@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,81 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { useCloseOnBack } from "../hooks/useCloseOnBack.js";
4
+ import { useReturnFocus } from "../hooks/useReturnFocus.js";
5
+ import { Sides } from "../../style/types.js";
6
+ import { useBrucksLabels } from "../lib/labels.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { Dialog } from "radix-ui";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ // src/ui/components/drawer.tsx
11
+ function Drawer(t0) {
12
+ const $ = c(19);
13
+ const { open, onClose, children, side: t1, classNames, title } = t0;
14
+ const side = t1 === void 0 ? Sides.right : t1;
15
+ const labels = useBrucksLabels();
16
+ useCloseOnBack(open, onClose);
17
+ const returnFocus = useReturnFocus();
18
+ const slideIn = side === Sides.right ? "data-[state=open]:animate-drawer-slide-in-right" : "data-[state=open]:animate-drawer-slide-in-left";
19
+ const slideOut = side === Sides.right ? "data-[state=closed]:animate-drawer-slide-out-right" : "data-[state=closed]:animate-drawer-slide-out-left";
20
+ let t2;
21
+ if ($[0] !== onClose) {
22
+ t2 = (o) => !o ? onClose() : void 0;
23
+ $[0] = onClose;
24
+ $[1] = t2;
25
+ } else t2 = $[1];
26
+ let t3;
27
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
28
+ t3 = /* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 z-dialog bg-black/50 data-[state=open]:animate-drawer-fade-in data-[state=closed]:animate-drawer-fade-out" });
29
+ $[2] = t3;
30
+ } else t3 = $[2];
31
+ const t4 = side === Sides.right ? "right-0" : "left-0";
32
+ let t5;
33
+ if ($[3] !== classNames || $[4] !== slideIn || $[5] !== slideOut || $[6] !== t4) {
34
+ t5 = cn("fixed top-0 z-dialog h-full w-9/10 max-w-90 safe-area-y bg-background", t4, slideIn, slideOut, classNames);
35
+ $[3] = classNames;
36
+ $[4] = slideIn;
37
+ $[5] = slideOut;
38
+ $[6] = t4;
39
+ $[7] = t5;
40
+ } else t5 = $[7];
41
+ const t6 = title ?? labels.menu;
42
+ let t7;
43
+ if ($[8] !== t6) {
44
+ t7 = /* @__PURE__ */ jsx(Dialog.Title, {
45
+ className: "sr-only",
46
+ children: t6
47
+ });
48
+ $[8] = t6;
49
+ $[9] = t7;
50
+ } else t7 = $[9];
51
+ let t8;
52
+ if ($[10] !== children || $[11] !== returnFocus || $[12] !== t5 || $[13] !== t7) {
53
+ t8 = /* @__PURE__ */ jsxs(Dialog.Portal, { children: [t3, /* @__PURE__ */ jsxs(Dialog.Content, {
54
+ ...returnFocus,
55
+ "aria-describedby": void 0,
56
+ className: t5,
57
+ children: [t7, children]
58
+ })] });
59
+ $[10] = children;
60
+ $[11] = returnFocus;
61
+ $[12] = t5;
62
+ $[13] = t7;
63
+ $[14] = t8;
64
+ } else t8 = $[14];
65
+ let t9;
66
+ if ($[15] !== open || $[16] !== t2 || $[17] !== t8) {
67
+ t9 = /* @__PURE__ */ jsx(Dialog.Root, {
68
+ open,
69
+ onOpenChange: t2,
70
+ children: t8
71
+ });
72
+ $[15] = open;
73
+ $[16] = t2;
74
+ $[17] = t8;
75
+ $[18] = t9;
76
+ } else t9 = $[18];
77
+ return t9;
78
+ }
79
+ export { Drawer };
80
+
81
+ //# sourceMappingURL=drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawer.js","names":["c","_c","Dialog","ReactNode","Side","Sides","cn","useCloseOnBack","useReturnFocus","useBrucksLabels","DrawerProps","open","onClose","children","side","classNames","title","Drawer","t0","$","t1","undefined","right","labels","returnFocus","slideIn","slideOut","t2","o","t3","Symbol","for","t4","t5","t6","menu","t7","t8","t9","_c"],"sources":["../../../src/ui/components/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { type Side, Sides } from \"~/style/types\";\nimport { cn } from \"~/style/utils\";\nimport { useCloseOnBack } from \"~/ui/hooks/useCloseOnBack\";\nimport { useReturnFocus } from \"~/ui/hooks/useReturnFocus\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ninterface DrawerProps {\n open: boolean;\n onClose: () => void;\n children?: ReactNode;\n side?: Side;\n classNames?: string;\n /** Screen reader name; the \"menu\" label if left out */\n title?: string;\n}\n\nfunction Drawer({ open, onClose, children, side = Sides.right, classNames, title }: DrawerProps) {\n const labels = useBrucksLabels();\n useCloseOnBack(open, onClose);\n const returnFocus = useReturnFocus();\n const slideIn =\n side === Sides.right\n ? \"data-[state=open]:animate-drawer-slide-in-right\"\n : \"data-[state=open]:animate-drawer-slide-in-left\";\n const slideOut =\n side === Sides.right\n ? \"data-[state=closed]:animate-drawer-slide-out-right\"\n : \"data-[state=closed]:animate-drawer-slide-out-left\";\n return (\n <Dialog.Root open={open} onOpenChange={(o) => (!o ? onClose() : undefined)}>\n <Dialog.Portal>\n <Dialog.Overlay className=\"fixed inset-0 z-dialog bg-black/50 data-[state=open]:animate-drawer-fade-in data-[state=closed]:animate-drawer-fade-out\" />\n <Dialog.Content\n {...returnFocus}\n aria-describedby={undefined}\n className={cn(\n \"fixed top-0 z-dialog h-full w-9/10 max-w-90 safe-area-y bg-background\",\n side === Sides.right ? \"right-0\" : \"left-0\",\n slideIn,\n slideOut,\n classNames,\n )}\n >\n <Dialog.Title className=\"sr-only\">{title ?? labels.menu}</Dialog.Title>\n {children}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n\nexport { Drawer };\n"],"mappings":";;;;;;;;;;AAoBA,SAAAiB,OAAAC,IAAA;CA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AAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAN,YAAAM,EAAA,QAAAK,eAAAL,EAAA,QAAAc,MAAAd,EAAA,QAAAiB,IAAA;EAb3EC,KAAA,qBAAA,OAAA,QAAA,EAAA,UAAA,CACER,IACA,qBAAA,OAAA,SAAA;GAAA,GACML;GACcH,oBAAAA,KAAAA;GACP,WAAAY;GAHb,UAAA,CAWEG,IACCvB,QACH;EACF,CAAA,CAAA,EAAA,CAAA;EAAgBM,EAAA,MAAAN;EAAAM,EAAA,MAAAK;EAAAL,EAAA,MAAAc;EAAAd,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAR,QAAAQ,EAAA,QAAAQ,MAAAR,EAAA,QAAAkB,IAAA;EAjBlBC,KAAA,oBAAA,OAAA,MAAA;GAAmB3B;GAAoB,cAAAgB;GACrCU,UAAAA;EAiBF,CAAA;EAAclB,EAAA,MAAAR;EAAAQ,EAAA,MAAAQ;EAAAR,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAlBdmB;AAkBc"}
@@ -0,0 +1,12 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ declare const fabVariants: (props?: ({
4
+ variant?: "secondary" | "default" | "outline" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
+ position?: "bottom-right" | "bottom-left" | "inline" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function Fab({ className, variant, size, position, visible, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof fabVariants> & {
9
+ visible?: boolean;
10
+ asChild?: boolean;
11
+ }): React.JSX.Element;
12
+ export { Fab, fabVariants };
@@ -0,0 +1,51 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { Slot } from "radix-ui";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
+ // src/ui/components/fab.tsx
6
+ var fabVariants = cva("group/fab inline-flex shrink-0 items-center justify-center rounded-primary shadow-[0_6px_16px_-2px_rgb(0_0_0/0.30),0_3px_6px_-2px_rgb(0_0_0/0.20)] dark:shadow-[0_6px_16px_-2px_rgb(0_0_0/0.45),0_3px_6px_-2px_rgb(0_0_0/0.30)] outline-none select-none cursor-pointer transition-all duration-300 ease-out focus-visible:ring-[3px] focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
7
+ variants: {
8
+ variant: {
9
+ default: "border border-border bg-card text-card-foreground hover:bg-muted",
10
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
11
+ outline: "border border-border bg-input/30 hover:bg-input/50 hover:text-foreground"
12
+ },
13
+ size: {
14
+ default: "size-12 [&_svg:not([class*='size-'])]:size-6",
15
+ sm: "size-10 [&_svg:not([class*='size-'])]:size-5",
16
+ lg: "size-14 [&_svg:not([class*='size-'])]:size-7"
17
+ },
18
+ position: {
19
+ "bottom-right": "fixed z-fab bottom-12 right-4 sm:bottom-14 lg:bottom-16 sm:right-5 lg:right-6",
20
+ "bottom-left": "fixed z-fab bottom-12 left-4 sm:bottom-14 lg:bottom-16 sm:left-5 lg:left-6",
21
+ /** Stays in normal flow, so it lines up with whatever sits next to it. */
22
+ inline: "relative"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ size: "default",
28
+ position: "bottom-right"
29
+ }
30
+ });
31
+ function Fab({ className, variant = "default", size = "default", position = "bottom-right", visible = true, asChild = false, ...props }) {
32
+ const Comp = asChild ? Slot.Root : "button";
33
+ return /* @__PURE__ */ jsx(Comp, {
34
+ "data-slot": "fab",
35
+ "data-variant": variant,
36
+ "data-size": size,
37
+ "data-position": position,
38
+ "data-visible": visible,
39
+ "aria-hidden": !visible ? true : void 0,
40
+ tabIndex: !visible ? -1 : void 0,
41
+ className: cn(fabVariants({
42
+ variant,
43
+ size,
44
+ position
45
+ }), visible ? "translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0", className),
46
+ ...props
47
+ });
48
+ }
49
+ export { Fab, fabVariants };
50
+
51
+ //# sourceMappingURL=fab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fab.js","names":[],"sources":["../../../src/ui/components/fab.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\nconst fabVariants = cva(\n \"group/fab inline-flex shrink-0 items-center justify-center rounded-primary shadow-[0_6px_16px_-2px_rgb(0_0_0/0.30),0_3px_6px_-2px_rgb(0_0_0/0.20)] dark:shadow-[0_6px_16px_-2px_rgb(0_0_0/0.45),0_3px_6px_-2px_rgb(0_0_0/0.30)] outline-none select-none cursor-pointer transition-all duration-300 ease-out focus-visible:ring-[3px] focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 hc:disabled:opacity-75 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"border border-border bg-card text-card-foreground hover:bg-muted\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n outline: \"border border-border bg-input/30 hover:bg-input/50 hover:text-foreground\",\n },\n size: {\n default: \"size-12 [&_svg:not([class*='size-'])]:size-6\",\n sm: \"size-10 [&_svg:not([class*='size-'])]:size-5\",\n lg: \"size-14 [&_svg:not([class*='size-'])]:size-7\",\n },\n position: {\n \"bottom-right\":\n \"fixed z-fab bottom-12 right-4 sm:bottom-14 lg:bottom-16 sm:right-5 lg:right-6\",\n \"bottom-left\": \"fixed z-fab bottom-12 left-4 sm:bottom-14 lg:bottom-16 sm:left-5 lg:left-6\",\n /** Stays in normal flow, so it lines up with whatever sits next to it. */\n inline: \"relative\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n position: \"bottom-right\",\n },\n },\n);\n\nfunction Fab({\n className,\n variant = \"default\",\n size = \"default\",\n position = \"bottom-right\",\n visible = true,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof fabVariants> & {\n visible?: boolean;\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot.Root : \"button\";\n\n return (\n <Comp\n data-slot=\"fab\"\n data-variant={variant}\n data-size={size}\n data-position={position}\n data-visible={visible}\n aria-hidden={!visible ? true : undefined}\n tabIndex={!visible ? -1 : undefined}\n className={cn(\n fabVariants({ variant, size, position }),\n visible\n ? \"translate-y-0 scale-100 opacity-100\"\n : \"pointer-events-none translate-y-4 scale-90 opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Fab, fabVariants };\n"],"mappings":";;;;;AAKA,IAAM,cAAc,IAClB,+eACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,SAAS;EACX;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;EACN;EACA,UAAU;GACR,gBACE;GACF,eAAe;;GAEf,QAAQ;EACV;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,UAAU;CACZ;AACF,CACF;AAEA,SAAS,IAAI,EACX,WACA,UAAU,WACV,OAAO,WACP,WAAW,gBACX,UAAU,MACV,UAAU,OACV,GAAG,SAKA;CACH,MAAM,OAAO,UAAU,KAAK,OAAO;CAEnC,OACE,oBAAC,MAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,iBAAe;EACf,gBAAc;EACd,eAAa,CAAC,UAAU,OAAO,KAAA;EAC/B,UAAU,CAAC,UAAU,KAAK,KAAA;EAC1B,WAAW,GACT,YAAY;GAAE;GAAS;GAAM;EAAS,CAAC,GACvC,UACI,wCACA,wDACJ,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,7 @@
1
+ import { Form as FormPrimitive } from "radix-ui";
2
+ declare const Form: import("react").ForwardRefExoticComponent<FormPrimitive.FormProps & import("react").RefAttributes<HTMLFormElement>>;
3
+ declare function FormField({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Field>): import("react").JSX.Element;
4
+ declare function FormLabel({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Label>): import("react").JSX.Element;
5
+ declare const FormControl: import("react").ForwardRefExoticComponent<FormPrimitive.FormControlProps & import("react").RefAttributes<HTMLInputElement>>;
6
+ declare function FormMessage({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Message>): import("react").JSX.Element;
7
+ export { Form, FormControl, FormField, FormLabel, FormMessage };
@@ -0,0 +1,107 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { Form } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/ui/components/form.tsx
7
+ var Form$1 = Form.Root;
8
+ function FormField(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("flex flex-col gap-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(Form.Field, {
30
+ "data-slot": "form-field",
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 FormLabel(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("text-sm font-medium text-muted-foreground", className);
56
+ $[3] = className;
57
+ $[4] = t1;
58
+ } else t1 = $[4];
59
+ let t2;
60
+ if ($[5] !== props || $[6] !== t1) {
61
+ t2 = /* @__PURE__ */ jsx(Form.Label, {
62
+ "data-slot": "form-label",
63
+ className: t1,
64
+ ...props
65
+ });
66
+ $[5] = props;
67
+ $[6] = t1;
68
+ $[7] = t2;
69
+ } else t2 = $[7];
70
+ return t2;
71
+ }
72
+ var FormControl = Form.Control;
73
+ function FormMessage(t0) {
74
+ const $ = c(8);
75
+ let className;
76
+ let props;
77
+ if ($[0] !== t0) {
78
+ ({className, ...props} = t0);
79
+ $[0] = t0;
80
+ $[1] = className;
81
+ $[2] = props;
82
+ } else {
83
+ className = $[1];
84
+ props = $[2];
85
+ }
86
+ let t1;
87
+ if ($[3] !== className) {
88
+ t1 = cn("text-xs text-destructive", className);
89
+ $[3] = className;
90
+ $[4] = t1;
91
+ } else t1 = $[4];
92
+ let t2;
93
+ if ($[5] !== props || $[6] !== t1) {
94
+ t2 = /* @__PURE__ */ jsx(Form.Message, {
95
+ "data-slot": "form-message",
96
+ className: t1,
97
+ ...props
98
+ });
99
+ $[5] = props;
100
+ $[6] = t1;
101
+ $[7] = t2;
102
+ } else t2 = $[7];
103
+ return t2;
104
+ }
105
+ export { Form$1 as Form, FormControl, FormField, FormLabel, FormMessage };
106
+
107
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","names":["c","_c","Form","FormPrimitive","cn","Root","FormField","t0","$","className","props","t1","t2","FormLabel","FormControl","Control","FormMessage","Form","FormPrimitive","_c"],"sources":["../../../src/ui/components/form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Form as FormPrimitive } from \"radix-ui\";\nimport { cn } from \"~/style/utils\";\n\nconst Form = FormPrimitive.Root;\n\nfunction FormField({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Field>) {\n return (\n <FormPrimitive.Field\n data-slot=\"form-field\"\n className={cn(\"flex flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Label>) {\n return (\n <FormPrimitive.Label\n data-slot=\"form-label\"\n className={cn(\"text-sm font-medium text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nconst FormControl = FormPrimitive.Control;\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<typeof FormPrimitive.Message>) {\n return (\n <FormPrimitive.Message\n data-slot=\"form-message\"\n className={cn(\"text-xs text-destructive\", className)}\n {...props}\n />\n );\n}\n\nexport { Form, FormControl, FormField, FormLabel, FormMessage };\n"],"mappings":";;;;;;AAKA,IAAME,SAAOC,KAAcE;AAE3B,SAAAC,UAAAC,IAAA;CAAA,MAAAC,IAAAP,EAAA,CAAA;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAE,WAAA,GAAAC,SAAAH;EAAyEC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAA;EAAAD,YAAAD,EAAA;EAAAE,QAAAF,EAAA;CAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAC,WAAA;EAI3EE,KAAAP,GAAG,uBAAuBK,SAAS;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAE,SAAAF,EAAA,OAAAG,IAAA;EAFjDC,KAAA,oBAAAM,KAAA,OAAA;GACY,aAAA;GACC,WAAAP;GAAoC,GAC3CD;EAAK,CAAA;EACTF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAJFI;AAIE;AAIN,SAAAC,U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;GACY,aAAA;GACC,WAAAP;GAAyC,GAChDD;EAAK,CAAA;EACTF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAJFI;AAIE"}
@@ -0,0 +1,9 @@
1
+ import type { IconSvgElement } from "@hugeicons/react";
2
+ type AppIconProps = {
3
+ icon: IconSvgElement | string;
4
+ className?: string;
5
+ useThemeColor?: boolean;
6
+ decorative?: boolean;
7
+ };
8
+ export declare function AppIcon({ icon, className, useThemeColor, decorative, }: AppIconProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,28 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { HugeiconsIcon } from "@hugeicons/react";
4
+ // src/ui/components/icon.tsx
5
+ function AppIcon({ icon, className, useThemeColor = false, decorative = true }) {
6
+ if (typeof icon === "string") return /* @__PURE__ */ jsx("span", {
7
+ "aria-hidden": decorative || void 0,
8
+ className: cn("inline-block", useThemeColor ? "bg-theme-600" : "bg-foreground", className),
9
+ style: {
10
+ maskImage: `url("${icon}")`,
11
+ maskSize: "contain",
12
+ maskRepeat: "no-repeat",
13
+ maskPosition: "center",
14
+ WebkitMaskImage: `url("${icon}")`,
15
+ WebkitMaskSize: "contain",
16
+ WebkitMaskRepeat: "no-repeat",
17
+ WebkitMaskPosition: "center"
18
+ }
19
+ });
20
+ return /* @__PURE__ */ jsx(HugeiconsIcon, {
21
+ icon,
22
+ "aria-hidden": decorative || void 0,
23
+ className: cn(useThemeColor ? "text-theme-600" : void 0, className)
24
+ });
25
+ }
26
+ export { AppIcon };
27
+
28
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","names":[],"sources":["../../../src/ui/components/icon.tsx"],"sourcesContent":["import type { IconSvgElement } from \"@hugeicons/react\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { cn } from \"~/style/utils\";\n\ntype AppIconProps = {\n icon: IconSvgElement | string;\n className?: string;\n useThemeColor?: boolean;\n decorative?: boolean;\n};\n\nexport function AppIcon({\n icon,\n className,\n useThemeColor = false,\n decorative = true,\n}: AppIconProps) {\n if (typeof icon === \"string\") {\n return (\n <span\n aria-hidden={decorative || undefined}\n className={cn(\"inline-block\", useThemeColor ? \"bg-theme-600\" : \"bg-foreground\", className)}\n style={{\n maskImage: `url(\"${icon}\")`,\n maskSize: \"contain\",\n maskRepeat: \"no-repeat\",\n maskPosition: \"center\",\n WebkitMaskImage: `url(\"${icon}\")`,\n WebkitMaskSize: \"contain\",\n WebkitMaskRepeat: \"no-repeat\",\n WebkitMaskPosition: \"center\",\n }}\n />\n );\n }\n\n return (\n <HugeiconsIcon\n icon={icon}\n aria-hidden={decorative || undefined}\n className={cn(useThemeColor ? \"text-theme-600\" : undefined, className)}\n />\n );\n}\n"],"mappings":";;;;AAWA,SAAgB,QAAQ,EACtB,MACA,WACA,gBAAgB,OAChB,aAAa,QACE;CACf,IAAI,OAAO,SAAS,UAClB,OACE,oBAAC,QAAD;EACE,eAAa,cAAc,KAAA;EAC3B,WAAW,GAAG,gBAAgB,gBAAgB,iBAAiB,iBAAiB,SAAS;EACzF,OAAO;GACL,WAAW,QAAQ,KAAK;GACxB,UAAU;GACV,YAAY;GACZ,cAAc;GACd,iBAAiB,QAAQ,KAAK;GAC9B,gBAAgB;GAChB,kBAAkB;GAClB,oBAAoB;EACtB;CACD,CAAA;CAIL,OACE,oBAAC,eAAD;EACQ;EACN,eAAa,cAAc,KAAA;EAC3B,WAAW,GAAG,gBAAgB,mBAAmB,KAAA,GAAW,SAAS;CACtE,CAAA;AAEL"}
@@ -0,0 +1,12 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ declare const inputVariants: (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
+ /**
8
+ * The native `size` attribute is a number, and intersecting it with the cva size
9
+ * scale leaves a prop nothing can satisfy, so it is omitted: the variant wins.
10
+ */
11
+ declare function Input({ className, variant, size, ...props }: Omit<React.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants>): React.JSX.Element;
12
+ export { Input, inputVariants };
@@ -0,0 +1,44 @@
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/input.tsx
5
+ var inputVariants = cva("flex w-full min-w-0 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: "h-9 px-3",
15
+ xs: "h-6 px-2.5 text-xs",
16
+ sm: "h-8 px-3",
17
+ lg: "h-10 px-4"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ size: "default"
23
+ }
24
+ });
25
+ /**
26
+ * The native `size` attribute is a number, and intersecting it with the cva size
27
+ * scale leaves a prop nothing can satisfy, so it is omitted: the variant wins.
28
+ */
29
+ function Input({ className, variant = "default", size = "default", ...props }) {
30
+ return /* @__PURE__ */ jsx("input", {
31
+ "data-slot": "input",
32
+ "data-variant": variant,
33
+ "data-size": size,
34
+ className: cn(inputVariants({
35
+ variant,
36
+ size,
37
+ className
38
+ })),
39
+ ...props
40
+ });
41
+ }
42
+ export { Input, inputVariants };
43
+
44
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../../src/ui/components/input.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\nconst inputVariants = cva(\n \"flex w-full min-w-0 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: \"h-9 px-3\",\n xs: \"h-6 px-2.5 text-xs\",\n sm: \"h-8 px-3\",\n lg: \"h-10 px-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\n/**\n * The native `size` attribute is a number, and intersecting it with the cva size\n * scale leaves a prop nothing can satisfy, so it is omitted: the variant wins.\n */\nfunction Input({\n className,\n variant = \"default\",\n size = \"default\",\n ...props\n}: Omit<React.ComponentProps<\"input\">, \"size\"> & VariantProps<typeof inputVariants>) {\n return (\n <input\n data-slot=\"input\"\n data-variant={variant}\n data-size={size}\n className={cn(inputVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Input, inputVariants };\n"],"mappings":";;;;AAIA,IAAM,gBAAgB,IACpB,6ZACA;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;;;;;AAMA,SAAS,MAAM,EACb,WACA,UAAU,WACV,OAAO,WACP,GAAG,SACgF;CACnF,OACE,oBAAC,SAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACX,WAAW,GAAG,cAAc;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EACzD,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ interface ModalProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ children: ReactNode;
6
+ className?: string;
7
+ /** Applied to the overlay, e.g. `overflow-y-auto` for a modal that can outgrow the screen. */
8
+ overlayClassName?: string;
9
+ showClose?: boolean;
10
+ title?: string;
11
+ }
12
+ /** Close icon for a custom close button inside a modal's content. */
13
+ declare function useModalCloseIcon(): [string, {
14
+ [key: string]: string | number;
15
+ }][] | readonly (readonly [string, {
16
+ readonly [key: string]: string | number;
17
+ }])[];
18
+ declare function Modal({ open, onClose, children, className, overlayClassName, showClose, title, }: ModalProps): import("react").JSX.Element;
19
+ export { Modal, useModalCloseIcon };
@@ -0,0 +1,144 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { Button } from "./button.js";
4
+ import { useCloseOnBack } from "../hooks/useCloseOnBack.js";
5
+ import { useReturnFocus } from "../hooks/useReturnFocus.js";
6
+ import { useBrucksLabels } from "../lib/labels.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { Dialog } from "radix-ui";
9
+ import { createContext, useContext } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { Cancel01Icon, ReplyAllIcon, ReplyIcon } from "@hugeicons/core-free-icons";
12
+ import { HugeiconsIcon } from "@hugeicons/react";
13
+ // src/ui/components/modal.tsx
14
+ /** Open modals around this point of the tree: 1 inside a modal, 2 inside one opened from it. */
15
+ var ModalDepthContext = createContext(0);
16
+ /** The first modal closes with an X; the second steps back with an upside-down arrow, deeper ones a stack. */
17
+ var closeIcon = (depth) => {
18
+ if (depth > 2) return ReplyAllIcon;
19
+ if (depth > 1) return ReplyIcon;
20
+ return Cancel01Icon;
21
+ };
22
+ /** Close icon for a custom close button inside a modal's content. */
23
+ function useModalCloseIcon() {
24
+ const $ = c(2);
25
+ const t0 = useContext(ModalDepthContext);
26
+ let t1;
27
+ if ($[0] !== t0) {
28
+ t1 = closeIcon(t0);
29
+ $[0] = t0;
30
+ $[1] = t1;
31
+ } else t1 = $[1];
32
+ return t1;
33
+ }
34
+ function Modal(t0) {
35
+ const $ = c(28);
36
+ const { open, onClose, children, className, overlayClassName, showClose, title } = t0;
37
+ const labels = useBrucksLabels();
38
+ const depth = useContext(ModalDepthContext) + 1;
39
+ useCloseOnBack(open, onClose);
40
+ const returnFocus = useReturnFocus();
41
+ let t1;
42
+ if ($[0] !== onClose) {
43
+ t1 = (next) => !next ? onClose() : void 0;
44
+ $[0] = onClose;
45
+ $[1] = t1;
46
+ } else t1 = $[1];
47
+ let t2;
48
+ if ($[2] !== overlayClassName) {
49
+ t2 = cn("fixed inset-0 z-dialog flex items-center justify-center bg-black/75", overlayClassName);
50
+ $[2] = overlayClassName;
51
+ $[3] = t2;
52
+ } else t2 = $[3];
53
+ let t3;
54
+ if ($[4] !== className) {
55
+ t3 = cn("relative overflow-hidden", className);
56
+ $[4] = className;
57
+ $[5] = t3;
58
+ } else t3 = $[5];
59
+ const t4 = title ?? labels.dialog;
60
+ let t5;
61
+ if ($[6] !== t4) {
62
+ t5 = /* @__PURE__ */ jsx(Dialog.Title, {
63
+ className: "sr-only",
64
+ children: t4
65
+ });
66
+ $[6] = t4;
67
+ $[7] = t5;
68
+ } else t5 = $[7];
69
+ let t6;
70
+ if ($[8] !== depth || $[9] !== labels || $[10] !== showClose) {
71
+ t6 = showClose ? /* @__PURE__ */ jsx("div", {
72
+ className: "flex justify-end px-4 pt-2 pb-2",
73
+ children: /* @__PURE__ */ jsx(Dialog.Close, {
74
+ asChild: true,
75
+ children: /* @__PURE__ */ jsx(Button, {
76
+ type: "button",
77
+ variant: "outline",
78
+ size: "icon-sm",
79
+ "aria-label": labels.close,
80
+ children: /* @__PURE__ */ jsx(HugeiconsIcon, { icon: closeIcon(depth) })
81
+ })
82
+ })
83
+ }) : null;
84
+ $[8] = depth;
85
+ $[9] = labels;
86
+ $[10] = showClose;
87
+ $[11] = t6;
88
+ } else t6 = $[11];
89
+ let t7;
90
+ if ($[12] !== children || $[13] !== depth) {
91
+ t7 = /* @__PURE__ */ jsx(ModalDepthContext.Provider, {
92
+ value: depth,
93
+ children
94
+ });
95
+ $[12] = children;
96
+ $[13] = depth;
97
+ $[14] = t7;
98
+ } else t7 = $[14];
99
+ let t8;
100
+ if ($[15] !== returnFocus || $[16] !== t3 || $[17] !== t5 || $[18] !== t6 || $[19] !== t7) {
101
+ t8 = /* @__PURE__ */ jsxs(Dialog.Content, {
102
+ ...returnFocus,
103
+ "aria-describedby": void 0,
104
+ className: t3,
105
+ children: [
106
+ t5,
107
+ t6,
108
+ t7
109
+ ]
110
+ });
111
+ $[15] = returnFocus;
112
+ $[16] = t3;
113
+ $[17] = t5;
114
+ $[18] = t6;
115
+ $[19] = t7;
116
+ $[20] = t8;
117
+ } else t8 = $[20];
118
+ let t9;
119
+ if ($[21] !== t2 || $[22] !== t8) {
120
+ t9 = /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsx(Dialog.Overlay, {
121
+ className: t2,
122
+ children: t8
123
+ }) });
124
+ $[21] = t2;
125
+ $[22] = t8;
126
+ $[23] = t9;
127
+ } else t9 = $[23];
128
+ let t10;
129
+ if ($[24] !== open || $[25] !== t1 || $[26] !== t9) {
130
+ t10 = /* @__PURE__ */ jsx(Dialog.Root, {
131
+ open,
132
+ onOpenChange: t1,
133
+ children: t9
134
+ });
135
+ $[24] = open;
136
+ $[25] = t1;
137
+ $[26] = t9;
138
+ $[27] = t10;
139
+ } else t10 = $[27];
140
+ return t10;
141
+ }
142
+ export { Modal, useModalCloseIcon };
143
+
144
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.js","names":["c","_c","Cancel01Icon","ReplyAllIcon","ReplyIcon","HugeiconsIcon","Dialog","createContext","ReactNode","useContext","cn","Button","useCloseOnBack","useReturnFocus","useBrucksLabels","ModalProps","open","onClose","children","className","overlayClassName","showClose","title","ModalDepthContext","closeIcon","depth","useModalCloseIcon","$","t0","t1","Modal","labels","returnFocus","next","undefined","t2","t3","t4","dialog","t5","t6","close","t7","t8","t9","t10","_c"],"sources":["../../../src/ui/components/modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { Cancel01Icon, ReplyAllIcon, ReplyIcon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { Dialog } from \"radix-ui\";\nimport { createContext, type ReactNode, useContext } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { Button } from \"~/ui/components/button\";\nimport { useCloseOnBack } from \"~/ui/hooks/useCloseOnBack\";\nimport { useReturnFocus } from \"~/ui/hooks/useReturnFocus\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ninterface ModalProps {\n open: boolean;\n onClose: () => void;\n children: ReactNode;\n className?: string;\n /** Applied to the overlay, e.g. `overflow-y-auto` for a modal that can outgrow the screen. */\n overlayClassName?: string;\n showClose?: boolean;\n title?: string;\n}\n\n/** Open modals around this point of the tree: 1 inside a modal, 2 inside one opened from it. */\nconst ModalDepthContext = createContext(0);\n\n/** The first modal closes with an X; the second steps back with an upside-down arrow, deeper ones a stack. */\nconst closeIcon = (depth: number) => {\n if (depth > 2) return ReplyAllIcon;\n if (depth > 1) return ReplyIcon;\n return Cancel01Icon;\n};\n\n/** Close icon for a custom close button inside a modal's content. */\nfunction useModalCloseIcon() {\n return closeIcon(useContext(ModalDepthContext));\n}\n\nfunction Modal({\n open,\n onClose,\n children,\n className,\n overlayClassName,\n showClose,\n title,\n}: ModalProps) {\n const labels = useBrucksLabels();\n const depth = useContext(ModalDepthContext) + 1;\n useCloseOnBack(open, onClose);\n const returnFocus = useReturnFocus();\n\n return (\n <Dialog.Root open={open} onOpenChange={(next) => (!next ? onClose() : undefined)}>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(\n \"fixed inset-0 z-dialog flex items-center justify-center bg-black/75\",\n overlayClassName,\n )}\n >\n <Dialog.Content\n {...returnFocus}\n aria-describedby={undefined}\n className={cn(\"relative overflow-hidden\", className)}\n >\n <Dialog.Title className=\"sr-only\">{title ?? labels.dialog}</Dialog.Title>\n {showClose ? (\n <div className=\"flex justify-end px-4 pt-2 pb-2\">\n <Dialog.Close asChild>\n <Button type=\"button\" variant=\"outline\" size=\"icon-sm\" aria-label={labels.close}>\n <HugeiconsIcon icon={closeIcon(depth)} />\n </Button>\n </Dialog.Close>\n </div>\n ) : null}\n <ModalDepthContext.Provider value={depth}>{children}</ModalDepthContext.Provider>\n </Dialog.Content>\n </Dialog.Overlay>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n\nexport { Modal, useModalCloseIcon };\n"],"mappings":";;;;;;;;;;;;;;AAwBA,IAAMuB,oBAAoBhB,cAAc,CAAC;;AAGzC,IAAMiB,aAAaC,UAAkB;CACnC,IAAIA,QAAQ,GAAG,OAAOtB;CACtB,IAAIsB,QAAQ,GAAG,OAAOrB;CACtB,OAAOF;AACT;;AAGA,SAAAwB,oBAAA;CAAA,MAAAC,IAAA1B,EAAA,CAAA;CACmB,MAAA2B,KAAAnB,WAAWc,iBAAiB;CAAC,IAAAM;CAAA,IAAAF,EAAA,OAAAC,IAAA;EAAvCC,KAAAL,UAAUI,EAA6B;EAACD,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAxCE;AAAwC;AAGjD,SAAAC,MAAAF,IAAA;CAAA,MAAAD,IAAA1B,EAAA,EAAA;CAAe,MAAA,EAAAe,MAAAC,SAAAC,UAAAC,WAAAC,kBAAAC,WAAAC,UAAAM;CASb,MA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AA,MAAAkB;CAAA,OAAAA,MAAAlB,EAAA;CAAA,OA3BdkB;AA2Bc"}
@@ -0,0 +1,6 @@
1
+ type NoteProps = {
2
+ text: string;
3
+ className?: string;
4
+ };
5
+ export declare function Note({ text, className }: NoteProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/ui/components/note.tsx
4
+ function Note({ text, className }) {
5
+ return /* @__PURE__ */ jsx("p", {
6
+ className: cn("bg-accent border border-border border-l-4 border-l-theme-500 rounded-secondary p-3 text-sm leading-relaxed italic whitespace-pre-line min-w-0 wrap-break-word", className),
7
+ children: text
8
+ });
9
+ }
10
+ export { Note };
11
+
12
+ //# sourceMappingURL=note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"note.js","names":[],"sources":["../../../src/ui/components/note.tsx"],"sourcesContent":["import { cn } from \"~/style/utils\";\n\ntype NoteProps = {\n text: string;\n className?: string;\n};\n\nexport function Note({ text, className }: NoteProps) {\n return (\n <p\n className={cn(\n \"bg-accent border border-border border-l-4 border-l-theme-500 rounded-secondary p-3 text-sm leading-relaxed italic whitespace-pre-line min-w-0 wrap-break-word\",\n className,\n )}\n >\n {text}\n </p>\n );\n}\n"],"mappings":";;;AAOA,SAAgB,KAAK,EAAE,MAAM,aAAwB;CACnD,OACE,oBAAC,KAAD;EACE,WAAW,GACT,iKACA,SACF;EAEC,UAAA;CACA,CAAA;AAEP"}
@@ -0,0 +1,15 @@
1
+ import { Popover as PopoverPrimitive } from "radix-ui";
2
+ import { type ReactNode } from "react";
3
+ type PopoverProps = {
4
+ trigger: ReactNode;
5
+ children: ReactNode;
6
+ className?: string;
7
+ title?: string;
8
+ /** Applied to the title, e.g. a display font. */
9
+ titleClassName?: string;
10
+ useCloseButton?: boolean;
11
+ };
12
+ declare function Popover({ trigger, children, className, title, titleClassName, useCloseButton, }: PopoverProps): import("react").JSX.Element;
13
+ /** Closes the surrounding popover; wrap an interactive child with `asChild`. */
14
+ declare const PopoverClose: import("react").ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
15
+ export { Popover, PopoverClose };