@velocity-astro/cms-ui 0.1.0-beta.1 → 0.1.0-beta.12

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 (263) hide show
  1. package/component-registry.json +93 -8
  2. package/dist/components/BarChart/BarChart.d.ts +23 -0
  3. package/dist/components/BarChart/BarChart.d.ts.map +1 -0
  4. package/dist/components/BarChart/BarChart.js +19 -0
  5. package/dist/components/BarChart/BarChart.js.map +1 -0
  6. package/dist/components/BarChart/BarChart.variants.d.ts +29 -0
  7. package/dist/components/BarChart/BarChart.variants.d.ts.map +1 -0
  8. package/dist/components/BarChart/BarChart.variants.js +81 -0
  9. package/dist/components/BarChart/BarChart.variants.js.map +1 -0
  10. package/dist/components/BarChart/index.d.ts +2 -0
  11. package/dist/components/BarChart/index.d.ts.map +1 -0
  12. package/dist/components/BarChart/index.js +2 -0
  13. package/dist/components/BarChart/index.js.map +1 -0
  14. package/dist/components/Button/Button.d.ts +6 -1
  15. package/dist/components/Button/Button.d.ts.map +1 -1
  16. package/dist/components/Button/Button.js +5 -3
  17. package/dist/components/Button/Button.js.map +1 -1
  18. package/dist/components/Button/Button.variants.d.ts +6 -1
  19. package/dist/components/Button/Button.variants.d.ts.map +1 -1
  20. package/dist/components/Button/Button.variants.js +13 -1
  21. package/dist/components/Button/Button.variants.js.map +1 -1
  22. package/dist/components/Card/Card.d.ts +3 -1
  23. package/dist/components/Card/Card.d.ts.map +1 -1
  24. package/dist/components/Card/Card.js +3 -3
  25. package/dist/components/Card/Card.js.map +1 -1
  26. package/dist/components/Card/Card.variants.d.ts +4 -1
  27. package/dist/components/Card/Card.variants.d.ts.map +1 -1
  28. package/dist/components/Card/Card.variants.js +6 -1
  29. package/dist/components/Card/Card.variants.js.map +1 -1
  30. package/dist/components/ColorPicker/ColorPicker.d.ts +30 -0
  31. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -0
  32. package/dist/components/ColorPicker/ColorPicker.js +32 -0
  33. package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
  34. package/dist/components/ColorPicker/ColorPicker.variants.d.ts +24 -0
  35. package/dist/components/ColorPicker/ColorPicker.variants.d.ts.map +1 -0
  36. package/dist/components/ColorPicker/ColorPicker.variants.js +42 -0
  37. package/dist/components/ColorPicker/ColorPicker.variants.js.map +1 -0
  38. package/dist/components/ColorPicker/index.d.ts +2 -0
  39. package/dist/components/ColorPicker/index.d.ts.map +1 -0
  40. package/dist/components/ColorPicker/index.js +2 -0
  41. package/dist/components/ColorPicker/index.js.map +1 -0
  42. package/dist/components/FileButton/FileButton.d.ts +3 -1
  43. package/dist/components/FileButton/FileButton.d.ts.map +1 -1
  44. package/dist/components/FileButton/FileButton.js +2 -2
  45. package/dist/components/FileButton/FileButton.js.map +1 -1
  46. package/dist/components/Grid/Grid.variants.d.ts +1 -0
  47. package/dist/components/Grid/Grid.variants.d.ts.map +1 -1
  48. package/dist/components/Grid/Grid.variants.js +4 -3
  49. package/dist/components/Grid/Grid.variants.js.map +1 -1
  50. package/dist/components/Heading/Heading.d.ts +1 -1
  51. package/dist/components/Heading/Heading.d.ts.map +1 -1
  52. package/dist/components/Heading/Heading.js +2 -2
  53. package/dist/components/Heading/Heading.js.map +1 -1
  54. package/dist/components/Heading/Heading.variants.d.ts +1 -0
  55. package/dist/components/Heading/Heading.variants.d.ts.map +1 -1
  56. package/dist/components/Heading/Heading.variants.js +2 -0
  57. package/dist/components/Heading/Heading.variants.js.map +1 -1
  58. package/dist/components/LoadingMark/LoadingMark.d.ts +11 -0
  59. package/dist/components/LoadingMark/LoadingMark.d.ts.map +1 -0
  60. package/dist/components/LoadingMark/LoadingMark.js +17 -0
  61. package/dist/components/LoadingMark/LoadingMark.js.map +1 -0
  62. package/dist/components/LoadingMark/LoadingMark.variants.d.ts +22 -0
  63. package/dist/components/LoadingMark/LoadingMark.variants.d.ts.map +1 -0
  64. package/dist/components/LoadingMark/LoadingMark.variants.js +18 -0
  65. package/dist/components/LoadingMark/LoadingMark.variants.js.map +1 -0
  66. package/dist/components/LoadingMark/index.d.ts +2 -0
  67. package/dist/components/LoadingMark/index.d.ts.map +1 -0
  68. package/dist/components/LoadingMark/index.js +2 -0
  69. package/dist/components/LoadingMark/index.js.map +1 -0
  70. package/dist/components/Logo/Logo.d.ts +10 -2
  71. package/dist/components/Logo/Logo.d.ts.map +1 -1
  72. package/dist/components/Logo/Logo.js +11 -3
  73. package/dist/components/Logo/Logo.js.map +1 -1
  74. package/dist/components/Logo/Logo.variants.d.ts +5 -2
  75. package/dist/components/Logo/Logo.variants.d.ts.map +1 -1
  76. package/dist/components/Logo/Logo.variants.js +10 -1
  77. package/dist/components/Logo/Logo.variants.js.map +1 -1
  78. package/dist/components/Meter/Meter.d.ts +13 -0
  79. package/dist/components/Meter/Meter.d.ts.map +1 -0
  80. package/dist/components/Meter/Meter.js +8 -0
  81. package/dist/components/Meter/Meter.js.map +1 -0
  82. package/dist/components/Meter/Meter.variants.d.ts +14 -0
  83. package/dist/components/Meter/Meter.variants.d.ts.map +1 -0
  84. package/dist/components/Meter/Meter.variants.js +39 -0
  85. package/dist/components/Meter/Meter.variants.js.map +1 -0
  86. package/dist/components/Meter/index.d.ts +2 -0
  87. package/dist/components/Meter/index.d.ts.map +1 -0
  88. package/dist/components/Meter/index.js +2 -0
  89. package/dist/components/Meter/index.js.map +1 -0
  90. package/dist/components/RichTextEditor/RichTextEditor.d.ts +8 -1
  91. package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  92. package/dist/components/RichTextEditor/RichTextEditor.js +62 -17
  93. package/dist/components/RichTextEditor/RichTextEditor.js.map +1 -1
  94. package/dist/components/RichTextEditor/index.d.ts +1 -1
  95. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  96. package/dist/components/RichTextEditor/index.js.map +1 -1
  97. package/dist/components/Segmented/Segmented.d.ts +14 -1
  98. package/dist/components/Segmented/Segmented.d.ts.map +1 -1
  99. package/dist/components/Segmented/Segmented.js +14 -5
  100. package/dist/components/Segmented/Segmented.js.map +1 -1
  101. package/dist/components/Segmented/Segmented.variants.d.ts +14 -1
  102. package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
  103. package/dist/components/Segmented/Segmented.variants.js +19 -3
  104. package/dist/components/Segmented/Segmented.variants.js.map +1 -1
  105. package/dist/components/Spotlight/Spotlight.d.ts +16 -0
  106. package/dist/components/Spotlight/Spotlight.d.ts.map +1 -0
  107. package/dist/components/Spotlight/Spotlight.js +28 -0
  108. package/dist/components/Spotlight/Spotlight.js.map +1 -0
  109. package/dist/components/Spotlight/Spotlight.variants.d.ts +8 -0
  110. package/dist/components/Spotlight/Spotlight.variants.d.ts.map +1 -0
  111. package/dist/components/Spotlight/Spotlight.variants.js +15 -0
  112. package/dist/components/Spotlight/Spotlight.variants.js.map +1 -0
  113. package/dist/components/Spotlight/index.d.ts +2 -0
  114. package/dist/components/Spotlight/index.d.ts.map +1 -0
  115. package/dist/components/Spotlight/index.js +2 -0
  116. package/dist/components/Spotlight/index.js.map +1 -0
  117. package/dist/components/Table/Table.d.ts +8 -1
  118. package/dist/components/Table/Table.d.ts.map +1 -1
  119. package/dist/components/Table/Table.js +4 -4
  120. package/dist/components/Table/Table.js.map +1 -1
  121. package/dist/components/Table/Table.variants.d.ts +6 -2
  122. package/dist/components/Table/Table.variants.d.ts.map +1 -1
  123. package/dist/components/Table/Table.variants.js +11 -5
  124. package/dist/components/Table/Table.variants.js.map +1 -1
  125. package/dist/components/index.d.ts +5 -0
  126. package/dist/components/index.d.ts.map +1 -1
  127. package/dist/components/index.js +5 -0
  128. package/dist/components/index.js.map +1 -1
  129. package/dist/components/scales.d.ts +2 -2
  130. package/dist/components/scales.d.ts.map +1 -1
  131. package/dist/components/scales.js +4 -2
  132. package/dist/components/scales.js.map +1 -1
  133. package/dist/patterns/AppShell/AppShell.d.ts +38 -8
  134. package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
  135. package/dist/patterns/AppShell/AppShell.js +46 -7
  136. package/dist/patterns/AppShell/AppShell.js.map +1 -1
  137. package/dist/patterns/AppShell/AppShell.variants.d.ts +89 -20
  138. package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
  139. package/dist/patterns/AppShell/AppShell.variants.js +148 -23
  140. package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
  141. package/dist/patterns/AppShell/index.d.ts +1 -1
  142. package/dist/patterns/AppShell/index.d.ts.map +1 -1
  143. package/dist/patterns/AppShell/index.js.map +1 -1
  144. package/dist/patterns/CommandPalette/CommandPalette.d.ts +43 -0
  145. package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
  146. package/dist/patterns/CommandPalette/CommandPalette.js +19 -0
  147. package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
  148. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
  149. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
  150. package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
  151. package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
  152. package/dist/patterns/CommandPalette/index.d.ts +2 -0
  153. package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
  154. package/dist/patterns/CommandPalette/index.js +2 -0
  155. package/dist/patterns/CommandPalette/index.js.map +1 -0
  156. package/dist/patterns/ImagePicker/ImagePicker.d.ts +9 -1
  157. package/dist/patterns/ImagePicker/ImagePicker.d.ts.map +1 -1
  158. package/dist/patterns/ImagePicker/ImagePicker.js +13 -8
  159. package/dist/patterns/ImagePicker/ImagePicker.js.map +1 -1
  160. package/dist/patterns/OptionPicker/OptionPicker.d.ts +2 -0
  161. package/dist/patterns/OptionPicker/OptionPicker.d.ts.map +1 -1
  162. package/dist/patterns/OptionPicker/OptionPicker.js +8 -3
  163. package/dist/patterns/OptionPicker/OptionPicker.js.map +1 -1
  164. package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts +10 -4
  165. package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts.map +1 -1
  166. package/dist/patterns/OptionPicker/OptionPicker.variants.js +29 -6
  167. package/dist/patterns/OptionPicker/OptionPicker.variants.js.map +1 -1
  168. package/dist/patterns/Outline/Outline.d.ts +26 -0
  169. package/dist/patterns/Outline/Outline.d.ts.map +1 -0
  170. package/dist/patterns/Outline/Outline.js +21 -0
  171. package/dist/patterns/Outline/Outline.js.map +1 -0
  172. package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
  173. package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
  174. package/dist/patterns/Outline/Outline.variants.js +21 -0
  175. package/dist/patterns/Outline/Outline.variants.js.map +1 -0
  176. package/dist/patterns/Outline/index.d.ts +2 -0
  177. package/dist/patterns/Outline/index.d.ts.map +1 -0
  178. package/dist/patterns/Outline/index.js +2 -0
  179. package/dist/patterns/Outline/index.js.map +1 -0
  180. package/dist/patterns/PageHeader/PageHeader.d.ts +33 -4
  181. package/dist/patterns/PageHeader/PageHeader.d.ts.map +1 -1
  182. package/dist/patterns/PageHeader/PageHeader.js +31 -6
  183. package/dist/patterns/PageHeader/PageHeader.js.map +1 -1
  184. package/dist/patterns/PageHeader/PageHeader.variants.d.ts +23 -2
  185. package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
  186. package/dist/patterns/PageHeader/PageHeader.variants.js +33 -2
  187. package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
  188. package/dist/patterns/PagePreview/PagePreview.d.ts +138 -4
  189. package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
  190. package/dist/patterns/PagePreview/PagePreview.js +159 -13
  191. package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
  192. package/dist/patterns/PagePreview/PagePreview.variants.d.ts +15 -2
  193. package/dist/patterns/PagePreview/PagePreview.variants.d.ts.map +1 -1
  194. package/dist/patterns/PagePreview/PagePreview.variants.js +22 -6
  195. package/dist/patterns/PagePreview/PagePreview.variants.js.map +1 -1
  196. package/dist/patterns/PagePreview/index.d.ts +1 -1
  197. package/dist/patterns/PagePreview/index.d.ts.map +1 -1
  198. package/dist/patterns/PagePreview/index.js.map +1 -1
  199. package/dist/patterns/SaveBar/SaveBar.d.ts +20 -4
  200. package/dist/patterns/SaveBar/SaveBar.d.ts.map +1 -1
  201. package/dist/patterns/SaveBar/SaveBar.js +22 -4
  202. package/dist/patterns/SaveBar/SaveBar.js.map +1 -1
  203. package/dist/patterns/SaveBar/SaveBar.variants.d.ts +27 -5
  204. package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
  205. package/dist/patterns/SaveBar/SaveBar.variants.js +39 -6
  206. package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
  207. package/dist/patterns/SectionList/SectionList.d.ts.map +1 -1
  208. package/dist/patterns/SectionList/SectionList.js +2 -2
  209. package/dist/patterns/SectionList/SectionList.js.map +1 -1
  210. package/dist/patterns/SectionList/SectionList.variants.d.ts +4 -1
  211. package/dist/patterns/SectionList/SectionList.variants.d.ts.map +1 -1
  212. package/dist/patterns/SectionList/SectionList.variants.js +5 -2
  213. package/dist/patterns/SectionList/SectionList.variants.js.map +1 -1
  214. package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
  215. package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
  216. package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
  217. package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
  218. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
  219. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
  220. package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
  221. package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
  222. package/dist/patterns/SiteWindow/index.d.ts +2 -0
  223. package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
  224. package/dist/patterns/SiteWindow/index.js +2 -0
  225. package/dist/patterns/SiteWindow/index.js.map +1 -0
  226. package/dist/patterns/Split/Split.variants.d.ts +2 -2
  227. package/dist/patterns/Split/Split.variants.d.ts.map +1 -1
  228. package/dist/patterns/Split/Split.variants.js +2 -2
  229. package/dist/patterns/Split/Split.variants.js.map +1 -1
  230. package/dist/patterns/Welcome/Welcome.d.ts +18 -0
  231. package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
  232. package/dist/patterns/Welcome/Welcome.js +20 -0
  233. package/dist/patterns/Welcome/Welcome.js.map +1 -0
  234. package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
  235. package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
  236. package/dist/patterns/Welcome/Welcome.variants.js +12 -0
  237. package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
  238. package/dist/patterns/Welcome/index.d.ts +2 -0
  239. package/dist/patterns/Welcome/index.d.ts.map +1 -0
  240. package/dist/patterns/Welcome/index.js +2 -0
  241. package/dist/patterns/Welcome/index.js.map +1 -0
  242. package/dist/patterns/Workbench/Workbench.d.ts +35 -4
  243. package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
  244. package/dist/patterns/Workbench/Workbench.js +59 -4
  245. package/dist/patterns/Workbench/Workbench.js.map +1 -1
  246. package/dist/patterns/Workbench/Workbench.variants.d.ts +56 -4
  247. package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
  248. package/dist/patterns/Workbench/Workbench.variants.js +111 -4
  249. package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
  250. package/dist/patterns/Workbench/index.d.ts +1 -1
  251. package/dist/patterns/Workbench/index.d.ts.map +1 -1
  252. package/dist/patterns/Workbench/index.js.map +1 -1
  253. package/dist/patterns/index.d.ts +4 -0
  254. package/dist/patterns/index.d.ts.map +1 -1
  255. package/dist/patterns/index.js +4 -0
  256. package/dist/patterns/index.js.map +1 -1
  257. package/dist/patterns/page-bar.d.ts +17 -0
  258. package/dist/patterns/page-bar.d.ts.map +1 -0
  259. package/dist/patterns/page-bar.js +22 -0
  260. package/dist/patterns/page-bar.js.map +1 -0
  261. package/package.json +2 -1
  262. package/src/styles.css +179 -0
  263. package/src/tokens/tokens.css +27 -1
@@ -1,51 +1,176 @@
1
1
  import { cva } from 'class-variance-authority';
2
- /** The page is one quiet surface: the sidebar is part of it, and the screen sits on it in a panel. */
3
- export const appShellClass = 'flex h-dvh overflow-hidden bg-background-secondary text-foreground';
2
+ /**
3
+ * From `md` up the window has three parts side by side: the rail of sections; beside it, when the
4
+ * section being shown has places of its own, a column naming them; then the bar across the top and
5
+ * the screen under it. The rail and the column sit on the rail's dark ground, which fills the window,
6
+ * and the bar and the screen in one rounded panel inset from its edges. On a narrower window (a phone,
7
+ * a tablet held upright) the rail and the column are behind a button in the bar, so the screen has
8
+ * the width.
9
+ */
10
+ export const appShellClass = 'flex h-dvh flex-col overflow-hidden bg-background text-foreground md:flex-row md:bg-rail';
4
11
  export const appShellSkipClass = [
5
12
  'sr-only layer-toast rounded-md bg-primary px-4 py-2 text-base font-medium text-primary-foreground',
6
13
  'focus:not-sr-only focus:fixed focus:top-2 focus:left-2',
7
14
  ].join(' ');
8
- export const appShellSidebarClass = 'flex w-60 shrink-0 flex-col px-3 py-5';
9
- export const appShellBrandClass = 'flex items-center gap-2.5 px-2.5 pb-4';
10
- export const appShellBrandTextClass = 'min-w-0';
11
- export const appShellBrandNameClass = 'truncate text-base font-bold text-foreground';
12
- export const appShellBrandDetailClass = 'truncate text-xs text-foreground-muted';
13
- export const appShellNavClass = 'flex-1 overflow-auto';
14
- export const appShellGroupLabelClass = 'px-2.5 pt-4 pb-1.5 text-xs font-semibold tracking-widest text-foreground-muted uppercase';
15
+ /* --- The rail --------------------------------------------------------------- */
16
+ export const appShellRailClass = 'hidden w-16 shrink-0 flex-col items-center gap-1 bg-rail px-2 py-3 md:flex';
17
+ export const appShellRailLogoClass = 'flex h-11 w-11 shrink-0 items-center justify-center pb-2';
18
+ export const appShellRailNavClass = 'flex min-h-0 w-full flex-1 flex-col items-center gap-1 overflow-y-auto';
19
+ /** A group of sections. Each after the first is set off by a short rule; the group placed at the end sits at the bottom. */
20
+ export const appShellRailGroupVariants = cva('flex w-full flex-col items-center gap-1', {
21
+ variants: {
22
+ place: {
23
+ start: 'border-t border-rail-border pt-2 first:border-t-0 first:pt-0',
24
+ end: 'mt-auto pt-2',
25
+ },
26
+ },
27
+ defaultVariants: { place: 'start' },
28
+ });
29
+ export const appShellRailListClass = 'flex flex-col items-center gap-1';
30
+ export const appShellRailLinkVariants = cva([
31
+ 'relative flex h-11 w-11 items-center justify-center rounded-lg transition-colors motion-fast',
32
+ 'outline-none data-focus-visible:ring-2 data-focus-visible:ring-rail-foreground',
33
+ ], {
34
+ variants: {
35
+ isCurrent: {
36
+ true: 'bg-rail-current text-rail-foreground',
37
+ false: 'text-rail-muted data-hovered:bg-rail-hover data-hovered:text-rail-foreground',
38
+ },
39
+ },
40
+ defaultVariants: { isCurrent: false },
41
+ });
42
+ /** The words of a section's link: read out, and shown in a tooltip, since the rail shows only the icon. */
43
+ export const appShellRailLabelClass = 'sr-only';
44
+ /** A number on a section, such as what is new in it, at the corner of its icon. */
45
+ export const appShellRailBadgeClass = 'absolute top-1 right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-rail-foreground px-1 text-xs font-bold text-rail';
46
+ export const appShellRailIconSize = 20;
47
+ export const appShellRailAccountClass = [
48
+ 'flex h-11 w-11 shrink-0 items-center justify-center rounded-lg transition-colors motion-fast',
49
+ 'outline-none data-hovered:bg-rail-hover data-pressed:bg-rail-hover data-focus-visible:ring-2 data-focus-visible:ring-rail-foreground',
50
+ ].join(' ');
51
+ export const appShellRailAvatarClass = 'flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-rail-current text-xs font-bold text-rail-foreground';
52
+ /* --- The column of a section's own places ------------------------------------ */
53
+ /**
54
+ * On the rail's dark ground with no edge of its own, in the dark theme's colours whatever the editor's theme.
55
+ * It opens and closes by its width, so the panel beside it makes room as it slides out and takes the room back
56
+ * as it goes, and its places fade and slide in a little behind it. A person who asks for less motion sees it
57
+ * simply open and close.
58
+ */
59
+ export const appShellSectionVariants = cva('dark hidden shrink-0 overflow-hidden text-foreground transition-all motion-slide view-shell-places md:flex', {
60
+ variants: {
61
+ isOpen: { true: 'w-56', false: 'w-0' },
62
+ },
63
+ defaultVariants: { isOpen: false },
64
+ });
65
+ /** What the column holds: as wide as the column open, so its words never wrap while it opens or closes. */
66
+ export const appShellSectionNavVariants = cva('flex w-56 shrink-0 flex-col gap-5 overflow-y-auto px-3 py-5 transition-all motion-slide', {
67
+ variants: {
68
+ isOpen: { true: 'translate-x-0 opacity-100', false: '-translate-x-4 opacity-0' },
69
+ },
70
+ defaultVariants: { isOpen: false },
71
+ });
72
+ /** The site's name and address, at the top of a section's column and of a narrow window's panel. */
73
+ export const appShellSiteClass = 'flex min-w-0 flex-col gap-0.5 px-2.5';
74
+ export const appShellSiteNameClass = 'truncate text-base font-bold text-foreground';
75
+ export const appShellSiteDetailClass = 'truncate text-xs text-foreground-subtle';
76
+ export const appShellGroupLabelClass = 'px-2.5 pb-1.5 text-xs font-semibold tracking-widest text-foreground-subtle uppercase';
15
77
  export const appShellNavListClass = 'flex flex-col gap-0.5';
16
78
  export const appShellNavLinkVariants = cva([
17
- 'flex min-h-9 items-center gap-2.5 rounded-md px-2.5 text-base transition-colors motion-fast',
79
+ 'flex min-h-9 items-center gap-2.5 rounded-lg px-2.5 text-base transition-colors motion-fast',
18
80
  'outline-none data-focus-visible:ring-2 data-focus-visible:ring-ring',
19
81
  ], {
20
82
  variants: {
21
83
  isCurrent: {
22
- true: 'bg-card font-semibold text-foreground shadow-sm ring-1 ring-border',
23
- false: 'font-medium text-foreground-secondary data-hovered:bg-background-tertiary data-hovered:text-foreground',
84
+ true: 'bg-background-tertiary font-semibold text-foreground',
85
+ false: 'font-medium text-foreground-muted data-hovered:bg-background-secondary data-hovered:text-foreground',
24
86
  },
25
87
  },
26
88
  defaultVariants: { isCurrent: false },
27
89
  });
28
- export const appShellFooterClass = 'border-t border-border pt-3';
29
- export const appShellAccountClass = [
90
+ export const appShellNavLabelClass = 'min-w-0 flex-1 truncate';
91
+ export const appShellNavCountClass = 'shrink-0 text-xs font-medium text-foreground-muted tabular-nums';
92
+ export const appShellNavIconSize = 16;
93
+ /* --- The bar across the top -------------------------------------------------- */
94
+ /** From `md` up, the panel: inset from the window's edges, its corners rounded, the dark ground showing around it. */
95
+ export const appShellColumnClass = 'flex min-h-0 min-w-0 flex-1 flex-col view-shell-panel md:my-2 md:mr-2 md:overflow-hidden md:rounded-2xl md:border md:border-border md:bg-card md:shadow-sm';
96
+ /**
97
+ * One bar on every screen, one row on every window: the menu (on a phone), the screen's header (its title,
98
+ * state and buttons, which fold into a menu on a phone) and the search at the end.
99
+ */
100
+ export const appShellBarVariants = cva('flex min-h-14 shrink-0 items-center gap-2 border-b border-border bg-card px-3 md:min-h-16 md:gap-3 md:px-6', {
101
+ variants: {
102
+ /**
103
+ * A screen with nothing for the bar (Home, which opens on its own greeting) has none from `md` up: the
104
+ * search is still a key away. A phone keeps it, since it holds the menu.
105
+ */
106
+ isHidden: { true: 'md:hidden', false: '' },
107
+ },
108
+ defaultVariants: { isHidden: false },
109
+ });
110
+ /** Where a screen's `PageHeader` or `SaveBar` is drawn. */
111
+ export const appShellBarSlotClass = 'flex min-w-0 flex-1 items-center';
112
+ /** The button that opens the search, at the end of the bar. Below `xl` it shows only its icon, and its words are read out. */
113
+ export const appShellSearchVariants = cva([
114
+ 'flex h-10 min-w-0 shrink-0 items-center gap-2.5 rounded-lg border border-border bg-background px-3 text-base text-foreground-subtle transition-colors motion-fast',
115
+ 'outline-none data-hovered:border-border-strong data-hovered:text-foreground-muted data-focus-visible:ring-2 data-focus-visible:ring-ring',
116
+ ], {
117
+ variants: {
118
+ /**
119
+ * A screen that leads back (an entry) is for working, not looking: its search is an icon, and on a phone it
120
+ * has none, the way back in the menu's place.
121
+ */
122
+ isScreenLeadingBack: { true: 'max-md:hidden', false: 'xl:w-52' },
123
+ },
124
+ defaultVariants: { isScreenLeadingBack: false },
125
+ });
126
+ export const appShellSearchLabelVariants = cva('sr-only min-w-0 flex-1 truncate text-left', {
127
+ variants: { isScreenLeadingBack: { true: '', false: 'xl:not-sr-only xl:overflow-hidden xl:whitespace-nowrap' } },
128
+ defaultVariants: { isScreenLeadingBack: false },
129
+ });
130
+ export const appShellSearchShortcutVariants = cva('hidden shrink-0 rounded-sm border border-border px-1.5 font-mono text-xs text-foreground-subtle', {
131
+ variants: { isScreenLeadingBack: { true: '', false: 'xl:block' } },
132
+ defaultVariants: { isScreenLeadingBack: false },
133
+ });
134
+ export const appShellSearchIconSize = 16;
135
+ export const appShellMenuButtonVariants = cva([
136
+ 'h-10 w-10 shrink-0 items-center justify-center rounded-md text-foreground transition-colors motion-fast md:hidden',
137
+ 'outline-none data-hovered:bg-background-tertiary data-pressed:bg-background-tertiary data-focus-visible:ring-2 data-focus-visible:ring-ring',
138
+ ], {
139
+ variants: {
140
+ /** The way back takes the menu's place on a screen that leads back, as on any phone. */
141
+ isScreenLeadingBack: { true: 'hidden', false: 'flex' },
142
+ },
143
+ defaultVariants: { isScreenLeadingBack: false },
144
+ });
145
+ export const appShellMenuIconSize = 20;
146
+ /* --- The panel of a narrow window -------------------------------------------- */
147
+ /** The navigation of a narrow window: a panel that slides in from the edge the button is on. */
148
+ export const appShellDrawerOverlayClass = 'fixed inset-0 layer-overlay flex bg-scrim motion-scrim';
149
+ export const appShellDrawerClass = 'h-full w-72 max-w-full border-r border-border bg-card shadow-xl outline-none motion-sheet-start';
150
+ export const appShellDrawerContentClass = 'flex h-full flex-col gap-4 overflow-y-auto px-3 py-5 outline-none';
151
+ export const appShellDrawerNavClass = 'flex flex-col gap-4';
152
+ /** A section's own places, under its link in the panel. */
153
+ export const appShellDrawerChildrenClass = 'flex flex-col gap-0.5 border-l border-border pl-3 ml-4.5';
154
+ export const appShellDrawerFooterClass = 'mt-auto border-t border-border pt-3';
155
+ export const appShellDrawerAccountClass = [
30
156
  'flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-foreground-muted transition-colors motion-fast',
31
157
  'outline-none data-hovered:bg-background-tertiary data-pressed:bg-background-tertiary data-focus-visible:ring-2 data-focus-visible:ring-ring',
32
158
  ].join(' ');
33
- export const appShellAccountAvatarClass = 'flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-background-tertiary text-xs font-semibold text-foreground';
159
+ export const appShellDrawerAvatarClass = 'flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-background-tertiary text-xs font-semibold text-foreground';
160
+ /* --- The account, as it is read ---------------------------------------------- */
34
161
  export const appShellAccountTextClass = 'flex min-w-0 flex-1 flex-col';
35
162
  export const appShellAccountNameClass = 'truncate text-sm font-semibold text-foreground';
36
163
  export const appShellAccountDetailClass = 'truncate text-xs text-foreground-muted';
164
+ /** On the rail only the initials show: the words are for screen readers, and the tooltip. */
165
+ export const appShellHiddenClass = 'sr-only';
166
+ export const appShellAccountIconSize = 14;
167
+ /* --- The screen --------------------------------------------------------------- */
37
168
  /**
38
- * `relative`, so that anything placed out of the flow inside the panel (a label only screen readers
169
+ * `relative`, so that anything placed out of the flow inside the screen (a label only screen readers
39
170
  * get) scrolls with it. Without it such an element is placed against the page and makes the page
40
171
  * itself scroll far past the frame.
41
172
  */
42
- export const appShellMainClass = 'relative my-2 mr-2 min-w-0 flex-1 overflow-auto rounded-2xl border border-border bg-background shadow-sm outline-none';
173
+ export const appShellMainClass = 'relative min-h-0 min-w-0 flex-1 overflow-auto bg-background outline-none';
43
174
  /** The id of the main area, which the skip link jumps to. */
44
175
  export const appShellMainId = 'main';
45
- /** The size of a navigation icon, in pixels. */
46
- export const appShellNavIconSize = 16;
47
- /** The size of the arrows on the account button, in pixels. */
48
- export const appShellAccountIconSize = 14;
49
- /** The word that says what the button is, for screen readers only: the name and detail follow it. */
50
- export const appShellAccountLabelClass = 'sr-only';
51
176
  //# sourceMappingURL=AppShell.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.variants.js","sourceRoot":"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/E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,uHAAuH;IACvH,6IAA6I;CAC9I,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,yBAAyB,GACpC,kJAAkJ,CAAC;AAErJ,mFAAmF;AAEnF,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,gDAAgD,CAAC;AACzF,MAAM,CAAC,MAAM,0BAA0B,GAAG,wCAAwC,CAAC;AACnF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,oFAAoF;AAEpF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,0EAA0E,CAAC;AAE5G,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- export { AppShell, type AppShellNavItem, type AppShellProps } from './AppShell.js';
1
+ export { AppShell, type AppShellAccount, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSearch } from './AppShell.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA4C,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA8G,MAAM,eAAe,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type LucideIcon } from 'lucide-react';
2
+ export interface CommandItem {
3
+ readonly id: string;
4
+ /** What choosing it does or where it goes: "Listings", "New listing". */
5
+ readonly label: string;
6
+ /** A few words at the end of the row: what kind of thing it is. */
7
+ readonly detail?: string;
8
+ readonly icon?: LucideIcon;
9
+ /** Other words it is found by, which are not shown. */
10
+ readonly keywords?: string;
11
+ }
12
+ export interface CommandGroup {
13
+ readonly id: string;
14
+ /** The small heading over the group: "Go to", "Create". */
15
+ readonly label: string;
16
+ readonly items: readonly CommandItem[];
17
+ /**
18
+ * Its items were already found by what was typed, somewhere the window cannot look itself (the
19
+ * site's content, its contacts), so they are shown as they are rather than narrowed again.
20
+ */
21
+ readonly isFound?: boolean;
22
+ }
23
+ export interface CommandPaletteProps {
24
+ readonly isOpen: boolean;
25
+ readonly onOpenChange: (isOpen: boolean) => void;
26
+ /** Names the window for screen readers: "Search and commands". */
27
+ readonly label: string;
28
+ /** What the box says before anything is typed, and what it is called. */
29
+ readonly placeholder: string;
30
+ /** Shown when nothing matches what was typed. */
31
+ readonly emptyText: string;
32
+ readonly groups: readonly CommandGroup[];
33
+ /** Called with the id of what was chosen. The window closes by itself. */
34
+ readonly onAction: (id: string) => void;
35
+ /** Called with what is in the box each time it changes, to look for things elsewhere (`isFound`). */
36
+ readonly onSearch?: (words: string) => void;
37
+ }
38
+ /**
39
+ * A window to find anything by typing and go there: a box, and under it the matches in groups.
40
+ * The arrow keys move through them and Enter chooses one.
41
+ */
42
+ export declare function CommandPalette({ isOpen, onOpenChange, label, placeholder, emptyText, groups, onAction, onSearch }: CommandPaletteProps): import("react").JSX.Element;
43
+ //# sourceMappingURL=CommandPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.d.ts","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/CommandPalette.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAgCvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAuDtI"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Search } from 'lucide-react';
3
+ import { Autocomplete, Dialog, Header, Input, Menu, MenuItem, MenuSection, Modal, ModalOverlay, SearchField, useFilter, } from 'react-aria-components';
4
+ import { commandPaletteClass, commandPaletteContentClass, commandPaletteEmptyClass, commandPaletteHeaderClass, commandPaletteInputClass, commandPaletteItemClass, commandPaletteItemDetailClass, commandPaletteItemIconClass, commandPaletteItemIconSize, commandPaletteItemLabelClass, commandPaletteListClass, commandPaletteOverlayClass, commandPaletteSearchClass, commandPaletteSearchIconSize, commandPaletteSectionClass, } from './CommandPalette.variants.js';
5
+ /**
6
+ * A window to find anything by typing and go there: a box, and under it the matches in groups.
7
+ * The arrow keys move through them and Enter chooses one.
8
+ */
9
+ export function CommandPalette({ isOpen, onOpenChange, label, placeholder, emptyText, groups, onAction, onSearch }) {
10
+ const { contains } = useFilter({ sensitivity: 'base' });
11
+ const found = new Set(groups.filter((group) => group.isFound === true).flatMap((group) => group.items.map((item) => item.id)));
12
+ return (_jsx(ModalOverlay, { isOpen: isOpen, onOpenChange: onOpenChange, isDismissable: true, className: commandPaletteOverlayClass, children: _jsx(Modal, { className: commandPaletteClass, children: _jsx(Dialog, { "aria-label": label, className: commandPaletteContentClass, children: ({ close }) => (_jsxs(Autocomplete, { filter: (text, words, node) => found.has(String(node.key)) || contains(text, words), ...(onSearch !== undefined && { onInputChange: onSearch }), children: [_jsxs(SearchField, { "aria-label": placeholder, autoFocus: true, className: commandPaletteSearchClass, children: [_jsx(Search, { "aria-hidden": true, size: commandPaletteSearchIconSize }), _jsx(Input, { placeholder: placeholder, className: commandPaletteInputClass })] }), _jsx(Menu, { "aria-label": label, className: commandPaletteListClass, renderEmptyState: () => _jsx("div", { className: commandPaletteEmptyClass, children: emptyText }), onAction: (key) => {
13
+ close();
14
+ onAction(String(key));
15
+ }, children: groups
16
+ .filter((group) => group.items.length > 0)
17
+ .map((group) => (_jsxs(MenuSection, { id: group.id, className: commandPaletteSectionClass, children: [_jsx(Header, { className: commandPaletteHeaderClass, children: group.label }), group.items.map(({ id, label: words, detail, icon: Icon, keywords }) => (_jsxs(MenuItem, { id: id, className: commandPaletteItemClass, textValue: [words, detail, keywords].filter((part) => part !== undefined).join(' '), children: [Icon && (_jsx("span", { "aria-hidden": true, className: commandPaletteItemIconClass, children: _jsx(Icon, { size: commandPaletteItemIconSize }) })), _jsx("span", { className: commandPaletteItemLabelClass, children: words }), detail !== undefined && _jsx("span", { className: commandPaletteItemDetailClass, children: detail })] }, id)))] }, group.id))) })] })) }) }) }));
18
+ }
19
+ //# sourceMappingURL=CommandPalette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.js","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/CommandPalette.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAmB,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,MAAM,EACN,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,WAAW,EACX,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,yBAA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B,YAAG,KAAK,GAAQ,EAC5D,MAAM,KAAK,SAAS,IAAI,eAAM,SAAS,EAAE,6BAA6B,YAAG,MAAM,GAAQ,KAXnF,EAAE,CAYE,CACZ,CAAC,KAjBc,KAAK,CAAC,EAAE,CAkBZ,CACf,CAAC,GACC,IACM,CAChB,GACM,GACH,GACK,CAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** Near the top of the window, where the eye already is, rather than in the middle. */
2
+ export declare const commandPaletteOverlayClass = "fixed inset-0 layer-overlay flex items-start justify-center bg-scrim px-4 pt-24 motion-scrim";
3
+ export declare const commandPaletteClass = "flex max-h-112 w-full max-w-xl flex-col overflow-hidden rounded-xl border border-border bg-background-elevated shadow-xl outline-none motion-pop";
4
+ /** The window scrolls as a whole, with the box held at its top, so what scrolls also holds what the keyboard reaches. */
5
+ export declare const commandPaletteContentClass = "flex min-h-0 flex-col overflow-y-auto outline-none";
6
+ export declare const commandPaletteSearchClass = "sticky top-0 layer-raised flex shrink-0 items-center gap-3 border-b border-border bg-background-elevated px-4 text-foreground-muted";
7
+ export declare const commandPaletteInputClass = "h-14 w-full min-w-0 bg-transparent text-lg text-foreground outline-none placeholder:text-foreground-subtle";
8
+ export declare const commandPaletteSearchIconSize = 18;
9
+ export declare const commandPaletteListClass = "p-2 outline-none";
10
+ export declare const commandPaletteSectionClass = "pb-1";
11
+ export declare const commandPaletteHeaderClass = "px-3 pt-2 pb-1 text-xs font-semibold tracking-widest text-foreground-subtle uppercase";
12
+ export declare const commandPaletteItemClass: string;
13
+ export declare const commandPaletteItemIconClass = "flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground-muted";
14
+ export declare const commandPaletteItemLabelClass = "min-w-0 flex-1 truncate font-medium";
15
+ export declare const commandPaletteItemDetailClass = "shrink-0 text-sm text-foreground-subtle";
16
+ export declare const commandPaletteItemIconSize = 16;
17
+ export declare const commandPaletteEmptyClass = "px-3 py-8 text-center text-base text-foreground-muted";
18
+ //# sourceMappingURL=CommandPalette.variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/CommandPalette.variants.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,eAAO,MAAM,0BAA0B,iGAAiG,CAAC;AACzI,eAAO,MAAM,mBAAmB,qJACoH,CAAC;AACrJ,yHAAyH;AACzH,eAAO,MAAM,0BAA0B,uDAAuD,CAAC;AAE/F,eAAO,MAAM,yBAAyB,wIAAwI,CAAC;AAC/K,eAAO,MAAM,wBAAwB,+GAA+G,CAAC;AACrJ,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAC1D,eAAO,MAAM,0BAA0B,SAAS,CAAC;AACjD,eAAO,MAAM,yBAAyB,0FAA0F,CAAC;AACjI,eAAO,MAAM,uBAAuB,QAGzB,CAAC;AACZ,eAAO,MAAM,2BAA2B,0HACiF,CAAC;AAC1H,eAAO,MAAM,4BAA4B,wCAAwC,CAAC;AAClF,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,wBAAwB,0DAA0D,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** Near the top of the window, where the eye already is, rather than in the middle. */
2
+ export const commandPaletteOverlayClass = 'fixed inset-0 layer-overlay flex items-start justify-center bg-scrim px-4 pt-24 motion-scrim';
3
+ export const commandPaletteClass = 'flex max-h-112 w-full max-w-xl flex-col overflow-hidden rounded-xl border border-border bg-background-elevated shadow-xl outline-none motion-pop';
4
+ /** The window scrolls as a whole, with the box held at its top, so what scrolls also holds what the keyboard reaches. */
5
+ export const commandPaletteContentClass = 'flex min-h-0 flex-col overflow-y-auto outline-none';
6
+ export const commandPaletteSearchClass = 'sticky top-0 layer-raised flex shrink-0 items-center gap-3 border-b border-border bg-background-elevated px-4 text-foreground-muted';
7
+ export const commandPaletteInputClass = 'h-14 w-full min-w-0 bg-transparent text-lg text-foreground outline-none placeholder:text-foreground-subtle';
8
+ export const commandPaletteSearchIconSize = 18;
9
+ export const commandPaletteListClass = 'p-2 outline-none';
10
+ export const commandPaletteSectionClass = 'pb-1';
11
+ export const commandPaletteHeaderClass = 'px-3 pt-2 pb-1 text-xs font-semibold tracking-widest text-foreground-subtle uppercase';
12
+ export const commandPaletteItemClass = [
13
+ 'flex cursor-default items-center gap-3 rounded-lg px-3 py-2 text-base text-foreground outline-none',
14
+ 'data-focused:bg-background-tertiary data-hovered:bg-background-secondary',
15
+ ].join(' ');
16
+ export const commandPaletteItemIconClass = 'flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground-muted';
17
+ export const commandPaletteItemLabelClass = 'min-w-0 flex-1 truncate font-medium';
18
+ export const commandPaletteItemDetailClass = 'shrink-0 text-sm text-foreground-subtle';
19
+ export const commandPaletteItemIconSize = 16;
20
+ export const commandPaletteEmptyClass = 'px-3 py-8 text-center text-base text-foreground-muted';
21
+ //# sourceMappingURL=CommandPalette.variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPalette.variants.js","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/CommandPalette.variants.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,8FAA8F,CAAC;AACzI,MAAM,CAAC,MAAM,mBAAmB,GAC9B,kJAAkJ,CAAC;AACrJ,yHAAyH;AACzH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oDAAoD,CAAC;AAE/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,qIAAqI,CAAC;AAC/K,MAAM,CAAC,MAAM,wBAAwB,GAAG,4GAA4G,CAAC;AACrJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAC1D,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AACjD,MAAM,CAAC,MAAM,yBAAyB,GAAG,uFAAuF,CAAC;AACjI,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,oGAAoG;IACpG,0EAA0E;CAC3E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,MAAM,2BAA2B,GACtC,uHAAuH,CAAC;AAC1H,MAAM,CAAC,MAAM,4BAA4B,GAAG,qCAAqC,CAAC;AAClF,MAAM,CAAC,MAAM,6BAA6B,GAAG,yCAAyC,CAAC;AACvF,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,uDAAuD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { CommandPalette, type CommandGroup, type CommandItem, type CommandPaletteProps } from './CommandPalette.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { CommandPalette } from './CommandPalette.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/CommandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiE,MAAM,qBAAqB,CAAC"}
@@ -41,7 +41,15 @@ export interface ImagePickerProps {
41
41
  readonly uploadHint?: string;
42
42
  /** Why the last upload did not work. */
43
43
  readonly uploadError?: string;
44
+ /**
45
+ * Given, only the window is drawn, and whoever gave it opens and closes it: for choosing an
46
+ * image from somewhere other than the field, such as the page the image is shown on.
47
+ */
48
+ readonly window?: {
49
+ readonly isOpen: boolean;
50
+ readonly onOpenChange: (isOpen: boolean) => void;
51
+ };
44
52
  }
45
53
  /** Shows the image a field holds and lets a person choose another from the site's images. */
46
- export declare function ImagePicker({ label, isLabelHidden, description, errorMessage, isRequired, value, images, onChange, chooseLabel, changeLabel, noneText, dialogTitle, closeLabel, emptyText, onUpload, uploadLabel, uploadHint, uploadError, }: ImagePickerProps): import("react").JSX.Element;
54
+ export declare function ImagePicker({ label, isLabelHidden, description, errorMessage, isRequired, value, images, onChange, chooseLabel, changeLabel, noneText, dialogTitle, closeLabel, emptyText, onUpload, uploadLabel, uploadHint, uploadError, window: held, }: ImagePickerProps): import("react").JSX.Element;
47
55
  //# sourceMappingURL=ImagePicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImagePicker.d.ts","sourceRoot":"","sources":["../../../src/patterns/ImagePicker/ImagePicker.tsx"],"names":[],"mappings":"AA0BA,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oGAAoG;IACpG,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,2EAA2E;IAC3E,QAAQ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,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,CAAC;CAClG;AAKD,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,YAAY,EACZ,UAAkB,EAClB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,MAAM,EAAE,IAAI,GACb,EAAE,gBAAgB,+BA0FlB"}
@@ -8,9 +8,11 @@ import { imagePickerChoiceClass, imagePickerChoiceImageClass, imagePickerChoiceN
8
8
  /** The kinds of file the file chooser offers. What a file really is, the server decides. */
9
9
  const IMAGE_FILES = ['image/jpeg', 'image/png', 'image/webp'];
10
10
  /** Shows the image a field holds and lets a person choose another from the site's images. */
11
- export function ImagePicker({ label, isLabelHidden = false, description, errorMessage, isRequired = false, value, images, onChange, chooseLabel, changeLabel, noneText, dialogTitle, closeLabel, emptyText, onUpload, uploadLabel, uploadHint, uploadError, }) {
11
+ export function ImagePicker({ label, isLabelHidden = false, description, errorMessage, isRequired = false, value, images, onChange, chooseLabel, changeLabel, noneText, dialogTitle, closeLabel, emptyText, onUpload, uploadLabel, uploadHint, uploadError, window: held, }) {
12
12
  const labelId = useId();
13
- const [isOpen, setOpen] = useState(false);
13
+ const [isOwnOpen, setOwnOpen] = useState(false);
14
+ const isOpen = held ? held.isOpen : isOwnOpen;
15
+ const setOpen = held ? held.onOpenChange : setOwnOpen;
14
16
  const [isUploading, setUploading] = useState(false);
15
17
  const upload = async (file) => {
16
18
  if (!file || !onUpload)
@@ -28,11 +30,14 @@ export function ImagePicker({ label, isLabelHidden = false, description, errorMe
28
30
  }
29
31
  };
30
32
  const chosen = images.find((image) => image.name === value);
31
- return (_jsxs("div", { role: "group", "aria-labelledby": labelId, className: imagePickerClass, children: [_jsxs("span", { id: labelId, className: imagePickerLabelVariants({ isLabelHidden }), children: [label, isRequired && (_jsx("span", { "aria-hidden": "true", className: imagePickerRequiredMarkClass, children: ' *' }))] }), _jsxs("div", { className: imagePickerRowClass, children: [chosen ? (_jsx("img", { src: chosen.url, alt: "", loading: "lazy", className: imagePickerThumbClass })) : (_jsx("span", { className: imagePickerPlaceholderClass, children: _jsx(ImageOff, { "aria-hidden": "true", className: imagePickerPlaceholderIconClass }) })), _jsx("span", { className: imagePickerNameClass, children: value ?? noneText }), _jsx(Button, { variant: "secondary", size: "sm", onPress: () => setOpen(true), children: value === null ? chooseLabel : changeLabel })] }), description !== undefined && _jsx("p", { className: imagePickerDescriptionClass, children: description }), errorMessage !== undefined && _jsx("p", { className: imagePickerErrorClass, children: errorMessage }), _jsxs(Dialog, { isOpen: isOpen, onOpenChange: setOpen, title: dialogTitle, closeLabel: closeLabel, size: "lg", children: [onUpload && uploadLabel !== undefined && (_jsxs("div", { className: imagePickerUploadClass, children: [_jsx(FileTrigger, { acceptedFileTypes: IMAGE_FILES, onSelect: (files) => void upload(files?.[0]), children: _jsx(Button, { variant: "secondary", size: "sm", icon: Upload, isPending: isUploading, children: uploadLabel }) }), uploadError !== undefined ? (_jsx("p", { role: "alert", className: imagePickerUploadErrorClass, children: uploadError })) : (uploadHint !== undefined && _jsx("p", { className: imagePickerUploadHintClass, children: uploadHint }))] })), _jsx(ListBox, { "aria-label": dialogTitle, layout: "grid", selectionMode: "single", autoFocus: true, selectedKeys: value === null ? [] : [value], onSelectionChange: (keys) => {
32
- const [name] = keys === 'all' ? [] : [...keys];
33
- if (typeof name === 'string')
34
- onChange(name);
35
- setOpen(false);
36
- }, renderEmptyState: () => _jsx("p", { className: imagePickerEmptyClass, children: emptyText }), className: imagePickerChoicesClass, children: images.map((image) => (_jsxs(ListBoxItem, { id: image.name, textValue: image.name, className: imagePickerChoiceClass, children: [_jsx("img", { src: image.url, alt: "", loading: "lazy", className: imagePickerChoiceImageClass }), _jsx("span", { className: imagePickerChoiceNameClass, children: image.name })] }, image.name))) })] })] }));
33
+ const choosing = (_jsxs(Dialog, { isOpen: isOpen, onOpenChange: setOpen, title: dialogTitle, closeLabel: closeLabel, size: "lg", children: [onUpload && uploadLabel !== undefined && (_jsxs("div", { className: imagePickerUploadClass, children: [_jsx(FileTrigger, { acceptedFileTypes: IMAGE_FILES, onSelect: (files) => void upload(files?.[0]), children: _jsx(Button, { variant: "secondary", size: "sm", icon: Upload, isPending: isUploading, children: uploadLabel }) }), uploadError !== undefined ? (_jsx("p", { role: "alert", className: imagePickerUploadErrorClass, children: uploadError })) : (uploadHint !== undefined && _jsx("p", { className: imagePickerUploadHintClass, children: uploadHint }))] })), _jsx(ListBox, { "aria-label": dialogTitle, layout: "grid", selectionMode: "single", autoFocus: true, selectedKeys: value === null ? [] : [value], onSelectionChange: (keys) => {
34
+ const [name] = keys === 'all' ? [] : [...keys];
35
+ if (typeof name === 'string')
36
+ onChange(name);
37
+ setOpen(false);
38
+ }, renderEmptyState: () => _jsx("p", { className: imagePickerEmptyClass, children: emptyText }), className: imagePickerChoicesClass, children: images.map((image) => (_jsxs(ListBoxItem, { id: image.name, textValue: image.name, className: imagePickerChoiceClass, children: [_jsx("img", { src: image.url, alt: "", loading: "lazy", className: imagePickerChoiceImageClass }), _jsx("span", { className: imagePickerChoiceNameClass, children: image.name })] }, image.name))) })] }));
39
+ if (held)
40
+ return choosing;
41
+ return (_jsxs("div", { role: "group", "aria-labelledby": labelId, className: imagePickerClass, children: [_jsxs("span", { id: labelId, className: imagePickerLabelVariants({ isLabelHidden }), children: [label, isRequired && (_jsx("span", { "aria-hidden": "true", className: imagePickerRequiredMarkClass, children: ' *' }))] }), _jsxs("div", { className: imagePickerRowClass, children: [chosen ? (_jsx("img", { src: chosen.url, alt: "", loading: "lazy", className: imagePickerThumbClass })) : (_jsx("span", { className: imagePickerPlaceholderClass, children: _jsx(ImageOff, { "aria-hidden": "true", className: imagePickerPlaceholderIconClass }) })), _jsx("span", { className: imagePickerNameClass, children: value ?? noneText }), _jsx(Button, { variant: "secondary", size: "sm", onPress: () => setOpen(true), children: value === null ? chooseLabel : changeLabel })] }), description !== undefined && _jsx("p", { className: imagePickerDescriptionClass, children: description }), errorMessage !== undefined && _jsx("p", { className: imagePickerErrorClass, children: errorMessage }), choosing] }));
37
42
  }
38
43
  //# sourceMappingURL=ImagePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImagePicker.js","sourceRoot":"","sources":["../../../src/patterns/ImagePicker/ImagePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAgDnC,4FAA4F;AAC5F,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;AAE9D,6FAA6F;AAC7F,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,GAAG,KAAK,EACrB,WAAW,EACX,YAAY,EACZ,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ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,IAAI,EAAC,OAAO,qBAAkB,OAAO,EAAE,SAAS,EAAE,gBAAgB,aACrE,gBAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,CAAC,EAAE,aAAa,EAAE,CAAC,aACtE,KAAK,EACL,UAAU,IAAI,CACb,8BAAkB,MAAM,EAAC,SAAS,EAAE,4BAA4B,YAC7D,IAAI,GACA,CACR,IACI,EACP,eAAK,SAAS,EAAE,mBAAmB,aAChC,MAAM,CAAC,CAAC,CAAC,CACR,cAAK,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAC,EAAE,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAE,qBAAqB,GAAI,CACjF,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAE,2BAA2B,YAC1C,KAAC,QAAQ,mBAAa,MAAM,EAAC,SAAS,EAAE,+BAA+B,GAAI,GACtE,CACR,EACD,eAAM,SAAS,EAAE,oBAAoB,YAAG,KAAK,IAAI,QAAQ,GAAQ,EACjE,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAC/D,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,GACpC,IACL,EACL,WAAW,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,2BAA2B,YAAG,WAAW,GAAK,EACzF,YAAY,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,qBAAqB,YAAG,YAAY,GAAK,EACrF,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
@@ -5,6 +5,8 @@ export interface PickerOption {
5
5
  /** A line on what choosing it gives. */
6
6
  readonly description?: string;
7
7
  readonly icon?: LucideIcon;
8
+ /** Where a picture of what it gives loads from. When any option has one, every option is a card. */
9
+ readonly image?: string;
8
10
  }
9
11
  export interface PickerGroup {
10
12
  readonly id: string;
@@ -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F,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BA8CjI"}
@@ -1,13 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Header, ListBox, ListBoxItem, ListBoxSection } from 'react-aria-components';
3
3
  import { Dialog } from '../../components/Dialog/index.js';
4
- import { optionPickerDescriptionClass, optionPickerEmptyClass, optionPickerGroupClass, optionPickerGroupLabelClass, optionPickerIconClass, optionPickerIconSize, optionPickerLabelClass, optionPickerListClass, optionPickerOptionClass, optionPickerTextClass, } from './OptionPicker.variants.js';
4
+ import { Thumbnail } from '../../components/Thumbnail/index.js';
5
+ import { optionPickerDescriptionClass, optionPickerEmptyClass, optionPickerGroupLabelClass, optionPickerGroupVariants, optionPickerIconSize, optionPickerIconVariants, optionPickerLabelClass, optionPickerListClass, optionPickerOptionVariants, optionPickerTextClass, } from './OptionPicker.variants.js';
5
6
  /** A window to choose one thing from a set of named kinds, in groups. Choosing closes it. */
6
7
  export function OptionPicker({ isOpen, onOpenChange, onClosed, title, closeLabel, groups, onChoose, emptyText }) {
7
8
  const filled = groups.filter((group) => group.options.length > 0);
8
- return (_jsx(Dialog, { isOpen: isOpen, onOpenChange: onOpenChange, ...(onClosed !== undefined && { onClosed }), title: title, closeLabel: closeLabel, size: "md", children: filled.length === 0 ? (_jsx("p", { className: optionPickerEmptyClass, children: emptyText })) : (_jsx(ListBox, { "aria-label": title, autoFocus: "first", selectionMode: "none", className: optionPickerListClass, onAction: (key) => {
9
+ // One layout for the whole window: a list of rows, or cards once anything has a picture to show.
10
+ const layout = filled.some((group) => group.options.some((option) => option.image !== undefined)) ? 'cards' : 'rows';
11
+ return (_jsx(Dialog, { isOpen: isOpen, onOpenChange: onOpenChange, ...(onClosed !== undefined && { onClosed }), title: title, closeLabel: closeLabel, size: layout === 'cards' ? 'lg' : 'md', children: filled.length === 0 ? (_jsx("p", { className: optionPickerEmptyClass, children: emptyText })) : (_jsx(ListBox, { "aria-label": title, autoFocus: "first", selectionMode: "none", layout: layout === 'cards' ? 'grid' : 'stack', className: optionPickerListClass, onAction: (key) => {
9
12
  onChoose(String(key));
10
13
  onOpenChange(false);
11
- }, children: filled.map((group) => (_jsxs(ListBoxSection, { id: `group:${group.id}`, className: optionPickerGroupClass, children: [_jsx(Header, { className: optionPickerGroupLabelClass, children: group.label }), group.options.map(({ id, label, description, icon: Icon }) => (_jsxs(ListBoxItem, { id: id, textValue: description === undefined ? label : `${label} ${description}`, className: optionPickerOptionClass, children: [Icon && (_jsx("span", { className: optionPickerIconClass, children: _jsx(Icon, { "aria-hidden": true, size: optionPickerIconSize }) })), _jsxs("span", { className: optionPickerTextClass, children: [_jsx("span", { className: optionPickerLabelClass, children: label }), description !== undefined && _jsx("span", { className: optionPickerDescriptionClass, children: description })] })] }, id)))] }, group.id))) })) }));
14
+ }, children: filled.map((group) => (_jsxs(ListBoxSection, { id: `group:${group.id}`, className: optionPickerGroupVariants({ layout }), children: [_jsx(Header, { className: optionPickerGroupLabelClass, children: group.label }), group.options.map(({ id, label, description, icon: Icon, image }) => (_jsxs(ListBoxItem, { id: id, textValue: description === undefined ? label : `${label} ${description}`, className: optionPickerOptionVariants({ layout }), children: [image !== undefined ? (_jsx(Thumbnail, { src: image, size: "full" })) : (
15
+ // In cards an option with no picture keeps a frame of the same size, so the rows of cards stay even.
16
+ (Icon || layout === 'cards') && (_jsx("span", { className: optionPickerIconVariants({ layout }), children: Icon && _jsx(Icon, { "aria-hidden": true, size: optionPickerIconSize }) }))), _jsxs("span", { className: optionPickerTextClass, children: [_jsx("span", { className: optionPickerLabelClass, children: label }), description !== undefined && _jsx("span", { className: optionPickerDescriptionClass, children: description })] })] }, id)))] }, group.id))) })) }));
12
17
  }
13
18
  //# sourceMappingURL=OptionPicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file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BAAM,SAAS,EAAE,qBAAqB,aAEpC,eAAM,SAAS,EAAE,sBAAsB,YAAG,KAAK,GAAQ,EACtD,WAAW,KAAK,SAAS,IAAI,eAAM,SAAS,EAAE,4BAA4B,YAAG,WAAW,GAAQ,IAC5F,KAbS,EAAE,CAcN,CACf,CAAC,KAlBiB,KAAK,CAAC,EAAE,CAmBZ,CAClB,CAAC,GACM,CACX,GACM,CACV,CAAC;AACJ,CAAC"}
@@ -1,9 +1,15 @@
1
1
  export declare const optionPickerListClass = "flex flex-col gap-4 pb-4 outline-none";
2
2
  export declare const optionPickerEmptyClass = "py-6 text-center text-sm text-foreground-muted";
3
- export declare const optionPickerGroupClass = "flex flex-col gap-1";
4
- export declare const optionPickerGroupLabelClass = "px-2 pb-1 text-xs font-medium tracking-wide text-foreground-muted uppercase";
5
- export declare const optionPickerOptionClass: string;
6
- export declare const optionPickerIconClass = "grid size-9 shrink-0 place-items-center rounded-md bg-secondary text-secondary-foreground";
3
+ export declare const optionPickerGroupVariants: (props?: ({
4
+ layout?: "rows" | "cards" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export declare const optionPickerGroupLabelClass = "col-span-full px-2 pb-1 text-xs font-medium tracking-wide text-foreground-muted uppercase";
7
+ export declare const optionPickerOptionVariants: (props?: ({
8
+ layout?: "rows" | "cards" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export declare const optionPickerIconVariants: (props?: ({
11
+ layout?: "rows" | "cards" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
13
  export declare const optionPickerTextClass = "flex min-w-0 flex-col";
8
14
  export declare const optionPickerLabelClass = "text-sm font-medium text-foreground";
9
15
  export declare const optionPickerDescriptionClass = "text-sm text-foreground-secondary";
@@ -1 +1 @@
1
- {"version":3,"file":"OptionPicker.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/OptionPicker/OptionPicker.variants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,0CAA0C,CAAC;AAC7E,eAAO,MAAM,sBAAsB,mDAAmD,CAAC;AACvF,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,eAAO,MAAM,2BAA2B,gFAAgF,CAAC;AACzH,eAAO,MAAM,uBAAuB,QAIzB,CAAC;AACZ,eAAO,MAAM,qBAAqB,8FAA8F,CAAC;AACjI,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,sBAAsB,wCAAwC,CAAC;AAC5E,eAAO,MAAM,4BAA4B,sCAAsC,CAAC;AAEhF,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,KAAK,CAAC"}
1
+ {"version":3,"file":"OptionPicker.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/OptionPicker/OptionPicker.variants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,0CAA0C,CAAC;AAC7E,eAAO,MAAM,sBAAsB,mDAAmD,CAAC;AACvF,eAAO,MAAM,yBAAyB;;8EAQpC,CAAC;AACH,eAAO,MAAM,2BAA2B,8FAA8F,CAAC;AACvI,eAAO,MAAM,0BAA0B;;8EActC,CAAC;AACF,eAAO,MAAM,wBAAwB;;8EAOnC,CAAC;AACH,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,sBAAsB,wCAAwC,CAAC;AAC5E,eAAO,MAAM,4BAA4B,sCAAsC,CAAC;AAEhF,+CAA+C;AAC/C,eAAO,MAAM,oBAAoB,KAAK,CAAC"}