@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,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { useBrucksLabels } from "../lib/labels.js";
|
|
4
|
+
import { SortableListRow } from "./sortableListRow.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Accessibility } from "@dnd-kit/dom";
|
|
9
|
+
import { move } from "@dnd-kit/helpers";
|
|
10
|
+
import { DragDropProvider } from "@dnd-kit/react";
|
|
11
|
+
// src/ui/components/sortableList.tsx
|
|
12
|
+
function SortableList(t0) {
|
|
13
|
+
const $ = c(24);
|
|
14
|
+
const { items, onChange, renderItem, className, itemLabel } = t0;
|
|
15
|
+
const labels = useBrucksLabels();
|
|
16
|
+
const [announcement, setAnnouncement] = useState("");
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== itemLabel || $[1] !== items || $[2] !== labels || $[3] !== onChange) {
|
|
19
|
+
t1 = function handleDragEnd(event) {
|
|
20
|
+
const next = move(items, event);
|
|
21
|
+
onChange(next);
|
|
22
|
+
const moved = next.find((item) => item.id === event.operation.source?.id);
|
|
23
|
+
if (!moved) return;
|
|
24
|
+
const position = next.indexOf(moved);
|
|
25
|
+
if (items[position]?.id === moved.id) return;
|
|
26
|
+
setAnnouncement(labels.reorderAnnouncement({
|
|
27
|
+
item: itemLabel?.(moved) ?? String(moved.id),
|
|
28
|
+
position: position + 1,
|
|
29
|
+
total: next.length
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
$[0] = itemLabel;
|
|
33
|
+
$[1] = items;
|
|
34
|
+
$[2] = labels;
|
|
35
|
+
$[3] = onChange;
|
|
36
|
+
$[4] = t1;
|
|
37
|
+
} else t1 = $[4];
|
|
38
|
+
const handleDragEnd = t1;
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[5] !== labels.dragInstructions) {
|
|
41
|
+
t2 = (defaults) => [...defaults.filter(_temp), Accessibility.configure({
|
|
42
|
+
screenReaderInstructions: { draggable: labels.dragInstructions },
|
|
43
|
+
announcements: {
|
|
44
|
+
dragstart: _temp2,
|
|
45
|
+
dragend: _temp3
|
|
46
|
+
}
|
|
47
|
+
})];
|
|
48
|
+
$[5] = labels.dragInstructions;
|
|
49
|
+
$[6] = t2;
|
|
50
|
+
} else t2 = $[6];
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[7] !== className) {
|
|
53
|
+
t3 = cn("flex flex-col gap-2", className);
|
|
54
|
+
$[7] = className;
|
|
55
|
+
$[8] = t3;
|
|
56
|
+
} else t3 = $[8];
|
|
57
|
+
let t4;
|
|
58
|
+
if ($[9] !== items || $[10] !== renderItem) {
|
|
59
|
+
let t5;
|
|
60
|
+
if ($[12] !== renderItem) {
|
|
61
|
+
t5 = (item_0, index) => /* @__PURE__ */ jsx(SortableListRow, {
|
|
62
|
+
id: item_0.id,
|
|
63
|
+
index,
|
|
64
|
+
children: renderItem(item_0, index)
|
|
65
|
+
}, item_0.id);
|
|
66
|
+
$[12] = renderItem;
|
|
67
|
+
$[13] = t5;
|
|
68
|
+
} else t5 = $[13];
|
|
69
|
+
t4 = items.map(t5);
|
|
70
|
+
$[9] = items;
|
|
71
|
+
$[10] = renderItem;
|
|
72
|
+
$[11] = t4;
|
|
73
|
+
} else t4 = $[11];
|
|
74
|
+
let t5;
|
|
75
|
+
if ($[14] !== t3 || $[15] !== t4) {
|
|
76
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
77
|
+
className: t3,
|
|
78
|
+
children: t4
|
|
79
|
+
});
|
|
80
|
+
$[14] = t3;
|
|
81
|
+
$[15] = t4;
|
|
82
|
+
$[16] = t5;
|
|
83
|
+
} else t5 = $[16];
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[17] !== announcement) {
|
|
86
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
87
|
+
"aria-live": "polite",
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: announcement
|
|
90
|
+
});
|
|
91
|
+
$[17] = announcement;
|
|
92
|
+
$[18] = t6;
|
|
93
|
+
} else t6 = $[18];
|
|
94
|
+
let t7;
|
|
95
|
+
if ($[19] !== handleDragEnd || $[20] !== t2 || $[21] !== t5 || $[22] !== t6) {
|
|
96
|
+
t7 = /* @__PURE__ */ jsxs(DragDropProvider, {
|
|
97
|
+
onDragEnd: handleDragEnd,
|
|
98
|
+
plugins: t2,
|
|
99
|
+
children: [t5, t6]
|
|
100
|
+
});
|
|
101
|
+
$[19] = handleDragEnd;
|
|
102
|
+
$[20] = t2;
|
|
103
|
+
$[21] = t5;
|
|
104
|
+
$[22] = t6;
|
|
105
|
+
$[23] = t7;
|
|
106
|
+
} else t7 = $[23];
|
|
107
|
+
return t7;
|
|
108
|
+
}
|
|
109
|
+
function _temp3() {}
|
|
110
|
+
function _temp2() {}
|
|
111
|
+
function _temp(plugin) {
|
|
112
|
+
return plugin !== Accessibility;
|
|
113
|
+
}
|
|
114
|
+
export { SortableList };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=sortableList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortableList.js","names":["c","_c","Accessibility","move","DragDropProvider","DragEndEvent","ReactNode","useState","cn","SortableListRow","useBrucksLabels","SortableItem","id","SortableListProps","items","Array","T","onChange","renderItem","item","index","className","itemLabel","SortableList","t0","$","labels","announcement","setAnnouncement","t1","handleDragEnd","event","next","moved","find","operation","source","position","indexOf","reorderAnnouncement","String","total","length","t2","dragInstructions","defaults","filter","_temp","configure","screenReaderInstructions","draggable","announcements","dragstart","_temp2","dragend","_temp3","t3","t4","t5","item_0","map","t6","t7","plugin","_c"],"sources":["../../../src/ui/components/sortableList.tsx"],"sourcesContent":["\"use client\";\n\nimport { Accessibility } from \"@dnd-kit/dom\";\nimport { move } from \"@dnd-kit/helpers\";\nimport { DragDropProvider, type DragEndEvent } from \"@dnd-kit/react\";\nimport { type ReactNode, useState } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { SortableListRow } from \"~/ui/components/sortableListRow\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ntype SortableItem = {\n id: string | number;\n};\n\ntype SortableListProps<T extends SortableItem> = {\n items: Array<T>;\n onChange: (items: Array<T>) => void;\n renderItem: (item: T, index: number) => ReactNode;\n className?: string;\n itemLabel?: (item: T) => string;\n};\n\nexport function SortableList<T extends SortableItem>({\n items,\n onChange,\n renderItem,\n className,\n itemLabel,\n}: SortableListProps<T>) {\n const labels = useBrucksLabels();\n /** Screen Reader */\n const [announcement, setAnnouncement] = useState(\"\");\n\n function handleDragEnd(event: DragEndEvent) {\n const next = move(items, event);\n onChange(next);\n\n const moved = next.find((item) => item.id === event.operation.source?.id);\n if (!moved) return;\n const position = next.indexOf(moved);\n if (items[position]?.id === moved.id) return;\n setAnnouncement(\n labels.reorderAnnouncement({\n item: itemLabel?.(moved) ?? String(moved.id),\n position: position + 1,\n total: next.length,\n }),\n );\n }\n\n return (\n <DragDropProvider\n onDragEnd={handleDragEnd}\n // dnd-kit's own instructions and announcements are English and name items by id. The\n // instructions come from the labels instead, and the move is announced below.\n plugins={(defaults) => [\n ...defaults.filter((plugin) => plugin !== Accessibility),\n Accessibility.configure({\n screenReaderInstructions: { draggable: labels.dragInstructions },\n announcements: { dragstart: () => undefined, dragend: () => undefined },\n }),\n ]}\n >\n <div className={cn(\"flex flex-col gap-2\", className)}>\n {items.map((item, index) => (\n <SortableListRow key={item.id} id={item.id} index={index}>\n {renderItem(item, index)}\n </SortableListRow>\n ))}\n </div>\n <div aria-live=\"polite\" className=\"sr-only\">\n {announcement}\n </div>\n </DragDropProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsBA,SAAOuB,aAAAC,IAAA;CAAA,MAAAC,IAAAxB,EAAA,EAAA;CAA8C,MAAA,EAAAa,OAAAG,UAAAC,YAAAG,WAAAC,cAAAE;CAOnD,MAAAE,SAAehB,gBAAgB;CAE/B,MAAA,CAAAiB,cAAAC,mBAAwCrB,SAAS,EAAE;CAAE,IAAAsB;CAAA,IAAAJ,EAAA,OAAAH,aAAAG,EAAA,OAAAX,SAAAW,EAA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AkCgCA,WAAW7D;AAAa"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type SortableListRowProps = {
|
|
3
|
+
id: string | number;
|
|
4
|
+
index: number;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function SortableListRow({ id, index, children }: SortableListRowProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { useBrucksLabels } from "../lib/labels.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { DragDropVerticalIcon } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
8
|
+
import { useSortable } from "@dnd-kit/react/sortable";
|
|
9
|
+
// src/ui/components/sortableListRow.tsx
|
|
10
|
+
function SortableListRow(t0) {
|
|
11
|
+
const $ = c(16);
|
|
12
|
+
const { id, index, children } = t0;
|
|
13
|
+
const labels = useBrucksLabels();
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== id || $[1] !== index) {
|
|
16
|
+
t1 = {
|
|
17
|
+
id,
|
|
18
|
+
index
|
|
19
|
+
};
|
|
20
|
+
$[0] = id;
|
|
21
|
+
$[1] = index;
|
|
22
|
+
$[2] = t1;
|
|
23
|
+
} else t1 = $[2];
|
|
24
|
+
const { ref, handleRef, isDragging } = useSortable(t1);
|
|
25
|
+
const t2 = isDragging ? "opacity-50" : null;
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[3] !== t2) {
|
|
28
|
+
t3 = cn("flex items-center gap-2", t2);
|
|
29
|
+
$[3] = t2;
|
|
30
|
+
$[4] = t3;
|
|
31
|
+
} else t3 = $[4];
|
|
32
|
+
let t4;
|
|
33
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t4 = /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
35
|
+
icon: DragDropVerticalIcon,
|
|
36
|
+
className: "size-8"
|
|
37
|
+
});
|
|
38
|
+
$[5] = t4;
|
|
39
|
+
} else t4 = $[5];
|
|
40
|
+
let t5;
|
|
41
|
+
if ($[6] !== handleRef || $[7] !== labels.dragToReorder) {
|
|
42
|
+
t5 = /* @__PURE__ */ jsx("button", {
|
|
43
|
+
ref: handleRef,
|
|
44
|
+
type: "button",
|
|
45
|
+
className: "shrink-0 cursor-grab touch-none text-muted-foreground active:cursor-grabbing",
|
|
46
|
+
"aria-label": labels.dragToReorder,
|
|
47
|
+
children: t4
|
|
48
|
+
});
|
|
49
|
+
$[6] = handleRef;
|
|
50
|
+
$[7] = labels.dragToReorder;
|
|
51
|
+
$[8] = t5;
|
|
52
|
+
} else t5 = $[8];
|
|
53
|
+
let t6;
|
|
54
|
+
if ($[9] !== children) {
|
|
55
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: "min-w-0 flex-1",
|
|
57
|
+
children
|
|
58
|
+
});
|
|
59
|
+
$[9] = children;
|
|
60
|
+
$[10] = t6;
|
|
61
|
+
} else t6 = $[10];
|
|
62
|
+
let t7;
|
|
63
|
+
if ($[11] !== ref || $[12] !== t3 || $[13] !== t5 || $[14] !== t6) {
|
|
64
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
65
|
+
ref,
|
|
66
|
+
className: t3,
|
|
67
|
+
children: [t5, t6]
|
|
68
|
+
});
|
|
69
|
+
$[11] = ref;
|
|
70
|
+
$[12] = t3;
|
|
71
|
+
$[13] = t5;
|
|
72
|
+
$[14] = t6;
|
|
73
|
+
$[15] = t7;
|
|
74
|
+
} else t7 = $[15];
|
|
75
|
+
return t7;
|
|
76
|
+
}
|
|
77
|
+
export { SortableListRow };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=sortableListRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortableListRow.js","names":["c","_c","useSortable","DragDropVerticalIcon","HugeiconsIcon","ReactNode","cn","useBrucksLabels","SortableListRowProps","id","index","children","SortableListRow","t0","$","labels","t1","ref","handleRef","isDragging","t2","t3","t4","Symbol","for","t5","dragToReorder","t6","t7","_c"],"sources":["../../../src/ui/components/sortableListRow.tsx"],"sourcesContent":["\"use client\";\n\nimport { useSortable } from \"@dnd-kit/react/sortable\";\nimport { DragDropVerticalIcon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ntype SortableListRowProps = {\n id: string | number;\n index: number;\n children: ReactNode;\n};\n\nexport function SortableListRow({ id, index, children }: SortableListRowProps) {\n const labels = useBrucksLabels();\n const { ref, handleRef, isDragging } = useSortable({ id, index });\n\n return (\n <div ref={ref} className={cn(\"flex items-center gap-2\", isDragging ? \"opacity-50\" : null)}>\n <button\n ref={handleRef}\n type=\"button\"\n className=\"shrink-0 cursor-grab touch-none text-muted-foreground active:cursor-grabbing\"\n aria-label={labels.dragToReorder}\n >\n <HugeiconsIcon icon={DragDropVerticalIcon} className=\"size-8\" />\n </button>\n <div className=\"min-w-0 flex-1\">{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAOY,gBAAAC,IAAA;CAAA,MAAAC,IAAAb,EAAA,EAAA;CAAyB,MAAA,EAAAQ,IAAAC,OAAAC,aAAAE;CAC9B,MAAAE,SAAeR,gBAAgB;CAAE,IAAAS;CAAA,IAAAF,EAAA,OAAAL,MAAAK,EAAA,OAAAJ,OAAA;EACkBM,KAAA;GAAAP;GAAAC;EAAY;EAACI,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAhE,MAAA,EAAAG,KAAAC,WAAAC,eAAuCjB,YAAYc,E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../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Switch } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/components/switch.tsx
|
|
7
|
+
function Switch$1(t0) {
|
|
8
|
+
const $ = c(9);
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
if ($[0] !== t0) {
|
|
12
|
+
({className, ...props} = t0);
|
|
13
|
+
$[0] = t0;
|
|
14
|
+
$[1] = className;
|
|
15
|
+
$[2] = props;
|
|
16
|
+
} else {
|
|
17
|
+
className = $[1];
|
|
18
|
+
props = $[2];
|
|
19
|
+
}
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[3] !== className) {
|
|
22
|
+
t1 = cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted outline-none transition-colors 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-theme-500 cursor-pointer", className);
|
|
23
|
+
$[3] = className;
|
|
24
|
+
$[4] = t1;
|
|
25
|
+
} else t1 = $[4];
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t2 = /* @__PURE__ */ jsx(Switch.Thumb, { className: "pointer-events-none block size-4 translate-x-0.5 rounded-full bg-accent-foreground data-[state=checked]:bg-theme-foreground shadow-sm transition-transform data-[state=checked]:translate-x-4" });
|
|
29
|
+
$[5] = t2;
|
|
30
|
+
} else t2 = $[5];
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[6] !== props || $[7] !== t1) {
|
|
33
|
+
t3 = /* @__PURE__ */ jsx(Switch.Root, {
|
|
34
|
+
"data-slot": "switch",
|
|
35
|
+
className: t1,
|
|
36
|
+
...props,
|
|
37
|
+
children: t2
|
|
38
|
+
});
|
|
39
|
+
$[6] = props;
|
|
40
|
+
$[7] = t1;
|
|
41
|
+
$[8] = t3;
|
|
42
|
+
} else t3 = $[8];
|
|
43
|
+
return t3;
|
|
44
|
+
}
|
|
45
|
+
export { Switch$1 as Switch };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","names":["c","_c","Switch","SwitchPrimitive","cn","t0","$","className","props","t1","t2","Symbol","for","t3","Switch","_c","SwitchPrimitive"],"sources":["../../../src/ui/components/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { Switch as SwitchPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\nfunction Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n \"peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border bg-muted outline-none transition-colors 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-theme-500 cursor-pointer\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb className=\"pointer-events-none block size-4 translate-x-0.5 rounded-full bg-accent-foreground data-[state=checked]:bg-theme-foreground shadow-sm transition-transform data-[state=checked]:translate-x-4\" />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n"],"mappings":";;;;;;AAKA,SAAAE,SAAAG,IAAA;CAAA,MAAAC,IAAAL,EAAA,CAAA;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAgB,CAAA,CAAAE,WAAA,GAAAC,SAAAH;EAA0EC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,YAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAC,WAAA;EAIzEE,KAAAL,GACT,mUACAG,SACF;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EAGDF,KAAA,oBAAAM,OAAA,OAAA,EAAiC,WAAA,gMAA+L,CAAA;EAAGV,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,SAAAF,EAAA,OAAAG,IAAA;EARrOI,KAAA,oBAAAG,OAAA,MAAA;GACY,aAAA;GACC,WAAAP;GAGV,GACGD;GAEJE,UAAAA;EACF,CAAA;EAAuBJ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OATvBO;AASuB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
|
5
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Tabs } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/components/tabs.tsx
|
|
7
|
+
var Tabs$1 = Tabs.Root;
|
|
8
|
+
function TabsList(t0) {
|
|
9
|
+
const $ = c(8);
|
|
10
|
+
let className;
|
|
11
|
+
let props;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({className, ...props} = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
} else {
|
|
18
|
+
className = $[1];
|
|
19
|
+
props = $[2];
|
|
20
|
+
}
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[3] !== className) {
|
|
23
|
+
t1 = cn("inline-flex w-fit items-center gap-1 rounded-primary bg-muted p-1", className);
|
|
24
|
+
$[3] = className;
|
|
25
|
+
$[4] = t1;
|
|
26
|
+
} else t1 = $[4];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Tabs.List, {
|
|
30
|
+
"data-slot": "tabs-list",
|
|
31
|
+
className: t1,
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
$[5] = props;
|
|
35
|
+
$[6] = t1;
|
|
36
|
+
$[7] = t2;
|
|
37
|
+
} else t2 = $[7];
|
|
38
|
+
return t2;
|
|
39
|
+
}
|
|
40
|
+
function TabsTrigger(t0) {
|
|
41
|
+
const $ = c(8);
|
|
42
|
+
let className;
|
|
43
|
+
let props;
|
|
44
|
+
if ($[0] !== t0) {
|
|
45
|
+
({className, ...props} = t0);
|
|
46
|
+
$[0] = t0;
|
|
47
|
+
$[1] = className;
|
|
48
|
+
$[2] = props;
|
|
49
|
+
} else {
|
|
50
|
+
className = $[1];
|
|
51
|
+
props = $[2];
|
|
52
|
+
}
|
|
53
|
+
let t1;
|
|
54
|
+
if ($[3] !== className) {
|
|
55
|
+
t1 = cn("inline-flex h-8 cursor-pointer items-center justify-center rounded-secondary px-3 text-sm font-medium whitespace-nowrap text-muted-foreground outline-none transition-all hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=active]:bg-theme-400 data-[state=active]:text-foreground hc:data-[state=active]:bg-foreground hc:data-[state=active]:text-background", className);
|
|
56
|
+
$[3] = className;
|
|
57
|
+
$[4] = t1;
|
|
58
|
+
} else t1 = $[4];
|
|
59
|
+
let t2;
|
|
60
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
61
|
+
t2 = /* @__PURE__ */ jsx(Tabs.Trigger, {
|
|
62
|
+
"data-slot": "tabs-trigger",
|
|
63
|
+
className: t1,
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
$[5] = props;
|
|
67
|
+
$[6] = t1;
|
|
68
|
+
$[7] = t2;
|
|
69
|
+
} else t2 = $[7];
|
|
70
|
+
return t2;
|
|
71
|
+
}
|
|
72
|
+
function TabsContent(t0) {
|
|
73
|
+
const $ = c(8);
|
|
74
|
+
let className;
|
|
75
|
+
let props;
|
|
76
|
+
if ($[0] !== t0) {
|
|
77
|
+
({className, ...props} = t0);
|
|
78
|
+
$[0] = t0;
|
|
79
|
+
$[1] = className;
|
|
80
|
+
$[2] = props;
|
|
81
|
+
} else {
|
|
82
|
+
className = $[1];
|
|
83
|
+
props = $[2];
|
|
84
|
+
}
|
|
85
|
+
let t1;
|
|
86
|
+
if ($[3] !== className) {
|
|
87
|
+
t1 = cn("flex flex-col gap-4 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", className);
|
|
88
|
+
$[3] = className;
|
|
89
|
+
$[4] = t1;
|
|
90
|
+
} else t1 = $[4];
|
|
91
|
+
let t2;
|
|
92
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
93
|
+
t2 = /* @__PURE__ */ jsx(Tabs.Content, {
|
|
94
|
+
"data-slot": "tabs-content",
|
|
95
|
+
className: t1,
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
|
+
$[5] = props;
|
|
99
|
+
$[6] = t1;
|
|
100
|
+
$[7] = t2;
|
|
101
|
+
} else t2 = $[7];
|
|
102
|
+
return t2;
|
|
103
|
+
}
|
|
104
|
+
export { Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["c","_c","Tabs","TabsPrimitive","React","cn","Root","TabsList","t0","$","className","props","t1","t2","TabsTrigger","TabsContent","Tabs","TabsPrimitive","_c"],"sources":["../../../src/ui/components/tabs.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\"inline-flex w-fit items-center gap-1 rounded-primary bg-muted p-1\", className)}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"inline-flex h-8 cursor-pointer items-center justify-center rounded-secondary px-3 text-sm font-medium whitespace-nowrap text-muted-foreground outline-none transition-all hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=active]:bg-theme-400 data-[state=active]:text-foreground hc:data-[state=active]:bg-foreground hc:data-[state=active]:text-background\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\n \"flex flex-col gap-4 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"],"mappings":";;;;;;AAMA,IAAME,SAAOC,KAAcG;AAE3B,SAAAC,SAAAC,IAAA;CAAA,MAAAC,IAAAR,EAAA,CAAA;CAAA,IAAAS;CAAA,IAAAC;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I;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAPFI;AAOE;AAIN,SAAAE,YAAAP,IAAA;CAAA,MAAAC,IAAAR,EAAA,CAAA;CAAA,IAAAS;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAE,WAAA,GAAAC,SAAAH;EAA2EC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,YAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAC,WAAA;EAI/EE,KAAAP,GACT,wFACAK,SACF;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAE,SAAAF,EAAA,OAAAG,IAAA;EALHC,KAAA,oBAAAI,KAAA,SAAA;GACY,aAAA;GACC,WAAAL;GAGV,GACGD;EAAK,CAAA;EACTF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAPFI;AAOE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const textareaVariants: (props?: ({
|
|
4
|
+
variant?: "secondary" | "default" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "xs" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Textarea({ className, variant, size, ...props }: React.ComponentProps<"textarea"> & VariantProps<typeof textareaVariants>): React.JSX.Element;
|
|
8
|
+
export { Textarea, textareaVariants };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cn } from "../../style/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
// src/ui/components/textarea.tsx
|
|
5
|
+
var textareaVariants = cva("flex w-full rounded-secondary text-sm outline-none transition-[color,box-shadow] placeholder:text-muted-foreground hc:placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 aria-invalid:border-destructive hc:aria-invalid:border-destructive aria-invalid:ring-destructive/20", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-card text-card-foreground placeholder:text-card-foreground/60 hc:border hc:border-border",
|
|
9
|
+
outline: "border border-border bg-input/30",
|
|
10
|
+
secondary: "bg-secondary text-secondary-foreground placeholder:text-secondary-foreground/60 hc:border hc:border-border",
|
|
11
|
+
ghost: "bg-transparent"
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: "min-h-16 px-3 py-2",
|
|
15
|
+
xs: "min-h-10 px-2.5 py-1.5 text-xs",
|
|
16
|
+
sm: "min-h-12 px-3 py-1.5",
|
|
17
|
+
lg: "min-h-24 px-4 py-2.5"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
size: "default"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function Textarea({ className, variant = "default", size = "default", ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
27
|
+
"data-slot": "textarea",
|
|
28
|
+
"data-variant": variant,
|
|
29
|
+
"data-size": size,
|
|
30
|
+
className: cn(textareaVariants({
|
|
31
|
+
variant,
|
|
32
|
+
size,
|
|
33
|
+
className
|
|
34
|
+
})),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export { Textarea, textareaVariants };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/ui/components/textarea.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\nconst textareaVariants = cva(\n \"flex w-full rounded-secondary text-sm outline-none transition-[color,box-shadow] placeholder:text-muted-foreground hc:placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 aria-invalid:border-destructive hc:aria-invalid:border-destructive aria-invalid:ring-destructive/20\",\n {\n variants: {\n variant: {\n default:\n \"bg-card text-card-foreground placeholder:text-card-foreground/60 hc:border hc:border-border\",\n outline: \"border border-border bg-input/30\",\n secondary:\n \"bg-secondary text-secondary-foreground placeholder:text-secondary-foreground/60 hc:border hc:border-border\",\n ghost: \"bg-transparent\",\n },\n size: {\n default: \"min-h-16 px-3 py-2\",\n xs: \"min-h-10 px-2.5 py-1.5 text-xs\",\n sm: \"min-h-12 px-3 py-1.5\",\n lg: \"min-h-24 px-4 py-2.5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Textarea({\n className,\n variant = \"default\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"textarea\"> & VariantProps<typeof textareaVariants>) {\n return (\n <textarea\n data-slot=\"textarea\"\n data-variant={variant}\n data-size={size}\n className={cn(textareaVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Textarea, textareaVariants };\n"],"mappings":";;;;AAIA,IAAM,mBAAmB,IACvB,qZACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,SAAS;GACT,WACE;GACF,OAAO;EACT;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAEA,SAAS,SAAS,EAChB,WACA,UAAU,WACV,OAAO,WACP,GAAG,SACwE;CAC3E,OACE,oBAAC,YAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GAAG,iBAAiB;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC5D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
declare const toastVariants: (props?: ({
|
|
3
|
+
variant?: "default" | "error" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
type ToastProps = VariantProps<typeof toastVariants> & {
|
|
6
|
+
open: boolean;
|
|
7
|
+
onOpenChange: (open: boolean) => void;
|
|
8
|
+
text: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function Toast({ open, onOpenChange, text, variant, duration, className, }: ToastProps): import("react").ReactPortal | null;
|
|
13
|
+
export { Toast };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { useBrucksLabels } from "../lib/labels.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { Toast } from "radix-ui";
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { Cancel01Icon } from "@hugeicons/core-free-icons";
|
|
10
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
11
|
+
import { createPortal } from "react-dom";
|
|
12
|
+
// src/ui/components/toast.tsx
|
|
13
|
+
var toastVariants = cva("pointer-events-auto flex items-start gap-3 rounded-primary border border-border border-l-4 bg-accent p-3 text-sm leading-relaxed shadow-lg outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform data-[swipe=end]:animate-out data-[swipe=end]:fade-out", {
|
|
14
|
+
variants: { variant: {
|
|
15
|
+
default: "border-l-theme-500",
|
|
16
|
+
error: "border-l-destructive"
|
|
17
|
+
} },
|
|
18
|
+
defaultVariants: { variant: "default" }
|
|
19
|
+
});
|
|
20
|
+
function Toast$1(t0) {
|
|
21
|
+
const $ = c(25);
|
|
22
|
+
const { open, onOpenChange, text, variant: t1, duration: t2, className } = t0;
|
|
23
|
+
const variant = t1 === void 0 ? "default" : t1;
|
|
24
|
+
const duration = t2 === void 0 ? 5e3 : t2;
|
|
25
|
+
const labels = useBrucksLabels();
|
|
26
|
+
const [mounted, setMounted] = useState(false);
|
|
27
|
+
const [session, setSession] = useState(0);
|
|
28
|
+
const [wasOpen, setWasOpen] = useState(open);
|
|
29
|
+
if (open !== wasOpen) {
|
|
30
|
+
setWasOpen(open);
|
|
31
|
+
if (open) setSession(_temp);
|
|
32
|
+
}
|
|
33
|
+
let t3;
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
|
+
t3 = () => {
|
|
37
|
+
setMounted(true);
|
|
38
|
+
};
|
|
39
|
+
t4 = [];
|
|
40
|
+
$[0] = t3;
|
|
41
|
+
$[1] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[0];
|
|
44
|
+
t4 = $[1];
|
|
45
|
+
}
|
|
46
|
+
useEffect(t3, t4);
|
|
47
|
+
if (!mounted) return null;
|
|
48
|
+
const t5 = labels.notification;
|
|
49
|
+
let t6;
|
|
50
|
+
if ($[2] !== className || $[3] !== variant) {
|
|
51
|
+
t6 = cn(toastVariants({
|
|
52
|
+
variant,
|
|
53
|
+
className
|
|
54
|
+
}));
|
|
55
|
+
$[2] = className;
|
|
56
|
+
$[3] = variant;
|
|
57
|
+
$[4] = t6;
|
|
58
|
+
} else t6 = $[4];
|
|
59
|
+
let t7;
|
|
60
|
+
if ($[5] !== text) {
|
|
61
|
+
t7 = /* @__PURE__ */ jsx(Toast.Description, {
|
|
62
|
+
className: "min-w-0 flex-1 italic",
|
|
63
|
+
children: text
|
|
64
|
+
});
|
|
65
|
+
$[5] = text;
|
|
66
|
+
$[6] = t7;
|
|
67
|
+
} else t7 = $[6];
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
+
t8 = /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
71
|
+
icon: Cancel01Icon,
|
|
72
|
+
className: "size-4",
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
});
|
|
75
|
+
$[7] = t8;
|
|
76
|
+
} else t8 = $[7];
|
|
77
|
+
let t9;
|
|
78
|
+
if ($[8] !== labels.close) {
|
|
79
|
+
t9 = /* @__PURE__ */ jsx(Toast.Close, {
|
|
80
|
+
"aria-label": labels.close,
|
|
81
|
+
className: "shrink-0 cursor-pointer rounded-secondary text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
82
|
+
children: t8
|
|
83
|
+
});
|
|
84
|
+
$[8] = labels.close;
|
|
85
|
+
$[9] = t9;
|
|
86
|
+
} else t9 = $[9];
|
|
87
|
+
let t10;
|
|
88
|
+
if ($[10] !== onOpenChange || $[11] !== open || $[12] !== t6 || $[13] !== t7 || $[14] !== t9 || $[15] !== variant) {
|
|
89
|
+
t10 = /* @__PURE__ */ jsxs(Toast.Root, {
|
|
90
|
+
open,
|
|
91
|
+
onOpenChange,
|
|
92
|
+
"data-slot": "toast",
|
|
93
|
+
"data-variant": variant,
|
|
94
|
+
className: t6,
|
|
95
|
+
children: [t7, t9]
|
|
96
|
+
});
|
|
97
|
+
$[10] = onOpenChange;
|
|
98
|
+
$[11] = open;
|
|
99
|
+
$[12] = t6;
|
|
100
|
+
$[13] = t7;
|
|
101
|
+
$[14] = t9;
|
|
102
|
+
$[15] = variant;
|
|
103
|
+
$[16] = t10;
|
|
104
|
+
} else t10 = $[16];
|
|
105
|
+
let t11;
|
|
106
|
+
if ($[17] !== labels.notifications) {
|
|
107
|
+
t11 = /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
108
|
+
label: labels.notifications,
|
|
109
|
+
className: "pointer-events-none fixed bottom-0 right-0 z-popover flex max-w-[calc(100vw-2rem)] w-96 flex-col gap-2 p-4 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
110
|
+
});
|
|
111
|
+
$[17] = labels.notifications;
|
|
112
|
+
$[18] = t11;
|
|
113
|
+
} else t11 = $[18];
|
|
114
|
+
let t12;
|
|
115
|
+
if ($[19] !== duration || $[20] !== labels.notification || $[21] !== session || $[22] !== t10 || $[23] !== t11) {
|
|
116
|
+
t12 = createPortal(/* @__PURE__ */ jsxs(Toast.Provider, {
|
|
117
|
+
swipeDirection: "right",
|
|
118
|
+
duration,
|
|
119
|
+
label: t5,
|
|
120
|
+
children: [t10, t11]
|
|
121
|
+
}, session), document.body);
|
|
122
|
+
$[19] = duration;
|
|
123
|
+
$[20] = labels.notification;
|
|
124
|
+
$[21] = session;
|
|
125
|
+
$[22] = t10;
|
|
126
|
+
$[23] = t11;
|
|
127
|
+
$[24] = t12;
|
|
128
|
+
} else t12 = $[24];
|
|
129
|
+
return t12;
|
|
130
|
+
}
|
|
131
|
+
function _temp(current) {
|
|
132
|
+
return current + 1;
|
|
133
|
+
}
|
|
134
|
+
export { Toast$1 as Toast };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","names":["c","_c","Cancel01Icon","HugeiconsIcon","cva","VariantProps","Toast","ToastPrimitive","useEffect","useState","createPortal","cn","useBrucksLabels","toastVariants","variants","variant","default","error","defaultVariants","ToastProps","open","onOpenChange","text","duration","className","t0","$","t1","t2","undefined","labels","mounted","setMounted","session","setSession","wasOpen","setWasOpen","_temp","t3","t4","Symbol","for","t5","notification","t6","t7","t8","t9","close","t10","t11","notifications","t12","document","body","current","Toast","_c","ToastPrimitive"],"sources":["../../../src/ui/components/toast.tsx"],"sourcesContent":["\"use client\";\n\nimport { Cancel01Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Toast as ToastPrimitive } from \"radix-ui\";\nimport { useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"~/style/utils\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\nconst toastVariants = cva(\n \"pointer-events-auto flex items-start gap-3 rounded-primary border border-border border-l-4 bg-accent p-3 text-sm leading-relaxed shadow-lg outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform data-[swipe=end]:animate-out data-[swipe=end]:fade-out\",\n {\n variants: {\n variant: {\n default: \"border-l-theme-500\",\n error: \"border-l-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\ntype ToastProps = VariantProps<typeof toastVariants> & {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n text: string;\n duration?: number;\n className?: string;\n};\n\nfunction Toast({\n open,\n onOpenChange,\n text,\n variant = \"default\",\n duration = 5000,\n className,\n}: ToastProps) {\n const labels = useBrucksLabels();\n const [mounted, setMounted] = useState(false);\n // Radix pauses the timer while the pointer is over the viewport and resumes on pointerleave, which\n // never comes when the toast unmounts under the pointer (closed with its X). Its pause flag then\n // sticks to the Provider, so every opening gets a fresh one.\n const [session, setSession] = useState(0);\n const [wasOpen, setWasOpen] = useState(open);\n if (open !== wasOpen) {\n setWasOpen(open);\n if (open) setSession((current) => current + 1);\n }\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) return null;\n\n return createPortal(\n <ToastPrimitive.Provider\n key={session}\n swipeDirection=\"right\"\n duration={duration}\n label={labels.notification}\n >\n <ToastPrimitive.Root\n open={open}\n onOpenChange={onOpenChange}\n data-slot=\"toast\"\n data-variant={variant}\n className={cn(toastVariants({ variant, className }))}\n >\n <ToastPrimitive.Description className=\"min-w-0 flex-1 italic\">\n {text}\n </ToastPrimitive.Description>\n <ToastPrimitive.Close\n aria-label={labels.close}\n className=\"shrink-0 cursor-pointer rounded-secondary text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n >\n <HugeiconsIcon icon={Cancel01Icon} className=\"size-4\" aria-hidden=\"true\" />\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n <ToastPrimitive.Viewport\n label={labels.notifications}\n className=\"pointer-events-none fixed bottom-0 right-0 z-popover flex max-w-[calc(100vw-2rem)] w-96 flex-col gap-2 p-4 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n />\n </ToastPrimitive.Provider>,\n document.body,\n );\n}\n\nexport { Toast };\n"],"mappings":";;;;;;;;;;;;AAWA,IAAMa,gBAAgBT,IACpB,2kBACA;CACEU,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,OAAO;CACT,EACF;CACAC,iBAAiB,EACfH,SAAS,UACX;AACF,CACF;AAUA,SAAAT,QAAAmB,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAe,MAAA,EAAAmB,MAAAC,cAAAC,MAAAP,SAAAY,IAAAJ,UAAAK,IAAAJ,cAAAC;CAIb,MAAAV,UAAAY,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAAJ,WAAAK,OAAAC,KAAAA,IAAA,MAAAD;CAGA,MAAAE,SAAelB,gBAAgB;CAC/B,MAAA,CAAAmB,SAAAC,cAA8B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B;EAAAxB,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,OA9BM0B;AA8BN;AAxDH,SAAAf,MAAAkB,SAAA;CAAA,OAiBsCA,UAAU;AAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type IconSvgElement } from "@hugeicons/react";
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
4
|
+
import { type ComponentProps } from "react";
|
|
5
|
+
import { toggleVariants } from "./toggle";
|
|
6
|
+
declare function ToggleGroup({ className, variant, size, children, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
|
|
7
|
+
declare function ToggleGroupItem({ className, variant, size, icon, iconClassName, children, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants> & {
|
|
8
|
+
icon?: IconSvgElement;
|
|
9
|
+
iconClassName?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export { ToggleGroup, ToggleGroupItem };
|