@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,310 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconButton, Kbd, cx } from "@orbitcommerce/constellation";
4
+ //#region src/pages/components/_overlays-specimens.tsx
5
+ /** Makes a still inert and invisible to assistive tech. */
6
+ function SpecimenFrame({ children, className, style }) {
7
+ return /* @__PURE__ */ jsx("div", {
8
+ className: cx("overlays-specimen", className),
9
+ style,
10
+ inert: true,
11
+ "aria-hidden": "true",
12
+ children
13
+ });
14
+ }
15
+ function MenuSheet({ width, sub, children, style }) {
16
+ const sized = width ? {
17
+ "--o-menu-w": `${width}px`,
18
+ "--o-menu-min-w": `${width}px`
19
+ } : void 0;
20
+ return /* @__PURE__ */ jsx("div", {
21
+ className: "o-menu",
22
+ "data-sub": sub ? "" : void 0,
23
+ style: {
24
+ ...sized,
25
+ ...style
26
+ },
27
+ children
28
+ });
29
+ }
30
+ function MenuRow({ icon, hint, shortcut, tone, highlighted, kind, checked, submenu, open, children }) {
31
+ const indicatorState = checked ? "checked" : "unchecked";
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ className: "o-menu__item",
34
+ "data-tone": tone,
35
+ "data-kind": kind,
36
+ "data-highlighted": highlighted ? "" : void 0,
37
+ "aria-haspopup": submenu ? "menu" : void 0,
38
+ "data-state": submenu ? open ? "open" : "closed" : kind ? indicatorState : void 0,
39
+ children: [
40
+ icon ? /* @__PURE__ */ jsx("span", {
41
+ className: "o-menu__icon",
42
+ children: icon
43
+ }) : null,
44
+ /* @__PURE__ */ jsx("span", {
45
+ className: "o-menu__label",
46
+ children
47
+ }),
48
+ hint != null || shortcut?.length ? /* @__PURE__ */ jsxs("span", {
49
+ className: "o-menu__end",
50
+ children: [hint != null ? /* @__PURE__ */ jsx("span", {
51
+ className: "o-menu__hint",
52
+ children: hint
53
+ }) : null, shortcut?.length ? /* @__PURE__ */ jsx(Kbd, { keys: shortcut }) : null]
54
+ }) : null,
55
+ submenu ? /* @__PURE__ */ jsx("svg", {
56
+ className: "o-menu__chevron",
57
+ viewBox: "0 0 16 16",
58
+ children: /* @__PURE__ */ jsx("path", { d: "M6.25 4l4 4-4 4" })
59
+ }) : null,
60
+ kind === "checkbox" ? /* @__PURE__ */ jsx("span", {
61
+ className: "o-menu__indicator",
62
+ "data-state": indicatorState,
63
+ children: /* @__PURE__ */ jsx("svg", {
64
+ viewBox: "0 0 16 16",
65
+ children: /* @__PURE__ */ jsx("path", {
66
+ className: "o-menu__check",
67
+ pathLength: 1,
68
+ d: "M3.6 8.4l2.9 2.9 5.9-6.6"
69
+ })
70
+ })
71
+ }) : null,
72
+ kind === "radio" ? /* @__PURE__ */ jsx("span", {
73
+ className: "o-menu__indicator",
74
+ "data-state": indicatorState,
75
+ children: /* @__PURE__ */ jsxs("svg", {
76
+ viewBox: "0 0 16 16",
77
+ children: [/* @__PURE__ */ jsx("circle", {
78
+ className: "o-menu__radio-ring",
79
+ cx: "8",
80
+ cy: "8",
81
+ r: "5.6"
82
+ }), /* @__PURE__ */ jsx("circle", {
83
+ className: "o-menu__radio-dot",
84
+ cx: "8",
85
+ cy: "8",
86
+ r: "2.9"
87
+ })]
88
+ })
89
+ }) : null
90
+ ]
91
+ });
92
+ }
93
+ function MenuHeading({ children }) {
94
+ return /* @__PURE__ */ jsx("div", {
95
+ className: "o-menu__heading",
96
+ children
97
+ });
98
+ }
99
+ function MenuRule() {
100
+ return /* @__PURE__ */ jsx("div", { className: "o-menu__separator" });
101
+ }
102
+ function PopoverSheet({ padding = "md", width, children, style }) {
103
+ return /* @__PURE__ */ jsx("div", {
104
+ className: "o-popover",
105
+ "data-padding": padding,
106
+ style: {
107
+ width,
108
+ ...style
109
+ },
110
+ children
111
+ });
112
+ }
113
+ function TooltipPill({ children, shortcut, side = "top", style }) {
114
+ const hasShortcut = !!shortcut?.length;
115
+ return /* @__PURE__ */ jsxs("div", {
116
+ className: "o-tooltip",
117
+ "data-side": side,
118
+ "data-shortcut": hasShortcut ? "" : void 0,
119
+ style,
120
+ children: [/* @__PURE__ */ jsx("span", {
121
+ className: "o-tooltip__text",
122
+ children
123
+ }), hasShortcut ? /* @__PURE__ */ jsx(Kbd, {
124
+ keys: shortcut,
125
+ className: "o-tooltip__keys"
126
+ }) : null]
127
+ });
128
+ }
129
+ /** The dialog sheet, taken out of its fixed, centred position so it can sit on a stage. */
130
+ function DialogSheet({ size = "md", close = false, width, style, children }) {
131
+ return /* @__PURE__ */ jsxs("div", {
132
+ className: "o-dialog",
133
+ "data-size": size,
134
+ "data-close": close ? "" : void 0,
135
+ style: {
136
+ position: "relative",
137
+ inset: "auto",
138
+ zIndex: "auto",
139
+ margin: 0,
140
+ maxHeight: "none",
141
+ ...width !== void 0 ? {
142
+ width,
143
+ maxWidth: "100%"
144
+ } : { maxWidth: "100%" },
145
+ ...style
146
+ },
147
+ children: [children, close ? /* @__PURE__ */ jsx(IconButton, {
148
+ label: "Close",
149
+ size: "sm",
150
+ className: "o-dialog__close",
151
+ tabIndex: -1,
152
+ children: /* @__PURE__ */ jsx("svg", {
153
+ viewBox: "0 0 16 16",
154
+ fill: "none",
155
+ stroke: "currentColor",
156
+ strokeWidth: 1.6,
157
+ strokeLinecap: "round",
158
+ children: /* @__PURE__ */ jsx("path", { d: "M4.75 4.75l6.5 6.5M11.25 4.75l-6.5 6.5" })
159
+ })
160
+ }) : null]
161
+ });
162
+ }
163
+ /** The palette's magnifier (SearchGlyph in SearchTrigger.tsx, which is internal). */
164
+ function SearchGlyphStill() {
165
+ return /* @__PURE__ */ jsxs("svg", {
166
+ viewBox: "0 0 16 16",
167
+ fill: "none",
168
+ stroke: "currentColor",
169
+ strokeWidth: 1.55,
170
+ strokeLinecap: "round",
171
+ children: [/* @__PURE__ */ jsx("circle", {
172
+ cx: "7.1",
173
+ cy: "7.1",
174
+ r: "4.85"
175
+ }), /* @__PURE__ */ jsx("path", { d: "m10.7 10.7 3.1 3.1" })]
176
+ });
177
+ }
178
+ /** The open palette, taken out of its fixed position so it can sit on a stage. */
179
+ function PaletteStill({ query, placeholder = "Search orders, products, customers", groups, loading, footer = true, style }) {
180
+ return /* @__PURE__ */ jsxs("div", {
181
+ className: "o-command",
182
+ "data-mode": "fade",
183
+ "data-phase": "open",
184
+ style: {
185
+ position: "relative",
186
+ top: "auto",
187
+ left: "auto",
188
+ right: "auto",
189
+ zIndex: "auto",
190
+ width: "100%",
191
+ maxWidth: 640,
192
+ ...style
193
+ },
194
+ children: [/* @__PURE__ */ jsx("span", { className: "o-command__shadow" }), /* @__PURE__ */ jsx("div", {
195
+ className: "o-command__panel",
196
+ "data-loading": loading ? "" : void 0,
197
+ children: /* @__PURE__ */ jsxs("div", {
198
+ className: "o-command__root",
199
+ children: [
200
+ /* @__PURE__ */ jsxs("div", {
201
+ className: "o-command__input-row",
202
+ children: [
203
+ /* @__PURE__ */ jsx("span", {
204
+ className: "o-command__input-icon",
205
+ children: /* @__PURE__ */ jsx(SearchGlyphStill, {})
206
+ }),
207
+ /* @__PURE__ */ jsx("span", {
208
+ className: "o-command__input",
209
+ style: {
210
+ display: "flex",
211
+ alignItems: "center",
212
+ color: query ? void 0 : "var(--o-fg-3)"
213
+ },
214
+ children: query || placeholder
215
+ }),
216
+ /* @__PURE__ */ jsx("span", {
217
+ className: "o-command-key o-command__esc",
218
+ children: "Esc"
219
+ }),
220
+ /* @__PURE__ */ jsx("span", {
221
+ className: "o-command__track",
222
+ children: /* @__PURE__ */ jsx("span", { className: "o-command__comet" })
223
+ })
224
+ ]
225
+ }),
226
+ /* @__PURE__ */ jsx("div", {
227
+ className: "o-command__list",
228
+ style: { height: "auto" },
229
+ children: /* @__PURE__ */ jsx("div", {
230
+ "cmdk-list-sizer": "",
231
+ children: groups.map((group, g) => /* @__PURE__ */ jsxs("div", {
232
+ className: "o-command__group",
233
+ children: [group.heading ? /* @__PURE__ */ jsx("div", {
234
+ "cmdk-group-heading": "",
235
+ children: group.heading
236
+ }) : null, /* @__PURE__ */ jsx("div", {
237
+ "cmdk-group-items": "",
238
+ children: group.items.map((item, i) => /* @__PURE__ */ jsxs("div", {
239
+ className: "o-command__item",
240
+ "data-selected": item.selected ? "true" : void 0,
241
+ children: [
242
+ item.selected ? /* @__PURE__ */ jsx("span", { className: "o-command__mark" }) : null,
243
+ /* @__PURE__ */ jsx("span", {
244
+ className: "o-command__item-icon",
245
+ children: item.icon
246
+ }),
247
+ /* @__PURE__ */ jsx("span", {
248
+ className: "o-command__item-label",
249
+ children: item.label
250
+ }),
251
+ item.hint ? /* @__PURE__ */ jsx("span", {
252
+ className: "o-command__item-hint",
253
+ children: item.hint
254
+ }) : null,
255
+ item.shortcut?.length ? /* @__PURE__ */ jsx("span", {
256
+ className: "o-command__item-keys",
257
+ children: item.shortcut.map((key) => /* @__PURE__ */ jsx("kbd", {
258
+ className: "o-command-key",
259
+ children: key
260
+ }, key))
261
+ }) : null
262
+ ]
263
+ }, i))
264
+ })]
265
+ }, group.heading ?? g))
266
+ })
267
+ }),
268
+ footer ? /* @__PURE__ */ jsx("div", {
269
+ className: "o-command__footer",
270
+ "data-default": footer === true ? "" : void 0,
271
+ children: footer === true ? /* @__PURE__ */ jsxs("span", {
272
+ className: "o-command__hints",
273
+ children: [
274
+ /* @__PURE__ */ jsxs("span", {
275
+ className: "o-command__hint",
276
+ children: [/* @__PURE__ */ jsxs("span", {
277
+ className: "o-command__hint-keys",
278
+ children: [/* @__PURE__ */ jsx("kbd", {
279
+ className: "o-command-key",
280
+ children: "↑"
281
+ }), /* @__PURE__ */ jsx("kbd", {
282
+ className: "o-command-key",
283
+ children: "↓"
284
+ })]
285
+ }), "to move"]
286
+ }),
287
+ /* @__PURE__ */ jsxs("span", {
288
+ className: "o-command__hint",
289
+ children: [/* @__PURE__ */ jsx("kbd", {
290
+ className: "o-command-key",
291
+ children: "↵"
292
+ }), "to open"]
293
+ }),
294
+ /* @__PURE__ */ jsxs("span", {
295
+ className: "o-command__hint",
296
+ children: [/* @__PURE__ */ jsx("kbd", {
297
+ className: "o-command-key",
298
+ children: "esc"
299
+ }), "to close"]
300
+ })
301
+ ]
302
+ }) : footer
303
+ }) : null
304
+ ]
305
+ })
306
+ })]
307
+ });
308
+ }
309
+ //#endregion
310
+ export { MenuSheet as a, SpecimenFrame as c, MenuRule as i, TooltipPill as l, MenuHeading as n, PaletteStill as o, MenuRow as r, PopoverSheet as s, DialogSheet as t };