@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,483 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section, i as DocPage, m as ThemePair, o as Example, r as DoDont } from "./docs-BNOb7AqR.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Badge, Button, Delta, EmptyState, Input, LiveGlobe, RollingNumber, SegmentedControl, Sparkline, Switch } from "@orbitcommerce/constellation";
7
+ import { PlusIcon } from "@orbitcommerce/constellation/icons";
8
+ //#region src/pages/start/principles.tsx
9
+ var GBP = {
10
+ style: "currency",
11
+ currency: "GBP"
12
+ };
13
+ var VISITORS = [
14
+ {
15
+ lat: 51.5074,
16
+ lng: -.1278,
17
+ live: true,
18
+ label: "London",
19
+ count: 3,
20
+ countryCode: "GB"
21
+ },
22
+ {
23
+ lat: 53.4808,
24
+ lng: -2.2426,
25
+ live: true,
26
+ label: "Manchester",
27
+ count: 2,
28
+ countryCode: "GB"
29
+ },
30
+ {
31
+ lat: 55.9533,
32
+ lng: -3.1883,
33
+ live: true,
34
+ label: "Edinburgh",
35
+ count: 1,
36
+ countryCode: "GB"
37
+ },
38
+ {
39
+ lat: 51.4545,
40
+ lng: -2.5879,
41
+ live: true,
42
+ label: "Bristol",
43
+ count: 1,
44
+ countryCode: "GB"
45
+ },
46
+ {
47
+ lat: 53.3498,
48
+ lng: -6.2603,
49
+ live: true,
50
+ label: "Dublin",
51
+ count: 1,
52
+ countryCode: "IE"
53
+ }
54
+ ];
55
+ var WEEK = [
56
+ 22,
57
+ 31,
58
+ 26,
59
+ 35,
60
+ 30,
61
+ 41,
62
+ 38
63
+ ];
64
+ var SALES = [
65
+ 129,
66
+ 45,
67
+ 249,
68
+ 68.5,
69
+ 18.99,
70
+ 579
71
+ ];
72
+ var YESTERDAY = 2440;
73
+ function TillIllustration() {
74
+ const [takings, setTakings] = useState(2743.44);
75
+ const [n, setN] = useState(0);
76
+ return /* @__PURE__ */ jsxs("div", {
77
+ className: "principles-till",
78
+ children: [/* @__PURE__ */ jsxs("div", {
79
+ className: "principles-till__figure",
80
+ children: [
81
+ /* @__PURE__ */ jsx("span", {
82
+ className: "principles-orbit__label",
83
+ children: "Takings today"
84
+ }),
85
+ /* @__PURE__ */ jsx(RollingNumber, {
86
+ className: "principles-till__value",
87
+ value: takings,
88
+ format: GBP,
89
+ animateOnMount: false,
90
+ live: true
91
+ }),
92
+ /* @__PURE__ */ jsx(Delta, {
93
+ value: (takings - YESTERDAY) / YESTERDAY * 100,
94
+ label: "vs this time yesterday"
95
+ })
96
+ ]
97
+ }), /* @__PURE__ */ jsx(Button, {
98
+ size: "sm",
99
+ icon: /* @__PURE__ */ jsx(PlusIcon, {}),
100
+ onClick: () => {
101
+ setTakings((t) => Math.round((t + (SALES[n % SALES.length] ?? 45)) * 100) / 100);
102
+ setN((i) => i + 1);
103
+ },
104
+ children: "Take a sale"
105
+ })]
106
+ });
107
+ }
108
+ function MotionIllustration() {
109
+ const [publishing, setPublishing] = useState(false);
110
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SegmentedControl, {
111
+ "aria-label": "Date range",
112
+ defaultValue: "7d",
113
+ options: [
114
+ {
115
+ value: "today",
116
+ label: "Today"
117
+ },
118
+ {
119
+ value: "7d",
120
+ label: "7 days"
121
+ },
122
+ {
123
+ value: "30d",
124
+ label: "30 days"
125
+ }
126
+ ]
127
+ }), /* @__PURE__ */ jsx(Button, {
128
+ variant: "primary",
129
+ loading: publishing,
130
+ onClick: () => {
131
+ setPublishing(true);
132
+ window.setTimeout(() => setPublishing(false), 2400);
133
+ },
134
+ children: publishing ? "Publishing" : "Publish theme"
135
+ })] });
136
+ }
137
+ function Page() {
138
+ return /* @__PURE__ */ jsxs(DocPage, {
139
+ title: "Principles",
140
+ lead: "Six ideas behind every Orbit screen. Each one is a rule the components already follow, so building with them keeps a screen on course.",
141
+ children: [
142
+ /* @__PURE__ */ jsx(Section, {
143
+ id: "centre",
144
+ title: "Your business, at the centre",
145
+ description: /* @__PURE__ */ jsx("p", { children: "The direction for the whole system. The merchant's shop sits at the centre of the view and everything else orbits it. Its North Star is the Till in Orbit: a precise instrument for running a UK shop, not a row of KPI cards over a 30-day chart." }),
146
+ children: /* @__PURE__ */ jsx(Example, {
147
+ caption: "The live globe: the shop's visitors right now, each pinned where they are.",
148
+ children: /* @__PURE__ */ jsx(LiveGlobe, {
149
+ size: 300,
150
+ markers: VISITORS,
151
+ title: "Visitors right now"
152
+ })
153
+ })
154
+ }),
155
+ /* @__PURE__ */ jsx(Section, {
156
+ id: "state-first",
157
+ title: "1. The shop's state first",
158
+ description: /* @__PURE__ */ jsx("p", { children: "What happened, then what needs doing, in that order. Every screen offers the obvious next move, and only that move is a primary pill." }),
159
+ children: /* @__PURE__ */ jsx(Example, {
160
+ align: "fill",
161
+ children: /* @__PURE__ */ jsxs("div", {
162
+ className: "principles-next",
163
+ children: [/* @__PURE__ */ jsxs("div", {
164
+ className: "principles-next__row",
165
+ children: [
166
+ /* @__PURE__ */ jsxs("div", {
167
+ className: "principles-next__text",
168
+ children: [/* @__PURE__ */ jsx("span", {
169
+ className: "principles-next__title",
170
+ children: "5 orders to fulfil"
171
+ }), /* @__PURE__ */ jsx("span", {
172
+ className: "principles-next__body",
173
+ children: "Paid and waiting to be sent. The oldest has waited 1 day."
174
+ })]
175
+ }),
176
+ /* @__PURE__ */ jsx(Badge, {
177
+ tone: "warning",
178
+ dot: true,
179
+ children: "Over a day"
180
+ }),
181
+ /* @__PURE__ */ jsx(Button, {
182
+ variant: "primary",
183
+ size: "sm",
184
+ children: "Fulfil orders"
185
+ })
186
+ ]
187
+ }), /* @__PURE__ */ jsxs("div", {
188
+ className: "principles-next__row",
189
+ children: [/* @__PURE__ */ jsxs("div", {
190
+ className: "principles-next__text",
191
+ children: [/* @__PURE__ */ jsx("span", {
192
+ className: "principles-next__title",
193
+ children: "Restock Arden ergonomic chair"
194
+ }), /* @__PURE__ */ jsx("span", {
195
+ className: "principles-next__body",
196
+ children: "2 left, selling about 4 a week."
197
+ })]
198
+ }), /* @__PURE__ */ jsx(Button, {
199
+ size: "sm",
200
+ children: "Review stock"
201
+ })]
202
+ })]
203
+ })
204
+ })
205
+ }),
206
+ /* @__PURE__ */ jsx(Section, {
207
+ id: "line-of-light",
208
+ title: "2. Teal is a line of light",
209
+ description: /* @__PURE__ */ jsx("p", { children: "Orbit teal is drawn, never poured: lines, rings, focus, live marks, what is selected and the one primary pill. Words stay ink. In dark it becomes mint, the same teal lit." }),
210
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
211
+ className: "principles-light",
212
+ children: [
213
+ /* @__PURE__ */ jsxs("div", {
214
+ className: "principles-light__figure",
215
+ children: [
216
+ /* @__PURE__ */ jsx("span", {
217
+ className: "principles-orbit__label",
218
+ children: "Visitors now"
219
+ }),
220
+ /* @__PURE__ */ jsx("span", {
221
+ className: "principles-light__value o-num",
222
+ children: "38"
223
+ }),
224
+ /* @__PURE__ */ jsx(Badge, {
225
+ tone: "accent",
226
+ pulse: true,
227
+ size: "sm",
228
+ children: "Live"
229
+ })
230
+ ]
231
+ }),
232
+ /* @__PURE__ */ jsx(Sparkline, {
233
+ data: WEEK,
234
+ width: 150,
235
+ height: 36,
236
+ tone: "accent",
237
+ fill: true,
238
+ label: "Visitors this week, rising"
239
+ }),
240
+ /* @__PURE__ */ jsxs("div", {
241
+ className: "principles-light__controls",
242
+ children: [/* @__PURE__ */ jsx(Switch, {
243
+ size: "sm",
244
+ defaultChecked: true,
245
+ label: "Show VAT"
246
+ }), /* @__PURE__ */ jsx(Button, {
247
+ size: "sm",
248
+ variant: "primary",
249
+ children: "Fulfil orders"
250
+ })]
251
+ })
252
+ ]
253
+ }) })
254
+ }),
255
+ /* @__PURE__ */ jsx(Section, {
256
+ id: "till",
257
+ title: "3. Figures read like a till",
258
+ description: /* @__PURE__ */ jsx("p", { children: "Money and counts that lead a view are set in Sora, every numeral is tabular, and a change rolls into place like a till display. A fall is written with a true minus sign." }),
259
+ children: /* @__PURE__ */ jsx(Example, { children: /* @__PURE__ */ jsx(TillIllustration, {}) })
260
+ }),
261
+ /* @__PURE__ */ jsx(Section, {
262
+ id: "shape",
263
+ title: "4. Pills, and corners that rise",
264
+ description: /* @__PURE__ */ jsx("p", { children: "If it can be pressed, it is a pill. Surfaces round their corners the higher they sit: a field at 12px inside a card at 16px, inside the canvas at 18px." }),
265
+ children: /* @__PURE__ */ jsx(Example, {
266
+ surface: "ground",
267
+ children: /* @__PURE__ */ jsxs("div", {
268
+ className: "principles-nest",
269
+ children: [/* @__PURE__ */ jsx("span", {
270
+ className: "principles-nest__tag",
271
+ children: "Canvas 18"
272
+ }), /* @__PURE__ */ jsxs("div", {
273
+ className: "principles-nest__card",
274
+ children: [
275
+ /* @__PURE__ */ jsx("span", {
276
+ className: "principles-nest__tag",
277
+ children: "Card 16"
278
+ }),
279
+ /* @__PURE__ */ jsxs("div", {
280
+ className: "principles-nest__row",
281
+ children: [/* @__PURE__ */ jsx(Input, {
282
+ size: "sm",
283
+ prefix: "£",
284
+ defaultValue: "249.00",
285
+ "aria-label": "Price"
286
+ }), /* @__PURE__ */ jsx(Button, {
287
+ size: "sm",
288
+ variant: "primary",
289
+ children: "Save price"
290
+ })]
291
+ }),
292
+ /* @__PURE__ */ jsx("span", {
293
+ className: "principles-nest__tag",
294
+ "data-inline": "",
295
+ children: "Field 12 · Pill"
296
+ })
297
+ ]
298
+ })]
299
+ })
300
+ })
301
+ }),
302
+ /* @__PURE__ */ jsx(Section, {
303
+ id: "motion",
304
+ title: "5. Calm, then alive",
305
+ description: /* @__PURE__ */ jsx("p", { children: "Nothing moves unless it explains a change. Things settle on springs, the comet circles what is working, and every movement has a still version for people who ask for less motion." }),
306
+ children: /* @__PURE__ */ jsx(Example, {
307
+ caption: "Hover the pill and the comet passes once. Press it and the comet stays in orbit while the work runs. Choose a range and the thumb glides.",
308
+ children: /* @__PURE__ */ jsx(MotionIllustration, {})
309
+ })
310
+ }),
311
+ /* @__PURE__ */ jsxs(Section, {
312
+ id: "plain-words",
313
+ title: "6. Plain words",
314
+ description: /* @__PURE__ */ jsx("p", { children: "Sentence case, UK English, no jargon. A control names its action, and a message says what happened and what to do next." }),
315
+ children: [/* @__PURE__ */ jsx(Example, { children: /* @__PURE__ */ jsx(EmptyState, {
316
+ title: "No orders yet",
317
+ description: "When someone buys from Harbour Desk Co, their order appears here.",
318
+ actions: /* @__PURE__ */ jsx(Button, {
319
+ variant: "primary",
320
+ children: "Share your shop"
321
+ })
322
+ }) }), /* @__PURE__ */ jsx(DoDont, {
323
+ do: {
324
+ children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
325
+ variant: "ghost",
326
+ children: "Keep editing"
327
+ }), /* @__PURE__ */ jsx(Button, {
328
+ variant: "primary",
329
+ children: "Publish theme"
330
+ })] }),
331
+ caption: "Name the action: what happens when it is pressed."
332
+ },
333
+ dont: {
334
+ children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
335
+ variant: "ghost",
336
+ children: "Cancel"
337
+ }), /* @__PURE__ */ jsx(Button, {
338
+ variant: "primary",
339
+ children: "Submit"
340
+ })] }),
341
+ caption: "\"Submit\" makes people read around the button to learn what it does."
342
+ }
343
+ })]
344
+ }),
345
+ /* @__PURE__ */ jsx(Section, {
346
+ id: "rules",
347
+ title: "The named rules",
348
+ description: /* @__PURE__ */ jsx("p", { children: "The principles, made specific. Every rule is kept by the components themselves, in light and dark, in every Orbit dashboard." }),
349
+ children: /* @__PURE__ */ jsx(DocTable, {
350
+ columns: [
351
+ "Rule",
352
+ "In one line",
353
+ "Details"
354
+ ],
355
+ rows: [
356
+ [
357
+ "Line-of-Light",
358
+ "Teal is drawn, never poured.",
359
+ /* @__PURE__ */ jsx(DocLink, {
360
+ to: "/foundations/colour#where-teal-goes",
361
+ children: "Colour"
362
+ })
363
+ ],
364
+ [
365
+ "Ink Words",
366
+ "Words and figures stay ink; colour belongs to marks.",
367
+ /* @__PURE__ */ jsx(DocLink, {
368
+ to: "/foundations/colour#where-teal-goes",
369
+ children: "Colour"
370
+ })
371
+ ],
372
+ [
373
+ "Teal-in-the-Grey",
374
+ "Every grey carries a trace of the teal.",
375
+ /* @__PURE__ */ jsx(DocLink, {
376
+ to: "/foundations/colour#primitives",
377
+ children: "Colour"
378
+ })
379
+ ],
380
+ [
381
+ "Till",
382
+ "Every numeral is tabular, everywhere.",
383
+ /* @__PURE__ */ jsx(DocLink, {
384
+ to: "/foundations/typography#numerals",
385
+ children: "Typography"
386
+ })
387
+ ],
388
+ [
389
+ "Sora Budget",
390
+ "Sora for figures and headlines only.",
391
+ /* @__PURE__ */ jsx(DocLink, {
392
+ to: "/foundations/typography#guidelines",
393
+ children: "Typography"
394
+ })
395
+ ],
396
+ [
397
+ "Sentence Case",
398
+ "No all-caps, no tracked-out labels.",
399
+ /* @__PURE__ */ jsx(DocLink, {
400
+ to: "/foundations/typography#guidelines",
401
+ children: "Typography"
402
+ })
403
+ ],
404
+ [
405
+ "Pill",
406
+ "If it can be pressed, it is a pill.",
407
+ /* @__PURE__ */ jsx(DocLink, {
408
+ to: "/foundations/shape#radius",
409
+ children: "Shape and depth"
410
+ })
411
+ ],
412
+ [
413
+ "Altitude",
414
+ "The higher it floats, the rounder its corners.",
415
+ /* @__PURE__ */ jsx(DocLink, {
416
+ to: "/foundations/shape#altitude",
417
+ children: "Shape and depth"
418
+ })
419
+ ],
420
+ [
421
+ "One Raised Page",
422
+ "The canvas is the only raised plane.",
423
+ /* @__PURE__ */ jsx(DocLink, {
424
+ to: "/foundations/shape#planes",
425
+ children: "Shape and depth"
426
+ })
427
+ ],
428
+ [
429
+ "Hairline-or-Shadow",
430
+ "A surface has one edge, never both.",
431
+ /* @__PURE__ */ jsx(DocLink, {
432
+ to: "/foundations/shape#hairline-or-shadow",
433
+ children: "Shape and depth"
434
+ })
435
+ ],
436
+ [
437
+ "No-Box",
438
+ "Group with space and hairlines before cards.",
439
+ /* @__PURE__ */ jsx(DocLink, {
440
+ to: "/foundations/shape#hairline-or-shadow",
441
+ children: "Shape and depth"
442
+ })
443
+ ],
444
+ [
445
+ "Settle",
446
+ "Arrivals settle on a spring; nothing slides on linear time.",
447
+ /* @__PURE__ */ jsx(DocLink, {
448
+ to: "/foundations/motion#easings",
449
+ children: "Motion"
450
+ })
451
+ ],
452
+ [
453
+ "Pop Budget",
454
+ "Only glyph-sized things pop.",
455
+ /* @__PURE__ */ jsx(DocLink, {
456
+ to: "/foundations/motion#choreography",
457
+ children: "Motion"
458
+ })
459
+ ],
460
+ [
461
+ "Explain-a-Change",
462
+ "Nothing moves at idle unless it is live or loading.",
463
+ /* @__PURE__ */ jsx(DocLink, {
464
+ to: "/foundations/motion#choreography",
465
+ children: "Motion"
466
+ })
467
+ ],
468
+ [
469
+ "Stillness",
470
+ "Every movement has a still version.",
471
+ /* @__PURE__ */ jsx(DocLink, {
472
+ to: "/foundations/motion#reduced-motion",
473
+ children: "Motion"
474
+ })
475
+ ]
476
+ ]
477
+ })
478
+ })
479
+ ]
480
+ });
481
+ }
482
+ //#endregion
483
+ export { Page };