@orbitcommerce/constellation-docs 1.0.0 → 1.2.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 (235) hide show
  1. package/dist/docs.css +14764 -2237
  2. package/dist/index.js +2 -2
  3. package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
  4. package/dist/pages/_address-data-L9BR499w.js +161 -0
  5. package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
  6. package/dist/pages/_card-art-0be5ncyV.js +18 -0
  7. package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
  8. package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
  9. package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
  10. package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
  11. package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
  12. package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
  13. package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
  14. package/dist/pages/address-block-BZOOOPA9.js +368 -0
  15. package/dist/pages/address-fields-CwSqro3W.js +277 -0
  16. package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
  17. package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
  18. package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
  19. package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
  20. package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
  21. package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
  22. package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
  23. package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
  24. package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
  25. package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
  26. package/dist/pages/board-card-D2tZY_mU.js +415 -0
  27. package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
  28. package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
  29. package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
  30. package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
  31. package/dist/pages/card-CQEM1_wc.js +1567 -0
  32. package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
  33. package/dist/pages/chart-legend-B20AbakD.js +724 -0
  34. package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
  35. package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
  36. package/dist/pages/checklist-card-DEyykVFS.js +783 -0
  37. package/dist/pages/chip-Ck-o3Ui6.js +839 -0
  38. package/dist/pages/chip-list-k1LxXuCi.js +414 -0
  39. package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
  40. package/dist/pages/coachmark-Be2ghobT.js +366 -0
  41. package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
  42. package/dist/pages/collab-field-CfqqK7d2.js +696 -0
  43. package/dist/pages/color-field-CZpfcA-A.js +1127 -0
  44. package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
  45. package/dist/pages/column-mapper-TsTG39cl.js +502 -0
  46. package/dist/pages/combobox-DvK2j5tI.js +1334 -0
  47. package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
  48. package/dist/pages/comment-box-CDSGYhr5.js +346 -0
  49. package/dist/pages/composer-D4B0NgpA.js +689 -0
  50. package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
  51. package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
  52. package/dist/pages/context-menu-F9DV30ia.js +487 -0
  53. package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
  54. package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
  55. package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
  56. package/dist/pages/date-input-GOW067EB.js +956 -0
  57. package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
  58. package/dist/pages/date-time-BLKCXtVZ.js +678 -0
  59. package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
  60. package/dist/pages/description-list-BPeXn1eW.js +1268 -0
  61. package/dist/pages/device-switcher-BCaN99c1.js +554 -0
  62. package/dist/pages/dialog-CRpkRC98.js +3164 -0
  63. package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
  64. package/dist/pages/doodle-nzkqi2UI.js +201 -0
  65. package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
  66. package/dist/pages/drill-menu-cskH5mol.js +490 -0
  67. package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
  68. package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
  69. package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
  70. package/dist/pages/empty-state-4U2txFpI.js +1113 -0
  71. package/dist/pages/facet-filters-McbBeY9e.js +353 -0
  72. package/dist/pages/figure-D-HF5vCj.js +563 -0
  73. package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
  74. package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
  75. package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
  76. package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
  77. package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
  78. package/dist/pages/form-grid-BfWCVlie.js +692 -0
  79. package/dist/pages/gallery-BBk2EOri.js +453 -0
  80. package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
  81. package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
  82. package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
  83. package/dist/pages/heatmap-BohgIcNk.js +507 -0
  84. package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
  85. package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
  86. package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
  87. package/dist/pages/hosted-field-BLh-53AE.js +208 -0
  88. package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
  89. package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
  90. package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
  91. package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
  92. package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
  93. package/dist/pages/image-cropper-NyougqLH.js +466 -0
  94. package/dist/pages/image-field-7knBv4mJ.js +567 -0
  95. package/dist/pages/import-result-CmTtGXW_.js +486 -0
  96. package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
  97. package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
  98. package/dist/pages/input-CzLCzfyx.js +2372 -0
  99. package/dist/pages/{installation-DpsX8G_n.js → installation-C3UcpQJT.js} +112 -29
  100. package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
  101. package/dist/pages/kanban-Dy9sPAI0.js +740 -0
  102. package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
  103. package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
  104. package/dist/pages/line-chart-CntWxeMF.js +1117 -0
  105. package/dist/pages/link-CXqvAg9z.js +689 -0
  106. package/dist/pages/link-picker-BMFGCC67.js +478 -0
  107. package/dist/pages/link-row-x8yaUuWc.js +595 -0
  108. package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
  109. package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
  110. package/dist/pages/loading-state-BNbCo51C.js +556 -0
  111. package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
  112. package/dist/pages/{logo-BfGF1Pq9.js → logo-B38rnzoq.js} +13 -13
  113. package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
  114. package/dist/pages/markdown-Ied72vMT.js +237 -0
  115. package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
  116. package/dist/pages/media-banner-DkStCia0.js +233 -0
  117. package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
  118. package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
  119. package/dist/pages/meta-line-D5p2TycR.js +371 -0
  120. package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
  121. package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
  122. package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
  123. package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
  124. package/dist/pages/number-input-CuyMZg18.js +968 -0
  125. package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
  126. package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
  127. package/dist/pages/otp-input-CVRoX1mw.js +591 -0
  128. package/dist/pages/{overview-BPEbZQ6g.js → overview-LA9XRhZc.js} +4 -4
  129. package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
  130. package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
  131. package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
  132. package/dist/pages/password-field-DHEQKyUC.js +912 -0
  133. package/dist/pages/person-cell-BmjbADBz.js +564 -0
  134. package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
  135. package/dist/pages/plan-card-DRaA6RuB.js +621 -0
  136. package/dist/pages/plan-card-DtloWvMh.js +258 -0
  137. package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
  138. package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
  139. package/dist/pages/point-list-BbPmZjsm.js +222 -0
  140. package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
  141. package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
  142. package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
  143. package/dist/pages/price-CRBLoa9h.js +604 -0
  144. package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
  145. package/dist/pages/print-page-BkLv6bW8.js +513 -0
  146. package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
  147. package/dist/pages/progress-CP_awmo4.js +904 -0
  148. package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
  149. package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-C-4tg6FS.js} +580 -18
  150. package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
  151. package/dist/pages/rating-CweKN2SX.js +471 -0
  152. package/dist/pages/record-layout-DUP_X0RL.js +719 -0
  153. package/dist/pages/record-pager-y9D7JFgb.js +278 -0
  154. package/dist/pages/registry-BZg-xAbi.js +594 -0
  155. package/dist/pages/{release-Dvo684UJ.js → release-Cs6tl16C.js} +4 -1
  156. package/dist/pages/repeater-BRZYKRQa.js +1351 -0
  157. package/dist/pages/reply-feedback-BDnHprla.js +192 -0
  158. package/dist/pages/reveal-BygENBbL.js +460 -0
  159. package/dist/pages/rich-text-DOFQZEpT.js +156 -0
  160. package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
  161. package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
  162. package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
  163. package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
  164. package/dist/pages/rule-list-DTCmIMpT.js +648 -0
  165. package/dist/pages/save-status-B5KkyMZP.js +378 -0
  166. package/dist/pages/schedule-YycI95O1.js +243 -0
  167. package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
  168. package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
  169. package/dist/pages/search-menu-DMuXyUUW.js +580 -0
  170. package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
  171. package/dist/pages/section-rail-BtTCETS5.js +637 -0
  172. package/dist/pages/section-v2Pubup9.js +639 -0
  173. package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
  174. package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
  175. package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
  176. package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
  177. package/dist/pages/serp-preview-BGwORjmo.js +346 -0
  178. package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
  179. package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
  180. package/dist/pages/share-list-D4wgBxKN.js +926 -0
  181. package/dist/pages/side-panel-CCtkrZjs.js +811 -0
  182. package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
  183. package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
  184. package/dist/pages/skip-link-BxznhSkz.js +252 -0
  185. package/dist/pages/slider-CAoPURKD.js +774 -0
  186. package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
  187. package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
  188. package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
  189. package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
  190. package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
  191. package/dist/pages/split-bar-DYgZnFID.js +414 -0
  192. package/dist/pages/split-button-Be08-VI-.js +335 -0
  193. package/dist/pages/split-pane-lSNZgTKt.js +523 -0
  194. package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
  195. package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
  196. package/dist/pages/status-dot-D99gAGsV.js +567 -0
  197. package/dist/pages/stepper-CxKTbEA-.js +1093 -0
  198. package/dist/pages/success-mark-CqFTOBEu.js +142 -0
  199. package/dist/pages/swatch-H_kNvHuC.js +565 -0
  200. package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
  201. package/dist/pages/table-CL0vomno.js +3225 -0
  202. package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -21
  203. package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
  204. package/dist/pages/task-card-Dv0sR1-w.js +295 -0
  205. package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
  206. package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
  207. package/dist/pages/time-input-CA9-uZAa.js +442 -0
  208. package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
  209. package/dist/pages/timeline-BsMUTlpR.js +1798 -0
  210. package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
  211. package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
  212. package/dist/pages/toolbar-B9l_fHKy.js +754 -0
  213. package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
  214. package/dist/pages/translation-field-CTRXiF2N.js +251 -0
  215. package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
  216. package/dist/pages/tree-select-DU1qXHy_.js +492 -0
  217. package/dist/pages/tree-view-g_RjLtAb.js +739 -0
  218. package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
  219. package/dist/pages/unit-input-Dml4fjmK.js +659 -0
  220. package/dist/pages/upload-rules-yozEzSah.js +419 -0
  221. package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
  222. package/dist/pages/value-change-CnubDKyO.js +489 -0
  223. package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
  224. package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
  225. package/dist/pages/working-status-CENemSsw.js +389 -0
  226. package/manifest.json +10984 -1108
  227. package/package.json +2 -2
  228. package/dist/pages/card-DUggbis3.js +0 -659
  229. package/dist/pages/checkbox-DwimQaK3.js +0 -365
  230. package/dist/pages/dialog-BRAf4LMh.js +0 -1451
  231. package/dist/pages/empty-state-C-mLrXW2.js +0 -417
  232. package/dist/pages/input-KF9Gkawf.js +0 -1093
  233. package/dist/pages/registry-CroHzK9I.js +0 -244
  234. package/dist/pages/skeleton-DLuBhP46.js +0 -561
  235. package/dist/pages/table-AMoODng4.js +0 -607
@@ -0,0 +1,378 @@
1
+ "use client";
2
+ import { a as DocTable, d as Section$1, i as DocPage, m as ThemePair, o as Example, p as SubSection, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Button, Checkbox, SaveStatus, SegmentedControl } from "@orbitcommerce/constellation";
6
+ //#region src/pages/components/save-status.tsx
7
+ function Preview() {
8
+ return /* @__PURE__ */ jsxs("div", {
9
+ className: "save-status-bar",
10
+ "data-still": "",
11
+ children: [
12
+ /* @__PURE__ */ jsx(SaveStatus, {
13
+ status: "saved",
14
+ tooltip: false
15
+ }),
16
+ /* @__PURE__ */ jsx(Button, {
17
+ size: "sm",
18
+ variant: "secondary",
19
+ children: "Save"
20
+ }),
21
+ /* @__PURE__ */ jsx(Button, {
22
+ size: "sm",
23
+ children: "Publish"
24
+ })
25
+ ]
26
+ });
27
+ }
28
+ var STATES = [
29
+ {
30
+ value: "idle",
31
+ label: "Idle"
32
+ },
33
+ {
34
+ value: "unsaved",
35
+ label: "Unsaved"
36
+ },
37
+ {
38
+ value: "saving",
39
+ label: "Saving"
40
+ },
41
+ {
42
+ value: "saved",
43
+ label: "Saved"
44
+ },
45
+ {
46
+ value: "invalid",
47
+ label: "Invalid"
48
+ },
49
+ {
50
+ value: "failed",
51
+ label: "Failed"
52
+ },
53
+ {
54
+ value: "local",
55
+ label: "Local"
56
+ }
57
+ ];
58
+ /** Every state, chosen from a segmented control, in a bar beside Save and Publish. */
59
+ function States() {
60
+ const [status, setStatus] = useState("unsaved");
61
+ return /* @__PURE__ */ jsxs("div", {
62
+ className: "save-status-stack",
63
+ children: [/* @__PURE__ */ jsx(SegmentedControl, {
64
+ "aria-label": "Save state",
65
+ size: "sm",
66
+ options: STATES,
67
+ value: status,
68
+ onValueChange: setStatus
69
+ }), /* @__PURE__ */ jsxs("div", {
70
+ className: "save-status-bar",
71
+ children: [
72
+ /* @__PURE__ */ jsx(SaveStatus, { status }),
73
+ /* @__PURE__ */ jsx(Button, {
74
+ size: "sm",
75
+ variant: "secondary",
76
+ disabled: status !== "unsaved" && status !== "failed" && status !== "local",
77
+ children: "Save"
78
+ }),
79
+ /* @__PURE__ */ jsx(Button, {
80
+ size: "sm",
81
+ children: "Publish"
82
+ })
83
+ ]
84
+ })]
85
+ });
86
+ }
87
+ /** An autosaving editor: a change marks it unsaved, it saves after a pause, and Saved steps away after 2 seconds. */
88
+ function Autosave() {
89
+ const [status, setStatus] = useState("idle");
90
+ const [savedAt, setSavedAt] = useState();
91
+ const timers = useRef([]);
92
+ useEffect(() => () => timers.current.forEach((timer) => window.clearTimeout(timer)), []);
93
+ const change = () => {
94
+ timers.current.forEach((timer) => window.clearTimeout(timer));
95
+ setStatus("unsaved");
96
+ timers.current = [window.setTimeout(() => setStatus("saving"), 900), window.setTimeout(() => {
97
+ setSavedAt(Date.now());
98
+ setStatus("saved");
99
+ }, 2100)];
100
+ };
101
+ return /* @__PURE__ */ jsxs("div", {
102
+ className: "save-status-stack",
103
+ children: [/* @__PURE__ */ jsx(Button, {
104
+ size: "sm",
105
+ variant: "secondary",
106
+ onClick: change,
107
+ children: "Make a change"
108
+ }), /* @__PURE__ */ jsxs("div", {
109
+ className: "save-status-bar",
110
+ children: [/* @__PURE__ */ jsx(SaveStatus, {
111
+ status,
112
+ savedAt,
113
+ hideSavedAfter: 2e3
114
+ }), /* @__PURE__ */ jsx(Button, {
115
+ size: "sm",
116
+ children: "Publish"
117
+ })]
118
+ })]
119
+ });
120
+ }
121
+ /** A form that autosaves, its footer saying when it last did, beside a Save of its own. */
122
+ function AutosaveFooter() {
123
+ const [invalid, setInvalid] = useState(false);
124
+ return /* @__PURE__ */ jsxs("div", {
125
+ className: "save-status-footer",
126
+ children: [/* @__PURE__ */ jsx(Checkbox, {
127
+ label: "The form has an error",
128
+ checked: invalid,
129
+ onCheckedChange: setInvalid
130
+ }), /* @__PURE__ */ jsxs("div", {
131
+ className: "save-status-footer__end",
132
+ children: [/* @__PURE__ */ jsx(SaveStatus, {
133
+ status: invalid ? "invalid" : "saved",
134
+ savedAt: new Date(2026, 9, 15, 10, 42),
135
+ tooltip: false
136
+ }), /* @__PURE__ */ jsx(Button, {
137
+ size: "sm",
138
+ children: "Save"
139
+ })]
140
+ })]
141
+ });
142
+ }
143
+ function Page() {
144
+ return /* @__PURE__ */ jsxs(DocPage, {
145
+ title: "Save status",
146
+ status: "new",
147
+ importNames: ["SaveStatus", "saveStatusFrom"],
148
+ lead: "What an editor says about its save beside its Save button: quiet words with a small mark, from unsaved changes through saving to saved, and the three ways a save falls short.",
149
+ children: [
150
+ /* @__PURE__ */ jsxs(Section$1, {
151
+ id: "basics",
152
+ title: "Basics",
153
+ description: /* @__PURE__ */ jsxs("p", { children: [
154
+ "Give it the ",
155
+ /* @__PURE__ */ jsx("code", { children: "status" }),
156
+ ". Nothing shows before the first change (",
157
+ /* @__PURE__ */ jsx("code", { children: "idle" }),
158
+ "); then a dot while there are changes to save, the spinner while saving and a tick once saved. Only the mark takes a tone, so saving never looks like an error. Each new state fades in."
159
+ ] }),
160
+ children: [/* @__PURE__ */ jsx(Example, {
161
+ align: "start",
162
+ code: `<SaveStatus status={status} />\n<Button variant="secondary">Save</Button>\n<Button>Publish</Button>`,
163
+ children: /* @__PURE__ */ jsx(States, {})
164
+ }), /* @__PURE__ */ jsx(DocTable, {
165
+ columns: [
166
+ "Status",
167
+ "Says",
168
+ "Mark"
169
+ ],
170
+ rows: [
171
+ [
172
+ /* @__PURE__ */ jsx("code", { children: "idle" }, "s"),
173
+ "Nothing",
174
+ "None: nothing has changed since the page opened"
175
+ ],
176
+ [
177
+ /* @__PURE__ */ jsx("code", { children: "unsaved" }, "s"),
178
+ "Unsaved changes",
179
+ "A quiet dot"
180
+ ],
181
+ [
182
+ /* @__PURE__ */ jsx("code", { children: "saving" }, "s"),
183
+ "Saving",
184
+ "The Orbit spinner"
185
+ ],
186
+ [
187
+ /* @__PURE__ */ jsx("code", { children: "saved" }, "s"),
188
+ "Saved, or Saved 10:42",
189
+ "A green tick"
190
+ ],
191
+ [
192
+ /* @__PURE__ */ jsx("code", { children: "invalid" }, "s"),
193
+ "Not saved, fix the highlighted fields",
194
+ "A red warning: the form has errors, so nothing was sent"
195
+ ],
196
+ [
197
+ /* @__PURE__ */ jsx("code", { children: "failed" }, "s"),
198
+ "Not saved",
199
+ "A red cloud: the save failed"
200
+ ],
201
+ [
202
+ /* @__PURE__ */ jsx("code", { children: "local" }, "s"),
203
+ "Draft kept on this device",
204
+ "An amber warning: the server could not be reached"
205
+ ]
206
+ ]
207
+ })]
208
+ }),
209
+ /* @__PURE__ */ jsxs(Section$1, {
210
+ id: "saved",
211
+ title: "Saved, and when",
212
+ description: /* @__PURE__ */ jsxs("p", { children: [
213
+ "With ",
214
+ /* @__PURE__ */ jsx("code", { children: "savedAt" }),
215
+ ", Saved says the time it saved, as the clock reads in the ",
216
+ /* @__PURE__ */ jsx("code", { children: "locale" }),
217
+ " (British English by default). With ",
218
+ /* @__PURE__ */ jsx("code", { children: "hideSavedAfter" }),
219
+ ", Saved fades away that many milliseconds after it arrives, for an editor that saves as you go; the next change brings the status back. A failure never steps away."
220
+ ] }),
221
+ children: [/* @__PURE__ */ jsx(Example, {
222
+ align: "start",
223
+ clientOnly: true,
224
+ code: `<SaveStatus status={status} savedAt={savedAt} hideSavedAfter={2000} />`,
225
+ children: /* @__PURE__ */ jsx(Autosave, {})
226
+ }), /* @__PURE__ */ jsx(SubSection, {
227
+ title: "Beside a Save of its own",
228
+ description: /* @__PURE__ */ jsxs("p", { children: [
229
+ "A form that autosaves keeps a Save for those who want to press one. While the form has errors the autosave sends nothing, so the time gives way to ",
230
+ /* @__PURE__ */ jsx("code", { children: "invalid" }),
231
+ ": a time left standing would read as \"your latest edits are stored\", the opposite of what happened."
232
+ ] }),
233
+ children: /* @__PURE__ */ jsx(Example, {
234
+ align: "start",
235
+ clientOnly: true,
236
+ code: `<SaveStatus status={invalid ? 'invalid' : 'saved'} savedAt={lastSavedAt} />\n<Button>Save</Button>`,
237
+ children: /* @__PURE__ */ jsx(AutosaveFooter, {})
238
+ })
239
+ })]
240
+ }),
241
+ /* @__PURE__ */ jsx(Section$1, {
242
+ id: "compact",
243
+ title: "Compact",
244
+ description: /* @__PURE__ */ jsxs("p", { children: [
245
+ "In a bar short of room, ",
246
+ /* @__PURE__ */ jsx("code", { children: "compact" }),
247
+ " folds the words to the screen reader alone and keeps the mark; the tooltip still says them. A bar that measures itself folds the status first (see the builder bar's fold)."
248
+ ] }),
249
+ children: /* @__PURE__ */ jsx(Example, {
250
+ align: "start",
251
+ code: `<SaveStatus status="local" compact />`,
252
+ children: /* @__PURE__ */ jsxs("div", {
253
+ className: "save-status-bar",
254
+ children: [
255
+ /* @__PURE__ */ jsx(SaveStatus, {
256
+ status: "unsaved",
257
+ compact: true
258
+ }),
259
+ /* @__PURE__ */ jsx(SaveStatus, {
260
+ status: "saving",
261
+ compact: true
262
+ }),
263
+ /* @__PURE__ */ jsx(SaveStatus, {
264
+ status: "saved",
265
+ compact: true
266
+ }),
267
+ /* @__PURE__ */ jsx(SaveStatus, {
268
+ status: "local",
269
+ compact: true
270
+ })
271
+ ]
272
+ })
273
+ })
274
+ }),
275
+ /* @__PURE__ */ jsxs(Section$1, {
276
+ id: "from-state",
277
+ title: "From what the editor knows",
278
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "saveStatusFrom" }), " reads the state from the editor's flags: saving first, then what is wrong with the changes (invalid, failed, kept on this device), then unsaved, then saved."] }),
279
+ children: [/* @__PURE__ */ jsx(Example, {
280
+ align: "start",
281
+ codeOpen: true,
282
+ code: `const status = saveStatusFrom({
283
+ saving: isSaving || isAutosaving,
284
+ dirty: hasUnsavedChanges,
285
+ invalid: hasErrors,
286
+ failed: lastAutosaveFailed,
287
+ keptLocally: localDraftKept,
288
+ saved: savedThisSession,
289
+ })`,
290
+ children: /* @__PURE__ */ jsx(SaveStatus, {
291
+ status: "local",
292
+ tooltip: false
293
+ })
294
+ }), /* @__PURE__ */ jsx(Fragment$1, {})]
295
+ }),
296
+ /* @__PURE__ */ jsx(Section$1, {
297
+ id: "both-themes",
298
+ title: "In both themes",
299
+ description: /* @__PURE__ */ jsx("p", { children: "Every state but idle, light and dark." }),
300
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx("div", {
301
+ className: "save-status-grid",
302
+ children: STATES.slice(1).map((state) => /* @__PURE__ */ jsx(SaveStatus, {
303
+ status: state.value,
304
+ tooltip: false
305
+ }, state.value))
306
+ }) })
307
+ }),
308
+ /* @__PURE__ */ jsx(Section$1, {
309
+ id: "guidelines",
310
+ title: "Guidelines",
311
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
312
+ "Put it just before the Save button, so the words and the action read together.",
313
+ "Say what happened, never more: a draft kept on this device is not saved, and a form with errors sent nothing.",
314
+ "Let Saved step away only in an editor that saves as you go; where people press Save themselves, keep it.",
315
+ "One per editor. Two statuses for one page disagree sooner or later."
316
+ ] })
317
+ }),
318
+ /* @__PURE__ */ jsx(Section$1, {
319
+ id: "accessibility",
320
+ title: "Accessibility",
321
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
322
+ "It is a polite status from its first render, empty until the first change, so each new state is said as it arrives and a page that opens saved says nothing.",
323
+ "Its marks are hidden from assistive technology: the words say the state. Compact folds the words from sight only.",
324
+ "A Saved that steps away leaves the status empty; nothing is said as it goes.",
325
+ "A failure and a local draft say their longer story with their words, to the screen reader; the tooltip shows it on hover."
326
+ ] })
327
+ }),
328
+ /* @__PURE__ */ jsx(Section$1, {
329
+ id: "props",
330
+ title: "Props",
331
+ description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native span attribute." }),
332
+ children: /* @__PURE__ */ jsx(PropsTable, { rows: [
333
+ {
334
+ name: "status",
335
+ type: "'idle' | 'unsaved' | 'saving' | 'saved' | 'invalid' | 'failed' | 'local'",
336
+ required: true,
337
+ description: "Where the save stands. idle draws nothing."
338
+ },
339
+ {
340
+ name: "savedAt",
341
+ type: "Date | number",
342
+ description: "When it last saved: Saved says the time (\"Saved 10:42\")."
343
+ },
344
+ {
345
+ name: "locale",
346
+ type: "string",
347
+ default: "'en-GB'",
348
+ description: "The locale the time is written in."
349
+ },
350
+ {
351
+ name: "hideSavedAfter",
352
+ type: "number",
353
+ description: "Saved fades away this many milliseconds after it arrives."
354
+ },
355
+ {
356
+ name: "compact",
357
+ type: "boolean",
358
+ default: "false",
359
+ description: "Folds the words to the screen reader; the mark and the tooltip stay."
360
+ },
361
+ {
362
+ name: "tooltip",
363
+ type: "boolean",
364
+ default: "true",
365
+ description: "Shows the words, or the longer story for a failure or a local draft, in a tooltip."
366
+ },
367
+ {
368
+ name: "labels",
369
+ type: "Partial<SaveStatusLabels>",
370
+ description: "Its words: unsaved, saving, saved, savedAt(time), invalid, failed, failedHint, local, localHint (saveStatusLabels)."
371
+ }
372
+ ] })
373
+ })
374
+ ]
375
+ });
376
+ }
377
+ //#endregion
378
+ export { Page, Preview };
@@ -0,0 +1,243 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { d as Section$1, i as DocPage, m as ThemePair, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Schedule } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/schedule.tsx
8
+ var TODAY = new Date(2026, 9, 2);
9
+ function Preview() {
10
+ return /* @__PURE__ */ jsx("div", {
11
+ style: { width: 250 },
12
+ children: /* @__PURE__ */ jsx(Schedule, {
13
+ "aria-label": "Sale",
14
+ withTime: false,
15
+ defaultValue: {
16
+ start: "2026-10-05",
17
+ end: "2026-10-12"
18
+ },
19
+ today: TODAY
20
+ })
21
+ });
22
+ }
23
+ function Sale() {
24
+ const [value, setValue] = useState({
25
+ start: "2026-10-05T09:00",
26
+ end: "2026-10-12T17:30"
27
+ });
28
+ return /* @__PURE__ */ jsxs("div", {
29
+ style: {
30
+ display: "grid",
31
+ gap: 12,
32
+ width: "min(100%, 560px)"
33
+ },
34
+ children: [/* @__PURE__ */ jsx(Schedule, {
35
+ "aria-label": "Sale schedule",
36
+ value,
37
+ onChange: setValue,
38
+ today: TODAY,
39
+ hint: "The sale price shows from the start and goes back to the full price at the end."
40
+ }), /* @__PURE__ */ jsx("code", {
41
+ style: {
42
+ fontSize: "var(--o-text-sm)",
43
+ color: "var(--o-fg-2)"
44
+ },
45
+ role: "status",
46
+ children: JSON.stringify(value)
47
+ })]
48
+ });
49
+ }
50
+ function Discount() {
51
+ const [value, setValue] = useState({
52
+ start: "2026-10-05T00:00",
53
+ end: ""
54
+ });
55
+ return /* @__PURE__ */ jsx("div", {
56
+ style: { width: "min(100%, 560px)" },
57
+ children: /* @__PURE__ */ jsx(Schedule, {
58
+ "aria-label": "Active dates",
59
+ value,
60
+ onChange: setValue,
61
+ endOptional: true,
62
+ today: TODAY
63
+ })
64
+ });
65
+ }
66
+ function WithError() {
67
+ return /* @__PURE__ */ jsx("div", {
68
+ style: { width: "min(100%, 560px)" },
69
+ children: /* @__PURE__ */ jsx(Schedule, {
70
+ "aria-label": "Campaign dates",
71
+ defaultValue: {
72
+ start: "2026-10-05T09:00",
73
+ end: "2026-12-20T17:00"
74
+ },
75
+ today: TODAY,
76
+ error: "A campaign can run for 60 days at most."
77
+ })
78
+ });
79
+ }
80
+ function Page() {
81
+ return /* @__PURE__ */ jsxs(DocPage, {
82
+ title: "Schedule",
83
+ status: "new",
84
+ importNames: ["Schedule"],
85
+ lead: "When something starts and when it ends: two date and time fields, the end bound to the start, with one error for the pair and an end that can wait behind Set an end date.",
86
+ children: [
87
+ /* @__PURE__ */ jsx(Section$1, {
88
+ id: "basics",
89
+ title: "Basics",
90
+ description: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("p", { children: [
91
+ "Each field is a ",
92
+ /* @__PURE__ */ jsx(DocLink, {
93
+ to: "/components/date-input#time",
94
+ children: "date input with a time"
95
+ }),
96
+ ", typed or picked, and the value is the two strings, ",
97
+ /* @__PURE__ */ jsx("code", { children: "{ start, end }" }),
98
+ ", as DateInput holds them. The end's earliest is the start: days before it cannot be picked, and an end typed before it is said to be too early. Move the start past the end and the end is cleared, and a screen reader is told so. Try typing 20/10/2026 into the start."
99
+ ] }) }),
100
+ children: /* @__PURE__ */ jsx(Example, {
101
+ code: `
102
+ const [sale, setSale] = useState<ScheduleValue>({ start: '2026-10-05T09:00', end: '2026-10-12T17:30' })
103
+
104
+ <Schedule
105
+ aria-label="Sale schedule"
106
+ value={sale}
107
+ onChange={setSale}
108
+ hint="The sale price shows from the start and goes back to the full price at the end."
109
+ />`,
110
+ children: /* @__PURE__ */ jsx(Sale, {})
111
+ })
112
+ }),
113
+ /* @__PURE__ */ jsx(Section$1, {
114
+ id: "optional-end",
115
+ title: "An end that can wait",
116
+ description: /* @__PURE__ */ jsxs("p", { children: [
117
+ /* @__PURE__ */ jsx("code", { children: "endOptional" }),
118
+ " keeps the end behind a Set an end date checkbox while there is none, for a discount that runs until it is stopped. The checkbox stands where the end's label would. Ticking it shows the end with focus in it; unticking takes the end away (the value's ",
119
+ /* @__PURE__ */ jsx("code", { children: "end" }),
120
+ " is ",
121
+ /* @__PURE__ */ jsx("code", { children: "''" }),
122
+ "), and ticking again brings it back."
123
+ ] }),
124
+ children: /* @__PURE__ */ jsx(Example, {
125
+ code: `<Schedule aria-label="Active dates" value={dates} onChange={setDates} endOptional />`,
126
+ children: /* @__PURE__ */ jsx(Discount, {})
127
+ })
128
+ }),
129
+ /* @__PURE__ */ jsx(Section$1, {
130
+ id: "error",
131
+ title: "One error for the pair",
132
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "error" }), " is one sentence for the two, shown once under both. It marks both fields invalid and is read as the description of each. A field's own sentence (a date typed wrong) stays under that field."] }),
133
+ children: /* @__PURE__ */ jsx(Example, {
134
+ code: `<Schedule aria-label="Campaign dates" value={dates} onChange={setDates} error="A campaign can run for 60 days at most." />`,
135
+ children: /* @__PURE__ */ jsx(WithError, {})
136
+ })
137
+ }),
138
+ /* @__PURE__ */ jsx(Section$1, {
139
+ id: "days",
140
+ title: "Days alone, and both themes",
141
+ description: /* @__PURE__ */ jsxs("p", { children: [
142
+ /* @__PURE__ */ jsxs("code", { children: ["withTime=", "{false}"] }),
143
+ " schedules days alone, as DateInput holds them: ",
144
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DD" }),
145
+ ". In a column under 31rem the end goes under the start."
146
+ ] }),
147
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx("div", {
148
+ style: { width: 260 },
149
+ children: /* @__PURE__ */ jsx(Schedule, {
150
+ "aria-label": "Banner dates",
151
+ withTime: false,
152
+ defaultValue: {
153
+ start: "2026-10-05",
154
+ end: ""
155
+ },
156
+ endOptional: true,
157
+ today: TODAY
158
+ })
159
+ }) })
160
+ }),
161
+ /* @__PURE__ */ jsx(Section$1, {
162
+ id: "accessibility",
163
+ title: "Accessibility",
164
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
165
+ "The pair is a group named by aria-label. The fields are named by their labels, Starts and Ends (with an optional end, by its name behind the checkbox).",
166
+ "The shared error and the hint are the description of both fields.",
167
+ "Clearing the end because the start passed it is said by a polite status that was in the page from the start."
168
+ ] })
169
+ }),
170
+ /* @__PURE__ */ jsx(Section$1, {
171
+ id: "props",
172
+ title: "Props",
173
+ children: /* @__PURE__ */ jsx(PropsTable, { rows: [
174
+ {
175
+ name: "value",
176
+ type: "ScheduleValue",
177
+ description: "{ start, end }: YYYY-MM-DDTHH:mm each (YYYY-MM-DD without a time), '' for none."
178
+ },
179
+ {
180
+ name: "defaultValue",
181
+ type: "ScheduleValue",
182
+ description: "The starting value when uncontrolled."
183
+ },
184
+ {
185
+ name: "onChange",
186
+ type: "(value: ScheduleValue) => void",
187
+ description: "Called with both when either changes, and when the end is cleared or put back."
188
+ },
189
+ {
190
+ name: "withTime",
191
+ type: "boolean",
192
+ default: "true",
193
+ description: "Each field takes a time as well as a date."
194
+ },
195
+ {
196
+ name: "endOptional",
197
+ type: "boolean",
198
+ default: "false",
199
+ description: "The end waits behind Set an end date while there is none."
200
+ },
201
+ {
202
+ name: "min / max",
203
+ type: "string",
204
+ description: "The earliest start and the latest end."
205
+ },
206
+ {
207
+ name: "error",
208
+ type: "ReactNode",
209
+ description: "One error for the pair, under both."
210
+ },
211
+ {
212
+ name: "hint",
213
+ type: "ReactNode",
214
+ description: "A quiet line under the pair when there is no error."
215
+ },
216
+ {
217
+ name: "name",
218
+ type: "string",
219
+ description: "Submits name[start] and name[end]."
220
+ },
221
+ {
222
+ name: "labels",
223
+ type: "Partial<ScheduleLabels>",
224
+ description: "Starts, Ends, Set an end date and the cleared sentence. scheduleLabels is the English set."
225
+ },
226
+ {
227
+ name: "pickerLabels",
228
+ type: "Partial<DatePickerLabels>",
229
+ description: "The fields' words, for another language."
230
+ },
231
+ {
232
+ name: "…",
233
+ type: "",
234
+ description: "locale, hourCycle, size, disabled, readOnly and today, for both fields."
235
+ }
236
+ ] })
237
+ }),
238
+ /* @__PURE__ */ jsx(Fragment$1, {})
239
+ ]
240
+ });
241
+ }
242
+ //#endregion
243
+ export { Page, Preview };