@bzync/rui 0.0.5 → 0.0.9
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 +476 -57
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -1
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -1
- package/dist/components/avatar-group.js +1 -1
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -1
- package/dist/components/blockquote.js +3 -3
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.js +4 -4
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +3 -2
- package/dist/components/currency.cjs +1 -1
- package/dist/components/currency.js +1 -1
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/divider.cjs +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -1
- package/dist/components/rating.js +3 -3
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +45 -18
- package/dist/components/scroll-area.cjs +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -1
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +206 -148
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -1
- package/dist/components/typography.d.ts +2 -3
- package/dist/components/typography.js +37 -24
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +126 -99
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./cn-
|
|
2
|
-
import { o as t, t as n } from "./component-styles-
|
|
3
|
-
import { o as r } from "./utils-
|
|
1
|
+
import { t as e } from "./cn-BJyZJP-y.js";
|
|
2
|
+
import { o as t, t as n } from "./component-styles-C2CbHEEA.js";
|
|
3
|
+
import { o as r } from "./utils-DEw5mQrH.js";
|
|
4
4
|
import { t as i } from "./use-event-callback-DGkfO_uu.js";
|
|
5
5
|
import { AnimatePresence as a, motion as o } from "framer-motion";
|
|
6
6
|
import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
@@ -40,7 +40,7 @@ function b({ text: e, query: t }) {
|
|
|
40
40
|
return n === -1 ? /* @__PURE__ */ h(m, { children: e }) : /* @__PURE__ */ g(m, { children: [
|
|
41
41
|
e.slice(0, n),
|
|
42
42
|
/* @__PURE__ */ h("mark", {
|
|
43
|
-
className: "bg-
|
|
43
|
+
className: "bg-accent-500/25 text-accent-700 dark:text-accent-200 rounded-sm not-italic",
|
|
44
44
|
children: e.slice(n, n + t.length)
|
|
45
45
|
}),
|
|
46
46
|
e.slice(n + t.length)
|
|
@@ -48,9 +48,9 @@ function b({ text: e, query: t }) {
|
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/components/autocomplete/single-trigger.tsx
|
|
51
|
-
function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, onInputChange: m, onFocus: _, onKeyDown: b, onClear: x, messageId: S, inputProps: C }) {
|
|
51
|
+
function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, onInputChange: m, onFocus: _, onKeyDown: b, onClear: x, messageId: S, inputProps: C, className: w, inputClassName: T }) {
|
|
52
52
|
return /* @__PURE__ */ g("div", {
|
|
53
|
-
className: e("flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/
|
|
53
|
+
className: e("flex h-9 items-center gap-2 rounded-[var(--radius-md)] px-3", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", u && "opacity-50 cursor-not-allowed", w),
|
|
54
54
|
children: [
|
|
55
55
|
c && /* @__PURE__ */ h("span", {
|
|
56
56
|
className: "text-slate-500 shrink-0 text-sm",
|
|
@@ -74,7 +74,7 @@ function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
|
|
|
74
74
|
onKeyDown: b,
|
|
75
75
|
placeholder: l,
|
|
76
76
|
disabled: u,
|
|
77
|
-
className: "flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed"
|
|
77
|
+
className: e("flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed", T)
|
|
78
78
|
}),
|
|
79
79
|
f && /* @__PURE__ */ h(y, {}),
|
|
80
80
|
p && !f && /* @__PURE__ */ h("button", {
|
|
@@ -88,10 +88,10 @@ function x({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
|
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/components/autocomplete/multi-trigger.tsx
|
|
91
|
-
function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, selected: m, onContainerClick: _, onInputChange: b, onFocus: x, onKeyDown: S, onRemove: C, onClearAll: w, messageId: T, inputProps: E }) {
|
|
91
|
+
function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputText: s, prefix: c, placeholder: l, disabled: u, error: d, loading: f, showClear: p, selected: m, onContainerClick: _, onInputChange: b, onFocus: x, onKeyDown: S, onRemove: C, onClearAll: w, messageId: T, inputProps: E, className: ee, inputClassName: D }) {
|
|
92
92
|
return /* @__PURE__ */ g("div", {
|
|
93
93
|
onClick: _,
|
|
94
|
-
className: e("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/
|
|
94
|
+
className: e("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-[var(--radius-md)] px-2.5 py-1.5 cursor-text", n, d && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", u && "opacity-50 cursor-not-allowed", ee),
|
|
95
95
|
children: [
|
|
96
96
|
c && /* @__PURE__ */ h("span", {
|
|
97
97
|
className: "text-slate-500 shrink-0 text-sm",
|
|
@@ -116,7 +116,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
|
|
|
116
116
|
t.stopPropagation(), C(e);
|
|
117
117
|
},
|
|
118
118
|
disabled: u,
|
|
119
|
-
className: "shrink-0 text-slate-500 dark:text-slate-400 hover:text-
|
|
119
|
+
className: "shrink-0 text-slate-500 dark:text-slate-400 hover:text-foreground transition-colors cursor-pointer ml-0.5",
|
|
120
120
|
"aria-label": `Remove ${e.label}`,
|
|
121
121
|
children: /* @__PURE__ */ h(v, { size: 10 })
|
|
122
122
|
})
|
|
@@ -140,7 +140,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
|
|
|
140
140
|
onKeyDown: S,
|
|
141
141
|
placeholder: m.length === 0 ? l : void 0,
|
|
142
142
|
disabled: u,
|
|
143
|
-
className: "flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5"
|
|
143
|
+
className: e("flex-1 min-w-[80px] bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed py-0.5", D)
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ g("span", {
|
|
146
146
|
className: "ml-auto flex items-center gap-1.5 shrink-0",
|
|
@@ -167,7 +167,7 @@ function S({ inputRef: t, inputId: r, listId: i, open: a, activeIdx: o, inputTex
|
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/components/autocomplete/dropdown.tsx
|
|
170
|
-
function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, filtered: l, emptyMessage: u, activeIdx: d, setActiveIdx: f, inputText: p, selectedValues: m, singleValue: v, onSelectSingle: x, onToggleMulti: S, className: C }) {
|
|
170
|
+
function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, filtered: l, emptyMessage: u, activeIdx: d, setActiveIdx: f, inputText: p, selectedValues: m, singleValue: v, onSelectSingle: x, onToggleMulti: S, className: C, optionClassName: w, loadingClassName: T, emptyClassName: E }) {
|
|
171
171
|
return typeof document > "u" ? null : _(/* @__PURE__ */ h(a, { children: r && i && /* @__PURE__ */ h(o.ul, {
|
|
172
172
|
ref: t,
|
|
173
173
|
id: n,
|
|
@@ -195,10 +195,10 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
|
|
|
195
195
|
},
|
|
196
196
|
className: e("z-[110] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised py-1 shadow-floating", C),
|
|
197
197
|
children: c ? /* @__PURE__ */ g("li", {
|
|
198
|
-
className: "px-4 py-3 text-sm text-slate-600 flex items-center gap-2",
|
|
198
|
+
className: e("px-4 py-3 text-sm text-slate-600 flex items-center gap-2", T),
|
|
199
199
|
children: [/* @__PURE__ */ h(y, {}), "Loading…"]
|
|
200
200
|
}) : l.length === 0 ? /* @__PURE__ */ h("li", {
|
|
201
|
-
className: "px-4 py-3 text-sm text-slate-600",
|
|
201
|
+
className: e("px-4 py-3 text-sm text-slate-600", E),
|
|
202
202
|
children: u
|
|
203
203
|
}) : l.map((t, r) => {
|
|
204
204
|
let i = r === d, a = s ? m.includes(t.value) : t.value === v;
|
|
@@ -209,7 +209,7 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
|
|
|
209
209
|
onMouseDown: (e) => e.preventDefault(),
|
|
210
210
|
onClick: () => s ? S(t) : x(t),
|
|
211
211
|
onMouseEnter: () => f(r),
|
|
212
|
-
className: e("flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors", i && "bg-surface-muted", a && !i && "bg-accent-50 dark:bg-accent-500/10"),
|
|
212
|
+
className: e("flex min-h-9 items-center gap-3 px-3 py-2 cursor-pointer transition-colors", i && "bg-surface-muted", a && !i && "bg-accent-50 dark:bg-accent-500/10", w),
|
|
213
213
|
children: [
|
|
214
214
|
t.icon && /* @__PURE__ */ h("span", {
|
|
215
215
|
className: "shrink-0 text-slate-500 dark:text-slate-400",
|
|
@@ -249,118 +249,118 @@ function C({ listRef: t, listId: n, open: r, pos: i, multiple: s, loading: c, fi
|
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/components/autocomplete.tsx
|
|
251
251
|
function w(n, a) {
|
|
252
|
-
let { options: o, inputValue: s, onInputChange: _, label: v, hint: y, error: b, prefix: w, clearable: T = !0, loading: E = !1, emptyMessage: ee = "No results", maxVisible:
|
|
253
|
-
s === void 0 ?
|
|
254
|
-
}, [s,
|
|
255
|
-
if (!
|
|
252
|
+
let { options: o, inputValue: s, onInputChange: _, label: v, hint: y, error: b, prefix: w, clearable: T = !0, loading: E = !1, emptyMessage: ee = "No results", maxVisible: D = 8, className: te, wrapperClassName: ne, triggerClassName: re, inputClassName: ie, labelClassName: ae, messageClassName: oe, listClassName: se, optionClassName: ce, loadingClassName: le, emptyClassName: ue, placeholder: O, disabled: k, id: de, multiple: A, unstyled: fe = !1, ...pe } = n, { value: me, onSelect: he, onDeselect: ge, ..._e } = pe, ve = u(), j = de ?? ve, M = `${j}-list`, N = `${j}-message`, [ye, be] = p(""), P = s === void 0 ? ye : s, xe = i((e) => _?.(e)), F = c((e) => {
|
|
253
|
+
s === void 0 ? be(e) : xe(e);
|
|
254
|
+
}, [s, xe]), [Se, I] = p([]), L = d(() => {
|
|
255
|
+
if (!A) return [];
|
|
256
256
|
let e = n;
|
|
257
|
-
return e.value === void 0 ?
|
|
257
|
+
return e.value === void 0 ? Se : o.filter((t) => e.value.includes(t.value));
|
|
258
258
|
}, [
|
|
259
|
-
|
|
259
|
+
A,
|
|
260
260
|
o,
|
|
261
261
|
n,
|
|
262
|
-
|
|
263
|
-
]),
|
|
264
|
-
let e =
|
|
265
|
-
return o.filter((t) => !t.disabled && t.label.toLowerCase().includes(e)).slice(0,
|
|
262
|
+
Se
|
|
263
|
+
]), R = d(() => L.map((e) => e.value), [L]), [z, B] = p(!1), [V, H] = p(-1), U = f(null), W = f(null), G = f(null), [K, q] = p(""), J = d(() => {
|
|
264
|
+
let e = K.trim().toLowerCase();
|
|
265
|
+
return o.filter((t) => !t.disabled && t.label.toLowerCase().includes(e)).slice(0, D);
|
|
266
266
|
}, [
|
|
267
267
|
o,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
]),
|
|
271
|
-
n.onSelect?.(e),
|
|
272
|
-
}, [n,
|
|
273
|
-
let t = n, r = [...
|
|
274
|
-
t.value === void 0 &&
|
|
268
|
+
K,
|
|
269
|
+
D
|
|
270
|
+
]), Y = c((e) => {
|
|
271
|
+
n.onSelect?.(e), F(e.label), B(!1), H(-1);
|
|
272
|
+
}, [n, F]), Ce = c((e) => {
|
|
273
|
+
let t = n, r = [...L, e];
|
|
274
|
+
t.value === void 0 && I(r), t.onSelect?.(e, r), F(""), H(-1), W.current?.focus();
|
|
275
275
|
}, [
|
|
276
|
-
|
|
276
|
+
L,
|
|
277
277
|
n,
|
|
278
|
-
|
|
279
|
-
]),
|
|
280
|
-
let t = n, r =
|
|
281
|
-
t.value === void 0 &&
|
|
282
|
-
}, [
|
|
283
|
-
|
|
278
|
+
F
|
|
279
|
+
]), X = c((e) => {
|
|
280
|
+
let t = n, r = L.filter((t) => t.value !== e.value);
|
|
281
|
+
t.value === void 0 && I(r), t.onDeselect?.(e, r);
|
|
282
|
+
}, [L, n]), Z = c((e) => {
|
|
283
|
+
R.includes(e.value) ? X(e) : Ce(e);
|
|
284
284
|
}, [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
]),
|
|
289
|
-
|
|
285
|
+
R,
|
|
286
|
+
X,
|
|
287
|
+
Ce
|
|
288
|
+
]), we = c(() => {
|
|
289
|
+
F(""), n.onSelect?.({
|
|
290
290
|
value: "",
|
|
291
291
|
label: ""
|
|
292
|
-
}),
|
|
293
|
-
}, [n,
|
|
294
|
-
n.value === void 0 &&
|
|
295
|
-
}, [n,
|
|
296
|
-
if (
|
|
297
|
-
|
|
292
|
+
}), B(!1);
|
|
293
|
+
}, [n, F]), Te = c(() => {
|
|
294
|
+
n.value === void 0 && I([]), F("");
|
|
295
|
+
}, [n, F]), Ee = c((e) => {
|
|
296
|
+
if (A && e.key === "Backspace" && P === "" && L.length > 0) {
|
|
297
|
+
X(L[L.length - 1]);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
if (!
|
|
301
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp") && (
|
|
300
|
+
if (!z) {
|
|
301
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && (B(!0), q(""));
|
|
302
302
|
return;
|
|
303
303
|
}
|
|
304
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
305
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
304
|
+
if (e.key === "ArrowDown") e.preventDefault(), H((e) => Math.min(e + 1, J.length - 1));
|
|
305
|
+
else if (e.key === "ArrowUp") e.preventDefault(), H((e) => Math.max(e - 1, 0));
|
|
306
306
|
else if (e.key === "Enter") {
|
|
307
307
|
e.preventDefault();
|
|
308
|
-
let t =
|
|
308
|
+
let t = J[V];
|
|
309
309
|
if (!t) return;
|
|
310
|
-
|
|
311
|
-
} else e.key === "Escape" && (
|
|
310
|
+
A ? Z(t) : Y(t);
|
|
311
|
+
} else e.key === "Escape" && (B(!1), H(-1));
|
|
312
312
|
}, [
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
A,
|
|
314
|
+
P,
|
|
315
|
+
L,
|
|
316
|
+
z,
|
|
317
|
+
J,
|
|
318
|
+
V,
|
|
319
|
+
Z,
|
|
317
320
|
Y,
|
|
318
|
-
|
|
319
|
-
Q,
|
|
320
|
-
X,
|
|
321
|
-
Z
|
|
321
|
+
X
|
|
322
322
|
]);
|
|
323
323
|
l(() => {
|
|
324
|
-
|
|
325
|
-
}, [
|
|
324
|
+
V < 0 || !G.current || G.current.children[V]?.scrollIntoView({ block: "nearest" });
|
|
325
|
+
}, [V]), l(() => {
|
|
326
326
|
function e(e) {
|
|
327
327
|
let t = e.target;
|
|
328
|
-
!
|
|
328
|
+
!U.current?.contains(t) && !G.current?.contains(t) && B(!1);
|
|
329
329
|
}
|
|
330
330
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
331
331
|
}, []);
|
|
332
|
-
let
|
|
333
|
-
|
|
334
|
-
}, [
|
|
335
|
-
|
|
332
|
+
let De = A ? void 0 : n.value, Oe = !!(!A && T && P.length > 0 && !k), ke = !!(A && T && (L.length > 0 || P.length > 0) && !k), Ae = r(z, U), Q = c((e) => {
|
|
333
|
+
F(e.target.value), q(e.target.value), B(!0), H(-1);
|
|
334
|
+
}, [F]), $ = c(() => {
|
|
335
|
+
B(!0), q("");
|
|
336
336
|
}, []);
|
|
337
|
-
return
|
|
338
|
-
ref:
|
|
339
|
-
className: e(
|
|
337
|
+
return fe ? /* @__PURE__ */ g("div", {
|
|
338
|
+
ref: U,
|
|
339
|
+
className: e(te, ne),
|
|
340
340
|
children: [/* @__PURE__ */ h("input", {
|
|
341
341
|
ref: a,
|
|
342
|
+
id: j,
|
|
343
|
+
value: P,
|
|
344
|
+
onChange: Q,
|
|
345
|
+
placeholder: O,
|
|
346
|
+
disabled: k
|
|
347
|
+
}), z && /* @__PURE__ */ h("ul", {
|
|
348
|
+
ref: G,
|
|
342
349
|
id: M,
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
disabled: O
|
|
347
|
-
}), B && /* @__PURE__ */ h("ul", {
|
|
348
|
-
ref: K,
|
|
349
|
-
id: N,
|
|
350
|
-
className: ie,
|
|
351
|
-
children: Y.map((e) => /* @__PURE__ */ h("li", {
|
|
352
|
-
onClick: () => k ? Q(e) : X(e),
|
|
350
|
+
className: se,
|
|
351
|
+
children: J.map((e) => /* @__PURE__ */ h("li", {
|
|
352
|
+
onClick: () => A ? Z(e) : Y(e),
|
|
353
353
|
children: e.label
|
|
354
354
|
}, String(e.value)))
|
|
355
355
|
})]
|
|
356
356
|
}) : /* @__PURE__ */ g("div", {
|
|
357
|
-
ref:
|
|
358
|
-
className: e("relative", t,
|
|
357
|
+
ref: U,
|
|
358
|
+
className: e("relative", t, ne, te),
|
|
359
359
|
children: [
|
|
360
360
|
v && /* @__PURE__ */ g("label", {
|
|
361
|
-
htmlFor:
|
|
362
|
-
className: "text-xs font-semibold leading-5 text-foreground",
|
|
363
|
-
children: [v,
|
|
361
|
+
htmlFor: j,
|
|
362
|
+
className: e("text-xs font-semibold leading-5 text-foreground", ae),
|
|
363
|
+
children: [v, pe.required && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
364
364
|
"aria-hidden": "true",
|
|
365
365
|
className: "ml-1 text-destructive",
|
|
366
366
|
children: "*"
|
|
@@ -369,80 +369,87 @@ function w(n, a) {
|
|
|
369
369
|
children: " (required)"
|
|
370
370
|
})] })]
|
|
371
371
|
}),
|
|
372
|
-
!
|
|
372
|
+
!A && /* @__PURE__ */ h(x, {
|
|
373
373
|
inputRef: a,
|
|
374
|
-
inputId:
|
|
375
|
-
listId:
|
|
376
|
-
open:
|
|
377
|
-
activeIdx:
|
|
378
|
-
inputText:
|
|
374
|
+
inputId: j,
|
|
375
|
+
listId: M,
|
|
376
|
+
open: z,
|
|
377
|
+
activeIdx: V,
|
|
378
|
+
inputText: P,
|
|
379
379
|
prefix: w,
|
|
380
|
-
placeholder:
|
|
381
|
-
disabled:
|
|
380
|
+
placeholder: O,
|
|
381
|
+
disabled: k,
|
|
382
382
|
error: b,
|
|
383
383
|
loading: E,
|
|
384
|
-
showClear:
|
|
385
|
-
onInputChange:
|
|
386
|
-
onFocus:
|
|
387
|
-
onKeyDown:
|
|
388
|
-
onClear:
|
|
389
|
-
messageId: b || y ?
|
|
390
|
-
inputProps:
|
|
384
|
+
showClear: Oe,
|
|
385
|
+
onInputChange: Q,
|
|
386
|
+
onFocus: $,
|
|
387
|
+
onKeyDown: Ee,
|
|
388
|
+
onClear: we,
|
|
389
|
+
messageId: b || y ? N : void 0,
|
|
390
|
+
inputProps: _e,
|
|
391
|
+
className: re,
|
|
392
|
+
inputClassName: ie
|
|
391
393
|
}),
|
|
392
|
-
|
|
394
|
+
A && /* @__PURE__ */ h(S, {
|
|
393
395
|
inputRef: (e) => {
|
|
394
|
-
|
|
396
|
+
W.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
395
397
|
},
|
|
396
|
-
inputId:
|
|
397
|
-
listId:
|
|
398
|
-
open:
|
|
399
|
-
activeIdx:
|
|
400
|
-
inputText:
|
|
398
|
+
inputId: j,
|
|
399
|
+
listId: M,
|
|
400
|
+
open: z,
|
|
401
|
+
activeIdx: V,
|
|
402
|
+
inputText: P,
|
|
401
403
|
prefix: w,
|
|
402
|
-
placeholder:
|
|
403
|
-
disabled:
|
|
404
|
+
placeholder: O,
|
|
405
|
+
disabled: k,
|
|
404
406
|
error: b,
|
|
405
407
|
loading: E,
|
|
406
|
-
showClear:
|
|
407
|
-
selected:
|
|
408
|
+
showClear: ke,
|
|
409
|
+
selected: L,
|
|
408
410
|
onContainerClick: () => {
|
|
409
|
-
|
|
411
|
+
k || (W.current?.focus(), B(!0), q(""));
|
|
410
412
|
},
|
|
411
|
-
onInputChange:
|
|
412
|
-
onFocus:
|
|
413
|
-
onKeyDown:
|
|
414
|
-
onRemove:
|
|
415
|
-
onClearAll:
|
|
416
|
-
messageId: b || y ?
|
|
417
|
-
inputProps:
|
|
413
|
+
onInputChange: Q,
|
|
414
|
+
onFocus: $,
|
|
415
|
+
onKeyDown: Ee,
|
|
416
|
+
onRemove: X,
|
|
417
|
+
onClearAll: Te,
|
|
418
|
+
messageId: b || y ? N : void 0,
|
|
419
|
+
inputProps: _e,
|
|
420
|
+
className: re,
|
|
421
|
+
inputClassName: ie
|
|
418
422
|
}),
|
|
419
423
|
/* @__PURE__ */ h(C, {
|
|
420
|
-
listRef:
|
|
421
|
-
listId:
|
|
422
|
-
open:
|
|
423
|
-
pos:
|
|
424
|
-
multiple:
|
|
424
|
+
listRef: G,
|
|
425
|
+
listId: M,
|
|
426
|
+
open: z,
|
|
427
|
+
pos: Ae,
|
|
428
|
+
multiple: A,
|
|
425
429
|
loading: E,
|
|
426
|
-
filtered:
|
|
430
|
+
filtered: J,
|
|
427
431
|
emptyMessage: ee,
|
|
428
|
-
activeIdx:
|
|
429
|
-
setActiveIdx:
|
|
430
|
-
inputText:
|
|
431
|
-
selectedValues:
|
|
432
|
-
singleValue:
|
|
433
|
-
onSelectSingle:
|
|
434
|
-
onToggleMulti:
|
|
435
|
-
className:
|
|
432
|
+
activeIdx: V,
|
|
433
|
+
setActiveIdx: H,
|
|
434
|
+
inputText: K,
|
|
435
|
+
selectedValues: R,
|
|
436
|
+
singleValue: De,
|
|
437
|
+
onSelectSingle: Y,
|
|
438
|
+
onToggleMulti: Z,
|
|
439
|
+
className: se,
|
|
440
|
+
optionClassName: ce,
|
|
441
|
+
loadingClassName: le,
|
|
442
|
+
emptyClassName: ue
|
|
436
443
|
}),
|
|
437
444
|
b && /* @__PURE__ */ h("p", {
|
|
438
|
-
id:
|
|
445
|
+
id: N,
|
|
439
446
|
"aria-live": "polite",
|
|
440
|
-
className: "text-xs leading-5 text-destructive",
|
|
447
|
+
className: e("text-xs leading-5 text-destructive", oe),
|
|
441
448
|
children: b
|
|
442
449
|
}),
|
|
443
450
|
y && !b && /* @__PURE__ */ h("p", {
|
|
444
|
-
id:
|
|
445
|
-
className: "text-xs leading-5 text-muted-foreground",
|
|
451
|
+
id: N,
|
|
452
|
+
className: e("text-xs leading-5 text-muted-foreground", oe),
|
|
446
453
|
children: y
|
|
447
454
|
})
|
|
448
455
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./cn-B6R3HKzx.cjs"),t=require("./component-styles-DY4wigiq.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],s=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],c={blue:`bg-blue-500/12 text-blue-400 border-blue-500/20`,green:`bg-emerald-500/12 text-emerald-400 border-emerald-500/20`,red:`bg-red-500/12 text-red-400 border-red-500/20`,yellow:`bg-amber-500/12 text-amber-400 border-amber-500/20`,purple:`bg-violet-500/12 text-violet-400 border-violet-500/20`,orange:`bg-orange-500/12 text-orange-400 border-orange-500/20`};function l(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function u(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function d(e){let t=new Date(e);return t.setDate(t.getDate()-t.getDay()),t}var f={enter:e=>({opacity:0,x:e*16}),center:{opacity:1,x:0},exit:e=>({opacity:0,x:e*-16})};function p({viewDate:t,today:n,value:r,events:o,onSelect:s,onEventClick:u,isDateDisabled:d,onEventCreate:f,onEventDelete:p,editingId:m,onEditToggle:h,onUpdateTitle:g}){let _=t.getFullYear(),v=t.getMonth(),y=new Date(_,v+1,0).getDate(),b=new Date(_,v,1).getDay(),x=[...Array(b).fill(null),...Array.from({length:y},(e,t)=>new Date(_,v,t+1))];for(;x.length%7!=0;)x.push(null);function S(e){return o.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:a.map(e=>(0,i.jsx)(`div`,{role:`columnheader`,className:`py-2.5 text-center text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e},e))}),(0,i.jsx)(`div`,{role:`grid`,className:`grid grid-cols-7`,style:{gridTemplateRows:`repeat(${x.length/7}, minmax(80px, 1fr))`},children:x.map((t,a)=>{let o=a%7==6,h=a>=x.length-7;if(!t)return(0,i.jsx)(`div`,{role:`gridcell`,className:e.t(`border-black/6 dark:border-white/6 bg-black/[0.015] dark:bg-white/[0.015]`,!o&&`border-r`,!h&&`border-b`)},`e${a}`);let g=S(t),_=n?l(t,n):!1,y=r?l(t,r):!1,b=t.getMonth()===v,C=d?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:C?void 0:0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),"aria-disabled":C||void 0,"aria-selected":y,onClick:()=>!C&&s(t),onKeyDown:e=>{!C&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`p-1.5 transition-colors group/cell`,`border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!o&&`border-r`,!h&&`border-b`,!b&&`bg-black/[0.015] dark:bg-white/[0.015]`,C?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,i.jsx)(`span`,{className:e.t(`w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium`,y?`bg-primary text-primary-foreground`:_?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:b?`text-slate-700 dark:text-slate-200`:`text-slate-400 dark:text-slate-600`),children:t.getDate()}),f&&!C&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),f(t)},className:`opacity-0 group-hover/cell:opacity-100 focus:opacity-100 w-5 h-5 rounded-md bg-primary text-primary-foreground flex items-center justify-center text-[10px] hover:bg-primary-hover transition-opacity`,children:`+`})]}),(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[g.slice(0,2).map(t=>{let n=m===t.id;return(0,i.jsxs)(`div`,{className:e.t(`group/ev flex items-center gap-0.5 rounded border px-1 py-0.5`,c[t.color??`blue`],n&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u?.(t)},className:`min-w-0 flex-1 truncate text-left text-[10px] font-medium`,children:[t.time&&(0,i.jsx)(`span`,{className:`opacity-60 mr-1`,children:t.time}),t.title]}),p&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),p(t.id)},className:`flex size-4 shrink-0 items-center justify-center rounded text-[10px] leading-none opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id)}),g.length>2&&(0,i.jsxs)(`p`,{className:`text-[10px] text-slate-500 px-1`,children:[`+`,g.length-2,` more`]})]})]},t.toISOString())})})]})}function m({viewDate:t,today:n,value:r,events:a,onSelect:s,onEventClick:f,isDateDisabled:p,onEventCreate:m,onEventDelete:h,editingId:g,onEditToggle:_,onUpdateTitle:v}){let y=d(t),b=Array.from({length:7},(e,t)=>u(y,t));function x(e){return a.filter(t=>l(t.date,e))}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{role:`row`,className:`grid grid-cols-7 border-b border-border`,children:b.map(t=>{let a=n?l(t,n):!1,c=r?l(t,r):!1,u=p?.(t)??!1;return(0,i.jsxs)(`div`,{role:`gridcell`,tabIndex:u?void 0:0,"aria-selected":c,"aria-disabled":u||void 0,"aria-label":t.toLocaleDateString(void 0,{dateStyle:`full`}),onClick:()=>!u&&s(t),onKeyDown:e=>{!u&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,u?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted`),children:[(0,i.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide`,children:o[t.getDay()]}),(0,i.jsx)(`span`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-colors`,c?`bg-primary text-primary-foreground`:a?`border border-accent-500/50 text-accent-600 dark:text-accent-300`:`text-slate-700 dark:text-slate-200`),children:t.getDate()}),m&&!u&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Add event on ${t.toLocaleDateString()}`,onClick:e=>{e.stopPropagation(),m(t)},className:`opacity-0 group-hover/whead:opacity-100 focus:opacity-100 h-5 px-1.5 rounded-md bg-primary text-primary-foreground text-[10px] hover:bg-primary-hover`,children:`+ Add`})]},t.toISOString())})}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 min-h-[200px]`,children:b.map((t,n)=>{let r=x(t),a=n===6,o=p?.(t)??!1;return(0,i.jsx)(`div`,{role:`gridcell`,tabIndex:o?void 0:0,"aria-disabled":o||void 0,"aria-label":`${t.toLocaleDateString(void 0,{dateStyle:`full`})} events`,onClick:()=>!o&&s(t),onKeyDown:e=>{!o&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(t))},className:e.t(`space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35`,!a&&`border-r border-border`,o?`cursor-not-allowed opacity-40`:`cursor-pointer hover:bg-surface-muted/70`),children:r.map(t=>(0,i.jsxs)(`div`,{className:e.t(`group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5`,c[t.color??`blue`],g===t.id&&`ring-1 ring-focus-ring`),children:[(0,i.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f?.(t)},className:`min-w-0 flex-1 text-left`,children:[t.time&&(0,i.jsx)(`div`,{className:`text-[10px] opacity-60 mb-0.5`,children:t.time}),(0,i.jsx)(`div`,{className:`text-xs font-medium truncate`,children:t.title})]}),h&&(0,i.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.title}`,onClick:e=>{e.stopPropagation(),h(t.id)},className:`flex size-5 shrink-0 items-center justify-center rounded text-xs opacity-60 hover:bg-muted hover:opacity-100`,children:`×`})]},t.id))},t.toISOString())})})]})}function h({value:a,defaultValue:o=null,onChange:c,events:l,defaultEvents:h=[],onEventsChange:g,onEventClick:_,onEventCreate:v,onEventUpdate:y,onEventDelete:b,editable:x=!1,view:S,defaultView:C=`month`,onViewChange:ee,viewDate:w,defaultViewDate:T,onViewDateChange:te,minDate:E,maxDate:D,disabledDates:O,className:ne}){let[re,ie]=(0,r.useState)(null),[ae,oe]=(0,r.useState)(o),[se,ce]=(0,r.useState)(C),[k,A]=(0,r.useState)(T??null),[le,ue]=(0,r.useState)(()=>l??h),[j,M]=(0,r.useState)(1),[N,P]=(0,r.useState)(null),[F,I]=(0,r.useState)(``),[L,de]=(0,r.useState)(`blue`),[R,z]=(0,r.useState)(`09:00`),[B,V]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=new Date;ie(e),T===void 0&&w===void 0&&A(new Date(e.getFullYear(),e.getMonth(),1))},[]),(0,r.useEffect)(()=>{w===void 0&&T!==void 0&&k===null&&A(T?new Date(T):null)},[T]);let fe=a===void 0?ae:a,H=S===void 0?se:S,U=w===void 0?k:w,W=l!==void 0,G=W?l:le;function K(e){return!!(E&&e<new Date(E.getFullYear(),E.getMonth(),E.getDate())||D&&e>new Date(D.getFullYear(),D.getMonth(),D.getDate(),23,59,59,999)||O?.(e))}function pe(e){S===void 0&&ce(e),ee?.(e)}function q(e){e!==null&&(w===void 0&&A(e),te?.(e))}function J(e){K(e)||(a===void 0&&oe(e),c?.(e))}function me(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()-1,1):u(e,-7))}function he(e){return e&&(H===`month`?new Date(e.getFullYear(),e.getMonth()+1,1):u(e,7))}function ge(){M(-1),q(me(U))}function _e(){M(1),q(he(U))}function ve(){let e=new Date;M(0),q(new Date(e.getFullYear(),e.getMonth(),1)),J(e)}function Y(e){W||ue(e),g?.(e)}function X(e,t){if(K(e))return;let n={id:typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():String(Date.now()+Math.random()),title:t?.trim()||F.trim()||`New event`,date:new Date(e),color:L,time:R||void 0};Y([...G,n]),v?.(n),P(null),I(``),z(`09:00`)}function Z(e){Y(G.filter(t=>t.id!==e)),b?.(e),B===e&&V(null)}function Q(e){Y(G.map(t=>t.id===e.id?e:t)),y?.(e),V(null)}function ye(e){x&&V(t=>t===e.id?null:e.id),_?.(e)}let $=``;if(U){if(H===`month`)$=`${s[U.getMonth()]} ${U.getFullYear()}`;else{let e=d(U),t=u(e,6);$=e.getMonth()===t.getMonth()?`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${t.getDate()}, ${e.getFullYear()}`:`${s[e.getMonth()].slice(0,3)} ${e.getDate()} \u2013 ${s[t.getMonth()].slice(0,3)} ${t.getDate()}, ${e.getFullYear()}`}}let be=x||!!v||!!y||!!b||!!g,xe={today:re,value:fe,events:G,onSelect:J,onEventClick:ye,onEventCreate:be?e=>P(e):void 0,onEventDelete:be||b?Z:void 0,onEventUpdate:y,editingId:B,onEditToggle:e=>V(t=>t===e?null:e),onUpdateTitle:(e,t)=>{let n=G.find(t=>t.id===e);n&&Q({...n,title:t})},minDate:E,maxDate:D,disabledDates:O,isDateDisabled:K},Se=U?`${H}-${U.toISOString()}`:null;return(0,i.jsxs)(`div`,{className:e.t(`flex flex-col overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,ne),children:[(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:ge,"aria-label":`Previous ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m15 18-6-6 6-6`})})}),(0,i.jsx)(`button`,{type:`button`,onClick:_e,"aria-label":`Next ${H}`,className:e.t(t.c,`size-8`),children:(0,i.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`span`,{"aria-live":`polite`,className:`min-w-[9rem] flex-1 select-none text-sm font-semibold text-foreground`,children:$}),(0,i.jsx)(`button`,{type:`button`,onClick:ve,className:e.t(`h-8 rounded-[var(--radius-md)] border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:border-border-strong hover:bg-muted hover:text-foreground`,t.s),children:`Today`}),(0,i.jsx)(`div`,{role:`group`,"aria-label":`Calendar view`,className:`flex overflow-hidden rounded-[var(--radius-md)] border border-border`,children:[`month`,`week`].map(n=>(0,i.jsx)(`button`,{type:`button`,onClick:()=>pe(n),"aria-pressed":H===n,className:e.t(`h-8 px-3 text-xs capitalize transition-colors focus-visible:z-10`,t.s,H===n?`bg-muted text-foreground font-medium`:`text-muted-foreground hover:bg-surface-muted hover:text-foreground`),children:n},n))})]}),N&&(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-warning/8 px-3 py-3 sm:px-4`,children:[(0,i.jsxs)(`span`,{className:`text-xs font-medium text-foreground`,children:[`New event on `,N.toLocaleDateString(),`:`]}),(0,i.jsx)(`input`,{autoFocus:!0,value:F,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key===`Enter`&&X(N),e.key===`Escape`&&(P(null),I(``),z(`09:00`))},placeholder:`Event title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,value:R,onChange:e=>z(e.target.value),className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsxs)(`select`,{"aria-label":`Event color`,value:L,onChange:e=>de(e.target.value),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2 text-xs text-foreground`,children:[(0,i.jsx)(`option`,{value:`blue`,children:`Blue`}),(0,i.jsx)(`option`,{value:`green`,children:`Green`}),(0,i.jsx)(`option`,{value:`red`,children:`Red`}),(0,i.jsx)(`option`,{value:`yellow`,children:`Yellow`}),(0,i.jsx)(`option`,{value:`purple`,children:`Purple`}),(0,i.jsx)(`option`,{value:`orange`,children:`Orange`})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>X(N),className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Add`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{P(null),I(``),z(`09:00`)},className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}),B&&(()=>{let e=G.find(e=>e.id===B);return e?(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border bg-surface-muted px-3 py-3 sm:px-4`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Edit event:`}),(0,i.jsx)(`input`,{autoFocus:!0,defaultValue:e.title,onKeyDown:t=>{if(t.key===`Enter`){let n=t.target.value,r=document.getElementById(`cal-edit-time-${e.id}`)?.value??e.time??``;n.trim()&&Q({...e,title:n.trim(),time:r||void 0})}t.key===`Escape`&&V(null)},id:`cal-edit-${e.id}`,placeholder:`Title`,className:`h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`input`,{type:`time`,defaultValue:e.time??``,id:`cal-edit-time-${e.id}`,className:`h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>{let t=document.getElementById(`cal-edit-${e.id}`),n=document.getElementById(`cal-edit-time-${e.id}`),r=t?.value??e.title,i=n?.value??``;r.trim()&&Q({...e,title:r.trim(),time:i||void 0})},className:`h-7 px-3 rounded-md bg-primary text-xs font-medium text-primary-foreground hover:bg-primary-hover`,children:`Save`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>Z(e.id),className:`h-7 rounded-[var(--radius-md)] bg-destructive px-2.5 text-xs font-medium text-destructive-foreground hover:bg-destructive-hover`,children:`Delete`}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>V(null),className:`h-7 rounded-[var(--radius-md)] border border-border bg-surface px-2.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Cancel`})]}):null})(),(0,i.jsx)(`div`,{className:`relative flex-1 overflow-x-auto`,children:(0,i.jsx)(`div`,{className:`min-w-[42rem]`,children:(0,i.jsx)(n.AnimatePresence,{mode:`popLayout`,initial:!1,custom:j,children:Se!==null&&U!==null&&(0,i.jsx)(n.motion.div,{custom:j,variants:f,initial:`enter`,animate:`center`,exit:`exit`,transition:{duration:.18,ease:`easeInOut`},children:H===`month`?(0,i.jsx)(p,{viewDate:U,...xe}):(0,i.jsx)(m,{viewDate:U,...xe})},Se)})})})]})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./cn-
|
|
2
|
-
import { c as t, s as n } from "./component-styles-
|
|
1
|
+
import { t as e } from "./cn-BJyZJP-y.js";
|
|
2
|
+
import { c as t, s as n } from "./component-styles-C2CbHEEA.js";
|
|
3
3
|
import { AnimatePresence as r, motion as i } from "framer-motion";
|
|
4
4
|
import { useEffect as a, useState as o } from "react";
|
|
5
5
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -103,7 +103,7 @@ function v({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
|
|
|
103
103
|
onKeyDown: (e) => {
|
|
104
104
|
!S && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
|
|
105
105
|
},
|
|
106
|
-
className: e("p-1.5 transition-colors group/cell", "border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-
|
|
106
|
+
className: e("p-1.5 transition-colors group/cell", "border-border focus-visible:z-10 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", !s && "border-r", !u && "border-b", !x && "bg-black/[0.015] dark:bg-white/[0.015]", S ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
|
|
107
107
|
children: [/* @__PURE__ */ l("div", {
|
|
108
108
|
className: "flex items-center justify-between mb-1",
|
|
109
109
|
children: [/* @__PURE__ */ c("span", {
|
|
@@ -179,7 +179,7 @@ function y({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
|
|
|
179
179
|
onKeyDown: (e) => {
|
|
180
180
|
!s && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
|
|
181
181
|
},
|
|
182
|
-
className: e("group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-
|
|
182
|
+
className: e("group/whead flex flex-col items-center gap-1 py-3 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted"),
|
|
183
183
|
children: [
|
|
184
184
|
/* @__PURE__ */ c("span", {
|
|
185
185
|
className: "text-[10px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wide",
|
|
@@ -214,7 +214,7 @@ function y({ viewDate: t, today: n, value: r, events: i, onSelect: a, onEventCli
|
|
|
214
214
|
onKeyDown: (e) => {
|
|
215
215
|
!s && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a(t));
|
|
216
216
|
},
|
|
217
|
-
className: e("space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-
|
|
217
|
+
className: e("space-y-1.5 p-2 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-focus-ring/35", !i && "border-r border-border", s ? "cursor-not-allowed opacity-40" : "cursor-pointer hover:bg-surface-muted/70"),
|
|
218
218
|
children: r.map((t) => /* @__PURE__ */ l("div", {
|
|
219
219
|
className: e("group/wev flex items-start gap-1 rounded-[var(--radius-md)] border px-2 py-1.5", p[t.color ?? "blue"], v === t.id && "ring-1 ring-focus-ring"),
|
|
220
220
|
children: [/* @__PURE__ */ l("button", {
|
|
@@ -423,13 +423,13 @@ function b({ value: s, defaultValue: u = null, onChange: d, events: p, defaultEv
|
|
|
423
423
|
e.key === "Enter" && Ce(P), e.key === "Escape" && (F(null), L(""), B("09:00"));
|
|
424
424
|
},
|
|
425
425
|
placeholder: "Event title",
|
|
426
|
-
className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-
|
|
426
|
+
className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
|
|
427
427
|
}),
|
|
428
428
|
/* @__PURE__ */ c("input", {
|
|
429
429
|
type: "time",
|
|
430
430
|
value: z,
|
|
431
431
|
onChange: (e) => B(e.target.value),
|
|
432
|
-
className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-
|
|
432
|
+
className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
|
|
433
433
|
}),
|
|
434
434
|
/* @__PURE__ */ l("select", {
|
|
435
435
|
"aria-label": "Event color",
|
|
@@ -504,13 +504,13 @@ function b({ value: s, defaultValue: u = null, onChange: d, events: p, defaultEv
|
|
|
504
504
|
},
|
|
505
505
|
id: `cal-edit-${e.id}`,
|
|
506
506
|
placeholder: "Title",
|
|
507
|
-
className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-
|
|
507
|
+
className: "h-7 flex-1 min-w-[140px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
|
|
508
508
|
}),
|
|
509
509
|
/* @__PURE__ */ c("input", {
|
|
510
510
|
type: "time",
|
|
511
511
|
defaultValue: e.time ?? "",
|
|
512
512
|
id: `cal-edit-time-${e.id}`,
|
|
513
|
-
className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-
|
|
513
|
+
className: "h-7 w-[110px] rounded-md border border-border bg-surface px-2 text-xs text-foreground focus:outline-none focus:ring-[3px] focus:ring-focus-ring/25"
|
|
514
514
|
}),
|
|
515
515
|
/* @__PURE__ */ c("button", {
|
|
516
516
|
type: "button",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./cn-B6R3HKzx.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime"),i=require("react-dom");var a=[`var(--chart-1)`,`var(--chart-2)`,`var(--chart-3)`,`var(--chart-4)`,`var(--chart-5)`,`var(--chart-6)`],o=[`var(--color-accent-700)`,`var(--color-accent-600)`,`var(--color-accent-500)`,`var(--color-accent-400)`,`var(--color-accent-300)`,`var(--color-accent-200)`];function s(e,t){let n=e<=t?1:Math.ceil(e/t);return t=>t%n===0||t===e-1}function c({tooltip:e}){return!e||typeof document>`u`?null:(0,i.createPortal)((0,r.jsx)(`div`,{className:`pointer-events-none fixed z-[9999] px-3 py-2 rounded-[var(--radius-md)] border border-border bg-surface-raised shadow-floating text-sm text-foreground whitespace-nowrap`,style:{left:e.x+14,top:e.y-10},children:e.content}),document.body)}function l({data:t,height:i=220,color:a=`var(--chart-1)`,showValues:o=!1,gridLines:s=4,orientation:l=`vertical`,className:d,formatValue:f=String}){let[p,m]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),[_,v]=(0,n.useState)(!1),y=(0,n.useId)().replace(/:/g,``),b=Math.max(...t.map(e=>e.value),1);if((0,n.useEffect)(()=>{let e=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(e)},[]),l===`horizontal`)return(0,r.jsx)(u,{data:t,height:i,color:a,showValues:o,gridLines:s,className:d,formatValue:f});let x=100/t.length,S=x*.18,C=x-S*2,w=e=>e/100*i;return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none`,d),style:{height:i},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full text-black dark:text-white`,children:[(0,r.jsx)(`defs`,{children:t.map((e,t)=>{let n=e.color??a;return(0,r.jsxs)(`linearGradient`,{id:`${y}-bcg-${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`0%`,stopColor:n,stopOpacity:`1`}),(0,r.jsx)(`stop`,{offset:`100%`,stopColor:n,stopOpacity:`0.45`})]},t)})}),Array.from({length:s+1}).map((e,t)=>{let n=6+t/s*82;return(0,r.jsx)(`line`,{x1:`0`,y1:n,x2:`100`,y2:n,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.35`},t)}),t.map((e,t)=>{let n=Math.max(e.value/b*82,e.value>0?.5:0),i=t*x+S,a=88-n,o=.45,s=t*.05;return(0,r.jsx)(`rect`,{x:i,width:C,rx:`1.2`,y:_?a:88,height:_?n:0,onMouseEnter:()=>g(t),onMouseMove:t=>m({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.label}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:f(e.value)})]})}),onMouseLeave:()=>{g(null),m(null)},className:`cursor-pointer`,style:{fill:`url(#${y}-bcg-${t})`,fillOpacity:h!==null&&h!==t?.35:1,transition:_?`y ${o}s ${s}s cubic-bezier(0.25,0.46,0.45,0.94), height ${o}s ${s}s cubic-bezier(0.25,0.46,0.45,0.94), fill-opacity 0.12s`:`none`}},t)}),(0,r.jsx)(`line`,{x1:`0`,y1:88,x2:`100`,y2:88,stroke:`currentColor`,strokeOpacity:`0.1`,strokeWidth:`0.35`})]}),(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 flex`,style:{height:20},children:t.map((e,t)=>(0,r.jsx)(`div`,{className:`flex-1 text-center text-xs text-slate-500 truncate px-1 leading-5`,children:e.label},t))}),o&&(0,r.jsx)(`div`,{className:`absolute inset-x-0 top-0 pointer-events-none`,style:{bottom:20},children:t.map((e,n)=>{let i=e.value/b,a=w(6+(1-i)*82);return(0,r.jsx)(`div`,{className:`absolute flex justify-center`,style:{left:`${n/t.length*100}%`,width:`${100/t.length}%`,top:a,transform:`translateY(calc(-100% - 4px))`},children:(0,r.jsx)(`span`,{className:`text-xs font-semibold text-slate-500 dark:text-slate-400 leading-none tabular-nums`,children:f(e.value)})},n)})}),(0,r.jsx)(c,{tooltip:p})]})}function u({data:t,color:i,showValues:a,className:o,formatValue:s=String}){let[l,u]=(0,n.useState)(null),[d,f]=(0,n.useState)(null),[p,m]=(0,n.useState)(!1),h=Math.max(...t.map(e=>e.value),1);return(0,n.useEffect)(()=>{let e=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(e)},[]),(0,r.jsxs)(`div`,{className:e.t(`w-full select-none flex flex-col gap-2.5`,o),children:[t.map((e,t)=>{let n=e.value/h*100,o=e.color??i??`var(--chart-1)`,c=d===t;return(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsx)(`span`,{className:`text-xs text-slate-600 dark:text-slate-300 text-right shrink-0 leading-none`,style:{width:64},children:e.label}),(0,r.jsxs)(`div`,{className:`flex-1 h-8 relative rounded-md bg-black/5 dark:bg-white/5 overflow-hidden`,children:[(0,r.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 rounded-md cursor-pointer`,style:{width:p?`${n}%`:0,background:`linear-gradient(90deg, ${o}70, ${o})`,opacity:d!==null&&!c?.35:1,outline:c?`1.5px solid ${o}`:`none`,outlineOffset:-1,transition:p?`width 0.45s ${t*.05}s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.12s`:`none`},onMouseEnter:()=>f(t),onMouseMove:t=>u({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.label}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:s(e.value)})]})}),onMouseLeave:()=>{f(null),u(null)}}),a&&(0,r.jsx)(`div`,{className:`absolute top-0 bottom-0 flex items-center pointer-events-none`,style:{left:`${n}%`,paddingLeft:8},children:(0,r.jsx)(`span`,{className:`text-xs font-semibold text-slate-600 dark:text-slate-300 tabular-nums whitespace-nowrap`,children:s(e.value)})})]})]},t)}),(0,r.jsx)(c,{tooltip:l})]})}function d({data:i,height:a=220,color:o=`var(--chart-1)`,area:l=!0,dots:u=!0,gridLines:d=4,className:f,formatValue:p=String,smooth:m=!0,showXLabels:h=!0,maxLabels:g=8}){let[_,v]=(0,n.useState)(null),y=(0,n.useId)().replace(/:/g,``),b=Math.max(...i.map(e=>e.value),1),x=Math.min(...i.map(e=>e.value),0),S=b-x||1,C=i.length,w=i.map((e,t)=>({x:C===1?50:t/(C-1)*92+4,y:90-(e.value-x)/S*80,d:e}));function T(e){if(e.length===0)return``;if(!m||e.length<3)return e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`).join(` `);let t=`M${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2;t+=` C${a},${r.y} ${a},${i.y} ${i.x},${i.y}`}return t}let E=T(w),D=E?`${E} L${w[w.length-1].x},92 L${w[0].x},92 Z`:``,O=s(C,g);return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none`,f),style:{height:a},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full overflow-visible text-black dark:text-white`,children:[(0,r.jsx)(`defs`,{children:(0,r.jsxs)(`linearGradient`,{id:`${y}-ag`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`0%`,stopColor:o,stopOpacity:`0.25`}),(0,r.jsx)(`stop`,{offset:`100%`,stopColor:o,stopOpacity:`0.02`})]})}),Array.from({length:d+1}).map((e,t)=>{let n=t/d*84+4;return(0,r.jsx)(`line`,{x1:`4`,y1:n,x2:`96`,y2:n,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.3`},t)}),l&&D&&(0,r.jsx)(`path`,{d:D,fill:`url(#${y}-ag)`,style:{pointerEvents:`none`}}),E&&(0,r.jsx)(t.motion.path,{d:E,fill:`none`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`,initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{duration:.8,ease:`easeOut`},style:{stroke:o,pointerEvents:`none`}}),u&&w.map((e,n)=>(0,r.jsxs)(`g`,{children:[(0,r.jsx)(t.motion.circle,{cx:e.x,cy:e.y,r:`1.2`,style:{fill:o,pointerEvents:`none`},initial:{opacity:0},animate:{opacity:1},transition:{delay:.6+n*.03,duration:.2}}),(0,r.jsx)(`circle`,{cx:e.x,cy:e.y,r:`5`,fill:`transparent`,className:`cursor-pointer`,onMouseMove:t=>v({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.d.label}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:p(e.d.value)})]})}),onMouseLeave:()=>v(null)})]},n))]}),h&&(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0`,style:{height:20},children:i.map((e,t)=>e.label&&O(t)?(0,r.jsx)(`span`,{className:`absolute text-xs text-slate-600 dark:text-slate-400 whitespace-nowrap leading-5 select-none`,style:{left:`${C===1?50:t/(C-1)*92+4}%`,transform:`translateX(-50%)`},children:e.label},t):null)}),(0,r.jsx)(c,{tooltip:_})]})}var f=a;function p({labels:i,series:a,height:o=220,area:l=!0,dots:u=!0,gridLines:d=4,className:p,formatValue:m=String,maxLabels:h=8}){let[g,_]=(0,n.useState)(null),v=(0,n.useId)().replace(/:/g,``),y=a.flatMap(e=>e.data),b=Math.max(...y,1),x=Math.min(...y,0),S=b-x||1,C=i.length,w=s(C,h);function T(e){return e.map((e,t)=>({x:C===1?50:t/(C-1)*92+4,y:90-(e-x)/S*80}))}function E(e){if(e.length<2)return``;let t=`M${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2;t+=` C${a},${r.y} ${a},${i.y} ${i.x},${i.y}`}return t}return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none`,p),style:{height:o},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full overflow-visible text-black dark:text-white`,children:[(0,r.jsx)(`defs`,{children:a.map((e,t)=>{let n=e.color??f[t%f.length];return(0,r.jsxs)(`linearGradient`,{id:`${v}-mlg-${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`0%`,stopColor:n,stopOpacity:`0.2`}),(0,r.jsx)(`stop`,{offset:`100%`,stopColor:n,stopOpacity:`0.01`})]},t)})}),Array.from({length:d+1}).map((e,t)=>(0,r.jsx)(`line`,{x1:`4`,y1:t/d*84+4,x2:`96`,y2:t/d*84+4,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.3`},t)),a.map((e,n)=>{let a=e.color??f[n%f.length],o=T(e.data),s=E(o),c=s?`${s} L${o[o.length-1].x},92 L${o[0].x},92 Z`:``;return(0,r.jsxs)(`g`,{children:[l&&c&&(0,r.jsx)(`path`,{d:c,fill:`url(#${v}-mlg-${n})`,style:{pointerEvents:`none`}}),s&&(0,r.jsx)(t.motion.path,{d:s,fill:`none`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`,initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{delay:n*.1,duration:.7,ease:`easeOut`},style:{stroke:a,pointerEvents:`none`}}),u&&o.map((o,s)=>(0,r.jsxs)(`g`,{children:[(0,r.jsx)(t.motion.circle,{cx:o.x,cy:o.y,r:`1.2`,style:{fill:a,pointerEvents:`none`},initial:{opacity:0},animate:{opacity:1},transition:{delay:.7+n*.1+s*.02}}),(0,r.jsx)(`circle`,{cx:o.x,cy:o.y,r:`5`,fill:`transparent`,className:`cursor-pointer`,onMouseMove:t=>_({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsxs)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:[i[s],` · `,e.label]}),(0,r.jsx)(`span`,{className:`font-semibold`,style:{color:a},children:m(e.data[s])})]})}),onMouseLeave:()=>_(null)})]},s))]},n)})]}),(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0`,style:{height:20},children:i.map((e,t)=>e&&w(t)?(0,r.jsx)(`span`,{className:`absolute text-xs text-slate-600 dark:text-slate-400 whitespace-nowrap leading-5 select-none`,style:{left:`${C===1?50:t/(C-1)*92+4}%`,transform:`translateX(-50%)`},children:e},t):null)}),(0,r.jsx)(c,{tooltip:g})]})}var m=a;function h({data:i,size:a=190,thickness:o=28,centerLabel:s,className:l}){let[u,d]=(0,n.useState)(null),[f,p]=(0,n.useState)(null),h=i.reduce((e,t)=>e+t.value,0)||1,g=50-o/2,_=2*Math.PI*g,v=0,y=i.map((e,t)=>{let n=e.value/h,r=v;return v+=n,{...e,frac:n,offset:r,color:e.color??m[t%m.length]}});return(0,r.jsxs)(`div`,{className:e.t(`inline-flex flex-col items-center gap-5`,l),children:[(0,r.jsxs)(`div`,{className:`relative`,style:{width:a,height:a},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`w-full h-full -rotate-90 text-black dark:text-white`,children:[(0,r.jsx)(`circle`,{cx:50,cy:50,r:g,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:o/2}),y.map((e,n)=>{let i=e.frac*_,a=_-i,s=e.offset*360;return(0,r.jsx)(t.motion.circle,{cx:50,cy:50,r:g,fill:`none`,stroke:e.color,strokeWidth:f===n?o/2+1.5:o/2,strokeDasharray:`${i} ${a}`,strokeDashoffset:0,transform:`rotate(${s} 50 50)`,style:{strokeOpacity:f!==null&&f!==n?.35:.9,transition:`stroke-opacity 0.15s, stroke-width 0.15s`,pointerEvents:`all`},initial:{strokeDasharray:`0 ${_}`},animate:{strokeDasharray:`${i} ${a}`},transition:{delay:n*.08,duration:.5,ease:`easeOut`},onMouseMove:t=>{p(n),d({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.label}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.value}),(0,r.jsxs)(`span`,{className:`text-slate-500 ml-1.5`,children:[`(`,(e.frac*100).toFixed(1),`%)`]})]})})},onMouseLeave:()=>{p(null),d(null)},className:`cursor-pointer`},n)})]}),s&&(0,r.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,children:s})]}),(0,r.jsx)(`div`,{className:`flex flex-wrap justify-center gap-x-5 gap-y-2`,children:y.map((e,t)=>(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full shrink-0`,style:{backgroundColor:e.color}}),(0,r.jsx)(`span`,{className:`text-sm text-slate-500`,children:e.label})]},t))}),(0,r.jsx)(c,{tooltip:u})]})}var g=a;function _({series:t,height:i=260,xLabel:a,gridLines:o=4,className:s,formatX:l=String,formatY:u=String}){let[d,f]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),h=t.flatMap(e=>e.data.map(e=>e.x)),_=t.flatMap(e=>e.data.map(e=>e.y)),v=Math.min(...h),y=Math.max(...h),b=Math.min(..._),x=Math.max(..._),S=y-v||1,C=x-b||1,w=(e,t)=>({left:8+(e-v)/S*88,top:6+(x-t)/C*82});return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none`,s),style:{height:i},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full text-black dark:text-white`,children:[Array.from({length:o+1}).map((e,t)=>{let n=6+t/o*82,i=8+t/o*88;return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:8,y1:n,x2:96,y2:n,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.35`}),(0,r.jsx)(`line`,{x1:i,y1:6,x2:i,y2:88,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.35`})]},t)}),(0,r.jsx)(`line`,{x1:8,y1:88,x2:96,y2:88,stroke:`currentColor`,strokeOpacity:`0.12`,strokeWidth:`0.4`}),(0,r.jsx)(`line`,{x1:8,y1:6,x2:8,y2:88,stroke:`currentColor`,strokeOpacity:`0.12`,strokeWidth:`0.4`})]}),t.map((e,t)=>{let n=e.color??g[t%g.length];return e.data.map((i,a)=>{let{left:o,top:s}=w(i.x,i.y),c=(i.r??1)*10,d=`${t}-${a}`,h=p===d;return(0,r.jsx)(`div`,{style:{position:`absolute`,left:`${o}%`,top:`${s}%`,width:c,height:c,borderRadius:`50%`,transform:`translate(-50%, -50%)`,backgroundColor:i.color??n,opacity:p&&!h?.2:.85,outline:h?`2px solid rgba(255,255,255,0.55)`:`none`,outlineOffset:2,cursor:`pointer`,transition:`opacity 0.12s`,zIndex:h?10:1},onMouseEnter:()=>m(d),onMouseMove:t=>f({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(i.label||e.label)&&(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:i.label??e.label}),(0,r.jsxs)(`span`,{className:`font-semibold text-foreground`,children:[`(`,l(i.x),`, `,u(i.y),`)`]})]})}),onMouseLeave:()=>{m(null),f(null)}},d)})}),a&&(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 text-center pointer-events-none`,children:(0,r.jsx)(`span`,{className:`text-xs text-slate-600 dark:text-slate-400`,children:a})}),t.length>1&&(0,r.jsx)(`div`,{className:`absolute top-2 right-2 flex flex-col gap-2 pointer-events-none`,children:t.map((e,t)=>(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full shrink-0`,style:{backgroundColor:e.color??g[t%g.length]}}),(0,r.jsx)(`span`,{className:`text-xs text-slate-500`,children:e.label})]},t))}),(0,r.jsx)(c,{tooltip:d})]})}var v=a;function y({tasks:t,total:i,xLabels:a,rowHeight:o=42,className:s}){let[l,u]=(0,n.useState)(null),[d,f]=(0,n.useState)(null),[p,m]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(e)},[]);let h=i??Math.max(...t.map(e=>e.end),1),g=t.length*o+28;return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none overflow-x-auto`,s),children:[(0,r.jsxs)(`div`,{style:{height:g,minWidth:360},className:`relative`,children:[(0,r.jsx)(`div`,{className:`absolute inset-0 flex pointer-events-none`,style:{bottom:28},children:Array.from({length:h+1}).map((e,t)=>(0,r.jsx)(`div`,{className:`h-full border-l border-black/6 dark:border-white/6 flex-shrink-0`,style:{width:`${100/h}%`}},t))}),t.map((e,t)=>{let n=e.color??v[t%v.length],i=e.start/h*100,a=(e.end-e.start)/h*100,s=d===e.id;return(0,r.jsx)(`div`,{className:`absolute left-0 right-0 flex items-center`,style:{top:t*o,height:o},children:(0,r.jsx)(`div`,{className:`absolute rounded-md flex items-center px-2.5 cursor-pointer`,style:{left:`${i}%`,width:p?`${a}%`:0,top:`18%`,height:`64%`,backgroundColor:n,opacity:d&&!s?.35:.85,outline:s?`1.5px solid ${n}`:`none`,outlineOffset:2,transition:p?`width 0.45s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.12s`:`none`},onMouseEnter:()=>f(e.id),onMouseMove:t=>u({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`font-semibold text-foreground mr-2`,children:e.label}),(0,r.jsxs)(`span`,{className:`text-slate-500 dark:text-slate-400`,children:[e.start,`–`,e.end]})]})}),onMouseLeave:()=>{f(null),u(null)},children:(0,r.jsx)(`span`,{className:`text-xs font-medium text-foreground truncate leading-none select-none`,children:e.label})})},e.id)}),(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 flex border-t border-black/[0.07] dark:border-white/[0.07]`,style:{height:28},children:(a??Array.from({length:h},(e,t)=>String(t+1))).map((e,t)=>(0,r.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-slate-600 dark:text-slate-400 truncate`,children:e},t))})]}),(0,r.jsx)(c,{tooltip:l})]})}function b({data:t,rowLabels:i,colLabels:a,color:o=`var(--chart-1)`,cellSize:s=34,className:l,formatValue:u=String}){let[d,f]=(0,n.useState)(null),p=t.flat(),m=Math.min(...p),h=Math.max(...p,1)-m||1,g=e=>.08+(e-m)/h*.88,_=i?56:0;return(0,r.jsxs)(`div`,{className:e.t(`select-none overflow-x-auto`,l),children:[(0,r.jsxs)(`div`,{style:{display:`inline-flex`,flexDirection:`column`,gap:3},children:[a&&(0,r.jsx)(`div`,{style:{display:`flex`,gap:3,paddingLeft:_+3},children:a.map((e,t)=>(0,r.jsx)(`div`,{style:{width:s,flexShrink:0},className:`text-center text-xs text-slate-600 dark:text-slate-400 leading-none truncate`,children:e},t))}),t.map((e,t)=>(0,r.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:3},children:[i&&(0,r.jsx)(`div`,{style:{width:_,flexShrink:0},className:`text-xs text-slate-600 dark:text-slate-400 text-right pr-2 leading-none truncate`,children:i[t]}),e.map((e,n)=>(0,r.jsx)(`div`,{"data-heatmap-cell":``,style:{width:s,height:s,flexShrink:0,backgroundColor:o,opacity:g(e),borderRadius:5,cursor:`pointer`,transition:`background-color 0.12s, opacity 0.12s`},onMouseMove:o=>f({x:o.clientX,y:o.clientY,content:(0,r.jsxs)(`span`,{children:[i?.[t]&&(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-1.5`,children:i[t]}),a?.[n]&&(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:a[n]}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:u(e)})]})}),onMouseLeave:()=>f(null)},n))]},t))]}),(0,r.jsx)(c,{tooltip:d})]})}var x=a;function S({axes:t,series:i,size:a=240,gridLines:o=4,className:s}){let[l,u]=(0,n.useState)(null),d=t.length,f=e=>Math.PI*2*e/d-Math.PI/2,p=(e,t)=>({x:50+e*Math.cos(f(t)),y:50+e*Math.sin(f(t))}),m=Math.max(...i.flatMap(e=>e.data),1),h=e=>e.map((e,t)=>{let{x:n,y:r}=p(e/m*38,t);return`${t===0?`M`:`L`}${n},${r}`}).join(` `)+`Z`;return(0,r.jsxs)(`div`,{className:e.t(`inline-flex flex-col items-center gap-4`,s),children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,style:{width:a,height:a},className:`text-black dark:text-white`,children:[Array.from({length:o}).map((e,t)=>{let n=38*((t+1)/o),i=Array.from({length:d},(e,t)=>p(n,t)).map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`).join(` `)+`Z`;return(0,r.jsx)(`path`,{d:i,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.08`,strokeWidth:`0.4`},t)}),t.map((e,t)=>{let{x:n,y:i}=p(38,t);return(0,r.jsx)(`line`,{x1:50,y1:50,x2:n,y2:i,stroke:`currentColor`,strokeOpacity:`0.1`,strokeWidth:`0.4`},t)}),i.map((e,n)=>{let i=e.color??x[n%x.length];return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`path`,{d:h(e.data),fill:i,fillOpacity:`0.12`,style:{stroke:i,strokeWidth:1.2,strokeOpacity:.85,strokeLinejoin:`round`}}),e.data.map((e,n)=>{let{x:a,y:o}=p(e/m*38,n);return(0,r.jsx)(`circle`,{cx:a,cy:o,r:`1.5`,style:{fill:i,fillOpacity:.9,cursor:`pointer`},onMouseMove:a=>u({x:a.clientX,y:a.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:t[n]}),(0,r.jsx)(`span`,{className:`font-semibold`,style:{color:i},children:e})]})}),onMouseLeave:()=>u(null)},n)})]},n)}),t.map((e,t)=>{let{x:n,y:i}=p(46,t);return(0,r.jsx)(`text`,{x:n,y:i,textAnchor:n<48?`end`:n>52?`start`:`middle`,dominantBaseline:`middle`,fontSize:`5.5`,fill:`currentColor`,className:`text-slate-600 dark:text-slate-400`,children:e},t)})]}),i.length>1&&(0,r.jsx)(`div`,{className:`flex items-center gap-5`,children:i.map((e,t)=>(0,r.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,r.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full shrink-0`,style:{backgroundColor:e.color??x[t%x.length]}}),(0,r.jsx)(`span`,{className:`text-sm text-slate-600 dark:text-slate-300`,children:e.label})]},t))}),(0,r.jsx)(c,{tooltip:l})]})}var C=o;function w({data:t,className:i,formatValue:a=String}){let[o,s]=(0,n.useState)(null),[l,u]=(0,n.useState)(null),[d,f]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(e)},[]);let p=Math.max(...t.map(e=>e.value),1);return(0,r.jsxs)(`div`,{className:e.t(`w-full select-none flex flex-col gap-2`,i),children:[t.map((e,n)=>{let i=18+e.value/p*82,o=e.color??C[n%C.length],c=l===n,f=n>0?(e.value/t[0].value*100).toFixed(0):null;return(0,r.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,r.jsx)(`span`,{className:`text-sm text-slate-800 dark:text-slate-100 font-[500] text-right shrink-0 leading-none truncate`,style:{width:80},children:e.label}),(0,r.jsx)(`div`,{className:`flex-1 flex justify-center`,children:(0,r.jsx)(`div`,{className:`relative h-10 rounded-md flex items-center justify-center cursor-pointer`,style:{width:d?`${i}%`:`18%`,backgroundColor:o,opacity:l!==null&&!c?.3:c?1:.78,boxShadow:c?`0 0 0 2px ${o}88`:`none`,transition:d?`width 0.45s ${n*.06}s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.12s, box-shadow 0.12s`:`none`},onMouseEnter:()=>u(n),onMouseMove:t=>s({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.label}),(0,r.jsx)(`span`,{className:`font-semibold text-foreground`,children:a(e.value)}),f&&(0,r.jsxs)(`span`,{className:`text-slate-500 dark:text-slate-400 ml-2`,children:[f,`% of total`]})]})}),onMouseLeave:()=>{u(null),s(null)}})}),(0,r.jsxs)(`div`,{className:`shrink-0 text-right`,style:{width:80},children:[(0,r.jsx)(`span`,{className:`text-sm font-semibold text-slate-800 dark:text-slate-100 tabular-nums leading-none`,children:a(e.value)}),f&&(0,r.jsxs)(`span`,{className:`ml-2 text-xs text-slate-500 dark:text-slate-400 tabular-nums`,children:[f,`%`]})]})]},n)}),(0,r.jsx)(c,{tooltip:o})]})}function T({data:t,height:i=240,className:a,formatValue:o=String}){let[s,l]=(0,n.useState)(null),[u,d]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),m=(0,n.useId)().replace(/:/g,``);(0,n.useEffect)(()=>{let e=requestAnimationFrame(()=>p(!0));return()=>cancelAnimationFrame(e)},[]);let h=0,g=t.map(e=>{let t=e.total?0:h;e.total||(h+=e.value);let n=e.total?h:t+e.value;return{...e,base:t,end:n,color:e.color??(e.total?`var(--color-slate-500)`:e.value>=0?`var(--chart-2)`:`var(--chart-4)`)}}),_=g.flatMap(e=>[e.base,e.end]),v=Math.min(..._,0),y=Math.max(..._,1),b=y-v||1,x=e=>6+(y-e)/b*82,S=100/g.length,C=S*.2,w=S-C*2;return(0,r.jsxs)(`div`,{className:e.t(`relative w-full select-none`,a),style:{height:i},children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,className:`absolute inset-0 w-full h-full text-slate-900 dark:text-white`,children:[(0,r.jsx)(`defs`,{children:g.map((e,t)=>(0,r.jsxs)(`linearGradient`,{id:`${m}-wf-${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:`1`}),(0,r.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:`0.5`})]},t))}),v<0&&(0,r.jsx)(`line`,{x1:`0`,y1:x(0),x2:`100`,y2:x(0),stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:`0.4`,strokeDasharray:`2 2`}),[.25,.5,.75].map((e,t)=>(0,r.jsx)(`line`,{x1:`0`,y1:6+e*82,x2:`100`,y2:6+e*82,stroke:`currentColor`,strokeOpacity:`0.07`,strokeWidth:`0.35`},t)),g.map((e,t)=>{if(t===g.length-1)return null;let n=(t+1)*S+C,i=t*S+C+w,a=x(e.end);return(0,r.jsx)(`line`,{x1:i,y1:a,x2:n,y2:a,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`0.35`,strokeDasharray:`1.5 1`},t)}),g.map((e,t)=>{let n=x(Math.max(e.base,e.end)),i=x(Math.min(e.base,e.end)),a=Math.max(i-n,.5),s=t*S+C,c=.4,p=t*.05;return(0,r.jsx)(`rect`,{x:s,width:w,rx:`1.2`,y:f?n:i,height:f?a:0,onMouseEnter:()=>d(t),onMouseMove:t=>l({x:t.clientX,y:t.clientY,content:(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:`text-slate-500 dark:text-slate-400 mr-2`,children:e.label}),(0,r.jsxs)(`span`,{className:`font-semibold`,style:{color:e.color},children:[e.value>=0&&!e.total?`+`:``,o(e.value)]})]})}),onMouseLeave:()=>{d(null),l(null)},className:`cursor-pointer`,style:{fill:`url(#${m}-wf-${t})`,fillOpacity:u!==null&&u!==t?.35:1,transition:f?`y ${c}s ${p}s cubic-bezier(0.25,0.46,0.45,0.94), height ${c}s ${p}s cubic-bezier(0.25,0.46,0.45,0.94), fill-opacity 0.12s`:`none`}},t)}),(0,r.jsx)(`line`,{x1:`0`,y1:88,x2:`100`,y2:88,stroke:`currentColor`,strokeOpacity:`0.1`,strokeWidth:`0.35`})]}),(0,r.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 flex`,style:{height:20},children:g.map((t,n)=>(0,r.jsx)(`div`,{className:e.t(`flex-1 text-center text-xs truncate px-1 leading-5`,t.total?`text-slate-500 dark:text-slate-400 font-medium`:`text-slate-500`),children:t.label},n))}),(0,r.jsx)(c,{tooltip:s})]})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return l}});
|