@devalok/shilp-sutra 0.18.0 → 0.18.2
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/dist/_chunks/motion-provider.js +24 -0
- package/dist/_chunks/primitives.js +101 -101
- package/dist/_chunks/tree-view.js +12 -12
- package/dist/_chunks/use-calendar.js +1 -1
- package/dist/_chunks/vendor-utils.js +2 -2
- package/dist/composed/activity-feed.js +21 -21
- package/dist/composed/avatar-group.js +25 -25
- package/dist/composed/command-palette.js +3 -3
- package/dist/composed/confirm-dialog.js +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/empty-state.js +2 -2
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +10 -10
- package/dist/composed/lib/string-utils.d.ts +0 -1
- package/dist/composed/lib/string-utils.js +0 -1
- package/dist/composed/loading-skeleton.js +1 -1
- package/dist/composed/member-picker.js +6 -6
- package/dist/composed/page-header.js +1 -1
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +1 -1
- package/dist/composed/schedule-view.js +15 -15
- package/dist/composed/simple-tooltip.js +8 -8
- package/dist/composed/status-badge.js +12 -12
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +8 -6
- package/dist/motion/primitives-index.js +184 -8
- package/dist/shell/app-command-palette.js +1 -1
- package/dist/shell/bottom-navbar.js +3 -3
- package/dist/shell/notification-center.js +35 -35
- package/dist/shell/notification-preferences.js +29 -28
- package/dist/shell/sidebar.js +56 -56
- package/dist/shell/top-bar.js +25 -25
- package/dist/ui/accordion.js +11 -11
- package/dist/ui/alert-dialog.js +41 -41
- package/dist/ui/alert.js +10 -10
- package/dist/ui/aspect-ratio.js +5 -5
- package/dist/ui/autocomplete.js +15 -15
- package/dist/ui/avatar.js +4 -4
- package/dist/ui/badge.js +11 -11
- package/dist/ui/banner.js +3 -3
- package/dist/ui/breadcrumb.js +8 -8
- package/dist/ui/button-group.js +4 -4
- package/dist/ui/button.js +25 -25
- package/dist/ui/card.js +5 -5
- package/dist/ui/charts/index.js +4 -4
- package/dist/ui/checkbox.js +4 -4
- package/dist/ui/chip.js +14 -14
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +7 -7
- package/dist/ui/color-input.js +1 -1
- package/dist/ui/combobox.js +5 -5
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +4 -4
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +55 -55
- package/dist/ui/dialog.js +3 -3
- package/dist/ui/dropdown-menu.js +3 -3
- package/dist/ui/file-upload.js +10 -10
- package/dist/ui/form.js +1 -1
- package/dist/ui/hover-card.js +12 -12
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +322 -516
- package/dist/ui/input-otp.js +4 -4
- package/dist/ui/input.js +9 -9
- package/dist/ui/label.js +9 -9
- package/dist/ui/lib/date-utils.d.ts +0 -1
- package/dist/{_chunks → ui/lib}/date-utils.js +1 -2
- package/dist/{_chunks/motion2.js → ui/lib/motion.js} +13 -14
- package/dist/ui/lib/use-ripple.d.ts.map +1 -1
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/link.js +1 -1
- package/dist/ui/menubar.js +66 -66
- package/dist/ui/navigation-menu.js +4 -4
- package/dist/ui/number-input.js +9 -9
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.js +18 -18
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.js +11 -11
- package/dist/ui/search-input.js +2 -2
- package/dist/ui/segmented-control.d.ts +2 -0
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +59 -55
- package/dist/ui/select.js +19 -19
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.js +10 -10
- package/dist/ui/sidebar.js +574 -38
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.js +9 -9
- package/dist/ui/spinner.js +2 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +35 -35
- package/dist/ui/stepper.d.ts +1 -3
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +74 -74
- package/dist/ui/switch.js +7 -7
- package/dist/ui/table.js +28 -28
- package/dist/ui/tabs.js +10 -10
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.js +10 -10
- package/dist/ui/toast.js +12 -12
- package/dist/ui/toaster.js +11 -11
- package/dist/ui/toggle-group.js +2 -2
- package/dist/ui/toggle.js +8 -8
- package/dist/ui/tooltip.js +21 -21
- package/dist/ui/visually-hidden.js +3 -3
- package/docs/components/_header.md +83 -0
- package/docs/components/composed/activity-feed.md +43 -0
- package/docs/components/composed/avatar-group.md +32 -0
- package/docs/components/composed/command-palette.md +40 -0
- package/docs/components/composed/confirm-dialog.md +46 -0
- package/docs/components/composed/content-card.md +36 -0
- package/docs/components/composed/date-picker.md +130 -0
- package/docs/components/composed/empty-state.md +53 -0
- package/docs/components/composed/error-boundary.md +29 -0
- package/docs/components/composed/global-loading.md +27 -0
- package/docs/components/composed/loading-skeleton.md +51 -0
- package/docs/components/composed/member-picker.md +35 -0
- package/docs/components/composed/page-header.md +41 -0
- package/docs/components/composed/page-skeletons.md +32 -0
- package/docs/components/composed/priority-indicator.md +32 -0
- package/docs/components/composed/rich-text-editor.md +71 -0
- package/docs/components/composed/schedule-view.md +39 -0
- package/docs/components/composed/simple-tooltip.md +33 -0
- package/docs/components/composed/status-badge.md +41 -0
- package/docs/components/shell/app-command-palette.md +44 -0
- package/docs/components/shell/bottom-navbar.md +48 -0
- package/docs/components/shell/command-registry.md +48 -0
- package/docs/components/shell/link-context.md +41 -0
- package/docs/components/shell/notification-center.md +63 -0
- package/docs/components/shell/notification-preferences.md +42 -0
- package/docs/components/shell/sidebar.md +88 -0
- package/docs/components/shell/top-bar.md +63 -0
- package/docs/components/ui/accordion.md +48 -0
- package/docs/components/ui/alert-dialog.md +58 -0
- package/docs/components/ui/alert.md +43 -0
- package/docs/components/ui/aspect-ratio.md +25 -0
- package/docs/components/ui/autocomplete.md +48 -0
- package/docs/components/ui/avatar.md +34 -0
- package/docs/components/ui/badge.md +48 -0
- package/docs/components/ui/banner.md +35 -0
- package/docs/components/ui/breadcrumb.md +37 -0
- package/docs/components/ui/button-group.md +32 -0
- package/docs/components/ui/button.md +55 -0
- package/docs/components/ui/card.md +48 -0
- package/docs/components/ui/charts.md +43 -0
- package/docs/components/ui/checkbox.md +31 -0
- package/docs/components/ui/chip.md +43 -0
- package/docs/components/ui/code.md +28 -0
- package/docs/components/ui/collapsible.md +40 -0
- package/docs/components/ui/color-input.md +37 -0
- package/docs/components/ui/combobox.md +54 -0
- package/docs/components/ui/container.md +26 -0
- package/docs/components/ui/context-menu.md +43 -0
- package/docs/components/ui/data-table-toolbar.md +44 -0
- package/docs/components/ui/data-table.md +91 -0
- package/docs/components/ui/dialog.md +51 -0
- package/docs/components/ui/dropdown-menu.md +45 -0
- package/docs/components/ui/file-upload.md +41 -0
- package/docs/components/ui/form.md +51 -0
- package/docs/components/ui/hover-card.md +32 -0
- package/docs/components/ui/icon-button.md +33 -0
- package/docs/components/ui/input-otp.md +44 -0
- package/docs/components/ui/input.md +48 -0
- package/docs/components/ui/label.md +25 -0
- package/docs/components/ui/link.md +29 -0
- package/docs/components/ui/menubar.md +44 -0
- package/docs/components/ui/navigation-menu.md +46 -0
- package/docs/components/ui/number-input.md +44 -0
- package/docs/components/ui/pagination.md +48 -0
- package/docs/components/ui/popover.md +30 -0
- package/docs/components/ui/progress.md +29 -0
- package/docs/components/ui/radio.md +34 -0
- package/docs/components/ui/search-input.md +43 -0
- package/docs/components/ui/segmented-control.md +50 -0
- package/docs/components/ui/select.md +49 -0
- package/docs/components/ui/separator.md +29 -0
- package/docs/components/ui/sheet.md +47 -0
- package/docs/components/ui/sidebar.md +72 -0
- package/docs/components/ui/skeleton.md +77 -0
- package/docs/components/ui/slider.md +29 -0
- package/docs/components/ui/spinner.md +50 -0
- package/docs/components/ui/stack.md +39 -0
- package/docs/components/ui/stat-card.md +61 -0
- package/docs/components/ui/stepper.md +49 -0
- package/docs/components/ui/switch.md +34 -0
- package/docs/components/ui/table.md +47 -0
- package/docs/components/ui/tabs.md +56 -0
- package/docs/components/ui/text.md +37 -0
- package/docs/components/ui/textarea.md +39 -0
- package/docs/components/ui/toast.md +65 -0
- package/docs/components/ui/toaster.md +47 -0
- package/docs/components/ui/toggle-group.md +43 -0
- package/docs/components/ui/toggle.md +37 -0
- package/docs/components/ui/tooltip.md +33 -0
- package/docs/components/ui/tree-view.md +65 -0
- package/docs/components/ui/visually-hidden.md +21 -0
- package/llms-full.txt +3384 -1591
- package/llms.txt +4 -4
- package/package.json +28 -3
- package/dist/_chunks/avatar.js +0 -52
- package/dist/_chunks/button-group.js +0 -27
- package/dist/_chunks/button.js +0 -113
- package/dist/_chunks/card.js +0 -50
- package/dist/_chunks/checkbox.js +0 -16
- package/dist/_chunks/form.js +0 -27
- package/dist/_chunks/sidebar.js +0 -606
- package/dist/_chunks/spinner.js +0 -64
- package/dist/_chunks/tooltip.js +0 -30
- package/dist/_chunks/utils.js +0 -17
- package/dist/motion/motion-provider.js +0 -24
- package/dist/motion/primitives.js +0 -187
- /package/dist/_chunks/{motion.js → framer.js} +0 -0
package/dist/_chunks/sidebar.js
DELETED
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as s, jsxs as h, Fragment as G } from "react/jsx-runtime";
|
|
3
|
-
import { bb as k, S as w } from "./primitives.js";
|
|
4
|
-
import { ag as z } from "./vendor-utils.js";
|
|
5
|
-
import { IconLayoutSidebarLeftCollapse as q } from "@tabler/icons-react";
|
|
6
|
-
import { useIsMobile as L } from "../hooks/use-mobile.js";
|
|
7
|
-
import { m as j, s as H } from "./motion2.js";
|
|
8
|
-
import { c as i } from "./utils.js";
|
|
9
|
-
import { B as K } from "./button.js";
|
|
10
|
-
import * as B from "react";
|
|
11
|
-
import { createContext as F, forwardRef as o, useState as _, useCallback as C, useEffect as V, useMemo as E, useContext as P } from "react";
|
|
12
|
-
import { u as $ } from "./form.js";
|
|
13
|
-
import { m as T } from "./motion.js";
|
|
14
|
-
import { Sheet as W, SheetContent as U } from "../ui/sheet.js";
|
|
15
|
-
import { Skeleton as I } from "../ui/skeleton.js";
|
|
16
|
-
import { T as X, a as Y, b as J, c as Q } from "./tooltip.js";
|
|
17
|
-
const Z = z([
|
|
18
|
-
"flex w-full font-sans",
|
|
19
|
-
"bg-surface-3 text-surface-fg",
|
|
20
|
-
"border border-surface-border rounded-ds-md",
|
|
21
|
-
"placeholder:text-surface-fg-subtle",
|
|
22
|
-
"hover:bg-surface-4",
|
|
23
|
-
"transition-colors duration-fast-01",
|
|
24
|
-
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-7 focus-visible:border-surface-border",
|
|
25
|
-
"disabled:cursor-not-allowed disabled:opacity-action-disabled",
|
|
26
|
-
"read-only:bg-surface-2 read-only:cursor-default"
|
|
27
|
-
], {
|
|
28
|
-
variants: {
|
|
29
|
-
size: {
|
|
30
|
-
sm: "h-ds-sm text-ds-sm px-ds-03",
|
|
31
|
-
md: "h-ds-md text-ds-md px-ds-04",
|
|
32
|
-
lg: "h-ds-lg text-ds-md px-ds-05"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: { size: "md" }
|
|
36
|
-
}), R = B.forwardRef(({ className: a, type: e, state: t, size: d, startIcon: r, endIcon: n, ...c }, p) => {
|
|
37
|
-
const l = $(), u = t ?? (l.state === "helper" ? void 0 : l.state), f = c["aria-describedby"] ?? l.helperTextId, v = c["aria-required"] ?? l.required, g = s(T.input, { type: e, className: i(Z({ size: d }), r && "pl-ds-07", n && "pr-ds-07", u === "error" && "border-error-7 focus-visible:ring-error-7", u === "warning" && "border-warning-7 focus-visible:ring-warning-7", u === "success" && "border-success-7 focus-visible:ring-success-7", a), "aria-invalid": u === "error" || void 0, "aria-describedby": f, "aria-required": v || void 0, ref: p, ...j(c) });
|
|
38
|
-
return !r && !n ? g : h("div", { className: "relative flex items-center w-full", children: [r && s("span", { className: "absolute left-ds-03 flex items-center text-surface-fg-muted pointer-events-none [&>svg]:h-ico-sm [&>svg]:w-ico-sm", children: r }), g, n && s("span", { className: "absolute right-ds-03 flex items-center text-surface-fg-muted pointer-events-none [&>svg]:h-ico-sm [&>svg]:w-ico-sm", children: n })] });
|
|
39
|
-
});
|
|
40
|
-
R.displayName = "Input";
|
|
41
|
-
const D = B.forwardRef(({ className: a, orientation: e = "horizontal", decorative: t = !0, ...d }, r) => s(k, { ref: r, decorative: t, orientation: e, className: i("shrink-0 bg-surface-border", e === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", a), ...d }));
|
|
42
|
-
D.displayName = k.displayName;
|
|
43
|
-
const ee = "sidebar:state", ae = 60 * 60 * 24 * 7, te = "16rem", se = "18rem", re = "3rem", ie = "b", A = F(null);
|
|
44
|
-
function N() {
|
|
45
|
-
const a = P(A);
|
|
46
|
-
if (!a)
|
|
47
|
-
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
48
|
-
return a;
|
|
49
|
-
}
|
|
50
|
-
const de = o(
|
|
51
|
-
({
|
|
52
|
-
defaultOpen: a = !0,
|
|
53
|
-
open: e,
|
|
54
|
-
onOpenChange: t,
|
|
55
|
-
className: d,
|
|
56
|
-
style: r,
|
|
57
|
-
children: n,
|
|
58
|
-
...c
|
|
59
|
-
}, p) => {
|
|
60
|
-
const l = L(), [u, f] = _(!1), [v, g] = _(a), x = e ?? v, S = C(
|
|
61
|
-
(m) => {
|
|
62
|
-
const b = typeof m == "function" ? m(x) : m;
|
|
63
|
-
t ? t(b) : g(b), document.cookie = `${ee}=${b}; path=/; max-age=${ae}`;
|
|
64
|
-
},
|
|
65
|
-
[t, x]
|
|
66
|
-
), y = C(() => l ? f((m) => !m) : S((m) => !m), [l, S, f]);
|
|
67
|
-
V(() => {
|
|
68
|
-
const m = (b) => {
|
|
69
|
-
b.key === ie && (b.metaKey || b.ctrlKey) && (b.preventDefault(), y());
|
|
70
|
-
};
|
|
71
|
-
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
72
|
-
}, [y]);
|
|
73
|
-
const M = x ? "expanded" : "collapsed", O = E(
|
|
74
|
-
() => ({
|
|
75
|
-
state: M,
|
|
76
|
-
open: x,
|
|
77
|
-
setOpen: S,
|
|
78
|
-
isMobile: l,
|
|
79
|
-
openMobile: u,
|
|
80
|
-
setOpenMobile: f,
|
|
81
|
-
toggleSidebar: y
|
|
82
|
-
}),
|
|
83
|
-
[
|
|
84
|
-
M,
|
|
85
|
-
x,
|
|
86
|
-
S,
|
|
87
|
-
l,
|
|
88
|
-
u,
|
|
89
|
-
f,
|
|
90
|
-
y
|
|
91
|
-
]
|
|
92
|
-
);
|
|
93
|
-
return /* @__PURE__ */ s(A.Provider, { value: O, children: /* @__PURE__ */ s(X, { delayDuration: 0, children: /* @__PURE__ */ s(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
style: {
|
|
97
|
-
"--sidebar-width": te,
|
|
98
|
-
"--sidebar-width-icon": re,
|
|
99
|
-
...r
|
|
100
|
-
},
|
|
101
|
-
className: i(
|
|
102
|
-
"group/sidebar-wrapper flex min-h-svh has-[[data-variant=inset]]:bg-surface-1",
|
|
103
|
-
d
|
|
104
|
-
),
|
|
105
|
-
ref: p,
|
|
106
|
-
...c,
|
|
107
|
-
children: n
|
|
108
|
-
}
|
|
109
|
-
) }) });
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
de.displayName = "SidebarProvider";
|
|
113
|
-
const oe = o(
|
|
114
|
-
({
|
|
115
|
-
side: a = "left",
|
|
116
|
-
variant: e = "sidebar",
|
|
117
|
-
collapsible: t = "offcanvas",
|
|
118
|
-
className: d,
|
|
119
|
-
children: r,
|
|
120
|
-
...n
|
|
121
|
-
}, c) => {
|
|
122
|
-
const { isMobile: p, state: l, openMobile: u, setOpenMobile: f } = N();
|
|
123
|
-
return t === "none" ? /* @__PURE__ */ s(
|
|
124
|
-
"div",
|
|
125
|
-
{
|
|
126
|
-
className: i(
|
|
127
|
-
"flex h-full w-[--sidebar-width] flex-col bg-surface-1 text-surface-fg",
|
|
128
|
-
d
|
|
129
|
-
),
|
|
130
|
-
ref: c,
|
|
131
|
-
...n,
|
|
132
|
-
children: r
|
|
133
|
-
}
|
|
134
|
-
) : p ? /* @__PURE__ */ s(W, { open: u, onOpenChange: f, ...n, children: /* @__PURE__ */ s(
|
|
135
|
-
U,
|
|
136
|
-
{
|
|
137
|
-
"data-sidebar": "sidebar",
|
|
138
|
-
"data-mobile": "true",
|
|
139
|
-
className: "w-[--sidebar-width] bg-surface-1 p-0 text-surface-fg [&>button]:hidden",
|
|
140
|
-
style: {
|
|
141
|
-
"--sidebar-width": se
|
|
142
|
-
},
|
|
143
|
-
side: a,
|
|
144
|
-
children: /* @__PURE__ */ s("div", { className: "flex h-full w-full flex-col", children: r })
|
|
145
|
-
}
|
|
146
|
-
) }) : /* @__PURE__ */ h(
|
|
147
|
-
"div",
|
|
148
|
-
{
|
|
149
|
-
ref: c,
|
|
150
|
-
className: "group peer hidden text-surface-fg md:block",
|
|
151
|
-
"data-state": l,
|
|
152
|
-
"data-collapsible": l === "collapsed" ? t : "",
|
|
153
|
-
"data-variant": e,
|
|
154
|
-
"data-side": a,
|
|
155
|
-
children: [
|
|
156
|
-
/* @__PURE__ */ s(
|
|
157
|
-
"div",
|
|
158
|
-
{
|
|
159
|
-
className: i(
|
|
160
|
-
"relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-moderate-02 ease-linear",
|
|
161
|
-
"group-data-[collapsible=offcanvas]:w-0",
|
|
162
|
-
"group-data-[side=right]:rotate-180",
|
|
163
|
-
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
164
|
-
)
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
/* @__PURE__ */ s(
|
|
168
|
-
"div",
|
|
169
|
-
{
|
|
170
|
-
className: i(
|
|
171
|
-
"fixed inset-y-0 z-raised hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-moderate-02 ease-linear md:flex",
|
|
172
|
-
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
173
|
-
e === "floating" || e === "inset" ? "p-ds-03 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
174
|
-
d
|
|
175
|
-
),
|
|
176
|
-
...n,
|
|
177
|
-
children: /* @__PURE__ */ s(
|
|
178
|
-
"div",
|
|
179
|
-
{
|
|
180
|
-
"data-sidebar": "sidebar",
|
|
181
|
-
className: "flex h-full w-full flex-col bg-surface-1 group-data-[variant=floating]:rounded-ds-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-surface-border group-data-[variant=floating]:shadow",
|
|
182
|
-
children: r
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
oe.displayName = "Sidebar";
|
|
193
|
-
const ne = o(({ className: a, onClick: e, ...t }, d) => {
|
|
194
|
-
const { toggleSidebar: r } = N();
|
|
195
|
-
return /* @__PURE__ */ h(
|
|
196
|
-
K,
|
|
197
|
-
{
|
|
198
|
-
ref: d,
|
|
199
|
-
"data-sidebar": "trigger",
|
|
200
|
-
variant: "ghost",
|
|
201
|
-
size: "icon-md",
|
|
202
|
-
className: i("h-ds-xs-plus w-ds-xs-plus", a),
|
|
203
|
-
onClick: (n) => {
|
|
204
|
-
e == null || e(n), r();
|
|
205
|
-
},
|
|
206
|
-
...t,
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ s(q, {}),
|
|
209
|
-
/* @__PURE__ */ s("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
});
|
|
214
|
-
ne.displayName = "SidebarTrigger";
|
|
215
|
-
const le = o(
|
|
216
|
-
({ className: a, ...e }, t) => {
|
|
217
|
-
const { toggleSidebar: d } = N();
|
|
218
|
-
return /* @__PURE__ */ s(
|
|
219
|
-
"button",
|
|
220
|
-
{
|
|
221
|
-
ref: t,
|
|
222
|
-
"data-sidebar": "rail",
|
|
223
|
-
"aria-label": "Toggle Sidebar",
|
|
224
|
-
tabIndex: -1,
|
|
225
|
-
onClick: d,
|
|
226
|
-
title: "Toggle Sidebar",
|
|
227
|
-
className: i(
|
|
228
|
-
"hover:after:bg-surface-border-strong absolute inset-y-0 z-raised hidden w-4 -translate-x-1/2 transition-colors ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
229
|
-
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
230
|
-
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
231
|
-
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-surface-2",
|
|
232
|
-
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
233
|
-
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
234
|
-
a
|
|
235
|
-
),
|
|
236
|
-
...e
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
le.displayName = "SidebarRail";
|
|
242
|
-
const ce = o(
|
|
243
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
244
|
-
"main",
|
|
245
|
-
{
|
|
246
|
-
ref: t,
|
|
247
|
-
className: i(
|
|
248
|
-
"relative flex min-h-svh flex-1 flex-col bg-surface-1",
|
|
249
|
-
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-ds-03 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-ds-03 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-ds-xl md:peer-data-[variant=inset]:shadow",
|
|
250
|
-
a
|
|
251
|
-
),
|
|
252
|
-
...e
|
|
253
|
-
}
|
|
254
|
-
)
|
|
255
|
-
);
|
|
256
|
-
ce.displayName = "SidebarInset";
|
|
257
|
-
const ue = o(({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
258
|
-
R,
|
|
259
|
-
{
|
|
260
|
-
ref: t,
|
|
261
|
-
"data-sidebar": "input",
|
|
262
|
-
className: i(
|
|
263
|
-
"h-ds-sm w-full bg-surface-1 shadow-none focus-visible:ring-2 focus-visible:ring-accent-9",
|
|
264
|
-
a
|
|
265
|
-
),
|
|
266
|
-
...e
|
|
267
|
-
}
|
|
268
|
-
));
|
|
269
|
-
ue.displayName = "SidebarInput";
|
|
270
|
-
const fe = o(
|
|
271
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
272
|
-
"div",
|
|
273
|
-
{
|
|
274
|
-
ref: t,
|
|
275
|
-
"data-sidebar": "header",
|
|
276
|
-
className: i("flex flex-col gap-ds-03 p-ds-03", a),
|
|
277
|
-
...e
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
);
|
|
281
|
-
fe.displayName = "SidebarHeader";
|
|
282
|
-
const me = o(
|
|
283
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
284
|
-
"div",
|
|
285
|
-
{
|
|
286
|
-
ref: t,
|
|
287
|
-
"data-sidebar": "footer",
|
|
288
|
-
className: i("flex flex-col gap-ds-03 p-ds-03", a),
|
|
289
|
-
...e
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
);
|
|
293
|
-
me.displayName = "SidebarFooter";
|
|
294
|
-
const be = o(({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
295
|
-
D,
|
|
296
|
-
{
|
|
297
|
-
ref: t,
|
|
298
|
-
"data-sidebar": "separator",
|
|
299
|
-
className: i(
|
|
300
|
-
"bg-surface-border mx-ds-03 w-auto",
|
|
301
|
-
a
|
|
302
|
-
),
|
|
303
|
-
...e
|
|
304
|
-
}
|
|
305
|
-
));
|
|
306
|
-
be.displayName = "SidebarSeparator";
|
|
307
|
-
const pe = o(
|
|
308
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
309
|
-
"div",
|
|
310
|
-
{
|
|
311
|
-
ref: t,
|
|
312
|
-
"data-sidebar": "content",
|
|
313
|
-
className: i(
|
|
314
|
-
"flex min-h-0 flex-1 flex-col gap-ds-03 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
315
|
-
a
|
|
316
|
-
),
|
|
317
|
-
...e
|
|
318
|
-
}
|
|
319
|
-
)
|
|
320
|
-
);
|
|
321
|
-
pe.displayName = "SidebarContent";
|
|
322
|
-
const ge = o(
|
|
323
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
324
|
-
"div",
|
|
325
|
-
{
|
|
326
|
-
ref: t,
|
|
327
|
-
"data-sidebar": "group",
|
|
328
|
-
className: i("relative flex w-full min-w-0 flex-col p-ds-03", a),
|
|
329
|
-
...e
|
|
330
|
-
}
|
|
331
|
-
)
|
|
332
|
-
);
|
|
333
|
-
ge.displayName = "SidebarGroup";
|
|
334
|
-
const he = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ s(
|
|
335
|
-
e ? w : "div",
|
|
336
|
-
{
|
|
337
|
-
ref: d,
|
|
338
|
-
"data-sidebar": "group-label",
|
|
339
|
-
className: i(
|
|
340
|
-
"flex h-ds-sm shrink-0 items-center rounded-ds-md px-ds-03 text-ds-sm font-medium text-surface-fg-muted outline-none ring-accent-9 transition-[margin,opa] duration-moderate-02 ease-linear focus-visible:ring-2 [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0",
|
|
341
|
-
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
342
|
-
a
|
|
343
|
-
),
|
|
344
|
-
...t
|
|
345
|
-
}
|
|
346
|
-
));
|
|
347
|
-
he.displayName = "SidebarGroupLabel";
|
|
348
|
-
const ve = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ s(
|
|
349
|
-
e ? w : "button",
|
|
350
|
-
{
|
|
351
|
-
ref: d,
|
|
352
|
-
"data-sidebar": "group-action",
|
|
353
|
-
className: i(
|
|
354
|
-
"hover:bg-surface-2 absolute right-ds-04 top-ds-04 flex aspect-square w-5 items-center justify-center rounded-ds-md p-0 text-surface-fg outline-none ring-accent-9 transition-transform hover:text-surface-fg focus-visible:ring-2 [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0",
|
|
355
|
-
"after:absolute after:-inset-2 after:md:hidden",
|
|
356
|
-
"group-data-[collapsible=icon]:hidden",
|
|
357
|
-
a
|
|
358
|
-
),
|
|
359
|
-
...t
|
|
360
|
-
}
|
|
361
|
-
));
|
|
362
|
-
ve.displayName = "SidebarGroupAction";
|
|
363
|
-
const xe = o(
|
|
364
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
365
|
-
"div",
|
|
366
|
-
{
|
|
367
|
-
ref: t,
|
|
368
|
-
"data-sidebar": "group-content",
|
|
369
|
-
className: i("w-full text-ds-md", a),
|
|
370
|
-
...e
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
);
|
|
374
|
-
xe.displayName = "SidebarGroupContent";
|
|
375
|
-
const we = o(
|
|
376
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
377
|
-
"ul",
|
|
378
|
-
{
|
|
379
|
-
ref: t,
|
|
380
|
-
"data-sidebar": "menu",
|
|
381
|
-
className: i("flex w-full min-w-0 flex-col gap-ds-02", a),
|
|
382
|
-
...e
|
|
383
|
-
}
|
|
384
|
-
)
|
|
385
|
-
);
|
|
386
|
-
we.displayName = "SidebarMenu";
|
|
387
|
-
const Se = o(
|
|
388
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
389
|
-
"li",
|
|
390
|
-
{
|
|
391
|
-
ref: t,
|
|
392
|
-
"data-sidebar": "menu-item",
|
|
393
|
-
className: i("group/menu-item relative", a),
|
|
394
|
-
...e
|
|
395
|
-
}
|
|
396
|
-
)
|
|
397
|
-
);
|
|
398
|
-
Se.displayName = "SidebarMenuItem";
|
|
399
|
-
const ye = z(
|
|
400
|
-
"peer/menu-button hover:bg-surface-2 active:bg-accent-2 data-[active=true]:bg-accent-2 data-[state=open]:hover:bg-surface-2 flex w-full items-center gap-ds-03 overflow-hidden rounded-ds-md p-ds-03 text-left outline-none ring-accent-9 transition-[width,height,padding] hover:text-surface-fg focus-visible:ring-2 active:text-surface-fg disabled:pointer-events-none disabled:opacity-action-disabled group-has-[[data-sidebar=menu-action]]/menu-item:pr-ds-07 aria-disabled:pointer-events-none aria-disabled:opacity-action-disabled data-[active=true]:font-medium data-[active=true]:text-surface-fg data-[state=open]:hover:text-surface-fg group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-ds-03 [&>span:last-child]:truncate [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0",
|
|
401
|
-
{
|
|
402
|
-
variants: {
|
|
403
|
-
variant: {
|
|
404
|
-
default: "hover:bg-surface-2 hover:text-surface-fg",
|
|
405
|
-
outline: "hover:bg-surface-2 bg-surface-1 shadow-[0_0_0_1px_var(--color-surface-border)] hover:text-surface-fg hover:shadow-[0_0_0_1px_var(--color-surface-border-strong)]"
|
|
406
|
-
},
|
|
407
|
-
size: {
|
|
408
|
-
md: "h-ds-sm text-ds-md",
|
|
409
|
-
sm: "h-ds-xs-plus text-ds-sm",
|
|
410
|
-
lg: "h-ds-lg text-ds-md group-data-[collapsible=icon]:!p-0"
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
defaultVariants: {
|
|
414
|
-
variant: "default",
|
|
415
|
-
size: "md"
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
), Ne = o(
|
|
419
|
-
({
|
|
420
|
-
asChild: a = !1,
|
|
421
|
-
isActive: e = !1,
|
|
422
|
-
variant: t = "default",
|
|
423
|
-
size: d = "md",
|
|
424
|
-
tooltip: r,
|
|
425
|
-
className: n,
|
|
426
|
-
children: c,
|
|
427
|
-
...p
|
|
428
|
-
}, l) => {
|
|
429
|
-
const u = a ? w : "button", { isMobile: f, state: v } = N(), g = /* @__PURE__ */ s(
|
|
430
|
-
u,
|
|
431
|
-
{
|
|
432
|
-
ref: l,
|
|
433
|
-
"data-sidebar": "menu-button",
|
|
434
|
-
"data-size": d,
|
|
435
|
-
"data-active": e,
|
|
436
|
-
className: i(ye({ variant: t, size: d }), !a && "relative", n),
|
|
437
|
-
...p,
|
|
438
|
-
children: a ? c : /* @__PURE__ */ h(G, { children: [
|
|
439
|
-
e && /* @__PURE__ */ s(
|
|
440
|
-
T.span,
|
|
441
|
-
{
|
|
442
|
-
layoutId: "sidebar-active-indicator",
|
|
443
|
-
className: "absolute inset-0 rounded-ds-md bg-accent-2",
|
|
444
|
-
transition: H.smooth
|
|
445
|
-
}
|
|
446
|
-
),
|
|
447
|
-
/* @__PURE__ */ s("span", { className: "relative z-[1] flex w-full items-center gap-[inherit]", children: c })
|
|
448
|
-
] })
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
return r ? (typeof r == "string" && (r = {
|
|
452
|
-
children: r
|
|
453
|
-
}), /* @__PURE__ */ h(Y, { children: [
|
|
454
|
-
/* @__PURE__ */ s(J, { asChild: !0, children: g }),
|
|
455
|
-
/* @__PURE__ */ s(
|
|
456
|
-
Q,
|
|
457
|
-
{
|
|
458
|
-
side: "right",
|
|
459
|
-
align: "center",
|
|
460
|
-
hidden: v !== "collapsed" || f,
|
|
461
|
-
...r
|
|
462
|
-
}
|
|
463
|
-
)
|
|
464
|
-
] })) : g;
|
|
465
|
-
}
|
|
466
|
-
);
|
|
467
|
-
Ne.displayName = "SidebarMenuButton";
|
|
468
|
-
const Me = o(({ className: a, asChild: e = !1, showOnHover: t = !1, ...d }, r) => /* @__PURE__ */ s(
|
|
469
|
-
e ? w : "button",
|
|
470
|
-
{
|
|
471
|
-
ref: r,
|
|
472
|
-
"data-sidebar": "menu-action",
|
|
473
|
-
className: i(
|
|
474
|
-
"hover:bg-surface-2 absolute right-ds-02 top-ds-02b flex aspect-square w-5 items-center justify-center rounded-ds-md p-0 text-surface-fg outline-none ring-accent-9 transition-transform hover:text-surface-fg focus-visible:ring-2 peer-hover/menu-button:text-surface-fg [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0",
|
|
475
|
-
"after:absolute after:-inset-2 after:md:hidden",
|
|
476
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
477
|
-
"peer-data-[size=md]/menu-button:top-ds-02b",
|
|
478
|
-
"peer-data-[size=lg]/menu-button:top-ds-03",
|
|
479
|
-
"group-data-[collapsible=icon]:hidden",
|
|
480
|
-
t && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-surface-fg md:opacity-0",
|
|
481
|
-
a
|
|
482
|
-
),
|
|
483
|
-
...d
|
|
484
|
-
}
|
|
485
|
-
));
|
|
486
|
-
Me.displayName = "SidebarMenuAction";
|
|
487
|
-
const _e = o(
|
|
488
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
489
|
-
"div",
|
|
490
|
-
{
|
|
491
|
-
ref: t,
|
|
492
|
-
"data-sidebar": "menu-badge",
|
|
493
|
-
className: i(
|
|
494
|
-
"pointer-events-none absolute right-ds-02 flex h-5 min-w-5 select-none items-center justify-center rounded-ds-md px-ds-02 text-ds-sm font-medium tabular-nums text-surface-fg",
|
|
495
|
-
"peer-hover/menu-button:text-surface-fg peer-data-[active=true]/menu-button:text-surface-fg",
|
|
496
|
-
"peer-data-[size=sm]/menu-button:top-1",
|
|
497
|
-
"peer-data-[size=md]/menu-button:top-ds-02b",
|
|
498
|
-
"peer-data-[size=lg]/menu-button:top-ds-03",
|
|
499
|
-
"group-data-[collapsible=icon]:hidden",
|
|
500
|
-
a
|
|
501
|
-
),
|
|
502
|
-
...e
|
|
503
|
-
}
|
|
504
|
-
)
|
|
505
|
-
);
|
|
506
|
-
_e.displayName = "SidebarMenuBadge";
|
|
507
|
-
const Ce = o(({ className: a, showIcon: e = !1, ...t }, d) => {
|
|
508
|
-
const r = E(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
509
|
-
return /* @__PURE__ */ h(
|
|
510
|
-
"div",
|
|
511
|
-
{
|
|
512
|
-
ref: d,
|
|
513
|
-
"data-sidebar": "menu-skeleton",
|
|
514
|
-
className: i("flex h-ds-sm items-center gap-ds-03 rounded-ds-md px-ds-03", a),
|
|
515
|
-
...t,
|
|
516
|
-
children: [
|
|
517
|
-
e && /* @__PURE__ */ s(
|
|
518
|
-
I,
|
|
519
|
-
{
|
|
520
|
-
className: "h-ico-sm w-ico-sm rounded-ds-md",
|
|
521
|
-
"data-sidebar": "menu-skeleton-icon"
|
|
522
|
-
}
|
|
523
|
-
),
|
|
524
|
-
/* @__PURE__ */ s(
|
|
525
|
-
I,
|
|
526
|
-
{
|
|
527
|
-
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
528
|
-
"data-sidebar": "menu-skeleton-text",
|
|
529
|
-
style: {
|
|
530
|
-
"--skeleton-width": r
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
)
|
|
534
|
-
]
|
|
535
|
-
}
|
|
536
|
-
);
|
|
537
|
-
});
|
|
538
|
-
Ce.displayName = "SidebarMenuSkeleton";
|
|
539
|
-
const Ie = o(
|
|
540
|
-
({ className: a, ...e }, t) => /* @__PURE__ */ s(
|
|
541
|
-
"ul",
|
|
542
|
-
{
|
|
543
|
-
ref: t,
|
|
544
|
-
"data-sidebar": "menu-sub",
|
|
545
|
-
className: i(
|
|
546
|
-
"mx-ds-04 flex min-w-0 translate-x-px flex-col gap-ds-02 border-l border-surface-border px-ds-03 py-ds-01",
|
|
547
|
-
"group-data-[collapsible=icon]:hidden",
|
|
548
|
-
a
|
|
549
|
-
),
|
|
550
|
-
...e
|
|
551
|
-
}
|
|
552
|
-
)
|
|
553
|
-
);
|
|
554
|
-
Ie.displayName = "SidebarMenuSub";
|
|
555
|
-
const ke = o(
|
|
556
|
-
({ ...a }, e) => /* @__PURE__ */ s("li", { ref: e, ...a })
|
|
557
|
-
);
|
|
558
|
-
ke.displayName = "SidebarMenuSubItem";
|
|
559
|
-
const ze = o(({ asChild: a = !1, size: e = "md", isActive: t, className: d, ...r }, n) => /* @__PURE__ */ s(
|
|
560
|
-
a ? w : "a",
|
|
561
|
-
{
|
|
562
|
-
ref: n,
|
|
563
|
-
"data-sidebar": "menu-sub-button",
|
|
564
|
-
"data-size": e,
|
|
565
|
-
"data-active": t,
|
|
566
|
-
className: i(
|
|
567
|
-
"hover:bg-surface-2 active:bg-accent-2 flex h-ds-xs-plus min-w-0 -translate-x-px items-center gap-ds-03 overflow-hidden rounded-ds-md px-ds-03 text-surface-fg outline-none ring-accent-9 hover:text-surface-fg focus-visible:ring-2 active:text-surface-fg disabled:pointer-events-none disabled:opacity-action-disabled aria-disabled:pointer-events-none aria-disabled:opacity-action-disabled [&>span:last-child]:truncate [&>svg]:h-ico-sm [&>svg]:w-ico-sm [&>svg]:shrink-0 [&>svg]:text-surface-fg",
|
|
568
|
-
"data-[active=true]:bg-accent-2 data-[active=true]:text-surface-fg",
|
|
569
|
-
e === "sm" && "text-ds-sm",
|
|
570
|
-
e === "md" && "text-ds-md",
|
|
571
|
-
"group-data-[collapsible=icon]:hidden",
|
|
572
|
-
d
|
|
573
|
-
),
|
|
574
|
-
...r
|
|
575
|
-
}
|
|
576
|
-
));
|
|
577
|
-
ze.displayName = "SidebarMenuSubButton";
|
|
578
|
-
export {
|
|
579
|
-
R as I,
|
|
580
|
-
oe as S,
|
|
581
|
-
fe as a,
|
|
582
|
-
be as b,
|
|
583
|
-
pe as c,
|
|
584
|
-
ge as d,
|
|
585
|
-
he as e,
|
|
586
|
-
ve as f,
|
|
587
|
-
xe as g,
|
|
588
|
-
we as h,
|
|
589
|
-
me as i,
|
|
590
|
-
Se as j,
|
|
591
|
-
Ne as k,
|
|
592
|
-
_e as l,
|
|
593
|
-
Ie as m,
|
|
594
|
-
ke as n,
|
|
595
|
-
ze as o,
|
|
596
|
-
ne as p,
|
|
597
|
-
D as q,
|
|
598
|
-
ue as r,
|
|
599
|
-
ce as s,
|
|
600
|
-
Me as t,
|
|
601
|
-
Ce as u,
|
|
602
|
-
de as v,
|
|
603
|
-
le as w,
|
|
604
|
-
Z as x,
|
|
605
|
-
N as y
|
|
606
|
-
};
|
package/dist/_chunks/spinner.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as M, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as g from "react";
|
|
4
|
-
import { c as $ } from "./utils.js";
|
|
5
|
-
import { u as v, m as l, A as L } from "./motion.js";
|
|
6
|
-
const C = {
|
|
7
|
-
sm: "h-ico-sm w-ico-sm",
|
|
8
|
-
md: "h-ico-md w-ico-md",
|
|
9
|
-
lg: "h-ico-lg w-ico-lg"
|
|
10
|
-
}, N = { sm: 3, md: 3, lg: 4 }, K = { sm: 1.8, md: 2, lg: 2.5 }, o = 10, e = 2 * Math.PI * o, T = {
|
|
11
|
-
spinning: "Loading...",
|
|
12
|
-
success: "Complete",
|
|
13
|
-
error: "Error"
|
|
14
|
-
}, F = {
|
|
15
|
-
spinning: "var(--color-accent-9)",
|
|
16
|
-
success: "var(--color-success-9)",
|
|
17
|
-
error: "var(--color-error-9)"
|
|
18
|
-
}, P = "M7 12.5l3 3 7-7", b = "M8 8l8 8M16 8l-8 8", j = "M5 12.5l4 4 10-10", U = "M6 6l12 12M18 6l-12 12", B = g.forwardRef(({ size: m = "md", state: n = "spinning", variant: O = "filled", delay: d = 0, onComplete: i, className: E }, I) => {
|
|
19
|
-
const a = v(), [_, x] = g.useState(d === 0);
|
|
20
|
-
if (g.useEffect(() => {
|
|
21
|
-
if (d <= 0) {
|
|
22
|
-
x(!0);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const W = setTimeout(() => x(!0), d);
|
|
26
|
-
return () => clearTimeout(W);
|
|
27
|
-
}, [d]), !_)
|
|
28
|
-
return null;
|
|
29
|
-
const s = N[m], u = K[m], h = n === "spinning", c = n === "success" || n === "error", r = O === "filled", p = F[n], f = r ? "white" : "currentColor", A = r ? P : j, R = r ? b : U, y = 0.4, w = 0.3, S = 0.25, k = r ? 0.5 : 0.35, D = 0.35;
|
|
30
|
-
return M("span", { ref: I, role: "status", className: $("inline-flex", E), children: [M("svg", { className: C[m], viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [a ? !(c && !r) && t("circle", { cx: "12", cy: "12", r: o, stroke: "var(--color-surface-border)", strokeWidth: s, fill: "none" }) : t(l.circle, { cx: "12", cy: "12", r: o, stroke: "var(--color-surface-border)", strokeWidth: s, fill: "none", animate: { opacity: c && !r ? 0 : 1 }, transition: { duration: 0.2, delay: c && !r ? y : 0 } }), a ? t("circle", { cx: "12", cy: "12", r: o, stroke: p, strokeWidth: s, fill: "none", strokeLinecap: "round", strokeDasharray: h ? `${e * 0.75} ${e * 0.25}` : `${e} 0`, style: {
|
|
31
|
-
transformOrigin: "center",
|
|
32
|
-
transform: h ? "rotate(-90deg)" : void 0,
|
|
33
|
-
opacity: c && !r ? 0 : 1
|
|
34
|
-
} }) : t(l.circle, { cx: "12", cy: "12", r: o, stroke: p, strokeWidth: s, fill: "none", strokeLinecap: "round", style: { transformOrigin: "center" }, animate: h ? {
|
|
35
|
-
rotate: [0, 360],
|
|
36
|
-
strokeDasharray: [
|
|
37
|
-
`${e * 0.1} ${e * 0.9}`,
|
|
38
|
-
`${e * 0.75} ${e * 0.25}`,
|
|
39
|
-
`${e * 0.1} ${e * 0.9}`
|
|
40
|
-
]
|
|
41
|
-
} : {
|
|
42
|
-
rotate: 0,
|
|
43
|
-
strokeDasharray: `${e} 0`,
|
|
44
|
-
// In bare mode, fade out the arc after it completes
|
|
45
|
-
...!r && { opacity: 0 }
|
|
46
|
-
}, transition: h ? {
|
|
47
|
-
rotate: { duration: 1, repeat: 1 / 0, ease: "linear" },
|
|
48
|
-
strokeDasharray: { duration: 1.5, repeat: 1 / 0, ease: "easeInOut" }
|
|
49
|
-
} : {
|
|
50
|
-
rotate: { duration: 0.3, ease: "easeOut" },
|
|
51
|
-
strokeDasharray: { duration: y, ease: "easeInOut" },
|
|
52
|
-
...!r && { opacity: { duration: 0.2, delay: y } }
|
|
53
|
-
} }), t(L, { children: c && r && (a ? t("circle", { cx: "12", cy: "12", r: o + s / 2, fill: p, stroke: "none" }, "fill-static") : t(l.circle, { cx: "12", cy: "12", r: o + s / 2, fill: p, stroke: "none", initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: S, delay: w, ease: "easeOut" }, style: { transformOrigin: "center" } }, "fill")) }), t(L, { children: n === "success" && (a ? t("path", { d: A, stroke: f, strokeWidth: u, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }, "check-static") : t(l.path, { d: A, stroke: f, strokeWidth: u, strokeLinecap: "round", strokeLinejoin: "round", fill: "none", initial: { pathLength: 0, opacity: 0 }, animate: { pathLength: 1, opacity: 1 }, transition: {
|
|
54
|
-
pathLength: { duration: D, ease: "easeOut", delay: k },
|
|
55
|
-
opacity: { duration: 0.1, delay: k }
|
|
56
|
-
}, onAnimationComplete: () => i == null ? void 0 : i() }, "check")) }), t(L, { children: n === "error" && (a ? t("path", { d: R, stroke: f, strokeWidth: u, strokeLinecap: "round", fill: "none" }, "x-static") : t(l.path, { d: R, stroke: f, strokeWidth: u, strokeLinecap: "round", fill: "none", initial: { pathLength: 0, opacity: 0 }, animate: { pathLength: 1, opacity: 1 }, transition: {
|
|
57
|
-
pathLength: { duration: D, ease: "easeOut", delay: k },
|
|
58
|
-
opacity: { duration: 0.1, delay: k }
|
|
59
|
-
}, onAnimationComplete: () => i == null ? void 0 : i() }, "x")) })] }), t("span", { className: "sr-only", children: T[n] })] });
|
|
60
|
-
});
|
|
61
|
-
B.displayName = "Spinner";
|
|
62
|
-
export {
|
|
63
|
-
B as S
|
|
64
|
-
};
|