@dynamic-labs-sdk/droplet 1.50.0 → 1.52.0
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 +0 -1
- package/dist/components/copy-button/copy-button.d.ts +3 -1
- package/dist/components/copy-button/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button/copy-button.stories.d.ts +1 -1
- package/dist/components/toggle-card/toggle-card.d.ts +10 -0
- package/dist/components/toggle-card/toggle-card.d.ts.map +1 -1
- package/dist/components/toggle-card/toggle-card.stories.d.ts +5 -0
- package/dist/components/toggle-card/toggle-card.stories.d.ts.map +1 -1
- package/dist/components/toggle-row/toggle-row.d.ts +22 -1
- package/dist/components/toggle-row/toggle-row.d.ts.map +1 -1
- package/dist/components/toggle-row/toggle-row.stories.d.ts +10 -6
- package/dist/components/toggle-row/toggle-row.stories.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +54 -12
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts +12 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts.map +1 -1
- package/dist/components/ui/field/field-control-context.d.ts +20 -0
- package/dist/components/ui/field/field-control-context.d.ts.map +1 -0
- package/dist/components/ui/field/field.d.ts +24 -4
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.stories.d.ts +26 -6
- package/dist/components/ui/field/field.stories.d.ts.map +1 -1
- package/dist/components/ui/field/use-field-feedback.d.ts +25 -0
- package/dist/components/ui/field/use-field-feedback.d.ts.map +1 -0
- package/dist/components/ui/label/label.d.ts +15 -0
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/select/select.stories.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +7 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/well/index.d.ts +1 -1
- package/dist/components/ui/well/index.d.ts.map +1 -1
- package/dist/components/ui/well/well-reveal.stories.d.ts.map +1 -1
- package/dist/components/ui/well/well.d.ts +18 -3
- package/dist/components/ui/well/well.d.ts.map +1 -1
- package/dist/components/ui/well/well.stories.d.ts +1 -9
- package/dist/components/ui/well/well.stories.d.ts.map +1 -1
- package/dist/index.cjs +995 -407
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +796 -205
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -6
- package/src/styles/globals.css +11 -15
- package/dist/components/migration/banner/banner.d.ts +0 -24
- package/dist/components/migration/banner/banner.d.ts.map +0 -1
- package/dist/components/migration/banner/banner.stories.d.ts +0 -39
- package/dist/components/migration/banner/banner.stories.d.ts.map +0 -1
- package/dist/components/migration/banner/index.d.ts +0 -2
- package/dist/components/migration/banner/index.d.ts.map +0 -1
- package/dist/components/migration/double-section/double-section.d.ts +0 -29
- package/dist/components/migration/double-section/double-section.d.ts.map +0 -1
- package/dist/components/migration/double-section/double-section.stories.d.ts +0 -32
- package/dist/components/migration/double-section/double-section.stories.d.ts.map +0 -1
- package/dist/components/migration/double-section/index.d.ts +0 -2
- package/dist/components/migration/double-section/index.d.ts.map +0 -1
- package/dist/components/migration/field/field.d.ts +0 -19
- package/dist/components/migration/field/field.d.ts.map +0 -1
- package/dist/components/migration/field/field.stories.d.ts +0 -43
- package/dist/components/migration/field/field.stories.d.ts.map +0 -1
- package/dist/components/migration/field/index.d.ts +0 -2
- package/dist/components/migration/field/index.d.ts.map +0 -1
- package/dist/components/migration/index.d.ts +0 -16
- package/dist/components/migration/index.d.ts.map +0 -1
- package/dist/components/migration/settings-section-v2/index.d.ts +0 -2
- package/dist/components/migration/settings-section-v2/index.d.ts.map +0 -1
- package/dist/components/migration/settings-section-v2/settings-section-v2.d.ts +0 -45
- package/dist/components/migration/settings-section-v2/settings-section-v2.d.ts.map +0 -1
- package/dist/components/migration/settings-section-v2/settings-section-v2.stories.d.ts +0 -40
- package/dist/components/migration/settings-section-v2/settings-section-v2.stories.d.ts.map +0 -1
- package/dist/components/migration/sub-section/index.d.ts +0 -2
- package/dist/components/migration/sub-section/index.d.ts.map +0 -1
- package/dist/components/migration/sub-section/sub-section.d.ts +0 -26
- package/dist/components/migration/sub-section/sub-section.d.ts.map +0 -1
- package/dist/components/migration/sub-section/sub-section.stories.d.ts +0 -33
- package/dist/components/migration/sub-section/sub-section.stories.d.ts.map +0 -1
- package/dist/components/migration/toggle-group/index.d.ts +0 -2
- package/dist/components/migration/toggle-group/index.d.ts.map +0 -1
- package/dist/components/migration/toggle-group/toggle-group.d.ts +0 -22
- package/dist/components/migration/toggle-group/toggle-group.d.ts.map +0 -1
- package/dist/components/migration/toggle-group/toggle-group.stories.d.ts +0 -30
- package/dist/components/migration/toggle-group/toggle-group.stories.d.ts.map +0 -1
- package/dist/components/patterns/config-tab-with-pill/config-tab-with-pill.stories.d.ts +0 -17
- package/dist/components/patterns/config-tab-with-pill/config-tab-with-pill.stories.d.ts.map +0 -1
- package/dist/components/patterns/cors-list/cors-list.stories.d.ts +0 -17
- package/dist/components/patterns/cors-list/cors-list.stories.d.ts.map +0 -1
- package/dist/components/patterns/rounded-row-list/rounded-row-list.stories.d.ts +0 -17
- package/dist/components/patterns/rounded-row-list/rounded-row-list.stories.d.ts.map +0 -1
- package/dist/components/status-badge/index.d.ts +0 -2
- package/dist/components/status-badge/index.d.ts.map +0 -1
- package/dist/components/status-badge/status-badge.d.ts +0 -10
- package/dist/components/status-badge/status-badge.d.ts.map +0 -1
- package/dist/components/status-badge/status-badge.stories.d.ts +0 -24
- package/dist/components/status-badge/status-badge.stories.d.ts.map +0 -1
- package/dist/components/ui/flush-card-detach/flush-card-detach.stories.d.ts +0 -17
- package/dist/components/ui/flush-card-detach/flush-card-detach.stories.d.ts.map +0 -1
- package/dist/migration.cjs +0 -328
- package/dist/migration.cjs.map +0 -1
- package/dist/migration.esm.js +0 -322
- package/dist/migration.esm.js.map +0 -1
- package/dist/toggle-row-BBTk7_bT.cjs +0 -408
- package/dist/toggle-row-BBTk7_bT.cjs.map +0 -1
- package/dist/toggle-row-PqelNVXI.esm.js +0 -360
- package/dist/toggle-row-PqelNVXI.esm.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -25,7 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
|
|
28
|
+
let clsx = require("clsx");
|
|
29
|
+
let tailwind_merge = require("tailwind-merge");
|
|
29
30
|
let react = require("react");
|
|
30
31
|
let motion_react = require("motion/react");
|
|
31
32
|
let _hugeicons_react = require("@hugeicons/react");
|
|
@@ -49,14 +50,17 @@ let _radix_ui_react_popover = require("@radix-ui/react-popover");
|
|
|
49
50
|
_radix_ui_react_popover = __toESM(_radix_ui_react_popover);
|
|
50
51
|
let _radix_ui_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
51
52
|
let lucide_react = require("lucide-react");
|
|
53
|
+
let _paper_design_shaders_react = require("@paper-design/shaders-react");
|
|
54
|
+
let _radix_ui_react_label = require("@radix-ui/react-label");
|
|
55
|
+
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
52
56
|
let _radix_ui_react_radio_group = require("@radix-ui/react-radio-group");
|
|
53
57
|
_radix_ui_react_radio_group = __toESM(_radix_ui_react_radio_group);
|
|
54
58
|
let _radix_ui_react_scroll_area = require("@radix-ui/react-scroll-area");
|
|
55
59
|
_radix_ui_react_scroll_area = __toESM(_radix_ui_react_scroll_area);
|
|
56
|
-
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
57
60
|
let _radix_ui_react_separator = require("@radix-ui/react-separator");
|
|
58
61
|
let next_themes = require("next-themes");
|
|
59
62
|
let sonner = require("sonner");
|
|
63
|
+
let _radix_ui_react_switch = require("@radix-ui/react-switch");
|
|
60
64
|
let _tanstack_react_table = require("@tanstack/react-table");
|
|
61
65
|
let _tanstack_react_virtual = require("@tanstack/react-virtual");
|
|
62
66
|
let _radix_ui_react_tabs = require("@radix-ui/react-tabs");
|
|
@@ -65,8 +69,145 @@ let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
|
|
|
65
69
|
let next_link = require("next/link");
|
|
66
70
|
next_link = __toESM(next_link);
|
|
67
71
|
|
|
72
|
+
//#region src/lib/utils.ts
|
|
73
|
+
const cn = (...inputs) => (0, tailwind_merge.twMerge)((0, clsx.clsx)(inputs));
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/ui/spinner/spinner.tsx
|
|
77
|
+
/** Maps the `size` prop to Tailwind size utilities. */
|
|
78
|
+
const sizeMap = {
|
|
79
|
+
lg: "size-6",
|
|
80
|
+
md: "size-4",
|
|
81
|
+
sm: "size-3"
|
|
82
|
+
};
|
|
83
|
+
const Spinner = ({ className, size = "md" }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("output", {
|
|
84
|
+
"aria-label": "Loading",
|
|
85
|
+
className: "inline-flex",
|
|
86
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
87
|
+
viewBox: "0 0 24 24",
|
|
88
|
+
fill: "none",
|
|
89
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
90
|
+
className: cn("animate-spin motion-reduce:animate-none", sizeMap[size], className),
|
|
91
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
92
|
+
className: "opacity-25",
|
|
93
|
+
cx: "12",
|
|
94
|
+
cy: "12",
|
|
95
|
+
r: "10",
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
strokeWidth: "4"
|
|
98
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
99
|
+
className: "opacity-75",
|
|
100
|
+
fill: "currentColor",
|
|
101
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
102
|
+
})]
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/ui/button/button.tsx
|
|
108
|
+
const buttonVariants = (0, class_variance_authority.cva)("relative isolate inline-flex items-center justify-center gap-1.5 whitespace-nowrap select-none text-[13px] font-medium leading-[calc(18/13)] touch-manipulation transition-[background-color,color,opacity,box-shadow,transform,filter,scale] duration-150 ease-out active:scale-[0.96] motion-reduce:transition-none cursor-pointer border-0 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", {
|
|
109
|
+
compoundVariants: [
|
|
110
|
+
{
|
|
111
|
+
class: "min-w-16",
|
|
112
|
+
size: "sm",
|
|
113
|
+
variant: [
|
|
114
|
+
"default",
|
|
115
|
+
"destructive",
|
|
116
|
+
"outline",
|
|
117
|
+
"secondary"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
class: "min-w-20",
|
|
122
|
+
size: "default",
|
|
123
|
+
variant: [
|
|
124
|
+
"default",
|
|
125
|
+
"destructive",
|
|
126
|
+
"outline",
|
|
127
|
+
"secondary"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
class: "min-w-24",
|
|
132
|
+
size: "lg",
|
|
133
|
+
variant: [
|
|
134
|
+
"default",
|
|
135
|
+
"destructive",
|
|
136
|
+
"outline",
|
|
137
|
+
"secondary"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
defaultVariants: {
|
|
142
|
+
size: "default",
|
|
143
|
+
variant: "default"
|
|
144
|
+
},
|
|
145
|
+
variants: {
|
|
146
|
+
size: {
|
|
147
|
+
default: "rounded-md px-3 py-1.5 h-8 has-[>svg]:px-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
148
|
+
icon: "size-9 rounded-md",
|
|
149
|
+
"icon-sm": "size-7 rounded-md [&_svg:not([class*='size-'])]:size-3.5 relative before:absolute before:-inset-[8px] before:content-['']",
|
|
150
|
+
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3 relative before:absolute before:-inset-[10px] before:content-['']",
|
|
151
|
+
lg: "rounded-md px-5 py-2.5 h-10 has-[>svg]:px-4 [&_svg:not([class*='size-'])]:size-4",
|
|
152
|
+
sm: "rounded-md px-2.5 py-1 h-7 has-[>svg]:px-2 [&_svg:not([class*='size-'])]:size-3 before:absolute before:-inset-y-[6px] before:inset-x-0 before:content-['']",
|
|
153
|
+
xs: "rounded-md px-3 py-1 h-7 [&_svg:not([class*='size-'])]:size-3"
|
|
154
|
+
},
|
|
155
|
+
variant: {
|
|
156
|
+
default: "bg-(--action) text-white shadow-[0_0_0_1px_var(--action),var(--shadow-button)] hover:brightness-105 [text-shadow:0_1px_1px_rgba(0,0,0,0.16)]",
|
|
157
|
+
destructive: "bg-destructive text-white shadow-[0_0_0_1px_var(--destructive),var(--shadow-button)] hover:brightness-105 [text-shadow:0_1px_1px_rgba(0,0,0,0.16)] focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
158
|
+
ghost: "text-muted-foreground hover:bg-[#f8f8f9] hover:text-foreground dark:hover:bg-white/[0.06]",
|
|
159
|
+
link: "text-(--action) underline-offset-4 hover:underline",
|
|
160
|
+
outline: "bg-white shadow-[var(--shadow-input)] hover:bg-[#f8f8f9] hover:shadow-[var(--shadow-input-hover)] dark:bg-input/30 dark:hover:bg-white/[0.06]",
|
|
161
|
+
secondary: "bg-white shadow-[var(--shadow-secondary)] hover:bg-[#f8f8f9] hover:shadow-[var(--shadow-secondary-hover)] dark:bg-input/30 dark:hover:bg-white/[0.06]"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Primary clickable action button.
|
|
167
|
+
*
|
|
168
|
+
* Variants: `default` | `destructive` | `outline` | `secondary` | `ghost` | `link`.
|
|
169
|
+
* Sizes: `default` | `sm` | `xs` | `lg` | `icon` | `icon-sm` | `icon-xs`.
|
|
170
|
+
* Set `asChild` to render the button styles onto a child element (e.g. an anchor) instead of a `<button>`.
|
|
171
|
+
* Set `loading` to show an inline spinner before the label and disable interaction while an async action is pending.
|
|
172
|
+
* When `asChild` is true, `loading` is ignored — the Slot host cannot render an additional spinner child.
|
|
173
|
+
*/
|
|
174
|
+
const Button = ({ className, variant = "default", size = "default", asChild = false, loading = false, disabled, children, style, ...props }) => {
|
|
175
|
+
if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_slot.Slot, {
|
|
176
|
+
"data-slot": "button",
|
|
177
|
+
"data-size": size,
|
|
178
|
+
"data-variant": variant,
|
|
179
|
+
className: cn(buttonVariants({
|
|
180
|
+
className,
|
|
181
|
+
size,
|
|
182
|
+
variant
|
|
183
|
+
})),
|
|
184
|
+
...props,
|
|
185
|
+
disabled,
|
|
186
|
+
style,
|
|
187
|
+
children
|
|
188
|
+
});
|
|
189
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
190
|
+
"data-slot": "button",
|
|
191
|
+
"data-size": size,
|
|
192
|
+
"data-variant": variant,
|
|
193
|
+
className: cn(buttonVariants({
|
|
194
|
+
size,
|
|
195
|
+
variant
|
|
196
|
+
}), loading && "cursor-wait", className),
|
|
197
|
+
disabled: disabled || loading,
|
|
198
|
+
"aria-busy": loading || void 0,
|
|
199
|
+
style: loading ? {
|
|
200
|
+
opacity: 1,
|
|
201
|
+
...style
|
|
202
|
+
} : style,
|
|
203
|
+
...props,
|
|
204
|
+
children: [loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, { className: "size-3.5" }), children]
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
//#endregion
|
|
68
209
|
//#region src/components/unsaved-changes-bar/unsaved-changes-bar.tsx
|
|
69
|
-
const spring$
|
|
210
|
+
const spring$4 = {
|
|
70
211
|
bounce: 0,
|
|
71
212
|
duration: .35,
|
|
72
213
|
type: "spring"
|
|
@@ -104,7 +245,7 @@ const ProgressiveBlur = () => {
|
|
|
104
245
|
});
|
|
105
246
|
};
|
|
106
247
|
const popTransition = {
|
|
107
|
-
...spring$
|
|
248
|
+
...spring$4,
|
|
108
249
|
duration: .25
|
|
109
250
|
};
|
|
110
251
|
const StatusIcon = ({ state }) => {
|
|
@@ -203,7 +344,7 @@ const UnsavedChangesBar = ({ hasChanges, onSave, onReset, suppressed = false })
|
|
|
203
344
|
initial: { opacity: 0 },
|
|
204
345
|
animate: { opacity: 1 },
|
|
205
346
|
exit: { opacity: 0 },
|
|
206
|
-
transition: spring$
|
|
347
|
+
transition: spring$4,
|
|
207
348
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProgressiveBlur, {})
|
|
208
349
|
}, "blur") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
209
350
|
className: "fixed bottom-10 left-1/2 -translate-x-1/2 z-50",
|
|
@@ -223,7 +364,7 @@ const UnsavedChangesBar = ({ hasChanges, onSave, onReset, suppressed = false })
|
|
|
223
364
|
scale: .95,
|
|
224
365
|
y: 20
|
|
225
366
|
},
|
|
226
|
-
transition: spring$
|
|
367
|
+
transition: spring$4,
|
|
227
368
|
style: { willChange: "opacity, transform" },
|
|
228
369
|
className: "flex items-center gap-1.5 rounded-xl bg-zinc-900 dark:bg-[oklch(0.940_0.008_231)] shadow-[0_0_0_1px_rgba(0,0,0,0.08),0_8px_24px_-4px_rgba(0,0,0,0.25),0_20px_50px_-8px_rgba(0,0,0,0.20)] dark:shadow-[0_0_0_1px_rgba(0,0,0,0.08),0_8px_20px_-4px_rgba(0,0,0,0.10),0_20px_50px_-8px_rgba(0,0,0,0.08)] pl-3 pr-1.5 py-1.5",
|
|
229
370
|
children: [
|
|
@@ -234,13 +375,13 @@ const UnsavedChangesBar = ({ hasChanges, onSave, onReset, suppressed = false })
|
|
|
234
375
|
transition: popTransition,
|
|
235
376
|
className: "flex items-center gap-1.5 ml-0.5",
|
|
236
377
|
style: { pointerEvents: barState === "unsaved" ? "auto" : "none" },
|
|
237
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
378
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
238
379
|
variant: "ghost",
|
|
239
380
|
size: "sm",
|
|
240
381
|
className: "rounded-md text-zinc-400 hover:text-white hover:bg-white/10 dark:text-zinc-500 dark:hover:text-zinc-800 dark:hover:bg-black/[0.06] shrink-0 touch-manipulation",
|
|
241
382
|
onClick: onReset,
|
|
242
383
|
children: "Reset"
|
|
243
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
384
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
244
385
|
size: "sm",
|
|
245
386
|
className: "rounded-md shrink-0 touch-manipulation",
|
|
246
387
|
onClick: handleSave,
|
|
@@ -326,7 +467,7 @@ const Accordion = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_
|
|
|
326
467
|
const AccordionItem = ({ className, ...props }) => {
|
|
327
468
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Item, {
|
|
328
469
|
"data-slot": "accordion-item",
|
|
329
|
-
className:
|
|
470
|
+
className: cn("border-b border-[var(--border-divider)] last:border-b-0", className),
|
|
330
471
|
...props
|
|
331
472
|
});
|
|
332
473
|
};
|
|
@@ -335,7 +476,7 @@ const AccordionTrigger = ({ className, children, ...props }) => {
|
|
|
335
476
|
className: "flex",
|
|
336
477
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_accordion.Trigger, {
|
|
337
478
|
"data-slot": "accordion-trigger",
|
|
338
|
-
className:
|
|
479
|
+
className: cn("focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 rounded-md px-1 py-4 text-left text-sm font-medium touch-manipulation transition-[color,background-color,opacity] duration-150 ease-out motion-reduce:transition-none outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 cursor-pointer", className),
|
|
339
480
|
...props,
|
|
340
481
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
341
482
|
icon: _hugeicons_core_free_icons.ArrowRight01Icon,
|
|
@@ -351,7 +492,7 @@ const AccordionContent = ({ className, children, ...props }) => {
|
|
|
351
492
|
className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down motion-reduce:animate-none overflow-hidden text-sm",
|
|
352
493
|
...props,
|
|
353
494
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
354
|
-
className:
|
|
495
|
+
className: cn("px-1 pt-0 pb-4", className),
|
|
355
496
|
children
|
|
356
497
|
})
|
|
357
498
|
});
|
|
@@ -421,13 +562,13 @@ const renderTrayLayout = ({ children, isHeader, isFooter, tray = "auto", shelfCl
|
|
|
421
562
|
edge,
|
|
422
563
|
shellClassName: "bg-card"
|
|
423
564
|
};
|
|
424
|
-
const shellClassName =
|
|
565
|
+
const shellClassName = cn("flex flex-col bg-[var(--tray-chrome)] px-[var(--tray-inset)]", edge === "footer" ? "pt-[var(--tray-inset)]" : "pb-[var(--tray-inset)]");
|
|
425
566
|
return {
|
|
426
567
|
content: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
427
568
|
edge === "header" && trayChild,
|
|
428
569
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
429
570
|
"data-slot": "tray-shelf",
|
|
430
|
-
className:
|
|
571
|
+
className: cn("flex flex-1 flex-col overflow-hidden bg-card rounded-[var(--tray-shelf-radius)] shadow-[var(--tray-shelf-shadow)]", shelfClassName),
|
|
431
572
|
children: shelf
|
|
432
573
|
}),
|
|
433
574
|
edge === "footer" && trayChild
|
|
@@ -444,7 +585,7 @@ const AlertDialogTrigger = _radix_ui_react_alert_dialog.Trigger;
|
|
|
444
585
|
const AlertDialogPortal = _radix_ui_react_alert_dialog.Portal;
|
|
445
586
|
const AlertDialogOverlay = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_alert_dialog.Overlay, {
|
|
446
587
|
"data-slot": "alert-dialog-overlay",
|
|
447
|
-
className:
|
|
588
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[var(--overlay-md)] backdrop-blur-[2px] will-change-[opacity] duration-200 motion-reduce:animate-none", className),
|
|
448
589
|
...props
|
|
449
590
|
});
|
|
450
591
|
const AlertDialogContent = ({ className, size = "default", tray = "auto", children, ...props }) => {
|
|
@@ -458,48 +599,48 @@ const AlertDialogContent = ({ className, size = "default", tray = "auto", childr
|
|
|
458
599
|
"data-slot": "alert-dialog-content",
|
|
459
600
|
"data-size": size,
|
|
460
601
|
"data-tray": edge,
|
|
461
|
-
className:
|
|
602
|
+
className: cn("overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] rounded-[16px] border-0 shadow-[var(--shadow-elevated)] duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md will-change-[opacity,transform] motion-reduce:animate-none", shellClassName, className),
|
|
462
603
|
...props,
|
|
463
604
|
children: content
|
|
464
605
|
})] });
|
|
465
606
|
};
|
|
466
607
|
const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
467
608
|
"data-slot": "alert-dialog-header",
|
|
468
|
-
className:
|
|
609
|
+
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 px-5 py-4 bg-card text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
|
|
469
610
|
...props
|
|
470
611
|
});
|
|
471
612
|
const AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
472
613
|
"data-slot": "alert-dialog-footer",
|
|
473
|
-
className:
|
|
614
|
+
className: cn("grid grid-cols-2 gap-2 px-5 py-4 bg-muted", className),
|
|
474
615
|
...props
|
|
475
616
|
});
|
|
476
617
|
const AlertDialogTitle = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_alert_dialog.Title, {
|
|
477
618
|
"data-slot": "alert-dialog-title",
|
|
478
|
-
className:
|
|
619
|
+
className: cn("text-[17px] font-semibold text-balance sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
479
620
|
...props
|
|
480
621
|
});
|
|
481
622
|
const AlertDialogDescription = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_alert_dialog.Description, {
|
|
482
623
|
"data-slot": "alert-dialog-description",
|
|
483
|
-
className:
|
|
624
|
+
className: cn("text-muted-foreground text-sm text-pretty", className),
|
|
484
625
|
...props
|
|
485
626
|
});
|
|
486
|
-
const AlertDialogAction = ({ className, variant = "destructive", size = "default", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
627
|
+
const AlertDialogAction = ({ className, variant = "destructive", size = "default", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
487
628
|
variant,
|
|
488
629
|
size,
|
|
489
630
|
asChild: true,
|
|
490
631
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_alert_dialog.Action, {
|
|
491
632
|
"data-slot": "alert-dialog-action",
|
|
492
|
-
className:
|
|
633
|
+
className: cn(className),
|
|
493
634
|
...props
|
|
494
635
|
})
|
|
495
636
|
});
|
|
496
|
-
const AlertDialogCancel = ({ className, variant = "outline", size = "default", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
637
|
+
const AlertDialogCancel = ({ className, variant = "outline", size = "default", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
497
638
|
variant,
|
|
498
639
|
size,
|
|
499
640
|
asChild: true,
|
|
500
641
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_alert_dialog.Cancel, {
|
|
501
642
|
"data-slot": "alert-dialog-cancel",
|
|
502
|
-
className:
|
|
643
|
+
className: cn(className),
|
|
503
644
|
...props
|
|
504
645
|
})
|
|
505
646
|
});
|
|
@@ -510,49 +651,49 @@ const Avatar = ({ className, size = "default", ...props }) => {
|
|
|
510
651
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Root, {
|
|
511
652
|
"data-slot": "avatar",
|
|
512
653
|
"data-size": size,
|
|
513
|
-
className:
|
|
654
|
+
className: cn("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6", className),
|
|
514
655
|
...props
|
|
515
656
|
});
|
|
516
657
|
};
|
|
517
658
|
const AvatarImage = ({ className, ...props }) => {
|
|
518
659
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Image, {
|
|
519
660
|
"data-slot": "avatar-image",
|
|
520
|
-
className:
|
|
661
|
+
className: cn("aspect-square size-full outline-1 -outline-offset-1 outline-black/10", className),
|
|
521
662
|
...props
|
|
522
663
|
});
|
|
523
664
|
};
|
|
524
665
|
const AvatarFallback = ({ className, ...props }) => {
|
|
525
666
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_avatar.Fallback, {
|
|
526
667
|
"data-slot": "avatar-fallback",
|
|
527
|
-
className:
|
|
668
|
+
className: cn("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs", className),
|
|
528
669
|
...props
|
|
529
670
|
});
|
|
530
671
|
};
|
|
531
672
|
const AvatarBadge = ({ className, ...props }) => {
|
|
532
673
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
533
674
|
"data-slot": "avatar-badge",
|
|
534
|
-
className:
|
|
675
|
+
className: cn("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className),
|
|
535
676
|
...props
|
|
536
677
|
});
|
|
537
678
|
};
|
|
538
679
|
const AvatarGroup = ({ className, ...props }) => {
|
|
539
680
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
540
681
|
"data-slot": "avatar-group",
|
|
541
|
-
className:
|
|
682
|
+
className: cn("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2", className),
|
|
542
683
|
...props
|
|
543
684
|
});
|
|
544
685
|
};
|
|
545
686
|
const AvatarGroupCount = ({ className, ...props }) => {
|
|
546
687
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
547
688
|
"data-slot": "avatar-group-count",
|
|
548
|
-
className:
|
|
689
|
+
className: cn("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className),
|
|
549
690
|
...props
|
|
550
691
|
});
|
|
551
692
|
};
|
|
552
693
|
|
|
553
694
|
//#endregion
|
|
554
695
|
//#region src/components/ui/alert/alert.tsx
|
|
555
|
-
const spring$
|
|
696
|
+
const spring$3 = {
|
|
556
697
|
bounce: 0,
|
|
557
698
|
duration: .35,
|
|
558
699
|
type: "spring"
|
|
@@ -600,7 +741,7 @@ const Alert = ({ variant = "neutral", title, children, dismissible = false, onDi
|
|
|
600
741
|
role: variant === "danger" || variant === "warning" ? "alert" : "status",
|
|
601
742
|
"data-slot": "alert",
|
|
602
743
|
"data-variant": variant,
|
|
603
|
-
className:
|
|
744
|
+
className: cn(alertVariants({ variant }), className),
|
|
604
745
|
...props,
|
|
605
746
|
children: [
|
|
606
747
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -624,7 +765,7 @@ const Alert = ({ variant = "neutral", title, children, dismissible = false, onDi
|
|
|
624
765
|
type: "button",
|
|
625
766
|
"aria-label": "Dismiss",
|
|
626
767
|
whileTap: shouldReduceMotion ? void 0 : { scale: .96 },
|
|
627
|
-
transition: spring$
|
|
768
|
+
transition: spring$3,
|
|
628
769
|
onClick: () => {
|
|
629
770
|
setDismissed(true);
|
|
630
771
|
onDismiss?.();
|
|
@@ -677,7 +818,7 @@ const Badge = ({ className, variant = "neutral", asChild = false, ...props }) =>
|
|
|
677
818
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? _radix_ui_react_slot.Slot : "span", {
|
|
678
819
|
"data-slot": "badge",
|
|
679
820
|
"data-variant": variant,
|
|
680
|
-
className:
|
|
821
|
+
className: cn(badgeVariants({ variant }), className),
|
|
681
822
|
...props
|
|
682
823
|
});
|
|
683
824
|
};
|
|
@@ -692,7 +833,7 @@ const Badge = ({ className, variant = "neutral", asChild = false, ...props }) =>
|
|
|
692
833
|
const Breadcrumb = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
693
834
|
"data-slot": "breadcrumb",
|
|
694
835
|
"aria-label": "breadcrumb",
|
|
695
|
-
className:
|
|
836
|
+
className: cn("", className),
|
|
696
837
|
...props
|
|
697
838
|
});
|
|
698
839
|
/**
|
|
@@ -701,7 +842,7 @@ const Breadcrumb = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_ru
|
|
|
701
842
|
*/
|
|
702
843
|
const BreadcrumbList = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
703
844
|
"data-slot": "breadcrumb-list",
|
|
704
|
-
className:
|
|
845
|
+
className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className),
|
|
705
846
|
...props
|
|
706
847
|
});
|
|
707
848
|
/**
|
|
@@ -711,7 +852,7 @@ const BreadcrumbList = ({ className, ...props }) => /* @__PURE__ */ (0, react_js
|
|
|
711
852
|
*/
|
|
712
853
|
const BreadcrumbItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
713
854
|
"data-slot": "breadcrumb-item",
|
|
714
|
-
className:
|
|
855
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
715
856
|
...props
|
|
716
857
|
});
|
|
717
858
|
/**
|
|
@@ -730,7 +871,7 @@ const BreadcrumbItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_js
|
|
|
730
871
|
const BreadcrumbLink = ({ asChild = false, className, children, ...props }) => {
|
|
731
872
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? _radix_ui_react_slot.Slot : "a", {
|
|
732
873
|
"data-slot": "breadcrumb-link",
|
|
733
|
-
className:
|
|
874
|
+
className: cn("transition-colors duration-150 ease-out hover:text-foreground motion-reduce:transition-none", className),
|
|
734
875
|
...props,
|
|
735
876
|
children
|
|
736
877
|
});
|
|
@@ -745,7 +886,7 @@ const BreadcrumbLink = ({ asChild = false, className, children, ...props }) => {
|
|
|
745
886
|
const BreadcrumbPage = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
746
887
|
"data-slot": "breadcrumb-page",
|
|
747
888
|
"aria-current": "page",
|
|
748
|
-
className:
|
|
889
|
+
className: cn("font-normal text-foreground", className),
|
|
749
890
|
...props,
|
|
750
891
|
children
|
|
751
892
|
});
|
|
@@ -758,7 +899,7 @@ const BreadcrumbPage = ({ className, children, ...props }) => /* @__PURE__ */ (0
|
|
|
758
899
|
const BreadcrumbSeparator = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
759
900
|
"data-slot": "breadcrumb-separator",
|
|
760
901
|
"aria-hidden": "true",
|
|
761
|
-
className:
|
|
902
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
762
903
|
...props,
|
|
763
904
|
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
764
905
|
icon: _hugeicons_core_free_icons.ArrowRight01Icon,
|
|
@@ -777,7 +918,7 @@ const BreadcrumbSeparator = ({ className, children, ...props }) => /* @__PURE__
|
|
|
777
918
|
const BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
778
919
|
"data-slot": "breadcrumb-ellipsis",
|
|
779
920
|
"aria-hidden": "true",
|
|
780
|
-
className:
|
|
921
|
+
className: cn("flex size-6 items-center justify-center", className),
|
|
781
922
|
...props,
|
|
782
923
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
783
924
|
icon: _hugeicons_core_free_icons.MoreHorizontalIcon,
|
|
@@ -802,35 +943,35 @@ const Card = ({ className, interactive = false, selected = false, tray = "none",
|
|
|
802
943
|
"data-slot": "card",
|
|
803
944
|
"data-selected": selected || void 0,
|
|
804
945
|
"data-tray": edge,
|
|
805
|
-
className:
|
|
946
|
+
className: cn("text-card-foreground flex flex-col rounded-[16px] border-0 shadow-[var(--shadow-card)] overflow-hidden", shellClassName, interactive && "cursor-pointer transition-[box-shadow,transform] duration-150 ease-out motion-reduce:transition-none hover:shadow-[var(--shadow-elevated)] active:scale-[0.99]", selected && "shadow-[0_0_0_2px_var(--action),var(--shadow-card)]", className),
|
|
806
947
|
...props,
|
|
807
948
|
children: content
|
|
808
949
|
});
|
|
809
950
|
};
|
|
810
951
|
const CardHeader = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
811
952
|
"data-slot": "card-header",
|
|
812
|
-
className:
|
|
953
|
+
className: cn("@container/card-header relative flex flex-col gap-0.5 px-4 py-3.5 bg-card border-b border-[var(--border-divider)]", className),
|
|
813
954
|
...props
|
|
814
955
|
});
|
|
815
956
|
const CardTitle = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
816
957
|
"data-slot": "card-title",
|
|
817
|
-
className:
|
|
958
|
+
className: cn("text-base leading-none font-semibold text-balance", className),
|
|
818
959
|
...props,
|
|
819
960
|
children
|
|
820
961
|
});
|
|
821
962
|
const CardDescription = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
822
963
|
"data-slot": "card-description",
|
|
823
|
-
className:
|
|
964
|
+
className: cn("text-muted-foreground text-sm text-pretty", className),
|
|
824
965
|
...props
|
|
825
966
|
});
|
|
826
967
|
const CardContent = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
827
968
|
"data-slot": "card-content",
|
|
828
|
-
className:
|
|
969
|
+
className: cn("flex-1 px-4 py-3 bg-card", className),
|
|
829
970
|
...props
|
|
830
971
|
});
|
|
831
972
|
const CardFooter = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
832
973
|
"data-slot": "card-footer",
|
|
833
|
-
className:
|
|
974
|
+
className: cn("mt-auto flex items-center justify-end gap-2 px-4 py-3.5 border-t border-[var(--border-divider)] bg-muted", className),
|
|
834
975
|
...props
|
|
835
976
|
});
|
|
836
977
|
|
|
@@ -861,14 +1002,15 @@ const CheckIcon = ({ size = 14, strokeWidth = 3, className, ...props }) => /* @_
|
|
|
861
1002
|
const Checkbox = ({ className, ...props }) => {
|
|
862
1003
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_checkbox.Root, {
|
|
863
1004
|
"data-slot": "checkbox",
|
|
864
|
-
className:
|
|
1005
|
+
className: cn("group peer dark:bg-input/30 data-[state=checked]:bg-[var(--action)] data-[state=checked]:text-white dark:data-[state=checked]:bg-[var(--action)] data-[state=indeterminate]:bg-[var(--action)] data-[state=indeterminate]:text-white relative size-4 shrink-0 touch-manipulation rounded-[4px] border-0 shadow-[var(--shadow-control)] dark:shadow-[var(--shadow-control)] hover:data-[state=unchecked]:shadow-[var(--shadow-control-hover)] dark:hover:data-[state=unchecked]:shadow-[var(--shadow-control-hover)] data-[state=checked]:shadow-[var(--shadow-control-checked)] dark:data-[state=checked]:shadow-[var(--shadow-control-checked)] data-[state=indeterminate]:shadow-[var(--shadow-control-checked)] dark:data-[state=indeterminate]:shadow-[var(--shadow-control-checked)] transition-[color,box-shadow,background-color] duration-200 ease-out motion-reduce:transition-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:shadow-[0_0_0_1px_var(--destructive)] disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer after:absolute after:-inset-[14px] after:content-['']", className),
|
|
865
1006
|
...props,
|
|
866
1007
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_checkbox.Indicator, {
|
|
867
1008
|
"data-slot": "checkbox-indicator",
|
|
868
1009
|
className: "relative grid place-content-center text-current size-full",
|
|
869
1010
|
forceMount: true,
|
|
870
1011
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
871
|
-
|
|
1012
|
+
"aria-hidden": "true",
|
|
1013
|
+
className: "size-3.5 text-current absolute inset-0 m-auto transition-[opacity,transform,filter] duration-200 motion-reduce:transition-none opacity-0 scale-[0.25] blur-[4px] group-data-[state=indeterminate]:opacity-100 group-data-[state=indeterminate]:scale-100 group-data-[state=indeterminate]:blur-none",
|
|
872
1014
|
viewBox: "0 0 24 24",
|
|
873
1015
|
fill: "none",
|
|
874
1016
|
stroke: "currentColor",
|
|
@@ -880,7 +1022,8 @@ const Checkbox = ({ className, ...props }) => {
|
|
|
880
1022
|
strokeWidth: 3
|
|
881
1023
|
})
|
|
882
1024
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
883
|
-
|
|
1025
|
+
"aria-hidden": "true",
|
|
1026
|
+
className: "size-3.5 text-current absolute inset-0 m-auto transition-[opacity,transform,filter] duration-200 motion-reduce:transition-none opacity-0 scale-[0.25] blur-[4px] group-data-[state=checked]:opacity-100 group-data-[state=checked]:scale-100 group-data-[state=checked]:blur-none",
|
|
884
1027
|
viewBox: "0 0 24 24",
|
|
885
1028
|
fill: "none",
|
|
886
1029
|
stroke: "currentColor",
|
|
@@ -922,14 +1065,14 @@ const CollapsibleTrigger = ({ className, children, ...props }) => {
|
|
|
922
1065
|
if (keepsCallerPressScale) pressScaleClassName = "";
|
|
923
1066
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_collapsible.CollapsibleTrigger, {
|
|
924
1067
|
"data-slot": "collapsible-trigger",
|
|
925
|
-
className:
|
|
1068
|
+
className: cn("touch-manipulation", pressScaleClassName, className),
|
|
926
1069
|
...props,
|
|
927
1070
|
children
|
|
928
1071
|
});
|
|
929
1072
|
};
|
|
930
1073
|
const CollapsibleContent = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_collapsible.CollapsibleContent, {
|
|
931
1074
|
"data-slot": "collapsible-content",
|
|
932
|
-
className:
|
|
1075
|
+
className: cn("overflow-hidden", "data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up", "motion-reduce:animate-none", className),
|
|
933
1076
|
...props
|
|
934
1077
|
});
|
|
935
1078
|
|
|
@@ -947,7 +1090,7 @@ const DialogPortal = _radix_ui_react_dialog.Portal;
|
|
|
947
1090
|
const DialogClose = _radix_ui_react_dialog.Close;
|
|
948
1091
|
const DialogOverlay = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Overlay, {
|
|
949
1092
|
"data-slot": "dialog-overlay",
|
|
950
|
-
className:
|
|
1093
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[var(--overlay-md)] backdrop-blur-[2px] will-change-[opacity] duration-200 data-[state=open]:ease-out data-[state=closed]:ease-in motion-reduce:animate-none", className),
|
|
951
1094
|
...props
|
|
952
1095
|
});
|
|
953
1096
|
const DialogContent = ({ className, children, tray = "auto", ...props }) => {
|
|
@@ -962,7 +1105,7 @@ const DialogContent = ({ className, children, tray = "auto", ...props }) => {
|
|
|
962
1105
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Content, {
|
|
963
1106
|
"data-slot": "dialog-content",
|
|
964
1107
|
"data-tray": edge,
|
|
965
|
-
className:
|
|
1108
|
+
className: cn("overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] rounded-[16px] border-0 shadow-[var(--shadow-elevated)] duration-200 data-[state=open]:ease-out data-[state=closed]:ease-in outline-none sm:max-w-md will-change-[opacity,transform] motion-reduce:animate-none", shellClassName, className),
|
|
966
1109
|
...props,
|
|
967
1110
|
children: content
|
|
968
1111
|
})]
|
|
@@ -980,7 +1123,7 @@ const DialogContent = ({ className, children, tray = "auto", ...props }) => {
|
|
|
980
1123
|
const CLOSE_BUTTON_CLASS_NAME = "absolute top-3 right-3 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground opacity-70 transition-[opacity,background-color] duration-150 ease-out motion-reduce:transition-none hover:opacity-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus:outline-hidden cursor-pointer touch-manipulation before:absolute before:-inset-[8px] before:content-[\"\"]";
|
|
981
1124
|
const DialogHeader = ({ className, showCloseButton = true, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
982
1125
|
"data-slot": "dialog-header",
|
|
983
|
-
className:
|
|
1126
|
+
className: cn("relative flex flex-col gap-0.5 px-4 py-4 border-b border-[var(--border-hairline)] bg-card sm:text-left", showCloseButton && "pr-12", className),
|
|
984
1127
|
...props,
|
|
985
1128
|
children: [children, showCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dialog.Close, {
|
|
986
1129
|
"data-slot": "dialog-close",
|
|
@@ -996,16 +1139,16 @@ const DialogHeader = ({ className, showCloseButton = true, children, ...props })
|
|
|
996
1139
|
});
|
|
997
1140
|
const DialogBody = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
998
1141
|
"data-slot": "dialog-body",
|
|
999
|
-
className:
|
|
1142
|
+
className: cn("px-4 py-[18px] bg-card", className),
|
|
1000
1143
|
...props
|
|
1001
1144
|
});
|
|
1002
1145
|
const DialogFooter = ({ className, showCloseButton = false, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1003
1146
|
"data-slot": "dialog-footer",
|
|
1004
|
-
className:
|
|
1147
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end px-3 py-3.5 border-t border-[var(--border-divider)] bg-muted", className),
|
|
1005
1148
|
...props,
|
|
1006
1149
|
children: [children, showCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Close, {
|
|
1007
1150
|
asChild: true,
|
|
1008
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1151
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1009
1152
|
variant: "outline",
|
|
1010
1153
|
children: "Close"
|
|
1011
1154
|
})
|
|
@@ -1013,12 +1156,12 @@ const DialogFooter = ({ className, showCloseButton = false, children, ...props }
|
|
|
1013
1156
|
});
|
|
1014
1157
|
const DialogTitle = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
|
|
1015
1158
|
"data-slot": "dialog-title",
|
|
1016
|
-
className:
|
|
1159
|
+
className: cn("text-[17px] leading-none font-semibold text-balance", className),
|
|
1017
1160
|
...props
|
|
1018
1161
|
});
|
|
1019
1162
|
const DialogDescription = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, {
|
|
1020
1163
|
"data-slot": "dialog-description",
|
|
1021
|
-
className:
|
|
1164
|
+
className: cn("text-muted-foreground text-sm text-pretty", className),
|
|
1022
1165
|
...props
|
|
1023
1166
|
});
|
|
1024
1167
|
|
|
@@ -1026,13 +1169,13 @@ const DialogDescription = ({ className, ...props }) => /* @__PURE__ */ (0, react
|
|
|
1026
1169
|
//#region src/components/ui/command/command.tsx
|
|
1027
1170
|
const Command = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command, {
|
|
1028
1171
|
"data-slot": "command",
|
|
1029
|
-
className:
|
|
1172
|
+
className: cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
|
|
1030
1173
|
...props
|
|
1031
1174
|
});
|
|
1032
1175
|
const CommandDialog = ({ title = "Command Palette", description = "Search for a command to run...", children, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog, {
|
|
1033
1176
|
...props,
|
|
1034
1177
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogContent, {
|
|
1035
|
-
className:
|
|
1178
|
+
className: cn("overflow-hidden p-0", className),
|
|
1036
1179
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogHeader, {
|
|
1037
1180
|
className: "sr-only",
|
|
1038
1181
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogTitle, { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogDescription, { children: description })]
|
|
@@ -1051,13 +1194,13 @@ const CommandInput = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_
|
|
|
1051
1194
|
className: "shrink-0 text-muted-foreground/70"
|
|
1052
1195
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Input, {
|
|
1053
1196
|
"data-slot": "command-input",
|
|
1054
|
-
className:
|
|
1197
|
+
className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
1055
1198
|
...props
|
|
1056
1199
|
})]
|
|
1057
1200
|
});
|
|
1058
1201
|
const CommandList = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.List, {
|
|
1059
1202
|
"data-slot": "command-list",
|
|
1060
|
-
className:
|
|
1203
|
+
className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto p-1", className),
|
|
1061
1204
|
...props
|
|
1062
1205
|
});
|
|
1063
1206
|
const CommandEmpty = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Empty, {
|
|
@@ -1067,22 +1210,22 @@ const CommandEmpty = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx
|
|
|
1067
1210
|
});
|
|
1068
1211
|
const CommandGroup = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Group, {
|
|
1069
1212
|
"data-slot": "command-group",
|
|
1070
|
-
className:
|
|
1213
|
+
className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className),
|
|
1071
1214
|
...props
|
|
1072
1215
|
});
|
|
1073
1216
|
const CommandSeparator = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Separator, {
|
|
1074
1217
|
"data-slot": "command-separator",
|
|
1075
|
-
className:
|
|
1218
|
+
className: cn("bg-border -mx-1 h-px", className),
|
|
1076
1219
|
...props
|
|
1077
1220
|
});
|
|
1078
1221
|
const CommandItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Item, {
|
|
1079
1222
|
"data-slot": "command-item",
|
|
1080
|
-
className:
|
|
1223
|
+
className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
1081
1224
|
...props
|
|
1082
1225
|
});
|
|
1083
1226
|
const CommandShortcut = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1084
1227
|
"data-slot": "command-shortcut",
|
|
1085
|
-
className:
|
|
1228
|
+
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
1086
1229
|
...props
|
|
1087
1230
|
});
|
|
1088
1231
|
|
|
@@ -1101,7 +1244,7 @@ const PopoverContent = ({ className, align = "center", sideOffset = 8, ...props
|
|
|
1101
1244
|
"data-slot": "popover-content",
|
|
1102
1245
|
align,
|
|
1103
1246
|
sideOffset,
|
|
1104
|
-
className:
|
|
1247
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-xl border-0 p-4 shadow-[var(--shadow-elevated)] outline-hidden will-change-[opacity,transform] motion-reduce:animate-none", className),
|
|
1105
1248
|
...props
|
|
1106
1249
|
}) });
|
|
1107
1250
|
};
|
|
@@ -1112,13 +1255,37 @@ const PopoverAnchor = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.js
|
|
|
1112
1255
|
|
|
1113
1256
|
//#endregion
|
|
1114
1257
|
//#region src/components/ui/combobox/combobox.tsx
|
|
1258
|
+
/** cmdk value of the select-all row; never matches a real option. */
|
|
1259
|
+
const SELECT_ALL_VALUE = "__droplet-combobox-select-all__";
|
|
1260
|
+
/**
|
|
1261
|
+
* Decorative `Checkbox` inside a multi-select option. The option row is the
|
|
1262
|
+
* control: it owns focus, the click target and the checked state for
|
|
1263
|
+
* assistive tech, so the checkbox is hidden from them and ignores pointer
|
|
1264
|
+
* events to avoid a second tab stop or a second announcement.
|
|
1265
|
+
*/
|
|
1266
|
+
const OptionCheckbox = ({ checked }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Checkbox, {
|
|
1267
|
+
checked,
|
|
1268
|
+
"aria-hidden": true,
|
|
1269
|
+
tabIndex: -1,
|
|
1270
|
+
className: "pointer-events-none after:hidden in-data-[selected=true]:data-[state=unchecked]:shadow-[var(--shadow-control-hover)]"
|
|
1271
|
+
});
|
|
1272
|
+
/** Checkbox state of the select-all row: indeterminate while only some are selected. */
|
|
1273
|
+
const getSelectAllState = ({ selectedCount, totalCount }) => {
|
|
1274
|
+
if (selectedCount === 0) return false;
|
|
1275
|
+
if (selectedCount === totalCount) return true;
|
|
1276
|
+
return "indeterminate";
|
|
1277
|
+
};
|
|
1115
1278
|
/**
|
|
1116
|
-
* Searchable single-select
|
|
1279
|
+
* Searchable Combobox, single-select by default or multi-select with `multiple`.
|
|
1117
1280
|
*
|
|
1118
|
-
* Composes `Popover`, `
|
|
1119
|
-
* The trigger is
|
|
1120
|
-
* signals open/closed state.
|
|
1121
|
-
*
|
|
1281
|
+
* Composes `Popover`, `Command` and `Checkbox` from the droplet design system.
|
|
1282
|
+
* The trigger is styled like `SelectTrigger` with a rotating chevron that
|
|
1283
|
+
* signals open/closed state.
|
|
1284
|
+
*
|
|
1285
|
+
* - Single-select: picking an item closes the popover, fires `onValueChange`
|
|
1286
|
+
* and shows a check mark next to the active selection.
|
|
1287
|
+
* - Multi-select: each option shows a `Checkbox`, picking an item toggles it
|
|
1288
|
+
* and keeps the popover open, and the trigger lists the selected labels.
|
|
1122
1289
|
*
|
|
1123
1290
|
* @example
|
|
1124
1291
|
* ```tsx
|
|
@@ -1129,18 +1296,49 @@ const PopoverAnchor = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.js
|
|
|
1129
1296
|
* onValueChange={setChain}
|
|
1130
1297
|
* placeholder="Select a chain"
|
|
1131
1298
|
* />
|
|
1299
|
+
*
|
|
1300
|
+
* const [chains, setChains] = useState<string[]>([]);
|
|
1301
|
+
* <Combobox
|
|
1302
|
+
* multiple
|
|
1303
|
+
* options={[{ value: 'eth', label: 'Ethereum' }, { value: 'sol', label: 'Solana' }]}
|
|
1304
|
+
* value={chains}
|
|
1305
|
+
* onValueChange={setChains}
|
|
1306
|
+
* selectAllLabel="All chains"
|
|
1307
|
+
* />
|
|
1132
1308
|
* ```
|
|
1133
1309
|
*/
|
|
1134
|
-
const Combobox = (
|
|
1310
|
+
const Combobox = (props) => {
|
|
1311
|
+
const { options, placeholder = "Select…", searchPlaceholder = "Search…", emptyText = "No results.", className, disabled = false } = props;
|
|
1135
1312
|
const [open, setOpen] = (0, react.useState)(false);
|
|
1136
|
-
const
|
|
1313
|
+
const [search, setSearch] = (0, react.useState)("");
|
|
1314
|
+
const selectedValues = props.multiple ? props.value : [props.value];
|
|
1315
|
+
const selectedOptions = options.filter((opt) => selectedValues.includes(opt.value));
|
|
1316
|
+
const selectedLabels = selectedOptions.map((opt) => opt.label);
|
|
1317
|
+
const selectedLabel = props.multiple && props.formatSelected && selectedLabels.length > 0 ? props.formatSelected(selectedLabels) : selectedLabels.join(", ") || void 0;
|
|
1318
|
+
const selectAllState = getSelectAllState({
|
|
1319
|
+
selectedCount: selectedOptions.length,
|
|
1320
|
+
totalCount: options.length
|
|
1321
|
+
});
|
|
1322
|
+
const showSelectAll = props.multiple && props.selectAllLabel !== void 0 && search === "";
|
|
1137
1323
|
const handleSelect = (selectedValue) => {
|
|
1138
|
-
|
|
1139
|
-
|
|
1324
|
+
if (!props.multiple) {
|
|
1325
|
+
props.onValueChange(selectedValue);
|
|
1326
|
+
handleOpenChange(false);
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
props.onValueChange(props.value.includes(selectedValue) ? props.value.filter((v) => v !== selectedValue) : [...props.value, selectedValue]);
|
|
1330
|
+
};
|
|
1331
|
+
const handleSelectAll = () => {
|
|
1332
|
+
if (!props.multiple) return;
|
|
1333
|
+
props.onValueChange(selectAllState === true ? [] : options.map((opt) => opt.value));
|
|
1334
|
+
};
|
|
1335
|
+
const handleOpenChange = (nextOpen) => {
|
|
1336
|
+
setOpen(nextOpen);
|
|
1337
|
+
if (!nextOpen) setSearch("");
|
|
1140
1338
|
};
|
|
1141
1339
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Popover, {
|
|
1142
1340
|
open,
|
|
1143
|
-
onOpenChange:
|
|
1341
|
+
onOpenChange: handleOpenChange,
|
|
1144
1342
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverTrigger, {
|
|
1145
1343
|
asChild: true,
|
|
1146
1344
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1149,14 +1347,14 @@ const Combobox = ({ options, value, onValueChange, placeholder = "Select…", se
|
|
|
1149
1347
|
"aria-expanded": open,
|
|
1150
1348
|
"aria-haspopup": "listbox",
|
|
1151
1349
|
disabled,
|
|
1152
|
-
className:
|
|
1350
|
+
className: cn("flex h-8 w-full touch-manipulation items-center justify-between gap-1.5 rounded-md border-0 bg-background px-3 text-[13px] whitespace-nowrap dark:bg-input/30", "shadow-[var(--shadow-input)] hover:shadow-[var(--shadow-input-hover)]", "transition-[color,box-shadow] duration-100 ease-out motion-reduce:transition-none", "outline-none focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo)]", "cursor-pointer disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
1153
1351
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1154
|
-
className:
|
|
1352
|
+
className: cn("truncate", !selectedLabel && "text-muted-foreground/60"),
|
|
1155
1353
|
children: selectedLabel ?? placeholder
|
|
1156
1354
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1157
1355
|
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
1158
1356
|
size: 16,
|
|
1159
|
-
className:
|
|
1357
|
+
className: cn("shrink-0 opacity-50 transition-transform duration-150 ease-out motion-reduce:transition-none", open && "rotate-180")
|
|
1160
1358
|
})]
|
|
1161
1359
|
})
|
|
1162
1360
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContent, {
|
|
@@ -1165,12 +1363,32 @@ const Combobox = ({ options, value, onValueChange, placeholder = "Select…", se
|
|
|
1165
1363
|
sideOffset: 4,
|
|
1166
1364
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Command, {
|
|
1167
1365
|
className: "rounded-[inherit]",
|
|
1168
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandInput, {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1366
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandInput, {
|
|
1367
|
+
placeholder: searchPlaceholder,
|
|
1368
|
+
value: search,
|
|
1369
|
+
onValueChange: setSearch
|
|
1370
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CommandList, {
|
|
1371
|
+
"aria-multiselectable": props.multiple || void 0,
|
|
1372
|
+
children: [
|
|
1373
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandEmpty, { children: emptyText }),
|
|
1374
|
+
showSelectAll && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CommandItem, {
|
|
1375
|
+
value: SELECT_ALL_VALUE,
|
|
1376
|
+
"aria-checked": selectAllState === "indeterminate" ? "mixed" : selectAllState,
|
|
1377
|
+
onSelect: handleSelectAll,
|
|
1378
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(OptionCheckbox, { checked: selectAllState }), props.selectAllLabel]
|
|
1379
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandSeparator, { className: "my-1" })] }),
|
|
1380
|
+
options.map((opt) => {
|
|
1381
|
+
const isSelected = selectedValues.includes(opt.value);
|
|
1382
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CommandItem, {
|
|
1383
|
+
value: opt.value,
|
|
1384
|
+
keywords: [opt.label],
|
|
1385
|
+
"aria-checked": props.multiple ? isSelected : void 0,
|
|
1386
|
+
onSelect: handleSelect,
|
|
1387
|
+
children: [props.multiple ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OptionCheckbox, { checked: isSelected }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, { className: cn("shrink-0", isSelected ? "opacity-100" : "opacity-0") }), opt.label]
|
|
1388
|
+
}, opt.value);
|
|
1389
|
+
})
|
|
1390
|
+
]
|
|
1391
|
+
})]
|
|
1174
1392
|
})
|
|
1175
1393
|
})]
|
|
1176
1394
|
});
|
|
@@ -1185,19 +1403,19 @@ const DropdownMenuSub = _radix_ui_react_dropdown_menu.Sub;
|
|
|
1185
1403
|
const DropdownMenuContent = (0, react.forwardRef)(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Content, {
|
|
1186
1404
|
ref,
|
|
1187
1405
|
sideOffset,
|
|
1188
|
-
className:
|
|
1406
|
+
className: cn("z-50 min-w-32 overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-[var(--shadow-elevated)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:animate-none", className),
|
|
1189
1407
|
...props
|
|
1190
1408
|
}) }));
|
|
1191
1409
|
DropdownMenuContent.displayName = _radix_ui_react_dropdown_menu.Content.displayName;
|
|
1192
1410
|
const DropdownMenuItem = (0, react.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Item, {
|
|
1193
1411
|
ref,
|
|
1194
|
-
className:
|
|
1412
|
+
className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-4", inset && "pl-8", className),
|
|
1195
1413
|
...props
|
|
1196
1414
|
}));
|
|
1197
1415
|
DropdownMenuItem.displayName = _radix_ui_react_dropdown_menu.Item.displayName;
|
|
1198
1416
|
const DropdownMenuCheckboxItem = (0, react.forwardRef)(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.CheckboxItem, {
|
|
1199
1417
|
ref,
|
|
1200
|
-
className:
|
|
1418
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
1201
1419
|
checked,
|
|
1202
1420
|
...props,
|
|
1203
1421
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1209,7 +1427,7 @@ DropdownMenuCheckboxItem.displayName = _radix_ui_react_dropdown_menu.CheckboxIte
|
|
|
1209
1427
|
const DropdownMenuRadioGroup = _radix_ui_react_dropdown_menu.RadioGroup;
|
|
1210
1428
|
const DropdownMenuRadioItem = (0, react.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.RadioItem, {
|
|
1211
1429
|
ref,
|
|
1212
|
-
className:
|
|
1430
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
1213
1431
|
...props,
|
|
1214
1432
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1215
1433
|
className: "absolute left-2 flex size-3.5 items-center justify-center",
|
|
@@ -1220,43 +1438,43 @@ DropdownMenuRadioItem.displayName = _radix_ui_react_dropdown_menu.RadioItem.disp
|
|
|
1220
1438
|
const DropdownMenuLabel = (0, react.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Label, {
|
|
1221
1439
|
ref,
|
|
1222
1440
|
"data-slot": "dropdown-menu-label",
|
|
1223
|
-
className:
|
|
1441
|
+
className: cn("px-2 py-1.5 text-sm font-medium", inset && "pl-8", className),
|
|
1224
1442
|
...props
|
|
1225
1443
|
}));
|
|
1226
1444
|
DropdownMenuLabel.displayName = _radix_ui_react_dropdown_menu.Label.displayName;
|
|
1227
1445
|
const DropdownMenuSeparator = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.Separator, {
|
|
1228
1446
|
ref,
|
|
1229
|
-
className:
|
|
1447
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1230
1448
|
...props
|
|
1231
1449
|
}));
|
|
1232
1450
|
DropdownMenuSeparator.displayName = _radix_ui_react_dropdown_menu.Separator.displayName;
|
|
1233
1451
|
const DropdownMenuShortcut = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1234
1452
|
"aria-hidden": "true",
|
|
1235
|
-
className:
|
|
1453
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
1236
1454
|
...props
|
|
1237
1455
|
});
|
|
1238
1456
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1239
1457
|
const DropdownMenuSubTrigger = (0, react.forwardRef)(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dropdown_menu.SubTrigger, {
|
|
1240
1458
|
ref,
|
|
1241
|
-
className:
|
|
1459
|
+
className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className),
|
|
1242
1460
|
...props,
|
|
1243
1461
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
1244
1462
|
}));
|
|
1245
1463
|
DropdownMenuSubTrigger.displayName = _radix_ui_react_dropdown_menu.SubTrigger.displayName;
|
|
1246
1464
|
const DropdownMenuSubContent = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dropdown_menu.SubContent, {
|
|
1247
1465
|
ref,
|
|
1248
|
-
className:
|
|
1466
|
+
className: cn("z-50 min-w-32 overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:animate-none", className),
|
|
1249
1467
|
...props
|
|
1250
1468
|
}));
|
|
1251
1469
|
DropdownMenuSubContent.displayName = _radix_ui_react_dropdown_menu.SubContent.displayName;
|
|
1252
1470
|
|
|
1253
1471
|
//#endregion
|
|
1254
1472
|
//#region src/components/ui/well/well.tsx
|
|
1255
|
-
|
|
1473
|
+
/** The Well's one look plus the rhythm knobs (`gap`, `spacing`). */
|
|
1474
|
+
const wellVariants = (0, class_variance_authority.cva)("rounded-xl flex flex-col bg-muted/50 border border-border", {
|
|
1256
1475
|
defaultVariants: {
|
|
1257
1476
|
gap: "sm",
|
|
1258
|
-
spacing: "default"
|
|
1259
|
-
variant: "inset"
|
|
1477
|
+
spacing: "default"
|
|
1260
1478
|
},
|
|
1261
1479
|
variants: {
|
|
1262
1480
|
gap: {
|
|
@@ -1270,21 +1488,29 @@ const wellVariants = (0, class_variance_authority.cva)("rounded-xl flex flex-col
|
|
|
1270
1488
|
lg: "p-5",
|
|
1271
1489
|
none: "p-0",
|
|
1272
1490
|
sm: "p-3"
|
|
1273
|
-
},
|
|
1274
|
-
variant: {
|
|
1275
|
-
default: "bg-muted/50",
|
|
1276
|
-
inset: "bg-muted/50 border border-border",
|
|
1277
|
-
outline: "border border-border"
|
|
1278
1491
|
}
|
|
1279
1492
|
}
|
|
1280
1493
|
});
|
|
1281
|
-
|
|
1494
|
+
/**
|
|
1495
|
+
* The muted surface that holds the settings a toggle reveals. Put it inside `WellReveal`
|
|
1496
|
+
* or a `FlushCardStack.Item`. It has one look; `gap` and `spacing` only tune its rhythm.
|
|
1497
|
+
*
|
|
1498
|
+
* @example
|
|
1499
|
+
* ```tsx
|
|
1500
|
+
* <WellReveal open={emailOn}>
|
|
1501
|
+
* <Well>{rows}</Well>
|
|
1502
|
+
* </WellReveal>
|
|
1503
|
+
* ```
|
|
1504
|
+
* @returns The rendered surface.
|
|
1505
|
+
* @see WellReveal
|
|
1506
|
+
* @see FlushCardStack
|
|
1507
|
+
*/
|
|
1508
|
+
const Well = ({ className, gap, spacing, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1282
1509
|
"data-slot": "well",
|
|
1283
1510
|
"data-spacing": spacing ?? "default",
|
|
1284
|
-
className:
|
|
1511
|
+
className: cn(wellVariants({
|
|
1285
1512
|
gap,
|
|
1286
|
-
spacing
|
|
1287
|
-
variant
|
|
1513
|
+
spacing
|
|
1288
1514
|
}), className),
|
|
1289
1515
|
...props
|
|
1290
1516
|
});
|
|
@@ -1297,7 +1523,7 @@ const WellReveal = ({ children, className, open }) => /* @__PURE__ */ (0, react_
|
|
|
1297
1523
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1298
1524
|
className: "overflow-hidden",
|
|
1299
1525
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1300
|
-
className:
|
|
1526
|
+
className: cn("px-0.5 pb-0.5 [&>[data-slot=well]:not([data-spacing=none])]:p-[22px]", "[[data-slot=card]>[data-slot=well-reveal]>div>&>[data-slot=well]]:rounded-2xl", className),
|
|
1301
1527
|
children
|
|
1302
1528
|
})
|
|
1303
1529
|
})
|
|
@@ -1360,7 +1586,7 @@ const FlushCardStack = ({ children, className }) => {
|
|
|
1360
1586
|
const gapPossible = !isLast && (hasReveal(item) || hasReveal(next));
|
|
1361
1587
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Card, {
|
|
1362
1588
|
"data-detached": detaches(item) || void 0,
|
|
1363
|
-
className:
|
|
1589
|
+
className: cn("gap-0 py-0 transition-[border-radius] duration-300", !roundTop && "rounded-t-none -mt-px", !roundBottom && "rounded-b-none", item.props.className),
|
|
1364
1590
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1365
1591
|
className: "px-5 py-4",
|
|
1366
1592
|
children: item.props.header
|
|
@@ -1424,9 +1650,337 @@ const Icon = (props) => {
|
|
|
1424
1650
|
});
|
|
1425
1651
|
};
|
|
1426
1652
|
|
|
1653
|
+
//#endregion
|
|
1654
|
+
//#region src/components/ui/input/input.tsx
|
|
1655
|
+
const shaderDefaults = {
|
|
1656
|
+
bloom: 0,
|
|
1657
|
+
colors: [
|
|
1658
|
+
"#BDDCFF",
|
|
1659
|
+
"#57A7FF",
|
|
1660
|
+
"#DEEAFC"
|
|
1661
|
+
],
|
|
1662
|
+
inset: 1,
|
|
1663
|
+
intensity: 0,
|
|
1664
|
+
pulse: .3,
|
|
1665
|
+
roundness: .6,
|
|
1666
|
+
scale: 1,
|
|
1667
|
+
smoke: .75,
|
|
1668
|
+
smokeSize: .7,
|
|
1669
|
+
softness: .6,
|
|
1670
|
+
speed: 2.2,
|
|
1671
|
+
spots: 8,
|
|
1672
|
+
spotSize: .75,
|
|
1673
|
+
thickness: .04
|
|
1674
|
+
};
|
|
1675
|
+
const spring$2 = {
|
|
1676
|
+
bounce: 0,
|
|
1677
|
+
duration: .35,
|
|
1678
|
+
type: "spring"
|
|
1679
|
+
};
|
|
1680
|
+
const Input = (0, react.forwardRef)(({ className, type, shaderBorder, style, ...props }, ref) => {
|
|
1681
|
+
const prefersReducedMotion = (0, motion_react.useReducedMotion)();
|
|
1682
|
+
const inputClassName = cn("file:text-foreground placeholder:text-muted-foreground/60 selection:bg-primary selection:text-primary-foreground dark:bg-input/30 h-8 w-full min-w-0 touch-manipulation rounded-md border-0 bg-background px-3 py-1 text-base shadow-[var(--shadow-input)] transition-[color,box-shadow] duration-100 ease-out outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "hover:shadow-[var(--shadow-input-hover)]", "focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo,#0072EF26)]", "aria-invalid:shadow-[0_0_0_1px_var(--destructive),0_0_1px_0_var(--destructive)] dark:aria-invalid:shadow-[0_0_0_1px_var(--destructive)]", className);
|
|
1683
|
+
const isActive = !!shaderBorder;
|
|
1684
|
+
const config = typeof shaderBorder === "object" ? {
|
|
1685
|
+
...shaderDefaults,
|
|
1686
|
+
...shaderBorder
|
|
1687
|
+
} : shaderDefaults;
|
|
1688
|
+
const inset = config.inset;
|
|
1689
|
+
if (shaderBorder !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1690
|
+
className: "relative",
|
|
1691
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, {
|
|
1692
|
+
initial: false,
|
|
1693
|
+
children: isActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
|
|
1694
|
+
initial: prefersReducedMotion ? false : { opacity: 0 },
|
|
1695
|
+
animate: { opacity: 1 },
|
|
1696
|
+
exit: { opacity: 0 },
|
|
1697
|
+
transition: prefersReducedMotion ? { duration: 0 } : spring$2,
|
|
1698
|
+
className: "absolute pointer-events-none z-20",
|
|
1699
|
+
style: {
|
|
1700
|
+
borderRadius: `${8 + inset}px`,
|
|
1701
|
+
inset: `-${inset}px`,
|
|
1702
|
+
willChange: "opacity"
|
|
1703
|
+
},
|
|
1704
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_paper_design_shaders_react.PulsingBorder, {
|
|
1705
|
+
colorBack: "#00000000",
|
|
1706
|
+
colors: config.colors,
|
|
1707
|
+
speed: config.speed,
|
|
1708
|
+
scale: config.scale,
|
|
1709
|
+
roundness: config.roundness,
|
|
1710
|
+
thickness: config.thickness,
|
|
1711
|
+
softness: config.softness,
|
|
1712
|
+
intensity: config.intensity,
|
|
1713
|
+
bloom: config.bloom,
|
|
1714
|
+
spots: config.spots,
|
|
1715
|
+
spotSize: config.spotSize,
|
|
1716
|
+
pulse: config.pulse,
|
|
1717
|
+
smoke: config.smoke,
|
|
1718
|
+
smokeSize: config.smokeSize,
|
|
1719
|
+
webGlContextAttributes: {
|
|
1720
|
+
alpha: true,
|
|
1721
|
+
premultipliedAlpha: true
|
|
1722
|
+
},
|
|
1723
|
+
className: "size-full",
|
|
1724
|
+
style: { borderRadius: `${8 + inset}px` }
|
|
1725
|
+
})
|
|
1726
|
+
}, "shader-border")
|
|
1727
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1728
|
+
ref,
|
|
1729
|
+
type,
|
|
1730
|
+
"data-slot": "input",
|
|
1731
|
+
className: cn(inputClassName, isActive && "animate-shimmer motion-reduce:animate-none", isActive && "focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--ring)]"),
|
|
1732
|
+
style: isActive ? {
|
|
1733
|
+
backgroundClip: "text",
|
|
1734
|
+
backgroundImage: `linear-gradient(to right, color-mix(in srgb, ${config.colors[0]} 70%, #000), color-mix(in srgb, ${config.colors[1] || config.colors[0]} 70%, #000), color-mix(in srgb, ${config.colors[2] || config.colors[0]} 70%, #000), color-mix(in srgb, ${config.colors[0]} 70%, #000))`,
|
|
1735
|
+
backgroundSize: "200% 100%",
|
|
1736
|
+
boxShadow: "none",
|
|
1737
|
+
color: "transparent",
|
|
1738
|
+
WebkitBackgroundClip: "text",
|
|
1739
|
+
...style
|
|
1740
|
+
} : style,
|
|
1741
|
+
...props
|
|
1742
|
+
})]
|
|
1743
|
+
});
|
|
1744
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1745
|
+
ref,
|
|
1746
|
+
type,
|
|
1747
|
+
"data-slot": "input",
|
|
1748
|
+
className: inputClassName,
|
|
1749
|
+
style,
|
|
1750
|
+
...props
|
|
1751
|
+
});
|
|
1752
|
+
});
|
|
1753
|
+
Input.displayName = "Input";
|
|
1754
|
+
|
|
1755
|
+
//#endregion
|
|
1756
|
+
//#region src/components/ui/label/label.tsx
|
|
1757
|
+
const labelVariants = (0, class_variance_authority.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
1758
|
+
/**
|
|
1759
|
+
* The text label for a form control.
|
|
1760
|
+
*
|
|
1761
|
+
* `Label` carries no spacing of its own. To label a form control, wrap the
|
|
1762
|
+
* control in `Field` and pass `label`: `Field` sets the gap between the label
|
|
1763
|
+
* and the control and wires up `htmlFor`. A bare `Label` placed next to a
|
|
1764
|
+
* control ends up at whatever gap its parent happens to use.
|
|
1765
|
+
*
|
|
1766
|
+
* @example
|
|
1767
|
+
* ```tsx
|
|
1768
|
+
* <Field label="Email">
|
|
1769
|
+
* <Input type="email" />
|
|
1770
|
+
* </Field>
|
|
1771
|
+
* ```
|
|
1772
|
+
*/
|
|
1773
|
+
const Label = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_label.Root, {
|
|
1774
|
+
ref,
|
|
1775
|
+
className: cn(labelVariants(), className),
|
|
1776
|
+
...props
|
|
1777
|
+
}));
|
|
1778
|
+
Label.displayName = _radix_ui_react_label.Root.displayName;
|
|
1779
|
+
|
|
1780
|
+
//#endregion
|
|
1781
|
+
//#region src/components/ui/field/field-control-context.ts
|
|
1782
|
+
/**
|
|
1783
|
+
* Carries a `Field`'s control attributes to a control that renders its focusable
|
|
1784
|
+
* element deeper than `Field`'s direct child.
|
|
1785
|
+
*
|
|
1786
|
+
* `Field` injects `id` and the `aria-*` attributes onto its direct child. That
|
|
1787
|
+
* works for `Input` and `Textarea`, but `Select` renders no element of its own,
|
|
1788
|
+
* so `SelectTrigger` reads them from here instead.
|
|
1789
|
+
*/
|
|
1790
|
+
const FieldControlContext = (0, react.createContext)(null);
|
|
1791
|
+
|
|
1792
|
+
//#endregion
|
|
1793
|
+
//#region src/components/ui/select/select.tsx
|
|
1794
|
+
const Select = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Root, {
|
|
1795
|
+
"data-slot": "select",
|
|
1796
|
+
...props
|
|
1797
|
+
});
|
|
1798
|
+
const SelectGroup = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Group, {
|
|
1799
|
+
"data-slot": "select-group",
|
|
1800
|
+
...props
|
|
1801
|
+
});
|
|
1802
|
+
const SelectValue = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
|
|
1803
|
+
"data-slot": "select-value",
|
|
1804
|
+
...props
|
|
1805
|
+
});
|
|
1806
|
+
const SelectTrigger = ({ className, size = "default", children, ...props }) => {
|
|
1807
|
+
const fieldControlProps = (0, react.useContext)(FieldControlContext);
|
|
1808
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
|
|
1809
|
+
...fieldControlProps,
|
|
1810
|
+
"data-slot": "select-trigger",
|
|
1811
|
+
"data-size": size,
|
|
1812
|
+
className: cn("data-[placeholder]:text-muted-foreground/60 [&_svg:not([class*='text-'])]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit touch-manipulation items-center justify-between gap-1.5 rounded-md border-0 bg-transparent px-3 py-2 text-[13px] whitespace-nowrap shadow-[var(--shadow-input)] hover:shadow-[var(--shadow-input-hover)] transition-[color,box-shadow] duration-100 ease-out outline-none focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo,#0072EF26)] aria-invalid:shadow-[0_0_0_1px_var(--destructive)] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:text-[13px] data-[size=sm]:px-2.5 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[state=open]:[&>svg:last-of-type]:rotate-180", className),
|
|
1813
|
+
...props,
|
|
1814
|
+
...fieldControlProps ? { id: fieldControlProps.id } : {},
|
|
1815
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
|
|
1816
|
+
asChild: true,
|
|
1817
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1818
|
+
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
1819
|
+
size: 16,
|
|
1820
|
+
className: "opacity-50 transition-transform duration-150 ease-out motion-reduce:transition-none"
|
|
1821
|
+
})
|
|
1822
|
+
})]
|
|
1823
|
+
});
|
|
1824
|
+
};
|
|
1825
|
+
const SelectContent = ({ className, children, position = "popper", align = "start", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Content, {
|
|
1826
|
+
"data-slot": "select-content",
|
|
1827
|
+
className: cn("bg-popover text-popover-foreground will-change-[opacity,transform] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:animate-none relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border-0 shadow-[var(--shadow-elevated)]", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
1828
|
+
position,
|
|
1829
|
+
align,
|
|
1830
|
+
...props,
|
|
1831
|
+
children: [
|
|
1832
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollUpButton, {}),
|
|
1833
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Viewport, {
|
|
1834
|
+
className: cn("p-1", position === "popper" && "w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
1835
|
+
children
|
|
1836
|
+
}),
|
|
1837
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollDownButton, {})
|
|
1838
|
+
]
|
|
1839
|
+
}) });
|
|
1840
|
+
const SelectLabel = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Label, {
|
|
1841
|
+
"data-slot": "select-label",
|
|
1842
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
1843
|
+
...props
|
|
1844
|
+
});
|
|
1845
|
+
const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
1846
|
+
"data-slot": "select-item",
|
|
1847
|
+
className: cn("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=checked]:font-medium [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
1848
|
+
...props,
|
|
1849
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1850
|
+
"data-slot": "select-item-indicator",
|
|
1851
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
1852
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1853
|
+
icon: _hugeicons_core_free_icons.Tick01Icon,
|
|
1854
|
+
size: 14
|
|
1855
|
+
}) })
|
|
1856
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children })]
|
|
1857
|
+
});
|
|
1858
|
+
const SelectSeparator = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Separator, {
|
|
1859
|
+
"data-slot": "select-separator",
|
|
1860
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
1861
|
+
...props
|
|
1862
|
+
});
|
|
1863
|
+
const SelectScrollUpButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollUpButton, {
|
|
1864
|
+
"data-slot": "select-scroll-up-button",
|
|
1865
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
1866
|
+
...props,
|
|
1867
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1868
|
+
icon: _hugeicons_core_free_icons.ArrowUp01Icon,
|
|
1869
|
+
size: 16,
|
|
1870
|
+
"aria-hidden": true
|
|
1871
|
+
})
|
|
1872
|
+
});
|
|
1873
|
+
const SelectScrollDownButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollDownButton, {
|
|
1874
|
+
"data-slot": "select-scroll-down-button",
|
|
1875
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
1876
|
+
...props,
|
|
1877
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1878
|
+
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
1879
|
+
size: 16,
|
|
1880
|
+
"aria-hidden": true
|
|
1881
|
+
})
|
|
1882
|
+
});
|
|
1883
|
+
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region src/components/ui/field/use-field-feedback.ts
|
|
1886
|
+
const EASE_OUT = "cubic-bezier(0.215, 0.61, 0.355, 1)";
|
|
1887
|
+
const EASE_IN_OUT = "cubic-bezier(0.645, 0.045, 0.355, 1)";
|
|
1888
|
+
const SHAKE_KEYFRAMES = [
|
|
1889
|
+
0,
|
|
1890
|
+
-4,
|
|
1891
|
+
3.5,
|
|
1892
|
+
-2,
|
|
1893
|
+
1,
|
|
1894
|
+
0
|
|
1895
|
+
].map((offset) => ({
|
|
1896
|
+
easing: EASE_IN_OUT,
|
|
1897
|
+
transform: `translateX(${offset}px)`
|
|
1898
|
+
}));
|
|
1899
|
+
const SHAKE_TIMING = {
|
|
1900
|
+
duration: 300,
|
|
1901
|
+
easing: "linear"
|
|
1902
|
+
};
|
|
1903
|
+
const MESSAGE_KEYFRAMES = [{
|
|
1904
|
+
opacity: 0,
|
|
1905
|
+
transform: "translateY(-4px)"
|
|
1906
|
+
}, {
|
|
1907
|
+
opacity: 1,
|
|
1908
|
+
transform: "translateY(0)"
|
|
1909
|
+
}];
|
|
1910
|
+
const MESSAGE_TIMING = {
|
|
1911
|
+
duration: 150,
|
|
1912
|
+
easing: EASE_OUT
|
|
1913
|
+
};
|
|
1914
|
+
const ERROR_HAPTIC_MS = 12;
|
|
1915
|
+
const CONTROL_SELECTOR = ":scope > :not([data-slot^=\"field-\"])";
|
|
1916
|
+
const ERROR_SELECTOR = ":scope > [data-slot=\"field-error\"]";
|
|
1917
|
+
const MESSAGE_SELECTOR = `${ERROR_SELECTOR}, :scope > [data-slot="field-description"]`;
|
|
1918
|
+
const tickHaptics = () => {
|
|
1919
|
+
if (window.matchMedia?.("(pointer: coarse)").matches) navigator.vibrate?.(ERROR_HAPTIC_MS);
|
|
1920
|
+
};
|
|
1921
|
+
const shakeControl = (wrapper) => {
|
|
1922
|
+
wrapper.querySelectorAll(CONTROL_SELECTOR).forEach((control) => {
|
|
1923
|
+
control.animate?.(SHAKE_KEYFRAMES, SHAKE_TIMING);
|
|
1924
|
+
});
|
|
1925
|
+
};
|
|
1926
|
+
/**
|
|
1927
|
+
* Plays a field's validation feedback and returns the ref for its wrapper.
|
|
1928
|
+
*
|
|
1929
|
+
* When an error appears, the control shakes, the message under it slides in,
|
|
1930
|
+
* and touch devices get a short haptic tick. Each later submit of the
|
|
1931
|
+
* surrounding `<form>` that leaves the error in place shakes and ticks again,
|
|
1932
|
+
* so every failed attempt is acknowledged. When the error clears, the
|
|
1933
|
+
* description slides back in. A change to the error's text alone swaps
|
|
1934
|
+
* instantly: it usually comes from re-validating while the user types, and
|
|
1935
|
+
* motion on every keystroke reads as noise. Nothing plays on first render, and
|
|
1936
|
+
* motion is skipped under `prefers-reduced-motion`.
|
|
1937
|
+
*
|
|
1938
|
+
* Uses the Web Animations API, so the feedback needs no stylesheet.
|
|
1939
|
+
*
|
|
1940
|
+
* @see Field
|
|
1941
|
+
* @see FieldControlContext
|
|
1942
|
+
*/
|
|
1943
|
+
const useFieldFeedback = ({ error }) => {
|
|
1944
|
+
const wrapperRef = (0, react.useRef)(null);
|
|
1945
|
+
const hasError = Boolean(error);
|
|
1946
|
+
const previousHasErrorRef = (0, react.useRef)(hasError);
|
|
1947
|
+
const prefersReducedMotion = (0, motion_react.useReducedMotion)();
|
|
1948
|
+
const prefersReducedMotionRef = (0, react.useRef)(prefersReducedMotion);
|
|
1949
|
+
prefersReducedMotionRef.current = prefersReducedMotion;
|
|
1950
|
+
(0, react.useEffect)(() => {
|
|
1951
|
+
if (previousHasErrorRef.current === hasError) return;
|
|
1952
|
+
previousHasErrorRef.current = hasError;
|
|
1953
|
+
const wrapper = wrapperRef.current;
|
|
1954
|
+
if (!wrapper) return;
|
|
1955
|
+
if (hasError) tickHaptics();
|
|
1956
|
+
if (prefersReducedMotionRef.current) return;
|
|
1957
|
+
wrapper.querySelectorAll(MESSAGE_SELECTOR).forEach((message) => {
|
|
1958
|
+
message.animate?.(MESSAGE_KEYFRAMES, MESSAGE_TIMING);
|
|
1959
|
+
});
|
|
1960
|
+
if (hasError) shakeControl(wrapper);
|
|
1961
|
+
}, [hasError]);
|
|
1962
|
+
(0, react.useEffect)(() => {
|
|
1963
|
+
const form = wrapperRef.current?.closest("form");
|
|
1964
|
+
if (!form) return void 0;
|
|
1965
|
+
const handleSubmit = () => {
|
|
1966
|
+
const wrapper = wrapperRef.current;
|
|
1967
|
+
if (!wrapper?.querySelector(ERROR_SELECTOR)) return;
|
|
1968
|
+
requestAnimationFrame(() => {
|
|
1969
|
+
if (!wrapper.querySelector(ERROR_SELECTOR)) return;
|
|
1970
|
+
tickHaptics();
|
|
1971
|
+
if (!prefersReducedMotionRef.current) shakeControl(wrapper);
|
|
1972
|
+
});
|
|
1973
|
+
};
|
|
1974
|
+
form.addEventListener("submit", handleSubmit);
|
|
1975
|
+
return () => form.removeEventListener("submit", handleSubmit);
|
|
1976
|
+
}, []);
|
|
1977
|
+
return wrapperRef;
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1427
1980
|
//#endregion
|
|
1428
1981
|
//#region src/components/ui/field/field.tsx
|
|
1429
|
-
const
|
|
1982
|
+
const FIELD_GAP_CLASS_NAME = "grid [--field-gap:6px] [--label-gap:10px] gap-[var(--field-gap)]";
|
|
1983
|
+
const LABEL_GAP_CLASS_NAME = "mb-[calc(var(--label-gap)-var(--field-gap))]";
|
|
1430
1984
|
/**
|
|
1431
1985
|
* A generic labeled form-field wrapper.
|
|
1432
1986
|
*
|
|
@@ -1434,16 +1988,30 @@ const LABEL_GAP_CLASS_NAME = "mb-[calc(var(--spacing-label-gap)-var(--spacing-fi
|
|
|
1434
1988
|
* an error message together with the correct `id`/`htmlFor`/`aria-describedby`
|
|
1435
1989
|
* associations so callers don't have to hand-assemble these.
|
|
1436
1990
|
*
|
|
1991
|
+
* Always wrap a form control in `Field` rather than pairing a bare `<Label>`
|
|
1992
|
+
* with it: `Field` owns the label-to-control gap (10px) and the gap to the
|
|
1993
|
+
* error (6px). Don't add helper text: the error is the only message under a
|
|
1994
|
+
* control.
|
|
1995
|
+
*
|
|
1437
1996
|
* When there is exactly one child element, `Field` uses `cloneElement` to
|
|
1438
1997
|
* inject:
|
|
1439
1998
|
* - `id` — links the label's `htmlFor` to the control
|
|
1999
|
+
* - `aria-labelledby` — names group controls such as `RadioGroup`, which a
|
|
2000
|
+
* `<label for>` cannot name
|
|
1440
2001
|
* - `aria-describedby` — references the description and/or error paragraph ids
|
|
1441
2002
|
* - `aria-invalid` — `true` when `error` is present
|
|
1442
2003
|
*
|
|
2004
|
+
* When an error appears, the control shakes, the message slides in, and
|
|
2005
|
+
* touch devices get a short haptic tick. Motion is skipped under
|
|
2006
|
+
* `prefers-reduced-motion` and never plays on first render.
|
|
2007
|
+
*
|
|
2008
|
+
* `Select` renders no element of its own, so `SelectTrigger` picks up `id`,
|
|
2009
|
+
* `aria-describedby` and `aria-invalid` from `Field` instead.
|
|
2010
|
+
*
|
|
1443
2011
|
* @example
|
|
1444
2012
|
* ```tsx
|
|
1445
|
-
* <Field label="Email"
|
|
1446
|
-
* <Input type="email" />
|
|
2013
|
+
* <Field label="Email" required>
|
|
2014
|
+
* <Input type="email" required />
|
|
1447
2015
|
* </Field>
|
|
1448
2016
|
*
|
|
1449
2017
|
* <Field label="Email" error="Enter a valid email address.">
|
|
@@ -1452,25 +2020,41 @@ const LABEL_GAP_CLASS_NAME = "mb-[calc(var(--spacing-label-gap)-var(--spacing-fi
|
|
|
1452
2020
|
* ```
|
|
1453
2021
|
*/
|
|
1454
2022
|
const Field = ({ label, description, error, required, htmlFor, children, className }) => {
|
|
2023
|
+
const childArray = react.Children.toArray(children);
|
|
2024
|
+
const singleChild = childArray.length === 1 && (0, react.isValidElement)(childArray[0]) ? childArray[0] : null;
|
|
2025
|
+
const childId = (singleChild?.props)?.id;
|
|
1455
2026
|
const generatedId = (0, react.useId)();
|
|
1456
|
-
const
|
|
2027
|
+
const wrapperRef = useFieldFeedback({ error });
|
|
2028
|
+
const controlId = (typeof childId === "string" ? childId : void 0) ?? htmlFor ?? generatedId;
|
|
1457
2029
|
const descriptionId = `${controlId}-description`;
|
|
1458
2030
|
const errorId = `${controlId}-error`;
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
const
|
|
2031
|
+
const labelId = label ? `${controlId}-label` : void 0;
|
|
2032
|
+
const showDescription = Boolean(description) && !error;
|
|
2033
|
+
let ariaDescribedBy;
|
|
2034
|
+
if (error) ariaDescribedBy = errorId;
|
|
2035
|
+
else if (showDescription) ariaDescribedBy = descriptionId;
|
|
2036
|
+
const hasError = Boolean(error);
|
|
2037
|
+
const controlProps = (0, react.useMemo)(() => ({
|
|
2038
|
+
"aria-describedby": ariaDescribedBy,
|
|
2039
|
+
id: controlId,
|
|
2040
|
+
...hasError ? { "aria-invalid": true } : {}
|
|
2041
|
+
}), [
|
|
2042
|
+
ariaDescribedBy,
|
|
2043
|
+
controlId,
|
|
2044
|
+
hasError
|
|
2045
|
+
]);
|
|
1465
2046
|
const enrichedChild = singleChild ? (0, react.cloneElement)(singleChild, {
|
|
1466
2047
|
"aria-describedby": singleChild.props["aria-describedby"] ?? ariaDescribedBy,
|
|
1467
|
-
|
|
2048
|
+
"aria-labelledby": singleChild.props["aria-labelledby"] ?? labelId,
|
|
2049
|
+
id: controlId,
|
|
1468
2050
|
...error ? { "aria-invalid": true } : {}
|
|
1469
2051
|
}) : null;
|
|
1470
2052
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1471
|
-
|
|
2053
|
+
ref: wrapperRef,
|
|
2054
|
+
className: cn(FIELD_GAP_CLASS_NAME, className),
|
|
1472
2055
|
children: [
|
|
1473
|
-
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
2056
|
+
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Label, {
|
|
2057
|
+
id: labelId,
|
|
1474
2058
|
htmlFor: controlId,
|
|
1475
2059
|
"data-slot": "field-label",
|
|
1476
2060
|
className: LABEL_GAP_CLASS_NAME,
|
|
@@ -1480,14 +2064,19 @@ const Field = ({ label, description, error, required, htmlFor, children, classNa
|
|
|
1480
2064
|
children: "*"
|
|
1481
2065
|
})]
|
|
1482
2066
|
}),
|
|
1483
|
-
|
|
1484
|
-
|
|
2067
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldControlContext.Provider, {
|
|
2068
|
+
value: singleChild?.type === Select ? controlProps : null,
|
|
2069
|
+
children: enrichedChild ?? children
|
|
2070
|
+
}),
|
|
2071
|
+
showDescription && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1485
2072
|
id: descriptionId,
|
|
2073
|
+
"data-slot": "field-description",
|
|
1486
2074
|
className: "text-sm text-muted-foreground",
|
|
1487
2075
|
children: description
|
|
1488
2076
|
}),
|
|
1489
2077
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1490
2078
|
id: errorId,
|
|
2079
|
+
"data-slot": "field-error",
|
|
1491
2080
|
role: "alert",
|
|
1492
2081
|
className: "text-sm text-[var(--text-danger)]",
|
|
1493
2082
|
children: error
|
|
@@ -1502,7 +2091,7 @@ Field.displayName = "Field";
|
|
|
1502
2091
|
const Kbd = ({ className, ...props }) => {
|
|
1503
2092
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
1504
2093
|
"data-slot": "kbd",
|
|
1505
|
-
className:
|
|
2094
|
+
className: cn("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none", "[&_svg:not([class*='size-'])]:size-3", "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10", className),
|
|
1506
2095
|
...props
|
|
1507
2096
|
});
|
|
1508
2097
|
};
|
|
@@ -1524,7 +2113,7 @@ const Progress = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy,
|
|
|
1524
2113
|
const clamped = Math.min(100, Math.max(0, value ?? 0));
|
|
1525
2114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1526
2115
|
"data-slot": "progress",
|
|
1527
|
-
className:
|
|
2116
|
+
className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
|
|
1528
2117
|
...props,
|
|
1529
2118
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("progress", {
|
|
1530
2119
|
"aria-label": ariaLabel ?? "Progress",
|
|
@@ -1534,7 +2123,7 @@ const Progress = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy,
|
|
|
1534
2123
|
value: indeterminate ? void 0 : clamped
|
|
1535
2124
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1536
2125
|
"data-slot": "progress-indicator",
|
|
1537
|
-
className:
|
|
2126
|
+
className: cn(progressVariants({ variant }), indeterminate && "animate-progress-indeterminate motion-reduce:animate-none"),
|
|
1538
2127
|
style: indeterminate ? void 0 : { transform: `translateX(-${100 - clamped}%)` }
|
|
1539
2128
|
})]
|
|
1540
2129
|
});
|
|
@@ -1545,14 +2134,14 @@ const Progress = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy,
|
|
|
1545
2134
|
const RadioGroup = ({ className, ...props }) => {
|
|
1546
2135
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Root, {
|
|
1547
2136
|
"data-slot": "radio-group",
|
|
1548
|
-
className:
|
|
2137
|
+
className: cn("grid gap-3", className),
|
|
1549
2138
|
...props
|
|
1550
2139
|
});
|
|
1551
2140
|
};
|
|
1552
2141
|
const RadioGroupItem = ({ className, ...props }) => {
|
|
1553
2142
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Item, {
|
|
1554
2143
|
"data-slot": "radio-group-item",
|
|
1555
|
-
className:
|
|
2144
|
+
className: cn("text-[var(--action)] dark:bg-input/30 relative aspect-square size-4 shrink-0 touch-manipulation rounded-full border border-[rgba(31,41,55,0.30)] dark:border-[rgba(255,255,255,0.20)] hover:data-[state=unchecked]:border-[rgba(31,41,55,0.45)] dark:hover:data-[state=unchecked]:border-[rgba(255,255,255,0.35)] data-[state=checked]:border-[var(--action)] shadow-[var(--shadow-radio)] dark:shadow-[var(--shadow-radio)] transition-[color,box-shadow,border-color] duration-100 ease-out motion-reduce:transition-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-[var(--destructive)] disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer after:absolute after:-inset-[14px] after:content-['']", className),
|
|
1556
2145
|
...props,
|
|
1557
2146
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Indicator, {
|
|
1558
2147
|
"data-slot": "radio-group-indicator",
|
|
@@ -1591,7 +2180,7 @@ const RadioField = ({ value, label, description, disabled, id: idProp, className
|
|
|
1591
2180
|
const generatedId = (0, react.useId)();
|
|
1592
2181
|
const id = idProp ?? generatedId;
|
|
1593
2182
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1594
|
-
className:
|
|
2183
|
+
className: cn("flex items-start gap-3", disabled && "opacity-50", className),
|
|
1595
2184
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroupItem, {
|
|
1596
2185
|
value,
|
|
1597
2186
|
id,
|
|
@@ -1599,9 +2188,9 @@ const RadioField = ({ value, label, description, disabled, id: idProp, className
|
|
|
1599
2188
|
className: "mt-0.5"
|
|
1600
2189
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1601
2190
|
className: "grid gap-0.5",
|
|
1602
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2191
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
1603
2192
|
htmlFor: id,
|
|
1604
|
-
className:
|
|
2193
|
+
className: cn("cursor-pointer transition-colors duration-100 ease-out motion-reduce:transition-none", disabled && "cursor-not-allowed"),
|
|
1605
2194
|
children: label
|
|
1606
2195
|
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1607
2196
|
className: "text-sm text-muted-foreground",
|
|
@@ -1623,7 +2212,7 @@ const Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_ru
|
|
|
1623
2212
|
"data-slot": "pagination",
|
|
1624
2213
|
role: "navigation",
|
|
1625
2214
|
"aria-label": "pagination",
|
|
1626
|
-
className:
|
|
2215
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
1627
2216
|
...props
|
|
1628
2217
|
});
|
|
1629
2218
|
/**
|
|
@@ -1632,7 +2221,7 @@ const Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_ru
|
|
|
1632
2221
|
*/
|
|
1633
2222
|
const PaginationContent = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1634
2223
|
"data-slot": "pagination-content",
|
|
1635
|
-
className:
|
|
2224
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
1636
2225
|
...props
|
|
1637
2226
|
});
|
|
1638
2227
|
/**
|
|
@@ -1641,7 +2230,7 @@ const PaginationContent = ({ className, ...props }) => /* @__PURE__ */ (0, react
|
|
|
1641
2230
|
*/
|
|
1642
2231
|
const PaginationItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
1643
2232
|
"data-slot": "pagination-item",
|
|
1644
|
-
className:
|
|
2233
|
+
className: cn("", className),
|
|
1645
2234
|
...props
|
|
1646
2235
|
});
|
|
1647
2236
|
/**
|
|
@@ -1652,7 +2241,7 @@ const PaginationItem = ({ className, ...props }) => /* @__PURE__ */ (0, react_js
|
|
|
1652
2241
|
const PaginationLink = ({ className, isActive = false, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
1653
2242
|
"data-slot": "pagination-link",
|
|
1654
2243
|
"aria-current": isActive ? "page" : void 0,
|
|
1655
|
-
className:
|
|
2244
|
+
className: cn(buttonVariants({
|
|
1656
2245
|
size: "icon-sm",
|
|
1657
2246
|
variant: isActive ? "outline" : "ghost"
|
|
1658
2247
|
}), PAGINATION_HIT_AREA, className),
|
|
@@ -1667,7 +2256,7 @@ const PaginationLink = ({ className, isActive = false, children, ...props }) =>
|
|
|
1667
2256
|
const PaginationPrevious = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
1668
2257
|
"data-slot": "pagination-previous",
|
|
1669
2258
|
"aria-label": "Go to previous page",
|
|
1670
|
-
className:
|
|
2259
|
+
className: cn(buttonVariants({
|
|
1671
2260
|
size: "icon-sm",
|
|
1672
2261
|
variant: "ghost"
|
|
1673
2262
|
}), PAGINATION_HIT_AREA, "gap-1 pl-2.5", className),
|
|
@@ -1688,7 +2277,7 @@ const PaginationPrevious = ({ className, children, ...props }) => /* @__PURE__ *
|
|
|
1688
2277
|
const PaginationNext = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
1689
2278
|
"data-slot": "pagination-next",
|
|
1690
2279
|
"aria-label": "Go to next page",
|
|
1691
|
-
className:
|
|
2280
|
+
className: cn(buttonVariants({
|
|
1692
2281
|
size: "icon-sm",
|
|
1693
2282
|
variant: "ghost"
|
|
1694
2283
|
}), PAGINATION_HIT_AREA, "gap-1 pr-2.5", className),
|
|
@@ -1710,7 +2299,7 @@ const PaginationNext = ({ className, children, ...props }) => /* @__PURE__ */ (0
|
|
|
1710
2299
|
const PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1711
2300
|
"data-slot": "pagination-ellipsis",
|
|
1712
2301
|
"aria-hidden": "true",
|
|
1713
|
-
className:
|
|
2302
|
+
className: cn("flex size-7 items-center justify-center text-muted-foreground", className),
|
|
1714
2303
|
...props,
|
|
1715
2304
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1716
2305
|
icon: _hugeicons_core_free_icons.MoreHorizontalIcon,
|
|
@@ -1742,13 +2331,13 @@ const PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ (0, reac
|
|
|
1742
2331
|
const CursorPagination = ({ hasPrevious, hasNext, onPrevious, onNext, label, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
1743
2332
|
"aria-label": "Pagination",
|
|
1744
2333
|
"data-slot": "cursor-pagination",
|
|
1745
|
-
className:
|
|
2334
|
+
className: cn("flex items-center justify-end gap-3", className),
|
|
1746
2335
|
children: [label !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1747
2336
|
className: "text-[13px] text-muted-foreground tabular-nums",
|
|
1748
2337
|
children: label
|
|
1749
2338
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1750
2339
|
className: "flex items-center gap-2",
|
|
1751
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2340
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1752
2341
|
variant: "outline",
|
|
1753
2342
|
size: "icon-sm",
|
|
1754
2343
|
className: "size-8 before:-inset-1",
|
|
@@ -1760,7 +2349,7 @@ const CursorPagination = ({ hasPrevious, hasNext, onPrevious, onNext, label, cla
|
|
|
1760
2349
|
size: 16,
|
|
1761
2350
|
"aria-hidden": "true"
|
|
1762
2351
|
})
|
|
1763
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2352
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
1764
2353
|
variant: "outline",
|
|
1765
2354
|
size: "icon-sm",
|
|
1766
2355
|
className: "size-8 before:-inset-1",
|
|
@@ -1781,7 +2370,7 @@ const CursorPagination = ({ hasPrevious, hasNext, onPrevious, onNext, label, cla
|
|
|
1781
2370
|
const ScrollArea = ({ className, children, ...props }) => {
|
|
1782
2371
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_scroll_area.Root, {
|
|
1783
2372
|
"data-slot": "scroll-area",
|
|
1784
|
-
className:
|
|
2373
|
+
className: cn("relative", className),
|
|
1785
2374
|
...props,
|
|
1786
2375
|
children: [
|
|
1787
2376
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_scroll_area.Viewport, {
|
|
@@ -1798,7 +2387,7 @@ const ScrollBar = ({ className, orientation = "vertical", ...props }) => {
|
|
|
1798
2387
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_scroll_area.ScrollAreaScrollbar, {
|
|
1799
2388
|
"data-slot": "scroll-area-scrollbar",
|
|
1800
2389
|
orientation,
|
|
1801
|
-
className:
|
|
2390
|
+
className: cn("flex touch-none touch-manipulation p-px transition-[background-color] motion-reduce:transition-none select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
1802
2391
|
...props,
|
|
1803
2392
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_scroll_area.ScrollAreaThumb, {
|
|
1804
2393
|
"data-slot": "scroll-area-thumb",
|
|
@@ -1813,7 +2402,7 @@ const SearchInput = ({ className, placeholder = "Search...", shortcut = "⌘K",
|
|
|
1813
2402
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1814
2403
|
type: "button",
|
|
1815
2404
|
"data-slot": "search-input",
|
|
1816
|
-
className:
|
|
2405
|
+
className: cn("h-8 w-full touch-manipulation rounded-md border-0 bg-background dark:bg-input/30 shadow-[var(--shadow-input)]", "hover:shadow-[var(--shadow-input-hover)]", "transition-[color,box-shadow] duration-100 ease-out motion-reduce:transition-none", "outline-none focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo,#0072EF26)]", "flex items-center gap-2 px-2", "text-sm text-muted-foreground/60 cursor-pointer", className),
|
|
1817
2406
|
onClick,
|
|
1818
2407
|
...props,
|
|
1819
2408
|
children: [
|
|
@@ -1831,99 +2420,12 @@ const SearchInput = ({ className, placeholder = "Search...", shortcut = "⌘K",
|
|
|
1831
2420
|
});
|
|
1832
2421
|
};
|
|
1833
2422
|
|
|
1834
|
-
//#endregion
|
|
1835
|
-
//#region src/components/ui/select/select.tsx
|
|
1836
|
-
const Select = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Root, {
|
|
1837
|
-
"data-slot": "select",
|
|
1838
|
-
...props
|
|
1839
|
-
});
|
|
1840
|
-
const SelectGroup = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Group, {
|
|
1841
|
-
"data-slot": "select-group",
|
|
1842
|
-
...props
|
|
1843
|
-
});
|
|
1844
|
-
const SelectValue = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Value, {
|
|
1845
|
-
"data-slot": "select-value",
|
|
1846
|
-
...props
|
|
1847
|
-
});
|
|
1848
|
-
const SelectTrigger = ({ className, size = "default", children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Trigger, {
|
|
1849
|
-
"data-slot": "select-trigger",
|
|
1850
|
-
"data-size": size,
|
|
1851
|
-
className: require_toggle_row.cn("data-[placeholder]:text-muted-foreground/60 [&_svg:not([class*='text-'])]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit touch-manipulation items-center justify-between gap-1.5 rounded-md border-0 bg-transparent px-3 py-2 text-[13px] whitespace-nowrap shadow-[var(--shadow-input)] hover:shadow-[var(--shadow-input-hover)] transition-[color,box-shadow] duration-100 ease-out outline-none focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo,#0072EF26)] aria-invalid:shadow-[0_0_0_1px_var(--destructive)] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:text-[13px] data-[size=sm]:px-2.5 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[state=open]:[&>svg:last-of-type]:rotate-180", className),
|
|
1852
|
-
...props,
|
|
1853
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Icon, {
|
|
1854
|
-
asChild: true,
|
|
1855
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1856
|
-
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
1857
|
-
size: 16,
|
|
1858
|
-
className: "opacity-50 transition-transform duration-150 ease-out motion-reduce:transition-none"
|
|
1859
|
-
})
|
|
1860
|
-
})]
|
|
1861
|
-
});
|
|
1862
|
-
const SelectContent = ({ className, children, position = "popper", align = "start", ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Content, {
|
|
1863
|
-
"data-slot": "select-content",
|
|
1864
|
-
className: require_toggle_row.cn("bg-popover text-popover-foreground will-change-[opacity,transform] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:animate-none relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border-0 shadow-[var(--shadow-elevated)]", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
1865
|
-
position,
|
|
1866
|
-
align,
|
|
1867
|
-
...props,
|
|
1868
|
-
children: [
|
|
1869
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollUpButton, {}),
|
|
1870
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Viewport, {
|
|
1871
|
-
className: require_toggle_row.cn("p-1", position === "popper" && "w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
1872
|
-
children
|
|
1873
|
-
}),
|
|
1874
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollDownButton, {})
|
|
1875
|
-
]
|
|
1876
|
-
}) });
|
|
1877
|
-
const SelectLabel = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Label, {
|
|
1878
|
-
"data-slot": "select-label",
|
|
1879
|
-
className: require_toggle_row.cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
1880
|
-
...props
|
|
1881
|
-
});
|
|
1882
|
-
const SelectItem = ({ className, children, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_select.Item, {
|
|
1883
|
-
"data-slot": "select-item",
|
|
1884
|
-
className: require_toggle_row.cn("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=checked]:font-medium [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
1885
|
-
...props,
|
|
1886
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1887
|
-
"data-slot": "select-item-indicator",
|
|
1888
|
-
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
1889
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1890
|
-
icon: _hugeicons_core_free_icons.Tick01Icon,
|
|
1891
|
-
size: 14
|
|
1892
|
-
}) })
|
|
1893
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ItemText, { children })]
|
|
1894
|
-
});
|
|
1895
|
-
const SelectSeparator = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.Separator, {
|
|
1896
|
-
"data-slot": "select-separator",
|
|
1897
|
-
className: require_toggle_row.cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
1898
|
-
...props
|
|
1899
|
-
});
|
|
1900
|
-
const SelectScrollUpButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollUpButton, {
|
|
1901
|
-
"data-slot": "select-scroll-up-button",
|
|
1902
|
-
className: require_toggle_row.cn("flex cursor-default items-center justify-center py-1", className),
|
|
1903
|
-
...props,
|
|
1904
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1905
|
-
icon: _hugeicons_core_free_icons.ArrowUp01Icon,
|
|
1906
|
-
size: 16,
|
|
1907
|
-
"aria-hidden": true
|
|
1908
|
-
})
|
|
1909
|
-
});
|
|
1910
|
-
const SelectScrollDownButton = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_select.ScrollDownButton, {
|
|
1911
|
-
"data-slot": "select-scroll-down-button",
|
|
1912
|
-
className: require_toggle_row.cn("flex cursor-default items-center justify-center py-1", className),
|
|
1913
|
-
...props,
|
|
1914
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
1915
|
-
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
1916
|
-
size: 16,
|
|
1917
|
-
"aria-hidden": true
|
|
1918
|
-
})
|
|
1919
|
-
});
|
|
1920
|
-
|
|
1921
2423
|
//#endregion
|
|
1922
2424
|
//#region src/components/ui/selectable-card/selectable-card.tsx
|
|
1923
2425
|
const SelectableCard = ({ badge, className, description, icon, iconSize = 20, label, selected, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1924
2426
|
"data-slot": "selectable-card",
|
|
1925
2427
|
"data-selected": selected,
|
|
1926
|
-
className:
|
|
2428
|
+
className: cn("group/card relative flex flex-col items-start gap-2.5 p-4 rounded-xl text-left transition-[box-shadow,background-color,scale] duration-150 motion-reduce:transition-none touch-manipulation active:scale-[0.96] cursor-pointer w-full outline-none focus-visible:shadow-[0_0_0_1.5px_var(--action),0_0_0_4px_oklch(from_var(--action)_l_c_h_/_0.25)]", selected ? "bg-[var(--action)]/5 shadow-[0_0_0_1.5px_var(--action)]" : "shadow-[0_0_0_1px_oklch(0.278_0.03_256.85_/_0.12)] hover:shadow-[0_0_0_1px_oklch(0.278_0.03_256.85_/_0.20)]", className),
|
|
1927
2429
|
...props,
|
|
1928
2430
|
children: [
|
|
1929
2431
|
icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
@@ -1950,10 +2452,10 @@ const SelectableCard = ({ badge, className, description, icon, iconSize = 20, la
|
|
|
1950
2452
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1951
2453
|
className: "absolute top-4 right-4",
|
|
1952
2454
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1953
|
-
className:
|
|
2455
|
+
className: cn("relative size-4 shrink-0 rounded-[4px] transition-[color,box-shadow,background-color] duration-200 ease-out motion-reduce:transition-none", selected ? "bg-[var(--action)] text-white shadow-[0_0_0_1px_var(--action),0px_1px_1px_0px_oklch(1_0_0_/_0.07)_inset,0px_2px_3px_0px_oklch(0.278_0.03_256.85_/_0.20),0px_1px_1px_0px_oklch(0_0_0_/_0.24)]" : "shadow-[0_0_0_1px_oklch(0.278_0.03_256.85_/_0.20),0_1px_2px_0_oklch(0_0_0_/_0.06),0_0_1px_0_oklch(0_0_0_/_0.02)] group-hover/card:shadow-[0_0_0_1px_oklch(0.278_0.03_256.85_/_0.30),0_1px_2px_0_oklch(0_0_0_/_0.06),0_0_1px_0_oklch(0_0_0_/_0.02)]"),
|
|
1954
2456
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {
|
|
1955
2457
|
size: 14,
|
|
1956
|
-
className:
|
|
2458
|
+
className: cn("absolute inset-0 m-auto text-current transition-[opacity,transform,filter] duration-200 motion-reduce:transition-none", selected ? "opacity-100 scale-100 blur-none" : "opacity-0 scale-[0.25] blur-[4px]")
|
|
1957
2459
|
})
|
|
1958
2460
|
})
|
|
1959
2461
|
})
|
|
@@ -1966,7 +2468,7 @@ const Separator = (0, react.forwardRef)(({ className, orientation = "horizontal"
|
|
|
1966
2468
|
ref,
|
|
1967
2469
|
decorative,
|
|
1968
2470
|
orientation,
|
|
1969
|
-
className:
|
|
2471
|
+
className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
1970
2472
|
...props
|
|
1971
2473
|
}));
|
|
1972
2474
|
Separator.displayName = _radix_ui_react_separator.Root.displayName;
|
|
@@ -1987,7 +2489,7 @@ const Slider = ({ value, onValueChange, min = 0, max = 100, step = 1, disabled =
|
|
|
1987
2489
|
const fillPercent = range === 0 ? 0 : (clamped - min) / range * 100;
|
|
1988
2490
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1989
2491
|
"data-slot": "slider",
|
|
1990
|
-
className:
|
|
2492
|
+
className: cn("relative flex w-full touch-manipulation items-center", className),
|
|
1991
2493
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1992
2494
|
type: "range",
|
|
1993
2495
|
"data-slot": "slider-input",
|
|
@@ -2000,7 +2502,7 @@ const Slider = ({ value, onValueChange, min = 0, max = 100, step = 1, disabled =
|
|
|
2000
2502
|
"aria-valuemax": max,
|
|
2001
2503
|
"aria-valuenow": clamped,
|
|
2002
2504
|
onChange: (e) => onValueChange(Number(e.target.value)),
|
|
2003
|
-
className:
|
|
2505
|
+
className: cn("w-full appearance-none bg-transparent outline-none", "cursor-pointer disabled:cursor-not-allowed disabled:opacity-50", "[&::-webkit-slider-runnable-track]:h-1.5", "[&::-webkit-slider-runnable-track]:w-full", "[&::-webkit-slider-runnable-track]:rounded-full", "[&::-webkit-slider-runnable-track]:bg-[linear-gradient(to_right,var(--action)_var(--slider-fill,0%),var(--bg-accented)_var(--slider-fill,0%))]", "[&::-webkit-slider-runnable-track]:transition-[background-size] [&::-webkit-slider-runnable-track]:duration-150 [&::-webkit-slider-runnable-track]:ease-out", "[&::-webkit-slider-runnable-track]:motion-reduce:transition-none", "[&::-webkit-slider-thumb]:appearance-none", "[&::-webkit-slider-thumb]:size-4", "[&::-webkit-slider-thumb]:rounded-full", "[&::-webkit-slider-thumb]:bg-background", "[&::-webkit-slider-thumb]:border", "[&::-webkit-slider-thumb]:border-[var(--action)]", "[&::-webkit-slider-thumb]:shadow-[var(--shadow-control-thumb)]", "[&::-webkit-slider-thumb]:-mt-[5px]", "[&::-webkit-slider-thumb]:transition-[box-shadow] [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb]:ease-out", "[&::-webkit-slider-thumb]:motion-reduce:transition-none", "focus-visible:[&::-webkit-slider-thumb]:shadow-[0_0_0_3px_var(--ring-halo),var(--shadow-control-thumb)]", "[&::-moz-range-track]:h-1.5", "[&::-moz-range-track]:w-full", "[&::-moz-range-track]:rounded-full", "[&::-moz-range-track]:bg-[var(--bg-accented)]", "[&::-moz-range-progress]:h-1.5", "[&::-moz-range-progress]:rounded-full", "[&::-moz-range-progress]:bg-[var(--action)]", "[&::-moz-range-thumb]:size-4", "[&::-moz-range-thumb]:rounded-full", "[&::-moz-range-thumb]:border", "[&::-moz-range-thumb]:border-[var(--action)]", "[&::-moz-range-thumb]:bg-background", "[&::-moz-range-thumb]:shadow-[var(--shadow-control-thumb)]", "[&::-moz-range-thumb]:transition-[box-shadow] [&::-moz-range-thumb]:duration-150 [&::-moz-range-thumb]:ease-out", "[&::-moz-range-thumb]:motion-reduce:transition-none", "focus-visible:[&::-moz-range-thumb]:shadow-[0_0_0_3px_var(--ring-halo),var(--shadow-control-thumb)]"),
|
|
2004
2506
|
style: { "--slider-fill": `${fillPercent}%` }
|
|
2005
2507
|
})
|
|
2006
2508
|
});
|
|
@@ -2027,14 +2529,14 @@ const SheetPortal = ({ ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)
|
|
|
2027
2529
|
const SheetOverlay = ({ className, ...props }) => {
|
|
2028
2530
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Overlay, {
|
|
2029
2531
|
"data-slot": "sheet-overlay",
|
|
2030
|
-
className:
|
|
2532
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[var(--overlay-md)] will-change-[opacity] data-[state=closed]:duration-100 data-[state=open]:duration-150 [animation-timing-function:cubic-bezier(0.16,1,0.3,1)] motion-reduce:animate-none", className),
|
|
2031
2533
|
...props
|
|
2032
2534
|
});
|
|
2033
2535
|
};
|
|
2034
2536
|
const SheetContent = ({ className, children, side = "right", showCloseButton = true, overlayClassName, ...props }) => {
|
|
2035
2537
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SheetPortal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SheetOverlay, { className: overlayClassName }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dialog.Content, {
|
|
2036
2538
|
"data-slot": "sheet-content",
|
|
2037
|
-
className:
|
|
2539
|
+
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 border-0 shadow-[var(--shadow-elevated)] [animation-timing-function:cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:duration-150 data-[state=open]:duration-200 will-change-[opacity,transform] motion-reduce:animate-none", side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 sm:max-w-sm rounded-l-xl rounded-r-md", side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 sm:max-w-sm rounded-r-xl rounded-l-md", side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto rounded-b-md", side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto rounded-t-md", className),
|
|
2038
2540
|
...props,
|
|
2039
2541
|
children: [children, showCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_dialog.Close, {
|
|
2040
2542
|
className: "absolute top-3 right-3 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground opacity-70 transition-[opacity,background-color] duration-150 ease-out motion-reduce:transition-none hover:opacity-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus:outline-hidden disabled:pointer-events-none cursor-pointer touch-manipulation before:absolute before:-inset-2 before:content-['']",
|
|
@@ -2051,28 +2553,28 @@ const SheetContent = ({ className, children, side = "right", showCloseButton = t
|
|
|
2051
2553
|
const SheetHeader = ({ className, ...props }) => {
|
|
2052
2554
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2053
2555
|
"data-slot": "sheet-header",
|
|
2054
|
-
className:
|
|
2556
|
+
className: cn("flex flex-col gap-0.5 px-4 py-3.5 border-b border-[var(--border-divider)]", className),
|
|
2055
2557
|
...props
|
|
2056
2558
|
});
|
|
2057
2559
|
};
|
|
2058
2560
|
const SheetFooter = ({ className, ...props }) => {
|
|
2059
2561
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2060
2562
|
"data-slot": "sheet-footer",
|
|
2061
|
-
className:
|
|
2563
|
+
className: cn("mt-auto flex flex-col gap-2 px-4 py-3.5 border-t border-[var(--border-divider)] bg-muted", className),
|
|
2062
2564
|
...props
|
|
2063
2565
|
});
|
|
2064
2566
|
};
|
|
2065
2567
|
const SheetTitle = ({ className, ...props }) => {
|
|
2066
2568
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Title, {
|
|
2067
2569
|
"data-slot": "sheet-title",
|
|
2068
|
-
className:
|
|
2570
|
+
className: cn("text-foreground font-semibold", className),
|
|
2069
2571
|
...props
|
|
2070
2572
|
});
|
|
2071
2573
|
};
|
|
2072
2574
|
const SheetDescription = ({ className, ...props }) => {
|
|
2073
2575
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, {
|
|
2074
2576
|
"data-slot": "sheet-description",
|
|
2075
|
-
className:
|
|
2577
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
2076
2578
|
...props
|
|
2077
2579
|
});
|
|
2078
2580
|
};
|
|
@@ -2083,7 +2585,7 @@ const Skeleton = ({ className, ...props }) => {
|
|
|
2083
2585
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("output", {
|
|
2084
2586
|
"aria-label": "Loading",
|
|
2085
2587
|
"data-slot": "skeleton",
|
|
2086
|
-
className:
|
|
2588
|
+
className: cn("block bg-accent animate-shimmer motion-reduce:animate-none rounded-md bg-[length:200%_100%] bg-gradient-to-r from-accent via-accent/50 to-accent dark:via-accent/70", className),
|
|
2087
2589
|
...props
|
|
2088
2590
|
});
|
|
2089
2591
|
};
|
|
@@ -2158,33 +2660,33 @@ const Toaster = ({ ...props }) => {
|
|
|
2158
2660
|
*/
|
|
2159
2661
|
const Stepper = ({ steps, currentStep, className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
2160
2662
|
"aria-label": "Progress",
|
|
2161
|
-
className:
|
|
2663
|
+
className: cn("flex w-full items-start", className),
|
|
2162
2664
|
...props,
|
|
2163
2665
|
children: steps.map((step, index) => {
|
|
2164
2666
|
const isCompleted = index < currentStep;
|
|
2165
2667
|
const isCurrent = index === currentStep;
|
|
2166
2668
|
const connectorCompleted = index > 0 && index <= currentStep;
|
|
2167
2669
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2168
|
-
className:
|
|
2670
|
+
className: cn("flex flex-1 items-start", index === steps.length - 1 && "flex-none"),
|
|
2169
2671
|
"aria-current": isCurrent ? "step" : void 0,
|
|
2170
2672
|
children: [
|
|
2171
2673
|
index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2172
2674
|
"aria-hidden": "true",
|
|
2173
|
-
className:
|
|
2675
|
+
className: cn("mt-3.5 h-px flex-1 transition-colors duration-300 ease-out motion-reduce:transition-none", connectorCompleted ? "bg-[var(--action)]" : "bg-[var(--border-divider)]")
|
|
2174
2676
|
}),
|
|
2175
2677
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2176
2678
|
className: "flex flex-col items-center gap-1.5",
|
|
2177
2679
|
children: [
|
|
2178
2680
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2179
2681
|
"aria-hidden": "true",
|
|
2180
|
-
className:
|
|
2682
|
+
className: cn("flex size-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-[background-color,border-color,color] duration-300 ease-out motion-reduce:transition-none select-none", isCompleted && "bg-[var(--action)] text-white", isCurrent && "border-2 border-[var(--action)] text-[var(--action)]", !isCompleted && !isCurrent && "border border-[var(--border-default)] text-muted-foreground"),
|
|
2181
2683
|
children: isCompleted ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {
|
|
2182
2684
|
size: 13,
|
|
2183
2685
|
strokeWidth: 3
|
|
2184
2686
|
}) : String(index + 1)
|
|
2185
2687
|
}),
|
|
2186
2688
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2187
|
-
className:
|
|
2689
|
+
className: cn("max-w-[6rem] text-center text-xs leading-tight transition-colors duration-300 ease-out motion-reduce:transition-none", isCurrent ? "font-medium text-foreground" : "text-muted-foreground"),
|
|
2188
2690
|
children: step.label
|
|
2189
2691
|
}),
|
|
2190
2692
|
step.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -2195,13 +2697,29 @@ const Stepper = ({ steps, currentStep, className, ...props }) => /* @__PURE__ */
|
|
|
2195
2697
|
}),
|
|
2196
2698
|
index < steps.length - 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2197
2699
|
"aria-hidden": "true",
|
|
2198
|
-
className:
|
|
2700
|
+
className: cn("mt-3.5 h-px flex-1 transition-colors duration-300 ease-out motion-reduce:transition-none", index + 1 <= currentStep ? "bg-[var(--action)]" : "bg-[var(--border-divider)]")
|
|
2199
2701
|
})
|
|
2200
2702
|
]
|
|
2201
2703
|
}, step.label);
|
|
2202
2704
|
})
|
|
2203
2705
|
});
|
|
2204
2706
|
|
|
2707
|
+
//#endregion
|
|
2708
|
+
//#region src/components/ui/switch/switch.tsx
|
|
2709
|
+
const Switch = (0, react.forwardRef)(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_switch.Root, {
|
|
2710
|
+
ref,
|
|
2711
|
+
"data-slot": "switch",
|
|
2712
|
+
"data-size": size,
|
|
2713
|
+
className: cn("peer data-[state=checked]:bg-(--action) data-[state=unchecked]:bg-input hover:data-[state=unchecked]:bg-[rgba(31,41,55,0.16)] group-hover/toggle:data-[state=unchecked]:bg-[rgba(31,41,55,0.16)] focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 dark:hover:data-[state=unchecked]:bg-[rgba(255,255,255,0.12)] dark:group-hover/toggle:data-[state=unchecked]:bg-[rgba(255,255,255,0.12)] relative group/switch inline-flex shrink-0 touch-manipulation items-center rounded-full border-0 shadow-[var(--shadow-control)] dark:shadow-[var(--shadow-control)] data-[state=checked]:shadow-[var(--shadow-control-checked)] dark:data-[state=checked]:shadow-[var(--shadow-control-checked)] transition-[color,background-color,box-shadow] duration-200 ease-out motion-reduce:transition-none outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer data-[size=default]:h-[18px] data-[size=default]:w-[30px] data-[size=sm]:h-3.5 data-[size=sm]:w-[22px] before:absolute before:-inset-[15px] before:content-['']", className),
|
|
2714
|
+
...props,
|
|
2715
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_switch.Thumb, {
|
|
2716
|
+
"data-slot": "switch-thumb",
|
|
2717
|
+
className: cn("pointer-events-none relative block ring-0", "transition-transform duration-200 ease-out motion-reduce:transition-none", "group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-2.5", "data-[state=unchecked]:translate-x-0.5 group-data-[size=default]/switch:data-[state=checked]:translate-x-[14px] group-data-[size=sm]/switch:data-[state=checked]:translate-x-[10px]"),
|
|
2718
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cn("absolute top-0 h-full rounded-full", "bg-background dark:group-data-[state=checked]/switch:bg-white dark:group-data-[state=unchecked]/switch:bg-[oklch(0.500_0.013_253)]", "shadow-[var(--shadow-control-thumb)] dark:shadow-[var(--shadow-control-thumb)]", "group-data-[size=default]/switch:w-3.5 group-data-[size=sm]/switch:w-2.5", "group-data-[state=checked]/switch:right-0 group-data-[state=unchecked]/switch:left-0", "group-[&[data-size=default]:active]/switch:w-[17px] group-[&[data-size=sm]:active]/switch:w-3", "transition-[width,background-color] duration-[120ms] ease-out motion-reduce:transition-none") })
|
|
2719
|
+
})
|
|
2720
|
+
}));
|
|
2721
|
+
Switch.displayName = "Switch";
|
|
2722
|
+
|
|
2205
2723
|
//#endregion
|
|
2206
2724
|
//#region src/components/ui/table/table.tsx
|
|
2207
2725
|
/** Keep overlay tracks clear of the shelf's rounded corners. */
|
|
@@ -2247,7 +2765,13 @@ const measureShelfTop = ({ scrollArea, table }) => {
|
|
|
2247
2765
|
const body = table?.tBodies[0];
|
|
2248
2766
|
return body ? body.getBoundingClientRect().top - scrollArea.getBoundingClientRect().top + scrollArea.scrollTop : 0;
|
|
2249
2767
|
};
|
|
2250
|
-
/**
|
|
2768
|
+
/**
|
|
2769
|
+
* Render a table in a stable tray with keyboard access only when content overflows.
|
|
2770
|
+
* For any list of records, use `DataTable`, which is built on this. Use `Table` directly
|
|
2771
|
+
* only for static layout: a short fixed grid of values that nobody sorts, filters, pages or selects.
|
|
2772
|
+
*
|
|
2773
|
+
* @deprecated For lists of records, use `DataTable`. Direct use is only for static layout.
|
|
2774
|
+
*/
|
|
2251
2775
|
const Table = ({ className, fill = false, scrollAreaProps = {}, stickyFirstColumn = false, viewportRef, ...props }) => {
|
|
2252
2776
|
const scrollAreaRef = (0, react.useRef)(null);
|
|
2253
2777
|
const setViewportRef = (0, react.useMemo)(() => mergeRefs(scrollAreaRef, viewportRef), [viewportRef]);
|
|
@@ -2357,7 +2881,7 @@ const Table = ({ className, fill = false, scrollAreaProps = {}, stickyFirstColum
|
|
|
2357
2881
|
"data-tray": "header",
|
|
2358
2882
|
"data-fill": fill || void 0,
|
|
2359
2883
|
dir: props.dir,
|
|
2360
|
-
className:
|
|
2884
|
+
className: cn("group/table relative min-w-0 w-full overflow-hidden [container-type:inline-size] [--table-radius:16px] [--table-shelf-radius:calc(var(--table-radius)_-_var(--tray-inset))] rounded-[var(--table-radius)] bg-[var(--tray-chrome)] px-[var(--tray-inset)] pb-[var(--tray-inset)]", fill && "flex min-h-0 flex-1 flex-col"),
|
|
2361
2885
|
children: [
|
|
2362
2886
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2363
2887
|
"aria-hidden": "true",
|
|
@@ -2382,11 +2906,11 @@ const Table = ({ className, fill = false, scrollAreaProps = {}, stickyFirstColum
|
|
|
2382
2906
|
scrollPaddingTop: headerHeight + topCaptionHeight,
|
|
2383
2907
|
...scrollAreaStyle
|
|
2384
2908
|
},
|
|
2385
|
-
className:
|
|
2909
|
+
className: cn("relative min-w-0 overflow-auto overscroll-none rounded-[var(--table-shelf-radius)] data-[native-scrollbars=true]:[scrollbar-width:auto] data-[native-scrollbars=true]:[&::-webkit-scrollbar]:block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ring)]", fill && "min-h-0 flex-1", scrollAreaClassName),
|
|
2386
2910
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
|
|
2387
2911
|
"data-slot": "table",
|
|
2388
2912
|
"data-sticky-first-column": stickyFirstColumn || void 0,
|
|
2389
|
-
className:
|
|
2913
|
+
className: cn("w-full caption-bottom border-separate border-spacing-0 text-sm", stickyFirstColumn && [
|
|
2390
2914
|
"[&>*>tr>[data-table-pinned]]:sticky [&>*>tr>[data-table-pinned]]:start-0 [&>*>tr>[data-table-pinned]]:z-10",
|
|
2391
2915
|
"[&>*>tr>[data-table-pinned]]:bg-card",
|
|
2392
2916
|
"[&>thead>tr>[data-table-pinned]]:bg-[var(--tray-chrome)]",
|
|
@@ -2435,7 +2959,7 @@ const Table = ({ className, fill = false, scrollAreaProps = {}, stickyFirstColum
|
|
|
2435
2959
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_scroll_area.Thumb, {
|
|
2436
2960
|
"data-slot": "table-scrollbar-thumb",
|
|
2437
2961
|
style: orientation === "vertical" ? { width: "100%" } : { height: "100%" },
|
|
2438
|
-
className:
|
|
2962
|
+
className: cn("relative [--table-scrollbar-thumb:color-mix(in_oklab,var(--foreground)_25%,transparent)] [--table-scrollbar-thumb-hover:color-mix(in_oklab,var(--foreground)_35%,transparent)] before:pointer-events-none before:absolute before:rounded-full before:bg-[var(--table-scrollbar-thumb)] group-hover/scrollbar:before:bg-[var(--table-scrollbar-thumb-hover)] contrast-more:before:bg-[var(--border-strong)] contrast-more:group-hover/scrollbar:before:bg-[var(--border-strong)] forced-colors:before:bg-[CanvasText] forced-colors:group-hover/scrollbar:before:bg-[CanvasText]", orientation === "vertical" ? "before:inset-y-0 before:left-1/2 before:w-1 before:-translate-x-1/2 group-hover/scrollbar:before:w-1.5" : "before:inset-x-0 before:top-1/2 before:h-1 before:-translate-y-1/2 group-hover/scrollbar:before:h-1.5")
|
|
2439
2963
|
})
|
|
2440
2964
|
}, orientation))
|
|
2441
2965
|
]
|
|
@@ -2445,28 +2969,28 @@ const Table = ({ className, fill = false, scrollAreaProps = {}, stickyFirstColum
|
|
|
2445
2969
|
const TableHeader = ({ className, ...props }) => {
|
|
2446
2970
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
|
|
2447
2971
|
"data-slot": "table-header",
|
|
2448
|
-
className:
|
|
2972
|
+
className: cn("sticky top-[var(--table-caption-height,0px)] z-20 bg-[var(--tray-chrome)] [&_tr]:border-0 [&_tr]:hover:bg-transparent", className),
|
|
2449
2973
|
...props
|
|
2450
2974
|
});
|
|
2451
2975
|
};
|
|
2452
2976
|
const TableBody = ({ className, ...props }) => {
|
|
2453
2977
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
|
|
2454
2978
|
"data-slot": "table-body",
|
|
2455
|
-
className:
|
|
2979
|
+
className: cn("[&>tr:not(:last-child)>*]:border-b [&>tr:not(:last-child)>*]:border-[var(--border-divider)]", className),
|
|
2456
2980
|
...props
|
|
2457
2981
|
});
|
|
2458
2982
|
};
|
|
2459
2983
|
const TableFooter = ({ className, ...props }) => {
|
|
2460
2984
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tfoot", {
|
|
2461
2985
|
"data-slot": "table-footer",
|
|
2462
|
-
className:
|
|
2986
|
+
className: cn("font-medium [&>tr>*]:border-t [&>tr>*]:border-[var(--border-divider)]", className),
|
|
2463
2987
|
...props
|
|
2464
2988
|
});
|
|
2465
2989
|
};
|
|
2466
2990
|
const TableRow = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
2467
2991
|
ref,
|
|
2468
2992
|
"data-slot": "table-row",
|
|
2469
|
-
className:
|
|
2993
|
+
className: cn("hover:bg-[var(--overlay-hover)] data-[state=selected]:bg-[var(--table-row-selected)] data-[state=selected]:hover:bg-[var(--table-row-selected-hover)] border-b border-[var(--border-divider)]", "hover:[--table-row-overlay:var(--overlay-hover)] data-[state=selected]:[--table-row-overlay:var(--table-row-selected)] data-[state=selected]:hover:[--table-row-overlay:var(--table-row-selected-hover)]", className),
|
|
2470
2994
|
...props
|
|
2471
2995
|
}));
|
|
2472
2996
|
TableRow.displayName = "TableRow";
|
|
@@ -2474,21 +2998,21 @@ const TableHead = ({ className, scope, ...props }) => {
|
|
|
2474
2998
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
2475
2999
|
"data-slot": "table-head",
|
|
2476
3000
|
scope: scope ?? "col",
|
|
2477
|
-
className:
|
|
3001
|
+
className: cn("text-foreground/75 h-[38px] px-4 text-left align-middle text-xs font-medium whitespace-nowrap tabular-nums [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
2478
3002
|
...props
|
|
2479
3003
|
});
|
|
2480
3004
|
};
|
|
2481
3005
|
const TableCell = ({ className, ...props }) => {
|
|
2482
3006
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2483
3007
|
"data-slot": "table-cell",
|
|
2484
|
-
className:
|
|
3008
|
+
className: cn("px-4 py-2.5 align-middle whitespace-nowrap tabular-nums [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
|
|
2485
3009
|
...props
|
|
2486
3010
|
});
|
|
2487
3011
|
};
|
|
2488
3012
|
const TableCaption = ({ className, ...props }) => {
|
|
2489
3013
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("caption", {
|
|
2490
3014
|
"data-slot": "table-caption",
|
|
2491
|
-
className:
|
|
3015
|
+
className: cn("text-muted-foreground mt-4 text-sm [[data-caption-top=true]_&]:sticky [[data-caption-top=true]_&]:top-0 [[data-caption-top=true]_&]:z-20 [[data-caption-top=true]_&]:mt-0 [[data-caption-top=true]_&]:bg-[var(--tray-chrome)]", className),
|
|
2492
3016
|
...props
|
|
2493
3017
|
});
|
|
2494
3018
|
};
|
|
@@ -2557,7 +3081,7 @@ const DataTable = ({ children, className, fill = false, table, ...props }) => {
|
|
|
2557
3081
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2558
3082
|
"data-slot": "data-table",
|
|
2559
3083
|
"data-fill": fill || void 0,
|
|
2560
|
-
className:
|
|
3084
|
+
className: cn("flex min-w-0 flex-col gap-3", fill && "min-h-0 flex-1", className),
|
|
2561
3085
|
...props,
|
|
2562
3086
|
children
|
|
2563
3087
|
})
|
|
@@ -2579,7 +3103,7 @@ const DataTable = ({ children, className, fill = false, table, ...props }) => {
|
|
|
2579
3103
|
*/
|
|
2580
3104
|
const DataTableToolbar = ({ className, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2581
3105
|
"data-slot": "data-table-toolbar",
|
|
2582
|
-
className:
|
|
3106
|
+
className: cn("flex flex-wrap items-center gap-2", className),
|
|
2583
3107
|
...props
|
|
2584
3108
|
});
|
|
2585
3109
|
|
|
@@ -2637,7 +3161,7 @@ const DataTableValuesFilter = ({ column, filterValue }) => {
|
|
|
2637
3161
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2638
3162
|
"data-slot": "data-table-column-filter-options",
|
|
2639
3163
|
className: "-m-1 flex max-h-60 flex-col gap-2 overflow-y-auto p-1",
|
|
2640
|
-
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3164
|
+
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Label, {
|
|
2641
3165
|
className: "flex items-center gap-2 text-sm font-normal",
|
|
2642
3166
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Checkbox, {
|
|
2643
3167
|
checked: selected.includes(option),
|
|
@@ -2677,13 +3201,13 @@ const DataTableColumnFilter = ({ className, column }) => {
|
|
|
2677
3201
|
const isFiltered = column.getIsFiltered();
|
|
2678
3202
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Popover, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverTrigger, {
|
|
2679
3203
|
asChild: true,
|
|
2680
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3204
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
2681
3205
|
"aria-label": isFiltered ? `Filter ${label}, filtered` : `Filter ${label}`,
|
|
2682
3206
|
"data-slot": "data-table-column-filter",
|
|
2683
3207
|
"data-filtered": isFiltered || void 0,
|
|
2684
3208
|
size: "icon-xs",
|
|
2685
3209
|
variant: "ghost",
|
|
2686
|
-
className:
|
|
3210
|
+
className: cn("ms-1 align-middle before:-inset-1 data-[filtered=true]:text-foreground", className),
|
|
2687
3211
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
2688
3212
|
icon: _hugeicons_core_free_icons.FilterIcon,
|
|
2689
3213
|
"aria-hidden": "true"
|
|
@@ -2705,7 +3229,7 @@ const DataTableColumnFilterContent = ({ column }) => {
|
|
|
2705
3229
|
children: [column.columnDef.meta?.filter === "values" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataTableValuesFilter, {
|
|
2706
3230
|
column,
|
|
2707
3231
|
filterValue
|
|
2708
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3232
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
2709
3233
|
"aria-label": `Filter ${label}`,
|
|
2710
3234
|
placeholder: TEXT_FILTER_PLACEHOLDER,
|
|
2711
3235
|
value: typeof filterValue === "string" ? filterValue : "",
|
|
@@ -2713,7 +3237,7 @@ const DataTableColumnFilterContent = ({ column }) => {
|
|
|
2713
3237
|
}), column.getIsFiltered() && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2714
3238
|
"data-slot": "data-table-column-filter-footer",
|
|
2715
3239
|
className: "-mx-3 flex justify-end border-t border-[var(--border-divider)] px-3 pt-3",
|
|
2716
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3240
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
2717
3241
|
size: "sm",
|
|
2718
3242
|
variant: "secondary",
|
|
2719
3243
|
onClick: () => column.setFilterValue(void 0),
|
|
@@ -2745,7 +3269,7 @@ const DataTableFilterChip = ({ column, label, onRemove, removeLabel, values }) =
|
|
|
2745
3269
|
type: "button",
|
|
2746
3270
|
"aria-label": removeLabel,
|
|
2747
3271
|
onClick: onRemove,
|
|
2748
|
-
className:
|
|
3272
|
+
className: cn(CHIP_CONTROL, "w-6 justify-center text-muted-foreground/70 hover:text-foreground"),
|
|
2749
3273
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
2750
3274
|
icon: _hugeicons_core_free_icons.Cancel01Icon,
|
|
2751
3275
|
size: 12,
|
|
@@ -2769,7 +3293,7 @@ const DataTableFilterChip = ({ column, label, onRemove, removeLabel, values }) =
|
|
|
2769
3293
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2770
3294
|
type: "button",
|
|
2771
3295
|
"aria-label": `Change ${label} filter: ${fullValue}`,
|
|
2772
|
-
className:
|
|
3296
|
+
className: cn(CHIP_CONTROL, "ms-1 gap-1 ps-1.5 pe-1 font-medium text-[var(--action)]"),
|
|
2773
3297
|
children: [shownValue, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
2774
3298
|
icon: _hugeicons_core_free_icons.ArrowDown01Icon,
|
|
2775
3299
|
size: 14,
|
|
@@ -2815,7 +3339,7 @@ const DataTableActiveFilters = ({ className }) => {
|
|
|
2815
3339
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
2816
3340
|
"aria-label": "Active filters",
|
|
2817
3341
|
"data-slot": "data-table-active-filters",
|
|
2818
|
-
className:
|
|
3342
|
+
className: cn("flex min-w-0 flex-wrap items-center gap-2", className),
|
|
2819
3343
|
children: [
|
|
2820
3344
|
search !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataTableFilterChip, {
|
|
2821
3345
|
label: "Search",
|
|
@@ -2834,7 +3358,7 @@ const DataTableActiveFilters = ({ className }) => {
|
|
|
2834
3358
|
values: toFilterValues(value)
|
|
2835
3359
|
}, id);
|
|
2836
3360
|
}),
|
|
2837
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3361
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
2838
3362
|
className: "text-muted-foreground hover:text-foreground",
|
|
2839
3363
|
variant: "ghost",
|
|
2840
3364
|
onClick: clearAll,
|
|
@@ -2868,7 +3392,7 @@ const DataTableColumnVisibility = ({ className, label = "Columns" }) => {
|
|
|
2868
3392
|
const columns = table.getAllLeafColumns().filter((column) => column.getCanHide());
|
|
2869
3393
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropdownMenuTrigger, {
|
|
2870
3394
|
asChild: true,
|
|
2871
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
3395
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
2872
3396
|
"data-slot": "data-table-column-visibility",
|
|
2873
3397
|
className,
|
|
2874
3398
|
variant: "outline",
|
|
@@ -2909,7 +3433,7 @@ const DataTableColumnVisibility = ({ className, label = "Columns" }) => {
|
|
|
2909
3433
|
//#region src/components/empty-state/empty-state.tsx
|
|
2910
3434
|
const EmptyState = ({ icon: Icon$2, title, description, action, className }) => {
|
|
2911
3435
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2912
|
-
className:
|
|
3436
|
+
className: cn("flex flex-col items-center justify-center py-16 px-8 text-center", className),
|
|
2913
3437
|
children: [
|
|
2914
3438
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2915
3439
|
className: "flex size-12 items-center justify-center rounded-xl bg-muted mb-4",
|
|
@@ -2952,7 +3476,7 @@ const DataTableSkeletonRows = ({ columnCount, rowCount }) => /* @__PURE__ */ (0,
|
|
|
2952
3476
|
className: STATIC_ROW,
|
|
2953
3477
|
children: Array.from({ length: columnCount }, (_$1, columnIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, {
|
|
2954
3478
|
"aria-hidden": rowIndex > 0 || columnIndex > 0 || void 0,
|
|
2955
|
-
className:
|
|
3479
|
+
className: cn("h-4 max-w-full", getBarWidth(columnIndex))
|
|
2956
3480
|
}) }, columnIndex))
|
|
2957
3481
|
}, rowIndex)) });
|
|
2958
3482
|
/** Ghost rows keep the table's shape behind an icon and title. */
|
|
@@ -2973,7 +3497,7 @@ const DataTableEmptyRow = ({ action, columnCount, icon, title }) => /* @__PURE__
|
|
|
2973
3497
|
style: { gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` },
|
|
2974
3498
|
children: Array.from({ length: columnCount }, (_$1, columnIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2975
3499
|
className: "px-4",
|
|
2976
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className:
|
|
3500
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cn("block h-2.5 max-w-full rounded-full bg-[var(--bg-accented)]", getBarWidth(columnIndex)) })
|
|
2977
3501
|
}, columnIndex))
|
|
2978
3502
|
}, rowIndex))
|
|
2979
3503
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2995,7 +3519,7 @@ const DataTableEmptyRow = ({ action, columnCount, icon, title }) => /* @__PURE__
|
|
|
2995
3519
|
const ExpandChevron = ({ isOpen }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
2996
3520
|
icon: _hugeicons_core_free_icons.ArrowRight01Icon,
|
|
2997
3521
|
"aria-hidden": "true",
|
|
2998
|
-
className:
|
|
3522
|
+
className: cn("transition-transform duration-150 motion-reduce:transition-none", isOpen && "rotate-90")
|
|
2999
3523
|
});
|
|
3000
3524
|
|
|
3001
3525
|
//#endregion
|
|
@@ -3016,7 +3540,7 @@ const getPinnedCellProps = ({ column, section }) => {
|
|
|
3016
3540
|
if (!side) return {};
|
|
3017
3541
|
const isEdge = side === "left" ? column.getIsLastColumn("left") : column.getIsFirstColumn("right");
|
|
3018
3542
|
return {
|
|
3019
|
-
className:
|
|
3543
|
+
className: cn("sticky z-10", PINNED_BACKGROUND[section], isEdge && PINNED_EDGE[side]),
|
|
3020
3544
|
"data-pinned": side,
|
|
3021
3545
|
style: side === "left" ? { insetInlineStart: column.getStart("left") } : { insetInlineEnd: column.getAfter("right") }
|
|
3022
3546
|
};
|
|
@@ -3106,7 +3630,7 @@ const DataTableRow = ({ hasFixedLayout, row, rowRef, ...props }) => {
|
|
|
3106
3630
|
});
|
|
3107
3631
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableCell, {
|
|
3108
3632
|
"data-pinned": pinned["data-pinned"],
|
|
3109
|
-
className:
|
|
3633
|
+
className: cn(hasFixedLayout && !isControlColumn(cell.column.id) && FIXED_LAYOUT_CELL_CLASS, pinned.className),
|
|
3110
3634
|
style: cell.id === indentedCellId ? {
|
|
3111
3635
|
...pinned.style,
|
|
3112
3636
|
paddingInlineStart: getIndent(row.depth)
|
|
@@ -3237,7 +3761,7 @@ const DataTableHeadCell = ({ header, hasFixedLayout }) => {
|
|
|
3237
3761
|
colSpan: header.colSpan,
|
|
3238
3762
|
"aria-sort": sorted && sortIndex === 0 ? ARIA_SORT[sorted] : void 0,
|
|
3239
3763
|
"data-pinned": pinned["data-pinned"],
|
|
3240
|
-
className:
|
|
3764
|
+
className: cn(column.getCanResize() && "relative", isControlColumn(column.id) && "w-px", hasFixedLayout && !isControlColumn(column.id) && FIXED_LAYOUT_CELL_CLASS, pinned.className),
|
|
3241
3765
|
style: {
|
|
3242
3766
|
...pinned.style,
|
|
3243
3767
|
width: hasFixedLayout ? header.getSize() : void 0
|
|
@@ -3357,7 +3881,7 @@ const DataTableContent = ({ className, emptyFilteredTitle = DEFAULT_EMPTY_FILTER
|
|
|
3357
3881
|
table.setGlobalFilter("");
|
|
3358
3882
|
};
|
|
3359
3883
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataTableEmptyRow, {
|
|
3360
|
-
action: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3884
|
+
action: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
3361
3885
|
variant: "outline",
|
|
3362
3886
|
size: "sm",
|
|
3363
3887
|
onClick: clearFilters,
|
|
@@ -3385,7 +3909,7 @@ const DataTableContent = ({ className, emptyFilteredTitle = DEFAULT_EMPTY_FILTER
|
|
|
3385
3909
|
fill,
|
|
3386
3910
|
"aria-busy": loading || void 0,
|
|
3387
3911
|
"aria-rowcount": isVirtualized ? rows.length + headerRowCount : void 0,
|
|
3388
|
-
className:
|
|
3912
|
+
className: cn(hasFixedLayout && "w-auto table-fixed", className),
|
|
3389
3913
|
style: hasFixedLayout ? {
|
|
3390
3914
|
minWidth: "100%",
|
|
3391
3915
|
width: table.getTotalSize(),
|
|
@@ -3482,13 +4006,13 @@ const DataTableSearch = ({ className, placeholder = "Search" }) => {
|
|
|
3482
4006
|
const { globalFilter } = table.getState();
|
|
3483
4007
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3484
4008
|
"data-slot": "data-table-search",
|
|
3485
|
-
className:
|
|
4009
|
+
className: cn("relative w-full max-w-64", className),
|
|
3486
4010
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
3487
4011
|
icon: _hugeicons_core_free_icons.Search01Icon,
|
|
3488
4012
|
size: 16,
|
|
3489
4013
|
"aria-hidden": "true",
|
|
3490
4014
|
className: "pointer-events-none absolute start-2 top-1/2 -translate-y-1/2 text-muted-foreground/70"
|
|
3491
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4015
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
3492
4016
|
type: "search",
|
|
3493
4017
|
"aria-label": placeholder,
|
|
3494
4018
|
placeholder,
|
|
@@ -3809,7 +4333,7 @@ const Tabs = ({ className, orientation = "horizontal", ...props }) => {
|
|
|
3809
4333
|
"data-slot": "tabs",
|
|
3810
4334
|
"data-orientation": orientation,
|
|
3811
4335
|
orientation,
|
|
3812
|
-
className:
|
|
4336
|
+
className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className),
|
|
3813
4337
|
...props
|
|
3814
4338
|
});
|
|
3815
4339
|
};
|
|
@@ -3825,21 +4349,21 @@ const TabsList = (0, react.forwardRef)(({ className, variant = "default", ...pro
|
|
|
3825
4349
|
ref,
|
|
3826
4350
|
"data-slot": "tabs-list",
|
|
3827
4351
|
"data-variant": variant,
|
|
3828
|
-
className:
|
|
4352
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
3829
4353
|
...props
|
|
3830
4354
|
}));
|
|
3831
4355
|
TabsList.displayName = _radix_ui_react_tabs.List.displayName;
|
|
3832
4356
|
const TabsTrigger = ({ className, ...props }) => {
|
|
3833
4357
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tabs.Trigger, {
|
|
3834
4358
|
"data-slot": "tabs-trigger",
|
|
3835
|
-
className:
|
|
4359
|
+
className: cn("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap touch-manipulation transition-[color,background-color,border-color,box-shadow,opacity] duration-150 motion-reduce:transition-none group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent", "data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground", "after:bg-foreground after:absolute after:opacity-0 after:transition-[opacity] after:motion-reduce:transition-none group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100", "group-data-[variant=navigation]/tabs-list:h-11 group-data-[variant=navigation]/tabs-list:flex-none group-data-[variant=navigation]/tabs-list:rounded-none group-data-[variant=navigation]/tabs-list:border-0 group-data-[variant=navigation]/tabs-list:bg-transparent group-data-[variant=navigation]/tabs-list:px-0 group-data-[variant=navigation]/tabs-list:py-0 group-data-[variant=navigation]/tabs-list:text-sm group-data-[variant=navigation]/tabs-list:font-normal group-data-[variant=navigation]/tabs-list:after:hidden group-data-[variant=navigation]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=navigation]/tabs-list:data-[state=active]:bg-transparent", className),
|
|
3836
4360
|
...props
|
|
3837
4361
|
});
|
|
3838
4362
|
};
|
|
3839
4363
|
const TabsContent = ({ className, ...props }) => {
|
|
3840
4364
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tabs.Content, {
|
|
3841
4365
|
"data-slot": "tabs-content",
|
|
3842
|
-
className:
|
|
4366
|
+
className: cn("flex-1 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:rounded-md", className),
|
|
3843
4367
|
...props
|
|
3844
4368
|
});
|
|
3845
4369
|
};
|
|
@@ -3923,7 +4447,7 @@ const ToggleGroup = ({ type, value, onValueChange, disabled = false, className,
|
|
|
3923
4447
|
"data-slot": "toggle-group",
|
|
3924
4448
|
role: type === "single" ? "radiogroup" : "toolbar",
|
|
3925
4449
|
onKeyDown: handleKeyDown,
|
|
3926
|
-
className:
|
|
4450
|
+
className: cn("inline-flex items-center rounded-lg bg-muted p-[3px] gap-0.5", disabled && "opacity-50 pointer-events-none", className),
|
|
3927
4451
|
...props,
|
|
3928
4452
|
children
|
|
3929
4453
|
})
|
|
@@ -3951,7 +4475,7 @@ const ToggleGroupItem = ({ value, disabled, className, children, onClick, ...pro
|
|
|
3951
4475
|
};
|
|
3952
4476
|
const tabIndex = isActive ? 0 : -1;
|
|
3953
4477
|
const sharedButtonProps = {
|
|
3954
|
-
className:
|
|
4478
|
+
className: cn("relative inline-flex h-8 flex-1 items-center justify-center gap-1.5", "rounded-md px-3 text-sm font-medium whitespace-nowrap", "cursor-pointer", "text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground", "transition-[color,background-color,box-shadow] duration-150 ease-out motion-reduce:transition-none", "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm", "dark:data-[state=on]:bg-input/30 dark:data-[state=on]:text-foreground dark:data-[state=on]:border dark:data-[state=on]:border-input", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", "disabled:pointer-events-none disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
3955
4479
|
"data-slot": "toggle-group-item",
|
|
3956
4480
|
"data-state": isActive ? "on" : "off",
|
|
3957
4481
|
disabled: isDisabled,
|
|
@@ -3980,7 +4504,7 @@ const ToggleGroupItem = ({ value, disabled, className, children, onClick, ...pro
|
|
|
3980
4504
|
const Textarea = ({ className, ...props }) => {
|
|
3981
4505
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
3982
4506
|
"data-slot": "textarea",
|
|
3983
|
-
className:
|
|
4507
|
+
className: cn("placeholder:text-muted-foreground/60 dark:bg-input/30 flex field-sizing-content min-h-20 w-full touch-manipulation rounded-md border-0 bg-background px-3 py-2 text-base shadow-[var(--shadow-input)] transition-[color,box-shadow] duration-100 ease-out outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "hover:shadow-[var(--shadow-input-hover)]", "focus-visible:shadow-[0_0_0_1px_var(--ring),0_0_0_4px_var(--ring-halo,#0072EF26)]", "aria-invalid:shadow-[0_0_0_1px_var(--destructive),0_0_1px_0_var(--destructive)]", className),
|
|
3984
4508
|
...props
|
|
3985
4509
|
});
|
|
3986
4510
|
};
|
|
@@ -3994,7 +4518,7 @@ const TooltipContent = (0, react.forwardRef)(({ children, className, sideOffset
|
|
|
3994
4518
|
ref,
|
|
3995
4519
|
"data-slot": "tooltip-content",
|
|
3996
4520
|
sideOffset,
|
|
3997
|
-
className:
|
|
4521
|
+
className: cn("z-50 max-w-xs rounded-[6px] bg-[var(--tooltip-bg)] px-2 py-1 text-xs leading-4 font-medium text-balance text-[var(--tooltip-fg)] shadow-[inset_0_1px_0_0_oklch(1_0_0/0.08)] [filter:var(--tooltip-drop)]", className),
|
|
3998
4522
|
...props,
|
|
3999
4523
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_tooltip.Arrow, {
|
|
4000
4524
|
asChild: true,
|
|
@@ -4052,7 +4576,7 @@ const AssetIcon = ({ symbol, size = 32, className }) => {
|
|
|
4052
4576
|
alt: symbol,
|
|
4053
4577
|
width: size,
|
|
4054
4578
|
height: size,
|
|
4055
|
-
className:
|
|
4579
|
+
className: cn("object-contain", className),
|
|
4056
4580
|
onError: (e) => {
|
|
4057
4581
|
const target = e.currentTarget;
|
|
4058
4582
|
if (!target.src.endsWith("/assets/generic.svg")) target.src = "/assets/generic.svg";
|
|
@@ -4063,9 +4587,10 @@ const AssetIcon = ({ symbol, size = 32, className }) => {
|
|
|
4063
4587
|
//#endregion
|
|
4064
4588
|
//#region src/components/copy-button/copy-button.tsx
|
|
4065
4589
|
const TIMING = {
|
|
4066
|
-
|
|
4067
|
-
iconSwap:
|
|
4068
|
-
reset: 120
|
|
4590
|
+
errorHold: 2e3,
|
|
4591
|
+
iconSwap: 200,
|
|
4592
|
+
reset: 120,
|
|
4593
|
+
successHold: 1e3
|
|
4069
4594
|
};
|
|
4070
4595
|
const COPY_STAGE = {
|
|
4071
4596
|
copied: 1,
|
|
@@ -4073,12 +4598,18 @@ const COPY_STAGE = {
|
|
|
4073
4598
|
idle: 0
|
|
4074
4599
|
};
|
|
4075
4600
|
const ICON = {
|
|
4601
|
+
activeBlur: "blur(0px)",
|
|
4076
4602
|
activeScale: 1,
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4603
|
+
inactiveBlur: "blur(4px)",
|
|
4604
|
+
inactiveScale: .25,
|
|
4605
|
+
transition: {
|
|
4606
|
+
duration: TIMING.iconSwap / 1e3,
|
|
4607
|
+
ease: [
|
|
4608
|
+
.4,
|
|
4609
|
+
0,
|
|
4610
|
+
.2,
|
|
4611
|
+
1
|
|
4612
|
+
]
|
|
4082
4613
|
}
|
|
4083
4614
|
};
|
|
4084
4615
|
const LABEL = {
|
|
@@ -4099,6 +4630,7 @@ const HIDDEN_RESET_TRANSITION = {
|
|
|
4099
4630
|
duration: 0
|
|
4100
4631
|
};
|
|
4101
4632
|
const ICON_RESET_TRANSITION = {
|
|
4633
|
+
filter: HIDDEN_RESET_TRANSITION,
|
|
4102
4634
|
opacity: RESET_TRANSITION,
|
|
4103
4635
|
scale: HIDDEN_RESET_TRANSITION
|
|
4104
4636
|
};
|
|
@@ -4108,12 +4640,11 @@ const LABEL_RESET_TRANSITION = {
|
|
|
4108
4640
|
};
|
|
4109
4641
|
const REDUCED_MOTION_TRANSITION = { duration: 0 };
|
|
4110
4642
|
/** Copies a value and presents stable, accessible success or failure feedback. */
|
|
4111
|
-
const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", className }) => {
|
|
4643
|
+
const CopyButton = ({ value, ariaLabel: idleAriaLabel, label, variant = "outline", size = "icon-xs", className }) => {
|
|
4112
4644
|
const [stage, setStage] = (0, react.useState)(COPY_STAGE.idle);
|
|
4113
4645
|
const timeoutRef = (0, react.useRef)(null);
|
|
4114
4646
|
const requestIdRef = (0, react.useRef)(0);
|
|
4115
4647
|
const shouldReduceMotion = (0, motion_react.useReducedMotion)();
|
|
4116
|
-
const animationStyle = { willChange: shouldReduceMotion ? "auto" : "transform, opacity" };
|
|
4117
4648
|
(0, react.useEffect)(() => {
|
|
4118
4649
|
return () => {
|
|
4119
4650
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
@@ -4122,7 +4653,7 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4122
4653
|
const showFeedback = (nextStage) => {
|
|
4123
4654
|
setStage(nextStage);
|
|
4124
4655
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4125
|
-
timeoutRef.current = setTimeout(() => setStage(COPY_STAGE.idle), TIMING.
|
|
4656
|
+
timeoutRef.current = setTimeout(() => setStage(COPY_STAGE.idle), nextStage === COPY_STAGE.error ? TIMING.errorHold : TIMING.successHold);
|
|
4126
4657
|
};
|
|
4127
4658
|
const handleCopy = async () => {
|
|
4128
4659
|
const requestId = ++requestIdRef.current;
|
|
@@ -4133,7 +4664,7 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4133
4664
|
if (requestId === requestIdRef.current) showFeedback(COPY_STAGE.error);
|
|
4134
4665
|
}
|
|
4135
4666
|
};
|
|
4136
|
-
let ariaLabel = label || "Copy to clipboard";
|
|
4667
|
+
let ariaLabel = idleAriaLabel || label || "Copy to clipboard";
|
|
4137
4668
|
let announcement = "";
|
|
4138
4669
|
if (stage === COPY_STAGE.copied) {
|
|
4139
4670
|
ariaLabel = "Copied";
|
|
@@ -4142,7 +4673,7 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4142
4673
|
ariaLabel = "Copy failed";
|
|
4143
4674
|
announcement = "Copy failed";
|
|
4144
4675
|
}
|
|
4145
|
-
let iconTransition = ICON.
|
|
4676
|
+
let iconTransition = ICON.transition;
|
|
4146
4677
|
let labelTransition = LABEL.spring;
|
|
4147
4678
|
if (stage === COPY_STAGE.idle) {
|
|
4148
4679
|
iconTransition = ICON_RESET_TRANSITION;
|
|
@@ -4163,8 +4694,8 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4163
4694
|
},
|
|
4164
4695
|
{
|
|
4165
4696
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {
|
|
4166
|
-
|
|
4167
|
-
|
|
4697
|
+
className: "[&_path]:[stroke-width:var(--icon-stroke-width,1.75)]",
|
|
4698
|
+
size: null
|
|
4168
4699
|
}),
|
|
4169
4700
|
label: label ? "Copied" : void 0,
|
|
4170
4701
|
stage: COPY_STAGE.copied
|
|
@@ -4178,12 +4709,12 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4178
4709
|
stage: COPY_STAGE.error
|
|
4179
4710
|
}
|
|
4180
4711
|
];
|
|
4181
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
4712
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
4182
4713
|
variant,
|
|
4183
4714
|
size,
|
|
4184
4715
|
onClick: handleCopy,
|
|
4185
4716
|
"aria-label": ariaLabel,
|
|
4186
|
-
className:
|
|
4717
|
+
className: cn(stage === COPY_STAGE.copied && "text-[var(--text-success)]", stage === COPY_STAGE.error && "text-[var(--text-danger)]", className),
|
|
4187
4718
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4188
4719
|
"aria-hidden": "true",
|
|
4189
4720
|
className: "grid items-center",
|
|
@@ -4194,17 +4725,18 @@ const CopyButton = ({ value, label, variant = "outline", size = "icon-xs", class
|
|
|
4194
4725
|
className: "col-start-1 row-start-1 flex items-center gap-1.5",
|
|
4195
4726
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.span, {
|
|
4196
4727
|
initial: false,
|
|
4728
|
+
"data-slot": visualState.stage === COPY_STAGE.copied ? "copy-button-check" : void 0,
|
|
4729
|
+
"data-state": isActive ? "checked" : "unchecked",
|
|
4197
4730
|
animate: {
|
|
4731
|
+
filter: isIdleVisual || isActive ? ICON.activeBlur : ICON.inactiveBlur,
|
|
4198
4732
|
opacity: isActive ? 1 : 0,
|
|
4199
4733
|
scale: isIdleVisual || isActive ? ICON.activeScale : ICON.inactiveScale
|
|
4200
4734
|
},
|
|
4201
4735
|
transition: iconTransition,
|
|
4202
|
-
style: animationStyle,
|
|
4203
4736
|
className: "flex items-center",
|
|
4204
4737
|
children: visualState.icon
|
|
4205
4738
|
}), visualState.label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.span, {
|
|
4206
4739
|
initial: false,
|
|
4207
|
-
style: animationStyle,
|
|
4208
4740
|
animate: {
|
|
4209
4741
|
opacity: isActive ? 1 : 0,
|
|
4210
4742
|
y: isIdleVisual || isActive ? LABEL.activeOffset : LABEL.inactiveOffset
|
|
@@ -4256,21 +4788,21 @@ const CodeBlock = (0, react.forwardRef)(({ code, title, language: _language, sho
|
|
|
4256
4788
|
const s = variantStyles[variant];
|
|
4257
4789
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4258
4790
|
ref,
|
|
4259
|
-
className:
|
|
4791
|
+
className: cn("rounded-xl overflow-hidden", s.wrapper, className),
|
|
4260
4792
|
children: [(title || showWindowChrome) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4261
|
-
className:
|
|
4793
|
+
className: cn("flex items-center justify-between border-b px-4 py-2.5", s.header),
|
|
4262
4794
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4263
4795
|
className: "flex items-center gap-3",
|
|
4264
4796
|
children: [showWindowChrome && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4265
4797
|
className: "flex gap-[6px]",
|
|
4266
4798
|
"aria-hidden": "true",
|
|
4267
4799
|
children: [
|
|
4268
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className:
|
|
4269
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className:
|
|
4270
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className:
|
|
4800
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cn("size-[9px] rounded-full", s.chromeDot) }),
|
|
4801
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cn("size-[9px] rounded-full", s.chromeDot) }),
|
|
4802
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cn("size-[9px] rounded-full", s.chromeDot) })
|
|
4271
4803
|
]
|
|
4272
4804
|
}), title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4273
|
-
className:
|
|
4805
|
+
className: cn("text-[13px] font-medium", s.headerText),
|
|
4274
4806
|
children: title
|
|
4275
4807
|
})]
|
|
4276
4808
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyButton, {
|
|
@@ -4290,25 +4822,25 @@ const CodeBlock = (0, react.forwardRef)(({ code, title, language: _language, sho
|
|
|
4290
4822
|
className: s.copyBtn
|
|
4291
4823
|
})
|
|
4292
4824
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4293
|
-
className:
|
|
4825
|
+
className: cn("overflow-x-auto px-4 py-3.5 text-[13px] font-mono leading-relaxed", !title && !showWindowChrome && "pr-10", variant === "dark" && "bg-[var(--background)]"),
|
|
4294
4826
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: showLineNumbers ? lines.map((line, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4295
4827
|
className: "table-row",
|
|
4296
4828
|
children: [
|
|
4297
4829
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4298
|
-
className:
|
|
4830
|
+
className: cn("table-cell pr-4 text-right select-none tabular-nums w-[2ch]", s.lineNumber),
|
|
4299
4831
|
children: i + 1
|
|
4300
4832
|
}),
|
|
4301
4833
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4302
4834
|
className: "table-cell",
|
|
4303
4835
|
children: [showTerminalPrompt && i === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4304
|
-
className:
|
|
4836
|
+
className: cn("select-none mr-2", s.prompt),
|
|
4305
4837
|
children: "$"
|
|
4306
4838
|
}), line]
|
|
4307
4839
|
}),
|
|
4308
4840
|
i < lines.length - 1 && "\n"
|
|
4309
4841
|
]
|
|
4310
4842
|
}, `L${i}:${line}`)) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [showTerminalPrompt && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4311
|
-
className:
|
|
4843
|
+
className: cn("select-none mr-2", s.prompt),
|
|
4312
4844
|
children: "$"
|
|
4313
4845
|
}), code] }) })
|
|
4314
4846
|
})]
|
|
@@ -4321,7 +4853,7 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
4321
4853
|
//#region src/components/danger-zone/danger-zone.tsx
|
|
4322
4854
|
const DangerZone = ({ title, description, actionLabel, confirmTitle, confirmDescription, onConfirm, className }) => {
|
|
4323
4855
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4324
|
-
className:
|
|
4856
|
+
className: cn("rounded-xl border border-[var(--border-danger)]/30 p-6 shadow-[var(--shadow-card)] bg-card", className),
|
|
4325
4857
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4326
4858
|
className: "flex items-start gap-3",
|
|
4327
4859
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4346,7 +4878,7 @@ const DangerZone = ({ title, description, actionLabel, confirmTitle, confirmDesc
|
|
|
4346
4878
|
className: "mt-4",
|
|
4347
4879
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AlertDialog, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDialogTrigger, {
|
|
4348
4880
|
asChild: true,
|
|
4349
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4881
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
4350
4882
|
variant: "destructive",
|
|
4351
4883
|
children: actionLabel
|
|
4352
4884
|
})
|
|
@@ -4395,12 +4927,12 @@ const DomainList = ({ className, domains, onChange, placeholder = "https://examp
|
|
|
4395
4927
|
}
|
|
4396
4928
|
};
|
|
4397
4929
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4398
|
-
className:
|
|
4930
|
+
className: cn("space-y-3", className),
|
|
4399
4931
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4400
4932
|
className: "flex gap-2",
|
|
4401
4933
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4402
4934
|
className: "flex-1",
|
|
4403
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4935
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
4404
4936
|
value: inputValue,
|
|
4405
4937
|
onChange: (e) => {
|
|
4406
4938
|
setInputValue(e.target.value);
|
|
@@ -4413,7 +4945,7 @@ const DomainList = ({ className, domains, onChange, placeholder = "https://examp
|
|
|
4413
4945
|
className: "text-xs text-[var(--text-danger)] mt-1",
|
|
4414
4946
|
children: error
|
|
4415
4947
|
})]
|
|
4416
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
4948
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button, {
|
|
4417
4949
|
variant: "outline",
|
|
4418
4950
|
size: "default",
|
|
4419
4951
|
onClick: handleAdd,
|
|
@@ -4429,7 +4961,7 @@ const DomainList = ({ className, domains, onChange, placeholder = "https://examp
|
|
|
4429
4961
|
children: domains.map((domain) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
4430
4962
|
className: "flex items-center justify-between gap-2 rounded-md border bg-[var(--bg-bottom)] px-3 py-2 text-sm",
|
|
4431
4963
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4432
|
-
className: "
|
|
4964
|
+
className: "text-sm tabular-nums truncate",
|
|
4433
4965
|
children: domain
|
|
4434
4966
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4435
4967
|
type: "button",
|
|
@@ -4457,7 +4989,7 @@ const InfoBanner = ({ children, dismissible = false, onDismiss, className }) =>
|
|
|
4457
4989
|
const shouldReduceMotion = (0, motion_react.useReducedMotion)();
|
|
4458
4990
|
if (dismissed) return null;
|
|
4459
4991
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4460
|
-
className:
|
|
4992
|
+
className: cn("flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm text-muted-foreground", className),
|
|
4461
4993
|
children: [
|
|
4462
4994
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4463
4995
|
className: "text-muted-foreground shrink-0",
|
|
@@ -4493,7 +5025,7 @@ const buildIdList = (length) => Array.from({ length }, () => crypto.randomUUID()
|
|
|
4493
5025
|
/** Full-page skeleton with header and content area */
|
|
4494
5026
|
const PageSkeleton = ({ className }) => {
|
|
4495
5027
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4496
|
-
className:
|
|
5028
|
+
className: cn("space-y-6 p-6", className),
|
|
4497
5029
|
children: [
|
|
4498
5030
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4499
5031
|
className: "space-y-2",
|
|
@@ -4514,7 +5046,7 @@ const PageSkeleton = ({ className }) => {
|
|
|
4514
5046
|
/** Stat/metric card skeleton */
|
|
4515
5047
|
const StatCardSkeleton = ({ className }) => {
|
|
4516
5048
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4517
|
-
className:
|
|
5049
|
+
className: cn("rounded-xl p-5 shadow-[var(--shadow-card)] bg-card", className),
|
|
4518
5050
|
children: [
|
|
4519
5051
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4520
5052
|
className: "flex items-center justify-between mb-3",
|
|
@@ -4531,13 +5063,13 @@ const TableSkeleton = ({ rows = 5, columns = 4, className }) => {
|
|
|
4531
5063
|
const rowIds = (0, react.useMemo)(() => buildIdList(rows), [rows]);
|
|
4532
5064
|
const colIds = (0, react.useMemo)(() => buildIdList(columns), [columns]);
|
|
4533
5065
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4534
|
-
className:
|
|
5066
|
+
className: cn("rounded-xl border shadow-[var(--shadow-card)] bg-card overflow-hidden", className),
|
|
4535
5067
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4536
5068
|
className: "flex items-center gap-4 px-4 py-3 border-b",
|
|
4537
5069
|
children: headerIds.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { className: "h-4 flex-1" }, id))
|
|
4538
5070
|
}), rowIds.map((rowId) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4539
5071
|
className: "flex items-center gap-4 px-4 py-3 border-b last:border-b-0",
|
|
4540
|
-
children: colIds.map((colId, colIdx) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { className:
|
|
5072
|
+
children: colIds.map((colId, colIdx) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { className: cn("h-4 flex-1", colIdx === 0 && "max-w-32", colIdx === columns - 1 && "max-w-16") }, `${rowId}-${colId}`))
|
|
4541
5073
|
}, rowId))]
|
|
4542
5074
|
});
|
|
4543
5075
|
};
|
|
@@ -4552,11 +5084,11 @@ const trendColor = {
|
|
|
4552
5084
|
const MetricCard = (props) => {
|
|
4553
5085
|
const { label, icon: Icon$2, loading = false, className } = props;
|
|
4554
5086
|
if (loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4555
|
-
className:
|
|
5087
|
+
className: cn("rounded-[16px] bg-card shadow-[var(--shadow-card)] px-5 py-4", className),
|
|
4556
5088
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { className: "h-3.5 w-20 mb-2.5" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { className: "h-7 w-24" })]
|
|
4557
5089
|
});
|
|
4558
5090
|
if (props.inactive) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4559
|
-
className:
|
|
5091
|
+
className: cn("rounded-[16px] bg-card shadow-[var(--shadow-card)] px-5 py-4", className),
|
|
4560
5092
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4561
5093
|
className: "flex items-center gap-1.5",
|
|
4562
5094
|
children: [Icon$2 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon$2, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -4569,7 +5101,7 @@ const MetricCard = (props) => {
|
|
|
4569
5101
|
})]
|
|
4570
5102
|
});
|
|
4571
5103
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4572
|
-
className:
|
|
5104
|
+
className: cn("rounded-[16px] bg-card shadow-[var(--shadow-card)] px-5 py-4", className),
|
|
4573
5105
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4574
5106
|
className: "flex items-center gap-1.5",
|
|
4575
5107
|
children: [Icon$2 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon$2, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -4582,7 +5114,7 @@ const MetricCard = (props) => {
|
|
|
4582
5114
|
className: "text-2xl font-semibold tracking-tight tabular-nums",
|
|
4583
5115
|
children: props.value
|
|
4584
5116
|
}), props.trend && props.trendValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4585
|
-
className:
|
|
5117
|
+
className: cn("text-xs font-medium tabular-nums", trendColor[props.trend]),
|
|
4586
5118
|
children: props.trendValue
|
|
4587
5119
|
})]
|
|
4588
5120
|
})]
|
|
@@ -4608,7 +5140,7 @@ const AskAIAction = ({ docsPath }) => {
|
|
|
4608
5140
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AskAISheet, { docsPath });
|
|
4609
5141
|
};
|
|
4610
5142
|
const WebhooksAction = () => {
|
|
4611
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5143
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
4612
5144
|
variant: "outline",
|
|
4613
5145
|
size: "sm",
|
|
4614
5146
|
asChild: true,
|
|
@@ -4644,7 +5176,7 @@ const WebhooksAction = () => {
|
|
|
4644
5176
|
* @see SettingsSection
|
|
4645
5177
|
*/
|
|
4646
5178
|
const PageHeader = ({ title, description, badge, actions, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4647
|
-
className:
|
|
5179
|
+
className: cn("flex items-start justify-between gap-4", className),
|
|
4648
5180
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [badge ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4649
5181
|
className: "flex flex-wrap items-center gap-2",
|
|
4650
5182
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
@@ -4688,7 +5220,7 @@ const ProductPageLayout = ({ title, tabs, activeTab, onTabChange, children, head
|
|
|
4688
5220
|
whileTap: shouldReduceMotion ? void 0 : { scale: .96 },
|
|
4689
5221
|
transition: spring,
|
|
4690
5222
|
onClick: () => onTabChange(tab.id),
|
|
4691
|
-
className:
|
|
5223
|
+
className: cn("flex items-center rounded-md px-3 py-1.5 text-[13px] font-medium transition-[color,background-color] text-left touch-manipulation", activeTab === tab.id ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/50 hover:text-foreground"),
|
|
4692
5224
|
children: tab.label
|
|
4693
5225
|
}, tab.id))
|
|
4694
5226
|
}),
|
|
@@ -4715,11 +5247,11 @@ const ProductPageLayout = ({ title, tabs, activeTab, onTabChange, children, head
|
|
|
4715
5247
|
//#region src/components/settings-section/settings-section.tsx
|
|
4716
5248
|
const SettingsSection = ({ title, description, children, variant = "default", className }) => {
|
|
4717
5249
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4718
|
-
className:
|
|
5250
|
+
className: cn("rounded-xl border p-6 shadow-[var(--shadow-card)] bg-card", variant === "danger" && "border-[var(--border-danger)]/30", className),
|
|
4719
5251
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4720
5252
|
className: "mb-4",
|
|
4721
5253
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
4722
|
-
className:
|
|
5254
|
+
className: cn("text-sm font-semibold text-balance", variant === "danger" && "text-[var(--text-danger)]"),
|
|
4723
5255
|
children: title
|
|
4724
5256
|
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4725
5257
|
className: "text-sm text-muted-foreground mt-1 text-pretty",
|
|
@@ -4732,47 +5264,6 @@ const SettingsSection = ({ title, description, children, variant = "default", cl
|
|
|
4732
5264
|
});
|
|
4733
5265
|
};
|
|
4734
5266
|
|
|
4735
|
-
//#endregion
|
|
4736
|
-
//#region src/components/status-badge/status-badge.tsx
|
|
4737
|
-
const statusConfig = {
|
|
4738
|
-
active: {
|
|
4739
|
-
label: "Active",
|
|
4740
|
-
variant: "success"
|
|
4741
|
-
},
|
|
4742
|
-
blocked: {
|
|
4743
|
-
label: "Blocked",
|
|
4744
|
-
variant: "danger"
|
|
4745
|
-
},
|
|
4746
|
-
inactive: {
|
|
4747
|
-
label: "Inactive",
|
|
4748
|
-
variant: "inactive"
|
|
4749
|
-
},
|
|
4750
|
-
live: {
|
|
4751
|
-
label: "Live",
|
|
4752
|
-
variant: "success"
|
|
4753
|
-
},
|
|
4754
|
-
pending: {
|
|
4755
|
-
label: "Pending",
|
|
4756
|
-
variant: "warning"
|
|
4757
|
-
},
|
|
4758
|
-
processing: {
|
|
4759
|
-
label: "Processing",
|
|
4760
|
-
variant: "process"
|
|
4761
|
-
},
|
|
4762
|
-
sandbox: {
|
|
4763
|
-
label: "Sandbox",
|
|
4764
|
-
variant: "warning"
|
|
4765
|
-
}
|
|
4766
|
-
};
|
|
4767
|
-
const StatusBadge = ({ status, label, className }) => {
|
|
4768
|
-
const config = statusConfig[status];
|
|
4769
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
|
|
4770
|
-
variant: config.variant,
|
|
4771
|
-
className,
|
|
4772
|
-
children: label || config.label
|
|
4773
|
-
});
|
|
4774
|
-
};
|
|
4775
|
-
|
|
4776
5267
|
//#endregion
|
|
4777
5268
|
//#region src/components/tab-navigation/tab-navigation.tsx
|
|
4778
5269
|
/**
|
|
@@ -4924,19 +5415,19 @@ const renderInput = (input, id) => {
|
|
|
4924
5415
|
name: input.name ?? ""
|
|
4925
5416
|
} });
|
|
4926
5417
|
};
|
|
4927
|
-
if (type === "toggle") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5418
|
+
if (type === "toggle") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Switch, {
|
|
4928
5419
|
id: input.id ?? id,
|
|
4929
5420
|
checked: Boolean(input.checked),
|
|
4930
5421
|
disabled: input.disabled,
|
|
4931
5422
|
onCheckedChange: handleChange,
|
|
4932
|
-
className:
|
|
5423
|
+
className: cn(inputCommon, "mt-0.5")
|
|
4933
5424
|
});
|
|
4934
5425
|
if (type === "checkbox") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Checkbox, {
|
|
4935
5426
|
id: input.id ?? id,
|
|
4936
5427
|
checked: Boolean(input.checked),
|
|
4937
5428
|
disabled: input.disabled,
|
|
4938
5429
|
onCheckedChange: (state) => handleChange(state === true),
|
|
4939
|
-
className:
|
|
5430
|
+
className: cn(inputCommon, "mt-1")
|
|
4940
5431
|
});
|
|
4941
5432
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroup, {
|
|
4942
5433
|
value: input.checked ? input.id ?? id : "",
|
|
@@ -4950,6 +5441,16 @@ const renderInput = (input, id) => {
|
|
|
4950
5441
|
})
|
|
4951
5442
|
});
|
|
4952
5443
|
};
|
|
5444
|
+
/**
|
|
5445
|
+
* DEPRECATED. Never use in new code. Use `FlushCardStack` with a `ToggleRow`
|
|
5446
|
+
* header instead; put sub-options in the item's reveal.
|
|
5447
|
+
*
|
|
5448
|
+
* Kept so existing callers keep rendering while they migrate.
|
|
5449
|
+
*
|
|
5450
|
+
* @deprecated Use `FlushCardStack` + `ToggleRow`.
|
|
5451
|
+
* @see FlushCardStack
|
|
5452
|
+
* @see ToggleRow
|
|
5453
|
+
*/
|
|
4953
5454
|
const ToggleCard = ({ accordionKey, title, description, inputProps, allowExpand = true, defaultExpanded, value, onValueChange, collapsible = true, Tags, RightSideTags, notification, actionLink, customActionIcon, onCardClick: _onCardClick, children, disabled, triggerTestId, className, triggerClassName }) => {
|
|
4954
5455
|
const generatedId = (0, react.useId)();
|
|
4955
5456
|
const inputId = inputProps?.id ?? generatedId;
|
|
@@ -4978,14 +5479,14 @@ const ToggleCard = ({ accordionKey, title, description, inputProps, allowExpand
|
|
|
4978
5479
|
value,
|
|
4979
5480
|
onValueChange,
|
|
4980
5481
|
"data-slot": "toggle-card",
|
|
4981
|
-
className:
|
|
5482
|
+
className: cn("rounded-xl bg-card shadow-card overflow-hidden", disabled && "opacity-60", className),
|
|
4982
5483
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_accordion.Item, {
|
|
4983
5484
|
value: accordionKey,
|
|
4984
5485
|
className: "border-0",
|
|
4985
5486
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Header, {
|
|
4986
5487
|
className: "m-0",
|
|
4987
5488
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4988
|
-
className:
|
|
5489
|
+
className: cn("group flex items-start gap-3 px-5 py-4", isParentMode && "bg-bg-bottom", triggerClassName),
|
|
4989
5490
|
children: [
|
|
4990
5491
|
renderInput(inputProps, inputId),
|
|
4991
5492
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -4995,7 +5496,7 @@ const ToggleCard = ({ accordionKey, title, description, inputProps, allowExpand
|
|
|
4995
5496
|
className: "flex items-baseline gap-1.5 flex-wrap leading-5",
|
|
4996
5497
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4997
5498
|
htmlFor: inputId,
|
|
4998
|
-
className:
|
|
5499
|
+
className: cn("text-sm font-medium select-none leading-5", disabled && "text-muted-foreground"),
|
|
4999
5500
|
children: [title, notification && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5000
5501
|
"aria-hidden": true,
|
|
5001
5502
|
className: "inline-block ml-1.5 size-1.5 rounded-full bg-destructive align-middle"
|
|
@@ -5025,7 +5526,7 @@ const ToggleCard = ({ accordionKey, title, description, inputProps, allowExpand
|
|
|
5025
5526
|
children: RightSideTags.map((t) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t.Tag }, t.id))
|
|
5026
5527
|
}), allowExpand && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_accordion.Trigger, {
|
|
5027
5528
|
"data-testid": triggerTestId,
|
|
5028
|
-
className:
|
|
5529
|
+
className: cn("shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-[transform,background-color] duration-150 hover:bg-overlay-hover [&[data-state=open]>svg]:rotate-180", customActionIcon?.className),
|
|
5029
5530
|
disabled: !allowExpand,
|
|
5030
5531
|
children: customActionIcon ? customActionIcon.Icon : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
5031
5532
|
className: "size-4",
|
|
@@ -5047,6 +5548,96 @@ const ToggleCard = ({ accordionKey, title, description, inputProps, allowExpand
|
|
|
5047
5548
|
});
|
|
5048
5549
|
};
|
|
5049
5550
|
|
|
5551
|
+
//#endregion
|
|
5552
|
+
//#region src/components/toggle-row/toggle-row.tsx
|
|
5553
|
+
/**
|
|
5554
|
+
* A single on/off setting: switch on the left, then label, description and
|
|
5555
|
+
* optional `Badge`. It has no surface of its own.
|
|
5556
|
+
*
|
|
5557
|
+
* Use it as the `header` of a `FlushCardStack.Item`, or on its own inside a
|
|
5558
|
+
* `Card`. Never put a `Well` under it directly; sub-options go in the
|
|
5559
|
+
* `FlushCardStack.Item` reveal.
|
|
5560
|
+
*
|
|
5561
|
+
* @see FlushCardStack
|
|
5562
|
+
* @see Switch
|
|
5563
|
+
*/
|
|
5564
|
+
const ToggleRow = (props) => {
|
|
5565
|
+
const { label, description, checked, onCheckedChange, disabled = false, switchPosition = "left", icon, badge, onSettings, children, className } = props;
|
|
5566
|
+
const switchId = (0, react.useId)();
|
|
5567
|
+
const descId = (0, react.useId)();
|
|
5568
|
+
const cursorClass = disabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
5569
|
+
if (switchPosition === "left") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5570
|
+
className,
|
|
5571
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5572
|
+
className: cn("flex items-start gap-2.5 touch-manipulation group/toggle"),
|
|
5573
|
+
children: [
|
|
5574
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Switch, {
|
|
5575
|
+
id: switchId,
|
|
5576
|
+
"aria-describedby": description ? descId : void 0,
|
|
5577
|
+
checked,
|
|
5578
|
+
onCheckedChange,
|
|
5579
|
+
disabled,
|
|
5580
|
+
className: "mt-0.5"
|
|
5581
|
+
}),
|
|
5582
|
+
icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5583
|
+
htmlFor: switchId,
|
|
5584
|
+
className: cn("text-muted-foreground shrink-0 self-start", cursorClass),
|
|
5585
|
+
children: icon
|
|
5586
|
+
}),
|
|
5587
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5588
|
+
className: "flex-1 min-w-0",
|
|
5589
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5590
|
+
className: "flex items-center gap-2",
|
|
5591
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5592
|
+
htmlFor: switchId,
|
|
5593
|
+
className: cn("font-medium select-none", disabled && "text-muted-foreground", cursorClass),
|
|
5594
|
+
children: label
|
|
5595
|
+
}), badge]
|
|
5596
|
+
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5597
|
+
id: descId,
|
|
5598
|
+
className: "text-sm text-muted-foreground mt-1 text-pretty",
|
|
5599
|
+
children: description
|
|
5600
|
+
})]
|
|
5601
|
+
})
|
|
5602
|
+
]
|
|
5603
|
+
}), children]
|
|
5604
|
+
});
|
|
5605
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5606
|
+
className: cn("space-y-3", className),
|
|
5607
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5608
|
+
className: "flex items-center justify-between gap-4",
|
|
5609
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5610
|
+
htmlFor: switchId,
|
|
5611
|
+
className: cn("text-sm font-medium select-none", cursorClass),
|
|
5612
|
+
children: label
|
|
5613
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5614
|
+
className: "flex items-center gap-2 shrink-0",
|
|
5615
|
+
children: [onSettings && checked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
5616
|
+
variant: "ghost",
|
|
5617
|
+
size: "icon-xs",
|
|
5618
|
+
onClick: onSettings,
|
|
5619
|
+
className: "text-muted-foreground hover:text-foreground",
|
|
5620
|
+
"aria-label": "Configure",
|
|
5621
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hugeicons_react.HugeiconsIcon, {
|
|
5622
|
+
icon: _hugeicons_core_free_icons.Setting07Icon,
|
|
5623
|
+
size: 14
|
|
5624
|
+
})
|
|
5625
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Switch, {
|
|
5626
|
+
id: switchId,
|
|
5627
|
+
"aria-describedby": description ? descId : void 0,
|
|
5628
|
+
checked,
|
|
5629
|
+
onCheckedChange,
|
|
5630
|
+
disabled
|
|
5631
|
+
})]
|
|
5632
|
+
})]
|
|
5633
|
+
}), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5634
|
+
id: descId,
|
|
5635
|
+
className: "text-sm text-muted-foreground mt-0.5 text-pretty",
|
|
5636
|
+
children: description
|
|
5637
|
+
})] }), checked && children && children]
|
|
5638
|
+
});
|
|
5639
|
+
};
|
|
5640
|
+
|
|
5050
5641
|
//#endregion
|
|
5051
5642
|
//#region src/components/icons/animated-icon/animated-icon.tsx
|
|
5052
5643
|
const AnimatedIcon = (0, react.forwardRef)(({ children, className, onMouseEnter, onMouseLeave, size = 28, ...props }, ref) => {
|
|
@@ -5069,7 +5660,7 @@ const AnimatedIcon = (0, react.forwardRef)(({ children, className, onMouseEnter,
|
|
|
5069
5660
|
}, [controls, onMouseLeave]);
|
|
5070
5661
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5071
5662
|
"aria-hidden": "true",
|
|
5072
|
-
className:
|
|
5663
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
5073
5664
|
onMouseEnter: handleMouseEnter,
|
|
5074
5665
|
onMouseLeave: handleMouseLeave,
|
|
5075
5666
|
...props,
|
|
@@ -5214,7 +5805,7 @@ const ChartBarIncreasingIcon = (0, react.forwardRef)(({ onMouseEnter, onMouseLea
|
|
|
5214
5805
|
}, [controls, onMouseLeave]);
|
|
5215
5806
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5216
5807
|
"aria-hidden": "true",
|
|
5217
|
-
className:
|
|
5808
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
5218
5809
|
onMouseEnter: handleMouseEnter,
|
|
5219
5810
|
onMouseLeave: handleMouseLeave,
|
|
5220
5811
|
...props,
|
|
@@ -5439,7 +6030,7 @@ const CopyCheckIcon = (0, react.forwardRef)(({ onMouseEnter, onMouseLeave, class
|
|
|
5439
6030
|
]);
|
|
5440
6031
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5441
6032
|
"aria-hidden": "true",
|
|
5442
|
-
className:
|
|
6033
|
+
className: cn("relative inline-flex items-center justify-center", className),
|
|
5443
6034
|
onMouseEnter: handleMouseEnter,
|
|
5444
6035
|
onMouseLeave: handleMouseLeave,
|
|
5445
6036
|
...props,
|
|
@@ -6668,7 +7259,7 @@ exports.BreadcrumbLink = BreadcrumbLink;
|
|
|
6668
7259
|
exports.BreadcrumbList = BreadcrumbList;
|
|
6669
7260
|
exports.BreadcrumbPage = BreadcrumbPage;
|
|
6670
7261
|
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
|
6671
|
-
exports.Button =
|
|
7262
|
+
exports.Button = Button;
|
|
6672
7263
|
exports.Card = Card;
|
|
6673
7264
|
exports.CardContent = CardContent;
|
|
6674
7265
|
exports.CardDescription = CardDescription;
|
|
@@ -6745,10 +7336,10 @@ exports.HomeIcon = HomeIcon;
|
|
|
6745
7336
|
exports.Icon = Icon;
|
|
6746
7337
|
exports.IconConfigProvider = IconConfigProvider;
|
|
6747
7338
|
exports.InfoBanner = InfoBanner;
|
|
6748
|
-
exports.Input =
|
|
7339
|
+
exports.Input = Input;
|
|
6749
7340
|
exports.Kbd = Kbd;
|
|
6750
7341
|
exports.KeyIcon = KeyIcon;
|
|
6751
|
-
exports.Label =
|
|
7342
|
+
exports.Label = Label;
|
|
6752
7343
|
exports.LayoutPanelTopIcon = LayoutPanelTopIcon;
|
|
6753
7344
|
exports.LinkIcon = LinkIcon;
|
|
6754
7345
|
exports.MetricCard = MetricCard;
|
|
@@ -6807,12 +7398,11 @@ exports.SheetTrigger = SheetTrigger;
|
|
|
6807
7398
|
exports.ShieldCheckIcon = ShieldCheckIcon;
|
|
6808
7399
|
exports.Skeleton = Skeleton;
|
|
6809
7400
|
exports.Slider = Slider;
|
|
6810
|
-
exports.Spinner =
|
|
7401
|
+
exports.Spinner = Spinner;
|
|
6811
7402
|
exports.StatCardSkeleton = StatCardSkeleton;
|
|
6812
|
-
exports.StatusBadge = StatusBadge;
|
|
6813
7403
|
exports.Stepper = Stepper;
|
|
6814
7404
|
exports.SunIcon = SunIcon;
|
|
6815
|
-
exports.Switch =
|
|
7405
|
+
exports.Switch = Switch;
|
|
6816
7406
|
exports.TabNavigation = TabNavigation;
|
|
6817
7407
|
exports.Table = Table;
|
|
6818
7408
|
exports.TableBody = TableBody;
|
|
@@ -6833,7 +7423,7 @@ exports.Toaster = Toaster;
|
|
|
6833
7423
|
exports.ToggleCard = ToggleCard;
|
|
6834
7424
|
exports.ToggleGroup = ToggleGroup;
|
|
6835
7425
|
exports.ToggleGroupItem = ToggleGroupItem;
|
|
6836
|
-
exports.ToggleRow =
|
|
7426
|
+
exports.ToggleRow = ToggleRow;
|
|
6837
7427
|
exports.Tooltip = Tooltip;
|
|
6838
7428
|
exports.TooltipContent = TooltipContent;
|
|
6839
7429
|
exports.TooltipProvider = TooltipProvider;
|
|
@@ -6845,10 +7435,9 @@ exports.WebhooksAction = WebhooksAction;
|
|
|
6845
7435
|
exports.Well = Well;
|
|
6846
7436
|
exports.WellReveal = WellReveal;
|
|
6847
7437
|
exports.WindsurfLogo = WindsurfLogo;
|
|
6848
|
-
exports.__toESM = __toESM;
|
|
6849
7438
|
exports.badgeVariants = badgeVariants;
|
|
6850
|
-
exports.buttonVariants =
|
|
6851
|
-
exports.cn =
|
|
7439
|
+
exports.buttonVariants = buttonVariants;
|
|
7440
|
+
exports.cn = cn;
|
|
6852
7441
|
exports.createColumnHelper = createColumnHelper;
|
|
6853
7442
|
exports.selectionColumn = selectionColumn;
|
|
6854
7443
|
Object.defineProperty(exports, 'toast', {
|
|
@@ -6860,5 +7449,4 @@ Object.defineProperty(exports, 'toast', {
|
|
|
6860
7449
|
exports.useDataTable = useDataTable;
|
|
6861
7450
|
exports.useIconConfig = useIconConfig;
|
|
6862
7451
|
exports.useUnsavedChanges = useUnsavedChanges;
|
|
6863
|
-
exports.wellVariants = wellVariants;
|
|
6864
7452
|
//# sourceMappingURL=index.cjs.map
|