@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,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { toggleVariants } from "./toggle.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { ToggleGroup } from "radix-ui";
|
|
6
|
+
import { createContext, useContext } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
9
|
+
// src/ui/components/toggle-group.tsx
|
|
10
|
+
var ToggleGroupContext = createContext({
|
|
11
|
+
variant: "default",
|
|
12
|
+
size: "default"
|
|
13
|
+
});
|
|
14
|
+
function ToggleGroup$1(t0) {
|
|
15
|
+
const $ = c(20);
|
|
16
|
+
let children;
|
|
17
|
+
let className;
|
|
18
|
+
let props;
|
|
19
|
+
let t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({className, variant: t1, size: t2, children, ...props} = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = children;
|
|
25
|
+
$[2] = className;
|
|
26
|
+
$[3] = props;
|
|
27
|
+
$[4] = t1;
|
|
28
|
+
$[5] = t2;
|
|
29
|
+
} else {
|
|
30
|
+
children = $[1];
|
|
31
|
+
className = $[2];
|
|
32
|
+
props = $[3];
|
|
33
|
+
t1 = $[4];
|
|
34
|
+
t2 = $[5];
|
|
35
|
+
}
|
|
36
|
+
const variant = t1 === void 0 ? "default" : t1;
|
|
37
|
+
const size = t2 === void 0 ? "default" : t2;
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[6] !== className) {
|
|
40
|
+
t3 = cn("group/toggle-group flex w-fit items-center rounded-secondary isolate", className);
|
|
41
|
+
$[6] = className;
|
|
42
|
+
$[7] = t3;
|
|
43
|
+
} else t3 = $[7];
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[8] !== size || $[9] !== variant) {
|
|
46
|
+
t4 = {
|
|
47
|
+
variant,
|
|
48
|
+
size
|
|
49
|
+
};
|
|
50
|
+
$[8] = size;
|
|
51
|
+
$[9] = variant;
|
|
52
|
+
$[10] = t4;
|
|
53
|
+
} else t4 = $[10];
|
|
54
|
+
let t5;
|
|
55
|
+
if ($[11] !== children || $[12] !== t4) {
|
|
56
|
+
t5 = /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
|
|
57
|
+
value: t4,
|
|
58
|
+
children
|
|
59
|
+
});
|
|
60
|
+
$[11] = children;
|
|
61
|
+
$[12] = t4;
|
|
62
|
+
$[13] = t5;
|
|
63
|
+
} else t5 = $[13];
|
|
64
|
+
let t6;
|
|
65
|
+
if ($[14] !== props || $[15] !== size || $[16] !== t3 || $[17] !== t5 || $[18] !== variant) {
|
|
66
|
+
t6 = /* @__PURE__ */ jsx(ToggleGroup.Root, {
|
|
67
|
+
"data-slot": "toggle-group",
|
|
68
|
+
"data-variant": variant,
|
|
69
|
+
"data-size": size,
|
|
70
|
+
className: t3,
|
|
71
|
+
...props,
|
|
72
|
+
children: t5
|
|
73
|
+
});
|
|
74
|
+
$[14] = props;
|
|
75
|
+
$[15] = size;
|
|
76
|
+
$[16] = t3;
|
|
77
|
+
$[17] = t5;
|
|
78
|
+
$[18] = variant;
|
|
79
|
+
$[19] = t6;
|
|
80
|
+
} else t6 = $[19];
|
|
81
|
+
return t6;
|
|
82
|
+
}
|
|
83
|
+
function ToggleGroupItem(t0) {
|
|
84
|
+
const $ = c(22);
|
|
85
|
+
let children;
|
|
86
|
+
let className;
|
|
87
|
+
let icon;
|
|
88
|
+
let props;
|
|
89
|
+
let size;
|
|
90
|
+
let t1;
|
|
91
|
+
let variant;
|
|
92
|
+
if ($[0] !== t0) {
|
|
93
|
+
({className, variant, size, icon, iconClassName: t1, children, ...props} = t0);
|
|
94
|
+
$[0] = t0;
|
|
95
|
+
$[1] = children;
|
|
96
|
+
$[2] = className;
|
|
97
|
+
$[3] = icon;
|
|
98
|
+
$[4] = props;
|
|
99
|
+
$[5] = size;
|
|
100
|
+
$[6] = t1;
|
|
101
|
+
$[7] = variant;
|
|
102
|
+
} else {
|
|
103
|
+
children = $[1];
|
|
104
|
+
className = $[2];
|
|
105
|
+
icon = $[3];
|
|
106
|
+
props = $[4];
|
|
107
|
+
size = $[5];
|
|
108
|
+
t1 = $[6];
|
|
109
|
+
variant = $[7];
|
|
110
|
+
}
|
|
111
|
+
const iconClassName = t1 === void 0 ? "" : t1;
|
|
112
|
+
const context = useContext(ToggleGroupContext);
|
|
113
|
+
const resolvedVariant = variant ?? context.variant;
|
|
114
|
+
const resolvedSize = size ?? context.size;
|
|
115
|
+
let t2;
|
|
116
|
+
if ($[8] !== className || $[9] !== resolvedSize || $[10] !== resolvedVariant) {
|
|
117
|
+
t2 = cn(toggleVariants({
|
|
118
|
+
variant: resolvedVariant,
|
|
119
|
+
size: resolvedSize
|
|
120
|
+
}), "rounded-none first:rounded-l-secondary last:rounded-r-secondary not-first:-ml-px hover:z-10 focus-visible:z-10 data-[state=on]:z-10", className);
|
|
121
|
+
$[8] = className;
|
|
122
|
+
$[9] = resolvedSize;
|
|
123
|
+
$[10] = resolvedVariant;
|
|
124
|
+
$[11] = t2;
|
|
125
|
+
} else t2 = $[11];
|
|
126
|
+
let t3;
|
|
127
|
+
if ($[12] !== icon || $[13] !== iconClassName) {
|
|
128
|
+
t3 = icon ? /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
129
|
+
icon,
|
|
130
|
+
className: iconClassName
|
|
131
|
+
}) : null;
|
|
132
|
+
$[12] = icon;
|
|
133
|
+
$[13] = iconClassName;
|
|
134
|
+
$[14] = t3;
|
|
135
|
+
} else t3 = $[14];
|
|
136
|
+
let t4;
|
|
137
|
+
if ($[15] !== children || $[16] !== props || $[17] !== resolvedSize || $[18] !== resolvedVariant || $[19] !== t2 || $[20] !== t3) {
|
|
138
|
+
t4 = /* @__PURE__ */ jsxs(ToggleGroup.Item, {
|
|
139
|
+
"data-slot": "toggle-group-item",
|
|
140
|
+
"data-variant": resolvedVariant,
|
|
141
|
+
"data-size": resolvedSize,
|
|
142
|
+
className: t2,
|
|
143
|
+
...props,
|
|
144
|
+
children: [t3, children]
|
|
145
|
+
});
|
|
146
|
+
$[15] = children;
|
|
147
|
+
$[16] = props;
|
|
148
|
+
$[17] = resolvedSize;
|
|
149
|
+
$[18] = resolvedVariant;
|
|
150
|
+
$[19] = t2;
|
|
151
|
+
$[20] = t3;
|
|
152
|
+
$[21] = t4;
|
|
153
|
+
} else t4 = $[21];
|
|
154
|
+
return t4;
|
|
155
|
+
}
|
|
156
|
+
export { ToggleGroup$1 as ToggleGroup, ToggleGroupItem };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":["c","_c","HugeiconsIcon","IconSvgElement","VariantProps","ToggleGroup","ToggleGroupPrimitive","ComponentProps","createContext","useContext","cn","toggleVariants","ToggleGroupContext","variant","size","t0","$","children","className","props","t1","t2","undefined","t3","t4","t5","t6","ToggleGroupItem","icon","iconClassName","context","resolvedVariant","resolvedSize","ToggleGroup","_c","ToggleGroupPrimitive"],"sources":["../../../src/ui/components/toggle-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { HugeiconsIcon, type IconSvgElement } from \"@hugeicons/react\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { ToggleGroup as ToggleGroupPrimitive } from \"radix-ui\";\nimport { type ComponentProps, createContext, useContext } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { toggleVariants } from \"~/ui/components/toggle\";\n\nconst ToggleGroupContext = createContext<VariantProps<typeof toggleVariants>>({\n variant: \"default\",\n size: \"default\",\n});\n\nfunction ToggleGroup({\n className,\n variant = \"default\",\n size = \"default\",\n children,\n ...props\n}: ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n className={cn(\n \"group/toggle-group flex w-fit items-center rounded-secondary isolate\",\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n variant,\n size,\n icon,\n iconClassName = \"\",\n children,\n ...props\n}: ComponentProps<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants> & {\n icon?: IconSvgElement;\n iconClassName?: string;\n }) {\n const context = useContext(ToggleGroupContext);\n const resolvedVariant = variant ?? context.variant;\n const resolvedSize = size ?? context.size;\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={resolvedVariant}\n data-size={resolvedSize}\n className={cn(\n toggleVariants({ variant: resolvedVariant, size: resolvedSize }),\n \"rounded-none first:rounded-l-secondary last:rounded-r-secondary not-first:-ml-px hover:z-10 focus-visible:z-10 data-[state=on]:z-10\",\n className,\n )}\n {...props}\n >\n {icon ? <HugeiconsIcon icon={icon} className={iconClassName} /> : null}\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":";;;;;;;;;AASA,IAAMY,qBAAqBJ,cAAmD;CAC5EK,SAAS;CACTC,MAAM;AACR,CAAC;AAED,SAAAT,cAAAU,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAG,WAAAL,SAAAO,IAAAN,MAAAO,IAAAJ,UAAA,GAAAE,SAAAJ;EAMoEC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,WAAAD,EAAA;EAAAE,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAJvF,MAAAH,UAAAO,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAAN,OAAAO,OAAAC,KAAAA,IAAA,YAAAD;CAAgB,IAAAE;CAAA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AAA;GACIJ,gBAAAA;GACHC,aAAAA;GACA,WAAAX;GAIV,GACGF;GATN,UAAA,CAWGI,IACAN,QACH;;EAA4BD,EAAA,MAAAC;EAAAD,EAAA,MAAAG;EAAAH,EAAA,MAAAgB;EAAAhB,EAAA,MAAAe;EAAAf,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAb5BQ;AAa4B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IconSvgElement } from "@hugeicons/react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "icon" | "sm" | "lg" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Toggle({ className, variant, size, icon, iconClassName, children, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
9
|
+
icon: IconSvgElement;
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from "../../style/utils.js";
|
|
2
|
+
import { Toggle } from "radix-ui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
6
|
+
// src/ui/components/toggle.tsx
|
|
7
|
+
var toggleVariants = cva("group/toggle 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 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-transparent hover:bg-muted hover:text-foreground",
|
|
11
|
+
outline: "border border-border bg-input/30 hover:bg-input/50 hover:text-foreground data-[state=on]:border-primary"
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: "h-9 gap-1.5 px-3",
|
|
15
|
+
xs: "h-6 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3",
|
|
16
|
+
sm: "h-8 gap-1 px-3",
|
|
17
|
+
lg: "h-10 gap-1.5 px-4",
|
|
18
|
+
icon: "size-9",
|
|
19
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
+
"icon-sm": "size-8",
|
|
21
|
+
"icon-lg": "size-10"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function Toggle$1({ className, variant = "default", size = "default", icon, iconClassName = "", children, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(Toggle.Root, {
|
|
31
|
+
"data-slot": "toggle",
|
|
32
|
+
"data-variant": variant,
|
|
33
|
+
"data-size": size,
|
|
34
|
+
className: cn(toggleVariants({
|
|
35
|
+
variant,
|
|
36
|
+
size,
|
|
37
|
+
className
|
|
38
|
+
})),
|
|
39
|
+
...props,
|
|
40
|
+
children: [/* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
41
|
+
icon,
|
|
42
|
+
className: iconClassName
|
|
43
|
+
}), children]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export { Toggle$1 as Toggle, toggleVariants };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","names":["Toggle","TogglePrimitive"],"sources":["../../../src/ui/components/toggle.tsx"],"sourcesContent":["import { HugeiconsIcon, type IconSvgElement } from \"@hugeicons/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Toggle as TogglePrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\nconst toggleVariants = cva(\n \"group/toggle 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 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer\",\n {\n variants: {\n variant: {\n default: \"bg-transparent hover:bg-muted hover:text-foreground\",\n outline:\n \"border border-border bg-input/30 hover:bg-input/50 hover:text-foreground data-[state=on]:border-primary\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3\",\n xs: \"h-6 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3\",\n lg: \"h-10 gap-1.5 px-4\",\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 Toggle({\n className,\n variant = \"default\",\n size = \"default\",\n icon,\n iconClassName = \"\",\n children,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants> & {\n icon: IconSvgElement;\n iconClassName?: string;\n }) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n data-variant={variant}\n data-size={size}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n >\n <HugeiconsIcon icon={icon} className={iconClassName} />\n {children}\n </TogglePrimitive.Root>\n );\n}\n\nexport { Toggle, toggleVariants };\n"],"mappings":";;;;;;AAKA,IAAM,iBAAiB,IACrB,2dACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;EACJ;EACA,MAAM;GACJ,SAAS;GACT,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,SAASA,SAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,MACA,gBAAgB,IAChB,UACA,GAAG,SAKA;CACH,OACE,qBAACC,OAAgB,MAAjB;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC1D,GAAI;EALN,UAAA,CAOE,oBAAC,eAAD;GAAqB;GAAM,WAAW;EAAgB,CAAA,GACrD,QACmB;;AAE1B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../style/utils.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Tooltip } from "radix-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/components/tooltip.tsx
|
|
7
|
+
function Tooltip$1(t0) {
|
|
8
|
+
const $ = c(11);
|
|
9
|
+
const { trigger, children, className } = t0;
|
|
10
|
+
let t1;
|
|
11
|
+
if ($[0] !== trigger) {
|
|
12
|
+
t1 = /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
13
|
+
asChild: true,
|
|
14
|
+
onClick: _temp,
|
|
15
|
+
children: trigger
|
|
16
|
+
});
|
|
17
|
+
$[0] = trigger;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
} else t1 = $[1];
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[2] !== className) {
|
|
22
|
+
t2 = cn("z-popover rounded-secondary border border-border bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-[0_0_8px_2px_rgba(0,0,0,0.4),0_4px_6px_-2px_rgba(0,0,0,0.4)] dark:shadow-[0_0_8px_2px_rgba(0,0,0,0.75),0_4px_6px_-2px_rgba(0,0,0,0.75)] outline-none", className);
|
|
23
|
+
$[2] = className;
|
|
24
|
+
$[3] = t2;
|
|
25
|
+
} else t2 = $[3];
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t3 = /* @__PURE__ */ jsx(Tooltip.Arrow, { className: "fill-popover" });
|
|
29
|
+
$[4] = t3;
|
|
30
|
+
} else t3 = $[4];
|
|
31
|
+
let t4;
|
|
32
|
+
if ($[5] !== children || $[6] !== t2) {
|
|
33
|
+
t4 = /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsxs(Tooltip.Content, {
|
|
34
|
+
sideOffset: 8,
|
|
35
|
+
className: t2,
|
|
36
|
+
children: [children, t3]
|
|
37
|
+
}) });
|
|
38
|
+
$[5] = children;
|
|
39
|
+
$[6] = t2;
|
|
40
|
+
$[7] = t4;
|
|
41
|
+
} else t4 = $[7];
|
|
42
|
+
let t5;
|
|
43
|
+
if ($[8] !== t1 || $[9] !== t4) {
|
|
44
|
+
t5 = /* @__PURE__ */ jsx(Tooltip.Provider, {
|
|
45
|
+
delayDuration: 200,
|
|
46
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Root, { children: [t1, t4] })
|
|
47
|
+
});
|
|
48
|
+
$[8] = t1;
|
|
49
|
+
$[9] = t4;
|
|
50
|
+
$[10] = t5;
|
|
51
|
+
} else t5 = $[10];
|
|
52
|
+
return t5;
|
|
53
|
+
}
|
|
54
|
+
function _temp(e) {
|
|
55
|
+
return e.currentTarget.focus();
|
|
56
|
+
}
|
|
57
|
+
export { Tooltip$1 as Tooltip };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["c","_c","Tooltip","TooltipPrimitive","React","cn","TooltipProps","trigger","ReactNode","children","className","t0","$","t1","_temp","t2","t3","Symbol","for","t4","t5","e","currentTarget","focus","Tooltip","_c","TooltipPrimitive"],"sources":["../../../src/ui/components/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\ntype TooltipProps = {\n trigger: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n};\n\nfunction Tooltip({ trigger, children, className }: TooltipProps) {\n return (\n <TooltipPrimitive.Provider delayDuration={200}>\n <TooltipPrimitive.Root>\n <TooltipPrimitive.Trigger asChild onClick={(e) => e.currentTarget.focus()}>\n {trigger}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n sideOffset={8}\n className={cn(\n \"z-popover rounded-secondary border border-border bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-[0_0_8px_2px_rgba(0,0,0,0.4),0_4px_6px_-2px_rgba(0,0,0,0.4)] dark:shadow-[0_0_8px_2px_rgba(0,0,0,0.75),0_4px_6px_-2px_rgba(0,0,0,0.75)] outline-none\",\n className,\n )}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"fill-popover\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.Provider>\n );\n}\n\nexport { Tooltip };\n"],"mappings":";;;;;;AAYA,SAAAE,UAAAS,IAAA;CAAA,MAAAC,IAAAX,EAAA,EAAA;CAAiB,MAAA,EAAAM,SAAAE,UAAAC,cAAAC;CAA8C,IAAAE;CAAA,IAAAD,EAAA,OAAAL,SAAA;EAIvDM,KAAA,oBAAAa,QAAA,SAAA;GAA0B,SAAA;GAAiB,SAAAZ;G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overlay in the Android back button's way for as long as it is open, so
|
|
5
|
+
* back closes it rather than leaving the page under it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCloseOnBack(open: boolean, onClose: () => void): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useEffectEvent } from "react";
|
|
4
|
+
// src/ui/hooks/useCloseOnBack.ts
|
|
5
|
+
/**
|
|
6
|
+
* How to close each overlay open right now, in the order they opened - so the last
|
|
7
|
+
* is the one on top, and the one back takes away first.
|
|
8
|
+
*/
|
|
9
|
+
var openOverlays = [];
|
|
10
|
+
/** Closes the overlay on top, where one is open, and says whether one was. */
|
|
11
|
+
function closeTopmost() {
|
|
12
|
+
const close = openOverlays.at(-1);
|
|
13
|
+
close?.();
|
|
14
|
+
return close !== void 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Puts an overlay in the Android back button's way for as long as it is open, so
|
|
18
|
+
* back closes it rather than leaving the page under it.
|
|
19
|
+
*/
|
|
20
|
+
function useCloseOnBack(open, onClose) {
|
|
21
|
+
const $ = c(5);
|
|
22
|
+
const close = useEffectEvent(onClose);
|
|
23
|
+
let t0;
|
|
24
|
+
if ($[0] !== close || $[1] !== open) {
|
|
25
|
+
t0 = () => {
|
|
26
|
+
if (!open) return;
|
|
27
|
+
openOverlays.push(close);
|
|
28
|
+
return () => {
|
|
29
|
+
openOverlays.splice(openOverlays.indexOf(close), 1);
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
$[0] = close;
|
|
33
|
+
$[1] = open;
|
|
34
|
+
$[2] = t0;
|
|
35
|
+
} else t0 = $[2];
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[3] !== open) {
|
|
38
|
+
t1 = [open];
|
|
39
|
+
$[3] = open;
|
|
40
|
+
$[4] = t1;
|
|
41
|
+
} else t1 = $[4];
|
|
42
|
+
useEffect(t0, t1);
|
|
43
|
+
}
|
|
44
|
+
export { closeTopmost, useCloseOnBack };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=useCloseOnBack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseOnBack.js","names":["c","_c","useEffect","useEffectEvent","openOverlays","Array","closeTopmost","close","at","undefined","useCloseOnBack","open","onClose","$","t0","push","splice","indexOf","t1","_c"],"sources":["../../../src/ui/hooks/useCloseOnBack.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useEffectEvent } from \"react\";\n\n/**\n * How to close each overlay open right now, in the order they opened - so the last\n * is the one on top, and the one back takes away first.\n */\nconst openOverlays: Array<() => void> = [];\n\n/** Closes the overlay on top, where one is open, and says whether one was. */\nexport function closeTopmost() {\n const close = openOverlays.at(-1);\n close?.();\n return close !== undefined;\n}\n\n/**\n * Puts an overlay in the Android back button's way for as long as it is open, so\n * back closes it rather than leaving the page under it.\n */\nexport function useCloseOnBack(open: boolean, onClose: () => void) {\n const close = useEffectEvent(onClose);\n\n useEffect(() => {\n if (!open) return;\n\n openOverlays.push(close);\n return () => {\n openOverlays.splice(openOverlays.indexOf(close), 1);\n };\n }, [open]);\n}\n"],"mappings":";;;;;;;;AAQA,IAAMI,eAAkC,CAAA;;AAGxC,SAAgBE,eAAe;CAC7B,MAAMC,QAAQH,aAAaI,GAAG,EAAE;CAChCD,QAAQ;CACR,OAAOA,UAAUE,KAAAA;AACnB;;;;;AAMA,SAAOC,eAAAC,MAAAC,SAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CACL,MAAAM,QAAcJ,eAAeS,OAAO;CAAE,IAAAE;CAAA,IAAAD,EAAA,OAAAN,SAAAM,EAAA,OAAAF,MAAA;EAE5BG,WAAA;GACR,IAAI,CAACH,MAAI;GAETP,aAAYW,KAAMR,KAAK;GAAC,aACjB;IACLH,aAAYY,OAAQZ,aAAYa,QAASV,KAAK,GAAG,CAAC;GAAC;EACpD;EACFM,EAAA,KAAAN;EAAAM,EAAA,KAAAF;EAAAE,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAF,MAAA;EAAEO,KAAA,CAACP,IAAI;EAACE,EAAA,KAAAF;EAAAE,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAPTX,UAAUY,IAOPI,EAAM;AAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hands focus back to whatever opened the dialog. Radix only does that for its own Trigger, and the
|
|
3
|
+
* controlled brucks dialogs have none, so without this focus drops to <body> on close.
|
|
4
|
+
* Spread the result on the dialog's Content.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useReturnFocus(): {
|
|
7
|
+
onOpenAutoFocus: () => void;
|
|
8
|
+
onCloseAutoFocus: (event: Event) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
// src/ui/hooks/useReturnFocus.ts
|
|
5
|
+
/**
|
|
6
|
+
* Hands focus back to whatever opened the dialog. Radix only does that for its own Trigger, and the
|
|
7
|
+
* controlled brucks dialogs have none, so without this focus drops to <body> on close.
|
|
8
|
+
* Spread the result on the dialog's Content.
|
|
9
|
+
*/
|
|
10
|
+
function useReturnFocus() {
|
|
11
|
+
const $ = c(1);
|
|
12
|
+
const opener = useRef(null);
|
|
13
|
+
let t0;
|
|
14
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
15
|
+
t0 = {
|
|
16
|
+
onOpenAutoFocus: () => {
|
|
17
|
+
opener.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
18
|
+
},
|
|
19
|
+
onCloseAutoFocus: (event) => {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
opener.current?.focus();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
$[0] = t0;
|
|
25
|
+
} else t0 = $[0];
|
|
26
|
+
return t0;
|
|
27
|
+
}
|
|
28
|
+
export { useReturnFocus };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=useReturnFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReturnFocus.js","names":["c","_c","useRef","useReturnFocus","$","opener","t0","Symbol","for","onOpenAutoFocus","current","document","activeElement","HTMLElement","onCloseAutoFocus","event","preventDefault","focus","_c"],"sources":["../../../src/ui/hooks/useReturnFocus.ts"],"sourcesContent":["\"use client\";\n\nimport { useRef } from \"react\";\n\n/**\n * Hands focus back to whatever opened the dialog. Radix only does that for its own Trigger, and the\n * controlled brucks dialogs have none, so without this focus drops to <body> on close.\n * Spread the result on the dialog's Content.\n */\nexport function useReturnFocus() {\n const opener = useRef<HTMLElement | null>(null);\n\n return {\n onOpenAutoFocus: () => {\n opener.current =\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\n },\n onCloseAutoFocus: (event: Event) => {\n event.preventDefault();\n opener.current?.focus();\n },\n };\n}\n"],"mappings":";;;;;;;;;AASA,SAAOG,iBAAA;CAAA,MAAAC,IAAAH,EAAA,CAAA;CACL,MAAAI,SAAeH,OAA2B,IAAI;CAAE,IAAAI;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAEzCF,KAAA;GAAAG,uBACY;IACfJ,OAAMK,UACJC,SAAQC,yBAA0BC,cAAcF,SAAQC,gBAAxD;GADY;GAEfE,mBACiBC,UAAA;IAChBA,MAAKC,eAAgB;IACrBX,OAAMK,SAAeO,MAAC;GAAC;EAE3B;EAACb,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OATME;AASN"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { Accordion, AccordionGroup, type HeadingLevel } from "./components/accordion";
|
|
2
|
+
export { AlertDialog } from "./components/alertDialog";
|
|
3
|
+
export { Button, buttonVariants } from "./components/button";
|
|
4
|
+
export { Checkbox } from "./components/checkbox";
|
|
5
|
+
export { Chip } from "./components/chip";
|
|
6
|
+
export { Collapsible } from "./components/collapsible";
|
|
7
|
+
export { Drawer } from "./components/drawer";
|
|
8
|
+
export { Fab, fabVariants } from "./components/fab";
|
|
9
|
+
export { Form, FormControl, FormField, FormLabel, FormMessage } from "./components/form";
|
|
10
|
+
export { AppIcon } from "./components/icon";
|
|
11
|
+
export { Input, inputVariants } from "./components/input";
|
|
12
|
+
export { default as Loader } from "./components/loader";
|
|
13
|
+
export { Modal, useModalCloseIcon } from "./components/modal";
|
|
14
|
+
export { Note } from "./components/note";
|
|
15
|
+
export { Popover, PopoverClose } from "./components/popover";
|
|
16
|
+
export { Progress } from "./components/progress";
|
|
17
|
+
export { RadioGroup, RadioGroupItem } from "./components/radioGroup";
|
|
18
|
+
export { ScrollArea, ScrollBar } from "./components/scrollArea";
|
|
19
|
+
export { Select } from "./components/select";
|
|
20
|
+
export { Separator } from "./components/separator";
|
|
21
|
+
export { Slider } from "./components/slider";
|
|
22
|
+
export { SortableList } from "./components/sortableList";
|
|
23
|
+
export { SortableListRow } from "./components/sortableListRow";
|
|
24
|
+
export { Switch } from "./components/switch";
|
|
25
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs";
|
|
26
|
+
export { Textarea, textareaVariants } from "./components/textarea";
|
|
27
|
+
export { Toast } from "./components/toast";
|
|
28
|
+
export { Toggle, toggleVariants } from "./components/toggle";
|
|
29
|
+
export { ToggleGroup, ToggleGroupItem } from "./components/toggle-group";
|
|
30
|
+
export { Tooltip } from "./components/tooltip";
|
|
31
|
+
export { closeTopmost, useCloseOnBack } from "./hooks/useCloseOnBack";
|
|
32
|
+
export { type BrucksLabels, defaultLabels } from "./lib/defaultLabels";
|
|
33
|
+
export { BrucksProvider, useBrucksLabels } from "./lib/labels";
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Accordion, AccordionGroup } from "./components/accordion.js";
|
|
2
|
+
import { Button, buttonVariants } from "./components/button.js";
|
|
3
|
+
import { closeTopmost, useCloseOnBack } from "./hooks/useCloseOnBack.js";
|
|
4
|
+
import { AlertDialog } from "./components/alertDialog.js";
|
|
5
|
+
import { Checkbox } from "./components/checkbox.js";
|
|
6
|
+
import { AppIcon } from "./components/icon.js";
|
|
7
|
+
import { Chip } from "./components/chip.js";
|
|
8
|
+
import { Collapsible } from "./components/collapsible.js";
|
|
9
|
+
import { defaultLabels } from "./lib/defaultLabels.js";
|
|
10
|
+
import { BrucksProvider, useBrucksLabels } from "./lib/labels.js";
|
|
11
|
+
import { Drawer } from "./components/drawer.js";
|
|
12
|
+
import { Fab, fabVariants } from "./components/fab.js";
|
|
13
|
+
import { Form, FormControl, FormField, FormLabel, FormMessage } from "./components/form.js";
|
|
14
|
+
import { Input, inputVariants } from "./components/input.js";
|
|
15
|
+
import Loader from "./components/loader.js";
|
|
16
|
+
import { Modal, useModalCloseIcon } from "./components/modal.js";
|
|
17
|
+
import { Note } from "./components/note.js";
|
|
18
|
+
import { Popover, PopoverClose } from "./components/popover.js";
|
|
19
|
+
import { Progress } from "./components/progress.js";
|
|
20
|
+
import { RadioGroup, RadioGroupItem } from "./components/radioGroup.js";
|
|
21
|
+
import { ScrollArea, ScrollBar } from "./components/scrollArea.js";
|
|
22
|
+
import { Select } from "./components/select.js";
|
|
23
|
+
import { Separator } from "./components/separator.js";
|
|
24
|
+
import { Slider } from "./components/slider.js";
|
|
25
|
+
import { SortableListRow } from "./components/sortableListRow.js";
|
|
26
|
+
import { SortableList } from "./components/sortableList.js";
|
|
27
|
+
import { Switch } from "./components/switch.js";
|
|
28
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs.js";
|
|
29
|
+
import { Textarea, textareaVariants } from "./components/textarea.js";
|
|
30
|
+
import { Toast } from "./components/toast.js";
|
|
31
|
+
import { Toggle, toggleVariants } from "./components/toggle.js";
|
|
32
|
+
import { ToggleGroup, ToggleGroupItem } from "./components/toggle-group.js";
|
|
33
|
+
import { Tooltip } from "./components/tooltip.js";
|
|
34
|
+
export { Accordion, AccordionGroup, AlertDialog, AppIcon, BrucksProvider, Button, Checkbox, Chip, Collapsible, Drawer, Fab, Form, FormControl, FormField, FormLabel, FormMessage, Input, Loader, Modal, Note, Popover, PopoverClose, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, Separator, Slider, SortableList, SortableListRow, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, buttonVariants, closeTopmost, defaultLabels, fabVariants, inputVariants, textareaVariants, toggleVariants, useBrucksLabels, useCloseOnBack, useModalCloseIcon };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the components speak for themselves - screen reader names and
|
|
3
|
+
* announcements. The library ships no translations, so an app hands its own in
|
|
4
|
+
* through `BrucksProvider`, usually straight from its i18n `t`.
|
|
5
|
+
*
|
|
6
|
+
* Kept out of the "use client" provider module, so a Server Component reading the
|
|
7
|
+
* defaults gets the object rather than a client reference.
|
|
8
|
+
*/
|
|
9
|
+
export type BrucksLabels = {
|
|
10
|
+
close: string;
|
|
11
|
+
dialog: string;
|
|
12
|
+
/** Names the Drawer, and Header's action button. */
|
|
13
|
+
menu: string;
|
|
14
|
+
dragToReorder: string;
|
|
15
|
+
reorderAnnouncement: (values: {
|
|
16
|
+
item: string;
|
|
17
|
+
position: number;
|
|
18
|
+
total: number;
|
|
19
|
+
}) => string;
|
|
20
|
+
/** Spoken before a toast's text. */
|
|
21
|
+
notification: string;
|
|
22
|
+
/** Names the toast region; Radix replaces `{hotkey}` with the key that focuses it. */
|
|
23
|
+
notifications: string;
|
|
24
|
+
/** How to sort with the keyboard, read when a drag handle is focused. */
|
|
25
|
+
dragInstructions: string;
|
|
26
|
+
/** Names ScrollToTopFab. */
|
|
27
|
+
scrollToTop: string;
|
|
28
|
+
/** AppLayout's skip link to `main`. */
|
|
29
|
+
skipToContent: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const defaultLabels: BrucksLabels;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/ui/lib/defaultLabels.ts
|
|
2
|
+
var defaultLabels = {
|
|
3
|
+
close: "Close",
|
|
4
|
+
dialog: "Dialog",
|
|
5
|
+
menu: "Menu",
|
|
6
|
+
dragToReorder: "Drag to reorder",
|
|
7
|
+
reorderAnnouncement: ({ item, position, total }) => `${item} moved to position ${position} of ${total}`,
|
|
8
|
+
notification: "Notification",
|
|
9
|
+
notifications: "Notifications ({hotkey})",
|
|
10
|
+
dragInstructions: "To pick up an item, press Space or Enter. Move it with the arrow keys, press Space or Enter again to drop it, or Escape to cancel.",
|
|
11
|
+
scrollToTop: "Scroll back to top",
|
|
12
|
+
skipToContent: "Skip to content"
|
|
13
|
+
};
|
|
14
|
+
export { defaultLabels };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=defaultLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultLabels.js","names":[],"sources":["../../../src/ui/lib/defaultLabels.ts"],"sourcesContent":["/**\n * The words the components speak for themselves - screen reader names and\n * announcements. The library ships no translations, so an app hands its own in\n * through `BrucksProvider`, usually straight from its i18n `t`.\n *\n * Kept out of the \"use client\" provider module, so a Server Component reading the\n * defaults gets the object rather than a client reference.\n */\nexport type BrucksLabels = {\n close: string;\n dialog: string;\n /** Names the Drawer, and Header's action button. */\n menu: string;\n dragToReorder: string;\n reorderAnnouncement: (values: { item: string; position: number; total: number }) => string;\n /** Spoken before a toast's text. */\n notification: string;\n /** Names the toast region; Radix replaces `{hotkey}` with the key that focuses it. */\n notifications: string;\n /** How to sort with the keyboard, read when a drag handle is focused. */\n dragInstructions: string;\n /** Names ScrollToTopFab. */\n scrollToTop: string;\n /** AppLayout's skip link to `main`. */\n skipToContent: string;\n};\n\nexport const defaultLabels: BrucksLabels = {\n close: \"Close\",\n dialog: \"Dialog\",\n menu: \"Menu\",\n dragToReorder: \"Drag to reorder\",\n reorderAnnouncement: ({ item, position, total }) =>\n `${item} moved to position ${position} of ${total}`,\n notification: \"Notification\",\n notifications: \"Notifications ({hotkey})\",\n dragInstructions:\n \"To pick up an item, press Space or Enter. Move it with the arrow keys, press Space or Enter again to drop it, or Escape to cancel.\",\n scrollToTop: \"Scroll back to top\",\n skipToContent: \"Skip to content\",\n};\n"],"mappings":";AA2BA,IAAa,gBAA8B;CACzC,OAAO;CACP,QAAQ;CACR,MAAM;CACN,eAAe;CACf,sBAAsB,EAAE,MAAM,UAAU,YACtC,GAAG,KAAK,qBAAqB,SAAS,MAAM;CAC9C,cAAc;CACd,eAAe;CACf,kBACE;CACF,aAAa;CACb,eAAe;AACjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type BrucksLabels } from "./defaultLabels";
|
|
3
|
+
type BrucksProviderProps = {
|
|
4
|
+
/** Any label left out falls back to the English default. */
|
|
5
|
+
labels?: Partial<BrucksLabels>;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function BrucksProvider({ labels, children }: BrucksProviderProps): import("react").JSX.Element;
|
|
9
|
+
export declare function useBrucksLabels(): BrucksLabels;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defaultLabels } from "./defaultLabels.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/ui/lib/labels.tsx
|
|
7
|
+
var LabelsContext = createContext(defaultLabels);
|
|
8
|
+
function BrucksProvider(t0) {
|
|
9
|
+
const $ = c(5);
|
|
10
|
+
const { labels, children } = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== labels) {
|
|
13
|
+
t1 = {
|
|
14
|
+
...defaultLabels,
|
|
15
|
+
...labels
|
|
16
|
+
};
|
|
17
|
+
$[0] = labels;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
} else t1 = $[1];
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[2] !== children || $[3] !== t1) {
|
|
22
|
+
t2 = /* @__PURE__ */ jsx(LabelsContext.Provider, {
|
|
23
|
+
value: t1,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
$[2] = children;
|
|
27
|
+
$[3] = t1;
|
|
28
|
+
$[4] = t2;
|
|
29
|
+
} else t2 = $[4];
|
|
30
|
+
return t2;
|
|
31
|
+
}
|
|
32
|
+
function useBrucksLabels() {
|
|
33
|
+
return useContext(LabelsContext);
|
|
34
|
+
}
|
|
35
|
+
export { BrucksProvider, useBrucksLabels };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","names":["c","_c","createContext","ReactNode","useContext","BrucksLabels","defaultLabels","LabelsContext","BrucksProviderProps","labels","Partial","children","BrucksProvider","t0","$","t1","t2","useBrucksLabels","_c"],"sources":["../../../src/ui/lib/labels.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, type ReactNode, useContext } from \"react\";\nimport { type BrucksLabels, defaultLabels } from \"~/ui/lib/defaultLabels\";\n\nconst LabelsContext = createContext<BrucksLabels>(defaultLabels);\n\ntype BrucksProviderProps = {\n /** Any label left out falls back to the English default. */\n labels?: Partial<BrucksLabels>;\n children: ReactNode;\n};\n\nexport function BrucksProvider({ labels, children }: BrucksProviderProps) {\n return (\n <LabelsContext.Provider value={{ ...defaultLabels, ...labels }}>\n {children}\n </LabelsContext.Provider>\n );\n}\n\nexport function useBrucksLabels() {\n return useContext(LabelsContext);\n}\n"],"mappings":";;;;;;AAKA,IAAMO,gBAAgBL,cAA4BI,aAAa;AAQ/D,SAAOM,eAAAC,IAAA;CAAA,MAAAC,IAAAb,EAAA,CAAA;CAAwB,MAAA,EAAAQ,QAAAE,aAAAE;CAAyC,IAAAE;CAAA,IAAAD,EAAA,OAAAL,QAAA;EAErCM,KAAA;GAAA,GAAKT;GAAa,GAAKG;EAAO;EAACK,EAAA,KAAAL;EAAAK,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAH,YAAAG,EAAA,OAAAC,IAAA;EAA9DC,KAAA,oBAAA,cAAA,UAAA;GAA+B,OAAAD;GAC5BJ;EACH,CAAA;EAAyBG,EAAA,KAAAH;EAAAG,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAFzBE;AAEyB;AAI7B,SAAOC,kBAAA;CAAA,OACEb,WAAWG,aAAa;AAAC"}
|