@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,188 @@
1
+ "use client";
2
+ import { cn } from "../../style/utils.js";
3
+ import { AppIcon } from "../../ui/components/icon.js";
4
+ import { useBrucksLabels } from "../../ui/lib/labels.js";
5
+ import { Fab } from "../../ui/components/fab.js";
6
+ import { useScrollAncestor } from "../hooks/useScrollAncestor.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { useEffect, useRef, useState } from "react";
9
+ import { jsx } from "react/jsx-runtime";
10
+ import { FlyingHumanIcon } from "@hugeicons/core-free-icons";
11
+ import "./scrollToTopFab.css";
12
+ // src/blucks/components/scrollToTopFab.tsx
13
+ /** Frames the scroller may sit still before the climb counts as stalled. */
14
+ var STALLED_FRAMES = 3;
15
+ /** Reader input that means the scroller is theirs again. */
16
+ var HANDOVER_EVENTS = [
17
+ "wheel",
18
+ "touchstart",
19
+ "pointerdown",
20
+ "keydown"
21
+ ];
22
+ function ScrollToTopFab(t0) {
23
+ const $ = c(25);
24
+ const { screensBeforeVisible: t1, position: t2, className, theme: t3, icon: t4, animate: t5 } = t0;
25
+ const screensBeforeVisible = t1 === void 0 ? 2.5 : t1;
26
+ const position = t2 === void 0 ? "bottom-right" : t2;
27
+ const theme = t3 === void 0 ? false : t3;
28
+ const icon = t4 === void 0 ? FlyingHumanIcon : t4;
29
+ const animate = t5 === void 0 ? true : t5;
30
+ const labels = useBrucksLabels();
31
+ const fadesOnScroll = position !== "inline";
32
+ const fabRef = useRef(null);
33
+ const scrollAncestor = useScrollAncestor(fabRef);
34
+ const [visible, setVisible] = useState(false);
35
+ let t6;
36
+ let t7;
37
+ if ($[0] !== fadesOnScroll || $[1] !== screensBeforeVisible || $[2] !== scrollAncestor) {
38
+ t6 = () => {
39
+ if (!scrollAncestor || !fadesOnScroll) return;
40
+ const onScroll = () => {
41
+ setVisible(scrollAncestor.scrollTop > scrollAncestor.clientHeight * screensBeforeVisible);
42
+ };
43
+ const scrollTarget = scrollAncestor === document.documentElement ? document : scrollAncestor;
44
+ onScroll();
45
+ scrollTarget.addEventListener("scroll", onScroll, { passive: true });
46
+ return () => scrollTarget.removeEventListener("scroll", onScroll);
47
+ };
48
+ t7 = [
49
+ scrollAncestor,
50
+ screensBeforeVisible,
51
+ fadesOnScroll
52
+ ];
53
+ $[0] = fadesOnScroll;
54
+ $[1] = screensBeforeVisible;
55
+ $[2] = scrollAncestor;
56
+ $[3] = t6;
57
+ $[4] = t7;
58
+ } else {
59
+ t6 = $[3];
60
+ t7 = $[4];
61
+ }
62
+ useEffect(t6, t7);
63
+ const endClimb = useRef(null);
64
+ let t8;
65
+ let t9;
66
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
67
+ t8 = () => () => endClimb.current?.();
68
+ t9 = [];
69
+ $[5] = t8;
70
+ $[6] = t9;
71
+ } else {
72
+ t8 = $[5];
73
+ t9 = $[6];
74
+ }
75
+ useEffect(t8, t9);
76
+ let t10;
77
+ if ($[7] !== scrollAncestor) {
78
+ t10 = () => {
79
+ if (!scrollAncestor) return;
80
+ endClimb.current?.();
81
+ const fab = fabRef.current;
82
+ if (fab && document.activeElement === fab) {
83
+ scrollAncestor.focus({ preventScroll: true });
84
+ if (document.activeElement === fab) fab.blur();
85
+ }
86
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
87
+ scrollAncestor.scrollTo({
88
+ top: 0,
89
+ behavior: "auto"
90
+ });
91
+ return;
92
+ }
93
+ const runway = scrollAncestor.clientHeight;
94
+ if (scrollAncestor.scrollTop > runway) scrollAncestor.scrollTo({
95
+ top: runway,
96
+ behavior: "auto"
97
+ });
98
+ scrollAncestor.scrollTo({
99
+ top: 0,
100
+ behavior: "smooth"
101
+ });
102
+ let frame = requestAnimationFrame(tick);
103
+ let previousTop = scrollAncestor.scrollTop;
104
+ let stalledFrames = 0;
105
+ function tick() {
106
+ if (!scrollAncestor) return;
107
+ const { scrollTop } = scrollAncestor;
108
+ if (scrollTop === 0) {
109
+ endClimb.current?.();
110
+ return;
111
+ }
112
+ stalledFrames = scrollTop === previousTop ? stalledFrames + 1 : 0;
113
+ previousTop = scrollTop;
114
+ if (stalledFrames >= STALLED_FRAMES) {
115
+ stalledFrames = 0;
116
+ scrollAncestor.scrollTo({
117
+ top: 0,
118
+ behavior: "smooth"
119
+ });
120
+ }
121
+ frame = requestAnimationFrame(tick);
122
+ }
123
+ const stop = () => endClimb.current?.();
124
+ for (const event of HANDOVER_EVENTS) scrollAncestor.addEventListener(event, stop, { passive: true });
125
+ endClimb.current = () => {
126
+ cancelAnimationFrame(frame);
127
+ for (const event_0 of HANDOVER_EVENTS) scrollAncestor.removeEventListener(event_0, stop);
128
+ endClimb.current = null;
129
+ };
130
+ };
131
+ $[7] = scrollAncestor;
132
+ $[8] = t10;
133
+ } else t10 = $[8];
134
+ const scrollToTop = t10;
135
+ const t11 = fadesOnScroll ? visible : true;
136
+ const t12 = theme ? "text-theme-600" : null;
137
+ let t13;
138
+ if ($[9] !== className || $[10] !== t12) {
139
+ t13 = cn(className, t12);
140
+ $[9] = className;
141
+ $[10] = t12;
142
+ $[11] = t13;
143
+ } else t13 = $[11];
144
+ const t14 = labels.scrollToTop;
145
+ const t15 = animate && "animate-[flap_1s_ease-in-out_infinite]";
146
+ const t16 = icon === FlyingHumanIcon && "-rotate-25";
147
+ let t17;
148
+ if ($[12] !== t15 || $[13] !== t16) {
149
+ t17 = cn(t15, t16);
150
+ $[12] = t15;
151
+ $[13] = t16;
152
+ $[14] = t17;
153
+ } else t17 = $[14];
154
+ let t18;
155
+ if ($[15] !== icon || $[16] !== t17) {
156
+ t18 = /* @__PURE__ */ jsx(AppIcon, {
157
+ icon,
158
+ className: t17
159
+ });
160
+ $[15] = icon;
161
+ $[16] = t17;
162
+ $[17] = t18;
163
+ } else t18 = $[17];
164
+ let t19;
165
+ if ($[18] !== labels.scrollToTop || $[19] !== position || $[20] !== scrollToTop || $[21] !== t11 || $[22] !== t13 || $[23] !== t18) {
166
+ t19 = /* @__PURE__ */ jsx(Fab, {
167
+ ref: fabRef,
168
+ type: "button",
169
+ position,
170
+ visible: t11,
171
+ className: t13,
172
+ "aria-label": t14,
173
+ onClick: scrollToTop,
174
+ children: t18
175
+ });
176
+ $[18] = labels.scrollToTop;
177
+ $[19] = position;
178
+ $[20] = scrollToTop;
179
+ $[21] = t11;
180
+ $[22] = t13;
181
+ $[23] = t18;
182
+ $[24] = t19;
183
+ } else t19 = $[24];
184
+ return t19;
185
+ }
186
+ export { ScrollToTopFab };
187
+
188
+ //# sourceMappingURL=scrollToTopFab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollToTopFab.js","names":["c","_c","FlyingHumanIcon","ComponentProps","useEffect","useRef","useState","useScrollAncestor","cn","Fab","AppIcon","useBrucksLabels","STALLED_FRAMES","HANDOVER_EVENTS","const","ScrollToTopFabProps","screensBeforeVisible","position","className","theme","icon","animate","ScrollToTopFab","t0","$","t1","t2","t3","t4","t5","undefined","labels","fadesOnScroll","fabRef","scrollAncestor","visible","setVisible","t6","t7","onScroll","scrollTop","clientHeight","scrollTarget","document","documentElement","addEventListener","passive","removeEventListener","endClimb","t8","t9","Symbol","for","current","t10","fab","activeElement","focus","preventScroll","blur","window","matchMedia","matches","scrollTo","top","behavior","runway","frame","requestAnimationFrame","tick","previousTop","stalledFrames","stop","event","cancelAnimationFrame","event_0","scrollToTop","t11","t12","t13","t14","t15","t16","t17","t18","t19","_c"],"sources":["../../../src/blucks/components/scrollToTopFab.tsx"],"sourcesContent":["\"use client\";\n\nimport { FlyingHumanIcon } from \"@hugeicons/core-free-icons\";\nimport { type ComponentProps, useEffect, useRef, useState } from \"react\";\nimport \"~/blucks/components/scrollToTopFab.css\";\nimport { useScrollAncestor } from \"~/blucks/hooks/useScrollAncestor\";\nimport { cn } from \"~/style/utils\";\nimport { Fab } from \"~/ui/components/fab\";\nimport { AppIcon } from \"~/ui/components/icon\";\nimport { useBrucksLabels } from \"~/ui/lib/labels\";\n\n/** Frames the scroller may sit still before the climb counts as stalled. */\nconst STALLED_FRAMES = 3;\n\n/** Reader input that means the scroller is theirs again. */\nconst HANDOVER_EVENTS = [\"wheel\", \"touchstart\", \"pointerdown\", \"keydown\"] as const;\n\ntype ScrollToTopFabProps = {\n /** How many screen heights must be scrolled before the button appears. */\n screensBeforeVisible?: number;\n /** `inline` drops the fixed positioning and keeps the button in normal flow. */\n position?: \"bottom-right\" | \"bottom-left\" | \"inline\";\n className?: string;\n /** Draws the icon in the theme accent. */\n theme?: boolean;\n icon?: ComponentProps<typeof AppIcon>[\"icon\"];\n /** Rocks the icon with the flap animation. */\n animate?: boolean;\n};\n\nfunction ScrollToTopFab({\n screensBeforeVisible = 2.5,\n position = \"bottom-right\",\n className,\n theme = false,\n icon = FlyingHumanIcon,\n animate = true,\n}: ScrollToTopFabProps) {\n const labels = useBrucksLabels();\n\n // An in-flow button would leave a hole while hidden, so it never fades out.\n const fadesOnScroll = position !== \"inline\";\n\n const fabRef = useRef<HTMLButtonElement>(null);\n const scrollAncestor = useScrollAncestor(fabRef);\n const [visible, setVisible] = useState(false);\n\n useEffect(() => {\n if (!scrollAncestor || !fadesOnScroll) return;\n\n const onScroll = () => {\n setVisible(scrollAncestor.scrollTop > scrollAncestor.clientHeight * screensBeforeVisible);\n };\n\n // The page's own scrolling fires its scroll events at the document, not at <html>.\n const scrollTarget: EventTarget =\n scrollAncestor === document.documentElement ? document : scrollAncestor;\n\n onScroll();\n scrollTarget.addEventListener(\"scroll\", onScroll, { passive: true });\n\n return () => scrollTarget.removeEventListener(\"scroll\", onScroll);\n }, [scrollAncestor, screensBeforeVisible, fadesOnScroll]);\n\n /** Tears down an in-flight climb: the frame loop and its handover listeners. */\n const endClimb = useRef<(() => void) | null>(null);\n useEffect(() => () => endClimb.current?.(), []);\n\n const scrollToTop = () => {\n if (!scrollAncestor) return;\n endClimb.current?.();\n\n // Focus goes up with the reader, instead of staying on a button left at the bottom (and hidden there).\n const fab = fabRef.current;\n if (fab && document.activeElement === fab) {\n scrollAncestor.focus({ preventScroll: true });\n if (document.activeElement === fab) fab.blur();\n }\n\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n scrollAncestor.scrollTo({ top: 0, behavior: \"auto\" });\n return;\n }\n\n /*\n * The browser paces a smooth scroll by its distance, and a virtualized list\n * puts hundreds of thousands of pixels between the bottom and the top, so\n * animating the whole trip crawls. Cut to within a screen of the top - none\n * of what is skipped is on screen long enough to read - and animate only\n * that last leg.\n */\n const runway = scrollAncestor.clientHeight;\n if (scrollAncestor.scrollTop > runway) {\n scrollAncestor.scrollTo({ top: runway, behavior: \"auto\" });\n }\n\n scrollAncestor.scrollTo({ top: 0, behavior: \"smooth\" });\n\n /*\n * A virtualized list remeasures rows as they scroll into view and re-anchors\n * the scroll offset to keep them from jumping, which cancels the native\n * animation partway up. Re-aim whenever the climb stalls short of the top,\n * and hand the scroller back the moment the reader touches it.\n */\n let frame = requestAnimationFrame(tick);\n let previousTop = scrollAncestor.scrollTop;\n let stalledFrames = 0;\n\n function tick() {\n if (!scrollAncestor) return;\n const { scrollTop } = scrollAncestor;\n\n if (scrollTop === 0) {\n endClimb.current?.();\n return;\n }\n\n stalledFrames = scrollTop === previousTop ? stalledFrames + 1 : 0;\n previousTop = scrollTop;\n\n if (stalledFrames >= STALLED_FRAMES) {\n stalledFrames = 0;\n scrollAncestor.scrollTo({ top: 0, behavior: \"smooth\" });\n }\n\n frame = requestAnimationFrame(tick);\n }\n\n const stop = () => endClimb.current?.();\n for (const event of HANDOVER_EVENTS) {\n scrollAncestor.addEventListener(event, stop, { passive: true });\n }\n\n endClimb.current = () => {\n cancelAnimationFrame(frame);\n for (const event of HANDOVER_EVENTS) {\n scrollAncestor.removeEventListener(event, stop);\n }\n endClimb.current = null;\n };\n };\n\n return (\n <Fab\n ref={fabRef}\n type=\"button\"\n position={position}\n visible={fadesOnScroll ? visible : true}\n className={cn(className, theme ? \"text-theme-600\" : null)}\n aria-label={labels.scrollToTop}\n onClick={scrollToTop}\n >\n <AppIcon\n icon={icon}\n className={cn(\n animate && \"animate-[flap_1s_ease-in-out_infinite]\",\n icon === FlyingHumanIcon && \"-rotate-25\",\n )}\n />\n </Fab>\n );\n}\n\nexport { ScrollToTopFab };\n"],"mappings":"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"}
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from "react";
2
+ interface SettingsPickerModalProps {
3
+ open: boolean;
4
+ /** Names the dialog; without it brucks falls back to the generic "Dialog". */
5
+ title: string;
6
+ onClose: () => void;
7
+ gridClassName: string;
8
+ children: ReactNode;
9
+ }
10
+ declare function SettingsPickerModal({ open, title, onClose, gridClassName, children, }: SettingsPickerModalProps): import("react").JSX.Element;
11
+ export { SettingsPickerModal };
@@ -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,13 @@
1
+ export { HomeCard, type HomeCardProps } from "./components/homeCard";
2
+ export { Loader } from "./components/loader";
3
+ export { ScrollToTopFab } from "./components/scrollToTopFab";
4
+ export { SettingsPickerModal } from "./components/settingsPickerModal";
5
+ export { SettingsRow } from "./components/settingsRow";
6
+ export { SettingsSection } from "./components/settingsSection";
7
+ export { SettingsSwatchButton } from "./components/settingsSwatchButton";
8
+ export { useDisclosure } from "./hooks/useDisclosure";
9
+ export { useScrollAncestor } from "./hooks/useScrollAncestor";
10
+ export { AppLayout } from "./layout/appLayout";
11
+ export { Footer } from "./layout/footer";
12
+ export { Header } from "./layout/header";
13
+ export { isKeyOf } from "./lib/utils";
@@ -0,0 +1,14 @@
1
+ import { HomeCard } from "./components/homeCard.js";
2
+ import { Loader } from "./components/loader.js";
3
+ import { useScrollAncestor } from "./hooks/useScrollAncestor.js";
4
+ import { ScrollToTopFab } from "./components/scrollToTopFab.js";
5
+ import { SettingsPickerModal } from "./components/settingsPickerModal.js";
6
+ import { SettingsRow } from "./components/settingsRow.js";
7
+ import { SettingsSection } from "./components/settingsSection.js";
8
+ import { SettingsSwatchButton } from "./components/settingsSwatchButton.js";
9
+ import { useDisclosure } from "./hooks/useDisclosure.js";
10
+ import { AppLayout } from "./layout/appLayout.js";
11
+ import { Footer } from "./layout/footer.js";
12
+ import { Header } from "./layout/header.js";
13
+ import { isKeyOf } from "./lib/utils.js";
14
+ export { AppLayout, Footer, Header, HomeCard, Loader, 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 };