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

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 (256) 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/Segmented/Segmented.d.ts +14 -1
  91. package/dist/components/Segmented/Segmented.d.ts.map +1 -1
  92. package/dist/components/Segmented/Segmented.js +14 -5
  93. package/dist/components/Segmented/Segmented.js.map +1 -1
  94. package/dist/components/Segmented/Segmented.variants.d.ts +14 -1
  95. package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
  96. package/dist/components/Segmented/Segmented.variants.js +19 -3
  97. package/dist/components/Segmented/Segmented.variants.js.map +1 -1
  98. package/dist/components/Spotlight/Spotlight.d.ts +16 -0
  99. package/dist/components/Spotlight/Spotlight.d.ts.map +1 -0
  100. package/dist/components/Spotlight/Spotlight.js +28 -0
  101. package/dist/components/Spotlight/Spotlight.js.map +1 -0
  102. package/dist/components/Spotlight/Spotlight.variants.d.ts +8 -0
  103. package/dist/components/Spotlight/Spotlight.variants.d.ts.map +1 -0
  104. package/dist/components/Spotlight/Spotlight.variants.js +15 -0
  105. package/dist/components/Spotlight/Spotlight.variants.js.map +1 -0
  106. package/dist/components/Spotlight/index.d.ts +2 -0
  107. package/dist/components/Spotlight/index.d.ts.map +1 -0
  108. package/dist/components/Spotlight/index.js +2 -0
  109. package/dist/components/Spotlight/index.js.map +1 -0
  110. package/dist/components/Table/Table.d.ts +8 -1
  111. package/dist/components/Table/Table.d.ts.map +1 -1
  112. package/dist/components/Table/Table.js +4 -4
  113. package/dist/components/Table/Table.js.map +1 -1
  114. package/dist/components/Table/Table.variants.d.ts +6 -2
  115. package/dist/components/Table/Table.variants.d.ts.map +1 -1
  116. package/dist/components/Table/Table.variants.js +11 -5
  117. package/dist/components/Table/Table.variants.js.map +1 -1
  118. package/dist/components/index.d.ts +5 -0
  119. package/dist/components/index.d.ts.map +1 -1
  120. package/dist/components/index.js +5 -0
  121. package/dist/components/index.js.map +1 -1
  122. package/dist/components/scales.d.ts +2 -2
  123. package/dist/components/scales.d.ts.map +1 -1
  124. package/dist/components/scales.js +4 -2
  125. package/dist/components/scales.js.map +1 -1
  126. package/dist/patterns/AppShell/AppShell.d.ts +33 -8
  127. package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
  128. package/dist/patterns/AppShell/AppShell.js +39 -7
  129. package/dist/patterns/AppShell/AppShell.js.map +1 -1
  130. package/dist/patterns/AppShell/AppShell.variants.d.ts +72 -20
  131. package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
  132. package/dist/patterns/AppShell/AppShell.variants.js +118 -23
  133. package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
  134. package/dist/patterns/AppShell/index.d.ts +1 -1
  135. package/dist/patterns/AppShell/index.d.ts.map +1 -1
  136. package/dist/patterns/AppShell/index.js.map +1 -1
  137. package/dist/patterns/CommandPalette/CommandPalette.d.ts +36 -0
  138. package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
  139. package/dist/patterns/CommandPalette/CommandPalette.js +18 -0
  140. package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
  141. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
  142. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
  143. package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
  144. package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
  145. package/dist/patterns/CommandPalette/index.d.ts +2 -0
  146. package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
  147. package/dist/patterns/CommandPalette/index.js +2 -0
  148. package/dist/patterns/CommandPalette/index.js.map +1 -0
  149. package/dist/patterns/ImagePicker/ImagePicker.d.ts +9 -1
  150. package/dist/patterns/ImagePicker/ImagePicker.d.ts.map +1 -1
  151. package/dist/patterns/ImagePicker/ImagePicker.js +13 -8
  152. package/dist/patterns/ImagePicker/ImagePicker.js.map +1 -1
  153. package/dist/patterns/OptionPicker/OptionPicker.d.ts +2 -0
  154. package/dist/patterns/OptionPicker/OptionPicker.d.ts.map +1 -1
  155. package/dist/patterns/OptionPicker/OptionPicker.js +8 -3
  156. package/dist/patterns/OptionPicker/OptionPicker.js.map +1 -1
  157. package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts +10 -4
  158. package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts.map +1 -1
  159. package/dist/patterns/OptionPicker/OptionPicker.variants.js +29 -6
  160. package/dist/patterns/OptionPicker/OptionPicker.variants.js.map +1 -1
  161. package/dist/patterns/Outline/Outline.d.ts +26 -0
  162. package/dist/patterns/Outline/Outline.d.ts.map +1 -0
  163. package/dist/patterns/Outline/Outline.js +21 -0
  164. package/dist/patterns/Outline/Outline.js.map +1 -0
  165. package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
  166. package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
  167. package/dist/patterns/Outline/Outline.variants.js +21 -0
  168. package/dist/patterns/Outline/Outline.variants.js.map +1 -0
  169. package/dist/patterns/Outline/index.d.ts +2 -0
  170. package/dist/patterns/Outline/index.d.ts.map +1 -0
  171. package/dist/patterns/Outline/index.js +2 -0
  172. package/dist/patterns/Outline/index.js.map +1 -0
  173. package/dist/patterns/PageHeader/PageHeader.d.ts +33 -4
  174. package/dist/patterns/PageHeader/PageHeader.d.ts.map +1 -1
  175. package/dist/patterns/PageHeader/PageHeader.js +31 -6
  176. package/dist/patterns/PageHeader/PageHeader.js.map +1 -1
  177. package/dist/patterns/PageHeader/PageHeader.variants.d.ts +23 -2
  178. package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
  179. package/dist/patterns/PageHeader/PageHeader.variants.js +33 -2
  180. package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
  181. package/dist/patterns/PagePreview/PagePreview.d.ts +138 -4
  182. package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
  183. package/dist/patterns/PagePreview/PagePreview.js +159 -13
  184. package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
  185. package/dist/patterns/PagePreview/PagePreview.variants.d.ts +15 -2
  186. package/dist/patterns/PagePreview/PagePreview.variants.d.ts.map +1 -1
  187. package/dist/patterns/PagePreview/PagePreview.variants.js +22 -6
  188. package/dist/patterns/PagePreview/PagePreview.variants.js.map +1 -1
  189. package/dist/patterns/PagePreview/index.d.ts +1 -1
  190. package/dist/patterns/PagePreview/index.d.ts.map +1 -1
  191. package/dist/patterns/PagePreview/index.js.map +1 -1
  192. package/dist/patterns/SaveBar/SaveBar.d.ts +20 -4
  193. package/dist/patterns/SaveBar/SaveBar.d.ts.map +1 -1
  194. package/dist/patterns/SaveBar/SaveBar.js +22 -4
  195. package/dist/patterns/SaveBar/SaveBar.js.map +1 -1
  196. package/dist/patterns/SaveBar/SaveBar.variants.d.ts +27 -5
  197. package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
  198. package/dist/patterns/SaveBar/SaveBar.variants.js +39 -6
  199. package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
  200. package/dist/patterns/SectionList/SectionList.d.ts.map +1 -1
  201. package/dist/patterns/SectionList/SectionList.js +2 -2
  202. package/dist/patterns/SectionList/SectionList.js.map +1 -1
  203. package/dist/patterns/SectionList/SectionList.variants.d.ts +4 -1
  204. package/dist/patterns/SectionList/SectionList.variants.d.ts.map +1 -1
  205. package/dist/patterns/SectionList/SectionList.variants.js +5 -2
  206. package/dist/patterns/SectionList/SectionList.variants.js.map +1 -1
  207. package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
  208. package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
  209. package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
  210. package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
  211. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
  212. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
  213. package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
  214. package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
  215. package/dist/patterns/SiteWindow/index.d.ts +2 -0
  216. package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
  217. package/dist/patterns/SiteWindow/index.js +2 -0
  218. package/dist/patterns/SiteWindow/index.js.map +1 -0
  219. package/dist/patterns/Split/Split.variants.d.ts +2 -2
  220. package/dist/patterns/Split/Split.variants.d.ts.map +1 -1
  221. package/dist/patterns/Split/Split.variants.js +2 -2
  222. package/dist/patterns/Split/Split.variants.js.map +1 -1
  223. package/dist/patterns/Welcome/Welcome.d.ts +18 -0
  224. package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
  225. package/dist/patterns/Welcome/Welcome.js +20 -0
  226. package/dist/patterns/Welcome/Welcome.js.map +1 -0
  227. package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
  228. package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
  229. package/dist/patterns/Welcome/Welcome.variants.js +12 -0
  230. package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
  231. package/dist/patterns/Welcome/index.d.ts +2 -0
  232. package/dist/patterns/Welcome/index.d.ts.map +1 -0
  233. package/dist/patterns/Welcome/index.js +2 -0
  234. package/dist/patterns/Welcome/index.js.map +1 -0
  235. package/dist/patterns/Workbench/Workbench.d.ts +35 -4
  236. package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
  237. package/dist/patterns/Workbench/Workbench.js +59 -4
  238. package/dist/patterns/Workbench/Workbench.js.map +1 -1
  239. package/dist/patterns/Workbench/Workbench.variants.d.ts +56 -4
  240. package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
  241. package/dist/patterns/Workbench/Workbench.variants.js +111 -4
  242. package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
  243. package/dist/patterns/Workbench/index.d.ts +1 -1
  244. package/dist/patterns/Workbench/index.d.ts.map +1 -1
  245. package/dist/patterns/Workbench/index.js.map +1 -1
  246. package/dist/patterns/index.d.ts +4 -0
  247. package/dist/patterns/index.d.ts.map +1 -1
  248. package/dist/patterns/index.js +4 -0
  249. package/dist/patterns/index.js.map +1 -1
  250. package/dist/patterns/page-bar.d.ts +17 -0
  251. package/dist/patterns/page-bar.d.ts.map +1 -0
  252. package/dist/patterns/page-bar.js +22 -0
  253. package/dist/patterns/page-bar.js.map +1 -0
  254. package/package.json +2 -1
  255. package/src/styles.css +136 -0
  256. package/src/tokens/tokens.css +26 -1
@@ -1,12 +1,43 @@
1
- import type { ReactNode } from 'react';
2
- export interface WorkbenchProps {
1
+ import { type ReactNode } from 'react';
2
+ import { type WorkbenchVariants } from './Workbench.variants.js';
3
+ export interface WorkbenchSizes {
4
+ /** How wide the outline is: a step from 0, the narrowest. */
5
+ readonly outline: number;
6
+ /** How wide the form's panel is, the same way. */
7
+ readonly form: number;
8
+ }
9
+ export interface WorkbenchProps extends WorkbenchVariants {
3
10
  /** Names the pane for screen readers, such as "The page". */
4
11
  readonly paneLabel: string;
5
12
  /** What is worked on: the form, in a column of its own. */
6
13
  readonly children: ReactNode;
7
14
  /** What the work makes, shown large beside it and kept in view: the page. */
8
15
  readonly pane: ReactNode;
16
+ /** Across the top when the workbench has the whole window: what is edited, the way back and the save buttons. */
17
+ readonly bar?: ReactNode;
18
+ /** With the whole window, whether the form is put away at the side so the pane has it all. */
19
+ readonly isFormAway?: boolean;
20
+ /** With the whole window, on the left of the pane: the way around it, such as an `Outline` of the page's sections. */
21
+ readonly outline?: ReactNode;
22
+ /** Names the outline's column for screen readers, such as "Sections of the page". */
23
+ readonly outlineLabel?: string;
24
+ /** With the whole window, how wide the outline and the form are, as a person last left them. */
25
+ readonly sizes?: WorkbenchSizes;
26
+ /** Called when a person drags a column wider or narrower, to keep it for next time. */
27
+ readonly onSizesChange?: (sizes: WorkbenchSizes) => void;
28
+ /** What the edges between the columns are called, for screen readers: "Width of the sections", "Width of the form". */
29
+ readonly resizeLabels?: {
30
+ readonly outline: string;
31
+ readonly form: string;
32
+ };
9
33
  }
10
- /** A form with what it makes shown large beside it. On a narrow screen the pane follows below. */
11
- export declare function Workbench({ paneLabel, children, pane }: WorkbenchProps): import("react").JSX.Element;
34
+ /**
35
+ * A form with what it makes shown large beside it. On a narrow screen the pane follows below.
36
+ * With `view="whole"` the two take the whole window, over the editor's frame, as a studio in the
37
+ * dark theme: the outline on the left, the pane in the middle, and the form a panel on the right that
38
+ * can be put away. The outline and the form are dragged wider or narrower by the edges between them.
39
+ * Going from one view to the other keeps both as they are: nothing typed is lost and the pane is not
40
+ * made again.
41
+ */
42
+ export declare function Workbench({ paneLabel, children, pane, bar, isFormAway, outline, outlineLabel, sizes, onSizesChange, resizeLabels, view, }: WorkbenchProps): import("react").JSX.Element;
12
43
  //# sourceMappingURL=Workbench.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,cAAc,+BAStE"}
1
+ {"version":3,"file":"Workbench.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAeL,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,iHAAiH;IACjH,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,sHAAsH;IACtH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,gGAAgG;IAChG,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzD,uHAAuH;IACvH,QAAQ,CAAC,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E;AAmED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,UAAkB,EAClB,OAAO,EACP,YAAY,EACZ,KAAK,EACL,aAAa,EACb,YAAY,EACZ,IAAe,GAChB,EAAE,cAAc,+BA8DhB"}
@@ -1,7 +1,62 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { workbenchClass, workbenchFormClass, workbenchPaneClass } from './Workbench.variants.js';
3
- /** A form with what it makes shown large beside it. On a narrow screen the pane follows below. */
4
- export function Workbench({ paneLabel, children, pane }) {
5
- return (_jsxs("div", { className: workbenchClass, children: [_jsx("div", { className: workbenchFormClass, children: children }), _jsx("section", { "aria-label": paneLabel, className: workbenchPaneClass, children: pane })] }));
2
+ import { useRef, useState } from 'react';
3
+ import { FocusScope, UNSAFE_PortalProvider, useFocusRing, useMove } from 'react-aria';
4
+ import { WORKBENCH_FORM_DEFAULT, WORKBENCH_OUTLINE_DEFAULT, workbenchBodyVariants, workbenchFormVariants, workbenchFormWidthVariants, WORKBENCH_FORM_STEPS, workbenchHandleVariants, workbenchFormInnerClass, workbenchOutlineClass, workbenchOutlineWidthVariants, WORKBENCH_OUTLINE_STEPS, workbenchPaneVariants, workbenchResizeStep, workbenchVariants, } from './Workbench.variants.js';
5
+ const clamp = (step, most) => Math.min(most, Math.max(0, step));
6
+ /**
7
+ * The edge between two columns. A pointer drags it; with the focus, the arrow keys move it a step at
8
+ * a time. It is a separator with a value, which is what it is to a screen reader: React Aria has no
9
+ * part for it, so its role and value are said here.
10
+ */
11
+ function Handle({ label, place, step, most, grows, onStep, onResizing, }) {
12
+ const travelled = useRef(0);
13
+ const started = useRef(step);
14
+ const [isHeld, setHeld] = useState(false);
15
+ const { focusProps, isFocusVisible } = useFocusRing();
16
+ const { moveProps } = useMove({
17
+ onMoveStart: () => {
18
+ travelled.current = 0;
19
+ started.current = step;
20
+ setHeld(true);
21
+ onResizing(true);
22
+ },
23
+ onMove: ({ deltaX, pointerType }) => {
24
+ if (pointerType === 'keyboard') {
25
+ onStep(clamp(step + Math.sign(deltaX) * grows, most));
26
+ return;
27
+ }
28
+ travelled.current += deltaX;
29
+ onStep(clamp(started.current + Math.round((travelled.current * grows) / workbenchResizeStep), most));
30
+ },
31
+ onMoveEnd: () => {
32
+ setHeld(false);
33
+ onResizing(false);
34
+ },
35
+ });
36
+ return (_jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": most, "aria-valuenow": step, tabIndex: 0, ...moveProps, ...focusProps, className: workbenchHandleVariants({ place, isActive: isHeld || isFocusVisible }) }));
37
+ }
38
+ /**
39
+ * A form with what it makes shown large beside it. On a narrow screen the pane follows below.
40
+ * With `view="whole"` the two take the whole window, over the editor's frame, as a studio in the
41
+ * dark theme: the outline on the left, the pane in the middle, and the form a panel on the right that
42
+ * can be put away. The outline and the form are dragged wider or narrower by the edges between them.
43
+ * Going from one view to the other keeps both as they are: nothing typed is lost and the pane is not
44
+ * made again.
45
+ */
46
+ export function Workbench({ paneLabel, children, pane, bar, isFormAway = false, outline, outlineLabel, sizes, onSizesChange, resizeLabels, view = 'beside', }) {
47
+ const isWhole = view === 'whole';
48
+ const [held, setHeld] = useState({ outline: WORKBENCH_OUTLINE_DEFAULT, form: WORKBENCH_FORM_DEFAULT });
49
+ const shown = sizes ?? held;
50
+ const resize = (next) => {
51
+ setHeld(next);
52
+ onSizesChange?.(next);
53
+ };
54
+ const [isResizing, setResizing] = useState(false);
55
+ // Menus and windows opened inside the studio open inside it, so they take its dark theme too.
56
+ const studio = useRef(null);
57
+ const form = (_jsx("div", { className: workbenchFormVariants({ view, isAway: isWhole && isFormAway }), children: _jsx("div", { className: isWhole ? workbenchFormWidthVariants({ width: shown.form }) : workbenchFormInnerClass, children: children }) }));
58
+ return (
59
+ // With the whole window, the keyboard stays in it: what is behind cannot be seen.
60
+ _jsx(FocusScope, { contain: isWhole, children: _jsx(UNSAFE_PortalProvider, { getContainer: () => (isWhole && studio.current !== null ? studio.current : document.body), children: _jsxs("div", { ref: studio, className: workbenchVariants({ view }), children: [isWhole && bar, _jsxs("div", { className: workbenchBodyVariants({ view }), children: [isWhole && outline !== undefined && (_jsx("aside", { "aria-label": outlineLabel, className: workbenchOutlineClass, children: _jsx("div", { className: workbenchOutlineWidthVariants({ width: shown.outline }), children: outline }) })), isWhole && outline !== undefined && resizeLabels !== undefined && (_jsx(Handle, { label: resizeLabels.outline, place: "outline", step: shown.outline, most: WORKBENCH_OUTLINE_STEPS - 1, grows: 1, onStep: (step) => resize({ ...shown, outline: step }), onResizing: setResizing })), isWhole && !isFormAway && resizeLabels !== undefined && (_jsx(Handle, { label: resizeLabels.form, place: "form", step: shown.form, most: WORKBENCH_FORM_STEPS - 1, grows: -1, onStep: (step) => resize({ ...shown, form: step }), onResizing: setResizing })), form, _jsx("section", { "aria-label": paneLabel, className: workbenchPaneVariants({ view, isResizing }), children: pane })] })] }) }) }));
6
61
  }
7
62
  //# sourceMappingURL=Workbench.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAWjG,kGAAkG;AAClG,MAAM,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nF,IAAI,GACG,IACN,IACF,GACgB,GACb,CACd,CAAC;AACJ,CAAC"}
@@ -1,6 +1,58 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ /**
3
+ * Beside the form, the workbench is part of the screen. Whole, it covers the window, over the frame of
4
+ * the editor, as a studio of its own: always in the dark theme (`dark` turns every token in it to its
5
+ * dark value), so the page, the one thing in full colour, stands out from it.
6
+ */
7
+ export declare const workbenchVariants: (props?: ({
8
+ view?: "beside" | "whole" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
10
  /** One column on a narrow screen; from `xl` up, the form in a column of its own width and the pane taking the rest. */
2
- export declare const workbenchClass = "flex w-full flex-col gap-6 xl:flex-row xl:items-start";
3
- export declare const workbenchFormClass = "flex min-w-0 flex-col gap-6 xl:w-lg xl:shrink-0";
4
- /** The pane stays in view while the form scrolls under the bar at the top. */
5
- export declare const workbenchPaneClass = "pane-tall min-w-0 xl:sticky xl:top-24 xl:flex-1";
11
+ export declare const workbenchBodyVariants: (props?: ({
12
+ view?: "beside" | "whole" | null | undefined;
13
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
+ /**
15
+ * Whole, the form is a panel on the right that scrolls by itself, where what is chosen on the page is edited, and slides away to
16
+ * leave the pane the window. On a phone it is as wide as the window, so away it is simply gone.
17
+ */
18
+ export declare const workbenchFormVariants: (props?: ({
19
+ view?: "beside" | "whole" | null | undefined;
20
+ isAway?: boolean | null | undefined;
21
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
22
+ /** How wide the form's panel is with the whole window, in the steps a person drags it through. */
23
+ export declare const workbenchFormWidthVariants: (props?: ({
24
+ width?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 7 | 9 | null | undefined;
25
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
26
+ export declare const WORKBENCH_FORM_STEPS = 10;
27
+ export declare const WORKBENCH_FORM_DEFAULT = 6;
28
+ /** How wide the outline is, in the same way. */
29
+ export declare const workbenchOutlineWidthVariants: (props?: ({
30
+ width?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | null | undefined;
31
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
32
+ export declare const WORKBENCH_OUTLINE_STEPS = 8;
33
+ export declare const WORKBENCH_OUTLINE_DEFAULT = 3;
34
+ /** How far the pointer moves for one step, in pixels. */
35
+ export declare const workbenchResizeStep = 32;
36
+ /** What the form holds, in a column: beside, as wide as the form's column; whole, as wide as the panel was dragged. */
37
+ export declare const workbenchFormInnerClass = "flex min-w-0 flex-col gap-6";
38
+ /** Beside the form, the pane stays in view while the form scrolls under the bar at the top. */
39
+ export declare const workbenchPaneVariants: (props?: ({
40
+ view?: "beside" | "whole" | null | undefined;
41
+ isResizing?: boolean | null | undefined;
42
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
43
+ /** Whole, the way around what is made, on the left: from `lg` up, where there is room for three columns. */
44
+ export declare const workbenchOutlineClass = "hidden shrink-0 flex-col overflow-auto border-r border-border bg-card p-3 lg:flex";
45
+ /**
46
+ * The edge between two columns, dragged to make one wider or narrower, or moved with the arrow keys
47
+ * once it has the focus. It shows as a line, and as the brand's colour while it is held or chosen.
48
+ */
49
+ /**
50
+ * The edge a panel is dragged by: a hairline over the panel's own border, seen on hover and in the brand's
51
+ * orange while it moves, with a wider area either side to take the pointer.
52
+ */
53
+ export declare const workbenchHandleVariants: (props?: ({
54
+ place?: "form" | "outline" | null | undefined;
55
+ isActive?: boolean | null | undefined;
56
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
57
+ export type WorkbenchVariants = VariantProps<typeof workbenchVariants>;
6
58
  //# sourceMappingURL=Workbench.variants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.variants.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,eAAO,MAAM,cAAc,0DAA0D,CAAC;AACtF,eAAO,MAAM,kBAAkB,oDAAoD,CAAC;AACpF,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,oDAAoD,CAAC"}
1
+ {"version":3,"file":"Workbench.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;8EAQ5B,CAAC;AAEH,uHAAuH;AACvH,eAAO,MAAM,qBAAqB;;8EAQhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;8EAUhC,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,0BAA0B;;8EAerC,CAAC;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,gDAAgD;AAChD,eAAO,MAAM,6BAA6B;;8EAaxC,CAAC;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,uHAAuH;AACvH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB;;;8EAUhC,CAAC;AAEH,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,sFAAsF,CAAC;AAEzH;;;GAGG;AACH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;8EAYnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,6 +1,113 @@
1
+ import { cva } from 'class-variance-authority';
2
+ /**
3
+ * Beside the form, the workbench is part of the screen. Whole, it covers the window, over the frame of
4
+ * the editor, as a studio of its own: always in the dark theme (`dark` turns every token in it to its
5
+ * dark value), so the page, the one thing in full colour, stands out from it.
6
+ */
7
+ export const workbenchVariants = cva('', {
8
+ variants: {
9
+ view: {
10
+ beside: 'w-full',
11
+ whole: 'dark fixed inset-0 layer-overlay flex flex-col bg-background text-foreground',
12
+ },
13
+ },
14
+ defaultVariants: { view: 'beside' },
15
+ });
1
16
  /** One column on a narrow screen; from `xl` up, the form in a column of its own width and the pane taking the rest. */
2
- export const workbenchClass = 'flex w-full flex-col gap-6 xl:flex-row xl:items-start';
3
- export const workbenchFormClass = 'flex min-w-0 flex-col gap-6 xl:w-lg xl:shrink-0';
4
- /** The pane stays in view while the form scrolls under the bar at the top. */
5
- export const workbenchPaneClass = 'pane-tall min-w-0 xl:sticky xl:top-24 xl:flex-1';
17
+ export const workbenchBodyVariants = cva('flex', {
18
+ variants: {
19
+ view: {
20
+ beside: 'w-full flex-col gap-6 xl:flex-row xl:items-start',
21
+ whole: 'min-h-0 flex-1',
22
+ },
23
+ },
24
+ defaultVariants: { view: 'beside' },
25
+ });
26
+ /**
27
+ * Whole, the form is a panel on the right that scrolls by itself, where what is chosen on the page is edited, and slides away to
28
+ * leave the pane the window. On a phone it is as wide as the window, so away it is simply gone.
29
+ */
30
+ export const workbenchFormVariants = cva('flex min-w-0 flex-col gap-6', {
31
+ variants: {
32
+ view: {
33
+ beside: 'xl:w-lg xl:shrink-0',
34
+ whole: 'order-last max-w-full shrink-0 overflow-auto border-l border-border bg-card p-4',
35
+ },
36
+ isAway: { true: '', false: '' },
37
+ },
38
+ compoundVariants: [{ view: 'whole', isAway: true, class: 'hidden' }],
39
+ defaultVariants: { view: 'beside', isAway: false },
40
+ });
41
+ /** How wide the form's panel is with the whole window, in the steps a person drags it through. */
42
+ export const workbenchFormWidthVariants = cva('flex min-w-0 max-w-full flex-col gap-6', {
43
+ variants: {
44
+ width: {
45
+ 0: 'md:w-80',
46
+ 1: 'md:w-88',
47
+ 2: 'md:w-96',
48
+ 3: 'md:w-104',
49
+ 4: 'md:w-112',
50
+ 5: 'md:w-120',
51
+ 6: 'md:w-128',
52
+ 7: 'md:w-136',
53
+ 8: 'md:w-144',
54
+ 9: 'md:w-160',
55
+ },
56
+ },
57
+ });
58
+ export const WORKBENCH_FORM_STEPS = 10;
59
+ export const WORKBENCH_FORM_DEFAULT = 6;
60
+ /** How wide the outline is, in the same way. */
61
+ export const workbenchOutlineWidthVariants = cva('', {
62
+ variants: {
63
+ width: {
64
+ 0: 'w-48',
65
+ 1: 'w-52',
66
+ 2: 'w-56',
67
+ 3: 'w-60',
68
+ 4: 'w-64',
69
+ 5: 'w-72',
70
+ 6: 'w-80',
71
+ 7: 'w-96',
72
+ },
73
+ },
74
+ });
75
+ export const WORKBENCH_OUTLINE_STEPS = 8;
76
+ export const WORKBENCH_OUTLINE_DEFAULT = 3;
77
+ /** How far the pointer moves for one step, in pixels. */
78
+ export const workbenchResizeStep = 32;
79
+ /** What the form holds, in a column: beside, as wide as the form's column; whole, as wide as the panel was dragged. */
80
+ export const workbenchFormInnerClass = 'flex min-w-0 flex-col gap-6';
81
+ /** Beside the form, the pane stays in view while the form scrolls under the bar at the top. */
82
+ export const workbenchPaneVariants = cva('min-w-0', {
83
+ variants: {
84
+ view: {
85
+ beside: 'pane-tall xl:sticky xl:top-8 xl:flex-1',
86
+ whole: 'min-h-0 flex-1 p-3',
87
+ },
88
+ /** While a panel is dragged wider or narrower, the page takes no pointer, so the drag is not lost over it. */
89
+ isResizing: { true: 'pointer-events-none select-none', false: '' },
90
+ },
91
+ defaultVariants: { view: 'beside', isResizing: false },
92
+ });
93
+ /** Whole, the way around what is made, on the left: from `lg` up, where there is room for three columns. */
94
+ export const workbenchOutlineClass = 'hidden shrink-0 flex-col overflow-auto border-r border-border bg-card p-3 lg:flex';
95
+ /**
96
+ * The edge between two columns, dragged to make one wider or narrower, or moved with the arrow keys
97
+ * once it has the focus. It shows as a line, and as the brand's colour while it is held or chosen.
98
+ */
99
+ /**
100
+ * The edge a panel is dragged by: a hairline over the panel's own border, seen on hover and in the brand's
101
+ * orange while it moves, with a wider area either side to take the pointer.
102
+ */
103
+ export const workbenchHandleVariants = cva([
104
+ 'relative z-10 w-px shrink-0 cursor-col-resize touch-none bg-transparent transition-colors motion-fast outline-none hover:bg-border-strong',
105
+ 'before:absolute before:inset-y-0 before:-inset-x-1.5',
106
+ ].join(' '), {
107
+ variants: {
108
+ place: { outline: 'hidden lg:block', form: 'order-last max-md:hidden' },
109
+ isActive: { true: 'bg-brand-fill hover:bg-brand-fill', false: '' },
110
+ },
111
+ defaultVariants: { place: 'outline', isActive: false },
112
+ });
6
113
  //# sourceMappingURL=Workbench.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.variants.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.variants.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,MAAM,CAAC,MAAM,cAAc,GAAG,uDAAuD,CAAC;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,iDAAiD,CAAC;AACpF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,iDAAiD,CAAC"}
1
+ {"version":3,"file":"Workbench.variants.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC,EAAE,EAAE;IACvC,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,8EAA8E;SACtF;KACF;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACpC,CAAC,CAAC;AAEH,uHAAuH;AACvH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC,MAAM,EAAE;IAC/C,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,kDAAkD;YAC1D,KAAK,EAAE,gBAAgB;SACxB;KACF;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAA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EAAE,MAAM;SACV;KACF;CACF,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAC3C,yDAAyD;AACzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,uHAAuH;AACvH,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC,SAAS,EAAE;IAClD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,wCAAwC;YAChD,KAAK,EAAE,oBAAoB;SAC5B;QACD,8GAA8G;QAC9G,UAAU,EAAE,EAAE,IAAI,EAAE,iCAAiC,EAAE,KAAK,EAAE,EAAE,EAAE;KACnE;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE;CACvD,CAAC,CAAC;AAEH,4GAA4G;AAC5G,MAAM,CAAC,MAAM,qBAAqB,GAAG,mFAAmF,CAAC;AAEzH;;;GAGG;AACH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CACxC;IACE,2IAA2I;IAC3I,sDAAsD;CACvD,CAAC,IAAI,CAAC,GAAG,CAAC,EACX;IACE,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,0BAA0B,EAAE;QACvE,QAAQ,EAAE,EAAE,IAAI,EAAE,mCAAmC,EAAE,KAAK,EAAE,EAAE,EAAE;KACnE;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;CACvD,CACF,CAAC"}
@@ -1,2 +1,2 @@
1
- export { Workbench, type WorkbenchProps } from './Workbench.js';
1
+ export { Workbench, type WorkbenchProps, type WorkbenchSizes } from './Workbench.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4C,MAAM,gBAAgB,CAAC"}
@@ -13,4 +13,8 @@ export * from './Board/index.js';
13
13
  export * from './SectionList/index.js';
14
14
  export * from './PagePreview/index.js';
15
15
  export * from './Workbench/index.js';
16
+ export * from './CommandPalette/index.js';
17
+ export * from './Outline/index.js';
18
+ export * from './Welcome/index.js';
19
+ export * from './SiteWindow/index.js';
16
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -13,4 +13,8 @@ export * from './Board/index.js';
13
13
  export * from './SectionList/index.js';
14
14
  export * from './PagePreview/index.js';
15
15
  export * from './Workbench/index.js';
16
+ export * from './CommandPalette/index.js';
17
+ export * from './Outline/index.js';
18
+ export * from './Welcome/index.js';
19
+ export * from './SiteWindow/index.js';
16
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Where a screen's header goes: the bar across the top of `AppShell`. The shell gives the element
3
+ * once it is drawn (`null` until then); outside a shell there is none (`undefined`), and a header
4
+ * is drawn where it stands, as in a story or a test of one part.
5
+ */
6
+ export declare const PageBarContext: import("react").Context<HTMLElement | null | undefined>;
7
+ /** The bar a screen's header is drawn in, `null` while the shell is still drawing it, or `undefined` outside a shell. */
8
+ export declare function usePageBar(): HTMLElement | null | undefined;
9
+ /**
10
+ * Told by a screen whose bar leads back (an entry, with the way back to its list) that it does, so on a
11
+ * phone the shell leaves out its menu and its search: one row, the way back in the menu's place, as on
12
+ * any phone. Outside a shell there is nothing to tell.
13
+ */
14
+ export declare const PageBarBackContext: import("react").Context<((leadsBack: boolean) => void) | undefined>;
15
+ /** Says, while the screen is shown, that its bar leads back. */
16
+ export declare function usePageBarBack(): ((leadsBack: boolean) => void) | undefined;
17
+ //# sourceMappingURL=page-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-bar.d.ts","sourceRoot":"","sources":["../../src/patterns/page-bar.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc,yDAA2D,CAAC;AAEvF,yHAAyH;AACzH,wBAAgB,UAAU,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,CAE3D;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,uCAA8B,OAAO,KAAK,IAAI,cAAyB,CAAC;AAEvG,gEAAgE;AAChE,wBAAgB,cAAc,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAE3E"}
@@ -0,0 +1,22 @@
1
+ import { createContext, useContext } from 'react';
2
+ /**
3
+ * Where a screen's header goes: the bar across the top of `AppShell`. The shell gives the element
4
+ * once it is drawn (`null` until then); outside a shell there is none (`undefined`), and a header
5
+ * is drawn where it stands, as in a story or a test of one part.
6
+ */
7
+ export const PageBarContext = createContext(undefined);
8
+ /** The bar a screen's header is drawn in, `null` while the shell is still drawing it, or `undefined` outside a shell. */
9
+ export function usePageBar() {
10
+ return useContext(PageBarContext);
11
+ }
12
+ /**
13
+ * Told by a screen whose bar leads back (an entry, with the way back to its list) that it does, so on a
14
+ * phone the shell leaves out its menu and its search: one row, the way back in the menu's place, as on
15
+ * any phone. Outside a shell there is nothing to tell.
16
+ */
17
+ export const PageBarBackContext = createContext(undefined);
18
+ /** Says, while the screen is shown, that its bar leads back. */
19
+ export function usePageBarBack() {
20
+ return useContext(PageBarBackContext);
21
+ }
22
+ //# sourceMappingURL=page-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-bar.js","sourceRoot":"","sources":["../../src/patterns/page-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAEvF,yHAAyH;AACzH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC,cAAc,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAA6C,SAAS,CAAC,CAAC;AAEvG,gEAAgE;AAChE,MAAM,UAAU,cAAc;IAC5B,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;AACxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velocity-astro/cms-ui",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.11",
4
4
  "description": "The Velocity CMS editor's design system: tokens, components and patterns. Knows nothing about content or the API.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,6 +50,7 @@
50
50
  "@tiptap/starter-kit": "^3.34.0",
51
51
  "class-variance-authority": "^0.7.1",
52
52
  "lucide-react": "^1.74.0",
53
+ "react-aria": "^3.53.1",
53
54
  "react-aria-components": "^1.22.1"
54
55
  },
55
56
  "peerDependencies": {
package/src/styles.css CHANGED
@@ -71,8 +71,16 @@
71
71
  --color-info-light: var(--info-light);
72
72
  --color-info-foreground: var(--info-foreground);
73
73
  --color-scrim: var(--scrim);
74
+ --color-rail: var(--rail);
75
+ --color-rail-foreground: var(--rail-foreground);
76
+ --color-rail-muted: var(--rail-muted);
77
+ --color-rail-hover: var(--rail-hover);
78
+ --color-rail-current: var(--rail-current);
79
+ --color-rail-border: var(--rail-border);
74
80
  --color-brand-fill: var(--brand-fill);
75
81
  --color-brand-ink: var(--brand-ink);
82
+ --color-brand-fill-hover: var(--brand-fill-hover);
83
+ --color-brand-text: var(--brand-text);
76
84
 
77
85
  --font-sans: var(--font-ui);
78
86
  --font-mono: var(--font-code);
@@ -92,6 +100,10 @@
92
100
  --text-2xl--line-height: var(--type-2xl-leading);
93
101
  --text-3xl: var(--type-3xl);
94
102
  --text-3xl--line-height: var(--type-3xl-leading);
103
+ --text-4xl: var(--type-4xl);
104
+ --text-4xl--line-height: var(--type-4xl-leading);
105
+ --text-5xl: var(--type-5xl);
106
+ --text-5xl--line-height: var(--type-5xl-leading);
95
107
 
96
108
  --radius-sm: var(--theme-radius-sm);
97
109
  --radius-md: var(--theme-radius-md);
@@ -117,6 +129,11 @@
117
129
  transition-duration: var(--motion-base);
118
130
  transition-timing-function: var(--motion-ease);
119
131
  }
132
+ /* A panel that is part of the layout and makes room or takes it: the form beside a page. */
133
+ @utility motion-slide {
134
+ transition-duration: var(--motion-slow);
135
+ transition-timing-function: var(--motion-ease);
136
+ }
120
137
  /*
121
138
  * How things arrive and leave. React Aria marks a part `data-entering` while it opens and
122
139
  * `data-exiting` while it closes, and waits for the animation before taking it away. Leaving is
@@ -154,6 +171,16 @@
154
171
  transform: translateX(100%);
155
172
  }
156
173
  }
174
+ @keyframes motion-sheet-start-in {
175
+ from {
176
+ transform: translateX(-100%);
177
+ }
178
+ }
179
+ @keyframes motion-sheet-start-out {
180
+ to {
181
+ transform: translateX(-100%);
182
+ }
183
+ }
157
184
  @keyframes motion-float-in {
158
185
  from {
159
186
  opacity: 0;
@@ -215,6 +242,16 @@
215
242
  forwards;
216
243
  }
217
244
  }
245
+ /* The same from the other edge: the navigation of a narrow window. */
246
+ @utility motion-sheet-start {
247
+ &[data-entering] {
248
+ animation: motion-sheet-start-in var(--motion-slower) var(--motion-ease-enter);
249
+ }
250
+ &[data-exiting] {
251
+ animation: motion-sheet-start-out var(--motion-slow) var(--motion-ease-exit)
252
+ forwards;
253
+ }
254
+ }
218
255
  /* A list, menu or tooltip beside what opened it: it comes from that side. */
219
256
  @utility motion-float {
220
257
  &[data-placement^="bottom"] {
@@ -259,6 +296,81 @@
259
296
  motion-fade-in var(--motion-slow) var(--motion-ease) var(--motion-slow) backwards,
260
297
  motion-breathe var(--motion-loop) ease-in-out infinite;
261
298
  }
299
+ /*
300
+ * The mark while the editor opens (LoadingMark): each facet arrives from its own side in grey and
301
+ * takes its colour, the top first, holds, fades, and assembles again until the editor is there.
302
+ * Someone who asks for less motion sees the whole mark, still.
303
+ */
304
+ @keyframes motion-mark-arrive {
305
+ 0% {
306
+ opacity: 0;
307
+ transform: translate(var(--mark-from-x), var(--mark-from-y));
308
+ }
309
+ 22%,
310
+ 82% {
311
+ opacity: 1;
312
+ transform: translate(0, 0);
313
+ }
314
+ 100% {
315
+ opacity: 0;
316
+ transform: translate(0, 0);
317
+ }
318
+ }
319
+ @keyframes motion-mark-colour {
320
+ 0%,
321
+ 30% {
322
+ opacity: 0;
323
+ }
324
+ 46%,
325
+ 100% {
326
+ opacity: 1;
327
+ }
328
+ }
329
+ @utility motion-mark-top {
330
+ --mark-from-x: 0px;
331
+ --mark-from-y: -18px;
332
+ transform-box: fill-box;
333
+ animation: motion-mark-arrive var(--motion-mark) var(--motion-ease-enter) infinite;
334
+ @media (prefers-reduced-motion: reduce) {
335
+ animation: none;
336
+ }
337
+ }
338
+ @utility motion-mark-left {
339
+ --mark-from-x: -18px;
340
+ --mark-from-y: 10px;
341
+ transform-box: fill-box;
342
+ animation: motion-mark-arrive var(--motion-mark) var(--motion-ease-enter) 140ms infinite backwards;
343
+ @media (prefers-reduced-motion: reduce) {
344
+ animation: none;
345
+ }
346
+ }
347
+ @utility motion-mark-right {
348
+ --mark-from-x: 18px;
349
+ --mark-from-y: 10px;
350
+ transform-box: fill-box;
351
+ animation: motion-mark-arrive var(--motion-mark) var(--motion-ease-enter) 280ms infinite backwards;
352
+ @media (prefers-reduced-motion: reduce) {
353
+ animation: none;
354
+ }
355
+ }
356
+ @utility motion-mark-colour-top {
357
+ animation: motion-mark-colour var(--motion-mark) var(--motion-ease) infinite;
358
+ @media (prefers-reduced-motion: reduce) {
359
+ animation: none;
360
+ }
361
+ }
362
+ @utility motion-mark-colour-left {
363
+ animation: motion-mark-colour var(--motion-mark) var(--motion-ease) 140ms infinite backwards;
364
+ @media (prefers-reduced-motion: reduce) {
365
+ animation: none;
366
+ }
367
+ }
368
+ @utility motion-mark-colour-right {
369
+ animation: motion-mark-colour var(--motion-mark) var(--motion-ease) 280ms infinite backwards;
370
+ @media (prefers-reduced-motion: reduce) {
371
+ animation: none;
372
+ }
373
+ }
262
374
  /* A control that gives a little under a press. */
263
375
  @utility motion-press {
264
376
  transition-property:
@@ -277,6 +389,30 @@
277
389
  animation-timing-function: var(--motion-ease);
278
390
  }
279
391
 
392
+ /* A faint grid behind the top of a screen that greets: lines of the border colour, 40px apart. */
393
+ @utility bg-grid {
394
+ background-image:
395
+ linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px),
396
+ linear-gradient(to right, var(--border-subtle) 1px, transparent 1px);
397
+ background-size: 2.5rem 2.5rem;
398
+ }
399
+
400
+ /*
401
+ * The grid as a clearing: its lines show in the middle and fade toward the edges, so what sits
402
+ * in the middle (the mark while the editor opens) stands on it alone.
403
+ */
404
+ @utility bg-grid-clearing {
405
+ background-image:
406
+ radial-gradient(closest-side, transparent 30%, var(--background) 100%),
407
+ linear-gradient(to bottom, var(--border) 1px, transparent 1px),
408
+ linear-gradient(to right, var(--border) 1px, transparent 1px);
409
+ background-size:
410
+ 100% 100%,
411
+ 1.5rem 1.5rem,
412
+ 1.5rem 1.5rem;
413
+ background-position: center;
414
+ }
415
+
280
416
  /* As tall as the room a screen has under its bar, for a pane that stays in view. */
281
417
  @utility pane-tall {
282
418
  height: var(--pane-height);