@velocity-astro/cms-ui 0.1.0-beta.7 → 0.1.0-beta.9

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 (205) hide show
  1. package/component-registry.json +72 -5
  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/Heading/Heading.d.ts +1 -1
  47. package/dist/components/Heading/Heading.d.ts.map +1 -1
  48. package/dist/components/Heading/Heading.js +2 -2
  49. package/dist/components/Heading/Heading.js.map +1 -1
  50. package/dist/components/Heading/Heading.variants.d.ts +1 -0
  51. package/dist/components/Heading/Heading.variants.d.ts.map +1 -1
  52. package/dist/components/Heading/Heading.variants.js +2 -0
  53. package/dist/components/Heading/Heading.variants.js.map +1 -1
  54. package/dist/components/Logo/Logo.d.ts +1 -1
  55. package/dist/components/Logo/Logo.d.ts.map +1 -1
  56. package/dist/components/Logo/Logo.js +3 -3
  57. package/dist/components/Logo/Logo.js.map +1 -1
  58. package/dist/components/Logo/Logo.variants.d.ts +5 -2
  59. package/dist/components/Logo/Logo.variants.d.ts.map +1 -1
  60. package/dist/components/Logo/Logo.variants.js +10 -1
  61. package/dist/components/Logo/Logo.variants.js.map +1 -1
  62. package/dist/components/Meter/Meter.d.ts +13 -0
  63. package/dist/components/Meter/Meter.d.ts.map +1 -0
  64. package/dist/components/Meter/Meter.js +8 -0
  65. package/dist/components/Meter/Meter.js.map +1 -0
  66. package/dist/components/Meter/Meter.variants.d.ts +14 -0
  67. package/dist/components/Meter/Meter.variants.d.ts.map +1 -0
  68. package/dist/components/Meter/Meter.variants.js +39 -0
  69. package/dist/components/Meter/Meter.variants.js.map +1 -0
  70. package/dist/components/Meter/index.d.ts +2 -0
  71. package/dist/components/Meter/index.d.ts.map +1 -0
  72. package/dist/components/Meter/index.js +2 -0
  73. package/dist/components/Meter/index.js.map +1 -0
  74. package/dist/components/Segmented/Segmented.d.ts +6 -1
  75. package/dist/components/Segmented/Segmented.d.ts.map +1 -1
  76. package/dist/components/Segmented/Segmented.js +9 -3
  77. package/dist/components/Segmented/Segmented.js.map +1 -1
  78. package/dist/components/Segmented/Segmented.variants.d.ts +7 -1
  79. package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
  80. package/dist/components/Segmented/Segmented.variants.js +11 -3
  81. package/dist/components/Segmented/Segmented.variants.js.map +1 -1
  82. package/dist/components/Table/Table.d.ts +8 -1
  83. package/dist/components/Table/Table.d.ts.map +1 -1
  84. package/dist/components/Table/Table.js +4 -4
  85. package/dist/components/Table/Table.js.map +1 -1
  86. package/dist/components/Table/Table.variants.d.ts +6 -2
  87. package/dist/components/Table/Table.variants.d.ts.map +1 -1
  88. package/dist/components/Table/Table.variants.js +9 -4
  89. package/dist/components/Table/Table.variants.js.map +1 -1
  90. package/dist/components/index.d.ts +3 -0
  91. package/dist/components/index.d.ts.map +1 -1
  92. package/dist/components/index.js +3 -0
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/patterns/AppShell/AppShell.d.ts +31 -8
  95. package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
  96. package/dist/patterns/AppShell/AppShell.js +31 -7
  97. package/dist/patterns/AppShell/AppShell.js.map +1 -1
  98. package/dist/patterns/AppShell/AppShell.variants.d.ts +70 -32
  99. package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
  100. package/dist/patterns/AppShell/AppShell.variants.js +116 -38
  101. package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
  102. package/dist/patterns/AppShell/index.d.ts +1 -1
  103. package/dist/patterns/AppShell/index.d.ts.map +1 -1
  104. package/dist/patterns/AppShell/index.js.map +1 -1
  105. package/dist/patterns/CommandPalette/CommandPalette.d.ts +36 -0
  106. package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
  107. package/dist/patterns/CommandPalette/CommandPalette.js +18 -0
  108. package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
  109. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
  110. package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
  111. package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
  112. package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
  113. package/dist/patterns/CommandPalette/index.d.ts +2 -0
  114. package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
  115. package/dist/patterns/CommandPalette/index.js +2 -0
  116. package/dist/patterns/CommandPalette/index.js.map +1 -0
  117. package/dist/patterns/Outline/Outline.d.ts +26 -0
  118. package/dist/patterns/Outline/Outline.d.ts.map +1 -0
  119. package/dist/patterns/Outline/Outline.js +21 -0
  120. package/dist/patterns/Outline/Outline.js.map +1 -0
  121. package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
  122. package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
  123. package/dist/patterns/Outline/Outline.variants.js +21 -0
  124. package/dist/patterns/Outline/Outline.variants.js.map +1 -0
  125. package/dist/patterns/Outline/index.d.ts +2 -0
  126. package/dist/patterns/Outline/index.d.ts.map +1 -0
  127. package/dist/patterns/Outline/index.js +2 -0
  128. package/dist/patterns/Outline/index.js.map +1 -0
  129. package/dist/patterns/PageHeader/PageHeader.d.ts +33 -4
  130. package/dist/patterns/PageHeader/PageHeader.d.ts.map +1 -1
  131. package/dist/patterns/PageHeader/PageHeader.js +31 -6
  132. package/dist/patterns/PageHeader/PageHeader.js.map +1 -1
  133. package/dist/patterns/PageHeader/PageHeader.variants.d.ts +23 -3
  134. package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
  135. package/dist/patterns/PageHeader/PageHeader.variants.js +33 -3
  136. package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
  137. package/dist/patterns/PagePreview/PagePreview.d.ts +9 -1
  138. package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
  139. package/dist/patterns/PagePreview/PagePreview.js +6 -2
  140. package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
  141. package/dist/patterns/SaveBar/SaveBar.d.ts +16 -5
  142. package/dist/patterns/SaveBar/SaveBar.d.ts.map +1 -1
  143. package/dist/patterns/SaveBar/SaveBar.js +21 -3
  144. package/dist/patterns/SaveBar/SaveBar.js.map +1 -1
  145. package/dist/patterns/SaveBar/SaveBar.variants.d.ts +25 -7
  146. package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
  147. package/dist/patterns/SaveBar/SaveBar.variants.js +32 -10
  148. package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
  149. package/dist/patterns/SectionList/SectionList.d.ts.map +1 -1
  150. package/dist/patterns/SectionList/SectionList.js +2 -2
  151. package/dist/patterns/SectionList/SectionList.js.map +1 -1
  152. package/dist/patterns/SectionList/SectionList.variants.d.ts +4 -1
  153. package/dist/patterns/SectionList/SectionList.variants.d.ts.map +1 -1
  154. package/dist/patterns/SectionList/SectionList.variants.js +5 -2
  155. package/dist/patterns/SectionList/SectionList.variants.js.map +1 -1
  156. package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
  157. package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
  158. package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
  159. package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
  160. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
  161. package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
  162. package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
  163. package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
  164. package/dist/patterns/SiteWindow/index.d.ts +2 -0
  165. package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
  166. package/dist/patterns/SiteWindow/index.js +2 -0
  167. package/dist/patterns/SiteWindow/index.js.map +1 -0
  168. package/dist/patterns/Split/Split.variants.d.ts +2 -2
  169. package/dist/patterns/Split/Split.variants.d.ts.map +1 -1
  170. package/dist/patterns/Split/Split.variants.js +2 -2
  171. package/dist/patterns/Split/Split.variants.js.map +1 -1
  172. package/dist/patterns/Welcome/Welcome.d.ts +18 -0
  173. package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
  174. package/dist/patterns/Welcome/Welcome.js +14 -0
  175. package/dist/patterns/Welcome/Welcome.js.map +1 -0
  176. package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
  177. package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
  178. package/dist/patterns/Welcome/Welcome.variants.js +12 -0
  179. package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
  180. package/dist/patterns/Welcome/index.d.ts +2 -0
  181. package/dist/patterns/Welcome/index.d.ts.map +1 -0
  182. package/dist/patterns/Welcome/index.js +2 -0
  183. package/dist/patterns/Welcome/index.js.map +1 -0
  184. package/dist/patterns/Workbench/Workbench.d.ts +26 -5
  185. package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
  186. package/dist/patterns/Workbench/Workbench.js +53 -7
  187. package/dist/patterns/Workbench/Workbench.js.map +1 -1
  188. package/dist/patterns/Workbench/Workbench.variants.d.ts +36 -2
  189. package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
  190. package/dist/patterns/Workbench/Workbench.variants.js +70 -8
  191. package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
  192. package/dist/patterns/Workbench/index.d.ts +1 -1
  193. package/dist/patterns/Workbench/index.d.ts.map +1 -1
  194. package/dist/patterns/Workbench/index.js.map +1 -1
  195. package/dist/patterns/index.d.ts +4 -0
  196. package/dist/patterns/index.d.ts.map +1 -1
  197. package/dist/patterns/index.js +4 -0
  198. package/dist/patterns/index.js.map +1 -1
  199. package/dist/patterns/page-bar.d.ts +17 -0
  200. package/dist/patterns/page-bar.d.ts.map +1 -0
  201. package/dist/patterns/page-bar.js +22 -0
  202. package/dist/patterns/page-bar.js.map +1 -0
  203. package/package.json +1 -1
  204. package/src/styles.css +19 -0
  205. package/src/tokens/tokens.css +21 -1
@@ -0,0 +1,20 @@
1
+ import { type SiteWindowVariants } from './SiteWindow.variants.js';
2
+ export interface SiteWindowProps extends SiteWindowVariants {
3
+ /** The site's address, shown where a browser shows it: "lakeshore.example". */
4
+ readonly address: string;
5
+ /** The page to show, as visitors see it: a path on the site, such as "/". */
6
+ readonly src: string;
7
+ /** What the page is, for screen readers: "The home page of Lakeshore Realty". */
8
+ readonly title: string;
9
+ /** What pressing the card does, at its foot: "Edit the home page". */
10
+ readonly label: string;
11
+ /** A few words at the foot before it: when the page was last published, and by whom. */
12
+ readonly meta?: string;
13
+ /** Where pressing the card leads. */
14
+ readonly href?: string;
15
+ /** What pressing the card does, when it leads nowhere by itself. */
16
+ readonly onPress?: () => void;
17
+ }
18
+ /** A page of the site in a small browser window, as visitors see it now. The whole card is one link. */
19
+ export declare function SiteWindow({ address, src, title, label, meta, href, onPress, size }: SiteWindowProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=SiteWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteWindow.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.tsx"],"names":[],"mappings":"AACA,OAAO,EAYL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,wGAAwG;AACxG,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,eAAe,+BAuBpG"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link } from 'react-aria-components';
3
+ import { siteWindowAddressClass, siteWindowBarClass, siteWindowClass, siteWindowDotClass, siteWindowDotsClass, siteWindowFootClass, siteWindowFrameVariants, siteWindowLinkClass, siteWindowMetaClass, siteWindowSpacerClass, siteWindowViewVariants, } from './SiteWindow.variants.js';
4
+ /** A page of the site in a small browser window, as visitors see it now. The whole card is one link. */
5
+ export function SiteWindow({ address, src, title, label, meta, href, onPress, size }) {
6
+ return (_jsxs("div", { className: siteWindowClass, children: [_jsxs("div", { "aria-hidden": true, className: siteWindowBarClass, children: [_jsxs("span", { className: siteWindowDotsClass, children: [_jsx("span", { className: siteWindowDotClass }), _jsx("span", { className: siteWindowDotClass }), _jsx("span", { className: siteWindowDotClass })] }), _jsx("span", { className: siteWindowAddressClass, children: address }), _jsx("span", { className: siteWindowSpacerClass })] }), _jsx("div", { className: siteWindowViewVariants({ size }), children: _jsx("iframe", { src: src, title: title, loading: "lazy", tabIndex: -1, "aria-hidden": true, className: siteWindowFrameVariants({ size }) }) }), _jsxs("div", { className: siteWindowFootClass, children: [meta !== undefined && _jsx("span", { className: siteWindowMetaClass, children: meta }), _jsx(Link, { className: siteWindowLinkClass, ...(href !== undefined && { href }), ...(onPress !== undefined && { onPress }), children: label })] })] }));
7
+ }
8
+ //# sourceMappingURL=SiteWindow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteWindow.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,0BAA0B,CAAC;AAmBlC,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAmB;IACnG,OAAO,CACL,eAAK,SAAS,EAAE,eAAe,aAC7B,oCAAiB,SAAS,EAAE,kBAAkB,aAC5C,gBAAM,SAAS,EAAE,mBAAmB,aAClC,eAAM,SAAS,EAAE,kBAAkB,GAAI,EACvC,eAAM,SAAS,EAAE,kBAAkB,GAAI,EACvC,eAAM,SAAS,EAAE,kBAAkB,GAAI,IAClC,EACP,eAAM,SAAS,EAAE,sBAAsB,YAAG,OAAO,GAAQ,EACzD,eAAM,SAAS,EAAE,qBAAqB,GAAI,IACtC,EACN,cAAK,SAAS,EAAE,sBAAsB,CAAC,EAAE,IAAI,EAAE,CAAC,YAC9C,iBAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,CAAC,uBAAc,SAAS,EAAE,uBAAuB,CAAC,EAAE,IAAI,EAAE,CAAC,GAAI,GACrH,EACN,eAAK,SAAS,EAAE,mBAAmB,aAChC,IAAI,KAAK,SAAS,IAAI,eAAM,SAAS,EAAE,mBAAmB,YAAG,IAAI,GAAQ,EAC1E,KAAC,IAAI,IAAC,SAAS,EAAE,mBAAmB,KAAM,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,KAAM,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC,YACnH,KAAK,GACD,IACH,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ /** `relative`, so the link at its foot can stretch over the whole card and make all of it one thing to press. */
3
+ export declare const siteWindowClass = "group relative w-full min-w-0 max-w-xl overflow-hidden rounded-xl border border-border bg-card shadow-xl transition-colors motion-base has-data-hovered:border-border-strong has-data-focus-visible:ring-2 has-data-focus-visible:ring-ring";
4
+ export declare const siteWindowBarClass = "flex items-center gap-3 border-b border-border bg-background-secondary px-3.5 py-2.5";
5
+ export declare const siteWindowDotsClass = "flex shrink-0 gap-1.5";
6
+ export declare const siteWindowDotClass = "h-2.5 w-2.5 rounded-full bg-border-strong";
7
+ export declare const siteWindowAddressClass = "min-w-0 flex-1 truncate text-center font-mono text-xs text-foreground-subtle";
8
+ export declare const siteWindowSpacerClass = "w-10 shrink-0";
9
+ /**
10
+ * The page is drawn at twice the card's width and shown at half its size, so it looks as it does on
11
+ * a desktop. It cannot be pressed or reached by the keyboard: the card is a way to edit the page, not the page.
12
+ */
13
+ export declare const siteWindowViewVariants: (props?: ({
14
+ size?: "sm" | "md" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ /** `sm` draws the page wider still and shows it at a fifth of its size, for a narrow column. */
17
+ export declare const siteWindowFrameVariants: (props?: ({
18
+ size?: "sm" | "md" | null | undefined;
19
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
20
+ export type SiteWindowVariants = VariantProps<typeof siteWindowViewVariants>;
21
+ export declare const siteWindowFootClass = "flex items-center gap-3 border-t border-border px-4 py-3 text-sm";
22
+ export declare const siteWindowMetaClass = "min-w-0 flex-1 truncate text-foreground-muted";
23
+ export declare const siteWindowLinkClass = "shrink-0 font-semibold text-foreground outline-none after:absolute after:inset-0 group-hover:underline";
24
+ //# sourceMappingURL=SiteWindow.variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteWindow.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,iHAAiH;AACjH,eAAO,MAAM,eAAe,gPACmN,CAAC;AAChP,eAAO,MAAM,kBAAkB,yFAAyF,CAAC;AACzH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAC3D,eAAO,MAAM,kBAAkB,8CAA8C,CAAC;AAC9E,eAAO,MAAM,sBAAsB,iFAAiF,CAAC;AACrH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AACrD;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;8EAGjC,CAAC;AACH,gGAAgG;AAChG,eAAO,MAAM,uBAAuB;;8EAGlC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC7E,eAAO,MAAM,mBAAmB,qEAAqE,CAAC;AACtG,eAAO,MAAM,mBAAmB,kDAAkD,CAAC;AACnF,eAAO,MAAM,mBAAmB,2GAA2G,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { cva } from 'class-variance-authority';
2
+ /** `relative`, so the link at its foot can stretch over the whole card and make all of it one thing to press. */
3
+ export const siteWindowClass = 'group relative w-full min-w-0 max-w-xl overflow-hidden rounded-xl border border-border bg-card shadow-xl transition-colors motion-base has-data-hovered:border-border-strong has-data-focus-visible:ring-2 has-data-focus-visible:ring-ring';
4
+ export const siteWindowBarClass = 'flex items-center gap-3 border-b border-border bg-background-secondary px-3.5 py-2.5';
5
+ export const siteWindowDotsClass = 'flex shrink-0 gap-1.5';
6
+ export const siteWindowDotClass = 'h-2.5 w-2.5 rounded-full bg-border-strong';
7
+ export const siteWindowAddressClass = 'min-w-0 flex-1 truncate text-center font-mono text-xs text-foreground-subtle';
8
+ export const siteWindowSpacerClass = 'w-10 shrink-0';
9
+ /**
10
+ * The page is drawn at twice the card's width and shown at half its size, so it looks as it does on
11
+ * a desktop. It cannot be pressed or reached by the keyboard: the card is a way to edit the page, not the page.
12
+ */
13
+ export const siteWindowViewVariants = cva('relative overflow-hidden bg-background', {
14
+ variants: { size: { md: 'h-72', sm: 'h-40' } },
15
+ defaultVariants: { size: 'md' },
16
+ });
17
+ /** `sm` draws the page wider still and shows it at a fifth of its size, for a narrow column. */
18
+ export const siteWindowFrameVariants = cva('pointer-events-none absolute top-0 left-0 origin-top-left border-0', {
19
+ variants: { size: { md: 'h-144 w-288 scale-50', sm: 'h-200 w-320 scale-20' } },
20
+ defaultVariants: { size: 'md' },
21
+ });
22
+ export const siteWindowFootClass = 'flex items-center gap-3 border-t border-border px-4 py-3 text-sm';
23
+ export const siteWindowMetaClass = 'min-w-0 flex-1 truncate text-foreground-muted';
24
+ export const siteWindowLinkClass = 'shrink-0 font-semibold text-foreground outline-none after:absolute after:inset-0 group-hover:underline';
25
+ //# sourceMappingURL=SiteWindow.variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteWindow.variants.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/SiteWindow.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,iHAAiH;AACjH,MAAM,CAAC,MAAM,eAAe,GAC1B,6OAA6O,CAAC;AAChP,MAAM,CAAC,MAAM,kBAAkB,GAAG,sFAAsF,CAAC;AACzH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,2CAA2C,CAAC;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,8EAA8E,CAAC;AACrH,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AACrD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC,wCAAwC,EAAE;IAClF,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IAC9C,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;CAChC,CAAC,CAAC;AACH,gGAAgG;AAChG,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC,oEAAoE,EAAE;IAC/G,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE;IAC9E,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,kEAAkE,CAAC;AACtG,MAAM,CAAC,MAAM,mBAAmB,GAAG,+CAA+C,CAAC;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wGAAwG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { SiteWindow, type SiteWindowProps } from './SiteWindow.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { SiteWindow } from './SiteWindow.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/SiteWindow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /** One column on a narrow screen; the main column and a side column from `xl` up. */
2
2
  export declare const splitClass = "mx-auto flex w-full max-w-7xl flex-col gap-6 xl:flex-row xl:items-start";
3
3
  export declare const splitMainClass = "flex min-w-0 flex-1 flex-col gap-6";
4
- /** The side column stays in view while the main column scrolls under the bar at the top. */
5
- export declare const splitAsideClass = "flex w-full shrink-0 flex-col gap-6 xl:sticky xl:top-24 xl:w-80";
4
+ /** The side column stays in view while the main column scrolls, as far from the top as the screen's own padding. */
5
+ export declare const splitAsideClass = "flex w-full shrink-0 flex-col gap-6 xl:sticky xl:top-8 xl:w-80";
6
6
  //# sourceMappingURL=Split.variants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Split.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Split/Split.variants.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,UAAU,4EAA4E,CAAC;AACpG,eAAO,MAAM,cAAc,uCAAuC,CAAC;AACnE,4FAA4F;AAC5F,eAAO,MAAM,eAAe,oEAAoE,CAAC"}
1
+ {"version":3,"file":"Split.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Split/Split.variants.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,UAAU,4EAA4E,CAAC;AACpG,eAAO,MAAM,cAAc,uCAAuC,CAAC;AACnE,oHAAoH;AACpH,eAAO,MAAM,eAAe,mEAAmE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /** One column on a narrow screen; the main column and a side column from `xl` up. */
2
2
  export const splitClass = 'mx-auto flex w-full max-w-7xl flex-col gap-6 xl:flex-row xl:items-start';
3
3
  export const splitMainClass = 'flex min-w-0 flex-1 flex-col gap-6';
4
- /** The side column stays in view while the main column scrolls under the bar at the top. */
5
- export const splitAsideClass = 'flex w-full shrink-0 flex-col gap-6 xl:sticky xl:top-24 xl:w-80';
4
+ /** The side column stays in view while the main column scrolls, as far from the top as the screen's own padding. */
5
+ export const splitAsideClass = 'flex w-full shrink-0 flex-col gap-6 xl:sticky xl:top-8 xl:w-80';
6
6
  //# sourceMappingURL=Split.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Split.variants.js","sourceRoot":"","sources":["../../../src/patterns/Split/Split.variants.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,yEAAyE,CAAC;AACpG,MAAM,CAAC,MAAM,cAAc,GAAG,oCAAoC,CAAC;AACnE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,iEAAiE,CAAC"}
1
+ {"version":3,"file":"Split.variants.js","sourceRoot":"","sources":["../../../src/patterns/Split/Split.variants.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,yEAAyE,CAAC;AACpG,MAAM,CAAC,MAAM,cAAc,GAAG,oCAAoC,CAAC;AACnE,oHAAoH;AACpH,MAAM,CAAC,MAAM,eAAe,GAAG,gEAAgE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface WelcomeProps {
3
+ /** A few words over the title, such as today's date. */
4
+ readonly eyebrow?: string;
5
+ /** The screen's one heading: "Good morning, Dana. 3 drafts are waiting." */
6
+ readonly title: string;
7
+ /** Words inside the title to set apart, such as "3 drafts". Its first appearance is marked. */
8
+ readonly highlight?: string;
9
+ /** One or two sentences under the title. */
10
+ readonly description?: string;
11
+ /** What to do first: one main `Button` and one or two others. */
12
+ readonly actions?: ReactNode;
13
+ /** Beside the words, from a tablet's width up: a `SiteWindow`. A phone leaves it out. */
14
+ readonly aside?: ReactNode;
15
+ }
16
+ /** The top of a screen that greets the person: what matters now in large words, what to do about it, and the site beside it. */
17
+ export declare function Welcome({ eyebrow, title, highlight, description, actions, aside }: WelcomeProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=Welcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Welcome.d.ts","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAavC,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAeD,gIAAgI;AAChI,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,YAAY,+BAc/F"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { welcomeActionsClass, welcomeAsideClass, welcomeClass, welcomeDescriptionClass, welcomeEyebrowClass, welcomeInnerClass, welcomeMarkClass, welcomeTextClass, welcomeTitleClass, } from './Welcome.variants.js';
3
+ /** The title with the highlighted words marked, where they appear in it. */
4
+ function marked(title, highlight) {
5
+ const at = highlight === undefined || highlight === '' ? -1 : title.indexOf(highlight);
6
+ if (highlight === undefined || at < 0)
7
+ return title;
8
+ return (_jsxs(_Fragment, { children: [title.slice(0, at), _jsx("mark", { className: welcomeMarkClass, children: highlight }), title.slice(at + highlight.length)] }));
9
+ }
10
+ /** The top of a screen that greets the person: what matters now in large words, what to do about it, and the site beside it. */
11
+ export function Welcome({ eyebrow, title, highlight, description, actions, aside }) {
12
+ return (_jsx("section", { className: welcomeClass, children: _jsxs("div", { className: welcomeInnerClass, children: [_jsxs("div", { className: welcomeTextClass, children: [eyebrow !== undefined && _jsx("p", { className: welcomeEyebrowClass, children: eyebrow }), _jsx("h1", { className: welcomeTitleClass, children: marked(title, highlight) }), description !== undefined && _jsx("p", { className: welcomeDescriptionClass, children: description }), actions !== undefined && _jsx("div", { className: welcomeActionsClass, children: actions })] }), aside !== undefined && _jsx("div", { className: welcomeAsideClass, children: aside })] }) }));
13
+ }
14
+ //# sourceMappingURL=Welcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Welcome.js","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAiB/B,4EAA4E;AAC5E,SAAS,MAAM,CAAC,KAAa,EAAE,SAA6B;IAC1D,MAAM,EAAE,GAAG,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvF,IAAI,SAAS,KAAK,SAAS,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,CACL,8BACG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EACnB,eAAM,SAAS,EAAE,gBAAgB,YAAG,SAAS,GAAQ,EACpD,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,IAClC,CACJ,CAAC;AACJ,CAAC;AAED,gIAAgI;AAChI,MAAM,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAgB;IAC9F,OAAO,CACL,kBAAS,SAAS,EAAE,YAAY,YAC9B,eAAK,SAAS,EAAE,iBAAiB,aAC/B,eAAK,SAAS,EAAE,gBAAgB,aAC7B,OAAO,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,mBAAmB,YAAG,OAAO,GAAK,EAC1E,aAAI,SAAS,EAAE,iBAAiB,YAAG,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAM,EAChE,WAAW,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,uBAAuB,YAAG,WAAW,GAAK,EACrF,OAAO,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,mBAAmB,YAAG,OAAO,GAAO,IAC1E,EACL,KAAK,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,iBAAiB,YAAG,KAAK,GAAO,IACpE,GACE,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const welcomeClass = "border-b border-border bg-background bg-grid";
2
+ export declare const welcomeInnerClass = "mx-auto flex max-w-7xl flex-wrap items-center gap-10 px-4 py-8 sm:px-6 md:px-12 md:py-12";
3
+ export declare const welcomeTextClass = "flex min-w-0 flex-1 basis-96 flex-col gap-4";
4
+ export declare const welcomeEyebrowClass = "text-xs font-semibold tracking-widest text-foreground-subtle uppercase";
5
+ export declare const welcomeTitleClass = "max-w-2xl font-display text-4xl font-bold tracking-tight text-balance text-foreground md:text-5xl";
6
+ /** The one phrase that matters on the screen, on the brand's colour: the only orange there. */
7
+ export declare const welcomeMarkClass = "rounded-md bg-brand-fill px-1.5 text-brand-ink box-decoration-clone";
8
+ export declare const welcomeDescriptionClass = "max-w-xl text-lg text-foreground-muted";
9
+ export declare const welcomeActionsClass = "flex flex-wrap gap-2 pt-2";
10
+ /** On a phone the words come first and alone: what stands beside them would push the screen's content far down. */
11
+ export declare const welcomeAsideClass = "hidden min-w-0 flex-1 basis-96 justify-center md:flex lg:justify-end";
12
+ //# sourceMappingURL=Welcome.variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Welcome.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.variants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAAiD,CAAC;AAC3E,eAAO,MAAM,iBAAiB,6FAA6F,CAAC;AAC5H,eAAO,MAAM,gBAAgB,gDAAgD,CAAC;AAC9E,eAAO,MAAM,mBAAmB,2EAA2E,CAAC;AAC5G,eAAO,MAAM,iBAAiB,sGAAsG,CAAC;AACrI,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,wEAAwE,CAAC;AACtG,eAAO,MAAM,uBAAuB,2CAA2C,CAAC;AAChF,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAC/D,mHAAmH;AACnH,eAAO,MAAM,iBAAiB,yEAAyE,CAAC"}
@@ -0,0 +1,12 @@
1
+ export const welcomeClass = 'border-b border-border bg-background bg-grid';
2
+ export const welcomeInnerClass = 'mx-auto flex max-w-7xl flex-wrap items-center gap-10 px-4 py-8 sm:px-6 md:px-12 md:py-12';
3
+ export const welcomeTextClass = 'flex min-w-0 flex-1 basis-96 flex-col gap-4';
4
+ export const welcomeEyebrowClass = 'text-xs font-semibold tracking-widest text-foreground-subtle uppercase';
5
+ export const welcomeTitleClass = 'max-w-2xl font-display text-4xl font-bold tracking-tight text-balance text-foreground md:text-5xl';
6
+ /** The one phrase that matters on the screen, on the brand's colour: the only orange there. */
7
+ export const welcomeMarkClass = 'rounded-md bg-brand-fill px-1.5 text-brand-ink box-decoration-clone';
8
+ export const welcomeDescriptionClass = 'max-w-xl text-lg text-foreground-muted';
9
+ export const welcomeActionsClass = 'flex flex-wrap gap-2 pt-2';
10
+ /** On a phone the words come first and alone: what stands beside them would push the screen's content far down. */
11
+ export const welcomeAsideClass = 'hidden min-w-0 flex-1 basis-96 justify-center md:flex lg:justify-end';
12
+ //# sourceMappingURL=Welcome.variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Welcome.variants.js","sourceRoot":"","sources":["../../../src/patterns/Welcome/Welcome.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,8CAA8C,CAAC;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,0FAA0F,CAAC;AAC5H,MAAM,CAAC,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,wEAAwE,CAAC;AAC5G,MAAM,CAAC,MAAM,iBAAiB,GAAG,mGAAmG,CAAC;AACrI,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG,qEAAqE,CAAC;AACtG,MAAM,CAAC,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AAC/D,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,sEAAsE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Welcome, type WelcomeProps } from './Welcome.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/Welcome/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Welcome } from './Welcome.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/Welcome/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC"}
@@ -1,5 +1,11 @@
1
- import type { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
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
+ }
3
9
  export interface WorkbenchProps extends WorkbenchVariants {
4
10
  /** Names the pane for screen readers, such as "The page". */
5
11
  readonly paneLabel: string;
@@ -11,12 +17,27 @@ export interface WorkbenchProps extends WorkbenchVariants {
11
17
  readonly bar?: ReactNode;
12
18
  /** With the whole window, whether the form is put away at the side so the pane has it all. */
13
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
+ };
14
33
  }
15
34
  /**
16
35
  * A form with what it makes shown large beside it. On a narrow screen the pane follows below.
17
- * With `view="whole"` the two take the whole window, over the editor's frame, and the form is a
18
- * panel at the side that can be put away. Going from one view to the other keeps both as they
19
- * are: nothing typed is lost and the pane is not made again.
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.
20
41
  */
21
- export declare function Workbench({ paneLabel, children, pane, bar, isFormAway, view }: WorkbenchProps): import("react").JSX.Element;
42
+ export declare function Workbench({ paneLabel, children, pane, bar, isFormAway, outline, outlineLabel, sizes, onSizesChange, resizeLabels, view, }: WorkbenchProps): import("react").JSX.Element;
22
43
  //# sourceMappingURL=Workbench.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.d.ts","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.tsx"],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AAC,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,16 +1,62 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FocusScope } from 'react-aria';
3
- import { workbenchBodyVariants, workbenchFormVariants, workbenchPaneVariants, workbenchVariants } from './Workbench.variants.js';
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
+ }
4
38
  /**
5
39
  * A form with what it makes shown large beside it. On a narrow screen the pane follows below.
6
- * With `view="whole"` the two take the whole window, over the editor's frame, and the form is a
7
- * panel at the side that can be put away. Going from one view to the other keeps both as they
8
- * are: nothing typed is lost and the pane is not made again.
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.
9
45
  */
10
- export function Workbench({ paneLabel, children, pane, bar, isFormAway = false, view = 'beside' }) {
46
+ export function Workbench({ paneLabel, children, pane, bar, isFormAway = false, outline, outlineLabel, sizes, onSizesChange, resizeLabels, view = 'beside', }) {
11
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 }) }));
12
58
  return (
13
59
  // With the whole window, the keyboard stays in it: what is behind cannot be seen.
14
- _jsx(FocusScope, { contain: isWhole, children: _jsxs("div", { className: workbenchVariants({ view }), children: [isWhole && bar, _jsxs("div", { className: workbenchBodyVariants({ view }), children: [_jsx("div", { className: workbenchFormVariants({ view, isAway: isWhole && isFormAway }), children: children }), _jsx("section", { "aria-label": paneLabel, className: workbenchPaneVariants({ view }), children: pane })] })] }) }));
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 })] })] }) }) }));
15
61
  }
16
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,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AAezJ;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,GAAG,KAAK,EAAE,IAAI,GAAG,QAAQ,EAAkB;IAC/G,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC;IACjC,OAAO;IACL,kFAAkF;IAClF,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAC1B,eAAK,SAAS,EAAE,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,aACxC,OAAO,IAAI,GAAG,EACf,eAAK,SAAS,EAAE,qBAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,aAC7C,cAAK,SAAS,EAAE,qBAAqB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,IAAI,UAAU,EAAE,CAAC,YAAG,QAAQ,GAAO,EAChG,gCAAqB,SAAS,EAAE,SAAS,EAAE,qBAAqB,CAAC,EAAE,IAAI,EAAE,CAAC,YACvE,IAAI,GACG,IACN,IACF,GACK,CACd,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Workbench.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/Workbench.tsx"],"names":[],"mappings":";AAAA,OAAO,E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ACT,EACA,OAAO,IAAI,OAAO,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,IAAI,CACjE,KAAC,MAAM,IACL,KAAK,EAAE,YAAY,CAAC,OAAO,EAC3B,KAAK,EAAC,SAAS,EACf,IAAI,EAAE,KAAK,CAAC,OAAO,EACnB,IAAI,EAAE,uBAAuB,GAAG,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EACrD,UAAU,EAAE,WAAW,GACvB,CACH,EACA,OAAO,IAAI,CAAC,UAAU,IAAI,YAAY,KAAK,SAAS,IAAI,CACvD,KAAC,MAAM,IACL,KAAK,EAAE,YAAY,CAAC,IAAI,EACxB,KAAK,EAAC,MAAM,EACZ,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,IAAI,EAAE,oBAAoB,GAAG,CAAC,EAC9B,KAAK,EAAE,CAAC,CAAC,EACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAClD,UAAU,EAAE,WAAW,GACvB,CACH,EAEA,IAAI,EACL,gCAAqB,SAAS,EAAE,SAAS,EAAE,qBAAqB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,YACnF,IAAI,GACG,IACN,IACF,GACgB,GACb,CACd,CAAC;AACJ,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
- /** Beside the form, the workbench is part of the screen. Whole, it covers the window, over the frame of the editor. */
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
+ */
3
7
  export declare const workbenchVariants: (props?: ({
4
8
  view?: "beside" | "whole" | null | undefined;
5
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -7,14 +11,44 @@ export declare const workbenchVariants: (props?: ({
7
11
  export declare const workbenchBodyVariants: (props?: ({
8
12
  view?: "beside" | "whole" | null | undefined;
9
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- /** Whole, the form is a panel at the side that scrolls by itself, and slides away to leave the pane the window. On a phone it is as wide as the window, so away it is simply gone. */
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
+ */
11
18
  export declare const workbenchFormVariants: (props?: ({
12
19
  view?: "beside" | "whole" | null | undefined;
13
20
  isAway?: boolean | null | undefined;
14
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";
15
38
  /** Beside the form, the pane stays in view while the form scrolls under the bar at the top. */
16
39
  export declare const workbenchPaneVariants: (props?: ({
17
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
+ export declare const workbenchHandleVariants: (props?: ({
50
+ place?: "form" | "outline" | null | undefined;
51
+ isActive?: boolean | null | undefined;
18
52
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
19
53
  export type WorkbenchVariants = VariantProps<typeof workbenchVariants>;
20
54
  //# 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,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,uHAAuH;AACvH,eAAO,MAAM,iBAAiB;;8EAQ5B,CAAC;AAEH,uHAAuH;AACvH,eAAO,MAAM,qBAAqB;;8EAQhC,CAAC;AAEH,sLAAsL;AACtL,eAAO,MAAM,qBAAqB;;;8EAUhC,CAAC;AAEH,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB;;8EAQhC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,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,eAAO,MAAM,uBAAuB;;;8EASnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import { cva } from 'class-variance-authority';
2
- /** Beside the form, the workbench is part of the screen. Whole, it covers the window, over the frame of the editor. */
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
+ */
3
7
  export const workbenchVariants = cva('', {
4
8
  variants: {
5
9
  view: {
6
10
  beside: 'w-full',
7
- whole: 'fixed inset-0 layer-overlay flex flex-col bg-background-secondary',
11
+ whole: 'dark fixed inset-0 layer-overlay flex flex-col bg-background-secondary text-foreground',
8
12
  },
9
13
  },
10
14
  defaultVariants: { view: 'beside' },
@@ -19,26 +23,84 @@ export const workbenchBodyVariants = cva('flex', {
19
23
  },
20
24
  defaultVariants: { view: 'beside' },
21
25
  });
22
- /** Whole, the form is a panel at the side that scrolls by itself, and slides away to leave the pane the window. On a phone it is as wide as the window, so away it is simply gone. */
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
+ */
23
30
  export const workbenchFormVariants = cva('flex min-w-0 flex-col gap-6', {
24
31
  variants: {
25
32
  view: {
26
33
  beside: 'xl:w-lg xl:shrink-0',
27
- whole: 'w-lg max-w-full shrink-0 overflow-auto border-r border-border bg-background p-4 transition-all motion-slide',
34
+ whole: 'order-last max-w-full shrink-0 overflow-auto border-l border-border bg-card p-4',
28
35
  },
29
36
  isAway: { true: '', false: '' },
30
37
  },
31
- compoundVariants: [{ view: 'whole', isAway: true, class: 'invisible max-md:hidden md:-ml-128' }],
38
+ compoundVariants: [{ view: 'whole', isAway: true, class: 'hidden' }],
32
39
  defaultVariants: { view: 'beside', isAway: false },
33
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';
34
81
  /** Beside the form, the pane stays in view while the form scrolls under the bar at the top. */
35
82
  export const workbenchPaneVariants = cva('min-w-0', {
36
83
  variants: {
37
84
  view: {
38
- beside: 'pane-tall xl:sticky xl:top-24 xl:flex-1',
39
- whole: 'min-h-0 flex-1',
85
+ beside: 'pane-tall xl:sticky xl:top-8 xl:flex-1',
86
+ whole: 'min-h-0 flex-1 p-3',
40
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: '' },
41
90
  },
42
- defaultVariants: { view: 'beside' },
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
+ export const workbenchHandleVariants = cva('relative z-10 w-1 shrink-0 cursor-col-resize touch-none bg-border transition-colors motion-fast outline-none hover:bg-border-strong', {
100
+ variants: {
101
+ place: { outline: 'hidden lg:block', form: 'order-last max-md:hidden' },
102
+ isActive: { true: 'bg-brand-fill hover:bg-brand-fill', false: '' },
103
+ },
104
+ defaultVariants: { place: 'outline', isActive: false },
43
105
  });
44
106
  //# sourceMappingURL=Workbench.variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Workbench.variants.js","sourceRoot":"","sources":["../../../src/patterns/Workbench/Work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E,UAAU,EAAE,KAAK,EAAE;CACvD,CAAC,CAAC;AAEH,4GAA4G;AAC5G,MAAM,CAAC,MAAM,qBAAqB,GAAG,mFAAmF,CAAC;AAEzH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CACxC,qIAAqI,EACrI;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"}