@designa8/vibedesign-stripe-deepseek-image-v1-85ea 0.2.0 → 0.2.1
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.cjs +76 -47
- package/dist/index.js +76 -47
- package/dist/styles.css +8 -2
- package/package.json +1 -1
- package/src/atoms/Icon/Icon.tsx +22 -8
- package/src/atoms/Input/Input.tsx +2 -2
- package/src/atoms/ProgressBar/ProgressBar.tsx +8 -3
- package/src/atoms/Sidebar/Sidebar.tsx +11 -0
- package/src/atoms/SidebarDesktop/SidebarDesktop.tsx +39 -10
- package/src/atoms/SidebarDesktop/preview.tsx +102 -28
- package/src/atoms/SidebarMobile/SidebarMobile.tsx +16 -4
- package/src/atoms/WorkspaceSwitcherDesktop/WorkspaceSwitcherDesktop.tsx +44 -19
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-stripe-deepseek-image-v1-85ea
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.2.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.2.1**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -226,10 +226,11 @@ var Icon = React.forwardRef(
|
|
|
226
226
|
...props
|
|
227
227
|
}, ref) => {
|
|
228
228
|
const glyph = ICON_REGISTRY[name];
|
|
229
|
-
const
|
|
229
|
+
const legacyNodes = (glyph.paths ?? []).map((d) => ({
|
|
230
230
|
tag: "path",
|
|
231
231
|
d
|
|
232
232
|
}));
|
|
233
|
+
const nodes = glyph.nodes ?? legacyNodes;
|
|
233
234
|
const px = typeof size === "number" ? size : SIZE_PX[size] ? SIZE_PX[size] : 20;
|
|
234
235
|
const classes = [TONE_CLASS[tone], "shrink-0", className].filter(Boolean).join(" ");
|
|
235
236
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1971,8 +1972,8 @@ var Input = import_react.default.forwardRef(
|
|
|
1971
1972
|
"shadow-sm transition duration-150 ease-out",
|
|
1972
1973
|
"placeholder:text-muted-soft",
|
|
1973
1974
|
SIZES[size],
|
|
1974
|
-
leadingIcon
|
|
1975
|
-
trailingIcon
|
|
1975
|
+
leadingIcon ? "pl-11" : void 0,
|
|
1976
|
+
trailingIcon ? "pr-11" : void 0,
|
|
1976
1977
|
!invalid && !showValid && !disabled && "border-hairline bg-surface text-ink hover:border-hairline-strong focus:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue",
|
|
1977
1978
|
showValid && "border-semantic-success bg-surface text-ink hover:border-semantic-success-strong focus:border-semantic-success-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-semantic-success/30",
|
|
1978
1979
|
invalid && !disabled && invalidFill && "border-semantic-error bg-semantic-error-soft text-semantic-error placeholder:text-semantic-error/70 hover:border-semantic-error-hover focus:border-semantic-error-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-semantic-error/30",
|
|
@@ -6344,7 +6345,9 @@ var ProgressBar = React39.forwardRef(
|
|
|
6344
6345
|
const hasSegments = variant === "stacked" && segments.length > 0;
|
|
6345
6346
|
const headline = hasSegments ? segmentTotal : value;
|
|
6346
6347
|
const percent = clampPercent(max > 0 ? headline / max * 100 : 0);
|
|
6347
|
-
const
|
|
6348
|
+
const fallbackValueText = `${formatAmount(headline)} of ${formatAmount(max)}`;
|
|
6349
|
+
const resolvedValueText = valueText ?? fallbackValueText;
|
|
6350
|
+
const announcedValueText = typeof resolvedValueText === "string" ? resolvedValueText : fallbackValueText;
|
|
6348
6351
|
const captionAlign = labelAlign === "left" ? "text-left" : "text-center";
|
|
6349
6352
|
const trackName = ariaLabel ?? (typeof label === "string" ? label : "Progress");
|
|
6350
6353
|
const track = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -6355,7 +6358,7 @@ var ProgressBar = React39.forwardRef(
|
|
|
6355
6358
|
"aria-valuemin": 0,
|
|
6356
6359
|
"aria-valuemax": 100,
|
|
6357
6360
|
"aria-valuenow": Math.round(percent),
|
|
6358
|
-
"aria-valuetext": hasSegments ?
|
|
6361
|
+
"aria-valuetext": hasSegments ? announcedValueText : void 0,
|
|
6359
6362
|
className: cn28(
|
|
6360
6363
|
"relative flex w-full overflow-hidden rounded-full bg-primary-soft",
|
|
6361
6364
|
trackHeight[size]
|
|
@@ -7854,9 +7857,10 @@ var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
|
7854
7857
|
var GAP4 = 8;
|
|
7855
7858
|
var GUTTER4 = 8;
|
|
7856
7859
|
var PANEL_MIN = 224;
|
|
7857
|
-
var
|
|
7860
|
+
var PANEL_MAX_HEIGHT = 300;
|
|
7858
7861
|
var ROW_CLASS = "cursor-pointer transition duration-150 ease-out hover:bg-surface-soft";
|
|
7859
7862
|
var cn37 = (...parts) => parts.filter(Boolean).join(" ");
|
|
7863
|
+
var clamp2 = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
7860
7864
|
var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesktop2({
|
|
7861
7865
|
label = "Switch workspace",
|
|
7862
7866
|
options = [],
|
|
@@ -7882,6 +7886,7 @@ var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesk
|
|
|
7882
7886
|
const [internalOpen, setInternalOpen] = React53.useState(false);
|
|
7883
7887
|
const isOpen = isOpenControlled ? open : internalOpen;
|
|
7884
7888
|
const [anchor, setAnchor] = React53.useState(null);
|
|
7889
|
+
const [hasOpened, setHasOpened] = React53.useState(isOpen);
|
|
7885
7890
|
const setOpen = React53.useCallback(
|
|
7886
7891
|
(next) => {
|
|
7887
7892
|
if (!isOpenControlled) setInternalOpen(next);
|
|
@@ -7891,22 +7896,24 @@ var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesk
|
|
|
7891
7896
|
);
|
|
7892
7897
|
const measure = React53.useCallback(() => {
|
|
7893
7898
|
const node = triggerRef.current;
|
|
7894
|
-
if (!node) return;
|
|
7899
|
+
if (!node) return false;
|
|
7895
7900
|
const box = node.getBoundingClientRect();
|
|
7896
|
-
|
|
7901
|
+
if (box.width === 0 && box.height === 0) return false;
|
|
7902
|
+
const viewportW = window.innerWidth;
|
|
7903
|
+
const viewportH = window.innerHeight;
|
|
7904
|
+
const width = clamp2(box.width, PANEL_MIN, Math.max(PANEL_MIN, viewportW - GUTTER4 * 2));
|
|
7905
|
+
const left = clamp2(box.left, GUTTER4, Math.max(GUTTER4, viewportW - width - GUTTER4));
|
|
7906
|
+
const below = viewportH - box.bottom - GAP4 - GUTTER4;
|
|
7897
7907
|
const above = box.top - GAP4 - GUTTER4;
|
|
7898
7908
|
const opensUp = below < 220 && above > below;
|
|
7899
|
-
const
|
|
7900
|
-
|
|
7901
|
-
|
|
7909
|
+
const maxHeight = clamp2(opensUp ? above : below, 120, PANEL_MAX_HEIGHT);
|
|
7910
|
+
const top = clamp2(
|
|
7911
|
+
opensUp ? box.top - GAP4 - maxHeight : box.bottom + GAP4,
|
|
7912
|
+
GUTTER4,
|
|
7913
|
+
Math.max(GUTTER4, viewportH - maxHeight - GUTTER4)
|
|
7902
7914
|
);
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
top: opensUp ? box.top - GAP4 : box.bottom + GAP4,
|
|
7906
|
-
left: Math.min(Math.max(GUTTER4, box.left), maxLeft),
|
|
7907
|
-
width,
|
|
7908
|
-
maxHeight: Math.min(Math.max(160, opensUp ? above : below), PANEL_MAX3)
|
|
7909
|
-
});
|
|
7915
|
+
setAnchor({ top, left, width, maxHeight });
|
|
7916
|
+
return true;
|
|
7910
7917
|
}, []);
|
|
7911
7918
|
React53.useEffect(() => {
|
|
7912
7919
|
if (!isOpen) return;
|
|
@@ -7954,10 +7961,10 @@ var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesk
|
|
|
7954
7961
|
"data-state": isOpen ? "open" : "closed",
|
|
7955
7962
|
style: {
|
|
7956
7963
|
position: "fixed",
|
|
7957
|
-
top: anchor?.top ??
|
|
7958
|
-
left: anchor?.left ??
|
|
7964
|
+
top: anchor?.top ?? GUTTER4,
|
|
7965
|
+
left: anchor?.left ?? GUTTER4,
|
|
7959
7966
|
width: anchor?.width ?? PANEL_MIN,
|
|
7960
|
-
maxHeight: anchor?.maxHeight ??
|
|
7967
|
+
maxHeight: anchor?.maxHeight ?? PANEL_MAX_HEIGHT,
|
|
7961
7968
|
overflowY: "auto",
|
|
7962
7969
|
zIndex: "var(--z-popover, 1300)"
|
|
7963
7970
|
},
|
|
@@ -8007,8 +8014,13 @@ var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesk
|
|
|
8007
8014
|
"aria-haspopup": "menu",
|
|
8008
8015
|
"aria-label": `${label}: ${selected?.label ?? ""}`,
|
|
8009
8016
|
onClick: () => {
|
|
8010
|
-
if (
|
|
8011
|
-
|
|
8017
|
+
if (isOpen) {
|
|
8018
|
+
setOpen(false);
|
|
8019
|
+
return;
|
|
8020
|
+
}
|
|
8021
|
+
if (!measure()) return;
|
|
8022
|
+
setHasOpened(true);
|
|
8023
|
+
setOpen(true);
|
|
8012
8024
|
},
|
|
8013
8025
|
trailing: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8014
8026
|
Icon,
|
|
@@ -8031,7 +8043,7 @@ var WorkspaceSwitcherDesktop = React53.forwardRef(function WorkspaceSwitcherDesk
|
|
|
8031
8043
|
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "truncate", children: selected?.label ?? "Select workspace" })
|
|
8032
8044
|
}
|
|
8033
8045
|
),
|
|
8034
|
-
typeof document === "undefined" ? null : (0, import_react_dom7.createPortal)(panel, document.body)
|
|
8046
|
+
typeof document === "undefined" || !hasOpened ? null : (0, import_react_dom7.createPortal)(panel, document.body)
|
|
8035
8047
|
]
|
|
8036
8048
|
}
|
|
8037
8049
|
);
|
|
@@ -10587,7 +10599,7 @@ var DEFAULT_BREAKDOWN = [
|
|
|
10587
10599
|
{ stars: 2, count: 3 },
|
|
10588
10600
|
{ stars: 1, count: 2 }
|
|
10589
10601
|
];
|
|
10590
|
-
var
|
|
10602
|
+
var clamp3 = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
10591
10603
|
var formatCount = (n) => n.toLocaleString("en-US");
|
|
10592
10604
|
var formatScore = (n) => Number.isInteger(n) ? n.toFixed(1) : n.toFixed(2);
|
|
10593
10605
|
var formatShare = (count, total) => {
|
|
@@ -10650,7 +10662,7 @@ var Stars = ({
|
|
|
10650
10662
|
const buttonRefs = React66.useRef([]);
|
|
10651
10663
|
const steps = Array.from({ length: max }, (_, index) => index + 1);
|
|
10652
10664
|
const move = (delta, from) => {
|
|
10653
|
-
const next =
|
|
10665
|
+
const next = clamp3(from + delta, 1, max);
|
|
10654
10666
|
onPick?.(next);
|
|
10655
10667
|
buttonRefs.current[next - 1]?.focus();
|
|
10656
10668
|
};
|
|
@@ -10664,7 +10676,7 @@ var Stars = ({
|
|
|
10664
10676
|
children: steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10665
10677
|
StarGlyph,
|
|
10666
10678
|
{
|
|
10667
|
-
fill:
|
|
10679
|
+
fill: clamp3(shown - (step - 1), 0, 1),
|
|
10668
10680
|
px
|
|
10669
10681
|
},
|
|
10670
10682
|
step
|
|
@@ -10719,7 +10731,7 @@ var Stars = ({
|
|
|
10719
10731
|
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10720
10732
|
StarGlyph,
|
|
10721
10733
|
{
|
|
10722
|
-
fill:
|
|
10734
|
+
fill: clamp3(shown - (step - 1), 0, 1),
|
|
10723
10735
|
px: PICK_PX[size]
|
|
10724
10736
|
}
|
|
10725
10737
|
)
|
|
@@ -11384,6 +11396,7 @@ var DEFAULT_ITEMS4 = [
|
|
|
11384
11396
|
}
|
|
11385
11397
|
];
|
|
11386
11398
|
var CHILD_INDENT = "pl-[calc(var(--spacing-base)+var(--spacing-md))] py-xxs";
|
|
11399
|
+
var STICKY_HEIGHT = "var(--sidebar-height, 100dvh)";
|
|
11387
11400
|
var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
11388
11401
|
const {
|
|
11389
11402
|
brand = "Acme",
|
|
@@ -11406,6 +11419,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11406
11419
|
collapsed,
|
|
11407
11420
|
defaultCollapsed = false,
|
|
11408
11421
|
onCollapsedChange,
|
|
11422
|
+
sticky = true,
|
|
11409
11423
|
children,
|
|
11410
11424
|
className,
|
|
11411
11425
|
...rest
|
|
@@ -11438,17 +11452,25 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11438
11452
|
"div",
|
|
11439
11453
|
{
|
|
11440
11454
|
ref,
|
|
11441
|
-
className: cn54(
|
|
11455
|
+
className: cn54(
|
|
11456
|
+
"flex w-full bg-canvas",
|
|
11457
|
+
sticky ? "items-start" : "items-stretch",
|
|
11458
|
+
className
|
|
11459
|
+
),
|
|
11442
11460
|
...rest,
|
|
11443
11461
|
children: [
|
|
11444
11462
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
11445
11463
|
"aside",
|
|
11446
11464
|
{
|
|
11447
11465
|
"aria-label": "Sidebar",
|
|
11448
|
-
style: {
|
|
11466
|
+
style: {
|
|
11467
|
+
width: isCollapsed ? RAIL_WIDTH_FOLDED : RAIL_WIDTH,
|
|
11468
|
+
...sticky ? { height: STICKY_HEIGHT } : null
|
|
11469
|
+
},
|
|
11449
11470
|
className: cn54(
|
|
11450
|
-
"relative shrink-0
|
|
11451
|
-
"transition-[width] duration-200 ease-out"
|
|
11471
|
+
"relative shrink-0 overflow-hidden border-r border-hairline bg-surface",
|
|
11472
|
+
"transition-[width] duration-200 ease-out",
|
|
11473
|
+
sticky ? "sticky top-0 self-start" : "self-stretch"
|
|
11452
11474
|
),
|
|
11453
11475
|
children: [
|
|
11454
11476
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
@@ -11461,7 +11483,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11461
11483
|
isCollapsed && "pointer-events-none invisible"
|
|
11462
11484
|
),
|
|
11463
11485
|
children: [
|
|
11464
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center justify-between px-base pb-md pt-base", children: [
|
|
11486
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex shrink-0 items-center justify-between px-base pb-md pt-base", children: [
|
|
11465
11487
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Logo, { size: "md", label: brand, href: brandHref }),
|
|
11466
11488
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11467
11489
|
IconButton,
|
|
@@ -11475,7 +11497,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11475
11497
|
}
|
|
11476
11498
|
)
|
|
11477
11499
|
] }),
|
|
11478
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "px-base pb-md", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11500
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "shrink-0 px-base pb-md", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11479
11501
|
WorkspaceSwitcherDesktop,
|
|
11480
11502
|
{
|
|
11481
11503
|
label: "Switch workspace",
|
|
@@ -11489,7 +11511,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11489
11511
|
"nav",
|
|
11490
11512
|
{
|
|
11491
11513
|
"aria-label": "Main navigation",
|
|
11492
|
-
className: "min-h-0 flex-1 overflow-y-auto px-sm pb-base",
|
|
11514
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-sm pb-base",
|
|
11493
11515
|
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("ul", { className: "flex flex-col gap-xs", children: items.map((item) => {
|
|
11494
11516
|
const hasChildren = Boolean(item.children?.length);
|
|
11495
11517
|
const isOpen = openGroups.includes(item.value);
|
|
@@ -11567,7 +11589,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11567
11589
|
}) })
|
|
11568
11590
|
}
|
|
11569
11591
|
),
|
|
11570
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "px-base pb-base", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "overflow-hidden rounded-lg bg-primary-soft", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11592
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "shrink-0 px-base pb-base", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "overflow-hidden rounded-lg bg-primary-soft", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11571
11593
|
Button,
|
|
11572
11594
|
{
|
|
11573
11595
|
type: "button",
|
|
@@ -11604,7 +11626,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11604
11626
|
] })
|
|
11605
11627
|
}
|
|
11606
11628
|
) }) }),
|
|
11607
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-sm border-t border-hairline px-base py-sm", children: [
|
|
11629
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex shrink-0 items-center gap-sm border-t border-hairline px-base py-sm", children: [
|
|
11608
11630
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11609
11631
|
Avatar,
|
|
11610
11632
|
{
|
|
@@ -11667,7 +11689,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11667
11689
|
"nav",
|
|
11668
11690
|
{
|
|
11669
11691
|
"aria-label": "Main navigation",
|
|
11670
|
-
className: "flex min-h-0 w-full flex-1 flex-col items-center gap-xs overflow-y-auto py-sm",
|
|
11692
|
+
className: "flex min-h-0 w-full flex-1 flex-col items-center gap-xs overflow-y-auto overscroll-contain py-sm",
|
|
11671
11693
|
children: items.map((item) => {
|
|
11672
11694
|
const isActive = !item.children && item.value === currentActive;
|
|
11673
11695
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
@@ -11693,7 +11715,7 @@ var SidebarDesktop = React70.forwardRef(function SidebarDesktop2(props, ref) {
|
|
|
11693
11715
|
}
|
|
11694
11716
|
),
|
|
11695
11717
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "aria-hidden": "true", className: "h-px w-xl shrink-0 bg-hairline" }),
|
|
11696
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex w-full flex-col items-center gap-xs pb-xxs", children: [
|
|
11718
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex w-full shrink-0 flex-col items-center gap-xs pb-xxs", children: [
|
|
11697
11719
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
11698
11720
|
Button,
|
|
11699
11721
|
{
|
|
@@ -11853,6 +11875,7 @@ var SidebarMobile = React71.forwardRef(
|
|
|
11853
11875
|
const isControlled = open !== void 0;
|
|
11854
11876
|
const [uncontrolled, setUncontrolled] = React71.useState(defaultOpen);
|
|
11855
11877
|
const isOpen = isControlled ? open : uncontrolled;
|
|
11878
|
+
const [hasOpened, setHasOpened] = React71.useState(isOpen);
|
|
11856
11879
|
const panelRef = React71.useRef(null);
|
|
11857
11880
|
const returnFocusRef = React71.useRef(null);
|
|
11858
11881
|
const [internalActive, setInternalActive] = React71.useState(defaultActiveItem);
|
|
@@ -11863,11 +11886,15 @@ var SidebarMobile = React71.forwardRef(
|
|
|
11863
11886
|
});
|
|
11864
11887
|
const setOpen = React71.useCallback(
|
|
11865
11888
|
(next) => {
|
|
11889
|
+
if (next) setHasOpened(true);
|
|
11866
11890
|
if (!isControlled) setUncontrolled(next);
|
|
11867
11891
|
onOpenChange?.(next);
|
|
11868
11892
|
},
|
|
11869
11893
|
[isControlled, onOpenChange]
|
|
11870
11894
|
);
|
|
11895
|
+
React71.useEffect(() => {
|
|
11896
|
+
if (isOpen) setHasOpened(true);
|
|
11897
|
+
}, [isOpen]);
|
|
11871
11898
|
React71.useEffect(() => {
|
|
11872
11899
|
if (!isOpen) return void 0;
|
|
11873
11900
|
const handleKeyDown = (event) => {
|
|
@@ -11899,7 +11926,7 @@ var SidebarMobile = React71.forwardRef(
|
|
|
11899
11926
|
);
|
|
11900
11927
|
};
|
|
11901
11928
|
const state = isOpen ? "open" : "closed";
|
|
11902
|
-
const drawer = typeof document === "undefined" ? null : (0, import_react_dom10.createPortal)(
|
|
11929
|
+
const drawer = typeof document === "undefined" || !hasOpened ? null : (0, import_react_dom10.createPortal)(
|
|
11903
11930
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
11904
11931
|
"div",
|
|
11905
11932
|
{
|
|
@@ -12187,6 +12214,7 @@ var Sidebar = React72.forwardRef(
|
|
|
12187
12214
|
collapsed,
|
|
12188
12215
|
defaultCollapsed = false,
|
|
12189
12216
|
onCollapsedChange,
|
|
12217
|
+
sticky = true,
|
|
12190
12218
|
open,
|
|
12191
12219
|
defaultOpen = false,
|
|
12192
12220
|
onOpenChange,
|
|
@@ -12237,6 +12265,7 @@ var Sidebar = React72.forwardRef(
|
|
|
12237
12265
|
SidebarDesktop,
|
|
12238
12266
|
{
|
|
12239
12267
|
...sharedProps,
|
|
12268
|
+
sticky,
|
|
12240
12269
|
collapsed,
|
|
12241
12270
|
defaultCollapsed,
|
|
12242
12271
|
onCollapsedChange
|
|
@@ -12266,7 +12295,7 @@ var RAIL = { sm: "h-0.5", md: "h-1" };
|
|
|
12266
12295
|
var HIT = { sm: "h-5", md: "h-6" };
|
|
12267
12296
|
var RING2 = { sm: "h-4 w-4", md: "h-5 w-5" };
|
|
12268
12297
|
var DOT = { sm: "h-3 w-3", md: "h-3.5 w-3.5" };
|
|
12269
|
-
function
|
|
12298
|
+
function clamp4(n, low, high) {
|
|
12270
12299
|
return Math.min(high, Math.max(low, n));
|
|
12271
12300
|
}
|
|
12272
12301
|
function cx5() {
|
|
@@ -12307,7 +12336,7 @@ var Slider = React73.forwardRef(
|
|
|
12307
12336
|
const trackRef = React73.useRef(null);
|
|
12308
12337
|
function ratioOf(raw) {
|
|
12309
12338
|
if (max === min) return 0;
|
|
12310
|
-
return (
|
|
12339
|
+
return (clamp4(raw, min, max) - min) / (max - min);
|
|
12311
12340
|
}
|
|
12312
12341
|
function percentOf(raw) {
|
|
12313
12342
|
return ratioOf(raw) * 100;
|
|
@@ -12317,8 +12346,8 @@ var Slider = React73.forwardRef(
|
|
|
12317
12346
|
if (props.onValueChange) props.onValueChange(next);
|
|
12318
12347
|
}
|
|
12319
12348
|
function commit(index, ratio) {
|
|
12320
|
-
const raw = min + (max - min) *
|
|
12321
|
-
const snapped =
|
|
12349
|
+
const raw = min + (max - min) * clamp4(ratio, 0, 1);
|
|
12350
|
+
const snapped = clamp4(
|
|
12322
12351
|
Math.round((raw - min) / step) * step + min,
|
|
12323
12352
|
min,
|
|
12324
12353
|
max
|
|
@@ -12450,7 +12479,7 @@ var Slider = React73.forwardRef(
|
|
|
12450
12479
|
disabled ? "bg-surface-strong" : "bg-primary-soft"
|
|
12451
12480
|
),
|
|
12452
12481
|
style: {
|
|
12453
|
-
height: Math.round(
|
|
12482
|
+
height: Math.round(clamp4(bar, 0.08, 1) * 100) + "%"
|
|
12454
12483
|
}
|
|
12455
12484
|
},
|
|
12456
12485
|
index
|
|
@@ -12565,7 +12594,7 @@ var RAIL_CLASS = {
|
|
|
12565
12594
|
error: "bg-hairline"
|
|
12566
12595
|
};
|
|
12567
12596
|
var RING_MASK = "radial-gradient(farthest-side, transparent calc(100% - 3px), var(--color-ink) calc(100% - 3px))";
|
|
12568
|
-
var
|
|
12597
|
+
var clamp5 = (value) => Math.min(100, Math.max(0, value));
|
|
12569
12598
|
var StepperItem = React74.forwardRef(
|
|
12570
12599
|
({
|
|
12571
12600
|
title,
|
|
@@ -12577,7 +12606,7 @@ var StepperItem = React74.forwardRef(
|
|
|
12577
12606
|
...rest
|
|
12578
12607
|
}, ref) => {
|
|
12579
12608
|
const isProgress = status === "progress";
|
|
12580
|
-
const pct =
|
|
12609
|
+
const pct = clamp5(progress);
|
|
12581
12610
|
const ringStyle = isProgress ? {
|
|
12582
12611
|
background: `conic-gradient(var(--color-primary) ${pct}%, var(--color-primary-soft) 0deg)`,
|
|
12583
12612
|
WebkitMaskImage: RING_MASK,
|