@mikebrucker/brucks 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +278 -2
- package/dist/blucks/components/homeCard.d.ts +27 -0
- package/dist/blucks/components/homeCard.js +53 -0
- package/dist/blucks/components/homeCard.js.map +1 -0
- package/dist/blucks/components/loader.css +169 -0
- package/dist/blucks/components/loader.d.ts +16 -0
- package/dist/blucks/components/loader.js +28 -0
- package/dist/blucks/components/loader.js.map +1 -0
- package/dist/blucks/components/scrollToTopFab.css +9 -0
- package/dist/blucks/components/scrollToTopFab.d.ts +17 -0
- package/dist/blucks/components/scrollToTopFab.js +188 -0
- package/dist/blucks/components/scrollToTopFab.js.map +1 -0
- package/dist/blucks/components/settingsPickerModal.d.ts +11 -0
- package/dist/blucks/components/settingsPickerModal.js +49 -0
- package/dist/blucks/components/settingsPickerModal.js.map +1 -0
- package/dist/blucks/components/settingsRow.d.ts +12 -0
- package/dist/blucks/components/settingsRow.js +34 -0
- package/dist/blucks/components/settingsRow.js.map +1 -0
- package/dist/blucks/components/settingsSection.d.ts +8 -0
- package/dist/blucks/components/settingsSection.js +19 -0
- package/dist/blucks/components/settingsSection.js.map +1 -0
- package/dist/blucks/components/settingsSwatchButton.d.ts +10 -0
- package/dist/blucks/components/settingsSwatchButton.js +38 -0
- package/dist/blucks/components/settingsSwatchButton.js.map +1 -0
- package/dist/blucks/hooks/useDisclosure.d.ts +5 -0
- package/dist/blucks/hooks/useDisclosure.js +34 -0
- package/dist/blucks/hooks/useDisclosure.js.map +1 -0
- package/dist/blucks/hooks/useScrollAncestor.d.ts +3 -0
- package/dist/blucks/hooks/useScrollAncestor.js +40 -0
- package/dist/blucks/hooks/useScrollAncestor.js.map +1 -0
- package/dist/blucks/index.d.ts +13 -0
- package/dist/blucks/index.js +14 -0
- package/dist/blucks/layout/appLayout.d.ts +16 -0
- package/dist/blucks/layout/appLayout.js +93 -0
- package/dist/blucks/layout/appLayout.js.map +1 -0
- package/dist/blucks/layout/footer.d.ts +7 -0
- package/dist/blucks/layout/footer.js +18 -0
- package/dist/blucks/layout/footer.js.map +1 -0
- package/dist/blucks/layout/header.d.ts +22 -0
- package/dist/blucks/layout/header.js +121 -0
- package/dist/blucks/layout/header.js.map +1 -0
- package/dist/blucks/lib/utils.d.ts +6 -0
- package/dist/blucks/lib/utils.js +12 -0
- package/dist/blucks/lib/utils.js.map +1 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.js +5 -0
- package/dist/style/settings.d.ts +105 -0
- package/dist/style/settings.js +156 -0
- package/dist/style/settings.js.map +1 -0
- package/dist/style/styles.d.ts +6 -0
- package/dist/style/styles.js +10 -0
- package/dist/style/styles.js.map +1 -0
- package/dist/style/theme.css +1259 -0
- package/dist/style/types.d.ts +6 -0
- package/dist/style/types.js +9 -0
- package/dist/style/types.js.map +1 -0
- package/dist/style/utils.d.ts +2 -0
- package/dist/style/utils.js +28 -0
- package/dist/style/utils.js.map +1 -0
- package/dist/ui/components/accordion.d.ts +81 -0
- package/dist/ui/components/accordion.js +449 -0
- package/dist/ui/components/accordion.js.map +1 -0
- package/dist/ui/components/alertDialog.d.ts +17 -0
- package/dist/ui/components/alertDialog.js +134 -0
- package/dist/ui/components/alertDialog.js.map +1 -0
- package/dist/ui/components/button.d.ts +10 -0
- package/dist/ui/components/button.js +51 -0
- package/dist/ui/components/button.js.map +1 -0
- package/dist/ui/components/checkbox.d.ts +3 -0
- package/dist/ui/components/checkbox.js +56 -0
- package/dist/ui/components/checkbox.js.map +1 -0
- package/dist/ui/components/chip.d.ts +13 -0
- package/dist/ui/components/chip.js +26 -0
- package/dist/ui/components/chip.js.map +1 -0
- package/dist/ui/components/collapsible.d.ts +22 -0
- package/dist/ui/components/collapsible.js +197 -0
- package/dist/ui/components/collapsible.js.map +1 -0
- package/dist/ui/components/drawer.d.ts +13 -0
- package/dist/ui/components/drawer.js +81 -0
- package/dist/ui/components/drawer.js.map +1 -0
- package/dist/ui/components/fab.d.ts +12 -0
- package/dist/ui/components/fab.js +51 -0
- package/dist/ui/components/fab.js.map +1 -0
- package/dist/ui/components/form.d.ts +7 -0
- package/dist/ui/components/form.js +107 -0
- package/dist/ui/components/form.js.map +1 -0
- package/dist/ui/components/icon.d.ts +9 -0
- package/dist/ui/components/icon.js +28 -0
- package/dist/ui/components/icon.js.map +1 -0
- package/dist/ui/components/input.d.ts +12 -0
- package/dist/ui/components/input.js +44 -0
- package/dist/ui/components/input.js.map +1 -0
- package/dist/ui/components/modal.d.ts +19 -0
- package/dist/ui/components/modal.js +144 -0
- package/dist/ui/components/modal.js.map +1 -0
- package/dist/ui/components/note.d.ts +6 -0
- package/dist/ui/components/note.js +12 -0
- package/dist/ui/components/note.js.map +1 -0
- package/dist/ui/components/popover.d.ts +15 -0
- package/dist/ui/components/popover.js +110 -0
- package/dist/ui/components/popover.js.map +1 -0
- package/dist/ui/components/progress.d.ts +11 -0
- package/dist/ui/components/progress.js +87 -0
- package/dist/ui/components/progress.js.map +1 -0
- package/dist/ui/components/radioGroup.d.ts +4 -0
- package/dist/ui/components/radioGroup.js +82 -0
- package/dist/ui/components/radioGroup.js.map +1 -0
- package/dist/ui/components/scrollArea.d.ts +29 -0
- package/dist/ui/components/scrollArea.js +185 -0
- package/dist/ui/components/scrollArea.js.map +1 -0
- package/dist/ui/components/select.d.ts +23 -0
- package/dist/ui/components/select.js +198 -0
- package/dist/ui/components/select.js.map +1 -0
- package/dist/ui/components/separator.d.ts +4 -0
- package/dist/ui/components/separator.js +48 -0
- package/dist/ui/components/separator.js.map +1 -0
- package/dist/ui/components/slider.d.ts +26 -0
- package/dist/ui/components/slider.js +228 -0
- package/dist/ui/components/slider.js.map +1 -0
- package/dist/ui/components/sortableList.d.ts +13 -0
- package/dist/ui/components/sortableList.js +116 -0
- package/dist/ui/components/sortableList.js.map +1 -0
- package/dist/ui/components/sortableListRow.d.ts +8 -0
- package/dist/ui/components/sortableListRow.js +79 -0
- package/dist/ui/components/sortableListRow.js.map +1 -0
- package/dist/ui/components/switch.d.ts +3 -0
- package/dist/ui/components/switch.js +47 -0
- package/dist/ui/components/switch.js.map +1 -0
- package/dist/ui/components/tabs.d.ts +7 -0
- package/dist/ui/components/tabs.js +106 -0
- package/dist/ui/components/tabs.js.map +1 -0
- package/dist/ui/components/textarea.d.ts +8 -0
- package/dist/ui/components/textarea.js +40 -0
- package/dist/ui/components/textarea.js.map +1 -0
- package/dist/ui/components/toast.d.ts +13 -0
- package/dist/ui/components/toast.js +136 -0
- package/dist/ui/components/toast.js.map +1 -0
- package/dist/ui/components/toggle-group.d.ts +11 -0
- package/dist/ui/components/toggle-group.js +158 -0
- package/dist/ui/components/toggle-group.js.map +1 -0
- package/dist/ui/components/toggle.d.ts +12 -0
- package/dist/ui/components/toggle.js +48 -0
- package/dist/ui/components/toggle.js.map +1 -0
- package/dist/ui/components/tooltip.d.ts +8 -0
- package/dist/ui/components/tooltip.js +59 -0
- package/dist/ui/components/tooltip.js.map +1 -0
- package/dist/ui/hooks/useCloseOnBack.d.ts +7 -0
- package/dist/ui/hooks/useCloseOnBack.js +46 -0
- package/dist/ui/hooks/useCloseOnBack.js.map +1 -0
- package/dist/ui/hooks/useReturnFocus.d.ts +9 -0
- package/dist/ui/hooks/useReturnFocus.js +30 -0
- package/dist/ui/hooks/useReturnFocus.js.map +1 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.js +33 -0
- package/dist/ui/lib/defaultLabels.d.ts +31 -0
- package/dist/ui/lib/defaultLabels.js +16 -0
- package/dist/ui/lib/defaultLabels.js.map +1 -0
- package/dist/ui/lib/labels.d.ts +10 -0
- package/dist/ui/lib/labels.js +37 -0
- package/dist/ui/lib/labels.js.map +1 -0
- package/package.json +80 -4
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { useCloseOnBack } from "../hooks/useCloseOnBack.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { Select } from "radix-ui";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { ChevronDown, Tick01Icon } from "@hugeicons/core-free-icons";
|
|
10
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
11
|
+
// src/ui/components/select.tsx
|
|
12
|
+
var variantColors = {
|
|
13
|
+
default: "bg-card text-card-foreground",
|
|
14
|
+
outline: "border border-border bg-input/30 text-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
16
|
+
ghost: "text-foreground",
|
|
17
|
+
keyboard: "bg-transparent shadow-none"
|
|
18
|
+
};
|
|
19
|
+
var contentColors = {
|
|
20
|
+
default: "bg-popover text-popover-foreground hc:border hc:border-border",
|
|
21
|
+
outline: "border border-border bg-popover text-popover-foreground",
|
|
22
|
+
secondary: "bg-secondary text-secondary-foreground hc:border hc:border-border",
|
|
23
|
+
ghost: "bg-popover text-popover-foreground hc:border hc:border-border",
|
|
24
|
+
keyboard: "bg-transparent shadow-none"
|
|
25
|
+
};
|
|
26
|
+
var itemStyles = {
|
|
27
|
+
keyboard: "rounded-[10px] [border-style:outset] border-(--keycap-edge,rgb(240,240,203)) [border-width:6px_8px_8px_6px] bg-(--keycap-face,beige) px-3 py-2 text-xs font-medium text-(--keycap-text,#3a382c) shadow-[0_4px_8px_2px_rgba(0,0,0,0.4)] transition-[box-shadow,transform,border-width] duration-100 ease-out data-highlighted:translate-y-0.5 data-highlighted:brightness-95 data-highlighted:[border-style:inset] data-highlighted:[border-width:6px_6px_4px_6px] data-highlighted:shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.3),0_1px_2px_1px_rgba(0,0,0,0.4)]",
|
|
28
|
+
plain: "px-3 h-9 text-sm font-medium not-data-highlighted:even:bg-black/5 dark:not-data-highlighted:even:bg-white/5 data-highlighted:bg-theme-300"
|
|
29
|
+
};
|
|
30
|
+
var selectVariants = cva("inline-flex min-w-40 shrink-0 items-center justify-between rounded-secondary text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 cursor-pointer", {
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
default: `${variantColors.default} hover:bg-card/80 hc:border hc:border-border`,
|
|
34
|
+
outline: `${variantColors.outline} hover:bg-input/50`,
|
|
35
|
+
secondary: `${variantColors.secondary} hover:bg-secondary/80 hc:border hc:border-border`,
|
|
36
|
+
ghost: `${variantColors.ghost} hover:bg-muted dark:hover:bg-muted/50`,
|
|
37
|
+
keyboard: "min-h-[44px] rounded-[10px] [border-style:outset] border-[var(--keycap-edge)] [border-width:8px_10px_10px_8px] bg-[var(--keycap-face)] text-xs text-[var(--keycap-text)] shadow-[0_5px_10px_2px_rgba(0,0,0,0.45)] transition-[box-shadow,transform,border-width] duration-100 ease-out active:translate-y-[3px] active:brightness-95 active:[border-style:inset] active:[border-width:8px_8px_5px_8px] active:shadow-[inset_0_2px_5px_0_rgba(0,0,0,0.3),0_1px_3px_1px_rgba(0,0,0,0.45)] data-[state=open]:translate-y-[3px] data-[state=open]:brightness-95 data-[state=open]:[border-style:inset] data-[state=open]:[border-width:8px_8px_5px_8px] data-[state=open]:shadow-[inset_0_2px_5px_0_rgba(0,0,0,0.3),0_1px_3px_1px_rgba(0,0,0,0.45)]"
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
default: "h-9 gap-1.5 px-3",
|
|
41
|
+
xs: "h-6 gap-1 px-2.5 text-xs",
|
|
42
|
+
sm: "h-8 gap-1 px-3",
|
|
43
|
+
lg: "h-10 gap-1.5 px-4"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
variant: "default",
|
|
48
|
+
size: "default"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
function Select$1(t0) {
|
|
52
|
+
const $ = c(39);
|
|
53
|
+
const { className, contentClassName, variant: t1, size: t2, options, value, defaultValue, onValueChange, disabled, placeholder, id } = t0;
|
|
54
|
+
const variant = t1 === void 0 ? "default" : t1;
|
|
55
|
+
const size = t2 === void 0 ? "default" : t2;
|
|
56
|
+
const isKeyboard = variant === "keyboard";
|
|
57
|
+
const [open, setOpen] = useState(false);
|
|
58
|
+
let t3;
|
|
59
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t3 = () => setOpen(false);
|
|
61
|
+
$[0] = t3;
|
|
62
|
+
} else t3 = $[0];
|
|
63
|
+
useCloseOnBack(open, t3);
|
|
64
|
+
let t4;
|
|
65
|
+
if ($[1] !== className || $[2] !== size || $[3] !== variant) {
|
|
66
|
+
t4 = cn(selectVariants({
|
|
67
|
+
variant,
|
|
68
|
+
size,
|
|
69
|
+
className
|
|
70
|
+
}));
|
|
71
|
+
$[1] = className;
|
|
72
|
+
$[2] = size;
|
|
73
|
+
$[3] = variant;
|
|
74
|
+
$[4] = t4;
|
|
75
|
+
} else t4 = $[4];
|
|
76
|
+
let t5;
|
|
77
|
+
if ($[5] !== placeholder) {
|
|
78
|
+
t5 = /* @__PURE__ */ jsx(Select.Value, { placeholder });
|
|
79
|
+
$[5] = placeholder;
|
|
80
|
+
$[6] = t5;
|
|
81
|
+
} else t5 = $[6];
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
84
|
+
t6 = /* @__PURE__ */ jsx(Select.Icon, { children: /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
85
|
+
icon: ChevronDown,
|
|
86
|
+
className: "size-6 shrink-0",
|
|
87
|
+
"aria-hidden": "true"
|
|
88
|
+
}) });
|
|
89
|
+
$[7] = t6;
|
|
90
|
+
} else t6 = $[7];
|
|
91
|
+
let t7;
|
|
92
|
+
if ($[8] !== id || $[9] !== size || $[10] !== t4 || $[11] !== t5 || $[12] !== variant) {
|
|
93
|
+
t7 = /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
94
|
+
id,
|
|
95
|
+
"data-slot": "select",
|
|
96
|
+
"data-variant": variant,
|
|
97
|
+
"data-size": size,
|
|
98
|
+
className: t4,
|
|
99
|
+
children: [t5, t6]
|
|
100
|
+
});
|
|
101
|
+
$[8] = id;
|
|
102
|
+
$[9] = size;
|
|
103
|
+
$[10] = t4;
|
|
104
|
+
$[11] = t5;
|
|
105
|
+
$[12] = variant;
|
|
106
|
+
$[13] = t7;
|
|
107
|
+
} else t7 = $[13];
|
|
108
|
+
const t8 = isKeyboard ? "overflow-y-auto p-1" : "overflow-hidden";
|
|
109
|
+
const t9 = contentColors[variant ?? "default"];
|
|
110
|
+
let t10;
|
|
111
|
+
if ($[14] !== contentClassName || $[15] !== t8 || $[16] !== t9) {
|
|
112
|
+
t10 = cn("relative z-popover min-w-(--radix-select-trigger-width) max-h-(--radix-select-content-available-height) rounded-secondary shadow-md", t8, t9, contentClassName);
|
|
113
|
+
$[14] = contentClassName;
|
|
114
|
+
$[15] = t8;
|
|
115
|
+
$[16] = t9;
|
|
116
|
+
$[17] = t10;
|
|
117
|
+
} else t10 = $[17];
|
|
118
|
+
const t11 = isKeyboard ? "flex flex-col gap-2" : "overflow-y-auto";
|
|
119
|
+
let t12;
|
|
120
|
+
if ($[18] !== t11) {
|
|
121
|
+
t12 = cn("max-h-full", t11);
|
|
122
|
+
$[18] = t11;
|
|
123
|
+
$[19] = t12;
|
|
124
|
+
} else t12 = $[19];
|
|
125
|
+
let t13;
|
|
126
|
+
if ($[20] !== isKeyboard || $[21] !== options) {
|
|
127
|
+
let t14;
|
|
128
|
+
if ($[23] !== isKeyboard) {
|
|
129
|
+
t14 = (option) => /* @__PURE__ */ jsxs(Select.Item, {
|
|
130
|
+
value: option.value,
|
|
131
|
+
className: cn("flex w-full cursor-pointer items-center justify-between gap-1.5 outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50 hc:data-disabled:opacity-75 hc:data-highlighted:bg-foreground hc:data-highlighted:text-background", itemStyles[isKeyboard ? "keyboard" : "plain"]),
|
|
132
|
+
children: [/* @__PURE__ */ jsx(Select.ItemText, { children: /* @__PURE__ */ jsxs("span", {
|
|
133
|
+
className: "flex items-center gap-2",
|
|
134
|
+
children: [option.icon, option.label]
|
|
135
|
+
}) }), /* @__PURE__ */ jsx("span", {
|
|
136
|
+
className: "size-4 shrink-0 flex items-center justify-center",
|
|
137
|
+
children: /* @__PURE__ */ jsx(Select.ItemIndicator, { children: /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
138
|
+
icon: Tick01Icon,
|
|
139
|
+
className: "size-6",
|
|
140
|
+
"aria-hidden": "true"
|
|
141
|
+
}) })
|
|
142
|
+
})]
|
|
143
|
+
}, option.value);
|
|
144
|
+
$[23] = isKeyboard;
|
|
145
|
+
$[24] = t14;
|
|
146
|
+
} else t14 = $[24];
|
|
147
|
+
t13 = options.map(t14);
|
|
148
|
+
$[20] = isKeyboard;
|
|
149
|
+
$[21] = options;
|
|
150
|
+
$[22] = t13;
|
|
151
|
+
} else t13 = $[22];
|
|
152
|
+
let t14;
|
|
153
|
+
if ($[25] !== t12 || $[26] !== t13) {
|
|
154
|
+
t14 = /* @__PURE__ */ jsx(Select.Viewport, {
|
|
155
|
+
className: t12,
|
|
156
|
+
children: t13
|
|
157
|
+
});
|
|
158
|
+
$[25] = t12;
|
|
159
|
+
$[26] = t13;
|
|
160
|
+
$[27] = t14;
|
|
161
|
+
} else t14 = $[27];
|
|
162
|
+
let t15;
|
|
163
|
+
if ($[28] !== t10 || $[29] !== t14) {
|
|
164
|
+
t15 = /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Content, {
|
|
165
|
+
position: "popper",
|
|
166
|
+
sideOffset: 4,
|
|
167
|
+
className: t10,
|
|
168
|
+
children: t14
|
|
169
|
+
}) });
|
|
170
|
+
$[28] = t10;
|
|
171
|
+
$[29] = t14;
|
|
172
|
+
$[30] = t15;
|
|
173
|
+
} else t15 = $[30];
|
|
174
|
+
let t16;
|
|
175
|
+
if ($[31] !== defaultValue || $[32] !== disabled || $[33] !== onValueChange || $[34] !== open || $[35] !== t15 || $[36] !== t7 || $[37] !== value) {
|
|
176
|
+
t16 = /* @__PURE__ */ jsxs(Select.Root, {
|
|
177
|
+
open,
|
|
178
|
+
onOpenChange: setOpen,
|
|
179
|
+
value,
|
|
180
|
+
defaultValue,
|
|
181
|
+
onValueChange,
|
|
182
|
+
disabled,
|
|
183
|
+
children: [t7, t15]
|
|
184
|
+
});
|
|
185
|
+
$[31] = defaultValue;
|
|
186
|
+
$[32] = disabled;
|
|
187
|
+
$[33] = onValueChange;
|
|
188
|
+
$[34] = open;
|
|
189
|
+
$[35] = t15;
|
|
190
|
+
$[36] = t7;
|
|
191
|
+
$[37] = value;
|
|
192
|
+
$[38] = t16;
|
|
193
|
+
} else t16 = $[38];
|
|
194
|
+
return t16;
|
|
195
|
+
}
|
|
196
|
+
export { Select$1 as Select };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":["c","_c","ChevronDown","Tick01Icon","HugeiconsIcon","cva","VariantProps","Select","SelectPrimitive","React","useState","cn","useCloseOnBack","variantColors","default","outline","secondary","ghost","keyboard","const","contentColors","itemStyles","plain","selectVariants","variants","variant","size","xs","sm","lg","defaultVariants","Option","value","label","icon","ReactNode","t0","$","className","contentClassName","t1","t2","options","defaultValue","onValueChange","disabled","placeholder","id","undefined","isKeyboard","open","setOpen","t3","Symbol","for","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","t14","option","map","t15","t16","Select","_c","SelectPrimitive"],"sources":["../../../src/ui/components/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { ChevronDown, Tick01Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Select as SelectPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { useState } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { useCloseOnBack } from \"~/ui/hooks/useCloseOnBack\";\n\nconst variantColors = {\n default: \"bg-card text-card-foreground\",\n outline: \"border border-border bg-input/30 text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n ghost: \"text-foreground\",\n keyboard: \"bg-transparent shadow-none\",\n} as const;\n\nconst contentColors = {\n default: \"bg-popover text-popover-foreground hc:border hc:border-border\",\n outline: \"border border-border bg-popover text-popover-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hc:border hc:border-border\",\n ghost: \"bg-popover text-popover-foreground hc:border hc:border-border\",\n keyboard: \"bg-transparent shadow-none\",\n} as const;\n\nconst itemStyles = {\n keyboard:\n \"rounded-[10px] [border-style:outset] border-(--keycap-edge,rgb(240,240,203)) [border-width:6px_8px_8px_6px] bg-(--keycap-face,beige) px-3 py-2 text-xs font-medium text-(--keycap-text,#3a382c) shadow-[0_4px_8px_2px_rgba(0,0,0,0.4)] transition-[box-shadow,transform,border-width] duration-100 ease-out data-highlighted:translate-y-0.5 data-highlighted:brightness-95 data-highlighted:[border-style:inset] data-highlighted:[border-width:6px_6px_4px_6px] data-highlighted:shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.3),0_1px_2px_1px_rgba(0,0,0,0.4)]\",\n plain:\n \"px-3 h-9 text-sm font-medium not-data-highlighted:even:bg-black/5 dark:not-data-highlighted:even:bg-white/5 data-highlighted:bg-theme-300\",\n} as const;\n\nconst selectVariants = cva(\n \"inline-flex min-w-40 shrink-0 items-center justify-between rounded-secondary text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 cursor-pointer\",\n {\n variants: {\n variant: {\n default: `${variantColors.default} hover:bg-card/80 hc:border hc:border-border`,\n outline: `${variantColors.outline} hover:bg-input/50`,\n secondary: `${variantColors.secondary} hover:bg-secondary/80 hc:border hc:border-border`,\n ghost: `${variantColors.ghost} hover:bg-muted dark:hover:bg-muted/50`,\n keyboard:\n \"min-h-[44px] rounded-[10px] [border-style:outset] border-[var(--keycap-edge)] [border-width:8px_10px_10px_8px] bg-[var(--keycap-face)] text-xs text-[var(--keycap-text)] shadow-[0_5px_10px_2px_rgba(0,0,0,0.45)] transition-[box-shadow,transform,border-width] duration-100 ease-out active:translate-y-[3px] active:brightness-95 active:[border-style:inset] active:[border-width:8px_8px_5px_8px] active:shadow-[inset_0_2px_5px_0_rgba(0,0,0,0.3),0_1px_3px_1px_rgba(0,0,0,0.45)] data-[state=open]:translate-y-[3px] data-[state=open]:brightness-95 data-[state=open]:[border-style:inset] data-[state=open]:[border-width:8px_8px_5px_8px] data-[state=open]:shadow-[inset_0_2px_5px_0_rgba(0,0,0,0.3),0_1px_3px_1px_rgba(0,0,0,0.45)]\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3\",\n xs: \"h-6 gap-1 px-2.5 text-xs\",\n sm: \"h-8 gap-1 px-3\",\n lg: \"h-10 gap-1.5 px-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype Option = { value: string; label: string; icon?: React.ReactNode };\n\nfunction Select({\n className,\n contentClassName,\n variant = \"default\",\n size = \"default\",\n options,\n value,\n defaultValue,\n onValueChange,\n disabled,\n placeholder,\n id,\n}: VariantProps<typeof selectVariants> & {\n options: Array<Option>;\n className?: string;\n contentClassName?: string;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n disabled?: boolean;\n placeholder?: string;\n id?: string;\n}) {\n const isKeyboard = variant === \"keyboard\";\n // Held here rather than left to Radix, so the back button closes the list before what is under it.\n const [open, setOpen] = useState(false);\n useCloseOnBack(open, () => setOpen(false));\n return (\n <SelectPrimitive.Root\n open={open}\n onOpenChange={setOpen}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n disabled={disabled}\n >\n <SelectPrimitive.Trigger\n id={id}\n data-slot=\"select\"\n data-variant={variant}\n data-size={size}\n className={cn(selectVariants({ variant, size, className }))}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon>\n <HugeiconsIcon icon={ChevronDown} className=\"size-6 shrink-0\" aria-hidden=\"true\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n position=\"popper\"\n sideOffset={4}\n className={cn(\n \"relative z-popover min-w-(--radix-select-trigger-width) max-h-(--radix-select-content-available-height) rounded-secondary shadow-md\",\n isKeyboard ? \"overflow-y-auto p-1\" : \"overflow-hidden\",\n contentColors[variant ?? \"default\"],\n contentClassName,\n )}\n >\n <SelectPrimitive.Viewport\n className={cn(\"max-h-full\", isKeyboard ? \"flex flex-col gap-2\" : \"overflow-y-auto\")}\n >\n {options.map((option) => (\n <SelectPrimitive.Item\n key={option.value}\n value={option.value}\n className={cn(\n \"flex w-full cursor-pointer items-center justify-between gap-1.5 outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-50 hc:data-disabled:opacity-75 hc:data-highlighted:bg-foreground hc:data-highlighted:text-background\",\n itemStyles[isKeyboard ? \"keyboard\" : \"plain\"],\n )}\n >\n <SelectPrimitive.ItemText>\n <span className=\"flex items-center gap-2\">\n {option.icon}\n {option.label}\n </span>\n </SelectPrimitive.ItemText>\n <span className=\"size-4 shrink-0 flex items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <HugeiconsIcon icon={Tick01Icon} className=\"size-6\" aria-hidden=\"true\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n );\n}\n\nexport { Select };\n"],"mappings":";;;;;;;;;;;AAWA,I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EAAA3B,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,IAAA+B;CAAA,IAAA/B,EAAA,QAAAwB,OAAAxB,EAAA,QAAA4B,KAAA;EApC/BG,MAAA,oBAAAI,OAAA,QAAA,EAAA,UACE,oBAAAA,OAAA,SAAA;GACW,UAAA;GACG,YAAA;GACD,WAAAX;GAOXI,UAAAA;EA0BF,CAAA,EACF,CAAA;EAAyB5B,EAAA,MAAAwB;EAAAxB,EAAA,MAAA4B;EAAA5B,EAAA,MAAA+B;CAAA,OAAAA,MAAA/B,EAAA;CAAA,IAAAgC;CAAA,IAAAhC,EAAA,QAAAM,gBAAAN,EAAA,QAAAQ,YAAAR,EAAA,QAAAO,iBAAAP,EAAA,QAAAa,QAAAb,EAAA,QAAA+B,OAAA/B,EAAA,QAAAqB,MAAArB,EAAA,QAAAL,OAAA;EA1D3BqC,MAAA,qBAAAG,OAAA,MAAA;GACQtB;GACQC,cAAAA;GACPnB;GACOW;GACCC;GACLC;GANZ,UAAA,CAQEa,IAYAU,GAuCF;;EAAuB/B,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAO;EAAAP,EAAA,MAAAa;EAAAb,EAAA,MAAA+B;EAAA/B,EAAA,MAAAqB;EAAArB,EAAA,MAAAL;EAAAK,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,OA3DvBgC;AA2DuB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
declare function Separator({ className, orientation, ...props }: ComponentProps<typeof SeparatorPrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Separator } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/components/separator.tsx
|
|
7
|
+
function Separator$1(t0) {
|
|
8
|
+
const $ = c(10);
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({className, orientation: t1, ...props} = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = t1;
|
|
18
|
+
} else {
|
|
19
|
+
className = $[1];
|
|
20
|
+
props = $[2];
|
|
21
|
+
t1 = $[3];
|
|
22
|
+
}
|
|
23
|
+
const orientation = t1 === void 0 ? "horizontal" : t1;
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[4] !== className) {
|
|
26
|
+
t2 = cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className);
|
|
27
|
+
$[4] = className;
|
|
28
|
+
$[5] = t2;
|
|
29
|
+
} else t2 = $[5];
|
|
30
|
+
let t3;
|
|
31
|
+
if ($[6] !== orientation || $[7] !== props || $[8] !== t2) {
|
|
32
|
+
t3 = /* @__PURE__ */ jsx(Separator.Root, {
|
|
33
|
+
"data-slot": "separator",
|
|
34
|
+
decorative: true,
|
|
35
|
+
orientation,
|
|
36
|
+
className: t2,
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
$[6] = orientation;
|
|
40
|
+
$[7] = props;
|
|
41
|
+
$[8] = t2;
|
|
42
|
+
$[9] = t3;
|
|
43
|
+
} else t3 = $[9];
|
|
44
|
+
return t3;
|
|
45
|
+
}
|
|
46
|
+
export { Separator$1 as Separator };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":["c","_c","Separator","SeparatorPrimitive","ComponentProps","cn","t0","$","className","props","t1","orientation","undefined","t2","t3","Separator","_c","SeparatorPrimitive"],"sources":["../../../src/ui/components/separator.tsx"],"sourcesContent":["\"use client\";\n\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"~/style/utils\";\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":";;;;;;AAMA,SAAAE,YAAAI,IAAA;CAAA,MAAAC,IAAAN,EAAA,EAAA;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAE,WAAAG,aAAAD,IAAA,GAAAD,SAAAH;EAI8BC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,YAAAD,EAAA;EAAAE,QAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAF/C,MAAAI,cAAAD,OAAAE,KAAAA,IAAA,eAAAF;CAA0B,IAAAG;CAAA,IAAAN,EAAA,OAAAC,WAAA;EAQXK,KAAAR,GACT,kKACAG,SACF;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAI,eAAAJ,EAAA,OAAAE,SAAAF,EAAA,OAAAM,IAAA;EAPHC,KAAA,oBAAAG,UAAA,MAAA;GACY,aAAA;GACV,YAAA;GACaN;GACF,WAAAE;GAGV,GACGJ;EAAK,CAAA;EACTF,EAAA,KAAAI;EAAAJ,EAAA,KAAAE;EAAAF,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OATFO;AASE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type SliderValue = [number] | [number, number];
|
|
2
|
+
/** Evenly spaced numeric range, or an explicit ascending list of the only values the thumbs may take. */
|
|
3
|
+
type SliderScale = {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
steps?: never;
|
|
8
|
+
showSteps?: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
min?: never;
|
|
11
|
+
max?: never;
|
|
12
|
+
step?: never;
|
|
13
|
+
steps: Array<number>;
|
|
14
|
+
/** Draw a tick on the track at every entry in `steps`. */
|
|
15
|
+
showSteps?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type SliderProps = SliderScale & {
|
|
18
|
+
value: SliderValue;
|
|
19
|
+
onValueChange: (value: SliderValue) => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
thumbLabels?: Array<string>;
|
|
24
|
+
};
|
|
25
|
+
declare function Slider({ value, onValueChange, min, max, step, steps, showSteps, disabled, className, label, thumbLabels, }: SliderProps): import("react").JSX.Element;
|
|
26
|
+
export { Slider };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Slider } from "radix-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/components/slider.tsx
|
|
7
|
+
/** Index of the entry in `steps` closest to `value`, so an out-of-scale value still lands on a real stop. */
|
|
8
|
+
function nearestIndex(steps, value) {
|
|
9
|
+
let nearest = 0;
|
|
10
|
+
for (let i = 1; i < steps.length; i++) if (Math.abs(steps[i] - value) < Math.abs(steps[nearest] - value)) nearest = i;
|
|
11
|
+
return nearest;
|
|
12
|
+
}
|
|
13
|
+
function Slider$1(t0) {
|
|
14
|
+
const $ = c(70);
|
|
15
|
+
const { value, onValueChange, min: t1, max: t2, step: t3, steps, showSteps, disabled, className, label, thumbLabels } = t0;
|
|
16
|
+
const min = t1 === void 0 ? 0 : t1;
|
|
17
|
+
const max = t2 === void 0 ? 100 : t2;
|
|
18
|
+
const step = t3 === void 0 ? 1 : t3;
|
|
19
|
+
const scale = steps !== void 0 && steps.length > 0 ? steps : void 0;
|
|
20
|
+
let t4;
|
|
21
|
+
if ($[0] !== scale) {
|
|
22
|
+
t4 = (v) => scale ? nearestIndex(scale, v) : v;
|
|
23
|
+
$[0] = scale;
|
|
24
|
+
$[1] = t4;
|
|
25
|
+
} else t4 = $[1];
|
|
26
|
+
const toTrack = t4;
|
|
27
|
+
let t5;
|
|
28
|
+
if ($[2] !== scale) {
|
|
29
|
+
t5 = (v_0) => scale ? scale[v_0] : v_0;
|
|
30
|
+
$[2] = scale;
|
|
31
|
+
$[3] = t5;
|
|
32
|
+
} else t5 = $[3];
|
|
33
|
+
const fromTrack = t5;
|
|
34
|
+
let t6;
|
|
35
|
+
if ($[4] !== toTrack || $[5] !== value[0] || $[6] !== value[1] || $[7] !== value.length) {
|
|
36
|
+
t6 = value.length === 1 ? [toTrack(value[0])] : [toTrack(value[0]), toTrack(value[1])];
|
|
37
|
+
$[4] = toTrack;
|
|
38
|
+
$[5] = value[0];
|
|
39
|
+
$[6] = value[1];
|
|
40
|
+
$[7] = value.length;
|
|
41
|
+
$[8] = t6;
|
|
42
|
+
} else t6 = $[8];
|
|
43
|
+
const trackValue = t6;
|
|
44
|
+
let T0;
|
|
45
|
+
let T1;
|
|
46
|
+
let t10;
|
|
47
|
+
let t11;
|
|
48
|
+
let t12;
|
|
49
|
+
let t13;
|
|
50
|
+
let t14;
|
|
51
|
+
let t15;
|
|
52
|
+
let t16;
|
|
53
|
+
let t17;
|
|
54
|
+
let t7;
|
|
55
|
+
let t8;
|
|
56
|
+
let t9;
|
|
57
|
+
if ($[9] !== className || $[10] !== disabled || $[11] !== fromTrack || $[12] !== max || $[13] !== min || $[14] !== onValueChange || $[15] !== scale || $[16] !== showSteps || $[17] !== step || $[18] !== trackValue || $[19] !== value.length) {
|
|
58
|
+
let t18;
|
|
59
|
+
bb0: {
|
|
60
|
+
if (!showSteps) {
|
|
61
|
+
t18 = [];
|
|
62
|
+
break bb0;
|
|
63
|
+
}
|
|
64
|
+
if (scale) {
|
|
65
|
+
let t19;
|
|
66
|
+
if ($[33] !== scale.length) {
|
|
67
|
+
t19 = (_, i) => scale.length > 1 ? i / (scale.length - 1) * 100 : 50;
|
|
68
|
+
$[33] = scale.length;
|
|
69
|
+
$[34] = t19;
|
|
70
|
+
} else t19 = $[34];
|
|
71
|
+
t18 = scale.map(t19);
|
|
72
|
+
break bb0;
|
|
73
|
+
}
|
|
74
|
+
const span = max - min;
|
|
75
|
+
if (span <= 0) {
|
|
76
|
+
t18 = [50];
|
|
77
|
+
break bb0;
|
|
78
|
+
}
|
|
79
|
+
const count = Math.floor(span / step);
|
|
80
|
+
let t19;
|
|
81
|
+
if ($[35] !== span || $[36] !== step) {
|
|
82
|
+
t19 = (__0, i_0) => Math.min(i_0 * step, span) / span * 100;
|
|
83
|
+
$[35] = span;
|
|
84
|
+
$[36] = step;
|
|
85
|
+
$[37] = t19;
|
|
86
|
+
} else t19 = $[37];
|
|
87
|
+
t18 = Array.from({ length: count + 1 }, t19);
|
|
88
|
+
}
|
|
89
|
+
const tickPositions = t18;
|
|
90
|
+
const tickOffset = _temp;
|
|
91
|
+
T1 = Slider.Root;
|
|
92
|
+
t10 = trackValue;
|
|
93
|
+
if ($[38] !== fromTrack || $[39] !== onValueChange || $[40] !== value.length) {
|
|
94
|
+
t11 = (next) => onValueChange(value.length === 1 ? [fromTrack(next[0])] : [fromTrack(next[0]), fromTrack(next[1])]);
|
|
95
|
+
$[38] = fromTrack;
|
|
96
|
+
$[39] = onValueChange;
|
|
97
|
+
$[40] = value.length;
|
|
98
|
+
$[41] = t11;
|
|
99
|
+
} else t11 = $[41];
|
|
100
|
+
t12 = scale ? 0 : min;
|
|
101
|
+
t13 = scale ? scale.length - 1 : max;
|
|
102
|
+
t14 = scale ? 1 : step;
|
|
103
|
+
t15 = disabled;
|
|
104
|
+
t16 = 1;
|
|
105
|
+
if ($[42] !== className) {
|
|
106
|
+
t17 = cn("relative flex w-full touch-none items-center select-none h-5 cursor-pointer data-disabled:cursor-not-allowed", className);
|
|
107
|
+
$[42] = className;
|
|
108
|
+
$[43] = t17;
|
|
109
|
+
} else t17 = $[43];
|
|
110
|
+
T0 = Slider.Track;
|
|
111
|
+
t7 = "relative h-1.5 w-full grow rounded-full bg-muted";
|
|
112
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
113
|
+
t8 = /* @__PURE__ */ jsx(Slider.Range, { className: "absolute h-full rounded-full bg-linear-to-r from-theme-300 to-theme-700 hc:bg-none hc:bg-theme-500" });
|
|
114
|
+
$[44] = t8;
|
|
115
|
+
} else t8 = $[44];
|
|
116
|
+
let t19;
|
|
117
|
+
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
+
t19 = (left) => /* @__PURE__ */ jsx("span", {
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
className: "absolute top-1/2 h-3 w-0.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-border",
|
|
121
|
+
style: { left: `calc(${left}% + ${tickOffset(left)}px)` }
|
|
122
|
+
}, left);
|
|
123
|
+
$[45] = t19;
|
|
124
|
+
} else t19 = $[45];
|
|
125
|
+
t9 = tickPositions.map(t19);
|
|
126
|
+
$[9] = className;
|
|
127
|
+
$[10] = disabled;
|
|
128
|
+
$[11] = fromTrack;
|
|
129
|
+
$[12] = max;
|
|
130
|
+
$[13] = min;
|
|
131
|
+
$[14] = onValueChange;
|
|
132
|
+
$[15] = scale;
|
|
133
|
+
$[16] = showSteps;
|
|
134
|
+
$[17] = step;
|
|
135
|
+
$[18] = trackValue;
|
|
136
|
+
$[19] = value.length;
|
|
137
|
+
$[20] = T0;
|
|
138
|
+
$[21] = T1;
|
|
139
|
+
$[22] = t10;
|
|
140
|
+
$[23] = t11;
|
|
141
|
+
$[24] = t12;
|
|
142
|
+
$[25] = t13;
|
|
143
|
+
$[26] = t14;
|
|
144
|
+
$[27] = t15;
|
|
145
|
+
$[28] = t16;
|
|
146
|
+
$[29] = t17;
|
|
147
|
+
$[30] = t7;
|
|
148
|
+
$[31] = t8;
|
|
149
|
+
$[32] = t9;
|
|
150
|
+
} else {
|
|
151
|
+
T0 = $[20];
|
|
152
|
+
T1 = $[21];
|
|
153
|
+
t10 = $[22];
|
|
154
|
+
t11 = $[23];
|
|
155
|
+
t12 = $[24];
|
|
156
|
+
t13 = $[25];
|
|
157
|
+
t14 = $[26];
|
|
158
|
+
t15 = $[27];
|
|
159
|
+
t16 = $[28];
|
|
160
|
+
t17 = $[29];
|
|
161
|
+
t7 = $[30];
|
|
162
|
+
t8 = $[31];
|
|
163
|
+
t9 = $[32];
|
|
164
|
+
}
|
|
165
|
+
let t18;
|
|
166
|
+
if ($[46] !== T0 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9) {
|
|
167
|
+
t18 = /* @__PURE__ */ jsxs(T0, {
|
|
168
|
+
className: t7,
|
|
169
|
+
children: [t8, t9]
|
|
170
|
+
});
|
|
171
|
+
$[46] = T0;
|
|
172
|
+
$[47] = t7;
|
|
173
|
+
$[48] = t8;
|
|
174
|
+
$[49] = t9;
|
|
175
|
+
$[50] = t18;
|
|
176
|
+
} else t18 = $[50];
|
|
177
|
+
let t19;
|
|
178
|
+
if ($[51] !== label || $[52] !== thumbLabels || $[53] !== value) {
|
|
179
|
+
let t20;
|
|
180
|
+
if ($[55] !== label || $[56] !== thumbLabels) {
|
|
181
|
+
t20 = (__1, i_1) => /* @__PURE__ */ jsx(Slider.Thumb, {
|
|
182
|
+
"aria-label": thumbLabels?.[i_1] ?? label,
|
|
183
|
+
className: cn("block size-4 shrink-0 rounded-full border-2 border-background hc:border-foreground shadow transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 data-disabled:pointer-events-none data-disabled:opacity-50 hc:data-disabled:opacity-75", i_1 === 0 ? "bg-theme-300" : "bg-theme-700")
|
|
184
|
+
}, i_1);
|
|
185
|
+
$[55] = label;
|
|
186
|
+
$[56] = thumbLabels;
|
|
187
|
+
$[57] = t20;
|
|
188
|
+
} else t20 = $[57];
|
|
189
|
+
t19 = value.map(t20);
|
|
190
|
+
$[51] = label;
|
|
191
|
+
$[52] = thumbLabels;
|
|
192
|
+
$[53] = value;
|
|
193
|
+
$[54] = t19;
|
|
194
|
+
} else t19 = $[54];
|
|
195
|
+
let t20;
|
|
196
|
+
if ($[58] !== T1 || $[59] !== t10 || $[60] !== t11 || $[61] !== t12 || $[62] !== t13 || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t17 || $[67] !== t18 || $[68] !== t19) {
|
|
197
|
+
t20 = /* @__PURE__ */ jsxs(T1, {
|
|
198
|
+
value: t10,
|
|
199
|
+
onValueChange: t11,
|
|
200
|
+
min: t12,
|
|
201
|
+
max: t13,
|
|
202
|
+
step: t14,
|
|
203
|
+
disabled: t15,
|
|
204
|
+
minStepsBetweenThumbs: t16,
|
|
205
|
+
className: t17,
|
|
206
|
+
children: [t18, t19]
|
|
207
|
+
});
|
|
208
|
+
$[58] = T1;
|
|
209
|
+
$[59] = t10;
|
|
210
|
+
$[60] = t11;
|
|
211
|
+
$[61] = t12;
|
|
212
|
+
$[62] = t13;
|
|
213
|
+
$[63] = t14;
|
|
214
|
+
$[64] = t15;
|
|
215
|
+
$[65] = t16;
|
|
216
|
+
$[66] = t17;
|
|
217
|
+
$[67] = t18;
|
|
218
|
+
$[68] = t19;
|
|
219
|
+
$[69] = t20;
|
|
220
|
+
} else t20 = $[69];
|
|
221
|
+
return t20;
|
|
222
|
+
}
|
|
223
|
+
function _temp(percent) {
|
|
224
|
+
return 8 - percent / 100 * 16;
|
|
225
|
+
}
|
|
226
|
+
export { Slider$1 as Slider };
|
|
227
|
+
|
|
228
|
+
//# sourceMappingURL=slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.js","names":["c","_c","Slider","SliderPrimitive","cn","SliderValue","SliderScale","min","max","step","steps","showSteps","Array","SliderProps","value","onValueChange","disabled","className","label","thumbLabels","nearestIndex","nearest","i","length","Math","abs","t0","$","t1","t2","t3","undefined","scale","t4","v","toTrack","t5","v_0","fromTrack","t6","trackValue","T0","T1","t10","t11","t12","t13","t14","t15","t16","t17","t7","t8","t9","t18","bb0","t19","_","map","span","count","floor","__0","i_0","from","tickPositions","tickOffset","_temp","Root","next","Track","Symbol","for","left","t20","__1","i_1","percent","Slider","_c","SliderPrimitive"],"sources":["../../../src/ui/components/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\ntype SliderValue = [number] | [number, number];\n\n/** Evenly spaced numeric range, or an explicit ascending list of the only values the thumbs may take. */\ntype SliderScale =\n | {\n min: number;\n max: number;\n step?: number;\n steps?: never; // X\n showSteps?: boolean;\n }\n | {\n min?: never; // X\n max?: never; // X\n step?: never; // X\n steps: Array<number>;\n /** Draw a tick on the track at every entry in `steps`. */\n showSteps?: boolean;\n };\n\ntype SliderProps = SliderScale & {\n value: SliderValue;\n onValueChange: (value: SliderValue) => void;\n disabled?: boolean;\n className?: string;\n label?: string;\n thumbLabels?: Array<string>;\n};\n\n/** Index of the entry in `steps` closest to `value`, so an out-of-scale value still lands on a real stop. */\nfunction nearestIndex(steps: Array<number>, value: number) {\n let nearest = 0;\n for (let i = 1; i < steps.length; i++) {\n if (Math.abs(steps[i] - value) < Math.abs(steps[nearest] - value)) nearest = i;\n }\n return nearest;\n}\n\nfunction Slider({\n value,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n steps,\n showSteps,\n disabled,\n className,\n label,\n thumbLabels,\n}: SliderProps) {\n // With an explicit scale the track runs over indices, so uneven gaps between values render evenly.\n const scale = steps !== undefined && steps.length > 0 ? steps : undefined;\n const toTrack = (v: number) => (scale ? nearestIndex(scale, v) : v);\n const fromTrack = (v: number) => (scale ? scale[v] : v);\n const trackValue: SliderValue =\n value.length === 1 ? [toTrack(value[0])] : [toTrack(value[0]), toTrack(value[1])];\n\n // One percentage per selectable stop; empty unless showSteps, so the ticks just don't render.\n const tickPositions = (() => {\n if (!showSteps) return [];\n if (scale) return scale.map((_, i) => (scale.length > 1 ? (i / (scale.length - 1)) * 100 : 50));\n const span = max - min;\n if (span <= 0) return [50];\n const count = Math.floor(span / step);\n return Array.from({ length: count + 1 }, (_, i) => (Math.min(i * step, span) / span) * 100);\n })();\n\n /**\n * Radix nudges each thumb inward so it never overhangs the track: half a thumb right at 0%,\n * nothing at 50%, half a thumb left at 100%. Ticks copy it or they drift off the thumb at the ends.\n */\n const thumbSize = 16;\n const tickOffset = (percent: number) => thumbSize / 2 - (percent / 100) * thumbSize;\n\n return (\n <SliderPrimitive.Root\n value={trackValue}\n onValueChange={(next) =>\n onValueChange(\n value.length === 1 ? [fromTrack(next[0])] : [fromTrack(next[0]), fromTrack(next[1])],\n )\n }\n min={scale ? 0 : min}\n max={scale ? scale.length - 1 : max}\n step={scale ? 1 : step}\n disabled={disabled}\n minStepsBetweenThumbs={1}\n className={cn(\n \"relative flex w-full touch-none items-center select-none h-5 cursor-pointer data-disabled:cursor-not-allowed\",\n className,\n )}\n >\n <SliderPrimitive.Track className=\"relative h-1.5 w-full grow rounded-full bg-muted\">\n <SliderPrimitive.Range className=\"absolute h-full rounded-full bg-linear-to-r from-theme-300 to-theme-700 hc:bg-none hc:bg-theme-500\" />\n {tickPositions.map((left) => (\n <span\n key={left}\n aria-hidden=\"true\"\n className=\"absolute top-1/2 h-3 w-0.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-border\"\n style={{ left: `calc(${left}% + ${tickOffset(left)}px)` }}\n />\n ))}\n </SliderPrimitive.Track>\n {value.map((_, i) => (\n <SliderPrimitive.Thumb\n // biome-ignore lint/suspicious/noArrayIndexKey: thumb count is fixed by the value tuple length (1 or 2), order never changes\n key={i}\n aria-label={thumbLabels?.[i] ?? label}\n className={cn(\n \"block size-4 shrink-0 rounded-full border-2 border-background hc:border-foreground shadow transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 data-disabled:pointer-events-none data-disabled:opacity-50 hc:data-disabled:opacity-75\",\n i === 0 ? \"bg-theme-300\" : \"bg-theme-700\",\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n}\n\nexport { Slider };\n"],"mappings":";;;;;;;AAmCA,SAASoB,aAAaV,OAAsBI,OAAe;CACzD,IAAIO,UAAU;CACd,KAAK,IAAIC,IAAI,GAAGA,IAAIZ,MAAMa,QAAQD,KAChC,IAAIE,KAAKC,IAAIf,MAAMY,KAAKR,KAAK,IAAIU,KAAKC,IAAIf,MAAMW,WAAWP,KAAK,GAAGO,UAAUC;CAE/E,OAAOD;AACT;AAEA,SAAAnB,SAAAwB,IAAA;CAAA,MAAAC,IAAA1B,EAAA,EAAA;CAAgB,MAAA,EAAAa,OAAAC,eAAAR,KAAAqB,IAAApB,KAAAqB,IAAApB,MAAAqB,IAAApB,OAAAC,WAAAK,UAAAC,WAAAC,OAAAC,gBAAAO;CAGd,MAAAnB,MAAAqB,OAAAG,KAAAA,IAAA,IAAAH;CACA,MAAApB,MAAAqB,OAAAE,KAAAA,IAAA,MAAAF;CACA,MAAApB,OAAAqB,OAAAC,KAAAA,IAAA,IAAAD;CASA,MAAAE,QAActB,UAAUqB,KAAAA,KAAarB,MAAKa,SAAU,IAAtCb,QAAAqB,KAAAA;CAA4D,IAAAE;CAAA,IAAAN,EAAA,OAAAK,OAAA;EAC1DC,MAAAC,MAAgBF,QAAQZ,aAAaY,OAAOE,CAAK,IAAjCA;EAAmCP,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN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,IAAA+C;CAAA,IAAA/C,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,OAAAhB,EAAA,QAAAiB,OAAAjB,EAAA,QAAAkB,OAAAlB,EAAA,QAAAmB,OAAAnB,EAAA,QAAAoB,OAAApB,EAAA,QAAAqB,OAAArB,EAAA,QAAAsB,OAAAtB,EAAA,QAAAuB,OAAAvB,EAAA,QAAA2B,OAAA3B,EAAA,QAAA6B,KAAA;EAtCJkB,MAAA,qBAAC,IAAD;GACSlC,OAAAA;GACQ,eAAAI;GAKV,KAAAC;GACA,KAAAC;GACC,MAAAC;GACI/B,UAAAA;GACa,uBAAAiC;GACZ,WAAAC;GAZb,UAAA,CAiBEI,KAWCE,GA5BkB;;EAuCE7B,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;EAAAvB,EAAA,MAAA2B;EAAA3B,EAAA,MAAA6B;EAAA7B,EAAA,MAAA+C;CAAA,OAAAA,MAAA/C,EAAA;CAAA,OAvCvB+C;AAuCuB;AA7E3B,SAAAP,MAAAU,SAAA;CAAA,OAmC0C,IAAiBA,UAAU,MADjD;AACiE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type SortableItem = {
|
|
3
|
+
id: string | number;
|
|
4
|
+
};
|
|
5
|
+
type SortableListProps<T extends SortableItem> = {
|
|
6
|
+
items: Array<T>;
|
|
7
|
+
onChange: (items: Array<T>) => void;
|
|
8
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
itemLabel?: (item: T) => string;
|
|
11
|
+
};
|
|
12
|
+
export declare function SortableList<T extends SortableItem>({ items, onChange, renderItem, className, itemLabel, }: SortableListProps<T>): import("react").JSX.Element;
|
|
13
|
+
export {};
|