@mikebrucker/brucks 0.0.0-stage → 0.1.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/LICENSE +22 -0
- package/README.md +274 -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/scrollToTopFab.d.ts +16 -0
- package/dist/blucks/components/scrollToTopFab.js +187 -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 +12 -0
- package/dist/blucks/index.js +13 -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 +1449 -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/loader.d.ts +15 -0
- package/dist/ui/components/loader.js +27 -0
- package/dist/ui/components/loader.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 +33 -0
- package/dist/ui/index.js +34 -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 +79 -4
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { useCloseOnBack } from "../hooks/useCloseOnBack.js";
|
|
5
|
+
import { useReturnFocus } from "../hooks/useReturnFocus.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { AlertDialog } from "radix-ui";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
// src/ui/components/alertDialog.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A question that has to be answered before going on: unlike `Modal`, a click beside
|
|
12
|
+
* it does not dismiss it, and focus starts on cancel rather than on the action.
|
|
13
|
+
*/
|
|
14
|
+
function AlertDialog$1(t0) {
|
|
15
|
+
const $ = c(26);
|
|
16
|
+
const { open, onClose, onAction, title, text, actionLabel, cancelLabel, className } = t0;
|
|
17
|
+
useCloseOnBack(open, onClose);
|
|
18
|
+
const returnFocus = useReturnFocus();
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== onClose) {
|
|
21
|
+
t1 = (next) => !next ? onClose() : void 0;
|
|
22
|
+
$[0] = onClose;
|
|
23
|
+
$[1] = t1;
|
|
24
|
+
} else t1 = $[1];
|
|
25
|
+
let t2;
|
|
26
|
+
if ($[2] !== className) {
|
|
27
|
+
t2 = cn("mx-4 flex w-full max-w-md flex-col gap-4 rounded-primary border border-border bg-background p-4 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 motion-reduce:animate-none", className);
|
|
28
|
+
$[2] = className;
|
|
29
|
+
$[3] = t2;
|
|
30
|
+
} else t2 = $[3];
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[4] !== title) {
|
|
33
|
+
t3 = /* @__PURE__ */ jsx(AlertDialog.Title, {
|
|
34
|
+
className: "text-lg font-semibold text-foreground",
|
|
35
|
+
children: title
|
|
36
|
+
});
|
|
37
|
+
$[4] = title;
|
|
38
|
+
$[5] = t3;
|
|
39
|
+
} else t3 = $[5];
|
|
40
|
+
let t4;
|
|
41
|
+
if ($[6] !== text) {
|
|
42
|
+
t4 = /* @__PURE__ */ jsx(AlertDialog.Description, {
|
|
43
|
+
className: "text-sm text-muted-foreground",
|
|
44
|
+
children: text
|
|
45
|
+
});
|
|
46
|
+
$[6] = text;
|
|
47
|
+
$[7] = t4;
|
|
48
|
+
} else t4 = $[7];
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[8] !== cancelLabel) {
|
|
51
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "flex-1 xs:flex-none",
|
|
53
|
+
children: /* @__PURE__ */ jsx(AlertDialog.Cancel, {
|
|
54
|
+
asChild: true,
|
|
55
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
56
|
+
className: "min-w-30 w-full xs:w-auto",
|
|
57
|
+
type: "button",
|
|
58
|
+
variant: "outline",
|
|
59
|
+
size: "lg",
|
|
60
|
+
children: cancelLabel
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
$[8] = cancelLabel;
|
|
65
|
+
$[9] = t5;
|
|
66
|
+
} else t5 = $[9];
|
|
67
|
+
let t6;
|
|
68
|
+
if ($[10] !== actionLabel || $[11] !== onAction) {
|
|
69
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
70
|
+
className: "flex-1 xs:flex-none",
|
|
71
|
+
children: /* @__PURE__ */ jsx(AlertDialog.Action, {
|
|
72
|
+
asChild: true,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
74
|
+
className: "min-w-30 w-full xs:w-auto",
|
|
75
|
+
type: "button",
|
|
76
|
+
variant: "destructive",
|
|
77
|
+
size: "lg",
|
|
78
|
+
onClick: onAction,
|
|
79
|
+
children: actionLabel
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
$[10] = actionLabel;
|
|
84
|
+
$[11] = onAction;
|
|
85
|
+
$[12] = t6;
|
|
86
|
+
} else t6 = $[12];
|
|
87
|
+
let t7;
|
|
88
|
+
if ($[13] !== t5 || $[14] !== t6) {
|
|
89
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: "flex justify-end gap-2",
|
|
91
|
+
children: [t5, t6]
|
|
92
|
+
});
|
|
93
|
+
$[13] = t5;
|
|
94
|
+
$[14] = t6;
|
|
95
|
+
$[15] = t7;
|
|
96
|
+
} else t7 = $[15];
|
|
97
|
+
let t8;
|
|
98
|
+
if ($[16] !== returnFocus || $[17] !== t2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t7) {
|
|
99
|
+
t8 = /* @__PURE__ */ jsx(AlertDialog.Portal, { children: /* @__PURE__ */ jsx(AlertDialog.Overlay, {
|
|
100
|
+
className: "fixed inset-0 z-dialog flex items-center justify-center bg-black/75 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out motion-reduce:animate-none",
|
|
101
|
+
children: /* @__PURE__ */ jsxs(AlertDialog.Content, {
|
|
102
|
+
...returnFocus,
|
|
103
|
+
className: t2,
|
|
104
|
+
children: [
|
|
105
|
+
t3,
|
|
106
|
+
t4,
|
|
107
|
+
t7
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
}) });
|
|
111
|
+
$[16] = returnFocus;
|
|
112
|
+
$[17] = t2;
|
|
113
|
+
$[18] = t3;
|
|
114
|
+
$[19] = t4;
|
|
115
|
+
$[20] = t7;
|
|
116
|
+
$[21] = t8;
|
|
117
|
+
} else t8 = $[21];
|
|
118
|
+
let t9;
|
|
119
|
+
if ($[22] !== open || $[23] !== t1 || $[24] !== t8) {
|
|
120
|
+
t9 = /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
121
|
+
open,
|
|
122
|
+
onOpenChange: t1,
|
|
123
|
+
children: t8
|
|
124
|
+
});
|
|
125
|
+
$[22] = open;
|
|
126
|
+
$[23] = t1;
|
|
127
|
+
$[24] = t8;
|
|
128
|
+
$[25] = t9;
|
|
129
|
+
} else t9 = $[25];
|
|
130
|
+
return t9;
|
|
131
|
+
}
|
|
132
|
+
export { AlertDialog$1 as AlertDialog };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=alertDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertDialog.js","names":["c","_c","AlertDialog","AlertDialogPrimitive","cn","Button","useCloseOnBack","useReturnFocus","AlertDialogProps","open","onClose","onAction","title","text","actionLabel","cancelLabel","className","t0","$","returnFocus","t1","next","undefined","t2","t3","t4","t5","t6","t7","t8","t9","AlertDialog","_c","AlertDialogPrimitive"],"sources":["../../../src/ui/components/alertDialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as AlertDialogPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\nimport { Button } from \"~/ui/components/button\";\nimport { useCloseOnBack } from \"~/ui/hooks/useCloseOnBack\";\nimport { useReturnFocus } from \"~/ui/hooks/useReturnFocus\";\n\ninterface AlertDialogProps {\n open: boolean;\n onClose: () => void;\n /** Runs on the action button, before the dialog closes itself. */\n onAction: () => void;\n title: string;\n text: string;\n actionLabel: string;\n cancelLabel: string;\n className?: string;\n}\n\n/**\n * A question that has to be answered before going on: unlike `Modal`, a click beside\n * it does not dismiss it, and focus starts on cancel rather than on the action.\n */\nfunction AlertDialog({\n open,\n onClose,\n onAction,\n title,\n text,\n actionLabel,\n cancelLabel,\n className,\n}: AlertDialogProps) {\n useCloseOnBack(open, onClose);\n // Radix still focuses Cancel on open: this handler runs first and doesn't prevent that.\n const returnFocus = useReturnFocus();\n\n return (\n <AlertDialogPrimitive.Root open={open} onOpenChange={(next) => (!next ? onClose() : undefined)}>\n <AlertDialogPrimitive.Portal>\n <AlertDialogPrimitive.Overlay className=\"fixed inset-0 z-dialog flex items-center justify-center bg-black/75 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=closed]:animate-out data-[state=closed]:fade-out motion-reduce:animate-none\">\n <AlertDialogPrimitive.Content\n {...returnFocus}\n className={cn(\n \"mx-4 flex w-full max-w-md flex-col gap-4 rounded-primary border border-border bg-background p-4 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95 motion-reduce:animate-none\",\n className,\n )}\n >\n <AlertDialogPrimitive.Title className=\"text-lg font-semibold text-foreground\">\n {title}\n </AlertDialogPrimitive.Title>\n <AlertDialogPrimitive.Description className=\"text-sm text-muted-foreground\">\n {text}\n </AlertDialogPrimitive.Description>\n <div className=\"flex justify-end gap-2\">\n <div className=\"flex-1 xs:flex-none\">\n <AlertDialogPrimitive.Cancel asChild>\n <Button\n className=\"min-w-30 w-full xs:w-auto\"\n type=\"button\"\n variant=\"outline\"\n size=\"lg\"\n >\n {cancelLabel}\n </Button>\n </AlertDialogPrimitive.Cancel>\n </div>\n <div className=\"flex-1 xs:flex-none\">\n <AlertDialogPrimitive.Action asChild>\n <Button\n className=\"min-w-30 w-full xs:w-auto\"\n type=\"button\"\n variant=\"destructive\"\n size=\"lg\"\n onClick={onAction}\n >\n {actionLabel}\n </Button>\n </AlertDialogPrimitive.Action>\n </div>\n </div>\n </AlertDialogPrimitive.Content>\n </AlertDialogPrimitive.Overlay>\n </AlertDialogPrimitive.Portal>\n </AlertDialogPrimitive.Root>\n );\n}\n\nexport { AlertDialog };\n"],"mappings":";;;;;;;;;;;;;AAwBA,SAAAE,cAAAe,IAAA;CAAA,MAAAC,IAAAjB,EAAA,EAAA;CAAqB,MAAA,EAAAQ,MAAAC,SAAAC,UAAAC,OAAAC,MAAAC,aAAAC,aAAAC,cAAAC;CAUnBX,eAAeG,MAAMC,OAAO;CAE5B,MAAAS,cAAoBZ,eAAe;CAAE,IAAAa;CAAA,IAAAF,EAAA,OAAAR,SAAA;EAGkBU,MAAAC,SAAW,CAACA,OAAOX,QAAoB,IAA5BY,KAAAA;EAA8BJ,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAF,WAAA;EAK3EO,KAAAnB,GACT,+SACAY,SACF;EAACE,EAAA,KAA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AA,CACEF,IAYAC,EAaI;;EAAAT,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAC,eAAAD,EAAA,QAAAK,MAAAL,EAAA,QAAAM,MAAAN,EAAA,QAAAO,MAAAP,EAAA,QAAAU,IAAA;EAzCZC,KAAA,oBAAAI,YAAA,QAAA,EAAA,UACE,oBAAAA,YAAA,SAAA;GAAwC,WAAA;GACtC,UAAA,qBAAAA,YAAA,SAAA;IAAA,GACMd;IACO,WAAAI;IAFb,UAAA;KAOEC;KAGAC;KAGAG;IA2BF;;EACF,CAAA,EACF,CAAA;EAA8BV,EAAA,MAAAC;EAAAD,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,QAAAT,QAAAS,EAAA,QAAAE,MAAAF,EAAA,QAAAW,IAAA;EA7ChCC,KAAA,oBAAAG,YAAA,MAAA;GAAiCxB;GAAoB,cAAAW;GACnDS,UAAAA;EA6CF,CAAA;EAA4BX,EAAA,MAAAT;EAAAS,EAAA,MAAAE;EAAAF,EAAA,MAAAW;EAAAX,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OA9C5BY;AA8C4B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "secondary" | "link" | "default" | "outline" | "ghost" | "destructive" | "keyboardModern" | "keyboard" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cn } from "../../style/utils.js";
|
|
2
|
+
import { keyboardButton } from "../../style/styles.js";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
// src/ui/components/button.tsx
|
|
7
|
+
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center 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 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 aria-invalid:border-destructive hc:aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border border-card bg-card text-card-foreground hover:border-card/80 hover:bg-card/80 hc:border-border",
|
|
11
|
+
outline: "border border-border bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hc:border hc:border-border",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
16
|
+
keyboardModern: "border border-border bg-card text-card-foreground shadow-[0_3px_0_0_var(--border)] hover:bg-muted active:translate-y-[3px] active:shadow-none",
|
|
17
|
+
keyboard: keyboardButton
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
21
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
22
|
+
sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
23
|
+
lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
24
|
+
icon: "size-9",
|
|
25
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
26
|
+
"icon-sm": "size-8",
|
|
27
|
+
"icon-lg": "size-10"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default",
|
|
32
|
+
size: "default"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
36
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
37
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
38
|
+
"data-slot": "button",
|
|
39
|
+
"data-variant": variant,
|
|
40
|
+
"data-size": size,
|
|
41
|
+
className: cn(buttonVariants({
|
|
42
|
+
variant,
|
|
43
|
+
size,
|
|
44
|
+
className
|
|
45
|
+
})),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { Button, buttonVariants };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../src/ui/components/button.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { keyboardButton } from \"~/style/styles\";\nimport { cn } from \"~/style/utils\";\n\nconst buttonVariants = cva(\n \"group/button inline-flex shrink-0 items-center justify-center 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 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 aria-invalid:border-destructive hc:aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer\",\n {\n variants: {\n variant: {\n default:\n \"border border-card bg-card text-card-foreground hover:border-card/80 hover:bg-card/80 hc:border-border\",\n outline:\n \"border border-border bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground hc:border hc:border-border\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n keyboardModern:\n \"border border-border bg-card text-card-foreground shadow-[0_3px_0_0_var(--border)] hover:bg-muted active:translate-y-[3px] active:shadow-none\",\n keyboard: keyboardButton,\n },\n size: {\n default:\n \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot.Root : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;AAMA,IAAM,iBAAiB,IACrB,wnBACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,SACE;GACF,WACE;GACF,OACE;GACF,aACE;GACF,MAAM;GACN,gBACE;GACF,UAAU;EACZ;EACA,MAAM;GACJ,SACE;GACF,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WAAW;GACX,WAAW;GACX,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAEA,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,GAAG,SAIA;CACH,MAAM,OAAO,UAAU,KAAK,OAAO;CAEnC,OACE,oBAAC,MAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC1D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Checkbox } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Tick01Icon } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
8
|
+
// src/ui/components/checkbox.tsx
|
|
9
|
+
function Checkbox$1(t0) {
|
|
10
|
+
const $ = c(9);
|
|
11
|
+
let className;
|
|
12
|
+
let props;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({className, ...props} = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = className;
|
|
17
|
+
$[2] = props;
|
|
18
|
+
} else {
|
|
19
|
+
className = $[1];
|
|
20
|
+
props = $[2];
|
|
21
|
+
}
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[3] !== className) {
|
|
24
|
+
t1 = cn("peer size-5 shrink-0 rounded-secondary border border-border bg-input/30 outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground", className);
|
|
25
|
+
$[3] = className;
|
|
26
|
+
$[4] = t1;
|
|
27
|
+
} else t1 = $[4];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
31
|
+
className: "flex items-center justify-center text-current",
|
|
32
|
+
children: /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
33
|
+
icon: Tick01Icon,
|
|
34
|
+
className: "size-4",
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
$[5] = t2;
|
|
39
|
+
} else t2 = $[5];
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[6] !== props || $[7] !== t1) {
|
|
42
|
+
t3 = /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
43
|
+
"data-slot": "checkbox",
|
|
44
|
+
className: t1,
|
|
45
|
+
...props,
|
|
46
|
+
children: t2
|
|
47
|
+
});
|
|
48
|
+
$[6] = props;
|
|
49
|
+
$[7] = t1;
|
|
50
|
+
$[8] = t3;
|
|
51
|
+
} else t3 = $[8];
|
|
52
|
+
return t3;
|
|
53
|
+
}
|
|
54
|
+
export { Checkbox$1 as Checkbox };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["c","_c","Tick01Icon","HugeiconsIcon","Checkbox","CheckboxPrimitive","cn","t0","$","className","props","t1","t2","Symbol","for","t3","Checkbox","_c","CheckboxPrimitive"],"sources":["../../../src/ui/components/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tick01Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer size-5 shrink-0 rounded-secondary border border-border bg-input/30 outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <HugeiconsIcon icon={Tick01Icon} className=\"size-4\" aria-hidden=\"true\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";;;;;;;;AAOA,SAAAI,WAAAG,IAAA;CAAA,MAAAC,IAAAP,EAAA,CAAA;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAkB,CAAA,CAAAE,WAAA,GAAAC,SAAAH;EAA4EC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,YAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAC,WAAA;EAI7EE,KAAAL,GACT,iXACAG,SACF;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EAGDF,KAAA,oBAAAM,SAAA,WAAA;GAAuC,WAAA;GACrC,UAAA,oBAAC,eAAD;IAAqBhB,MAAAA;IAAsB,WAAA;IAAqB,eAAA;GAAM,CAAA;EACxE,CAAA;EAA8BM,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,SAAAF,EAAA,OAAAG,IAAA;EAVhCI,KAAA,oBAAAG,SAAA,MAAA;GACY,aAAA;GACC,WAAAP;GAGV,GACGD;GAEJE,UAAAA;EAGF,CAAA;EAAyBJ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAXzBO;AAWyB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IconSvgElement } from "@hugeicons/react";
|
|
2
|
+
type ChipProps = {
|
|
3
|
+
text: string;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
icon?: IconSvgElement | string;
|
|
6
|
+
slot?: "start" | "end";
|
|
7
|
+
useIconThemeColor?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
prefixClassName?: string;
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function Chip({ text, prefix, icon, slot, useIconThemeColor, className, prefixClassName, iconClassName, }: ChipProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from "../../style/utils.js";
|
|
2
|
+
import { chip } from "../../style/styles.js";
|
|
3
|
+
import { AppIcon } from "./icon.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/ui/components/chip.tsx
|
|
6
|
+
function Chip({ text, prefix, icon, slot = "start", useIconThemeColor = false, className, prefixClassName, iconClassName }) {
|
|
7
|
+
const iconElement = icon ? /* @__PURE__ */ jsx(AppIcon, {
|
|
8
|
+
icon,
|
|
9
|
+
className: cn("size-5 shrink-0", iconClassName),
|
|
10
|
+
useThemeColor: useIconThemeColor
|
|
11
|
+
}) : null;
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
13
|
+
className: cn(chip, className),
|
|
14
|
+
children: [
|
|
15
|
+
slot === "start" ? iconElement : null,
|
|
16
|
+
/* @__PURE__ */ jsxs("span", { children: [prefix ? /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: prefixClassName,
|
|
18
|
+
children: prefix
|
|
19
|
+
}) : null, text] }),
|
|
20
|
+
slot === "end" ? iconElement : null
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { Chip };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../../../src/ui/components/chip.tsx"],"sourcesContent":["import type { IconSvgElement } from \"@hugeicons/react\";\nimport { chip } from \"~/style/styles\";\nimport { cn } from \"~/style/utils\";\nimport { AppIcon } from \"~/ui/components/icon\";\n\ntype ChipProps = {\n text: string;\n prefix?: string;\n icon?: IconSvgElement | string;\n slot?: \"start\" | \"end\";\n useIconThemeColor?: boolean;\n className?: string;\n prefixClassName?: string;\n iconClassName?: string;\n};\n\nexport function Chip({\n text,\n prefix,\n icon,\n slot = \"start\",\n useIconThemeColor = false,\n className,\n prefixClassName,\n iconClassName,\n}: ChipProps) {\n const iconElement = icon ? (\n <AppIcon\n icon={icon}\n className={cn(\"size-5 shrink-0\", iconClassName)}\n useThemeColor={useIconThemeColor}\n />\n ) : null;\n\n return (\n <span className={cn(chip, className)}>\n {slot === \"start\" ? iconElement : null}\n <span>\n {prefix ? <span className={prefixClassName}>{prefix}</span> : null}\n {text}\n </span>\n {slot === \"end\" ? iconElement : null}\n </span>\n );\n}\n"],"mappings":";;;;;AAgBA,SAAgB,KAAK,EACnB,MACA,QACA,MACA,OAAO,SACP,oBAAoB,OACpB,WACA,iBACA,iBACY;CACZ,MAAM,cAAc,OAClB,oBAAC,SAAD;EACQ;EACN,WAAW,GAAG,mBAAmB,aAAa;EAC9C,eAAe;CAChB,CAAA,IACC;CAEJ,OACE,qBAAC,QAAD;EAAM,WAAW,GAAG,MAAM,SAAS;EAAnC,UAAA;GACG,SAAS,UAAU,cAAc;GAClC,qBAAC,QAAD,EAAA,UAAA,CACG,SAAS,oBAAC,QAAD;IAAM,WAAW;IAAkB,UAAA;GAAa,CAAA,IAAI,MAC7D,IACG,EAAA,CAAA;GACL,SAAS,QAAQ,cAAc;EAC5B;;AAEV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type CollapsibleProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
trigger?: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Floor for the collapsed state, in Tailwind spacing units.
|
|
8
|
+
* `16` collapses to `h-16` instead of fully closing. `undefined` collapses to `0`.
|
|
9
|
+
* The open state is always the natural content height.
|
|
10
|
+
*/
|
|
11
|
+
collapsedHeight?: number;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
duration?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
triggerClassName?: string;
|
|
19
|
+
contentClassName?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function Collapsible({ children, title, trigger, collapsedHeight, defaultOpen, open, onOpenChange, disabled, duration, className, triggerClassName, contentClassName, }: CollapsibleProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Collapsible } from "radix-ui";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/ui/components/collapsible.tsx
|
|
8
|
+
function Collapsible$1(t0) {
|
|
9
|
+
const $ = c(45);
|
|
10
|
+
const { children, title, trigger, collapsedHeight, defaultOpen: t1, open, onOpenChange, disabled: t2, duration: t3, className, triggerClassName, contentClassName } = t0;
|
|
11
|
+
const defaultOpen = t1 === void 0 ? false : t1;
|
|
12
|
+
const disabled = t2 === void 0 ? false : t2;
|
|
13
|
+
const duration = t3 === void 0 ? 300 : t3;
|
|
14
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
15
|
+
const [contentHeight, setContentHeight] = React.useState(null);
|
|
16
|
+
const innerRef = React.useRef(null);
|
|
17
|
+
const contentRef = React.useRef(null);
|
|
18
|
+
const isOpen = open ?? uncontrolledOpen;
|
|
19
|
+
const hasPeek = collapsedHeight !== void 0;
|
|
20
|
+
let t4;
|
|
21
|
+
if ($[0] !== onOpenChange || $[1] !== open) {
|
|
22
|
+
t4 = function handleOpenChange(next) {
|
|
23
|
+
if (open === void 0) setUncontrolledOpen(next);
|
|
24
|
+
onOpenChange?.(next);
|
|
25
|
+
};
|
|
26
|
+
$[0] = onOpenChange;
|
|
27
|
+
$[1] = open;
|
|
28
|
+
$[2] = t4;
|
|
29
|
+
} else t4 = $[2];
|
|
30
|
+
const handleOpenChange = t4;
|
|
31
|
+
let t5;
|
|
32
|
+
let t6;
|
|
33
|
+
if ($[3] !== hasPeek) {
|
|
34
|
+
t5 = () => {
|
|
35
|
+
if (!hasPeek) return;
|
|
36
|
+
const node = innerRef.current;
|
|
37
|
+
if (!node) return;
|
|
38
|
+
const measure = () => setContentHeight(node.getBoundingClientRect().height);
|
|
39
|
+
measure();
|
|
40
|
+
const observer = new ResizeObserver(measure);
|
|
41
|
+
observer.observe(node);
|
|
42
|
+
return () => observer.disconnect();
|
|
43
|
+
};
|
|
44
|
+
t6 = [hasPeek];
|
|
45
|
+
$[3] = hasPeek;
|
|
46
|
+
$[4] = t5;
|
|
47
|
+
$[5] = t6;
|
|
48
|
+
} else {
|
|
49
|
+
t5 = $[4];
|
|
50
|
+
t6 = $[5];
|
|
51
|
+
}
|
|
52
|
+
React.useLayoutEffect(t5, t6);
|
|
53
|
+
let t7;
|
|
54
|
+
let t8;
|
|
55
|
+
if ($[6] !== hasPeek || $[7] !== isOpen) {
|
|
56
|
+
t7 = () => {
|
|
57
|
+
if (!hasPeek || !isOpen) return;
|
|
58
|
+
const node_0 = contentRef.current;
|
|
59
|
+
if (node_0) node_0.scrollTop = 0;
|
|
60
|
+
};
|
|
61
|
+
t8 = [hasPeek, isOpen];
|
|
62
|
+
$[6] = hasPeek;
|
|
63
|
+
$[7] = isOpen;
|
|
64
|
+
$[8] = t7;
|
|
65
|
+
$[9] = t8;
|
|
66
|
+
} else {
|
|
67
|
+
t7 = $[8];
|
|
68
|
+
t8 = $[9];
|
|
69
|
+
}
|
|
70
|
+
React.useLayoutEffect(t7, t8);
|
|
71
|
+
const t9 = `${duration}ms`;
|
|
72
|
+
const t10 = hasPeek ? `calc(var(--spacing) * ${collapsedHeight})` : "0px";
|
|
73
|
+
let contentStyle;
|
|
74
|
+
if ($[10] !== contentHeight || $[11] !== hasPeek || $[12] !== t10 || $[13] !== t9) {
|
|
75
|
+
contentStyle = {
|
|
76
|
+
animationDuration: t9,
|
|
77
|
+
"--collapsible-collapsed-height": t10
|
|
78
|
+
};
|
|
79
|
+
if (hasPeek) contentStyle["--collapsible-content-height"] = contentHeight === null ? "auto" : `${contentHeight}px`;
|
|
80
|
+
$[10] = contentHeight;
|
|
81
|
+
$[11] = hasPeek;
|
|
82
|
+
$[12] = t10;
|
|
83
|
+
$[13] = t9;
|
|
84
|
+
$[14] = contentStyle;
|
|
85
|
+
} else contentStyle = $[14];
|
|
86
|
+
let t11;
|
|
87
|
+
if ($[15] !== duration || $[16] !== title || $[17] !== trigger) {
|
|
88
|
+
t11 = trigger ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "min-w-0 truncate",
|
|
90
|
+
children: title
|
|
91
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
92
|
+
width: 16,
|
|
93
|
+
height: 16,
|
|
94
|
+
viewBox: "0 0 12 12",
|
|
95
|
+
fill: "none",
|
|
96
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
+
className: "shrink-0 transition-transform ease-in-out origin-center group-data-[state=open]:rotate-180",
|
|
98
|
+
style: { transitionDuration: `${duration}ms` },
|
|
99
|
+
"aria-hidden": "true",
|
|
100
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
101
|
+
d: "M2.5 4.5 6 8l3.5-3.5",
|
|
102
|
+
stroke: "currentColor",
|
|
103
|
+
strokeWidth: "1.5",
|
|
104
|
+
strokeLinecap: "round",
|
|
105
|
+
strokeLinejoin: "round"
|
|
106
|
+
})
|
|
107
|
+
})] });
|
|
108
|
+
$[15] = duration;
|
|
109
|
+
$[16] = title;
|
|
110
|
+
$[17] = trigger;
|
|
111
|
+
$[18] = t11;
|
|
112
|
+
} else t11 = $[18];
|
|
113
|
+
const triggerNode = t11;
|
|
114
|
+
let t12;
|
|
115
|
+
if ($[19] !== className) {
|
|
116
|
+
t12 = cn("w-full", className);
|
|
117
|
+
$[19] = className;
|
|
118
|
+
$[20] = t12;
|
|
119
|
+
} else t12 = $[20];
|
|
120
|
+
let t13;
|
|
121
|
+
if ($[21] !== triggerClassName) {
|
|
122
|
+
t13 = cn("group flex w-full items-center justify-between gap-4 p-2 text-left font-semibold text-muted-foreground tracking-widest hover:text-foreground transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 hc:disabled:opacity-75", triggerClassName);
|
|
123
|
+
$[21] = triggerClassName;
|
|
124
|
+
$[22] = t13;
|
|
125
|
+
} else t13 = $[22];
|
|
126
|
+
let t14;
|
|
127
|
+
if ($[23] !== t13 || $[24] !== triggerNode) {
|
|
128
|
+
t14 = /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
129
|
+
className: t13,
|
|
130
|
+
children: triggerNode
|
|
131
|
+
});
|
|
132
|
+
$[23] = t13;
|
|
133
|
+
$[24] = triggerNode;
|
|
134
|
+
$[25] = t14;
|
|
135
|
+
} else t14 = $[25];
|
|
136
|
+
const t15 = hasPeek || void 0;
|
|
137
|
+
const t16 = hasPeek ? "data-[state=closed]:h-(--collapsible-collapsed-height) data-[state=closed]:overflow-y-auto data-[state=closed]:overscroll-contain" : null;
|
|
138
|
+
let t17;
|
|
139
|
+
if ($[26] !== t16) {
|
|
140
|
+
t17 = cn("overflow-hidden data-[state=closed]:animate-collapsible-collapse data-[state=open]:animate-collapsible-expand", t16);
|
|
141
|
+
$[26] = t16;
|
|
142
|
+
$[27] = t17;
|
|
143
|
+
} else t17 = $[27];
|
|
144
|
+
let t18;
|
|
145
|
+
if ($[28] !== contentClassName) {
|
|
146
|
+
t18 = cn("flex flex-col", contentClassName);
|
|
147
|
+
$[28] = contentClassName;
|
|
148
|
+
$[29] = t18;
|
|
149
|
+
} else t18 = $[29];
|
|
150
|
+
let t19;
|
|
151
|
+
if ($[30] !== children || $[31] !== t18) {
|
|
152
|
+
t19 = /* @__PURE__ */ jsx("div", {
|
|
153
|
+
ref: innerRef,
|
|
154
|
+
className: t18,
|
|
155
|
+
children
|
|
156
|
+
});
|
|
157
|
+
$[30] = children;
|
|
158
|
+
$[31] = t18;
|
|
159
|
+
$[32] = t19;
|
|
160
|
+
} else t19 = $[32];
|
|
161
|
+
let t20;
|
|
162
|
+
if ($[33] !== contentStyle || $[34] !== t15 || $[35] !== t17 || $[36] !== t19) {
|
|
163
|
+
t20 = /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
164
|
+
ref: contentRef,
|
|
165
|
+
forceMount: t15,
|
|
166
|
+
className: t17,
|
|
167
|
+
style: contentStyle,
|
|
168
|
+
children: t19
|
|
169
|
+
});
|
|
170
|
+
$[33] = contentStyle;
|
|
171
|
+
$[34] = t15;
|
|
172
|
+
$[35] = t17;
|
|
173
|
+
$[36] = t19;
|
|
174
|
+
$[37] = t20;
|
|
175
|
+
} else t20 = $[37];
|
|
176
|
+
let t21;
|
|
177
|
+
if ($[38] !== disabled || $[39] !== handleOpenChange || $[40] !== isOpen || $[41] !== t12 || $[42] !== t14 || $[43] !== t20) {
|
|
178
|
+
t21 = /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
179
|
+
open: isOpen,
|
|
180
|
+
onOpenChange: handleOpenChange,
|
|
181
|
+
disabled,
|
|
182
|
+
className: t12,
|
|
183
|
+
children: [t14, t20]
|
|
184
|
+
});
|
|
185
|
+
$[38] = disabled;
|
|
186
|
+
$[39] = handleOpenChange;
|
|
187
|
+
$[40] = isOpen;
|
|
188
|
+
$[41] = t12;
|
|
189
|
+
$[42] = t14;
|
|
190
|
+
$[43] = t20;
|
|
191
|
+
$[44] = t21;
|
|
192
|
+
} else t21 = $[44];
|
|
193
|
+
return t21;
|
|
194
|
+
}
|
|
195
|
+
export { Collapsible$1 as Collapsible };
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.js","names":["c","_c","Collapsible","CollapsiblePrimitive","React","cn","CollapsibleProps","children","ReactNode","title","trigger","collapsedHeight","defaultOpen","open","onOpenChange","disabled","duration","className","triggerClassName","contentClassName","t0","$","t1","t2","t3","undefined","uncontrolledOpen","setUncontrolledOpen","useState","contentHeight","setContentHeight","innerRef","useRef","contentRef","isOpen","hasPeek","t4","handleOpenChange","next","t5","t6","node","current","measure","getBoundingClientRect","height","observer","ResizeObserver","observe","disconnect","useLayoutEffect","t7","t8","node_0","scrollTop","t9","t10","contentStyle","animationDuration","t11","transitionDuration","triggerNode","t12","t13","t14","t15","t16","t17","t18","t19","t20","t21","Collapsible","_c","_Fragment","CollapsiblePrimitive"],"sources":["../../../src/ui/components/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\ntype CollapsibleProps = {\n children: React.ReactNode;\n title?: string;\n trigger?: React.ReactNode;\n /**\n * Floor for the collapsed state, in Tailwind spacing units.\n * `16` collapses to `h-16` instead of fully closing. `undefined` collapses to `0`.\n * The open state is always the natural content height.\n */\n collapsedHeight?: number;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n duration?: number;\n className?: string;\n triggerClassName?: string;\n contentClassName?: string;\n};\n\nexport function Collapsible({\n children,\n title,\n trigger,\n collapsedHeight,\n defaultOpen = false,\n open,\n onOpenChange,\n disabled = false,\n duration = 300,\n className,\n triggerClassName,\n contentClassName,\n}: CollapsibleProps) {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const [contentHeight, setContentHeight] = React.useState<number | null>(null);\n const innerRef = React.useRef<HTMLDivElement>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n\n const isOpen = open ?? uncontrolledOpen;\n const hasPeek = collapsedHeight !== undefined;\n\n function handleOpenChange(next: boolean) {\n if (open === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n }\n\n /*\n A peeking collapsible measures its own content instead of leaning on\n `--radix-collapsible-content-height`. Radix reads that height during render\n but writes it in a layout effect, relying on `setIsPresent` to publish it --\n and `forceMount` pins `present` to `true`, so that update always bails out and\n the variable stays a commit behind. Measuring the inner element sidesteps\n that: it is never height-constrained, so it always reports the natural height.\n */\n React.useLayoutEffect(() => {\n if (!hasPeek) return;\n const node = innerRef.current;\n if (!node) return;\n\n const measure = () => setContentHeight(node.getBoundingClientRect().height);\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, [hasPeek]);\n\n /*\n The collapsed peek scrolls, so opening can land with a stale `scrollTop`. The\n open state is `overflow-hidden`, which keeps that offset with no way to scroll\n back, leaving the content permanently shifted up. Only the open direction\n needs this -- closing always starts from a non-scrollable open state.\n */\n React.useLayoutEffect(() => {\n if (!hasPeek || !isOpen) return;\n const node = contentRef.current;\n if (node) node.scrollTop = 0;\n }, [hasPeek, isOpen]);\n\n const contentStyle: React.CSSProperties & Record<`--${string}`, string> = {\n animationDuration: `${duration}ms`,\n \"--collapsible-collapsed-height\": hasPeek ? `calc(var(--spacing) * ${collapsedHeight})` : \"0px\",\n };\n if (hasPeek) {\n // Never leave this unset: an unresolvable `var()` inside a keyframe drops the\n // whole declaration, and an animation missing an endpoint silently falls back\n // to the element's current height -- which is already the collapsed one.\n contentStyle[\"--collapsible-content-height\"] =\n contentHeight === null ? \"auto\" : `${contentHeight}px`;\n }\n\n const triggerNode = trigger ?? (\n <>\n <span className=\"min-w-0 truncate\">{title}</span>\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"shrink-0 transition-transform ease-in-out origin-center group-data-[state=open]:rotate-180\"\n style={{ transitionDuration: `${duration}ms` }}\n aria-hidden=\"true\"\n >\n <path\n d=\"M2.5 4.5 6 8l3.5-3.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </>\n );\n\n return (\n <CollapsiblePrimitive.Root\n open={isOpen}\n onOpenChange={handleOpenChange}\n disabled={disabled}\n className={cn(\"w-full\", className)}\n >\n <CollapsiblePrimitive.Trigger\n className={cn(\n \"group flex w-full items-center justify-between gap-4 p-2 text-left font-semibold text-muted-foreground tracking-widest hover:text-foreground transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 hc:disabled:opacity-75\",\n triggerClassName,\n )}\n >\n {triggerNode}\n </CollapsiblePrimitive.Trigger>\n\n <CollapsiblePrimitive.Content\n ref={contentRef}\n forceMount={hasPeek || undefined}\n className={cn(\n \"overflow-hidden data-[state=closed]:animate-collapsible-collapse data-[state=open]:animate-collapsible-expand\",\n // Standing rule, so the collapsed state holds its height whether or not\n // the animation ran -- Radix blocks it on mount, and it never runs if\n // the collapsible is toggled mid-animation. Only safe when peeking: for\n // a plain collapsible this would clamp the height Radix measures on\n // close to `0`, wiping out its own close animation.\n //\n // The peek is also scrollable while collapsed, so the clipped overflow\n // is reachable. `overflow-x` stays hidden and `overscroll-contain` keeps\n // the scroll from chaining to the page once the peek bottoms out.\n hasPeek\n ? \"data-[state=closed]:h-(--collapsible-collapsed-height) data-[state=closed]:overflow-y-auto data-[state=closed]:overscroll-contain\"\n : null,\n )}\n style={contentStyle}\n >\n <div ref={innerRef} className={cn(\"flex flex-col\", contentClassName)}>\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n </CollapsiblePrimitive.Root>\n );\n}\n"],"mappings":";;;;;;;AA0BA,SAAOE,cAAAkB,IAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAqB,MAAA,EAAAM,UAAAE,OAAAC,SAAAC,iBAAAC,aAAAU,IAAAT,MAAAC,cAAAC,UAAAQ,IAAAP,UAAAQ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rawerProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
side?: Side;
|
|
8
|
+
classNames?: string;
|
|
9
|
+
/** Screen reader name; the "menu" label if left out */
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function Drawer({ open, onClose, children, side, classNames, title }: DrawerProps): import("react").JSX.Element;
|
|
13
|
+
export { Drawer };
|