gridsmith-ui 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +172 -123
- package/dist/index.js.map +1 -1
- package/dist/roots.css +8 -8
- package/dist/tailwind.css +10 -8
- package/dist-static/tailwind.css +10 -8
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1051,8 +1051,10 @@ interface DrawerProps {
|
|
|
1051
1051
|
flush?: boolean;
|
|
1052
1052
|
/** Use a lighter backdrop (no blur, subtle dim). Use for compact overlays. */
|
|
1053
1053
|
lightBackdrop?: boolean;
|
|
1054
|
+
/** Offset the drawer from the top of its container. When set, the area above this offset remains visible and interactive (e.g. keeping a navbar accessible). */
|
|
1055
|
+
topOffset?: string;
|
|
1054
1056
|
}
|
|
1055
|
-
declare function Drawer({ open, onClose, position, width, title, children, footer, container, flush, lightBackdrop }: DrawerProps): react.ReactPortal | null;
|
|
1057
|
+
declare function Drawer({ open, onClose, position, width, title, children, footer, container, flush, lightBackdrop, topOffset }: DrawerProps): react.ReactPortal | null;
|
|
1056
1058
|
|
|
1057
1059
|
interface TooltipProps {
|
|
1058
1060
|
content: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -82103,9 +82103,9 @@ function Card({ variant = "default", loading = false, selected, selectable, onSe
|
|
|
82103
82103
|
children: [
|
|
82104
82104
|
selected && !loading && /* @__PURE__ */ jsx("div", { className: "absolute top-ds-3 right-ds-3 w-5 h-5 rounded-[var(--ds-radius-full)] bg-[var(--ds-accent-primary)] flex items-center justify-center", children: /* @__PURE__ */ jsx(Icon, { name: "check", size: 12, className: "text-[var(--ds-text-on-primary)]" }) }),
|
|
82105
82105
|
loading ? /* @__PURE__ */ jsxs("div", { className: "space-y-ds-3", children: [
|
|
82106
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/3" }),
|
|
82107
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-full" }),
|
|
82108
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-2/3" })
|
|
82106
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "custom", className: "h-4 w-1/3" }),
|
|
82107
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "custom", className: "h-3 w-full" }),
|
|
82108
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "custom", className: "h-3 w-2/3" })
|
|
82109
82109
|
] }) : children
|
|
82110
82110
|
]
|
|
82111
82111
|
}
|
|
@@ -82124,7 +82124,7 @@ function CardTitle({ className, children, ...props }) {
|
|
|
82124
82124
|
return /* @__PURE__ */ jsx(
|
|
82125
82125
|
"h3",
|
|
82126
82126
|
{
|
|
82127
|
-
className: cn("font-[family-name:var(--ds-font-display)] text-
|
|
82127
|
+
className: cn("font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] truncate", className),
|
|
82128
82128
|
...props,
|
|
82129
82129
|
children
|
|
82130
82130
|
}
|
|
@@ -82154,7 +82154,7 @@ function StatsCard({ value, label, trend, icon, layout = "card", interactive, on
|
|
|
82154
82154
|
{
|
|
82155
82155
|
"data-card": "",
|
|
82156
82156
|
className: cn(
|
|
82157
|
-
"flex flex-col p-ds-5",
|
|
82157
|
+
"flex flex-col p-ds-5 min-w-0",
|
|
82158
82158
|
"bg-[var(--ds-bg-surface)] rounded-[var(--ds-radius-md)]",
|
|
82159
82159
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
82160
82160
|
isInteractive ? [
|
|
@@ -82179,8 +82179,8 @@ function StatsCard({ value, label, trend, icon, layout = "card", interactive, on
|
|
|
82179
82179
|
}
|
|
82180
82180
|
} : void 0,
|
|
82181
82181
|
children: [
|
|
82182
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-ds-2", children: [
|
|
82183
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-[var(--ds-text-muted)] uppercase tracking-wider", children: label }),
|
|
82182
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-ds-2 min-w-0", children: [
|
|
82183
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-[var(--ds-text-muted)] uppercase tracking-wider truncate min-w-0", title: label, children: label }),
|
|
82184
82184
|
icon && /* @__PURE__ */ jsx("div", { className: "shrink-0 flex items-center justify-center w-8 h-8 rounded-[var(--ds-radius-sm)] bg-[var(--ds-bg-muted)]", children: /* @__PURE__ */ jsx(Icon, { name: icon, size: 16, className: "text-[var(--ds-text-muted)]" }) })
|
|
82185
82185
|
] }),
|
|
82186
82186
|
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-ds-2 mt-ds-2 flex-wrap", children: [
|
|
@@ -84137,50 +84137,50 @@ var dotVariant = {
|
|
|
84137
84137
|
warning: "bg-[var(--ds-status-warning)] shadow-[0_0_0_3px_var(--ds-status-warning)]/20",
|
|
84138
84138
|
error: "bg-[var(--ds-status-error)] shadow-[0_0_0_3px_var(--ds-status-error)]/20"
|
|
84139
84139
|
};
|
|
84140
|
-
function
|
|
84141
|
-
|
|
84142
|
-
|
|
84143
|
-
|
|
84144
|
-
|
|
84145
|
-
|
|
84146
|
-
/* @__PURE__ */
|
|
84147
|
-
|
|
84148
|
-
|
|
84149
|
-
|
|
84150
|
-
|
|
84151
|
-
|
|
84152
|
-
|
|
84153
|
-
|
|
84154
|
-
|
|
84155
|
-
|
|
84156
|
-
|
|
84157
|
-
|
|
84158
|
-
|
|
84159
|
-
|
|
84160
|
-
|
|
84161
|
-
|
|
84162
|
-
|
|
84163
|
-
|
|
84164
|
-
|
|
84165
|
-
|
|
84166
|
-
|
|
84167
|
-
|
|
84168
|
-
|
|
84169
|
-
|
|
84170
|
-
|
|
84171
|
-
|
|
84172
|
-
|
|
84173
|
-
|
|
84174
|
-
|
|
84175
|
-
/* @__PURE__ */
|
|
84176
|
-
|
|
84177
|
-
|
|
84178
|
-
|
|
84179
|
-
|
|
84180
|
-
|
|
84181
|
-
|
|
84182
|
-
|
|
84183
|
-
return /* @__PURE__ */ jsx("div", {
|
|
84140
|
+
function TimelineHorizontal({ items, className }) {
|
|
84141
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-start", className), children: items.map((item, i) => {
|
|
84142
|
+
const isFirst = i === 0;
|
|
84143
|
+
const isLast = i === items.length - 1;
|
|
84144
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col items-center min-w-[100px]", children: [
|
|
84145
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center w-full", children: [
|
|
84146
|
+
/* @__PURE__ */ jsx(
|
|
84147
|
+
"div",
|
|
84148
|
+
{
|
|
84149
|
+
className: cn(
|
|
84150
|
+
"flex-1 h-[2px] transition-colors",
|
|
84151
|
+
isFirst ? "bg-transparent" : "bg-[var(--ds-border-subtle)]"
|
|
84152
|
+
)
|
|
84153
|
+
}
|
|
84154
|
+
),
|
|
84155
|
+
/* @__PURE__ */ jsx(
|
|
84156
|
+
"div",
|
|
84157
|
+
{
|
|
84158
|
+
className: cn(
|
|
84159
|
+
"shrink-0 w-3 h-3 rounded-[var(--ds-radius-full)]",
|
|
84160
|
+
dotVariant[item.variant ?? "default"]
|
|
84161
|
+
)
|
|
84162
|
+
}
|
|
84163
|
+
),
|
|
84164
|
+
/* @__PURE__ */ jsx(
|
|
84165
|
+
"div",
|
|
84166
|
+
{
|
|
84167
|
+
className: cn(
|
|
84168
|
+
"flex-1 h-[2px] transition-colors",
|
|
84169
|
+
isLast ? "bg-transparent" : "bg-[var(--ds-border-subtle)]"
|
|
84170
|
+
)
|
|
84171
|
+
}
|
|
84172
|
+
)
|
|
84173
|
+
] }),
|
|
84174
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mt-ds-2 px-ds-3", children: [
|
|
84175
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--ds-text-primary)]", children: item.title }),
|
|
84176
|
+
item.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--ds-text-muted)] mt-ds-0.5", children: item.description }),
|
|
84177
|
+
item.timestamp && /* @__PURE__ */ jsx("p", { className: "text-2xs text-[var(--ds-text-muted)] mt-ds-0.5 tabular-nums", children: item.timestamp })
|
|
84178
|
+
] })
|
|
84179
|
+
] }, i);
|
|
84180
|
+
}) });
|
|
84181
|
+
}
|
|
84182
|
+
function TimelineVertical({ items, className }) {
|
|
84183
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-ds-4", children: [
|
|
84184
84184
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
84185
84185
|
/* @__PURE__ */ jsx(
|
|
84186
84186
|
"div",
|
|
@@ -84200,6 +84200,18 @@ function Timeline({ items, orientation = "vertical", className, ref }) {
|
|
|
84200
84200
|
] })
|
|
84201
84201
|
] }, i)) });
|
|
84202
84202
|
}
|
|
84203
|
+
function Timeline({ items, orientation = "vertical", className, ref }) {
|
|
84204
|
+
if (orientation === "horizontal") {
|
|
84205
|
+
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(TimelineHorizontal, { items }) });
|
|
84206
|
+
}
|
|
84207
|
+
if (orientation === "responsive") {
|
|
84208
|
+
return /* @__PURE__ */ jsxs("div", { ref, className, children: [
|
|
84209
|
+
/* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(TimelineHorizontal, { items }) }),
|
|
84210
|
+
/* @__PURE__ */ jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsx(TimelineVertical, { items }) })
|
|
84211
|
+
] });
|
|
84212
|
+
}
|
|
84213
|
+
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(TimelineVertical, { items }) });
|
|
84214
|
+
}
|
|
84203
84215
|
function CodeBlock2({
|
|
84204
84216
|
code,
|
|
84205
84217
|
language,
|
|
@@ -93500,6 +93512,7 @@ function VirtualizedList({
|
|
|
93500
93512
|
var StackedList = forwardRef(function StackedList2({
|
|
93501
93513
|
items,
|
|
93502
93514
|
divided = true,
|
|
93515
|
+
flush = false,
|
|
93503
93516
|
className
|
|
93504
93517
|
}, ref) {
|
|
93505
93518
|
return /* @__PURE__ */ jsx(
|
|
@@ -93515,14 +93528,14 @@ var StackedList = forwardRef(function StackedList2({
|
|
|
93515
93528
|
"div",
|
|
93516
93529
|
{
|
|
93517
93530
|
className: cn(
|
|
93518
|
-
"flex items-center gap-ds-3",
|
|
93531
|
+
"flex items-center gap-ds-3 py-ds-3",
|
|
93532
|
+
flush ? "px-0" : "px-ds-5",
|
|
93519
93533
|
item.onClick && [
|
|
93520
93534
|
"cursor-pointer transition-all duration-[var(--ds-interactive-hover-speed)] ease-[var(--ds-interactive-hover-ease)]",
|
|
93521
93535
|
"hover:bg-[var(--ds-bg-muted)]",
|
|
93522
93536
|
"rounded-[var(--ds-radius-md)]"
|
|
93523
93537
|
]
|
|
93524
93538
|
),
|
|
93525
|
-
style: { padding: "var(--ds-space-3) var(--ds-space-4)" },
|
|
93526
93539
|
onClick: item.onClick,
|
|
93527
93540
|
role: item.onClick ? "button" : void 0,
|
|
93528
93541
|
tabIndex: item.onClick ? 0 : void 0,
|
|
@@ -94266,6 +94279,13 @@ function collectInitialExpanded(items, prefix = "") {
|
|
|
94266
94279
|
function makeKey(label, parentKey) {
|
|
94267
94280
|
return parentKey ? `${parentKey}/${label}` : label;
|
|
94268
94281
|
}
|
|
94282
|
+
var FLYOUT_BRIDGE_PX = 12;
|
|
94283
|
+
function computeCompactFlyoutPos(anchorEl, itemsLength) {
|
|
94284
|
+
const rect = anchorEl.getBoundingClientRect();
|
|
94285
|
+
const flyoutHeight = itemsLength * 32 + 28;
|
|
94286
|
+
const top = Math.min(rect.top, window.innerHeight - flyoutHeight - 8);
|
|
94287
|
+
return { top: Math.max(8, top), left: rect.right - (FLYOUT_BRIDGE_PX - 4) };
|
|
94288
|
+
}
|
|
94269
94289
|
function CompactFlyout({
|
|
94270
94290
|
parentLabel,
|
|
94271
94291
|
items,
|
|
@@ -94276,12 +94296,9 @@ function CompactFlyout({
|
|
|
94276
94296
|
onMouseEnter,
|
|
94277
94297
|
onMouseLeave
|
|
94278
94298
|
}) {
|
|
94279
|
-
const [pos, setPos] = useState(
|
|
94280
|
-
|
|
94281
|
-
|
|
94282
|
-
const flyoutHeight = items.length * 32 + 28;
|
|
94283
|
-
const top = Math.min(rect.top, window.innerHeight - flyoutHeight - 8);
|
|
94284
|
-
setPos({ top: Math.max(8, top), left: rect.right + 4 });
|
|
94299
|
+
const [pos, setPos] = useState(() => computeCompactFlyoutPos(anchorEl, items.length));
|
|
94300
|
+
useLayoutEffect(() => {
|
|
94301
|
+
setPos(computeCompactFlyoutPos(anchorEl, items.length));
|
|
94285
94302
|
}, [anchorEl, items.length]);
|
|
94286
94303
|
useEffect(() => {
|
|
94287
94304
|
function handler(e) {
|
|
@@ -94290,44 +94307,47 @@ function CompactFlyout({
|
|
|
94290
94307
|
document.addEventListener("keydown", handler);
|
|
94291
94308
|
return () => document.removeEventListener("keydown", handler);
|
|
94292
94309
|
}, [onClose]);
|
|
94293
|
-
const content = /* @__PURE__ */
|
|
94310
|
+
const content = /* @__PURE__ */ jsx(
|
|
94294
94311
|
"div",
|
|
94295
94312
|
{
|
|
94296
|
-
role: "menu",
|
|
94297
94313
|
onMouseEnter,
|
|
94298
94314
|
onMouseLeave,
|
|
94299
|
-
className:
|
|
94300
|
-
|
|
94301
|
-
|
|
94302
|
-
"
|
|
94303
|
-
|
|
94304
|
-
|
|
94305
|
-
|
|
94306
|
-
|
|
94307
|
-
|
|
94308
|
-
|
|
94309
|
-
|
|
94310
|
-
{
|
|
94311
|
-
|
|
94312
|
-
|
|
94313
|
-
|
|
94314
|
-
|
|
94315
|
-
|
|
94316
|
-
|
|
94315
|
+
className: "fixed z-50",
|
|
94316
|
+
style: { top: pos.top, left: pos.left, paddingLeft: FLYOUT_BRIDGE_PX, pointerEvents: "auto" },
|
|
94317
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
94318
|
+
role: "menu",
|
|
94319
|
+
className: cn(
|
|
94320
|
+
"min-w-[160px] py-ds-1",
|
|
94321
|
+
"bg-[var(--ds-sidebar-bg)] rounded-[var(--ds-radius-md)]",
|
|
94322
|
+
"shadow-[var(--ds-shadow-dropdown)]",
|
|
94323
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]"
|
|
94324
|
+
),
|
|
94325
|
+
children: [
|
|
94326
|
+
/* @__PURE__ */ jsx("p", { className: "px-ds-2 pt-ds-1 pb-ds-1.5 text-2xs font-semibold uppercase tracking-wider text-[var(--ds-sidebar-text-muted)]", children: parentLabel }),
|
|
94327
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col px-ds-1", style: { gap: "var(--ds-space-0\\.5)" }, children: items.map((child, i) => /* @__PURE__ */ jsxs(
|
|
94328
|
+
"a",
|
|
94329
|
+
{
|
|
94330
|
+
href: child.href ?? "#",
|
|
94331
|
+
role: "menuitem",
|
|
94332
|
+
onClick: (e) => {
|
|
94333
|
+
e.preventDefault();
|
|
94334
|
+
onItemClick?.(child, i);
|
|
94335
|
+
onClose();
|
|
94336
|
+
},
|
|
94337
|
+
className: cn(
|
|
94338
|
+
"flex items-center gap-ds-2 px-ds-2 py-ds-1.5 text-xs rounded-[var(--ds-radius-sm)] transition-colors cursor-pointer",
|
|
94339
|
+
child.active ? "bg-sidebar-accent-subtle text-[var(--ds-sidebar-accent)] font-medium" : "text-[var(--ds-sidebar-text-secondary)] hover:bg-[var(--ds-sidebar-item-hover)] hover:text-[var(--ds-sidebar-text)]"
|
|
94340
|
+
),
|
|
94341
|
+
children: [
|
|
94342
|
+
child.icon && /* @__PURE__ */ jsx(Icon, { name: child.icon, size: 14 }),
|
|
94343
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: child.label }),
|
|
94344
|
+
child.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: child.badge })
|
|
94345
|
+
]
|
|
94317
94346
|
},
|
|
94318
|
-
|
|
94319
|
-
|
|
94320
|
-
|
|
94321
|
-
|
|
94322
|
-
children: [
|
|
94323
|
-
child.icon && /* @__PURE__ */ jsx(Icon, { name: child.icon, size: 14 }),
|
|
94324
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: child.label }),
|
|
94325
|
-
child.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: child.badge })
|
|
94326
|
-
]
|
|
94327
|
-
},
|
|
94328
|
-
child.label
|
|
94329
|
-
)) })
|
|
94330
|
-
]
|
|
94347
|
+
child.label
|
|
94348
|
+
)) })
|
|
94349
|
+
]
|
|
94350
|
+
})
|
|
94331
94351
|
}
|
|
94332
94352
|
);
|
|
94333
94353
|
return createPortal(content, portalContainer ?? document.body);
|
|
@@ -94361,6 +94381,8 @@ function SidebarNav({
|
|
|
94361
94381
|
() => new Set(collectInitialExpanded(allItems))
|
|
94362
94382
|
);
|
|
94363
94383
|
const [openFlyout, setOpenFlyout] = useState(null);
|
|
94384
|
+
const openFlyoutRef = useRef(null);
|
|
94385
|
+
const flyoutCloseTimer = useRef(null);
|
|
94364
94386
|
const toggleExpand = useCallback((key2) => {
|
|
94365
94387
|
setExpandedItems((prev) => {
|
|
94366
94388
|
const next = new Set(prev);
|
|
@@ -94369,7 +94391,31 @@ function SidebarNav({
|
|
|
94369
94391
|
return next;
|
|
94370
94392
|
});
|
|
94371
94393
|
}, []);
|
|
94372
|
-
const
|
|
94394
|
+
const cancelFlyoutClose = useCallback(() => {
|
|
94395
|
+
if (flyoutCloseTimer.current) {
|
|
94396
|
+
clearTimeout(flyoutCloseTimer.current);
|
|
94397
|
+
flyoutCloseTimer.current = null;
|
|
94398
|
+
}
|
|
94399
|
+
}, []);
|
|
94400
|
+
const closeFlyout = useCallback(() => {
|
|
94401
|
+
cancelFlyoutClose();
|
|
94402
|
+
setOpenFlyout(null);
|
|
94403
|
+
openFlyoutRef.current = null;
|
|
94404
|
+
}, [cancelFlyoutClose]);
|
|
94405
|
+
const openFlyoutFor = useCallback((key2) => {
|
|
94406
|
+
cancelFlyoutClose();
|
|
94407
|
+
setOpenFlyout(key2);
|
|
94408
|
+
openFlyoutRef.current = key2;
|
|
94409
|
+
}, [cancelFlyoutClose]);
|
|
94410
|
+
const scheduleFlyoutClose = useCallback((key2) => {
|
|
94411
|
+
cancelFlyoutClose();
|
|
94412
|
+
flyoutCloseTimer.current = setTimeout(() => {
|
|
94413
|
+
if (openFlyoutRef.current === key2) {
|
|
94414
|
+
setOpenFlyout(null);
|
|
94415
|
+
openFlyoutRef.current = null;
|
|
94416
|
+
}
|
|
94417
|
+
}, 400);
|
|
94418
|
+
}, [cancelFlyoutClose]);
|
|
94373
94419
|
const isCompact = sidebarType === "compact";
|
|
94374
94420
|
const isMinimal = sidebarType === "minimal";
|
|
94375
94421
|
function renderLeaf(item, depth, index) {
|
|
@@ -94423,8 +94469,11 @@ function SidebarNav({
|
|
|
94423
94469
|
hasChildren,
|
|
94424
94470
|
childActive,
|
|
94425
94471
|
isOpen,
|
|
94426
|
-
|
|
94472
|
+
flyoutKey: key2,
|
|
94473
|
+
onOpen: openFlyoutFor,
|
|
94427
94474
|
onClose: closeFlyout,
|
|
94475
|
+
onScheduleClose: scheduleFlyoutClose,
|
|
94476
|
+
onCancelClose: cancelFlyoutClose,
|
|
94428
94477
|
portalContainer,
|
|
94429
94478
|
onItemClick,
|
|
94430
94479
|
mobile,
|
|
@@ -94479,7 +94528,8 @@ function SidebarNav({
|
|
|
94479
94528
|
name: "chevron-right",
|
|
94480
94529
|
size: 12,
|
|
94481
94530
|
className: cn(
|
|
94482
|
-
"shrink-0 transition-transform
|
|
94531
|
+
"shrink-0 transition-transform",
|
|
94532
|
+
item.active || childActive ? "text-[var(--ds-sidebar-accent)]" : "text-[var(--ds-sidebar-text-muted)]",
|
|
94483
94533
|
isExpanded && "rotate-90"
|
|
94484
94534
|
)
|
|
94485
94535
|
}
|
|
@@ -94602,8 +94652,11 @@ function CompactNavItem({
|
|
|
94602
94652
|
hasChildren,
|
|
94603
94653
|
childActive,
|
|
94604
94654
|
isOpen,
|
|
94655
|
+
flyoutKey,
|
|
94605
94656
|
onOpen,
|
|
94606
94657
|
onClose,
|
|
94658
|
+
onScheduleClose,
|
|
94659
|
+
onCancelClose,
|
|
94607
94660
|
portalContainer,
|
|
94608
94661
|
onItemClick,
|
|
94609
94662
|
mobile,
|
|
@@ -94611,22 +94664,13 @@ function CompactNavItem({
|
|
|
94611
94664
|
onToggleExpand
|
|
94612
94665
|
}) {
|
|
94613
94666
|
const triggerRef = useRef(null);
|
|
94614
|
-
const closeTimer = useRef(null);
|
|
94615
|
-
const cancelClose = useCallback(() => {
|
|
94616
|
-
if (closeTimer.current) {
|
|
94617
|
-
clearTimeout(closeTimer.current);
|
|
94618
|
-
closeTimer.current = null;
|
|
94619
|
-
}
|
|
94620
|
-
}, []);
|
|
94621
|
-
const scheduleClose = useCallback(() => {
|
|
94622
|
-
cancelClose();
|
|
94623
|
-
closeTimer.current = setTimeout(onClose, 300);
|
|
94624
|
-
}, [onClose, cancelClose]);
|
|
94625
94667
|
const handleMouseEnter = useCallback(() => {
|
|
94626
|
-
|
|
94627
|
-
if (hasChildren && !isOpen) onOpen();
|
|
94628
|
-
}, [hasChildren, isOpen, onOpen,
|
|
94629
|
-
|
|
94668
|
+
onCancelClose();
|
|
94669
|
+
if (hasChildren && !isOpen) onOpen(flyoutKey);
|
|
94670
|
+
}, [hasChildren, isOpen, onOpen, onCancelClose, flyoutKey]);
|
|
94671
|
+
const handleMouseLeave = useCallback(() => {
|
|
94672
|
+
onScheduleClose(flyoutKey);
|
|
94673
|
+
}, [onScheduleClose, flyoutKey]);
|
|
94630
94674
|
const handleClick2 = () => {
|
|
94631
94675
|
if (mobile && hasChildren) {
|
|
94632
94676
|
onToggleExpand?.();
|
|
@@ -94640,7 +94684,7 @@ function CompactNavItem({
|
|
|
94640
94684
|
{
|
|
94641
94685
|
ref: triggerRef,
|
|
94642
94686
|
onMouseEnter: !mobile && hasChildren ? handleMouseEnter : void 0,
|
|
94643
|
-
onMouseLeave: !mobile && hasChildren && isOpen ?
|
|
94687
|
+
onMouseLeave: !mobile && hasChildren && isOpen ? handleMouseLeave : void 0,
|
|
94644
94688
|
onClick: handleClick2,
|
|
94645
94689
|
"aria-expanded": hasChildren ? mobile ? expanded : isOpen : void 0,
|
|
94646
94690
|
className: cn(
|
|
@@ -94663,7 +94707,8 @@ function CompactNavItem({
|
|
|
94663
94707
|
name: mobile ? "chevron-down" : "chevron-right",
|
|
94664
94708
|
size: 10,
|
|
94665
94709
|
className: cn(
|
|
94666
|
-
"absolute right-1 top-1/2 -translate-y-1/2
|
|
94710
|
+
"absolute right-1 top-1/2 -translate-y-1/2 transition-transform",
|
|
94711
|
+
item.active || childActive ? "text-[var(--ds-sidebar-accent)]" : "text-[var(--ds-sidebar-text-muted)]",
|
|
94667
94712
|
mobile && expanded && "rotate-180"
|
|
94668
94713
|
)
|
|
94669
94714
|
}
|
|
@@ -94680,8 +94725,8 @@ function CompactNavItem({
|
|
|
94680
94725
|
portalContainer,
|
|
94681
94726
|
onItemClick,
|
|
94682
94727
|
onClose,
|
|
94683
|
-
onMouseEnter:
|
|
94684
|
-
onMouseLeave:
|
|
94728
|
+
onMouseEnter: onCancelClose,
|
|
94729
|
+
onMouseLeave: handleMouseLeave
|
|
94685
94730
|
}
|
|
94686
94731
|
),
|
|
94687
94732
|
mobile && expanded && hasChildren && item.children && /* @__PURE__ */ jsx("div", { className: "w-full flex flex-col gap-ds-1 pb-ds-1", children: item.children.map((child, ci) => /* @__PURE__ */ jsxs(
|
|
@@ -95065,7 +95110,7 @@ var borderByPosition = {
|
|
|
95065
95110
|
left: "border-r-[length:var(--ds-border-width)] border-r-[var(--ds-border-default)]",
|
|
95066
95111
|
bottom: "border-t-[length:var(--ds-border-width)] border-t-[var(--ds-border-default)]"
|
|
95067
95112
|
};
|
|
95068
|
-
function Drawer({ open, onClose, position = "right", width = "400px", title, children, footer, container, flush, lightBackdrop }) {
|
|
95113
|
+
function Drawer({ open, onClose, position = "right", width = "400px", title, children, footer, container, flush, lightBackdrop, topOffset }) {
|
|
95069
95114
|
const titleId = useId();
|
|
95070
95115
|
const isMobile = useBreakpoint("sm");
|
|
95071
95116
|
const panelRef = useRef(null);
|
|
@@ -95101,9 +95146,11 @@ function Drawer({ open, onClose, position = "right", width = "400px", title, chi
|
|
|
95101
95146
|
"div",
|
|
95102
95147
|
{
|
|
95103
95148
|
className: cn(
|
|
95104
|
-
`${positionClass}
|
|
95149
|
+
`${positionClass} z-50 transition-opacity duration-[var(--ds-transition-speed)]`,
|
|
95150
|
+
topOffset ? "left-0 right-0 bottom-0" : "inset-0",
|
|
95105
95151
|
open ? "pointer-events-auto" : "pointer-events-none"
|
|
95106
95152
|
),
|
|
95153
|
+
style: topOffset ? { top: topOffset } : void 0,
|
|
95107
95154
|
onTransitionEnd: handleTransitionEnd,
|
|
95108
95155
|
children: [
|
|
95109
95156
|
/* @__PURE__ */ jsx(
|
|
@@ -95153,7 +95200,7 @@ function Drawer({ open, onClose, position = "right", width = "400px", title, chi
|
|
|
95153
95200
|
minHeight: "calc(var(--ds-space-unit) * 6 + 1.75rem + 2px + var(--ds-border-width))"
|
|
95154
95201
|
},
|
|
95155
95202
|
children: [
|
|
95156
|
-
/* @__PURE__ */ jsx("h2", { id: titleId, className: "text-
|
|
95203
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: "font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] truncate", children: title }),
|
|
95157
95204
|
/* @__PURE__ */ jsx(
|
|
95158
95205
|
"button",
|
|
95159
95206
|
{
|
|
@@ -95255,6 +95302,7 @@ var AppShell = forwardRef(function AppShell2({
|
|
|
95255
95302
|
container: shellRef.current ?? void 0,
|
|
95256
95303
|
flush: mobileMenuFlush,
|
|
95257
95304
|
lightBackdrop: mobileMenuLightBackdrop,
|
|
95305
|
+
topOffset: layout !== "stacked" && navbar != null ? "var(--ds-navbar-height)" : void 0,
|
|
95258
95306
|
children: mobileMenu
|
|
95259
95307
|
}
|
|
95260
95308
|
),
|
|
@@ -95315,12 +95363,13 @@ function getTypeClasses(type, active) {
|
|
|
95315
95363
|
);
|
|
95316
95364
|
}
|
|
95317
95365
|
}
|
|
95318
|
-
function HamburgerButton({ onClick, className: cls }) {
|
|
95366
|
+
function HamburgerButton({ onClick, open, className: cls }) {
|
|
95319
95367
|
return /* @__PURE__ */ jsx(
|
|
95320
95368
|
"button",
|
|
95321
95369
|
{
|
|
95322
95370
|
onClick,
|
|
95323
|
-
"aria-label": "
|
|
95371
|
+
"aria-label": open ? "Close navigation menu" : "Open navigation menu",
|
|
95372
|
+
"aria-expanded": open ?? void 0,
|
|
95324
95373
|
className: cn(
|
|
95325
95374
|
"flex items-center justify-center shrink-0",
|
|
95326
95375
|
"w-10 h-10 rounded-[var(--ds-radius-md)]",
|
|
@@ -95330,7 +95379,7 @@ function HamburgerButton({ onClick, className: cls }) {
|
|
|
95330
95379
|
"cursor-pointer",
|
|
95331
95380
|
cls
|
|
95332
95381
|
),
|
|
95333
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "menu", size: 20 })
|
|
95382
|
+
children: /* @__PURE__ */ jsx(Icon, { name: open ? "close" : "menu", size: 20 })
|
|
95334
95383
|
}
|
|
95335
95384
|
);
|
|
95336
95385
|
}
|
|
@@ -95378,7 +95427,7 @@ var Navbar = forwardRef(function Navbar2({
|
|
|
95378
95427
|
style: { padding: padStyle, gap: "var(--ds-space-4)" },
|
|
95379
95428
|
children: [
|
|
95380
95429
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-4", children: [
|
|
95381
|
-
showHamburger && /* @__PURE__ */ jsx(HamburgerButton, { onClick: handleHamburger }),
|
|
95430
|
+
showHamburger && /* @__PURE__ */ jsx(HamburgerButton, { onClick: handleHamburger, open: appShell?.sidebarOpen }),
|
|
95382
95431
|
logo && /* @__PURE__ */ jsx("div", { className: "flex items-center shrink-0", children: logo })
|
|
95383
95432
|
] }),
|
|
95384
95433
|
navLinks && !hideNavLinks ? /* @__PURE__ */ jsx(NavbarTypeContext.Provider, { value: type, children: /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-ds-1 min-w-0 overflow-x-clip justify-center", "data-navbar-type": type, children: navLinks }) }) : /* @__PURE__ */ jsx("div", {}),
|
|
@@ -95404,7 +95453,7 @@ var Navbar = forwardRef(function Navbar2({
|
|
|
95404
95453
|
),
|
|
95405
95454
|
style: { padding: padStyle, gap: "var(--ds-space-4)" },
|
|
95406
95455
|
children: [
|
|
95407
|
-
showHamburger && /* @__PURE__ */ jsx(HamburgerButton, { onClick: handleHamburger }),
|
|
95456
|
+
showHamburger && /* @__PURE__ */ jsx(HamburgerButton, { onClick: handleHamburger, open: appShell?.sidebarOpen }),
|
|
95408
95457
|
logo && /* @__PURE__ */ jsx("div", { className: "flex items-center shrink-0", children: logo }),
|
|
95409
95458
|
align === "right" && /* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
95410
95459
|
navLinks && !hideNavLinks && /* @__PURE__ */ jsx(NavbarTypeContext.Provider, { value: type, children: /* @__PURE__ */ jsx("nav", { className: cn("flex items-center gap-ds-1 min-w-0 overflow-x-clip", align === "left" && "flex-1"), "data-navbar-type": type, children: navLinks }) }),
|
|
@@ -96346,7 +96395,7 @@ function Sheet({ open, onClose, title, children, footer, snapPoints = [0.5, 0.92
|
|
|
96346
96395
|
className: "flex items-center justify-between shrink-0 border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
96347
96396
|
style: { padding: "var(--ds-space-2) var(--ds-space-5)" },
|
|
96348
96397
|
children: [
|
|
96349
|
-
/* @__PURE__ */ jsx("h2", { id: titleId, className: "text-
|
|
96398
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: "font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] truncate", children: title }),
|
|
96350
96399
|
/* @__PURE__ */ jsx(
|
|
96351
96400
|
"button",
|
|
96352
96401
|
{
|