Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+98
-18
@@ -7,6 +7,7 @@
|
||||
import React from "react";
|
||||
import { FeatherChevronsLeft } from "@subframe/core";
|
||||
import { FeatherChevronsRight } from "@subframe/core";
|
||||
import { FeatherLock } from "@subframe/core";
|
||||
import * as SubframeCore from "@subframe/core";
|
||||
import * as SubframeUtils from "../../utils";
|
||||
|
||||
@@ -18,6 +19,18 @@ export interface KanbanColumnRootProps
|
||||
icon?: React.ReactNode;
|
||||
badge?: React.ReactNode;
|
||||
cards?: React.ReactNode;
|
||||
sumMode?: "visible" | "locked" | "hidden";
|
||||
lockedSumSlot?: React.ReactNode;
|
||||
twoColumn?: boolean;
|
||||
wrapAfter?: number;
|
||||
/**
|
||||
* Local adjustment: the export draws the collapsed head with `cursor-pointer`
|
||||
* and a chevron but wires nothing to it, so a collapsed column could never be
|
||||
* opened again. With this callback the collapsed head IS the expand control.
|
||||
*/
|
||||
onToggleCollapse?: () => void;
|
||||
/** Accessible name of that expand control — the caller owns the copy. */
|
||||
expandLabel?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -32,16 +45,42 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
icon = <FeatherChevronsLeft />,
|
||||
badge,
|
||||
cards,
|
||||
sumMode = "hidden",
|
||||
lockedSumSlot,
|
||||
twoColumn = false,
|
||||
wrapAfter = 6,
|
||||
onToggleCollapse,
|
||||
expandLabel,
|
||||
className,
|
||||
...otherProps
|
||||
}: KanbanColumnRootProps,
|
||||
ref
|
||||
) {
|
||||
// Only the collapsed head is interactive: expanded, the same row holds the
|
||||
// kebab menu, and a click target around it would swallow its clicks.
|
||||
const expandProps =
|
||||
collapsed && onToggleCollapse
|
||||
? {
|
||||
role: "button" as const,
|
||||
tabIndex: 0,
|
||||
"aria-label": expandLabel,
|
||||
onClick: onToggleCollapse,
|
||||
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => {
|
||||
if (event.key === "Enter" || event.key === " ") {
|
||||
event.preventDefault();
|
||||
onToggleCollapse();
|
||||
}
|
||||
},
|
||||
}
|
||||
: {};
|
||||
return (
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"group/bbc08458 flex w-80 flex-col items-center gap-2 rounded-md border-2 border-solid border-border-default bg-surface-neutral-tertiary px-1.5 py-1.5 self-start",
|
||||
{ "h-full w-12 px-0": collapsed },
|
||||
"group/bbc08458 flex w-80 flex-col items-center gap-2 rounded-md border-2 border-solid border-border-default bg-surface-neutral-tertiary px-1.5 py-1.5 shrink-0 min-w-80 self-start",
|
||||
{
|
||||
"w-[680px] min-w-[680px]": twoColumn,
|
||||
"h-full w-12 px-0 min-w-12": collapsed,
|
||||
},
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
@@ -55,9 +94,14 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
>
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex w-full items-center justify-between px-1 pt-1.5 pb-1",
|
||||
{ "flex-col rounded-md py-3 cursor-pointer": collapsed }
|
||||
"flex w-full items-center justify-between px-1 pt-1.5 pb-1 gap-2",
|
||||
{
|
||||
"flex-col rounded-md py-3 cursor-pointer": collapsed,
|
||||
"hover:bg-surface-neutral-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-200":
|
||||
collapsed && Boolean(onToggleCollapse),
|
||||
}
|
||||
)}
|
||||
{...expandProps}
|
||||
>
|
||||
<FeatherChevronsRight
|
||||
className={SubframeUtils.twClassNames(
|
||||
@@ -71,12 +115,12 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
{ flex: collapsed }
|
||||
)}
|
||||
>
|
||||
<div className="flex h-0.5 w-full flex-none flex-col items-center gap-2 bg-[#e5e5e5]" />
|
||||
<div className="flex h-0.5 w-full flex-none flex-col items-center gap-2 bg-border-default" />
|
||||
</div>
|
||||
{name ? (
|
||||
<span
|
||||
className={SubframeUtils.twClassNames(
|
||||
"hidden text-body-small-semibold-150 font-body-small-semibold-150 text-text-neutral-primary [writing-mode:vertical-rl] rotate-180",
|
||||
"hidden break-words text-body-small-semibold-150 font-body-small-semibold-150 text-text-neutral-primary [writing-mode:vertical-rl] rotate-180",
|
||||
{ inline: collapsed }
|
||||
)}
|
||||
>
|
||||
@@ -84,14 +128,15 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
</span>
|
||||
) : null}
|
||||
<div
|
||||
className={SubframeUtils.twClassNames("flex items-center gap-2.5", {
|
||||
"flex-col px-1 py-1": collapsed,
|
||||
})}
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex min-w-[0px] items-center gap-2.5 grow shrink",
|
||||
{ "flex-col px-1 py-1": collapsed }
|
||||
)}
|
||||
>
|
||||
{name ? (
|
||||
<span
|
||||
className={SubframeUtils.twClassNames(
|
||||
"text-body-small-semibold-150 font-body-small-semibold-150 text-text-neutral-primary",
|
||||
"min-w-[0px] break-words text-body-small-semibold-150 font-body-small-semibold-150 text-text-neutral-primary",
|
||||
{ hidden: collapsed }
|
||||
)}
|
||||
>
|
||||
@@ -101,8 +146,13 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
{badge ? (
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex items-center gap-2.5",
|
||||
{ "px-1 py-2": collapsed }
|
||||
"flex items-center gap-2.5 shrink-0",
|
||||
{
|
||||
// Local adjustment: collapsed, the count reads sideways like
|
||||
// the stage name above it — horizontally it would either
|
||||
// widen the 48px rail or clip.
|
||||
"px-1 py-2 [writing-mode:vertical-rl] rotate-180": collapsed,
|
||||
}
|
||||
)}
|
||||
>
|
||||
{badge}
|
||||
@@ -110,12 +160,26 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
) : null}
|
||||
</div>
|
||||
<div
|
||||
className={SubframeUtils.twClassNames("flex items-center gap-4", {
|
||||
hidden: collapsed,
|
||||
})}
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex min-w-[0px] items-center gap-2 shrink-0",
|
||||
{ hidden: collapsed }
|
||||
)}
|
||||
>
|
||||
{sumMode === "locked" && lockedSumSlot ? (
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<FeatherLock className="text-body-extra-small-regular-0 font-body-extra-small-regular-0 text-icon-neutral-subtle" />
|
||||
<span className="whitespace-nowrap text-body-extra-small-regular-150 font-body-extra-small-regular-150 text-text-neutral-subtle">
|
||||
{lockedSumSlot}
|
||||
</span>
|
||||
</div>
|
||||
) : null}
|
||||
{price ? (
|
||||
<span className="text-body-small-regular-0 font-body-small-regular-0 text-text-neutral-tertiary">
|
||||
<span
|
||||
className={SubframeUtils.twClassNames(
|
||||
"hidden break-words text-body-small-regular-0 font-body-small-regular-0 text-text-neutral-tertiary",
|
||||
{ inline: sumMode === "visible" }
|
||||
)}
|
||||
>
|
||||
{price}
|
||||
</span>
|
||||
) : null}
|
||||
@@ -127,13 +191,29 @@ const KanbanColumnRoot = React.forwardRef<
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex h-0.5 w-full flex-none flex-col items-center gap-2 bg-[#e5e5e5]" />
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex h-0.5 w-full flex-none flex-col items-center gap-2 bg-border-default",
|
||||
{ hidden: collapsed }
|
||||
)}
|
||||
/>
|
||||
{cards ? (
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex w-full flex-col items-center gap-3 pb-2",
|
||||
{ hidden: collapsed }
|
||||
{
|
||||
"min-w-[0px] flex-none items-start grid grid-flow-col grid-rows-6 grid-cols-2 justify-items-stretch mobile:grid-flow-row mobile:grid-rows-none mobile:grid-cols-1":
|
||||
twoColumn,
|
||||
hidden: collapsed,
|
||||
}
|
||||
)}
|
||||
// Local adjustment: honor wrapAfter instead of the fixed grid-rows-6
|
||||
// from the Subframe export (inline style wins over the class).
|
||||
style={
|
||||
twoColumn
|
||||
? { gridTemplateRows: `repeat(${wrapAfter}, min-content)` }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{cards}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user