@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.
Files changed (162) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +278 -2
  3. package/dist/blucks/components/homeCard.d.ts +27 -0
  4. package/dist/blucks/components/homeCard.js +53 -0
  5. package/dist/blucks/components/homeCard.js.map +1 -0
  6. package/dist/blucks/components/loader.css +169 -0
  7. package/dist/blucks/components/loader.d.ts +16 -0
  8. package/dist/blucks/components/loader.js +28 -0
  9. package/dist/blucks/components/loader.js.map +1 -0
  10. package/dist/blucks/components/scrollToTopFab.css +9 -0
  11. package/dist/blucks/components/scrollToTopFab.d.ts +17 -0
  12. package/dist/blucks/components/scrollToTopFab.js +188 -0
  13. package/dist/blucks/components/scrollToTopFab.js.map +1 -0
  14. package/dist/blucks/components/settingsPickerModal.d.ts +11 -0
  15. package/dist/blucks/components/settingsPickerModal.js +49 -0
  16. package/dist/blucks/components/settingsPickerModal.js.map +1 -0
  17. package/dist/blucks/components/settingsRow.d.ts +12 -0
  18. package/dist/blucks/components/settingsRow.js +34 -0
  19. package/dist/blucks/components/settingsRow.js.map +1 -0
  20. package/dist/blucks/components/settingsSection.d.ts +8 -0
  21. package/dist/blucks/components/settingsSection.js +19 -0
  22. package/dist/blucks/components/settingsSection.js.map +1 -0
  23. package/dist/blucks/components/settingsSwatchButton.d.ts +10 -0
  24. package/dist/blucks/components/settingsSwatchButton.js +38 -0
  25. package/dist/blucks/components/settingsSwatchButton.js.map +1 -0
  26. package/dist/blucks/hooks/useDisclosure.d.ts +5 -0
  27. package/dist/blucks/hooks/useDisclosure.js +34 -0
  28. package/dist/blucks/hooks/useDisclosure.js.map +1 -0
  29. package/dist/blucks/hooks/useScrollAncestor.d.ts +3 -0
  30. package/dist/blucks/hooks/useScrollAncestor.js +40 -0
  31. package/dist/blucks/hooks/useScrollAncestor.js.map +1 -0
  32. package/dist/blucks/index.d.ts +13 -0
  33. package/dist/blucks/index.js +14 -0
  34. package/dist/blucks/layout/appLayout.d.ts +16 -0
  35. package/dist/blucks/layout/appLayout.js +93 -0
  36. package/dist/blucks/layout/appLayout.js.map +1 -0
  37. package/dist/blucks/layout/footer.d.ts +7 -0
  38. package/dist/blucks/layout/footer.js +18 -0
  39. package/dist/blucks/layout/footer.js.map +1 -0
  40. package/dist/blucks/layout/header.d.ts +22 -0
  41. package/dist/blucks/layout/header.js +121 -0
  42. package/dist/blucks/layout/header.js.map +1 -0
  43. package/dist/blucks/lib/utils.d.ts +6 -0
  44. package/dist/blucks/lib/utils.js +12 -0
  45. package/dist/blucks/lib/utils.js.map +1 -0
  46. package/dist/style/index.d.ts +4 -0
  47. package/dist/style/index.js +5 -0
  48. package/dist/style/settings.d.ts +105 -0
  49. package/dist/style/settings.js +156 -0
  50. package/dist/style/settings.js.map +1 -0
  51. package/dist/style/styles.d.ts +6 -0
  52. package/dist/style/styles.js +10 -0
  53. package/dist/style/styles.js.map +1 -0
  54. package/dist/style/theme.css +1259 -0
  55. package/dist/style/types.d.ts +6 -0
  56. package/dist/style/types.js +9 -0
  57. package/dist/style/types.js.map +1 -0
  58. package/dist/style/utils.d.ts +2 -0
  59. package/dist/style/utils.js +28 -0
  60. package/dist/style/utils.js.map +1 -0
  61. package/dist/ui/components/accordion.d.ts +81 -0
  62. package/dist/ui/components/accordion.js +449 -0
  63. package/dist/ui/components/accordion.js.map +1 -0
  64. package/dist/ui/components/alertDialog.d.ts +17 -0
  65. package/dist/ui/components/alertDialog.js +134 -0
  66. package/dist/ui/components/alertDialog.js.map +1 -0
  67. package/dist/ui/components/button.d.ts +10 -0
  68. package/dist/ui/components/button.js +51 -0
  69. package/dist/ui/components/button.js.map +1 -0
  70. package/dist/ui/components/checkbox.d.ts +3 -0
  71. package/dist/ui/components/checkbox.js +56 -0
  72. package/dist/ui/components/checkbox.js.map +1 -0
  73. package/dist/ui/components/chip.d.ts +13 -0
  74. package/dist/ui/components/chip.js +26 -0
  75. package/dist/ui/components/chip.js.map +1 -0
  76. package/dist/ui/components/collapsible.d.ts +22 -0
  77. package/dist/ui/components/collapsible.js +197 -0
  78. package/dist/ui/components/collapsible.js.map +1 -0
  79. package/dist/ui/components/drawer.d.ts +13 -0
  80. package/dist/ui/components/drawer.js +81 -0
  81. package/dist/ui/components/drawer.js.map +1 -0
  82. package/dist/ui/components/fab.d.ts +12 -0
  83. package/dist/ui/components/fab.js +51 -0
  84. package/dist/ui/components/fab.js.map +1 -0
  85. package/dist/ui/components/form.d.ts +7 -0
  86. package/dist/ui/components/form.js +107 -0
  87. package/dist/ui/components/form.js.map +1 -0
  88. package/dist/ui/components/icon.d.ts +9 -0
  89. package/dist/ui/components/icon.js +28 -0
  90. package/dist/ui/components/icon.js.map +1 -0
  91. package/dist/ui/components/input.d.ts +12 -0
  92. package/dist/ui/components/input.js +44 -0
  93. package/dist/ui/components/input.js.map +1 -0
  94. package/dist/ui/components/modal.d.ts +19 -0
  95. package/dist/ui/components/modal.js +144 -0
  96. package/dist/ui/components/modal.js.map +1 -0
  97. package/dist/ui/components/note.d.ts +6 -0
  98. package/dist/ui/components/note.js +12 -0
  99. package/dist/ui/components/note.js.map +1 -0
  100. package/dist/ui/components/popover.d.ts +15 -0
  101. package/dist/ui/components/popover.js +110 -0
  102. package/dist/ui/components/popover.js.map +1 -0
  103. package/dist/ui/components/progress.d.ts +11 -0
  104. package/dist/ui/components/progress.js +87 -0
  105. package/dist/ui/components/progress.js.map +1 -0
  106. package/dist/ui/components/radioGroup.d.ts +4 -0
  107. package/dist/ui/components/radioGroup.js +82 -0
  108. package/dist/ui/components/radioGroup.js.map +1 -0
  109. package/dist/ui/components/scrollArea.d.ts +29 -0
  110. package/dist/ui/components/scrollArea.js +185 -0
  111. package/dist/ui/components/scrollArea.js.map +1 -0
  112. package/dist/ui/components/select.d.ts +23 -0
  113. package/dist/ui/components/select.js +198 -0
  114. package/dist/ui/components/select.js.map +1 -0
  115. package/dist/ui/components/separator.d.ts +4 -0
  116. package/dist/ui/components/separator.js +48 -0
  117. package/dist/ui/components/separator.js.map +1 -0
  118. package/dist/ui/components/slider.d.ts +26 -0
  119. package/dist/ui/components/slider.js +228 -0
  120. package/dist/ui/components/slider.js.map +1 -0
  121. package/dist/ui/components/sortableList.d.ts +13 -0
  122. package/dist/ui/components/sortableList.js +116 -0
  123. package/dist/ui/components/sortableList.js.map +1 -0
  124. package/dist/ui/components/sortableListRow.d.ts +8 -0
  125. package/dist/ui/components/sortableListRow.js +79 -0
  126. package/dist/ui/components/sortableListRow.js.map +1 -0
  127. package/dist/ui/components/switch.d.ts +3 -0
  128. package/dist/ui/components/switch.js +47 -0
  129. package/dist/ui/components/switch.js.map +1 -0
  130. package/dist/ui/components/tabs.d.ts +7 -0
  131. package/dist/ui/components/tabs.js +106 -0
  132. package/dist/ui/components/tabs.js.map +1 -0
  133. package/dist/ui/components/textarea.d.ts +8 -0
  134. package/dist/ui/components/textarea.js +40 -0
  135. package/dist/ui/components/textarea.js.map +1 -0
  136. package/dist/ui/components/toast.d.ts +13 -0
  137. package/dist/ui/components/toast.js +136 -0
  138. package/dist/ui/components/toast.js.map +1 -0
  139. package/dist/ui/components/toggle-group.d.ts +11 -0
  140. package/dist/ui/components/toggle-group.js +158 -0
  141. package/dist/ui/components/toggle-group.js.map +1 -0
  142. package/dist/ui/components/toggle.d.ts +12 -0
  143. package/dist/ui/components/toggle.js +48 -0
  144. package/dist/ui/components/toggle.js.map +1 -0
  145. package/dist/ui/components/tooltip.d.ts +8 -0
  146. package/dist/ui/components/tooltip.js +59 -0
  147. package/dist/ui/components/tooltip.js.map +1 -0
  148. package/dist/ui/hooks/useCloseOnBack.d.ts +7 -0
  149. package/dist/ui/hooks/useCloseOnBack.js +46 -0
  150. package/dist/ui/hooks/useCloseOnBack.js.map +1 -0
  151. package/dist/ui/hooks/useReturnFocus.d.ts +9 -0
  152. package/dist/ui/hooks/useReturnFocus.js +30 -0
  153. package/dist/ui/hooks/useReturnFocus.js.map +1 -0
  154. package/dist/ui/index.d.ts +32 -0
  155. package/dist/ui/index.js +33 -0
  156. package/dist/ui/lib/defaultLabels.d.ts +31 -0
  157. package/dist/ui/lib/defaultLabels.js +16 -0
  158. package/dist/ui/lib/defaultLabels.js.map +1 -0
  159. package/dist/ui/lib/labels.d.ts +10 -0
  160. package/dist/ui/lib/labels.js +37 -0
  161. package/dist/ui/lib/labels.js.map +1 -0
  162. package/package.json +80 -4
@@ -0,0 +1,110 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { useCloseOnBack } from "../hooks/useCloseOnBack.js";
4
+ import { useBrucksLabels } from "../lib/labels.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { Popover } from "radix-ui";
7
+ import { useId, useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Close } from "@hugeicons/core-free-icons";
10
+ import { HugeiconsIcon } from "@hugeicons/react";
11
+ // src/ui/components/popover.tsx
12
+ function Popover$1(t0) {
13
+ const $ = c(22);
14
+ const { trigger, children, className, title, titleClassName, useCloseButton } = t0;
15
+ const labels = useBrucksLabels();
16
+ const [open, setOpen] = useState(false);
17
+ let t1;
18
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
19
+ t1 = () => setOpen(false);
20
+ $[0] = t1;
21
+ } else t1 = $[0];
22
+ useCloseOnBack(open, t1);
23
+ const titleId = useId();
24
+ let t2;
25
+ if ($[1] !== trigger) {
26
+ t2 = /* @__PURE__ */ jsx(Popover.Trigger, {
27
+ asChild: true,
28
+ children: trigger
29
+ });
30
+ $[1] = trigger;
31
+ $[2] = t2;
32
+ } else t2 = $[2];
33
+ let t3;
34
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
35
+ t3 = /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-popover-backdrop bg-black/25" }) });
36
+ $[3] = t3;
37
+ } else t3 = $[3];
38
+ const t4 = title ? titleId : void 0;
39
+ const t5 = title ? void 0 : labels.dialog;
40
+ let t6;
41
+ if ($[4] !== className) {
42
+ t6 = cn("relative z-popover rounded-primary border border-border bg-popover 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);
43
+ $[4] = className;
44
+ $[5] = t6;
45
+ } else t6 = $[5];
46
+ let t7;
47
+ if ($[6] !== labels || $[7] !== title || $[8] !== titleClassName || $[9] !== titleId || $[10] !== useCloseButton) {
48
+ t7 = useCloseButton || title ? /* @__PURE__ */ jsxs("div", {
49
+ className: "flex justify-end w-full items-center",
50
+ children: [/* @__PURE__ */ jsx("p", {
51
+ id: titleId,
52
+ className: cn("text-xl px-2 grow", titleClassName),
53
+ children: title
54
+ }), /* @__PURE__ */ jsx(Popover.Close, {
55
+ className: "cursor-pointer rounded-secondary p-2 hover:bg-accent",
56
+ "aria-label": labels.close,
57
+ children: /* @__PURE__ */ jsx(HugeiconsIcon, {
58
+ icon: Close,
59
+ className: "size-5"
60
+ })
61
+ })]
62
+ }) : null;
63
+ $[6] = labels;
64
+ $[7] = title;
65
+ $[8] = titleClassName;
66
+ $[9] = titleId;
67
+ $[10] = useCloseButton;
68
+ $[11] = t7;
69
+ } else t7 = $[11];
70
+ let t8;
71
+ if ($[12] !== children || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 || $[16] !== t7) {
72
+ t8 = /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsxs(Popover.Content, {
73
+ sideOffset: 8,
74
+ align: "end",
75
+ "aria-labelledby": t4,
76
+ "aria-label": t5,
77
+ className: t6,
78
+ children: [t7, children]
79
+ }) });
80
+ $[12] = children;
81
+ $[13] = t4;
82
+ $[14] = t5;
83
+ $[15] = t6;
84
+ $[16] = t7;
85
+ $[17] = t8;
86
+ } else t8 = $[17];
87
+ let t9;
88
+ if ($[18] !== open || $[19] !== t2 || $[20] !== t8) {
89
+ t9 = /* @__PURE__ */ jsxs(Popover.Root, {
90
+ modal: true,
91
+ open,
92
+ onOpenChange: setOpen,
93
+ children: [
94
+ t2,
95
+ t3,
96
+ t8
97
+ ]
98
+ });
99
+ $[18] = open;
100
+ $[19] = t2;
101
+ $[20] = t8;
102
+ $[21] = t9;
103
+ } else t9 = $[21];
104
+ return t9;
105
+ }
106
+ /** Closes the surrounding popover; wrap an interactive child with `asChild`. */
107
+ var PopoverClose = Popover.Close;
108
+ export { Popover$1 as Popover, PopoverClose };
109
+
110
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.js","names":["c","_c","Close","HugeiconsIcon","Popover","PopoverPrimitive","ReactNode","useId","useState","cn","useCloseOnBack","useBrucksLabels","PopoverProps","trigger","children","className","title","titleClassName","useCloseButton","t0","$","labels","open","setOpen","t1","Symbol","for","titleId","t2","t3","t4","undefined","t5","dialog","t6","t7","close","t8","t9","PopoverClose","Popover","_c","PopoverPrimitive"],"sources":["../../../src/ui/components/popover.tsx"],"sourcesContent":["\"use client\";\n\nimport { Close } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport { type ReactNode, useId, useState } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { useCloseOnBack } from \"~/ui/hooks/useCloseOnBack\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ntype PopoverProps = {\n trigger: ReactNode;\n children: ReactNode;\n className?: string;\n title?: string;\n /** Applied to the title, e.g. a display font. */\n titleClassName?: string;\n useCloseButton?: boolean;\n};\n\nfunction Popover({\n trigger,\n children,\n className,\n title,\n titleClassName,\n useCloseButton,\n}: PopoverProps) {\n const labels = useBrucksLabels();\n // Held here rather than left to Radix, so the back button can close it too.\n const [open, setOpen] = useState(false);\n useCloseOnBack(open, () => setOpen(false));\n const titleId = useId();\n return (\n <PopoverPrimitive.Root modal open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>{trigger}</PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal>\n <div className=\"fixed inset-0 z-popover-backdrop bg-black/25\" />\n </PopoverPrimitive.Portal>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n sideOffset={8}\n align=\"end\"\n // A dialog needs a name: the title when there is one.\n aria-labelledby={title ? titleId : undefined}\n aria-label={title ? undefined : labels.dialog}\n className={cn(\n \"relative z-popover rounded-primary border border-border bg-popover 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 {useCloseButton || title ? (\n <div className=\"flex justify-end w-full items-center\">\n <p id={titleId} className={cn(\"text-xl px-2 grow\", titleClassName)}>\n {title}\n </p>\n <PopoverPrimitive.Close\n className=\"cursor-pointer rounded-secondary p-2 hover:bg-accent\"\n aria-label={labels.close}\n >\n <HugeiconsIcon icon={Close} className=\"size-5\" />\n </PopoverPrimitive.Close>\n </div>\n ) : null}\n {children}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n );\n}\n\n/** Closes the surrounding popover; wrap an interactive child with `asChild`. */\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport { Popover, PopoverClose };\n"],"mappings":";;;;;;;;;;;AAoBA,SAAAI,UAAAe,IAAA;CAAA,MAAAC,IAAAnB,EAAA,EAAA;CAAiB,MAAA,EAAAY,SAAAC,UAAAC,WAAAC,OAAAC,gBAAAC,mBAAAC;CAQf,MAAAE,SAAeV,gBAAgB;CAE/B,MAAA,CAAAW,MAAAC,WAAwBf,SAAS,KAAK;CAAE,IAAAgB;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EACnBF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kB,EAAA,KAAAC;EAAAD,EAAA,KAAAJ;EAAAI,EAAA,KAAAH;EAAAG,EAAA,KAAAO;EAAAP,EAAA,MAAAF;EAAAE,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,QAAAN,YAAAM,EAAA,QAAAU,MAAAV,EAAA,QAAAY,MAAAZ,EAAA,QAAAc,MAAAd,EAAA,QAAAe,IAAA;EAxBZE,KAAA,oBAAAK,QAAA,QAAA,EAAA,UACE,qBAAAA,QAAA,SAAA;GACc,YAAA;GACN,OAAA;GAEW,mBAAAZ;GACL,cAAAE;GACD,WAAAE;GANb,UAAA,CAWGC,IAaArB,QACH;EACF,CAAA,EAAA,CAAA;EAA0BM,EAAA,MAAAN;EAAAM,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;EAAAd,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAE,QAAAF,EAAA,QAAAQ,MAAAR,EAAA,QAAAiB,IAAA;EAhC5BC,KAAA,qBAAAI,QAAA,MAAA;GAAuB,OAAA;GAAYpB;GAAoBC,cAAAA;GAAvD,UAAA;IACEK;IACAC;IAGAQ;GA4BF;;EAAwBjB,EAAA,MAAAE;EAAAF,EAAA,MAAAQ;EAAAR,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,OAjCxBkB;AAiCwB;;AAK5B,IAAMC,eAAelC,QAAiBH"}
@@ -0,0 +1,11 @@
1
+ import { Progress as ProgressPrimitive } from "radix-ui";
2
+ /**
3
+ * A thin bar filled to `value` of `max`. The value is clamped into range, since
4
+ * Radix drops one outside it and a clock read between ticks runs a hair past zero.
5
+ */
6
+ declare function Progress({ className, indicatorClassName, value, max, ...props }: Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, "value"> & {
7
+ value: number;
8
+ /** The fill's colour and transition, where the theme and a 300 ms ease are not right. */
9
+ indicatorClassName?: string;
10
+ }): import("react").JSX.Element;
11
+ export { Progress };
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { Progress } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/ui/components/progress.tsx
7
+ /**
8
+ * A thin bar filled to `value` of `max`. The value is clamped into range, since
9
+ * Radix drops one outside it and a clock read between ticks runs a hair past zero.
10
+ */
11
+ function Progress$1(t0) {
12
+ const $ = c(21);
13
+ let className;
14
+ let indicatorClassName;
15
+ let props;
16
+ let t1;
17
+ let value;
18
+ if ($[0] !== t0) {
19
+ ({className, indicatorClassName, value, max: t1, ...props} = t0);
20
+ $[0] = t0;
21
+ $[1] = className;
22
+ $[2] = indicatorClassName;
23
+ $[3] = props;
24
+ $[4] = t1;
25
+ $[5] = value;
26
+ } else {
27
+ className = $[1];
28
+ indicatorClassName = $[2];
29
+ props = $[3];
30
+ t1 = $[4];
31
+ value = $[5];
32
+ }
33
+ const max = t1 === void 0 ? 100 : t1;
34
+ const safeMax = max > 0 ? max : 1;
35
+ const clamped = Math.max(0, Math.min(value, safeMax));
36
+ let t2;
37
+ if ($[6] !== className) {
38
+ t2 = cn("relative h-1.5 w-full overflow-hidden rounded-full bg-muted", className);
39
+ $[6] = className;
40
+ $[7] = t2;
41
+ } else t2 = $[7];
42
+ let t3;
43
+ if ($[8] !== indicatorClassName) {
44
+ t3 = cn("h-full w-full bg-theme-500 transition-transform duration-300 motion-reduce:transition-none", indicatorClassName);
45
+ $[8] = indicatorClassName;
46
+ $[9] = t3;
47
+ } else t3 = $[9];
48
+ const t4 = `translateX(-${100 - clamped / safeMax * 100}%)`;
49
+ let t5;
50
+ if ($[10] !== t4) {
51
+ t5 = { transform: t4 };
52
+ $[10] = t4;
53
+ $[11] = t5;
54
+ } else t5 = $[11];
55
+ let t6;
56
+ if ($[12] !== t3 || $[13] !== t5) {
57
+ t6 = /* @__PURE__ */ jsx(Progress.Indicator, {
58
+ "data-slot": "progress-indicator",
59
+ className: t3,
60
+ style: t5
61
+ });
62
+ $[12] = t3;
63
+ $[13] = t5;
64
+ $[14] = t6;
65
+ } else t6 = $[14];
66
+ let t7;
67
+ if ($[15] !== clamped || $[16] !== props || $[17] !== safeMax || $[18] !== t2 || $[19] !== t6) {
68
+ t7 = /* @__PURE__ */ jsx(Progress.Root, {
69
+ "data-slot": "progress",
70
+ className: t2,
71
+ value: clamped,
72
+ max: safeMax,
73
+ ...props,
74
+ children: t6
75
+ });
76
+ $[15] = clamped;
77
+ $[16] = props;
78
+ $[17] = safeMax;
79
+ $[18] = t2;
80
+ $[19] = t6;
81
+ $[20] = t7;
82
+ } else t7 = $[20];
83
+ return t7;
84
+ }
85
+ export { Progress$1 as Progress };
86
+
87
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","names":["c","_c","Progress","ProgressPrimitive","cn","t0","$","className","indicatorClassName","props","t1","value","max","undefined","safeMax","clamped","Math","min","t2","t3","t4","t5","transform","t6","t7","Progress","_c","ProgressPrimitive"],"sources":["../../../src/ui/components/progress.tsx"],"sourcesContent":["\"use client\";\n\nimport { Progress as ProgressPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\n/**\n * A thin bar filled to `value` of `max`. The value is clamped into range, since\n * Radix drops one outside it and a clock read between ticks runs a hair past zero.\n */\nfunction Progress({\n className,\n indicatorClassName,\n value,\n max = 100,\n ...props\n}: Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, \"value\"> & {\n value: number;\n /** The fill's colour and transition, where the theme and a 300 ms ease are not right. */\n indicatorClassName?: string;\n}) {\n const safeMax = max > 0 ? max : 1;\n const clamped = Math.max(0, Math.min(value, safeMax));\n\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n className={cn(\"relative h-1.5 w-full overflow-hidden rounded-full bg-muted\", className)}\n value={clamped}\n max={safeMax}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(\n \"h-full w-full bg-theme-500 transition-transform duration-300 motion-reduce:transition-none\",\n indicatorClassName,\n )}\n style={{ transform: `translateX(-${100 - (clamped / safeMax) * 100}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\nexport { Progress };\n"],"mappings":";;;;;;;;;;AASA,SAAAE,WAAAG,IAAA;CAAA,MAAAC,IAAAL,EAAA,EAAA;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAkB,CAAA,CAAAE,WAAAC,oBAAAG,OAAAC,KAAAF,IAAA,GAAAD,SAAAJ;EAUjBC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,YAAAD,EAAA;EAAAE,qBAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,QAAAL,EAAA;CAAA;CANC,MAAAM,MAAAF,OAAAG,KAAAA,IAAA,MAAAH;CAOA,MAAAI,UAAgBF,MAAM,IAANA,MAAA;CAChB,MAAAG,UAAgBC,KAAIJ,IAAK,GAAGI,KAAIC,IAAKN,OAAOG,OAAO,CAAC;CAAE,IAAAI;CAAA,IAAAZ,EAAA,OAAAC,WAAA;EAKvCW,KAAAd,GAAG,+DAA+DG,SAAS;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAE,oBAAA;EAO1EW,KAAAf,GACT,8FACAI,kBACF;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CACmB,MAAAc,KAAA,eAAe,MAAOL,UAAUD,UAAW,IAAG;CAAI,IAAAO;CAAA,IAAAf,EAAA,QAAAc,IAAA;EAA/DC,KAAA,EAAAC,WAAaF,GAAmD;EAACd,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,QAAAa,MAAAb,EAAA,QAAAe,IAAA;EAN1EE,KAAA,oBAAAI,SAAA,WAAA;GACY,aAAA;GACC,WAAAR;GAIJ,OAAAE;EAAiE,CAAA;EACxEf,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAS,WAAAT,EAAA,QAAAG,SAAAH,EAAA,QAAAQ,WAAAR,EAAA,QAAAY,MAAAZ,EAAA,QAAAiB,IAAA;EAdJC,KAAA,oBAAAG,SAAA,MAAA;GACY,aAAA;GACC,WAAAT;GACJH,OAAAA;GACFD,KAAAA;GAAO,GACRL;GAEJc,UAAAA;EAQF,CAAA;EAAyBjB,EAAA,MAAAS;EAAAT,EAAA,MAAAG;EAAAH,EAAA,MAAAQ;EAAAR,EAAA,MAAAY;EAAAZ,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,OAfzBkB;AAeyB"}
@@ -0,0 +1,4 @@
1
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
2
+ declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react").JSX.Element;
3
+ declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): import("react").JSX.Element;
4
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { RadioGroup } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/ui/components/radioGroup.tsx
7
+ function RadioGroup$1(t0) {
8
+ const $ = c(8);
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("flex flex-col gap-2", className);
23
+ $[3] = className;
24
+ $[4] = t1;
25
+ } else t1 = $[4];
26
+ let t2;
27
+ if ($[5] !== props || $[6] !== t1) {
28
+ t2 = /* @__PURE__ */ jsx(RadioGroup.Root, {
29
+ "data-slot": "radio-group",
30
+ className: t1,
31
+ ...props
32
+ });
33
+ $[5] = props;
34
+ $[6] = t1;
35
+ $[7] = t2;
36
+ } else t2 = $[7];
37
+ return t2;
38
+ }
39
+ function RadioGroupItem(t0) {
40
+ const $ = c(9);
41
+ let className;
42
+ let props;
43
+ if ($[0] !== t0) {
44
+ ({className, ...props} = t0);
45
+ $[0] = t0;
46
+ $[1] = className;
47
+ $[2] = props;
48
+ } else {
49
+ className = $[1];
50
+ props = $[2];
51
+ }
52
+ let t1;
53
+ if ($[3] !== className) {
54
+ t1 = cn("peer size-5 shrink-0 rounded-full border border-border bg-input/30 outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=checked]:border-primary", className);
55
+ $[3] = className;
56
+ $[4] = t1;
57
+ } else t1 = $[4];
58
+ let t2;
59
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
60
+ t2 = /* @__PURE__ */ jsx(RadioGroup.Indicator, {
61
+ className: "flex items-center justify-center w-full h-full",
62
+ children: /* @__PURE__ */ jsx("span", { className: "size-2.5 rounded-full bg-primary" })
63
+ });
64
+ $[5] = t2;
65
+ } else t2 = $[5];
66
+ let t3;
67
+ if ($[6] !== props || $[7] !== t1) {
68
+ t3 = /* @__PURE__ */ jsx(RadioGroup.Item, {
69
+ "data-slot": "radio-group-item",
70
+ className: t1,
71
+ ...props,
72
+ children: t2
73
+ });
74
+ $[6] = props;
75
+ $[7] = t1;
76
+ $[8] = t3;
77
+ } else t3 = $[8];
78
+ return t3;
79
+ }
80
+ export { RadioGroup$1 as RadioGroup, RadioGroupItem };
81
+
82
+ //# sourceMappingURL=radioGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radioGroup.js","names":["c","_c","RadioGroup","RadioGroupPrimitive","cn","t0","$","className","props","t1","t2","RadioGroupItem","Symbol","for","t3","RadioGroup","_c","RadioGroupPrimitive"],"sources":["../../../src/ui/components/radioGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as RadioGroupPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\nfunction RadioGroup({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n \"peer size-5 shrink-0 rounded-full border border-border bg-input/30 outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 data-[state=checked]:border-primary\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center w-full h-full\">\n <span className=\"size-2.5 rounded-full bg-primary\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;AAKA,SAAAE,aAAAG,IAAA;CAAA,MAAAC,IAAAL,EAAA,CAAA;CAAA,IAAAM;CAAA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AAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAE,SAAAF,EAAA,OAAAG,IAAA;EAVlCK,KAAA,oBAAAG,WAAA,MAAA;GACY,aAAA;GACC,WAAAR;GAGV,GACGD;GAEJE,UAAAA;EAGF,CAAA;EAA2BJ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAX3BQ;AAW2B"}
@@ -0,0 +1,29 @@
1
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
2
+ import { type ComponentProps } from "react";
3
+ /**
4
+ * A scroll box with the platform's scrollbar swapped for one of ours. The
5
+ * native bar is the reason a sideways row of chips is hard to place: on the
6
+ * desktop it takes a row's worth of height out of a row that only has one, and
7
+ * on Android it drops a heavy overlay on top of what it scrolls. Ours is laid
8
+ * over the box rather than inside it, so it costs the box no room at all.
9
+ *
10
+ * `type="hover"` is the overlay-scrollbar rule and the reason it is the default
11
+ * here: the bar comes up under the pointer, where it can be taken and dragged,
12
+ * and is out of the way the rest of the time. A box that wants it kept up
13
+ * passes `type="auto"` itself.
14
+ *
15
+ * The viewport wraps whatever it is handed in a block of its own, and that
16
+ * block is what the scroll extent is measured against - so a row that scrolls
17
+ * sideways puts its own flex container inside rather than handing the buttons
18
+ * straight in.
19
+ *
20
+ * A sideways box also takes the wheel, which it would otherwise have no answer
21
+ * to: a plain mouse sends nothing but `deltaY`, and the browser only spends
22
+ * that sideways on a box it considers unable to scroll down - which this one,
23
+ * with a viewport that scrolls in both axes, is not.
24
+ */
25
+ declare function ScrollArea({ className, children, orientation, ...props }: ComponentProps<typeof ScrollAreaPrimitive.Root> & {
26
+ orientation?: "vertical" | "horizontal";
27
+ }): import("react").JSX.Element;
28
+ declare function ScrollBar({ className, orientation, ...props }: ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react").JSX.Element;
29
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,185 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { ScrollArea } from "radix-ui";
5
+ import { useEffect, useRef } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/ui/components/scrollArea.tsx
8
+ /** A wheel notch in lines, and a page, in the pixels the deltas are turned into. */
9
+ var LINE_PX = 16;
10
+ var PAGE_FALLBACK_PX = 320;
11
+ /**
12
+ * A scroll box with the platform's scrollbar swapped for one of ours. The
13
+ * native bar is the reason a sideways row of chips is hard to place: on the
14
+ * desktop it takes a row's worth of height out of a row that only has one, and
15
+ * on Android it drops a heavy overlay on top of what it scrolls. Ours is laid
16
+ * over the box rather than inside it, so it costs the box no room at all.
17
+ *
18
+ * `type="hover"` is the overlay-scrollbar rule and the reason it is the default
19
+ * here: the bar comes up under the pointer, where it can be taken and dragged,
20
+ * and is out of the way the rest of the time. A box that wants it kept up
21
+ * passes `type="auto"` itself.
22
+ *
23
+ * The viewport wraps whatever it is handed in a block of its own, and that
24
+ * block is what the scroll extent is measured against - so a row that scrolls
25
+ * sideways puts its own flex container inside rather than handing the buttons
26
+ * straight in.
27
+ *
28
+ * A sideways box also takes the wheel, which it would otherwise have no answer
29
+ * to: a plain mouse sends nothing but `deltaY`, and the browser only spends
30
+ * that sideways on a box it considers unable to scroll down - which this one,
31
+ * with a viewport that scrolls in both axes, is not.
32
+ */
33
+ function ScrollArea$1(t0) {
34
+ const $ = c(20);
35
+ let children;
36
+ let className;
37
+ let props;
38
+ let t1;
39
+ if ($[0] !== t0) {
40
+ ({className, children, orientation: t1, ...props} = t0);
41
+ $[0] = t0;
42
+ $[1] = children;
43
+ $[2] = className;
44
+ $[3] = props;
45
+ $[4] = t1;
46
+ } else {
47
+ children = $[1];
48
+ className = $[2];
49
+ props = $[3];
50
+ t1 = $[4];
51
+ }
52
+ const orientation = t1 === void 0 ? "vertical" : t1;
53
+ const viewport = useRef(null);
54
+ let t2;
55
+ let t3;
56
+ if ($[5] !== orientation) {
57
+ t2 = () => {
58
+ const node = viewport.current;
59
+ if (!node || orientation !== "horizontal") return;
60
+ const pixelsOf = (event) => {
61
+ if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) return event.deltaY * LINE_PX;
62
+ if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) return event.deltaY * (node.clientWidth || PAGE_FALLBACK_PX);
63
+ return event.deltaY;
64
+ };
65
+ const onWheel = (event_0) => {
66
+ if (event_0.deltaX !== 0 || event_0.deltaY === 0) return;
67
+ const before = node.scrollLeft;
68
+ node.scrollLeft = node.scrollLeft + pixelsOf(event_0);
69
+ if (node.scrollLeft !== before) event_0.preventDefault();
70
+ };
71
+ node.addEventListener("wheel", onWheel, { passive: false });
72
+ return () => node.removeEventListener("wheel", onWheel);
73
+ };
74
+ t3 = [orientation];
75
+ $[5] = orientation;
76
+ $[6] = t2;
77
+ $[7] = t3;
78
+ } else {
79
+ t2 = $[6];
80
+ t3 = $[7];
81
+ }
82
+ useEffect(t2, t3);
83
+ let t4;
84
+ if ($[8] !== className) {
85
+ t4 = cn("relative overflow-hidden", className);
86
+ $[8] = className;
87
+ $[9] = t4;
88
+ } else t4 = $[9];
89
+ let t5;
90
+ if ($[10] !== children) {
91
+ t5 = /* @__PURE__ */ jsx(ScrollArea.Viewport, {
92
+ ref: viewport,
93
+ "data-slot": "scroll-area-viewport",
94
+ className: "size-full rounded-[inherit] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:ring-inset",
95
+ children
96
+ });
97
+ $[10] = children;
98
+ $[11] = t5;
99
+ } else t5 = $[11];
100
+ let t6;
101
+ if ($[12] !== orientation) {
102
+ t6 = /* @__PURE__ */ jsx(ScrollBar, { orientation });
103
+ $[12] = orientation;
104
+ $[13] = t6;
105
+ } else t6 = $[13];
106
+ let t7;
107
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
108
+ t7 = /* @__PURE__ */ jsx(ScrollArea.Corner, {});
109
+ $[14] = t7;
110
+ } else t7 = $[14];
111
+ let t8;
112
+ if ($[15] !== props || $[16] !== t4 || $[17] !== t5 || $[18] !== t6) {
113
+ t8 = /* @__PURE__ */ jsxs(ScrollArea.Root, {
114
+ "data-slot": "scroll-area",
115
+ type: "hover",
116
+ className: t4,
117
+ ...props,
118
+ children: [
119
+ t5,
120
+ t6,
121
+ t7
122
+ ]
123
+ });
124
+ $[15] = props;
125
+ $[16] = t4;
126
+ $[17] = t5;
127
+ $[18] = t6;
128
+ $[19] = t8;
129
+ } else t8 = $[19];
130
+ return t8;
131
+ }
132
+ function ScrollBar(t0) {
133
+ const $ = c(13);
134
+ let className;
135
+ let props;
136
+ let t1;
137
+ if ($[0] !== t0) {
138
+ ({className, orientation: t1, ...props} = t0);
139
+ $[0] = t0;
140
+ $[1] = className;
141
+ $[2] = props;
142
+ $[3] = t1;
143
+ } else {
144
+ className = $[1];
145
+ props = $[2];
146
+ t1 = $[3];
147
+ }
148
+ const orientation = t1 === void 0 ? "vertical" : t1;
149
+ const t2 = orientation === "vertical" ? "h-full w-2" : null;
150
+ const t3 = orientation === "horizontal" ? "h-2 flex-col" : null;
151
+ let t4;
152
+ if ($[4] !== className || $[5] !== t2 || $[6] !== t3) {
153
+ t4 = cn("flex touch-none select-none p-px transition-opacity data-[state=hidden]:opacity-0 pointer-coarse:hidden", t2, t3, className);
154
+ $[4] = className;
155
+ $[5] = t2;
156
+ $[6] = t3;
157
+ $[7] = t4;
158
+ } else t4 = $[7];
159
+ let t5;
160
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
161
+ t5 = /* @__PURE__ */ jsx(ScrollArea.ScrollAreaThumb, {
162
+ "data-slot": "scroll-area-thumb",
163
+ className: "relative flex-1 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground/70"
164
+ });
165
+ $[8] = t5;
166
+ } else t5 = $[8];
167
+ let t6;
168
+ if ($[9] !== orientation || $[10] !== props || $[11] !== t4) {
169
+ t6 = /* @__PURE__ */ jsx(ScrollArea.ScrollAreaScrollbar, {
170
+ "data-slot": "scroll-area-scrollbar",
171
+ orientation,
172
+ className: t4,
173
+ ...props,
174
+ children: t5
175
+ });
176
+ $[9] = orientation;
177
+ $[10] = props;
178
+ $[11] = t4;
179
+ $[12] = t6;
180
+ } else t6 = $[12];
181
+ return t6;
182
+ }
183
+ export { ScrollArea$1 as ScrollArea, ScrollBar };
184
+
185
+ //# sourceMappingURL=scrollArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollArea.js","names":["c","_c","ScrollArea","ScrollAreaPrimitive","ComponentProps","useEffect","useRef","cn","LINE_PX","PAGE_FALLBACK_PX","t0","$","children","className","props","t1","orientation","undefined","viewport","t2","t3","node","current","pixelsOf","event","deltaMode","WheelEvent","DOM_DELTA_LINE","deltaY","DOM_DELTA_PAGE","clientWidth","onWheel","event_0","deltaX","before","scrollLeft","preventDefault","addEventListener","passive","removeEventListener","t4","t5","t6","t7","Symbol","for","t8","ScrollBar","ScrollArea","_c","ScrollAreaPrimitive"],"sources":["../../../src/ui/components/scrollArea.tsx"],"sourcesContent":["\"use client\";\n\nimport { ScrollArea as ScrollAreaPrimitive } from \"radix-ui\";\nimport { type ComponentProps, useEffect, useRef } from \"react\";\nimport { cn } from \"~/style/utils\";\n\n/** A wheel notch in lines, and a page, in the pixels the deltas are turned into. */\nconst LINE_PX = 16;\nconst PAGE_FALLBACK_PX = 320;\n\n/**\n * A scroll box with the platform's scrollbar swapped for one of ours. The\n * native bar is the reason a sideways row of chips is hard to place: on the\n * desktop it takes a row's worth of height out of a row that only has one, and\n * on Android it drops a heavy overlay on top of what it scrolls. Ours is laid\n * over the box rather than inside it, so it costs the box no room at all.\n *\n * `type=\"hover\"` is the overlay-scrollbar rule and the reason it is the default\n * here: the bar comes up under the pointer, where it can be taken and dragged,\n * and is out of the way the rest of the time. A box that wants it kept up\n * passes `type=\"auto\"` itself.\n *\n * The viewport wraps whatever it is handed in a block of its own, and that\n * block is what the scroll extent is measured against - so a row that scrolls\n * sideways puts its own flex container inside rather than handing the buttons\n * straight in.\n *\n * A sideways box also takes the wheel, which it would otherwise have no answer\n * to: a plain mouse sends nothing but `deltaY`, and the browser only spends\n * that sideways on a box it considers unable to scroll down - which this one,\n * with a viewport that scrolls in both axes, is not.\n */\nfunction ScrollArea({\n className,\n children,\n orientation = \"vertical\",\n ...props\n}: ComponentProps<typeof ScrollAreaPrimitive.Root> & {\n orientation?: \"vertical\" | \"horizontal\";\n}) {\n const viewport = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const node = viewport.current;\n if (!node || orientation !== \"horizontal\") return;\n\n // Deltas come in whatever unit the device reports: pixels from most, lines\n // from Firefox on Windows, pages from the odd mouse driver.\n const pixelsOf = (event: WheelEvent) => {\n if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) return event.deltaY * LINE_PX;\n if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n return event.deltaY * (node.clientWidth || PAGE_FALLBACK_PX);\n }\n return event.deltaY;\n };\n\n const onWheel = (event: WheelEvent) => {\n // A trackpad swipe and a tilted wheel already say sideways; only a wheel\n // with nothing but a vertical delta is asking for a translation.\n if (event.deltaX !== 0 || event.deltaY === 0) return;\n\n const before = node.scrollLeft;\n node.scrollLeft += pixelsOf(event);\n // Only a wheel that actually moved the row is spent here. At either end\n // it is the page's, so a row under the cursor is not a dead patch that\n // swallows the scroll.\n if (node.scrollLeft !== before) event.preventDefault();\n };\n\n // Not React's `onWheel`: that one is delegated to the root as a passive\n // listener, where `preventDefault` does nothing but warn.\n node.addEventListener(\"wheel\", onWheel, { passive: false });\n return () => node.removeEventListener(\"wheel\", onWheel);\n }, [orientation]);\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n type=\"hover\"\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n ref={viewport}\n data-slot=\"scroll-area-viewport\"\n className=\"size-full rounded-[inherit] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:ring-inset\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation={orientation} />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n // `type=\"hover\"` is a pointer entering the box, and on a touchscreen a\n // press is exactly that: tapping a chip raises the bar and leaves it\n // there. A finger has nothing to aim at it with anyway, so on a coarse\n // pointer the row is swiped without one.\n \"flex touch-none select-none p-px transition-opacity data-[state=hidden]:opacity-0 pointer-coarse:hidden\",\n orientation === \"vertical\" ? \"h-full w-2\" : null,\n orientation === \"horizontal\" ? \"h-2 flex-col\" : null,\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"relative flex-1 rounded-full bg-muted-foreground/40 transition-colors hover:bg-muted-foreground/70\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n"],"mappings":";;;;;;;;AAOA,IAAMQ,UAAU;AAChB,IAAMC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;AAwBzB,SAAAP,aAAAQ,IAAA;CAAA,MAAAC,IAAAV,EAAA,EAAA;CAAA,IAAAW;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAG,WAAAD,UAAAI,aAAAD,IAAA,GAAAD,SAAAJ;EAOnBC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,WAAAD,E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,MAAAK,cAAAD,OAAAE,KAAAA,IAAA,aAAAF;CAaM,MAAAI,KAAAH,gBAAgB,aAAhB,eAAA;CACA,MAAAI,KAAAJ,gBAAgB,eAAhB,iBAAA;CAAoD,IAAAwB;CAAA,IAAA7B,EAAA,OAAAE,aAAAF,EAAA,OAAAQ,MAAAR,EAAA,OAAAS,IAAA;EAP3CoB,KAAAjC,GAKT,2GACAY,IACAC,IACAP,SACF;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;EAAAT,EAAA,KAAA6B;CAAA,OAAAA,KAAA7B,EAAA;CAAA,IAAA8B;CAAA,IAAA9B,EAAA,OAAAiC,OAAAC,IAAA,2BAAA,GAAA;EAGDJ,KAAA,oBAAAS,WAAA,iBAAA;GACY,aAAA;GACA,WAAA;EAAoG,CAAA;EAC9GvC,EAAA,KAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAAA,IAAA+B;CAAA,IAAA/B,EAAA,OAAAK,eAAAL,EAAA,QAAAG,SAAAH,EAAA,QAAA6B,IAAA;EAlBJE,KAAA,oBAAAQ,WAAA,qBAAA;GACY,aAAA;GACGlC;GACF,WAAAwB;GASV,GACG1B;GAEJ2B,UAAAA;EAIF,CAAA;EAA0C9B,EAAA,KAAAK;EAAAL,EAAA,MAAAG;EAAAH,EAAA,MAAA6B;EAAA7B,EAAA,MAAA+B;CAAA,OAAAA,KAAA/B,EAAA;CAAA,OAnB1C+B;AAmB0C"}
@@ -0,0 +1,23 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ declare const selectVariants: (props?: ({
4
+ variant?: "secondary" | "default" | "outline" | "ghost" | "keyboard" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "xs" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ type Option = {
8
+ value: string;
9
+ label: string;
10
+ icon?: React.ReactNode;
11
+ };
12
+ declare function Select({ className, contentClassName, variant, size, options, value, defaultValue, onValueChange, disabled, placeholder, id, }: VariantProps<typeof selectVariants> & {
13
+ options: Array<Option>;
14
+ className?: string;
15
+ contentClassName?: string;
16
+ value?: string;
17
+ defaultValue?: string;
18
+ onValueChange?: (value: string) => void;
19
+ disabled?: boolean;
20
+ placeholder?: string;
21
+ id?: string;
22
+ }): React.JSX.Element;
23
+ export { Select };