@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
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mike Brucker
4
+ Copyright (c) 2023 shadcn (the components based on shadcn/ui)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,279 @@
1
- # Temporary Holding Version
1
+ # brucks
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The UI components shared by bruck and grammatik, as a local React package, plus
4
+ the app code both had copies of: the style settings, the settings page kit, the
5
+ home card, the scroll-to-top button and the page layout.
6
+
7
+ It has three entry points, one per folder in `src/`:
8
+
9
+ | Import | Holds | Builds on |
10
+ | --- | --- | --- |
11
+ | `@mikebrucker/brucks/style` (+ `@mikebrucker/brucks/style/theme.css`) | the Tailwind theme, `cn`, `Side`, the class recipes, the style settings | nothing |
12
+ | `@mikebrucker/brucks/ui` (+ `@mikebrucker/brucks/ui/<file>`) | the components, `BrucksProvider`, the back stack | style |
13
+ | `@mikebrucker/brucks/blucks` | `AppLayout`, `Header`, `Footer`, the settings kit, `HomeCard`, `Loader`, `ScrollToTopFab`, `useDisclosure`, `useScrollAncestor`, `isKeyOf` | ui, style |
14
+
15
+ There is no plain `brucks` import, so everything has exactly one import path.
16
+ `npm run lint` keeps the layers apart: style imports neither ui nor blucks, and ui
17
+ never imports blucks.
18
+
19
+ `src/ui/components` is the merge of `src/components/ui` from both apps. Each file
20
+ was taken from whichever side changed it since grammatik forked from bruck, and
21
+ merged where both did. The build ships ES modules with their `"use client"`
22
+ directives intact, type declarations, and the Tailwind theme as source. The
23
+ `"use client"` modules go through the React Compiler. The others stay plain, so
24
+ Server Components can render them.
25
+
26
+ ## Scripts
27
+
28
+ | Script | What it does |
29
+ | --- | --- |
30
+ | `npm start` | The playground: every component with live props, at http://localhost:5173 |
31
+ | `npm run build` | `dist/{ui,style,blucks}`: one ES module per source file, `.d.ts` files, `style/theme.css` |
32
+ | `npm run typecheck` | `tsc --noEmit`, for brucks and for the playground |
33
+ | `npm test` | The playground's browser tests (Playwright, Chromium), against their own server on port 5199 |
34
+ | `npm run lint` | `biome check` |
35
+ | `npm run format` | `biome format --write` |
36
+
37
+ `prepare` runs the build, so installing brucks into an app builds it first.
38
+
39
+ `npm test` runs in Chromium and Firefox, which Playwright needs once per machine (or per
40
+ sandbox: VSCodium's Flatpak terminal has its own cache):
41
+ `npx playwright install --only-shell chromium firefox`.
42
+
43
+ ## Playground
44
+
45
+ `playground/` is a Vite app on brucks's own source (through `brucks/ui`, `brucks/style`
46
+ and `brucks/blucks`, so edits show up live). It is not part of the package. It uses the apps' i18n setup and
47
+ bruck's settings page, built on brucks's settings kit and style settings, so
48
+ components look the way they do in bruck and grammatik.
49
+
50
+ - `/en`, `/de`: a link to every demo. Each demo has its own page, e.g.
51
+ `/en/slider`, with links to the demos before and after it. A path without a
52
+ locale gets the browser's, so `/slider` works too. The pages are React Router
53
+ routes, so switching pages doesn't reload the app.
54
+ The menu lists the demos and filters them by name or by brucks export.
55
+ - `/en/settings`: theme, high contrast, accent, menu side, corners, zoom, language.
56
+ - Each demo has Reset, and a crash stays inside its card. `?crash` on a demo
57
+ page (`/en/button?crash`) shows the fallback on purpose.
58
+ - Each demo shows its code, which follows the props set in its controls and
59
+ leaves out the ones at the component's default. `DemoCard` requires it; demos
60
+ build it with `jsxCode.ts` from the values their preview renders with.
61
+ - Class fields start empty. Classes a demo needs itself show read-only above
62
+ the field, as `built-in className` and so on, and the field adds to them: the
63
+ prop gets `cn(builtIn, typed)`. Demos pass them to `DemoClassName` as
64
+ `builtIn`, never as the field's starting value.
65
+ - Backspace (outside text fields) stands in for the Android back button: it
66
+ calls `closeTopmost()`.
67
+ - `playground/src/components/modules/playground/registry.ts` maps every brucks
68
+ export to the card that shows it. A new export without a card fails
69
+ `npm run typecheck`.
70
+ - `playground/e2e/` holds the browser tests. Every test also fails on any console
71
+ error or warning.
72
+
73
+ ## Using it in an app
74
+
75
+ ### Install
76
+
77
+ ```sh
78
+ npm install @mikebrucker/brucks
79
+ ```
80
+
81
+ ### Styles
82
+
83
+ The theme is a Tailwind partial. Import it into the app's Tailwind entry, after
84
+ Tailwind and tw-animate-css:
85
+
86
+ ```css
87
+ @import "tailwindcss" theme(static);
88
+ @import "tw-animate-css";
89
+ @import "@mikebrucker/brucks/style/theme.css";
90
+ ```
91
+
92
+ `theme(static)` is recommended. The accent ramps alias Tailwind's own palettes,
93
+ and static mode makes sure every palette var exists, including ones the app only
94
+ builds at runtime. The theme registers all of `dist/` (ui, blucks and style) as a
95
+ Tailwind source itself, so the classes brucks uses are generated without any
96
+ `@source` line in the app.
97
+
98
+ The theme provides:
99
+
100
+ - the color, radius and accent tokens (`html.dark` / `html.light`,
101
+ `html.high-contrast`, `html[data-accent]`)
102
+ - the `dark` and `hc` variants
103
+ - the stacking layers (see below)
104
+ - the drawer and collapsible keyframes
105
+ - the `safe-area-y` utility
106
+ - a base rule giving every element `border-border` and `outline-ring`
107
+ - a reduced-motion rule: with reduced motion on, every animation and transition
108
+ finishes at once
109
+
110
+ Fonts and the `html`/`body` rules stay in the app. The titles of Popover and
111
+ Header take the app's display font through `titleClassName`, Footer's text
112
+ through `className`.
113
+
114
+ ### Stacking
115
+
116
+ The components sit on named layers, which the theme defines as `--z-index-*`
117
+ tokens. The app can use them as `z-*` classes too, and put its own layers in
118
+ between:
119
+
120
+ | Class | Value | Used by |
121
+ | --- | --- | --- |
122
+ | `z-sticky` | 10 | Accordion's sticky headers, the sticky Footer |
123
+ | `z-header` | 20 | the sticky Header, above sticky content scrolling under it |
124
+ | `z-fab` | 50 | Fab |
125
+ | `z-dialog` | 60 | Modal, Drawer, AlertDialog |
126
+ | `z-skip-link` | 100 | AppLayout's skip link, once focused |
127
+ | `z-loader` | 1000 | the full-screen Loader |
128
+ | `z-popover-backdrop` | 9998 | Popover's backdrop |
129
+ | `z-popover` | 9999 | Popover, Select, Tooltip, Toast |
130
+
131
+ `cn()` knows the names, so a `z-*` class passed to a component replaces its
132
+ layer.
133
+
134
+ ### Components
135
+
136
+ ```tsx
137
+ import { Button, Modal } from "@mikebrucker/brucks/ui";
138
+ import { Button } from "@mikebrucker/brucks/ui/button";
139
+ ```
140
+
141
+ Every component also has its own entry, named like the app file it came from
142
+ (`@mikebrucker/brucks/ui/alertDialog`, `@mikebrucker/brucks/ui/toggle-group`, ...), so `@/components/ui/x` maps
143
+ to `@mikebrucker/brucks/ui/x`. `cn` comes from `@mikebrucker/brucks/style`.
144
+
145
+ ### Labels
146
+
147
+ The components ship no translations. Their screen reader labels default to
148
+ English and are replaced through `BrucksProvider` from `@mikebrucker/brucks/ui`, usually inside
149
+ the app's i18n provider. The one provider also names `@mikebrucker/brucks/blucks`'s
150
+ `ScrollToTopFab` (`scrollToTop`) and `AppLayout`'s skip link (`skipToContent`),
151
+ and `menu` names `Drawer`:
152
+
153
+ ```tsx
154
+ <BrucksProvider
155
+ labels={{
156
+ close: t(($) => $.ariaLabels.close),
157
+ dialog: t(($) => $.ariaLabels.dialog),
158
+ menu: t(($) => $.ariaLabels.menu),
159
+ dragToReorder: t(($) => $.ariaLabels.drag_to_reorder),
160
+ reorderAnnouncement: (values) => t(($) => $.ariaLabels.reorder_announcement, values),
161
+ notification: t(($) => $.ariaLabels.notification),
162
+ notifications: t(($) => $.ariaLabels.notifications), // keep "{hotkey}" in the text
163
+ dragInstructions: t(($) => $.ariaLabels.drag_instructions),
164
+ scrollToTop: t(($) => $.ariaLabels.scroll_to_top),
165
+ skipToContent: t(($) => $.ariaLabels.skip_to_content),
166
+ }}
167
+ >
168
+ {children}
169
+ </BrucksProvider>
170
+ ```
171
+
172
+ `Loader` renders in Server Components, which can't read the provider, so it
173
+ takes its screen reader text as a `label` prop instead. `Drawer` and `Modal`
174
+ take a `title` for their screen reader name, in place of the "menu" and
175
+ "dialog" labels.
176
+
177
+ ### Android back button
178
+
179
+ `Modal`, `Drawer`, `AlertDialog`, `Popover` and `Select` register themselves with
180
+ `useCloseOnBack` while open. An app's back button handler calls `closeTopmost()` from `@mikebrucker/brucks/ui` to
181
+ close the one on top. It has to be brucks's own export, since the open overlays
182
+ are tracked in that module.
183
+
184
+ ### Style settings (`@mikebrucker/brucks/style`)
185
+
186
+ `Themes`, `Accents`, `RoundedCorners`, `RoundedTargets` and `Zooms` (with their
187
+ types and the `accents`/`roundedCorners` lists) are the options the theme
188
+ understands. Each writer puts a choice where theme.css reads it and stores it
189
+ under its own localStorage key:
190
+
191
+ | Writer | Writes |
192
+ | --- | --- |
193
+ | `applyTheme(theme)` | `dark` or `light` on `<html>` (`system` follows the OS); returns which |
194
+ | `applyAccent(accent)` | `data-accent` |
195
+ | `applyRounded(target, corner)` | `--rounded-primary` / `--rounded-secondary` |
196
+ | `applyZoom(zoom)` | `--zoom`, clamped to `Zooms`; returns the value it applied |
197
+ | `applyHighContrast(on)` | `high-contrast` |
198
+ | `applyMenuSide(side)` | only the stored value |
199
+
200
+ `readStoredStyle()` returns the stored choices, each one validated, with
201
+ `defaultStyle` for anything missing or invalid (high contrast falls back to the
202
+ OS preference). `darkSchemeQuery` is the media query to follow while the theme
203
+ is `system`. The store holding the choices stays in the app; the playground's
204
+ `stores/useStyleStore.ts` and `components/providers/styleInit.tsx` show the
205
+ wiring.
206
+
207
+ `@mikebrucker/brucks/style` also has `cn`, `Side`/`Sides` and the class recipes: `chip`,
208
+ `keyboardButton`, `toggleOn` (a pressed ToggleGroupItem in the accent) and
209
+ `navSelected` (the current page's nav link).
210
+
211
+ ### Blocks (`@mikebrucker/brucks/blucks`)
212
+
213
+ The blocks of an app, optional: ui and style never need them. Together with the
214
+ style settings they make a full settings page. Their own CSS comes with them:
215
+ `Loader` and `ScrollToTopFab` import the `.css` file next to them, which the app's
216
+ bundler loads along with the component, so the theme carries none of it.
217
+
218
+ - `AppLayout` frames every page: a skip link, the `header`, `main` as the one
219
+ scroller, with the page in a centered column, an optional `sidebar` beside it
220
+ on `sidebarSide`, and the `footer` below (a `sticky` Footer, like the Header).
221
+ `contentClassName` styles the column, e.g. its side padding. `main` and the
222
+ sidebar reach under the header's and footer's rounded corners, so the page
223
+ scrolls on behind them: give them a `sticky` Header and Footer, which sit on a
224
+ layer above that content. The sidebar pads itself with `--inset-top` and
225
+ `--inset-bottom`, that overlap (`0px` without a header or footer). The skip link
226
+ reads the `skipToContent` label. The app's menu and other overlays render
227
+ beside it.
228
+ - `Header` is the bar on top. Its `title` (the site's name or the page's, which
229
+ ends in an ellipsis when too long) can hold the app's link home, and `heading`
230
+ makes it the page's `h1`. `leading` goes before it (a back link), `children`
231
+ after it (a nav), then an icon button for `onAction` with `actionIcon`, named
232
+ by `actionLabel` or the `menu` label.
233
+ - `Footer` is the bar at the bottom, holding a line of text.
234
+
235
+ ```tsx
236
+ const menu = useDisclosure();
237
+
238
+ <>
239
+ <AppLayout
240
+ header={
241
+ <Header
242
+ sticky
243
+ title={<Link href={`/${language}`}>{websiteTitle}</Link>}
244
+ titleClassName="font-metal-mania"
245
+ onAction={menu.open}
246
+ actionIcon={Menu01Icon}
247
+ />
248
+ }
249
+ footer={<Footer className="font-metal-mania">{websiteTitle}</Footer>}
250
+ >
251
+ {children}
252
+ </AppLayout>
253
+ <Menu open={menu.isOpen} onClose={menu.close} />
254
+ </>
255
+ ```
256
+
257
+ - `SettingsSection`, `SettingsRow`, `SettingsSwatchButton` and
258
+ `SettingsPickerModal` (its `title` names the dialog) build a settings page.
259
+ - `HomeCard` links to a section of the app. With `asChild` its child is the
260
+ link and the card's content goes inside it:
261
+
262
+ ```tsx
263
+ <HomeCard asChild title={…} icon={…}>
264
+ <Link href={`/${language}/games`} />
265
+ </HomeCard>
266
+ ```
267
+
268
+ Without `asChild` it is a button that runs `onClick`.
269
+ - `Loader` draws bouncing bars in the text color; `fullScreen` centers them over
270
+ the page.
271
+ - `ScrollToTopFab` scrolls its nearest scrolling ancestor to the top. It fades in
272
+ after `screensBeforeVisible` screen heights; `position="inline"` keeps it in
273
+ the flow, always shown. Its name is the `scrollToTop` label. Pressed from the
274
+ keyboard, it moves focus to the scroller (when focusable, like a skip link's
275
+ `main`), so the next Tab starts at the top.
276
+ - `useDisclosure()` gives `{ isOpen, open, close }`. `useScrollAncestor(ref)`
277
+ finds the nearest scrolling ancestor.
278
+ - `isKeyOf(options, value)` narrows a Radix `onValueChange` string to an option
279
+ map's keys.
@@ -0,0 +1,27 @@
1
+ import type { IconSvgElement } from "@hugeicons/react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import type { ReactNode } from "react";
4
+ declare const homeCardVariants: (props?: ({
5
+ size?: "hero" | "default" | "compact" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ type HomeCardProps = VariantProps<typeof homeCardVariants> & {
8
+ /**
9
+ * The card becomes its only child, the app's link (`<Link href="…" />`), with
10
+ * the card's content put inside it. Without it the card is a button, and
11
+ * `onClick` is what it does.
12
+ */
13
+ asChild?: boolean;
14
+ children?: ReactNode;
15
+ onClick?: () => void;
16
+ title: string;
17
+ titleClassName?: string;
18
+ description?: string;
19
+ icon: IconSvgElement;
20
+ iconClassName?: string;
21
+ /** Sits in the bottom right corner, level with the media. */
22
+ badge?: ReactNode;
23
+ media?: ReactNode;
24
+ className?: string;
25
+ };
26
+ declare function HomeCard({ asChild, children, onClick, title, titleClassName, description, icon, iconClassName, badge, media, size, className, }: HomeCardProps): import("react").JSX.Element;
27
+ export { HomeCard, type HomeCardProps };
@@ -0,0 +1,53 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { Slot } from "radix-ui";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
+ import { HugeiconsIcon } from "@hugeicons/react";
6
+ // src/blucks/components/homeCard.tsx
7
+ var homeCardVariants = cva("bg-card text-card-foreground border border-border border-l-4 border-l-theme-500 rounded-primary flex flex-col gap-2 p-3 sm:p-4 h-full outline-none transition-all duration-300 hover:bg-muted active:bg-muted active:translate-y-px focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:shadow-[0_2px_3px_-1px_rgb(0_0_0/0.25),0_1px_2px_-1px_rgb(0_0_0/0.15)] dark:active:shadow-[0_2px_3px_-1px_rgb(0_0_0/0.35),0_1px_2px_-1px_rgb(0_0_0/0.22)]", {
8
+ variants: { size: {
9
+ hero: "hover:-translate-y-1 shadow-[0_10px_16px_-3px_rgb(0_0_0/0.30),0_5px_8px_-4px_rgb(0_0_0/0.20)] dark:shadow-[0_10px_16px_-3px_rgb(0_0_0/0.45),0_5px_8px_-4px_rgb(0_0_0/0.30)] hover:shadow-[0_16px_24px_-4px_rgb(0_0_0/0.35),0_8px_12px_-5px_rgb(0_0_0/0.25)] dark:hover:shadow-[0_16px_24px_-4px_rgb(0_0_0/0.5),0_8px_12px_-5px_rgb(0_0_0/0.35)]",
10
+ default: "hover:-translate-y-0.5 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)] hover:shadow-[0_9px_14px_-2px_rgb(0_0_0/0.30),0_5px_8px_-3px_rgb(0_0_0/0.20)] dark:hover:shadow-[0_9px_14px_-2px_rgb(0_0_0/0.45),0_5px_8px_-3px_rgb(0_0_0/0.30)]",
11
+ compact: "hover:-translate-y-0.5 shadow-[0_3px_4px_-1px_rgb(0_0_0/0.2),0_2px_3px_-2px_rgb(0_0_0/0.12)] dark:shadow-[0_3px_4px_-1px_rgb(0_0_0/0.3),0_2px_3px_-2px_rgb(0_0_0/0.18)] hover:shadow-[0_6px_10px_-2px_rgb(0_0_0/0.25),0_3px_5px_-3px_rgb(0_0_0/0.15)] dark:hover:shadow-[0_6px_10px_-2px_rgb(0_0_0/0.38),0_3px_5px_-3px_rgb(0_0_0/0.24)]"
12
+ } },
13
+ defaultVariants: { size: "default" }
14
+ });
15
+ function HomeCard({ asChild = false, children, onClick, title, titleClassName, description, icon, iconClassName, badge, media, size = "default", className }) {
16
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsxs("div", {
18
+ className: "flex items-center gap-2.5",
19
+ children: [/* @__PURE__ */ jsx(HugeiconsIcon, {
20
+ icon,
21
+ "aria-hidden": true,
22
+ className: cn("size-6 shrink-0 text-theme-600", iconClassName)
23
+ }), /* @__PURE__ */ jsx("h2", {
24
+ className: cn("text-lg font-bold leading-tight", titleClassName),
25
+ children: title
26
+ })]
27
+ }),
28
+ description ? /* @__PURE__ */ jsx("p", {
29
+ className: "text-sm text-muted-foreground whitespace-pre-wrap",
30
+ children: description
31
+ }) : null,
32
+ badge ? /* @__PURE__ */ jsxs("div", {
33
+ className: "flex items-end gap-2 mt-auto",
34
+ children: [media, /* @__PURE__ */ jsx("div", {
35
+ className: "ml-auto shrink-0",
36
+ children: badge
37
+ })]
38
+ }) : media
39
+ ] });
40
+ if (asChild) return /* @__PURE__ */ jsxs(Slot.Root, {
41
+ className: cn(homeCardVariants({ size }), className),
42
+ children: [/* @__PURE__ */ jsx(Slot.Slottable, { children }), content]
43
+ });
44
+ return /* @__PURE__ */ jsx("button", {
45
+ type: "button",
46
+ onClick,
47
+ className: cn(homeCardVariants({ size }), "w-full text-left cursor-pointer", className),
48
+ children: content
49
+ });
50
+ }
51
+ export { HomeCard };
52
+
53
+ //# sourceMappingURL=homeCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homeCard.js","names":["_Fragment"],"sources":["../../../src/blucks/components/homeCard.tsx"],"sourcesContent":["import type { IconSvgElement } from \"@hugeicons/react\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"radix-ui\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"~/style/utils\";\n\nconst homeCardVariants = cva(\n \"bg-card text-card-foreground border border-border border-l-4 border-l-theme-500 rounded-primary flex flex-col gap-2 p-3 sm:p-4 h-full outline-none transition-all duration-300 hover:bg-muted active:bg-muted active:translate-y-px focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:shadow-[0_2px_3px_-1px_rgb(0_0_0/0.25),0_1px_2px_-1px_rgb(0_0_0/0.15)] dark:active:shadow-[0_2px_3px_-1px_rgb(0_0_0/0.35),0_1px_2px_-1px_rgb(0_0_0/0.22)]\",\n {\n variants: {\n size: {\n hero: \"hover:-translate-y-1 shadow-[0_10px_16px_-3px_rgb(0_0_0/0.30),0_5px_8px_-4px_rgb(0_0_0/0.20)] dark:shadow-[0_10px_16px_-3px_rgb(0_0_0/0.45),0_5px_8px_-4px_rgb(0_0_0/0.30)] hover:shadow-[0_16px_24px_-4px_rgb(0_0_0/0.35),0_8px_12px_-5px_rgb(0_0_0/0.25)] dark:hover:shadow-[0_16px_24px_-4px_rgb(0_0_0/0.5),0_8px_12px_-5px_rgb(0_0_0/0.35)]\",\n default:\n \"hover:-translate-y-0.5 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)] hover:shadow-[0_9px_14px_-2px_rgb(0_0_0/0.30),0_5px_8px_-3px_rgb(0_0_0/0.20)] dark:hover:shadow-[0_9px_14px_-2px_rgb(0_0_0/0.45),0_5px_8px_-3px_rgb(0_0_0/0.30)]\",\n compact:\n \"hover:-translate-y-0.5 shadow-[0_3px_4px_-1px_rgb(0_0_0/0.2),0_2px_3px_-2px_rgb(0_0_0/0.12)] dark:shadow-[0_3px_4px_-1px_rgb(0_0_0/0.3),0_2px_3px_-2px_rgb(0_0_0/0.18)] hover:shadow-[0_6px_10px_-2px_rgb(0_0_0/0.25),0_3px_5px_-3px_rgb(0_0_0/0.15)] dark:hover:shadow-[0_6px_10px_-2px_rgb(0_0_0/0.38),0_3px_5px_-3px_rgb(0_0_0/0.24)]\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\ntype HomeCardProps = VariantProps<typeof homeCardVariants> & {\n /**\n * The card becomes its only child, the app's link (`<Link href=\"…\" />`), with\n * the card's content put inside it. Without it the card is a button, and\n * `onClick` is what it does.\n */\n asChild?: boolean;\n children?: ReactNode;\n onClick?: () => void;\n title: string;\n titleClassName?: string;\n description?: string;\n icon: IconSvgElement;\n iconClassName?: string;\n /** Sits in the bottom right corner, level with the media. */\n badge?: ReactNode;\n media?: ReactNode;\n className?: string;\n};\n\nfunction HomeCard({\n asChild = false,\n children,\n onClick,\n title,\n titleClassName,\n description,\n icon,\n iconClassName,\n badge,\n media,\n size = \"default\",\n className,\n}: HomeCardProps) {\n const content = (\n <>\n <div className=\"flex items-center gap-2.5\">\n <HugeiconsIcon\n icon={icon}\n aria-hidden\n className={cn(\"size-6 shrink-0 text-theme-600\", iconClassName)}\n />\n <h2 className={cn(\"text-lg font-bold leading-tight\", titleClassName)}>{title}</h2>\n </div>\n {description ? (\n <p className=\"text-sm text-muted-foreground whitespace-pre-wrap\">{description}</p>\n ) : null}\n {badge ? (\n <div className=\"flex items-end gap-2 mt-auto\">\n {media}\n <div className=\"ml-auto shrink-0\">{badge}</div>\n </div>\n ) : (\n media\n )}\n </>\n );\n\n if (asChild) {\n return (\n <Slot.Root className={cn(homeCardVariants({ size }), className)}>\n <Slot.Slottable>{children}</Slot.Slottable>\n {content}\n </Slot.Root>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(homeCardVariants({ size }), \"w-full text-left cursor-pointer\", className)}\n >\n {content}\n </button>\n );\n}\n\nexport { HomeCard, type HomeCardProps };\n"],"mappings":";;;;;;AAOA,IAAM,mBAAmB,IACvB,sdACA;CACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,SACE;EACF,SACE;CACJ,EACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CACF;AAsBA,SAAS,SAAS,EAChB,UAAU,OACV,UACA,SACA,OACA,gBACA,aACA,MACA,eACA,OACA,OACA,OAAO,WACP,aACgB;CAChB,MAAM,UACJ,qBAAAA,UAAA,EAAA,UAAA;EACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,eAAD;IACQ;IACN,eAAA;IACA,WAAW,GAAG,kCAAkC,aAAa;GAC9D,CAAA,GACD,oBAAC,MAAD;IAAI,WAAW,GAAG,mCAAmC,cAAc;IAAI,UAAA;GAAU,CAAA,CAC9E;;EACJ,cACC,oBAAC,KAAD;GAAG,WAAU;GAAqD,UAAA;EAAe,CAAA,IAC/E;EACH,QACC,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,OACD,oBAAC,OAAD;IAAK,WAAU;IAAoB,UAAA;GAAW,CAAA,CAC3C;EAEL,CAAA,IAAA;CAEF,EAAA,CAAA;CAGJ,IAAI,SACF,OACE,qBAAC,KAAK,MAAN;EAAW,WAAW,GAAG,iBAAiB,EAAE,KAAK,CAAC,GAAG,SAAS;EAA9D,UAAA,CACE,oBAAC,KAAK,WAAN,EAAiB,SAAyB,CAAA,GACzC,OACQ;;CAIf,OACE,oBAAC,UAAD;EACE,MAAK;EACI;EACT,WAAW,GAAG,iBAAiB,EAAE,KAAK,CAAC,GAAG,mCAAmC,SAAS;EAErF,UAAA;CACK,CAAA;AAEZ"}
@@ -0,0 +1,169 @@
1
+ /* The bars hold a [2 3 5 6 7 6 4] spectrum contour and pulse together on a 4-beat envelope. */
2
+ .loader {
3
+ display: inline-block;
4
+ position: relative;
5
+ width: 100px;
6
+ height: 50px;
7
+ background-repeat: no-repeat;
8
+ background-image:
9
+ linear-gradient(currentColor 50px, transparent 0),
10
+ linear-gradient(currentColor 50px, transparent 0),
11
+ linear-gradient(currentColor 50px, transparent 0),
12
+ linear-gradient(currentColor 50px, transparent 0),
13
+ linear-gradient(currentColor 50px, transparent 0),
14
+ linear-gradient(currentColor 50px, transparent 0),
15
+ linear-gradient(currentColor 50px, transparent 0);
16
+ background-position:
17
+ 0px center,
18
+ 15px center,
19
+ 30px center,
20
+ 45px center,
21
+ 60px center,
22
+ 75px center,
23
+ 90px center;
24
+ animation: musicBounce 1.8s ease-in-out infinite;
25
+ }
26
+ @keyframes musicBounce {
27
+ 0% {
28
+ background-size:
29
+ 10px 12px,
30
+ 10px 18px,
31
+ 10px 20px,
32
+ 10px 35px,
33
+ 10px 33px,
34
+ 10px 25px,
35
+ 10px 24px;
36
+ }
37
+
38
+ 8.3333% {
39
+ background-size:
40
+ 10px 17px,
41
+ 10px 19px,
42
+ 10px 30px,
43
+ 10px 41px,
44
+ 10px 35px,
45
+ 10px 36px,
46
+ 10px 27px;
47
+ }
48
+
49
+ 16.6667% {
50
+ background-size:
51
+ 10px 17px,
52
+ 10px 17px,
53
+ 10px 33px,
54
+ 10px 32px,
55
+ 10px 37px,
56
+ 10px 37px,
57
+ 10px 21px;
58
+ }
59
+
60
+ 25% {
61
+ background-size:
62
+ 10px 12px,
63
+ 10px 14px,
64
+ 10px 25px,
65
+ 10px 25px,
66
+ 10px 42px,
67
+ 10px 34px,
68
+ 10px 17px;
69
+ }
70
+
71
+ 33.3333% {
72
+ background-size:
73
+ 10px 13px,
74
+ 10px 21px,
75
+ 10px 26px,
76
+ 10px 31px,
77
+ 10px 39px,
78
+ 10px 36px,
79
+ 10px 24px;
80
+ }
81
+
82
+ 41.6667% {
83
+ background-size:
84
+ 10px 13px,
85
+ 10px 22px,
86
+ 10px 27px,
87
+ 10px 32px,
88
+ 10px 29px,
89
+ 10px 27px,
90
+ 10px 26px;
91
+ }
92
+
93
+ 50% {
94
+ background-size:
95
+ 10px 12px,
96
+ 10px 18px,
97
+ 10px 29px,
98
+ 10px 35px,
99
+ 10px 38px,
100
+ 10px 25px,
101
+ 10px 24px;
102
+ }
103
+
104
+ 58.3333% {
105
+ background-size:
106
+ 10px 17px,
107
+ 10px 19px,
108
+ 10px 32px,
109
+ 10px 41px,
110
+ 10px 48px,
111
+ 10px 36px,
112
+ 10px 27px;
113
+ }
114
+
115
+ 66.6667% {
116
+ background-size:
117
+ 10px 17px,
118
+ 10px 17px,
119
+ 10px 24px,
120
+ 10px 32px,
121
+ 10px 33px,
122
+ 10px 37px,
123
+ 10px 21px;
124
+ }
125
+
126
+ 75% {
127
+ background-size:
128
+ 10px 12px,
129
+ 10px 14px,
130
+ 10px 24px,
131
+ 10px 25px,
132
+ 10px 29px,
133
+ 10px 34px,
134
+ 10px 17px;
135
+ }
136
+
137
+ 83.3333% {
138
+ background-size:
139
+ 10px 13px,
140
+ 10px 21px,
141
+ 10px 35px,
142
+ 10px 31px,
143
+ 10px 44px,
144
+ 10px 36px,
145
+ 10px 24px;
146
+ }
147
+
148
+ 91.6667% {
149
+ background-size:
150
+ 10px 13px,
151
+ 10px 22px,
152
+ 10px 27px,
153
+ 10px 32px,
154
+ 10px 41px,
155
+ 10px 27px,
156
+ 10px 26px;
157
+ }
158
+
159
+ 100% {
160
+ background-size:
161
+ 10px 12px,
162
+ 10px 18px,
163
+ 10px 20px,
164
+ 10px 35px,
165
+ 10px 33px,
166
+ 10px 25px,
167
+ 10px 24px;
168
+ }
169
+ }
@@ -0,0 +1,16 @@
1
+ import "./loader.css";
2
+ type LoaderProps = {
3
+ isOpen: boolean;
4
+ /** Tailwind text color utilities, e.g. "text-cyan-400" */
5
+ className?: string;
6
+ /** Center the loader over a full-page overlay */
7
+ fullScreen?: boolean;
8
+ /** With fullScreen, skip the dimmed backdrop so the page shows through */
9
+ transparentBg?: boolean;
10
+ /** What screen readers announce, in the page's language; English "Loading" if left out */
11
+ label?: string;
12
+ /** Makes the wrapper a keyboard-accessible button you can click */
13
+ onClick?: () => void;
14
+ };
15
+ declare function Loader({ isOpen, className, fullScreen, transparentBg, label, onClick }: LoaderProps): import("react").JSX.Element | null;
16
+ export { Loader };
@@ -0,0 +1,28 @@
1
+ import { cn } from "../../style/utils.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import "./loader.css";
4
+ // src/blucks/components/loader.tsx
5
+ function Loader({ isOpen, className, fullScreen, transparentBg, label, onClick }) {
6
+ if (!isOpen) return null;
7
+ const wrapperClassName = fullScreen ? cn("fixed inset-0 z-loader flex items-center justify-center", !transparentBg ? "bg-black/50" : null) : void 0;
8
+ const bars = /* @__PURE__ */ jsx("span", { className: `loader ${className ?? ""}`.trim() });
9
+ const status = /* @__PURE__ */ jsx("span", {
10
+ role: "status",
11
+ "aria-live": "polite",
12
+ className: "sr-only",
13
+ lang: label === void 0 ? "en" : void 0,
14
+ children: label ?? "Loading"
15
+ });
16
+ return onClick ? /* @__PURE__ */ jsxs("button", {
17
+ type: "button",
18
+ onClick,
19
+ className: wrapperClassName,
20
+ children: [bars, status]
21
+ }) : /* @__PURE__ */ jsxs("div", {
22
+ className: wrapperClassName,
23
+ children: [bars, status]
24
+ });
25
+ }
26
+ export { Loader };
27
+
28
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","names":[],"sources":["../../../src/blucks/components/loader.tsx"],"sourcesContent":["import \"~/blucks/components/loader.css\";\nimport { cn } from \"~/style/utils\";\n\ntype LoaderProps = {\n isOpen: boolean;\n /** Tailwind text color utilities, e.g. \"text-cyan-400\" */\n className?: string;\n /** Center the loader over a full-page overlay */\n fullScreen?: boolean;\n /** With fullScreen, skip the dimmed backdrop so the page shows through */\n transparentBg?: boolean;\n /** What screen readers announce, in the page's language; English \"Loading\" if left out */\n label?: string;\n /** Makes the wrapper a keyboard-accessible button you can click */\n onClick?: () => void;\n};\n\nfunction Loader({ isOpen, className, fullScreen, transparentBg, label, onClick }: LoaderProps) {\n if (!isOpen) return null;\n\n const backdropClassName = !transparentBg ? \"bg-black/50\" : null;\n const wrapperClassName = fullScreen\n ? cn(\"fixed inset-0 z-loader flex items-center justify-center\", backdropClassName)\n : undefined;\n\n const bars = <span className={`loader ${className ?? \"\"}`.trim()} />;\n\n // The fallback is English on any page, so it says so for the screen reader's voice.\n const status = (\n <span\n role=\"status\"\n aria-live=\"polite\"\n className=\"sr-only\"\n lang={label === undefined ? \"en\" : undefined}\n >\n {label ?? \"Loading\"}\n </span>\n );\n\n return onClick ? (\n <button type=\"button\" onClick={onClick} className={wrapperClassName}>\n {bars}\n {status}\n </button>\n ) : (\n <div className={wrapperClassName}>\n {bars}\n {status}\n </div>\n );\n}\n\nexport { Loader };\n"],"mappings":";;;;AAiBA,SAAS,OAAO,EAAE,QAAQ,WAAW,YAAY,eAAe,OAAO,WAAwB;CAC7F,IAAI,CAAC,QAAQ,OAAO;CAGpB,MAAM,mBAAmB,aACrB,GAAG,2DAFmB,CAAC,gBAAgB,gBAAgB,IAEwB,IAC/E,KAAA;CAEJ,MAAM,OAAO,oBAAC,QAAD,EAAM,WAAW,UAAU,aAAa,KAAK,KAAK,EAAI,CAAA;CAGnE,MAAM,SACJ,oBAAC,QAAD;EACE,MAAK;EACL,aAAU;EACV,WAAU;EACV,MAAM,UAAU,KAAA,IAAY,OAAO,KAAA;EAElC,UAAA,SAAS;CACN,CAAA;CAGR,OAAO,UACL,qBAAC,UAAD;EAAQ,MAAK;EAAkB;EAAS,WAAW;EAAnD,UAAA,CACG,MACA,MACK;CAER,CAAA,IAAA,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACG,MACA,MACE;;AAET"}
@@ -0,0 +1,9 @@
1
+ @keyframes flap {
2
+ 0%,
3
+ 100% {
4
+ rotate: -25deg;
5
+ }
6
+ 50% {
7
+ rotate: -15deg;
8
+ }
9
+ }
@@ -0,0 +1,17 @@
1
+ import { type ComponentProps } from "react";
2
+ import "./scrollToTopFab.css";
3
+ import { AppIcon } from "../../ui/components/icon";
4
+ type ScrollToTopFabProps = {
5
+ /** How many screen heights must be scrolled before the button appears. */
6
+ screensBeforeVisible?: number;
7
+ /** `inline` drops the fixed positioning and keeps the button in normal flow. */
8
+ position?: "bottom-right" | "bottom-left" | "inline";
9
+ className?: string;
10
+ /** Draws the icon in the theme accent. */
11
+ theme?: boolean;
12
+ icon?: ComponentProps<typeof AppIcon>["icon"];
13
+ /** Rocks the icon with the flap animation. */
14
+ animate?: boolean;
15
+ };
16
+ declare function ScrollToTopFab({ screensBeforeVisible, position, className, theme, icon, animate, }: ScrollToTopFabProps): import("react").JSX.Element;
17
+ export { ScrollToTopFab };