@orbitcommerce/constellation-docs 0.0.0-stage → 1.0.0

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 (62) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +6 -2
  3. package/dist/docs.css +8260 -0
  4. package/dist/index.d.ts +33 -0
  5. package/dist/index.js +308 -0
  6. package/dist/pages/Playground-CNbBbErC.js +129 -0
  7. package/dist/pages/_figures-data-BDmScEny.js +606 -0
  8. package/dist/pages/_foundations-blXWyYh8.js +30 -0
  9. package/dist/pages/_overlays-specimens-Dpn6oiyH.js +310 -0
  10. package/dist/pages/alert-BD4e6QTh.js +769 -0
  11. package/dist/pages/app-shell-KbA-nRqZ.js +1479 -0
  12. package/dist/pages/area-chart-B91dLcGo.js +562 -0
  13. package/dist/pages/avatar-DPPHXJAu.js +713 -0
  14. package/dist/pages/badge-C9JR0thI.js +729 -0
  15. package/dist/pages/button-D3V912P4.js +518 -0
  16. package/dist/pages/calendar-DSDZ9nRH.js +630 -0
  17. package/dist/pages/card-DUggbis3.js +659 -0
  18. package/dist/pages/checkbox-DwimQaK3.js +365 -0
  19. package/dist/pages/colour-BwuO8xAv.js +1498 -0
  20. package/dist/pages/command-palette-xAD7fOg6.js +1243 -0
  21. package/dist/pages/date-picker-BYSa816m.js +1421 -0
  22. package/dist/pages/delta-CtAo0eIM.js +574 -0
  23. package/dist/pages/dialog-BRAf4LMh.js +1451 -0
  24. package/dist/pages/docs-BNOb7AqR.js +515 -0
  25. package/dist/pages/empty-state-C-mLrXW2.js +417 -0
  26. package/dist/pages/figure-tabs-CoPFzzKz.js +460 -0
  27. package/dist/pages/home-dashboard-CFQwDtC9.js +959 -0
  28. package/dist/pages/host-B6znjEgQ.js +109 -0
  29. package/dist/pages/icon-button-C9eSVPPW.js +861 -0
  30. package/dist/pages/icons-sxkTs5Ob.js +473 -0
  31. package/dist/pages/input-KF9Gkawf.js +1093 -0
  32. package/dist/pages/installation-DpsX8G_n.js +445 -0
  33. package/dist/pages/kbd-cNfDoikz.js +544 -0
  34. package/dist/pages/live-globe-ClvLn9Lb.js +571 -0
  35. package/dist/pages/logo-BfGF1Pq9.js +571 -0
  36. package/dist/pages/menu-by2sgQ09.js +1618 -0
  37. package/dist/pages/motion-BvTGc2Dk.js +855 -0
  38. package/dist/pages/orbit-spinner-Dil1Z3Oy.js +332 -0
  39. package/dist/pages/overview-BPEbZQ6g.js +130 -0
  40. package/dist/pages/pagination-BBUnGvv5.js +249 -0
  41. package/dist/pages/popover-Db1gLDpb.js +1136 -0
  42. package/dist/pages/principles-CeAIOIdt.js +483 -0
  43. package/dist/pages/radio-group-CkdBWWfG.js +1077 -0
  44. package/dist/pages/registry-CroHzK9I.js +244 -0
  45. package/dist/pages/release-Dvo684UJ.js +13 -0
  46. package/dist/pages/rolling-number-qmvH84Mq.js +529 -0
  47. package/dist/pages/search-field-BN7MWGQ4.js +693 -0
  48. package/dist/pages/segmented-control-CTbIpRBW.js +777 -0
  49. package/dist/pages/select-DguELoRR.js +1429 -0
  50. package/dist/pages/separator-CPZub9pv.js +351 -0
  51. package/dist/pages/shape-DKvA0YKr.js +627 -0
  52. package/dist/pages/skeleton-DLuBhP46.js +561 -0
  53. package/dist/pages/sparkline-DMMYGbHn.js +668 -0
  54. package/dist/pages/switch-B-Qe4kcT.js +517 -0
  55. package/dist/pages/table-AMoODng4.js +607 -0
  56. package/dist/pages/tabs-B4M-usCV.js +1455 -0
  57. package/dist/pages/textarea-fTuUZRQb.js +693 -0
  58. package/dist/pages/toast-CKP03zjy.js +1176 -0
  59. package/dist/pages/tooltip-CBYil3kt.js +697 -0
  60. package/dist/pages/typography-PCbg8Bhg.js +735 -0
  61. package/manifest.json +3125 -0
  62. package/package.json +35 -4
@@ -0,0 +1,351 @@
1
+ "use client";
2
+ import { d as Section, i as DocPage, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-BNOb7AqR.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Button, IconButton, Separator } from "@orbitcommerce/constellation";
5
+ import { ArchiveIcon, DownloadSimpleIcon, LinkSimpleIcon, ListBulletsIcon, PrinterIcon, TextBIcon, TextItalicIcon, TextUnderlineIcon, TruckIcon } from "@orbitcommerce/constellation/icons";
6
+ //#region src/pages/components/separator.tsx
7
+ var inset = { margin: "6px 4px" };
8
+ function Preview() {
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "separator-preview",
11
+ children: [/* @__PURE__ */ jsxs("div", {
12
+ className: "separator-toolbar",
13
+ children: [
14
+ /* @__PURE__ */ jsx(IconButton, {
15
+ label: "Print packing slip",
16
+ size: "sm",
17
+ children: /* @__PURE__ */ jsx(PrinterIcon, {})
18
+ }),
19
+ /* @__PURE__ */ jsx(IconButton, {
20
+ label: "Export",
21
+ size: "sm",
22
+ children: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
23
+ }),
24
+ /* @__PURE__ */ jsx(Separator, {
25
+ orientation: "vertical",
26
+ style: inset
27
+ }),
28
+ /* @__PURE__ */ jsx(IconButton, {
29
+ label: "Mark as fulfilled",
30
+ size: "sm",
31
+ children: /* @__PURE__ */ jsx(TruckIcon, {})
32
+ }),
33
+ /* @__PURE__ */ jsx(IconButton, {
34
+ label: "Archive",
35
+ size: "sm",
36
+ children: /* @__PURE__ */ jsx(ArchiveIcon, {})
37
+ })
38
+ ]
39
+ }), /* @__PURE__ */ jsx(OrderSummary, { compact: true })]
40
+ });
41
+ }
42
+ function OrderSummary({ compact = false }) {
43
+ return /* @__PURE__ */ jsxs("div", {
44
+ className: "separator-summary",
45
+ children: [
46
+ /* @__PURE__ */ jsxs("div", {
47
+ className: "separator-summary__row",
48
+ children: [/* @__PURE__ */ jsx("span", { children: "Subtotal" }), /* @__PURE__ */ jsx("span", { children: "£349.00" })]
49
+ }),
50
+ compact ? null : /* @__PURE__ */ jsxs("div", {
51
+ className: "separator-summary__row",
52
+ children: [/* @__PURE__ */ jsx("span", { children: "Delivery" }), /* @__PURE__ */ jsx("span", { children: "£12.00" })]
53
+ }),
54
+ /* @__PURE__ */ jsx(Separator, {}),
55
+ /* @__PURE__ */ jsxs("div", {
56
+ className: "separator-summary__row",
57
+ "data-total": "",
58
+ children: [/* @__PURE__ */ jsx("span", { children: "Total" }), /* @__PURE__ */ jsx("span", { children: "£361.00" })]
59
+ }),
60
+ compact ? null : /* @__PURE__ */ jsx("span", {
61
+ className: "separator-summary__note",
62
+ children: "Including £60.17 VAT"
63
+ })
64
+ ]
65
+ });
66
+ }
67
+ function OrderToolbar({ semantic = false }) {
68
+ return /* @__PURE__ */ jsxs("div", {
69
+ className: "separator-toolbar",
70
+ role: semantic ? "group" : void 0,
71
+ "aria-label": semantic ? "Order actions" : void 0,
72
+ children: [
73
+ /* @__PURE__ */ jsx(Button, {
74
+ size: "sm",
75
+ variant: "ghost",
76
+ icon: /* @__PURE__ */ jsx(PrinterIcon, {}),
77
+ children: "Print"
78
+ }),
79
+ /* @__PURE__ */ jsx(Button, {
80
+ size: "sm",
81
+ variant: "ghost",
82
+ icon: /* @__PURE__ */ jsx(DownloadSimpleIcon, {}),
83
+ children: "Export"
84
+ }),
85
+ /* @__PURE__ */ jsx(Separator, {
86
+ orientation: "vertical",
87
+ decorative: !semantic,
88
+ style: inset
89
+ }),
90
+ /* @__PURE__ */ jsx(Button, {
91
+ size: "sm",
92
+ variant: "ghost",
93
+ icon: /* @__PURE__ */ jsx(TruckIcon, {}),
94
+ children: "Mark as fulfilled"
95
+ }),
96
+ /* @__PURE__ */ jsx(Separator, {
97
+ orientation: "vertical",
98
+ decorative: !semantic,
99
+ style: inset
100
+ }),
101
+ /* @__PURE__ */ jsx(Button, {
102
+ size: "sm",
103
+ variant: "ghost",
104
+ icon: /* @__PURE__ */ jsx(ArchiveIcon, {}),
105
+ children: "Archive"
106
+ })
107
+ ]
108
+ });
109
+ }
110
+ function Page() {
111
+ return /* @__PURE__ */ jsxs(DocPage, {
112
+ title: "Separator",
113
+ status: "stable",
114
+ importNames: ["Separator"],
115
+ lead: "A hairline between groups of content: across a panel, or down a toolbar. Reach for it when space alone does not make the break clear enough.",
116
+ children: [
117
+ /* @__PURE__ */ jsx(Section, {
118
+ id: "horizontal",
119
+ title: "Horizontal",
120
+ description: /* @__PURE__ */ jsx("p", { children: "The default. A 1px hairline across the full width of its container, in the faintest border colour. Space around it comes from the layout, not the line." }),
121
+ children: /* @__PURE__ */ jsx(Example, {
122
+ align: "fill",
123
+ code: `
124
+ <div className="row"><span>Subtotal</span><span>£349.00</span></div>
125
+ <div className="row"><span>Delivery</span><span>£12.00</span></div>
126
+ <Separator />
127
+ <div className="row total"><span>Total</span><span>£361.00</span></div>
128
+ <span className="note">Including £60.17 VAT</span>`,
129
+ children: /* @__PURE__ */ jsx(OrderSummary, {})
130
+ })
131
+ }),
132
+ /* @__PURE__ */ jsx(Section, {
133
+ id: "vertical",
134
+ title: "Vertical",
135
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "orientation=\"vertical\"" }), " draws a 1px line that stretches to the height of its row, so it needs a flex or grid row to stand in. Inset it with a margin so it stops short of the bar's edges."] }),
136
+ children: /* @__PURE__ */ jsx(Example, {
137
+ code: `
138
+ <Button size="sm" variant="ghost" icon={<PrinterIcon />}>Print</Button>
139
+ <Button size="sm" variant="ghost" icon={<DownloadSimpleIcon />}>Export</Button>
140
+ <Separator orientation="vertical" style={{ margin: '6px 4px' }} />
141
+ <Button size="sm" variant="ghost" icon={<TruckIcon />}>Mark as fulfilled</Button>
142
+ <Separator orientation="vertical" style={{ margin: '6px 4px' }} />
143
+ <Button size="sm" variant="ghost" icon={<ArchiveIcon />}>Archive</Button>`,
144
+ children: /* @__PURE__ */ jsx(OrderToolbar, {})
145
+ })
146
+ }),
147
+ /* @__PURE__ */ jsxs(Section, {
148
+ id: "decorative-or-semantic",
149
+ title: "Decorative or semantic",
150
+ description: /* @__PURE__ */ jsxs("p", { children: [
151
+ "By default a separator is decorative: it is drawn but hidden from assistive tech, because the groups around it are usually clear from headings, lists or labels. Set ",
152
+ /* @__PURE__ */ jsxs("code", { children: ["decorative=", "{false}"] }),
153
+ " when the line itself marks where one group ends, such as between groups of buttons in a toolbar. It is then announced as a separator, with its orientation when vertical. Both look the same: only what assistive tech hears changes."
154
+ ] }),
155
+ children: [/* @__PURE__ */ jsx(Example, {
156
+ code: `
157
+ <div role="group" aria-label="Order actions">
158
+ <Button size="sm" variant="ghost" icon={<PrinterIcon />}>Print</Button>
159
+ <Button size="sm" variant="ghost" icon={<DownloadSimpleIcon />}>Export</Button>
160
+ <Separator orientation="vertical" decorative={false} style={{ margin: '6px 4px' }} />
161
+ <Button size="sm" variant="ghost" icon={<TruckIcon />}>Mark as fulfilled</Button>
162
+ <Separator orientation="vertical" decorative={false} style={{ margin: '6px 4px' }} />
163
+ <Button size="sm" variant="ghost" icon={<ArchiveIcon />}>Archive</Button>
164
+ </div>`,
165
+ children: /* @__PURE__ */ jsx(OrderToolbar, { semantic: true })
166
+ }), /* @__PURE__ */ jsx(SubSection, {
167
+ title: "Which to use",
168
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [/* @__PURE__ */ jsxs(Fragment, { children: [
169
+ "Decorative (the default) when the line only tidies the layout: rows in a list, a total under its lines. It renders with ",
170
+ /* @__PURE__ */ jsx("code", { children: "role=\"none\"" }),
171
+ "."
172
+ ] }), /* @__PURE__ */ jsxs(Fragment, { children: [
173
+ "Semantic when the line is structure a screen reader user needs: groups in a toolbar, sections of a list without headings. It renders with ",
174
+ /* @__PURE__ */ jsx("code", { children: "role=\"separator\"" }),
175
+ ", and",
176
+ " ",
177
+ /* @__PURE__ */ jsx("code", { children: "aria-orientation=\"vertical\"" }),
178
+ " when vertical."
179
+ ] })] })
180
+ })]
181
+ }),
182
+ /* @__PURE__ */ jsx(Section, {
183
+ id: "both-themes",
184
+ title: "In both themes",
185
+ description: /* @__PURE__ */ jsx("p", { children: "Both orientations, light and dark side by side." }),
186
+ children: /* @__PURE__ */ jsx(ThemePair, {
187
+ align: "fill",
188
+ children: /* @__PURE__ */ jsxs("div", {
189
+ className: "separator-pair",
190
+ children: [/* @__PURE__ */ jsxs("div", {
191
+ className: "separator-toolbar",
192
+ children: [
193
+ /* @__PURE__ */ jsx(IconButton, {
194
+ label: "Bold",
195
+ size: "sm",
196
+ children: /* @__PURE__ */ jsx(TextBIcon, {})
197
+ }),
198
+ /* @__PURE__ */ jsx(IconButton, {
199
+ label: "Italic",
200
+ size: "sm",
201
+ children: /* @__PURE__ */ jsx(TextItalicIcon, {})
202
+ }),
203
+ /* @__PURE__ */ jsx(IconButton, {
204
+ label: "Underline",
205
+ size: "sm",
206
+ children: /* @__PURE__ */ jsx(TextUnderlineIcon, {})
207
+ }),
208
+ /* @__PURE__ */ jsx(Separator, {
209
+ orientation: "vertical",
210
+ style: inset
211
+ }),
212
+ /* @__PURE__ */ jsx(IconButton, {
213
+ label: "Bulleted list",
214
+ size: "sm",
215
+ children: /* @__PURE__ */ jsx(ListBulletsIcon, {})
216
+ }),
217
+ /* @__PURE__ */ jsx(IconButton, {
218
+ label: "Link",
219
+ size: "sm",
220
+ children: /* @__PURE__ */ jsx(LinkSimpleIcon, {})
221
+ })
222
+ ]
223
+ }), /* @__PURE__ */ jsx(OrderSummary, {})]
224
+ })
225
+ })
226
+ }),
227
+ /* @__PURE__ */ jsxs(Section, {
228
+ id: "guidelines",
229
+ title: "Guidelines",
230
+ description: /* @__PURE__ */ jsx("p", { children: "The kit groups with space and weight first, a hairline second, and a box last. A separator is the second step." }),
231
+ children: [/* @__PURE__ */ jsx(DoDont, {
232
+ do: {
233
+ children: /* @__PURE__ */ jsxs("div", {
234
+ className: "separator-toolbar",
235
+ children: [
236
+ /* @__PURE__ */ jsx(IconButton, {
237
+ label: "Bold",
238
+ size: "sm",
239
+ children: /* @__PURE__ */ jsx(TextBIcon, {})
240
+ }),
241
+ /* @__PURE__ */ jsx(IconButton, {
242
+ label: "Italic",
243
+ size: "sm",
244
+ children: /* @__PURE__ */ jsx(TextItalicIcon, {})
245
+ }),
246
+ /* @__PURE__ */ jsx(Separator, {
247
+ orientation: "vertical",
248
+ style: inset
249
+ }),
250
+ /* @__PURE__ */ jsx(IconButton, {
251
+ label: "Bulleted list",
252
+ size: "sm",
253
+ children: /* @__PURE__ */ jsx(ListBulletsIcon, {})
254
+ }),
255
+ /* @__PURE__ */ jsx(IconButton, {
256
+ label: "Link",
257
+ size: "sm",
258
+ children: /* @__PURE__ */ jsx(LinkSimpleIcon, {})
259
+ })
260
+ ]
261
+ }),
262
+ caption: "One line between groups of related buttons."
263
+ },
264
+ dont: {
265
+ children: /* @__PURE__ */ jsxs("div", {
266
+ className: "separator-toolbar",
267
+ children: [
268
+ /* @__PURE__ */ jsx(IconButton, {
269
+ label: "Bold",
270
+ size: "sm",
271
+ children: /* @__PURE__ */ jsx(TextBIcon, {})
272
+ }),
273
+ /* @__PURE__ */ jsx(Separator, {
274
+ orientation: "vertical",
275
+ style: inset
276
+ }),
277
+ /* @__PURE__ */ jsx(IconButton, {
278
+ label: "Italic",
279
+ size: "sm",
280
+ children: /* @__PURE__ */ jsx(TextItalicIcon, {})
281
+ }),
282
+ /* @__PURE__ */ jsx(Separator, {
283
+ orientation: "vertical",
284
+ style: inset
285
+ }),
286
+ /* @__PURE__ */ jsx(IconButton, {
287
+ label: "Bulleted list",
288
+ size: "sm",
289
+ children: /* @__PURE__ */ jsx(ListBulletsIcon, {})
290
+ }),
291
+ /* @__PURE__ */ jsx(Separator, {
292
+ orientation: "vertical",
293
+ style: inset
294
+ }),
295
+ /* @__PURE__ */ jsx(IconButton, {
296
+ label: "Link",
297
+ size: "sm",
298
+ children: /* @__PURE__ */ jsx(LinkSimpleIcon, {})
299
+ })
300
+ ]
301
+ }),
302
+ caption: "A line between every button separates nothing. The groups disappear."
303
+ }
304
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
305
+ "Try space first. A larger gap often separates groups better than a line.",
306
+ "Separate groups, not items: one line between groups, never one between each thing.",
307
+ "Card footers and menus draw their own hairlines (menus have MenuSeparator). Do not add another beside them.",
308
+ "Never stack a separator against a border: two lines read as a mistake."
309
+ ] })]
310
+ }),
311
+ /* @__PURE__ */ jsx(Section, {
312
+ id: "accessibility",
313
+ title: "Accessibility",
314
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
315
+ /* @__PURE__ */ jsxs(Fragment, { children: [
316
+ "Decorative separators render ",
317
+ /* @__PURE__ */ jsx("code", { children: "role=\"none\"" }),
318
+ ", so screen readers skip them."
319
+ ] }),
320
+ /* @__PURE__ */ jsxs(Fragment, { children: [
321
+ "With ",
322
+ /* @__PURE__ */ jsxs("code", { children: ["decorative=", "{false}"] }),
323
+ " the separator is announced, and a vertical one says so with",
324
+ " ",
325
+ /* @__PURE__ */ jsx("code", { children: "aria-orientation" }),
326
+ ". It is not focusable: it marks structure and cannot be dragged."
327
+ ] }),
328
+ "The hairline is deliberately faint. Keep space around it too, so the break still shows for someone who cannot make out the line."
329
+ ] })
330
+ }),
331
+ /* @__PURE__ */ jsx(Section, {
332
+ id: "props",
333
+ title: "Props",
334
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native div attribute." }),
335
+ children: /* @__PURE__ */ jsx(PropsTable, { rows: [{
336
+ name: "orientation",
337
+ type: "'horizontal' | 'vertical'",
338
+ default: "'horizontal'",
339
+ description: "Across the full width, or down the full height of its row."
340
+ }, {
341
+ name: "decorative",
342
+ type: "boolean",
343
+ default: "true",
344
+ description: "Hidden from assistive tech. Set false when it divides content into meaningful groups."
345
+ }] })
346
+ })
347
+ ]
348
+ });
349
+ }
350
+ //#endregion
351
+ export { Page, Preview };