@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.
Files changed (160) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +274 -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/scrollToTopFab.d.ts +16 -0
  7. package/dist/blucks/components/scrollToTopFab.js +187 -0
  8. package/dist/blucks/components/scrollToTopFab.js.map +1 -0
  9. package/dist/blucks/components/settingsPickerModal.d.ts +11 -0
  10. package/dist/blucks/components/settingsPickerModal.js +49 -0
  11. package/dist/blucks/components/settingsPickerModal.js.map +1 -0
  12. package/dist/blucks/components/settingsRow.d.ts +12 -0
  13. package/dist/blucks/components/settingsRow.js +34 -0
  14. package/dist/blucks/components/settingsRow.js.map +1 -0
  15. package/dist/blucks/components/settingsSection.d.ts +8 -0
  16. package/dist/blucks/components/settingsSection.js +19 -0
  17. package/dist/blucks/components/settingsSection.js.map +1 -0
  18. package/dist/blucks/components/settingsSwatchButton.d.ts +10 -0
  19. package/dist/blucks/components/settingsSwatchButton.js +38 -0
  20. package/dist/blucks/components/settingsSwatchButton.js.map +1 -0
  21. package/dist/blucks/hooks/useDisclosure.d.ts +5 -0
  22. package/dist/blucks/hooks/useDisclosure.js +34 -0
  23. package/dist/blucks/hooks/useDisclosure.js.map +1 -0
  24. package/dist/blucks/hooks/useScrollAncestor.d.ts +3 -0
  25. package/dist/blucks/hooks/useScrollAncestor.js +40 -0
  26. package/dist/blucks/hooks/useScrollAncestor.js.map +1 -0
  27. package/dist/blucks/index.d.ts +12 -0
  28. package/dist/blucks/index.js +13 -0
  29. package/dist/blucks/layout/appLayout.d.ts +16 -0
  30. package/dist/blucks/layout/appLayout.js +93 -0
  31. package/dist/blucks/layout/appLayout.js.map +1 -0
  32. package/dist/blucks/layout/footer.d.ts +7 -0
  33. package/dist/blucks/layout/footer.js +18 -0
  34. package/dist/blucks/layout/footer.js.map +1 -0
  35. package/dist/blucks/layout/header.d.ts +22 -0
  36. package/dist/blucks/layout/header.js +121 -0
  37. package/dist/blucks/layout/header.js.map +1 -0
  38. package/dist/blucks/lib/utils.d.ts +6 -0
  39. package/dist/blucks/lib/utils.js +12 -0
  40. package/dist/blucks/lib/utils.js.map +1 -0
  41. package/dist/style/index.d.ts +4 -0
  42. package/dist/style/index.js +5 -0
  43. package/dist/style/settings.d.ts +105 -0
  44. package/dist/style/settings.js +156 -0
  45. package/dist/style/settings.js.map +1 -0
  46. package/dist/style/styles.d.ts +6 -0
  47. package/dist/style/styles.js +10 -0
  48. package/dist/style/styles.js.map +1 -0
  49. package/dist/style/theme.css +1449 -0
  50. package/dist/style/types.d.ts +6 -0
  51. package/dist/style/types.js +9 -0
  52. package/dist/style/types.js.map +1 -0
  53. package/dist/style/utils.d.ts +2 -0
  54. package/dist/style/utils.js +28 -0
  55. package/dist/style/utils.js.map +1 -0
  56. package/dist/ui/components/accordion.d.ts +81 -0
  57. package/dist/ui/components/accordion.js +449 -0
  58. package/dist/ui/components/accordion.js.map +1 -0
  59. package/dist/ui/components/alertDialog.d.ts +17 -0
  60. package/dist/ui/components/alertDialog.js +134 -0
  61. package/dist/ui/components/alertDialog.js.map +1 -0
  62. package/dist/ui/components/button.d.ts +10 -0
  63. package/dist/ui/components/button.js +51 -0
  64. package/dist/ui/components/button.js.map +1 -0
  65. package/dist/ui/components/checkbox.d.ts +3 -0
  66. package/dist/ui/components/checkbox.js +56 -0
  67. package/dist/ui/components/checkbox.js.map +1 -0
  68. package/dist/ui/components/chip.d.ts +13 -0
  69. package/dist/ui/components/chip.js +26 -0
  70. package/dist/ui/components/chip.js.map +1 -0
  71. package/dist/ui/components/collapsible.d.ts +22 -0
  72. package/dist/ui/components/collapsible.js +197 -0
  73. package/dist/ui/components/collapsible.js.map +1 -0
  74. package/dist/ui/components/drawer.d.ts +13 -0
  75. package/dist/ui/components/drawer.js +81 -0
  76. package/dist/ui/components/drawer.js.map +1 -0
  77. package/dist/ui/components/fab.d.ts +12 -0
  78. package/dist/ui/components/fab.js +51 -0
  79. package/dist/ui/components/fab.js.map +1 -0
  80. package/dist/ui/components/form.d.ts +7 -0
  81. package/dist/ui/components/form.js +107 -0
  82. package/dist/ui/components/form.js.map +1 -0
  83. package/dist/ui/components/icon.d.ts +9 -0
  84. package/dist/ui/components/icon.js +28 -0
  85. package/dist/ui/components/icon.js.map +1 -0
  86. package/dist/ui/components/input.d.ts +12 -0
  87. package/dist/ui/components/input.js +44 -0
  88. package/dist/ui/components/input.js.map +1 -0
  89. package/dist/ui/components/loader.d.ts +15 -0
  90. package/dist/ui/components/loader.js +27 -0
  91. package/dist/ui/components/loader.js.map +1 -0
  92. package/dist/ui/components/modal.d.ts +19 -0
  93. package/dist/ui/components/modal.js +144 -0
  94. package/dist/ui/components/modal.js.map +1 -0
  95. package/dist/ui/components/note.d.ts +6 -0
  96. package/dist/ui/components/note.js +12 -0
  97. package/dist/ui/components/note.js.map +1 -0
  98. package/dist/ui/components/popover.d.ts +15 -0
  99. package/dist/ui/components/popover.js +110 -0
  100. package/dist/ui/components/popover.js.map +1 -0
  101. package/dist/ui/components/progress.d.ts +11 -0
  102. package/dist/ui/components/progress.js +87 -0
  103. package/dist/ui/components/progress.js.map +1 -0
  104. package/dist/ui/components/radioGroup.d.ts +4 -0
  105. package/dist/ui/components/radioGroup.js +82 -0
  106. package/dist/ui/components/radioGroup.js.map +1 -0
  107. package/dist/ui/components/scrollArea.d.ts +29 -0
  108. package/dist/ui/components/scrollArea.js +185 -0
  109. package/dist/ui/components/scrollArea.js.map +1 -0
  110. package/dist/ui/components/select.d.ts +23 -0
  111. package/dist/ui/components/select.js +198 -0
  112. package/dist/ui/components/select.js.map +1 -0
  113. package/dist/ui/components/separator.d.ts +4 -0
  114. package/dist/ui/components/separator.js +48 -0
  115. package/dist/ui/components/separator.js.map +1 -0
  116. package/dist/ui/components/slider.d.ts +26 -0
  117. package/dist/ui/components/slider.js +228 -0
  118. package/dist/ui/components/slider.js.map +1 -0
  119. package/dist/ui/components/sortableList.d.ts +13 -0
  120. package/dist/ui/components/sortableList.js +116 -0
  121. package/dist/ui/components/sortableList.js.map +1 -0
  122. package/dist/ui/components/sortableListRow.d.ts +8 -0
  123. package/dist/ui/components/sortableListRow.js +79 -0
  124. package/dist/ui/components/sortableListRow.js.map +1 -0
  125. package/dist/ui/components/switch.d.ts +3 -0
  126. package/dist/ui/components/switch.js +47 -0
  127. package/dist/ui/components/switch.js.map +1 -0
  128. package/dist/ui/components/tabs.d.ts +7 -0
  129. package/dist/ui/components/tabs.js +106 -0
  130. package/dist/ui/components/tabs.js.map +1 -0
  131. package/dist/ui/components/textarea.d.ts +8 -0
  132. package/dist/ui/components/textarea.js +40 -0
  133. package/dist/ui/components/textarea.js.map +1 -0
  134. package/dist/ui/components/toast.d.ts +13 -0
  135. package/dist/ui/components/toast.js +136 -0
  136. package/dist/ui/components/toast.js.map +1 -0
  137. package/dist/ui/components/toggle-group.d.ts +11 -0
  138. package/dist/ui/components/toggle-group.js +158 -0
  139. package/dist/ui/components/toggle-group.js.map +1 -0
  140. package/dist/ui/components/toggle.d.ts +12 -0
  141. package/dist/ui/components/toggle.js +48 -0
  142. package/dist/ui/components/toggle.js.map +1 -0
  143. package/dist/ui/components/tooltip.d.ts +8 -0
  144. package/dist/ui/components/tooltip.js +59 -0
  145. package/dist/ui/components/tooltip.js.map +1 -0
  146. package/dist/ui/hooks/useCloseOnBack.d.ts +7 -0
  147. package/dist/ui/hooks/useCloseOnBack.js +46 -0
  148. package/dist/ui/hooks/useCloseOnBack.js.map +1 -0
  149. package/dist/ui/hooks/useReturnFocus.d.ts +9 -0
  150. package/dist/ui/hooks/useReturnFocus.js +30 -0
  151. package/dist/ui/hooks/useReturnFocus.js.map +1 -0
  152. package/dist/ui/index.d.ts +33 -0
  153. package/dist/ui/index.js +34 -0
  154. package/dist/ui/lib/defaultLabels.d.ts +31 -0
  155. package/dist/ui/lib/defaultLabels.js +16 -0
  156. package/dist/ui/lib/defaultLabels.js.map +1 -0
  157. package/dist/ui/lib/labels.d.ts +10 -0
  158. package/dist/ui/lib/labels.js +37 -0
  159. package/dist/ui/lib/labels.js.map +1 -0
  160. package/package.json +79 -4
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { Modal } from "../../ui/components/modal.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/blucks/components/settingsPickerModal.tsx
7
+ function SettingsPickerModal(t0) {
8
+ const $ = c(10);
9
+ const { open, title, onClose, gridClassName, children } = t0;
10
+ let t1;
11
+ if ($[0] !== gridClassName) {
12
+ t1 = cn("grid gap-2", gridClassName);
13
+ $[0] = gridClassName;
14
+ $[1] = t1;
15
+ } else t1 = $[1];
16
+ let t2;
17
+ if ($[2] !== children || $[3] !== t1) {
18
+ t2 = /* @__PURE__ */ jsx("div", {
19
+ className: "px-4 pb-4",
20
+ children: /* @__PURE__ */ jsx("div", {
21
+ className: t1,
22
+ children
23
+ })
24
+ });
25
+ $[2] = children;
26
+ $[3] = t1;
27
+ $[4] = t2;
28
+ } else t2 = $[4];
29
+ let t3;
30
+ if ($[5] !== onClose || $[6] !== open || $[7] !== t2 || $[8] !== title) {
31
+ t3 = /* @__PURE__ */ jsx(Modal, {
32
+ open,
33
+ onClose,
34
+ title,
35
+ showClose: true,
36
+ className: "max-w-2xl mx-4 max-h-[80dvh] w-full rounded-primary overflow-y-auto bg-background border border-border",
37
+ children: t2
38
+ });
39
+ $[5] = onClose;
40
+ $[6] = open;
41
+ $[7] = t2;
42
+ $[8] = title;
43
+ $[9] = t3;
44
+ } else t3 = $[9];
45
+ return t3;
46
+ }
47
+ export { SettingsPickerModal };
48
+
49
+ //# sourceMappingURL=settingsPickerModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsPickerModal.js","names":["c","_c","ReactNode","cn","Modal","SettingsPickerModalProps","open","title","onClose","gridClassName","children","SettingsPickerModal","t0","$","t1","t2","t3","_c"],"sources":["../../../src/blucks/components/settingsPickerModal.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { Modal } from \"~/ui/components/modal\";\n\ninterface SettingsPickerModalProps {\n open: boolean;\n /** Names the dialog; without it brucks falls back to the generic \"Dialog\". */\n title: string;\n onClose: () => void;\n gridClassName: string;\n children: ReactNode;\n}\n\nfunction SettingsPickerModal({\n open,\n title,\n onClose,\n gridClassName,\n children,\n}: SettingsPickerModalProps) {\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={title}\n showClose\n className=\"max-w-2xl mx-4 max-h-[80dvh] w-full rounded-primary overflow-y-auto bg-background border border-border\"\n >\n <div className=\"px-4 pb-4\">\n <div className={cn(\"grid gap-2\", gridClassName)}>{children}</div>\n </div>\n </Modal>\n );\n}\n\nexport { SettingsPickerModal };\n"],"mappings":";;;;;;AAeA,SAAAW,oBAAAC,IAAA;CAAA,MAAAC,IAAAZ,EAAA,EAAA;CAA6B,MAAA,EAAAK,MAAAC,OAAAC,SAAAC,eAAAC,aAAAE;CAMF,IAAAE;CAAA,IAAAD,EAAA,OAAAJ,eAAA;EAUHK,KAAAX,GAAG,cAAcM,aAAa;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAH,YAAAG,EAAA,OAAAC,IAAA;EADjDC,KAAA,oBAAA,OAAA;GAAe,WAAA;GACb,UAAA,oBAAA,OAAA;IAAgB,WAAAD;IAAkCJ;GAAe,CAAA;EAC7D,CAAA;EAAAG,EAAA,KAAAH;EAAAG,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAL,WAAAK,EAAA,OAAAP,QAAAO,EAAA,OAAAE,MAAAF,EAAA,OAAAN,OAAA;EATRS,KAAA,oBAAC,OAAD;GACQV;GACGE;GACFD;GACP,WAAA;GACU,WAAA;GAEVQ,UAAAA;EAPI,CAAA;EAUEF,EAAA,KAAAL;EAAAK,EAAA,KAAAP;EAAAO,EAAA,KAAAE;EAAAF,EAAA,KAAAN;EAAAM,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAVRG;AAUQ"}
@@ -0,0 +1,12 @@
1
+ import { type IconSvgElement } from "@hugeicons/react";
2
+ import type { ReactNode } from "react";
3
+ interface SettingsRowProps {
4
+ label: string;
5
+ value: string;
6
+ icon?: IconSvgElement;
7
+ stacked?: boolean;
8
+ action?: ReactNode;
9
+ children: ReactNode;
10
+ }
11
+ declare function SettingsRow({ label, value, icon, stacked, action, children }: SettingsRowProps): import("react").JSX.Element;
12
+ export { SettingsRow };
@@ -0,0 +1,34 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { HugeiconsIcon } from "@hugeicons/react";
3
+ // src/blucks/components/settingsRow.tsx
4
+ function SettingsRow({ label, value, icon, stacked, action, children }) {
5
+ const text = /* @__PURE__ */ jsxs("div", {
6
+ className: "flex items-center gap-3",
7
+ children: [icon ? /* @__PURE__ */ jsx(HugeiconsIcon, {
8
+ icon,
9
+ className: "size-6 text-theme-600"
10
+ }) : null, /* @__PURE__ */ jsxs("div", {
11
+ className: "flex flex-col gap-1",
12
+ children: [/* @__PURE__ */ jsx("p", {
13
+ className: "text-sm font-medium text-foreground",
14
+ children: label
15
+ }), /* @__PURE__ */ jsx("p", {
16
+ className: "text-sm font-medium text-muted-foreground",
17
+ children: value
18
+ })]
19
+ })]
20
+ });
21
+ return stacked ? /* @__PURE__ */ jsxs("div", {
22
+ className: "flex flex-col gap-3 px-4",
23
+ children: [/* @__PURE__ */ jsxs("div", {
24
+ className: "flex items-center justify-between gap-4",
25
+ children: [text, action]
26
+ }), children]
27
+ }) : /* @__PURE__ */ jsxs("div", {
28
+ className: "flex items-center justify-between gap-4 px-4",
29
+ children: [text, children]
30
+ });
31
+ }
32
+ export { SettingsRow };
33
+
34
+ //# sourceMappingURL=settingsRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsRow.js","names":[],"sources":["../../../src/blucks/components/settingsRow.tsx"],"sourcesContent":["import { HugeiconsIcon, type IconSvgElement } from \"@hugeicons/react\";\nimport type { ReactNode } from \"react\";\n\ninterface SettingsRowProps {\n label: string;\n value: string;\n icon?: IconSvgElement;\n stacked?: boolean;\n action?: ReactNode;\n children: ReactNode;\n}\n\nfunction SettingsRow({ label, value, icon, stacked, action, children }: SettingsRowProps) {\n const text = (\n <div className=\"flex items-center gap-3\">\n {icon ? <HugeiconsIcon icon={icon} className=\"size-6 text-theme-600\" /> : null}\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm font-medium text-foreground\">{label}</p>\n <p className=\"text-sm font-medium text-muted-foreground\">{value}</p>\n </div>\n </div>\n );\n\n return stacked ? (\n <div className=\"flex flex-col gap-3 px-4\">\n <div className=\"flex items-center justify-between gap-4\">\n {text}\n {action}\n </div>\n {children}\n </div>\n ) : (\n <div className=\"flex items-center justify-between gap-4 px-4\">\n {text}\n {children}\n </div>\n );\n}\n\nexport { SettingsRow };\n"],"mappings":";;;AAYA,SAAS,YAAY,EAAE,OAAO,OAAO,MAAM,SAAS,QAAQ,YAA8B;CACxF,MAAM,OACJ,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,OAAO,oBAAC,eAAD;GAAqB;GAAM,WAAU;EAAyB,CAAA,IAAI,MAC1E,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,KAAD;IAAG,WAAU;IAAuC,UAAA;GAAS,CAAA,GAC7D,oBAAC,KAAD;IAAG,WAAU;IAA6C,UAAA;GAAS,CAAA,CAChE;EACF,CAAA,CAAA;;CAGP,OAAO,UACL,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,MACA,MACE;EACJ,CAAA,GAAA,QACE;CAEL,CAAA,IAAA,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,MACA,QACE;;AAET"}
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ interface SettingsSectionProps {
3
+ id: string;
4
+ title: string;
5
+ children: ReactNode;
6
+ }
7
+ declare function SettingsSection({ id, title, children }: SettingsSectionProps): import("react").JSX.Element;
8
+ export { SettingsSection };
@@ -0,0 +1,19 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ // src/blucks/components/settingsSection.tsx
3
+ function SettingsSection({ id, title, children }) {
4
+ return /* @__PURE__ */ jsxs("section", {
5
+ "aria-labelledby": id,
6
+ className: "flex flex-col gap-2 rounded-primary bg-card border border-border py-3",
7
+ children: [/* @__PURE__ */ jsx("h2", {
8
+ id,
9
+ className: "text-xl font-semibold text-muted-foreground px-4",
10
+ children: title
11
+ }), /* @__PURE__ */ jsx("div", {
12
+ className: "flex flex-col gap-2",
13
+ children
14
+ })]
15
+ });
16
+ }
17
+ export { SettingsSection };
18
+
19
+ //# sourceMappingURL=settingsSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsSection.js","names":[],"sources":["../../../src/blucks/components/settingsSection.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\ninterface SettingsSectionProps {\n id: string;\n title: string;\n children: ReactNode;\n}\n\nfunction SettingsSection({ id, title, children }: SettingsSectionProps) {\n return (\n <section\n aria-labelledby={id}\n className=\"flex flex-col gap-2 rounded-primary bg-card border border-border py-3\"\n >\n <h2 id={id} className=\"text-xl font-semibold text-muted-foreground px-4\">\n {title}\n </h2>\n <div className=\"flex flex-col gap-2\">{children}</div>\n </section>\n );\n}\n\nexport { SettingsSection };\n"],"mappings":";;AAQA,SAAS,gBAAgB,EAAE,IAAI,OAAO,YAAkC;CACtE,OACE,qBAAC,WAAD;EACE,mBAAiB;EACjB,WAAU;EAFZ,UAAA,CAIE,oBAAC,MAAD;GAAQ;GAAI,WAAU;GACnB,UAAA;EACC,CAAA,GACJ,oBAAC,OAAD;GAAK,WAAU;GAAuB;EAAc,CAAA,CAC7C;;AAEb"}
@@ -0,0 +1,10 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ interface SettingsSwatchButtonProps {
3
+ selected: boolean;
4
+ style: CSSProperties;
5
+ onClick: () => void;
6
+ className?: string;
7
+ children: ReactNode;
8
+ }
9
+ declare function SettingsSwatchButton({ selected, style, onClick, className, children, }: SettingsSwatchButtonProps): import("react").JSX.Element;
10
+ export { SettingsSwatchButton };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { Button } from "../../ui/components/button.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx } from "react/jsx-runtime";
6
+ // src/blucks/components/settingsSwatchButton.tsx
7
+ function SettingsSwatchButton(t0) {
8
+ const $ = c(8);
9
+ const { selected, style, onClick, className, children } = t0;
10
+ let t1;
11
+ if ($[0] !== className) {
12
+ t1 = cn("relative isolate w-full h-auto aspect-4/3 after:content-[''] after:absolute after:inset-0 after:-z-10 after:transition-colors hover:after:bg-black/25 overflow-hidden hc:[&>span]:bg-background hc:[&>span]:text-foreground hc:[&>span]:px-1.5 hc:[&>span]:rounded-secondary hc:aria-pressed:outline-solid hc:aria-pressed:outline-4 hc:aria-pressed:outline-offset-2 hc:aria-pressed:outline-foreground", className);
13
+ $[0] = className;
14
+ $[1] = t1;
15
+ } else t1 = $[1];
16
+ let t2;
17
+ if ($[2] !== children || $[3] !== onClick || $[4] !== selected || $[5] !== style || $[6] !== t1) {
18
+ t2 = /* @__PURE__ */ jsx(Button, {
19
+ type: "button",
20
+ variant: "ghost",
21
+ "aria-pressed": selected,
22
+ style,
23
+ className: t1,
24
+ onClick,
25
+ children
26
+ });
27
+ $[2] = children;
28
+ $[3] = onClick;
29
+ $[4] = selected;
30
+ $[5] = style;
31
+ $[6] = t1;
32
+ $[7] = t2;
33
+ } else t2 = $[7];
34
+ return t2;
35
+ }
36
+ export { SettingsSwatchButton };
37
+
38
+ //# sourceMappingURL=settingsSwatchButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsSwatchButton.js","names":["c","_c","CSSProperties","ReactNode","cn","Button","SettingsSwatchButtonProps","selected","style","onClick","className","children","SettingsSwatchButton","t0","$","t1","t2","_c"],"sources":["../../../src/blucks/components/settingsSwatchButton.tsx"],"sourcesContent":["\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { cn } from \"~/style/utils\";\nimport { Button } from \"~/ui/components/button\";\n\ninterface SettingsSwatchButtonProps {\n selected: boolean;\n style: CSSProperties;\n onClick: () => void;\n className?: string;\n children: ReactNode;\n}\n\nfunction SettingsSwatchButton({\n selected,\n style,\n onClick,\n className,\n children,\n}: SettingsSwatchButtonProps) {\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n aria-pressed={selected}\n style={style}\n className={cn(\n \"relative isolate w-full h-auto aspect-4/3 after:content-[''] after:absolute after:inset-0 after:-z-10 after:transition-colors hover:after:bg-black/25 overflow-hidden hc:[&>span]:bg-background hc:[&>span]:text-foreground hc:[&>span]:px-1.5 hc:[&>span]:rounded-secondary hc:aria-pressed:outline-solid hc:aria-pressed:outline-4 hc:aria-pressed:outline-offset-2 hc:aria-pressed:outline-foreground\",\n className,\n )}\n onClick={onClick}\n >\n {children}\n </Button>\n );\n}\n\nexport { SettingsSwatchButton };\n"],"mappings":";;;;;;AAcA,SAAAY,qBAAAC,IAAA;CAAA,MAAAC,IAAAb,EAAA,CAAA;CAA8B,MAAA,EAAAM,UAAAC,OAAAC,SAAAC,WAAAC,aAAAE;CAMF,IAAAE;CAAA,IAAAD,EAAA,OAAAJ,WAAA;EAOXK,KAAAX,GACT,4YACAM,SACF;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAH,YAAAG,EAAA,OAAAL,WAAAK,EAAA,OAAAP,YAAAO,EAAA,OAAAN,SAAAM,EAAA,OAAAC,IAAA;EARHC,KAAA,oBAAC,QAAD;GACO,MAAA;GACG,SAAA;GACMT,gBAAAA;GACPC;GACI,WAAAO;GAIFN;GAERE;EAXI,CAAA;EAYEG,EAAA,KAAAH;EAAAG,EAAA,KAAAL;EAAAK,EAAA,KAAAP;EAAAO,EAAA,KAAAN;EAAAM,EAAA,KAAAC;EAAAD,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAZTE;AAYS"}
@@ -0,0 +1,5 @@
1
+ export declare function useDisclosure(initialOpen?: boolean): {
2
+ isOpen: boolean;
3
+ open: () => void;
4
+ close: () => void;
5
+ };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useState } from "react";
4
+ // src/blucks/hooks/useDisclosure.ts
5
+ function useDisclosure(t0) {
6
+ const $ = c(4);
7
+ const [isOpen, setIsOpen] = useState(t0 === void 0 ? false : t0);
8
+ let t1;
9
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
+ t1 = () => setIsOpen(true);
11
+ $[0] = t1;
12
+ } else t1 = $[0];
13
+ const open = t1;
14
+ let t2;
15
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
16
+ t2 = () => setIsOpen(false);
17
+ $[1] = t2;
18
+ } else t2 = $[1];
19
+ const close = t2;
20
+ let t3;
21
+ if ($[2] !== isOpen) {
22
+ t3 = {
23
+ isOpen,
24
+ open,
25
+ close
26
+ };
27
+ $[2] = isOpen;
28
+ $[3] = t3;
29
+ } else t3 = $[3];
30
+ return t3;
31
+ }
32
+ export { useDisclosure };
33
+
34
+ //# sourceMappingURL=useDisclosure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDisclosure.js","names":["c","_c","useCallback","useState","useDisclosure","t0","$","initialOpen","undefined","isOpen","setIsOpen","t1","Symbol","for","open","t2","close","t3","_c"],"sources":["../../../src/blucks/hooks/useDisclosure.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\n\nexport function useDisclosure(initialOpen = false) {\n const [isOpen, setIsOpen] = useState(initialOpen);\n const open = useCallback(() => setIsOpen(true), []);\n const close = useCallback(() => setIsOpen(false), []);\n\n return { isOpen, open, close };\n}\n"],"mappings":";;;;AAIA,SAAOI,cAAAC,IAAA;CAAA,MAAAC,IAAAL,EAAA,CAAA;CACL,MAAA,CAAAQ,QAAAC,aAA4BP,SADAE,OAAAG,KAAAA,IAAA,QAAAH,EACoB;CAAE,IAAAM;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EACzBF,WAAMD,UAAU,IAAI;EAACJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAA9C,MAAAQ,OAAaH;CAAuC,IAAAI;CAAA,IAAAT,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAC1BE,WAAML,UAAU,KAAK;EAACJ,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAhD,MAAAU,QAAcD;CAAwC,IAAAE;CAAA,IAAAX,EAAA,OAAAG,QAAA;EAE/CQ,KAAA;GAAAR;GAAAK;GAAAE;EAAsB;EAACV,EAAA,KAAAG;EAAAH,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAAvBW;AAAuB"}
@@ -0,0 +1,3 @@
1
+ import { type RefObject } from "react";
2
+ /** Nearest scrollable ancestor of `ref`, or the document element when none scrolls. */
3
+ export declare function useScrollAncestor(ref: RefObject<HTMLElement | null>): HTMLElement | null;
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useEffect, useState } from "react";
4
+ // src/blucks/hooks/useScrollAncestor.ts
5
+ function isScrollable(element) {
6
+ const { overflowY } = window.getComputedStyle(element);
7
+ return overflowY === "auto" || overflowY === "scroll";
8
+ }
9
+ /** Nearest scrollable ancestor of `ref`, or the document element when none scrolls. */
10
+ function useScrollAncestor(ref) {
11
+ const $ = c(3);
12
+ const [scrollAncestor, setScrollAncestor] = useState(null);
13
+ let t0;
14
+ let t1;
15
+ if ($[0] !== ref) {
16
+ t0 = () => {
17
+ let current = ref.current?.parentElement ?? null;
18
+ while (current) {
19
+ if (isScrollable(current)) {
20
+ setScrollAncestor(current);
21
+ return;
22
+ }
23
+ current = current.parentElement;
24
+ }
25
+ setScrollAncestor(document.documentElement);
26
+ };
27
+ t1 = [ref];
28
+ $[0] = ref;
29
+ $[1] = t0;
30
+ $[2] = t1;
31
+ } else {
32
+ t0 = $[1];
33
+ t1 = $[2];
34
+ }
35
+ useEffect(t0, t1);
36
+ return scrollAncestor;
37
+ }
38
+ export { useScrollAncestor };
39
+
40
+ //# sourceMappingURL=useScrollAncestor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollAncestor.js","names":["c","_c","RefObject","useEffect","useState","isScrollable","element","HTMLElement","overflowY","window","getComputedStyle","useScrollAncestor","ref","$","scrollAncestor","setScrollAncestor","t0","t1","current","parentElement","document","documentElement","_c"],"sources":["../../../src/blucks/hooks/useScrollAncestor.ts"],"sourcesContent":["\"use client\";\n\nimport { type RefObject, useEffect, useState } from \"react\";\n\nfunction isScrollable(element: HTMLElement) {\n const { overflowY } = window.getComputedStyle(element);\n return overflowY === \"auto\" || overflowY === \"scroll\";\n}\n\n/** Nearest scrollable ancestor of `ref`, or the document element when none scrolls. */\nexport function useScrollAncestor(ref: RefObject<HTMLElement | null>) {\n const [scrollAncestor, setScrollAncestor] = useState<HTMLElement | null>(null);\n\n useEffect(() => {\n let current = ref.current?.parentElement ?? null;\n\n while (current) {\n if (isScrollable(current)) {\n setScrollAncestor(current);\n return;\n }\n current = current.parentElement;\n }\n\n setScrollAncestor(document.documentElement);\n }, [ref]);\n\n return scrollAncestor;\n}\n"],"mappings":";;;;AAIA,SAASK,aAAaC,SAAsB;CAC1C,MAAM,EAAEE,cAAcC,OAAOC,iBAAiBJ,OAAO;CACrD,OAAOE,cAAc,UAAUA,cAAc;AAC/C;;AAGA,SAAOG,kBAAAC,KAAA;CAAA,MAAAC,IAAAZ,EAAA,CAAA;CACL,MAAA,CAAAa,gBAAAC,qBAA4CX,SAA6B,IAAI;CAAE,IAAAY;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,KAAA;EAErEI,WAAA;GACR,IAAAE,UAAcN,IAAGM,SAAuBC,iBAA1B;GAEd,OAAOD,SAAO;IACZ,IAAIb,aAAaa,OAAO,GAAC;KACvBH,kBAAkBG,OAAO;KAAC;IAAA;IAG5BA,UAAUA,QAAOC;GAAV;GAGTJ,kBAAkBK,SAAQC,eAAgB;EAAC;EAC1CJ,KAAA,CAACL,GAAG;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAD,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAZRV,UAAUa,IAYPC,EAAK;CAAC,OAEFH;AAAc"}
@@ -0,0 +1,12 @@
1
+ export { HomeCard, type HomeCardProps } from "./components/homeCard";
2
+ export { ScrollToTopFab } from "./components/scrollToTopFab";
3
+ export { SettingsPickerModal } from "./components/settingsPickerModal";
4
+ export { SettingsRow } from "./components/settingsRow";
5
+ export { SettingsSection } from "./components/settingsSection";
6
+ export { SettingsSwatchButton } from "./components/settingsSwatchButton";
7
+ export { useDisclosure } from "./hooks/useDisclosure";
8
+ export { useScrollAncestor } from "./hooks/useScrollAncestor";
9
+ export { AppLayout } from "./layout/appLayout";
10
+ export { Footer } from "./layout/footer";
11
+ export { Header } from "./layout/header";
12
+ export { isKeyOf } from "./lib/utils";
@@ -0,0 +1,13 @@
1
+ import { HomeCard } from "./components/homeCard.js";
2
+ import { useScrollAncestor } from "./hooks/useScrollAncestor.js";
3
+ import { ScrollToTopFab } from "./components/scrollToTopFab.js";
4
+ import { SettingsPickerModal } from "./components/settingsPickerModal.js";
5
+ import { SettingsRow } from "./components/settingsRow.js";
6
+ import { SettingsSection } from "./components/settingsSection.js";
7
+ import { SettingsSwatchButton } from "./components/settingsSwatchButton.js";
8
+ import { useDisclosure } from "./hooks/useDisclosure.js";
9
+ import { AppLayout } from "./layout/appLayout.js";
10
+ import { Footer } from "./layout/footer.js";
11
+ import { Header } from "./layout/header.js";
12
+ import { isKeyOf } from "./lib/utils.js";
13
+ export { AppLayout, Footer, Header, HomeCard, ScrollToTopFab, SettingsPickerModal, SettingsRow, SettingsSection, SettingsSwatchButton, isKeyOf, useDisclosure, useScrollAncestor };
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ import { type Side } from "../../style/types";
3
+ interface AppLayoutProps {
4
+ children: ReactNode;
5
+ /** A sticky Header. `main` starts under its rounded corners, so the page scrolls on behind them. */
6
+ header?: ReactNode;
7
+ /** Below `main`, e.g. a sticky Footer. */
8
+ footer?: ReactNode;
9
+ /** The page's column in `main`, e.g. its side padding. */
10
+ contentClassName?: string;
11
+ sidebar?: ReactNode;
12
+ sidebarSide?: Side;
13
+ }
14
+ /** The page frame, with `main` as the one scroller. The app's menu and other overlays render beside it. */
15
+ declare function AppLayout({ children, header, footer, contentClassName, sidebar, sidebarSide, }: AppLayoutProps): import("react").JSX.Element;
16
+ export { AppLayout };
@@ -0,0 +1,93 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { Sides } from "../../style/types.js";
4
+ import { useBrucksLabels } from "../../ui/lib/labels.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/blucks/layout/appLayout.tsx
8
+ /** The page frame, with `main` as the one scroller. The app's menu and other overlays render beside it. */
9
+ function AppLayout(t0) {
10
+ const $ = c(20);
11
+ const { children, header, footer, contentClassName, sidebar, sidebarSide: t1 } = t0;
12
+ const sidebarSide = t1 === void 0 ? Sides.right : t1;
13
+ const labels = useBrucksLabels();
14
+ let t2;
15
+ if ($[0] !== labels.skipToContent) {
16
+ t2 = /* @__PURE__ */ jsx("a", {
17
+ href: "#main",
18
+ className: "sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-skip-link focus:rounded-secondary focus:border focus:border-border focus:bg-card focus:px-3 focus:py-2 focus:text-foreground",
19
+ children: labels.skipToContent
20
+ });
21
+ $[0] = labels.skipToContent;
22
+ $[1] = t2;
23
+ } else t2 = $[1];
24
+ const t3 = header ? "[--inset-top:var(--rounded-primary)]" : "[--inset-top:0px]";
25
+ const t4 = footer ? "[--inset-bottom:var(--rounded-primary)]" : "[--inset-bottom:0px]";
26
+ let t5;
27
+ if ($[2] !== t3 || $[3] !== t4) {
28
+ t5 = cn("flex grow min-h-0 w-full transition-all -mt-(--inset-top) -mb-(--inset-bottom)", t3, t4);
29
+ $[2] = t3;
30
+ $[3] = t4;
31
+ $[4] = t5;
32
+ } else t5 = $[4];
33
+ const t6 = sidebarSide === Sides.left ? sidebar : null;
34
+ let t7;
35
+ if ($[5] !== contentClassName) {
36
+ t7 = cn("flex flex-col grow gap-4 max-w-5xl w-full pt-[calc(1rem+var(--inset-top))] pb-[calc(1rem+var(--inset-bottom))]", contentClassName);
37
+ $[5] = contentClassName;
38
+ $[6] = t7;
39
+ } else t7 = $[6];
40
+ let t8;
41
+ if ($[7] !== children || $[8] !== t7) {
42
+ t8 = /* @__PURE__ */ jsx("main", {
43
+ id: "main",
44
+ tabIndex: -1,
45
+ className: "flex flex-col items-center grow min-w-0 overflow-y-auto",
46
+ children: /* @__PURE__ */ jsx("div", {
47
+ className: t7,
48
+ children
49
+ })
50
+ });
51
+ $[7] = children;
52
+ $[8] = t7;
53
+ $[9] = t8;
54
+ } else t8 = $[9];
55
+ const t9 = sidebarSide === Sides.right ? sidebar : null;
56
+ let t10;
57
+ if ($[10] !== t5 || $[11] !== t6 || $[12] !== t8 || $[13] !== t9) {
58
+ t10 = /* @__PURE__ */ jsxs("div", {
59
+ className: t5,
60
+ children: [
61
+ t6,
62
+ t8,
63
+ t9
64
+ ]
65
+ });
66
+ $[10] = t5;
67
+ $[11] = t6;
68
+ $[12] = t8;
69
+ $[13] = t9;
70
+ $[14] = t10;
71
+ } else t10 = $[14];
72
+ let t11;
73
+ if ($[15] !== footer || $[16] !== header || $[17] !== t10 || $[18] !== t2) {
74
+ t11 = /* @__PURE__ */ jsxs("div", {
75
+ className: "flex flex-col h-dvh items-center font-sans safe-area-y",
76
+ children: [
77
+ t2,
78
+ header,
79
+ t10,
80
+ footer
81
+ ]
82
+ });
83
+ $[15] = footer;
84
+ $[16] = header;
85
+ $[17] = t10;
86
+ $[18] = t2;
87
+ $[19] = t11;
88
+ } else t11 = $[19];
89
+ return t11;
90
+ }
91
+ export { AppLayout };
92
+
93
+ //# sourceMappingURL=appLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appLayout.js","names":["c","_c","ReactNode","Side","Sides","cn","useBrucksLabels","AppLayoutProps","children","header","footer","contentClassName","sidebar","sidebarSide","AppLayout","t0","$","t1","undefined","right","labels","t2","skipToContent","t3","t4","t5","t6","left","t7","t8","t9","t10","t11","_c"],"sources":["../../../src/blucks/layout/appLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type Side, Sides } from \"~/style/types\";\nimport { cn } from \"~/style/utils\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\ninterface AppLayoutProps {\n children: ReactNode;\n /** A sticky Header. `main` starts under its rounded corners, so the page scrolls on behind them. */\n header?: ReactNode;\n /** Below `main`, e.g. a sticky Footer. */\n footer?: ReactNode;\n /** The page's column in `main`, e.g. its side padding. */\n contentClassName?: string;\n sidebar?: ReactNode;\n sidebarSide?: Side;\n}\n\n/** The page frame, with `main` as the one scroller. The app's menu and other overlays render beside it. */\nfunction AppLayout({\n children,\n header,\n footer,\n contentClassName,\n sidebar,\n sidebarSide = Sides.right,\n}: AppLayoutProps) {\n const labels = useBrucksLabels();\n\n return (\n <div className=\"flex flex-col h-dvh items-center font-sans safe-area-y\">\n <a\n href=\"#main\"\n className=\"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-skip-link focus:rounded-secondary focus:border focus:border-border focus:bg-card focus:px-3 focus:py-2 focus:text-foreground\"\n >\n {labels.skipToContent}\n </a>\n {header}\n <div\n className={cn(\n \"flex grow min-h-0 w-full transition-all -mt-(--inset-top) -mb-(--inset-bottom)\",\n header ? \"[--inset-top:var(--rounded-primary)]\" : \"[--inset-top:0px]\",\n footer ? \"[--inset-bottom:var(--rounded-primary)]\" : \"[--inset-bottom:0px]\",\n )}\n >\n {sidebarSide === Sides.left ? sidebar : null}\n <main\n id=\"main\"\n tabIndex={-1}\n className=\"flex flex-col items-center grow min-w-0 overflow-y-auto\"\n >\n <div\n className={cn(\n \"flex flex-col grow gap-4 max-w-5xl w-full pt-[calc(1rem+var(--inset-top))] pb-[calc(1rem+var(--inset-bottom))]\",\n contentClassName,\n )}\n >\n {children}\n </div>\n </main>\n {sidebarSide === Sides.right ? sidebar : null}\n </div>\n {footer}\n </div>\n );\n}\n\nexport { AppLayout };\n"],"mappings":";;;;;;;;AAoBA,SAAAc,UAAAC,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAmB,MAAA,EAAAO,UAAAC,QAAAC,QAAAC,kBAAAC,SAAAC,aAAAI,OAAAF;CAMjB,MAAAF,cAAAI,OAAAC,KAAAA,IAAcd,MAAKe,QAAnBF;CAEA,MAAAG,SAAed,gBAAgB;CAAE,IAAAe;CAAA,IAAAL,EAAA,OAAAI,OAAAE,eAAA;EAI7BD,KAAA,oBAAA,KAAA;GACO,MAAA;GACK,WAAA;GAETD,UAAAA,OAAME;EACL,CAAA;EAAAN,EAAA,KAAAI,OAAAE;EAAAN,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAKA,MAAAO,KAAAd,SAAA,yCAAA;CACA,MAAAe,KAAAd,SAAA,4CAAA;CAA2E,IAAAe;CAAA,IAAAT,EAAA,OAAAO,MAAAP,EAAA,OAAAQ,IAAA;EAHlEC,KAAApB,GACT,kFACAkB,IACAC,EACF;EAACR,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAEA,MAAAU,KAAAb,gBAAgBT,MAAKuB,OAArBf,UAAA;CAA2C,IAAAgB;CAAA,IAAAZ,EAAA,OAAAL,kBAAA;EAO7BiB,KAAAvB,GACT,kHACAM,gBACF;EAACK,EAAA,KAAAL;EAAAK,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAR,YAAAQ,EAAA,OAAAY,IAAA;EATLC,KAAA,oBAAA,QAAA;GACK,IAAA;GACO,UAAA;GACA,WAAA;GAEV,UAAA,oBAAA,OAAA;IACa,WAAAD;IAKVpB;GACG,CAAA;EACD,CAAA;EAAAQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CACN,MAAAc,KAAAjB,gBAAgBT,MAAKe,QAArBP,UAAA;CAA4C,IAAAmB;CAAA,IAAAf,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAa,MAAAb,EAAA,QAAAc,IAAA;EAtB/CC,MAAA,qBAAA,OAAA;GACa,WAAAN;GADb,UAAA;IAOGC;IACDG;IAcCC;GACG;;EAAAd,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,MAAAf,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAN,UAAAM,EAAA,QAAAP,UAAAO,EAAA,QAAAe,OAAAf,EAAA,QAAAK,IAAA;EA/BRW,MAAA,qBAAA,OAAA;GAAe,WAAA;GAAf,UAAA;IACEX;IAMCZ;IACDsB;IAwBCrB;GACG;;EAAAM,EAAA,MAAAN;EAAAM,EAAA,MAAAP;EAAAO,EAAA,MAAAe;EAAAf,EAAA,MAAAK;EAAAL,EAAA,MAAAgB;CAAA,OAAAA,MAAAhB,EAAA;CAAA,OAjCNgB;AAiCM"}
@@ -0,0 +1,7 @@
1
+ import type * as React from "react";
2
+ interface FooterProps extends React.ComponentProps<"footer"> {
3
+ sticky?: boolean;
4
+ }
5
+ /** The bar at the end of the page. Its text takes the app's display font from `className`. */
6
+ declare function Footer({ className, sticky, children, ...props }: FooterProps): React.JSX.Element;
7
+ export { Footer };
@@ -0,0 +1,18 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/blucks/layout/footer.tsx
4
+ /** The bar at the end of the page. Its text takes the app's display font from `className`. */
5
+ function Footer({ className, sticky = false, children, ...props }) {
6
+ return /* @__PURE__ */ jsx("footer", {
7
+ "data-slot": "footer",
8
+ className: cn("flex w-full items-center justify-around bg-card border-t rounded-t-primary px-4 py-2 shadow-[0_-5px_6px_-1px_rgb(0_0_0/0.25),0_-3px_4px_-2px_rgb(0_0_0/0.15)] dark:shadow-[0_-5px_6px_-1px_rgb(0_0_0/0.35),0_-3px_4px_-2px_rgb(0_0_0/0.22)]", sticky ? "sticky bottom-0 z-sticky" : null, className),
9
+ ...props,
10
+ children: /* @__PURE__ */ jsx("div", {
11
+ className: "flex text-base sm:text-lg tracking-widest text-shadow-md text-shadow-theme-600 dark:text-shadow-theme-400 hc:text-shadow-none transition-all",
12
+ children: /* @__PURE__ */ jsx("span", { children })
13
+ })
14
+ });
15
+ }
16
+ export { Footer };
17
+
18
+ //# sourceMappingURL=footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footer.js","names":[],"sources":["../../../src/blucks/layout/footer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"~/style/utils\";\n\ninterface FooterProps extends React.ComponentProps<\"footer\"> {\n sticky?: boolean;\n}\n\n/** The bar at the end of the page. Its text takes the app's display font from `className`. */\nfunction Footer({ className, sticky = false, children, ...props }: FooterProps) {\n return (\n <footer\n data-slot=\"footer\"\n className={cn(\n \"flex w-full items-center justify-around bg-card border-t rounded-t-primary px-4 py-2 shadow-[0_-5px_6px_-1px_rgb(0_0_0/0.25),0_-3px_4px_-2px_rgb(0_0_0/0.15)] dark:shadow-[0_-5px_6px_-1px_rgb(0_0_0/0.35),0_-3px_4px_-2px_rgb(0_0_0/0.22)]\",\n sticky ? \"sticky bottom-0 z-sticky\" : null,\n className,\n )}\n {...props}\n >\n <div className=\"flex text-base sm:text-lg tracking-widest text-shadow-md text-shadow-theme-600 dark:text-shadow-theme-400 hc:text-shadow-none transition-all\">\n <span>{children}</span>\n </div>\n </footer>\n );\n}\n\nexport { Footer };\n"],"mappings":";;;;AAQA,SAAS,OAAO,EAAE,WAAW,SAAS,OAAO,UAAU,GAAG,SAAsB;CAC9E,OACE,oBAAC,UAAD;EACE,aAAU;EACV,WAAW,GACT,+OACA,SAAS,6BAA6B,MACtC,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,oBAAC,QAAD,EAAO,SAAe,CAAA;EACnB,CAAA;CACC,CAAA;AAEZ"}
@@ -0,0 +1,22 @@
1
+ import type * as React from "react";
2
+ import { type Side } from "../../style/types";
3
+ interface HeaderProps extends Omit<React.ComponentProps<"header">, "title"> {
4
+ /** The site's name or the page's, cut short with an ellipsis. Can hold the app's link home. */
5
+ title: React.ReactNode;
6
+ /** Makes the title the page's `h1`, for a header that names the page. */
7
+ heading?: boolean;
8
+ /** For the app's display font. */
9
+ titleClassName?: string;
10
+ /** Before the title, e.g. a back link. */
11
+ leading?: React.ReactNode;
12
+ /** At the end on `actionSide`, e.g. the button that opens the menu. */
13
+ primaryActionButton?: React.ReactNode;
14
+ /** At the end opposite `actionSide`. */
15
+ secondaryActionButton?: React.ReactNode;
16
+ /** Match it to the menu drawer's side. */
17
+ actionSide?: Side;
18
+ sticky?: boolean;
19
+ }
20
+ /** The bar on top of the page. `children` sit at the right end, before a right-side action, e.g. a nav. */
21
+ declare function Header({ className, title, heading, titleClassName, leading, primaryActionButton, secondaryActionButton, actionSide, sticky, children, ...props }: HeaderProps): React.JSX.Element;
22
+ export { Header };
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { Sides } from "../../style/types.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/blucks/layout/header.tsx
7
+ /** The bar on top of the page. `children` sit at the right end, before a right-side action, e.g. a nav. */
8
+ function Header(t0) {
9
+ const $ = c(33);
10
+ let children;
11
+ let className;
12
+ let leading;
13
+ let primaryActionButton;
14
+ let props;
15
+ let secondaryActionButton;
16
+ let t1;
17
+ let t2;
18
+ let t3;
19
+ let title;
20
+ let titleClassName;
21
+ if ($[0] !== t0) {
22
+ ({className, title, heading: t1, titleClassName, leading, primaryActionButton, secondaryActionButton, actionSide: t2, sticky: t3, children, ...props} = t0);
23
+ $[0] = t0;
24
+ $[1] = children;
25
+ $[2] = className;
26
+ $[3] = leading;
27
+ $[4] = primaryActionButton;
28
+ $[5] = props;
29
+ $[6] = secondaryActionButton;
30
+ $[7] = t1;
31
+ $[8] = t2;
32
+ $[9] = t3;
33
+ $[10] = title;
34
+ $[11] = titleClassName;
35
+ } else {
36
+ children = $[1];
37
+ className = $[2];
38
+ leading = $[3];
39
+ primaryActionButton = $[4];
40
+ props = $[5];
41
+ secondaryActionButton = $[6];
42
+ t1 = $[7];
43
+ t2 = $[8];
44
+ t3 = $[9];
45
+ title = $[10];
46
+ titleClassName = $[11];
47
+ }
48
+ const heading = t1 === void 0 ? false : t1;
49
+ const actionSide = t2 === void 0 ? Sides.right : t2;
50
+ const sticky = t3 === void 0 ? false : t3;
51
+ const Title = heading ? "h1" : "span";
52
+ const t4 = sticky ? "sticky top-0 z-header" : null;
53
+ let t5;
54
+ if ($[12] !== className || $[13] !== t4) {
55
+ t5 = cn("w-full bg-card px-4 py-3 border-b border-border rounded-b-primary flex items-center justify-between gap-2 shadow-[0_5px_6px_-1px_rgb(0_0_0/0.25),0_3px_4px_-2px_rgb(0_0_0/0.15)] dark:shadow-[0_5px_6px_-1px_rgb(0_0_0/0.35),0_3px_4px_-2px_rgb(0_0_0/0.22)]", t4, className);
56
+ $[12] = className;
57
+ $[13] = t4;
58
+ $[14] = t5;
59
+ } else t5 = $[14];
60
+ const t6 = actionSide === Sides.left ? primaryActionButton : secondaryActionButton;
61
+ let t7;
62
+ if ($[15] !== titleClassName) {
63
+ t7 = cn("block min-w-0 overflow-clip [overflow-clip-margin:12px] text-ellipsis whitespace-nowrap font-semibold text-xl sm:text-3xl md:text-4xl tracking-widest text-shadow-lg text-shadow-theme-600 dark:text-shadow-theme-400 hc:text-shadow-none transition-[font-size] duration-1000", titleClassName);
64
+ $[15] = titleClassName;
65
+ $[16] = t7;
66
+ } else t7 = $[16];
67
+ let t8;
68
+ if ($[17] !== Title || $[18] !== t7 || $[19] !== title) {
69
+ t8 = /* @__PURE__ */ jsx(Title, {
70
+ className: t7,
71
+ children: title
72
+ });
73
+ $[17] = Title;
74
+ $[18] = t7;
75
+ $[19] = title;
76
+ $[20] = t8;
77
+ } else t8 = $[20];
78
+ let t9;
79
+ if ($[21] !== leading || $[22] !== t6 || $[23] !== t8) {
80
+ t9 = /* @__PURE__ */ jsxs("div", {
81
+ className: "flex items-center gap-2 min-w-0",
82
+ children: [
83
+ t6,
84
+ leading,
85
+ t8
86
+ ]
87
+ });
88
+ $[21] = leading;
89
+ $[22] = t6;
90
+ $[23] = t8;
91
+ $[24] = t9;
92
+ } else t9 = $[24];
93
+ const t10 = actionSide === Sides.right ? primaryActionButton : secondaryActionButton;
94
+ let t11;
95
+ if ($[25] !== children || $[26] !== t10) {
96
+ t11 = /* @__PURE__ */ jsxs("div", {
97
+ className: "flex items-center gap-0.5",
98
+ children: [children, t10]
99
+ });
100
+ $[25] = children;
101
+ $[26] = t10;
102
+ $[27] = t11;
103
+ } else t11 = $[27];
104
+ let t12;
105
+ if ($[28] !== props || $[29] !== t11 || $[30] !== t5 || $[31] !== t9) {
106
+ t12 = /* @__PURE__ */ jsxs("header", {
107
+ className: t5,
108
+ ...props,
109
+ children: [t9, t11]
110
+ });
111
+ $[28] = props;
112
+ $[29] = t11;
113
+ $[30] = t5;
114
+ $[31] = t9;
115
+ $[32] = t12;
116
+ } else t12 = $[32];
117
+ return t12;
118
+ }
119
+ export { Header };
120
+
121
+ //# sourceMappingURL=header.js.map