@orbitcommerce/constellation-docs 1.0.0 → 1.2.1

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-BvxQWBTy.js +403 -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-CXZ3V1d4.js +1612 -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-hg7txTc3.js +1381 -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-DRUWNVHP.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-D3a3QGKJ.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-BSfEqHY8.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-BCPvtP8J.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-CbiibLwn.js} +581 -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-CNR7zpf7.js +594 -0
  155. package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.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-mq_pNXza.js +3232 -0
  202. package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -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 +10989 -1108
  227. package/package.json +3 -3
  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,956 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section$1, i as DocPage, m as ThemePair, n as CodeBlock$1, o as Example, p as SubSection, r as DoDont, 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 { Button, DateInput, Field } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/date-input.tsx
8
+ function Preview() {
9
+ return /* @__PURE__ */ jsx("div", {
10
+ className: "date-input-preview",
11
+ children: /* @__PURE__ */ jsx(DateInput, {
12
+ "aria-label": "Hold until",
13
+ defaultValue: "2026-10-02",
14
+ size: "md"
15
+ })
16
+ });
17
+ }
18
+ /** What the page holds, as text: the state of the native input it replaced. */
19
+ function Readout({ name, value }) {
20
+ return /* @__PURE__ */ jsxs("p", {
21
+ className: "date-input-readout",
22
+ children: [/* @__PURE__ */ jsx("span", {
23
+ className: "date-input-readout__name",
24
+ children: name
25
+ }), /* @__PURE__ */ jsx("code", { children: JSON.stringify(value) })]
26
+ });
27
+ }
28
+ function HoldUntil({ withTime = false, initial }) {
29
+ const [value, setValue] = useState(initial);
30
+ return /* @__PURE__ */ jsxs("div", {
31
+ className: "date-input-demo",
32
+ children: [/* @__PURE__ */ jsx(Field, {
33
+ label: withTime ? "Publish at" : "Hold until",
34
+ children: /* @__PURE__ */ jsx(DateInput, {
35
+ value,
36
+ onChange: setValue,
37
+ withTime
38
+ })
39
+ }), /* @__PURE__ */ jsx(Readout, {
40
+ name: "state",
41
+ value
42
+ })]
43
+ });
44
+ }
45
+ function Window() {
46
+ const [value, setValue] = useState("2026-10-12");
47
+ return /* @__PURE__ */ jsxs("div", {
48
+ className: "date-input-demo",
49
+ children: [/* @__PURE__ */ jsx(Field, {
50
+ label: "Delivery date",
51
+ hint: "We deliver from 5 to 20 October.",
52
+ children: /* @__PURE__ */ jsx(DateInput, {
53
+ value,
54
+ onChange: setValue,
55
+ min: "2026-10-05",
56
+ max: "2026-10-20"
57
+ })
58
+ }), /* @__PURE__ */ jsx(Readout, {
59
+ name: "state",
60
+ value
61
+ })]
62
+ });
63
+ }
64
+ /** A date years away: the calendar offers a month and a year to choose from. */
65
+ function BornOn() {
66
+ const [value, setValue] = useState("1988-04-17");
67
+ return /* @__PURE__ */ jsxs("div", {
68
+ className: "date-input-demo",
69
+ children: [/* @__PURE__ */ jsx(Field, {
70
+ label: "Date of birth",
71
+ hint: "Type it, or choose the year and the month, then the day.",
72
+ children: /* @__PURE__ */ jsx(DateInput, {
73
+ value,
74
+ onChange: setValue,
75
+ max: "2026-10-02"
76
+ })
77
+ }), /* @__PURE__ */ jsx(Readout, {
78
+ name: "state",
79
+ value
80
+ })]
81
+ });
82
+ }
83
+ /** Typed text that is not a date, or not one in reach, is said under the field. */
84
+ function Typing() {
85
+ const [value, setValue] = useState("");
86
+ return /* @__PURE__ */ jsxs("div", {
87
+ className: "date-input-demo",
88
+ children: [/* @__PURE__ */ jsx(Field, {
89
+ label: "Delivery date",
90
+ hint: "We deliver from 5 to 20 October.",
91
+ children: /* @__PURE__ */ jsx(DateInput, {
92
+ value,
93
+ onChange: setValue,
94
+ min: "2026-10-05",
95
+ max: "2026-10-20"
96
+ })
97
+ }), /* @__PURE__ */ jsx(Readout, {
98
+ name: "state",
99
+ value
100
+ })]
101
+ });
102
+ }
103
+ function TimeWindow() {
104
+ const [value, setValue] = useState("2026-10-12T10:00");
105
+ return /* @__PURE__ */ jsxs("div", {
106
+ className: "date-input-demo",
107
+ children: [/* @__PURE__ */ jsx(Field, {
108
+ label: "Collection slot",
109
+ hint: "Slots open at 09:00 on 12 October and close at 17:30 on the 14th.",
110
+ children: /* @__PURE__ */ jsx(DateInput, {
111
+ withTime: true,
112
+ value,
113
+ onChange: setValue,
114
+ min: "2026-10-12T09:00",
115
+ max: "2026-10-14T17:30"
116
+ })
117
+ }), /* @__PURE__ */ jsx(Readout, {
118
+ name: "state",
119
+ value
120
+ })]
121
+ });
122
+ }
123
+ function Expiry() {
124
+ const [value, setValue] = useState("");
125
+ const [tried, setTried] = useState(false);
126
+ return /* @__PURE__ */ jsxs("div", {
127
+ className: "date-input-demo",
128
+ children: [/* @__PURE__ */ jsx(Field, {
129
+ label: "Expiry date",
130
+ error: tried && !value ? "Choose an expiry date." : void 0,
131
+ children: /* @__PURE__ */ jsx(DateInput, {
132
+ value,
133
+ onChange: setValue,
134
+ clearable: false
135
+ })
136
+ }), /* @__PURE__ */ jsxs("div", {
137
+ className: "date-input-form__footer",
138
+ children: [/* @__PURE__ */ jsx(Readout, {
139
+ name: "state",
140
+ value
141
+ }), /* @__PURE__ */ jsx(Button, {
142
+ size: "sm",
143
+ variant: "primary",
144
+ onClick: () => setTried(true),
145
+ children: "Create key"
146
+ })]
147
+ })]
148
+ });
149
+ }
150
+ function SubmitForm() {
151
+ const [sent, setSent] = useState();
152
+ const submit = (event) => {
153
+ event.preventDefault();
154
+ const data = new FormData(event.currentTarget);
155
+ setSent(JSON.stringify({
156
+ startsOn: data.get("startsOn"),
157
+ endsAt: data.get("endsAt")
158
+ }));
159
+ };
160
+ return /* @__PURE__ */ jsxs("form", {
161
+ className: "date-input-form",
162
+ onSubmit: submit,
163
+ noValidate: true,
164
+ children: [
165
+ /* @__PURE__ */ jsx(Field, {
166
+ label: "Starts on",
167
+ children: /* @__PURE__ */ jsx(DateInput, {
168
+ name: "startsOn",
169
+ defaultValue: "2026-10-02"
170
+ })
171
+ }),
172
+ /* @__PURE__ */ jsx(Field, {
173
+ label: "Ends at",
174
+ hint: "Leave it empty to run until you end it.",
175
+ children: /* @__PURE__ */ jsx(DateInput, {
176
+ name: "endsAt",
177
+ withTime: true
178
+ })
179
+ }),
180
+ /* @__PURE__ */ jsxs("div", {
181
+ className: "date-input-form__footer",
182
+ children: [/* @__PURE__ */ jsx(Button, {
183
+ type: "submit",
184
+ variant: "primary",
185
+ size: "sm",
186
+ children: "Submit"
187
+ }), sent ? /* @__PURE__ */ jsxs("p", {
188
+ className: "date-input-readout",
189
+ children: [/* @__PURE__ */ jsx("span", {
190
+ className: "date-input-readout__name",
191
+ children: "FormData"
192
+ }), /* @__PURE__ */ jsx("code", { children: sent })]
193
+ }) : null]
194
+ })
195
+ ]
196
+ });
197
+ }
198
+ function StateGrid() {
199
+ const one = (name, field) => /* @__PURE__ */ jsxs("figure", {
200
+ className: "date-input-state",
201
+ children: [/* @__PURE__ */ jsx("span", {
202
+ className: "date-input-state__name",
203
+ children: name
204
+ }), field]
205
+ });
206
+ return /* @__PURE__ */ jsxs("div", {
207
+ className: "date-input-states",
208
+ children: [
209
+ one("Empty", /* @__PURE__ */ jsx(DateInput, {
210
+ "aria-label": "Empty",
211
+ value: ""
212
+ })),
213
+ one("Filled", /* @__PURE__ */ jsx(DateInput, {
214
+ "aria-label": "Filled",
215
+ value: "2026-10-02"
216
+ })),
217
+ one("With a time", /* @__PURE__ */ jsx(DateInput, {
218
+ "aria-label": "With a time",
219
+ withTime: true,
220
+ value: "2026-10-02T09:30"
221
+ })),
222
+ one("Invalid", /* @__PURE__ */ jsx(Field, {
223
+ label: "Expiry date",
224
+ error: "That date has passed.",
225
+ children: /* @__PURE__ */ jsx(DateInput, { value: "2026-09-01" })
226
+ })),
227
+ one("Disabled", /* @__PURE__ */ jsx(DateInput, {
228
+ "aria-label": "Disabled",
229
+ value: "2026-10-02",
230
+ disabled: true
231
+ })),
232
+ one("Read only", /* @__PURE__ */ jsx(DateInput, {
233
+ "aria-label": "Read only",
234
+ value: "2026-10-02",
235
+ readOnly: true
236
+ }))
237
+ ]
238
+ });
239
+ }
240
+ function Sizes() {
241
+ return /* @__PURE__ */ jsxs("div", {
242
+ className: "date-input-sizes",
243
+ children: [
244
+ /* @__PURE__ */ jsx(DateInput, {
245
+ "aria-label": "Small",
246
+ size: "sm",
247
+ value: "2026-10-02",
248
+ style: { width: 176 }
249
+ }),
250
+ /* @__PURE__ */ jsx(DateInput, {
251
+ "aria-label": "Medium",
252
+ size: "md",
253
+ value: "2026-10-02",
254
+ style: { width: 200 }
255
+ }),
256
+ /* @__PURE__ */ jsx(DateInput, {
257
+ "aria-label": "Large",
258
+ size: "lg",
259
+ value: "2026-10-02",
260
+ style: { width: 224 }
261
+ })
262
+ ]
263
+ });
264
+ }
265
+ function Page() {
266
+ return /* @__PURE__ */ jsxs(DocPage, {
267
+ title: "Date input",
268
+ status: "new",
269
+ importNames: ["DateInput"],
270
+ lead: "The date picker for a form that keeps what a native date input holds: a string. Its value and onChange speak YYYY-MM-DD, or YYYY-MM-DDTHH:mm with a time, and '' for none, so a page swaps its input for it without touching its state. A date can be typed as well as picked, and the calendar has a month and a year to choose from.",
271
+ children: [
272
+ /* @__PURE__ */ jsxs(Section$1, {
273
+ id: "swap",
274
+ title: "Swapping a native input",
275
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
276
+ "A native ",
277
+ /* @__PURE__ */ jsx("code", { children: "<input type=\"date\">" }),
278
+ " holds a string, ",
279
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DD" }),
280
+ ", and a page keeps that string in state and sends it to the server. ",
281
+ /* @__PURE__ */ jsx("code", { children: "DateInput" }),
282
+ " holds the same string. Only the picker changes: it opens Constellation's calendar instead of the browser's own, and what it reads and writes is the local day, so ",
283
+ /* @__PURE__ */ jsx("code", { children: "2026-10-02" }),
284
+ " is that day wherever the browser is and never slips to the day before. A date can still be typed, as a native input's can."
285
+ ] }), /* @__PURE__ */ jsx("p", { children: "Pick a day, then clear it, and watch the state." })] }),
286
+ children: [
287
+ /* @__PURE__ */ jsx(Example, {
288
+ code: `
289
+ import { DateInput } from '@orbitcommerce/constellation'
290
+
291
+ // Before
292
+ <input type="date" value={holdUntil} onChange={(event) => setHoldUntil(event.target.value)} />
293
+
294
+ // After: holdUntil is still 'YYYY-MM-DD', and '' for none
295
+ <DateInput value={holdUntil} onChange={setHoldUntil} />`,
296
+ caption: "The state is a string, not a Date. Clearing the field gives an empty string, never null.",
297
+ children: /* @__PURE__ */ jsx(HoldUntil, { initial: "2026-10-02" })
298
+ }),
299
+ /* @__PURE__ */ jsx(DocTable, {
300
+ columns: ["Native input", "DateInput"],
301
+ rows: [
302
+ [/* @__PURE__ */ jsx("code", { children: "type=\"date\"" }), /* @__PURE__ */ jsx(Fragment$1, { children: "The default: a text field you can type into, with a calendar beside it." })],
303
+ [/* @__PURE__ */ jsx("code", { children: "type=\"datetime-local\"" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
304
+ /* @__PURE__ */ jsx("code", { children: "withTime" }),
305
+ ". The string is ",
306
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DDTHH:mm" }),
307
+ ", typed as a date and a time, or picked from the calendar and its time row."
308
+ ] })],
309
+ [/* @__PURE__ */ jsx("code", { children: "value" }), /* @__PURE__ */ jsx(Fragment$1, { children: "The same string. Empty, null and text that is not a date show no date." })],
310
+ [/* @__PURE__ */ jsx("code", { children: "onChange" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
311
+ /* @__PURE__ */ jsx("code", { children: "onChange={(value) => set(value)}" }),
312
+ ": called with the string, not an event, and with ",
313
+ /* @__PURE__ */ jsx("code", { children: "''" }),
314
+ " once cleared."
315
+ ] })],
316
+ [/* @__PURE__ */ jsxs(Fragment$1, { children: [
317
+ /* @__PURE__ */ jsx("code", { children: "min" }),
318
+ ", ",
319
+ /* @__PURE__ */ jsx("code", { children: "max" })
320
+ ] }), /* @__PURE__ */ jsx(Fragment$1, { children: "The same strings." })],
321
+ [/* @__PURE__ */ jsxs(Fragment$1, { children: [
322
+ /* @__PURE__ */ jsx("code", { children: "disabled" }),
323
+ ", ",
324
+ /* @__PURE__ */ jsx("code", { children: "readOnly" })
325
+ ] }), "The same."],
326
+ [/* @__PURE__ */ jsx("code", { children: "name" }), /* @__PURE__ */ jsx(Fragment$1, { children: "The same: the value is submitted with the form as the same string." })],
327
+ [/* @__PURE__ */ jsx("code", { children: "aria-invalid" }), /* @__PURE__ */ jsx(Fragment$1, { children: "The same, and it gives the error look." })],
328
+ [/* @__PURE__ */ jsx("code", { children: "required" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
329
+ "Turn ",
330
+ /* @__PURE__ */ jsx("code", { children: "clearable" }),
331
+ " off, and check on submit, showing ",
332
+ /* @__PURE__ */ jsx("code", { children: "error" }),
333
+ " on the Field."
334
+ ] })]
335
+ ]
336
+ }),
337
+ /* @__PURE__ */ jsx(SubSection, {
338
+ title: "A form library, or a handler written for an event",
339
+ description: /* @__PURE__ */ jsxs("p", { children: [
340
+ /* @__PURE__ */ jsx("code", { children: "onChange" }),
341
+ " is called with the string, not an event. A handler written for the native input (",
342
+ /* @__PURE__ */ jsx("code", { children: "(event) => set(event.target.value)" }),
343
+ ") throws on the first change with nothing said at build time in a ",
344
+ /* @__PURE__ */ jsx("code", { children: ".jsx" }),
345
+ " file, so change it to take the string. A form library that spreads its",
346
+ " ",
347
+ /* @__PURE__ */ jsx("code", { children: "register" }),
348
+ " props expects an event too: use its controlled form instead."
349
+ ] }),
350
+ children: /* @__PURE__ */ jsx(CodeBlock$1, { code: `
351
+ // Before: react-hook-form's register
352
+ <input type="date" {...register('startsOn')} />
353
+
354
+ // After: a Controller, which hands the string to the field.
355
+ // The ref goes to the text input, and onBlur is the library's.
356
+ <Controller
357
+ name="startsOn"
358
+ control={control}
359
+ render={({ field }) => (
360
+ <DateInput ref={field.ref} name={field.name} value={field.value ?? ''} onChange={field.onChange} onBlur={field.onBlur} />
361
+ )}
362
+ />
363
+
364
+ // A plain handler: take the string, not the event
365
+ <DateInput value={holdUntil} onChange={(value) => setHoldUntil(value)} />` })
366
+ })
367
+ ]
368
+ }),
369
+ /* @__PURE__ */ jsxs(Section$1, {
370
+ id: "typing",
371
+ title: "Typing a date",
372
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
373
+ "The field is a text input with a calendar button after it. It reads the locale's numeric short date,",
374
+ " ",
375
+ /* @__PURE__ */ jsx("code", { children: "25/12/2026" }),
376
+ " in British English and ",
377
+ /* @__PURE__ */ jsx("code", { children: "12/25/2026" }),
378
+ " in en-US, and ",
379
+ /* @__PURE__ */ jsx("code", { children: "2026-12-25" }),
380
+ " in any language, with any separators between the three numbers. The year has four digits and the day must be on the calendar. A month name (",
381
+ /* @__PURE__ */ jsx("code", { children: "25 Dec 2026" }),
382
+ ") and a two-digit year (",
383
+ /* @__PURE__ */ jsx("code", { children: "25/12/26" }),
384
+ ") are not read: the field says so rather than guess, since ",
385
+ /* @__PURE__ */ jsx("code", { children: "12/10" }),
386
+ " is two different days and ",
387
+ /* @__PURE__ */ jsx("code", { children: "26" }),
388
+ " is two different years."
389
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
390
+ "A day is taken as soon as the text is one, and the text is read again when it is left or Enter is pressed (Enter still submits a form). Text that is not a date, a day outside ",
391
+ /* @__PURE__ */ jsx("code", { children: "min" }),
392
+ " and ",
393
+ /* @__PURE__ */ jsx("code", { children: "max" }),
394
+ ", or one that ",
395
+ /* @__PURE__ */ jsx("code", { children: "disabledDays" }),
396
+ " rules out, makes the field invalid and says why under it, in a status a screen reader hears. The value is then ",
397
+ /* @__PURE__ */ jsx("code", { children: "''" }),
398
+ ": it never holds a string that is not a date."
399
+ ] })] }),
400
+ children: [
401
+ /* @__PURE__ */ jsx(Example, {
402
+ code: `
403
+ <Field label="Delivery date" hint="We deliver from 5 to 20 October.">
404
+ <DateInput value={day} onChange={setDay} min="2026-10-05" max="2026-10-20" />
405
+ </Field>`,
406
+ caption: "Type 04/10/2026, or 31/12, and leave the field. Then type 12/10/2026.",
407
+ children: /* @__PURE__ */ jsx(Typing, {})
408
+ }),
409
+ /* @__PURE__ */ jsx(DocTable, {
410
+ columns: ["Typed in en-GB", "Read as"],
411
+ rows: [
412
+ [/* @__PURE__ */ jsx("code", { children: "2/10/2026" }), "2 October 2026"],
413
+ [/* @__PURE__ */ jsx("code", { children: "02.10.2026" }), "2 October 2026: any separators, and a day or a month of one digit"],
414
+ [/* @__PURE__ */ jsx("code", { children: "2026-10-02" }), "2 October 2026: a year first is always year, month, day"],
415
+ [/* @__PURE__ */ jsx("code", { children: "25/12" }), "Not a date: the year is missing"],
416
+ [/* @__PURE__ */ jsx("code", { children: "2 Oct 2026" }), "Not a date: no month names"],
417
+ [/* @__PURE__ */ jsx("code", { children: "02/10/26" }), "Not a date: the year is four digits"]
418
+ ]
419
+ }),
420
+ /* @__PURE__ */ jsx(Guidelines, { items: [
421
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
422
+ "The field writes the date the way the locale does, so a page in German shows ",
423
+ /* @__PURE__ */ jsx("code", { children: "02.10.2026" }),
424
+ " and one in Japanese ",
425
+ /* @__PURE__ */ jsx("code", { children: "2026/10/02" }),
426
+ ". The hint while it is empty is the shape in the locale's order,",
427
+ " ",
428
+ /* @__PURE__ */ jsx("code", { children: "dd/mm/yyyy" }),
429
+ " in British English, built from three words in ",
430
+ /* @__PURE__ */ jsx("code", { children: "labels" }),
431
+ " (",
432
+ /* @__PURE__ */ jsx("code", { children: "dayHint" }),
433
+ ",",
434
+ " ",
435
+ /* @__PURE__ */ jsx("code", { children: "monthHint" }),
436
+ " and ",
437
+ /* @__PURE__ */ jsx("code", { children: "yearHint" }),
438
+ ", which are ",
439
+ /* @__PURE__ */ jsx("code", { children: "dd" }),
440
+ ", ",
441
+ /* @__PURE__ */ jsx("code", { children: "mm" }),
442
+ " and ",
443
+ /* @__PURE__ */ jsx("code", { children: "yyyy" }),
444
+ " ",
445
+ "until you pass your own, such as ",
446
+ /* @__PURE__ */ jsx("code", { children: "tt" }),
447
+ ", ",
448
+ /* @__PURE__ */ jsx("code", { children: "mm" }),
449
+ " and ",
450
+ /* @__PURE__ */ jsx("code", { children: "jjjj" }),
451
+ " for ",
452
+ /* @__PURE__ */ jsx("code", { children: "tt.mm.jjjj" }),
453
+ "). The dashboard entry's ",
454
+ /* @__PURE__ */ jsx("code", { children: "DateInput" }),
455
+ " fills them from its catalogue, in the words the browser's own date field uses in each of the 20 languages. ",
456
+ /* @__PURE__ */ jsx("code", { children: "placeholder" }),
457
+ " replaces the whole hint."
458
+ ] }),
459
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
460
+ "A language whose own date the field could not read back (Bulgarian writes ",
461
+ /* @__PURE__ */ jsx("code", { children: "04.03.2026 г." }),
462
+ ", Kyrgyz the year, the day and then the month) writes and hints ",
463
+ /* @__PURE__ */ jsx("code", { children: "2026-03-04" }),
464
+ " instead, so it never shows a day it would read as another."
465
+ ] }),
466
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
467
+ /* @__PURE__ */ jsx("code", { children: "format" }),
468
+ " does not apply to a typed field, which always writes the numeric short date: a name like ",
469
+ /* @__PURE__ */ jsx("code", { children: "Oct" }),
470
+ " is a word to read, not to type."
471
+ ] }),
472
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "typed={false}" }), " keeps the field a button that only opens the calendar, with or without a time."] }),
473
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
474
+ "The sentence under a typed field is inside it: two fields side by side (a start and an end) are one item each in a flex row or a grid, and take a width like ",
475
+ /* @__PURE__ */ jsx("code", { children: "w-44" }),
476
+ " from ",
477
+ /* @__PURE__ */ jsx("code", { children: "className" }),
478
+ ". Align the row to the top (",
479
+ /* @__PURE__ */ jsx("code", { children: "items-start" }),
480
+ "): in a row aligned to the middle, the field that gains a sentence grows downward and the other moves with the row's centre."
481
+ ] }),
482
+ "Tab goes from the text to the calendar button. Down arrow in the text opens the calendar too, and focus goes back to the text when it closes."
483
+ ] })
484
+ ]
485
+ }),
486
+ /* @__PURE__ */ jsx(Section$1, {
487
+ id: "years",
488
+ title: "A date years away",
489
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
490
+ "When the days that can be picked run for more than a year (no ",
491
+ /* @__PURE__ */ jsx("code", { children: "min" }),
492
+ " and ",
493
+ /* @__PURE__ */ jsx("code", { children: "max" }),
494
+ " is more than a year), the calendar has a month and a year to choose from in place of the month's name. They are the browser's own selects, named Month and Year, so a birth date or an old invoice is two choices and a day. With no limits the years run from a hundred years back to twenty on, and always take in the date on show. One limit moves the other end with it: a ",
495
+ /* @__PURE__ */ jsx("code", { children: "max" }),
496
+ " of 1900 lists 1800 to 1900, and a ",
497
+ /* @__PURE__ */ jsx("code", { children: "min" }),
498
+ " of 2100 lists 2100 to 2120. Limits under a year apart keep the arrows: there is nothing to choose between."
499
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
500
+ "This is on for a ",
501
+ /* @__PURE__ */ jsx("code", { children: "DateInput" }),
502
+ " (",
503
+ /* @__PURE__ */ jsx("code", { children: "captionLayout=\"auto\"" }),
504
+ ") because it replaces a native date input, where a date years away is a real case. The",
505
+ " ",
506
+ /* @__PURE__ */ jsx(DocLink, {
507
+ to: "/components/date-picker",
508
+ children: "DatePicker"
509
+ }),
510
+ " and the dashboard entry's date picker keep the month's name between the arrows unless asked, as they always did:",
511
+ " ",
512
+ /* @__PURE__ */ jsx("code", { children: "captionLayout=\"label\"" }),
513
+ " here switches the selects off, and",
514
+ " ",
515
+ /* @__PURE__ */ jsx("code", { children: "captionLayout=\"dropdown\"" }),
516
+ " on a date picker switches them on."
517
+ ] })] }),
518
+ children: /* @__PURE__ */ jsx(Example, {
519
+ code: `
520
+ <Field label="Date of birth">
521
+ <DateInput value={born} onChange={setBorn} max="2026-10-02" />
522
+ </Field>`,
523
+ caption: "Open the calendar and choose 1975 and then March.",
524
+ children: /* @__PURE__ */ jsx(BornOn, {})
525
+ })
526
+ }),
527
+ /* @__PURE__ */ jsx(Section$1, {
528
+ id: "time",
529
+ title: "With a time",
530
+ description: /* @__PURE__ */ jsxs("p", { children: [
531
+ /* @__PURE__ */ jsx("code", { children: "withTime" }),
532
+ " adds the time: typed in the field after the date, as hours and minutes that move on as they fill (the parts of a ",
533
+ /* @__PURE__ */ jsx(DocLink, {
534
+ to: "/components/time-input",
535
+ children: "time input"
536
+ }),
537
+ "), and under the calendar as its time row, the two kept as one time. A 24-hour clock unless ",
538
+ /* @__PURE__ */ jsx("code", { children: "hourCycle={12}" }),
539
+ " asks for am and pm. The string is the ",
540
+ /* @__PURE__ */ jsx("code", { children: "datetime-local" }),
541
+ " one, ",
542
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DDTHH:mm" }),
543
+ ", in local time, given once the date and the time are both whole; until then it is ",
544
+ /* @__PURE__ */ jsx("code", { children: "''" }),
545
+ ", and a field left with a date but no whole time says \"Enter a time like 09:30.\" Moving the day keeps the time, so a 16:30 deadline moved to Friday is still at 16:30. A day picked from the calendar takes the time typed before it. A whole date typed on to its end moves on to the hours, as the right arrow at its end does; the left arrow in the hours goes back to the date. ",
546
+ /* @__PURE__ */ jsx("code", { children: "typed={false}" }),
547
+ " keeps the button that reads ",
548
+ /* @__PURE__ */ jsx("code", { children: "02/10/2026, 16:30" }),
549
+ "."
550
+ ] }),
551
+ children: /* @__PURE__ */ jsx(Example, {
552
+ code: `
553
+ <DateInput withTime value={publishAt} onChange={setPublishAt} />
554
+
555
+ // publishAt: '2026-10-02T16:30'`,
556
+ children: /* @__PURE__ */ jsx(HoldUntil, {
557
+ withTime: true,
558
+ initial: "2026-10-02T16:30"
559
+ })
560
+ })
561
+ }),
562
+ /* @__PURE__ */ jsxs(Section$1, {
563
+ id: "limits",
564
+ title: "Earliest and latest",
565
+ description: /* @__PURE__ */ jsxs("p", { children: [
566
+ /* @__PURE__ */ jsx("code", { children: "min" }),
567
+ " and ",
568
+ /* @__PURE__ */ jsx("code", { children: "max" }),
569
+ " take the same strings as the value. Days outside them are greyed out and cannot be picked, and the calendar stops at their months. With a time they hold to the minute: a time stepped in the calendar before ",
570
+ /* @__PURE__ */ jsx("code", { children: "min" }),
571
+ " is brought back to it, and one typed before it holds",
572
+ " ",
573
+ /* @__PURE__ */ jsx("code", { children: "''" }),
574
+ " and is said to be too early, with the limit's time."
575
+ ] }),
576
+ children: [
577
+ /* @__PURE__ */ jsx(Example, {
578
+ code: `
579
+ <Field label="Delivery date" hint="We deliver from 5 to 20 October.">
580
+ <DateInput value={day} onChange={setDay} min="2026-10-05" max="2026-10-20" />
581
+ </Field>`,
582
+ caption: "Open the calendar: the 4th and the 21st are out.",
583
+ children: /* @__PURE__ */ jsx(Window, {})
584
+ }),
585
+ /* @__PURE__ */ jsx(SubSection, {
586
+ title: "With a time",
587
+ children: /* @__PURE__ */ jsx(Example, {
588
+ code: `
589
+ <DateInput
590
+ withTime
591
+ value={slot}
592
+ onChange={setSlot}
593
+ min="2026-10-12T09:00"
594
+ max="2026-10-14T17:30"
595
+ />`,
596
+ caption: "Type 12/10/2026 and 08:00, then leave the field: it says the earliest slot.",
597
+ children: /* @__PURE__ */ jsx(TimeWindow, {})
598
+ })
599
+ }),
600
+ /* @__PURE__ */ jsx(Guidelines, { items: [/* @__PURE__ */ jsxs(Fragment$1, { children: [
601
+ "Build the limits from the page's own dates, with ",
602
+ /* @__PURE__ */ jsx("code", { children: "toISODate" }),
603
+ " (exported with the date picker):",
604
+ " ",
605
+ /* @__PURE__ */ jsx("code", { children: "min={toISODate(new Date())}" }),
606
+ " for \"not in the past\"."
607
+ ] }), "Explain the limits in the hint. A greyed-out day does not say why."] })
608
+ ]
609
+ }),
610
+ /* @__PURE__ */ jsxs(Section$1, {
611
+ id: "states",
612
+ title: "States",
613
+ description: /* @__PURE__ */ jsxs("p", { children: [
614
+ "Empty, filled, with a time, invalid, disabled and read only. The error look comes from ",
615
+ /* @__PURE__ */ jsx("code", { children: "invalid" }),
616
+ ", from the native input's ",
617
+ /* @__PURE__ */ jsx("code", { children: "aria-invalid" }),
618
+ ", from the ",
619
+ /* @__PURE__ */ jsx("code", { children: "error" }),
620
+ " of the ",
621
+ /* @__PURE__ */ jsx("code", { children: "Field" }),
622
+ " ",
623
+ "round it, which also says why, or from text typed into the field that is not a date, which says why under it. Read only shows the date and does not open."
624
+ ] }),
625
+ children: [
626
+ /* @__PURE__ */ jsx(Example, {
627
+ align: "fill",
628
+ code: `
629
+ <DateInput aria-label="Empty" value="" />
630
+ <DateInput aria-label="Filled" value="2026-10-02" />
631
+ <DateInput aria-label="With a time" withTime value="2026-10-02T09:30" />
632
+
633
+ <Field label="Expiry date" error="That date has passed.">
634
+ <DateInput value="2026-09-01" />
635
+ </Field>
636
+
637
+ <DateInput aria-label="Disabled" value="2026-10-02" disabled />
638
+ <DateInput aria-label="Read only" value="2026-10-02" readOnly />`,
639
+ children: /* @__PURE__ */ jsx(StateGrid, {})
640
+ }),
641
+ /* @__PURE__ */ jsx(SubSection, {
642
+ title: "Required",
643
+ description: /* @__PURE__ */ jsxs("p", { children: [
644
+ "The field can be emptied by default, as a native input can. For a date that must be given, turn",
645
+ " ",
646
+ /* @__PURE__ */ jsx("code", { children: "clearable" }),
647
+ " off, and when the form is submitted empty, show the error on the Field."
648
+ ] }),
649
+ children: /* @__PURE__ */ jsx(Example, {
650
+ code: `
651
+ <Field label="Expiry date" error={tried && !value ? 'Choose an expiry date.' : undefined}>
652
+ <DateInput value={value} onChange={setValue} clearable={false} />
653
+ </Field>`,
654
+ caption: "Press Create key with no date.",
655
+ children: /* @__PURE__ */ jsx(Expiry, {})
656
+ })
657
+ }),
658
+ /* @__PURE__ */ jsx(SubSection, {
659
+ title: "Sizes",
660
+ description: /* @__PURE__ */ jsxs("p", { children: [
661
+ /* @__PURE__ */ jsx("code", { children: "sm" }),
662
+ " is 30px, ",
663
+ /* @__PURE__ */ jsx("code", { children: "md" }),
664
+ " 36px (default) and ",
665
+ /* @__PURE__ */ jsx("code", { children: "lg" }),
666
+ " 44px: the heights of",
667
+ " ",
668
+ /* @__PURE__ */ jsx("code", { children: "Input" }),
669
+ " and ",
670
+ /* @__PURE__ */ jsx("code", { children: "Button" }),
671
+ ", so a date sits on a line with them. A date input is as wide as you make it (",
672
+ /* @__PURE__ */ jsx("code", { children: "className" }),
673
+ " or ",
674
+ /* @__PURE__ */ jsx("code", { children: "style" }),
675
+ "); 176px is enough for a date."
676
+ ] }),
677
+ children: /* @__PURE__ */ jsx(Example, {
678
+ code: `
679
+ <DateInput size="sm" style={{ width: 176 }} … />
680
+ <DateInput size="md" style={{ width: 200 }} … />
681
+ <DateInput size="lg" style={{ width: 224 }} … />`,
682
+ children: /* @__PURE__ */ jsx(Sizes, {})
683
+ })
684
+ })
685
+ ]
686
+ }),
687
+ /* @__PURE__ */ jsx(Section$1, {
688
+ id: "form",
689
+ title: "In a form",
690
+ description: /* @__PURE__ */ jsxs("p", { children: [
691
+ "Give it a ",
692
+ /* @__PURE__ */ jsx("code", { children: "name" }),
693
+ " and the value goes with the form as the same string, or an empty one:",
694
+ " ",
695
+ /* @__PURE__ */ jsx("code", { children: "startsOn=2026-10-02" }),
696
+ ". Inside a ",
697
+ /* @__PURE__ */ jsx("code", { children: "Field" }),
698
+ " the label names it and the hint or error is read with it; on its own, point a ",
699
+ /* @__PURE__ */ jsx("code", { children: "<label htmlFor>" }),
700
+ " at its ",
701
+ /* @__PURE__ */ jsx("code", { children: "id" }),
702
+ " or give it an",
703
+ " ",
704
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
705
+ "."
706
+ ] }),
707
+ children: /* @__PURE__ */ jsx(Example, {
708
+ align: "fill",
709
+ code: `
710
+ <form onSubmit={submit}>
711
+ <Field label="Starts on">
712
+ <DateInput name="startsOn" defaultValue="2026-10-02" />
713
+ </Field>
714
+ <Field label="Ends at" hint="Leave it empty to run until you end it.">
715
+ <DateInput name="endsAt" withTime />
716
+ </Field>
717
+ <Button type="submit" variant="primary">Submit</Button>
718
+ </form>`,
719
+ caption: "Submit it, change a date, and submit again.",
720
+ children: /* @__PURE__ */ jsx(SubmitForm, {})
721
+ })
722
+ }),
723
+ /* @__PURE__ */ jsx(Section$1, {
724
+ id: "both-themes",
725
+ title: "In both themes",
726
+ description: /* @__PURE__ */ jsx("p", { children: "The states, light and dark side by side. The field and its calendar are the date picker's." }),
727
+ children: /* @__PURE__ */ jsx(ThemePair, {
728
+ align: "fill",
729
+ children: /* @__PURE__ */ jsx(StateGrid, {})
730
+ })
731
+ }),
732
+ /* @__PURE__ */ jsxs(Section$1, {
733
+ id: "guidelines",
734
+ title: "Guidelines",
735
+ children: [/* @__PURE__ */ jsx(DoDont, {
736
+ do: {
737
+ children: /* @__PURE__ */ jsx("div", {
738
+ className: "date-input-demo",
739
+ children: /* @__PURE__ */ jsx(Field, {
740
+ label: "Expiry date",
741
+ error: "Choose a date after today.",
742
+ children: /* @__PURE__ */ jsx(DateInput, { value: "2026-09-01" })
743
+ })
744
+ }),
745
+ caption: "Say what is wrong and how to fix it, in the Field. The red edge alone does not."
746
+ },
747
+ dont: {
748
+ children: /* @__PURE__ */ jsx("div", {
749
+ className: "date-input-demo",
750
+ children: /* @__PURE__ */ jsx(Field, {
751
+ label: "Expiry date",
752
+ children: /* @__PURE__ */ jsx(DateInput, {
753
+ value: "2026-09-01",
754
+ invalid: true
755
+ })
756
+ })
757
+ }),
758
+ caption: "A red field with no reason leaves the person to guess."
759
+ }
760
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
761
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
762
+ "Keep the state a string and compare it as one: ",
763
+ /* @__PURE__ */ jsx("code", { children: "YYYY-MM-DD" }),
764
+ " strings sort the same as the days they name. Keep ",
765
+ /* @__PURE__ */ jsx("code", { children: "''" }),
766
+ " for none, not null, so it matches a form library's fields."
767
+ ] }),
768
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
769
+ "Use ",
770
+ /* @__PURE__ */ jsx(DocLink, {
771
+ to: "/components/date-picker",
772
+ children: "DatePicker"
773
+ }),
774
+ " when the page works in ",
775
+ /* @__PURE__ */ jsx("code", { children: "Date" }),
776
+ "s, and a range picker for a start and an end that belong together."
777
+ ] }),
778
+ "Label every field. A date with no label is a calendar glyph and a number."
779
+ ] })]
780
+ }),
781
+ /* @__PURE__ */ jsx(Section$1, {
782
+ id: "accessibility",
783
+ title: "Accessibility",
784
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
785
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
786
+ "A date is a text field, named by its label (or ",
787
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
788
+ "), and a button after it named \"Choose a date\" (",
789
+ /* @__PURE__ */ jsx("code", { children: "labels.chooseDate" }),
790
+ ") that opens the calendar. A label's ",
791
+ /* @__PURE__ */ jsx("code", { children: "htmlFor" }),
792
+ " reaches the text through ",
793
+ /* @__PURE__ */ jsx("code", { children: "id" }),
794
+ ". Tab goes from the text to the button, and the Down arrow in the text opens the calendar, after which focus goes back to the text (to the button, when the button opened it). With a time, the hours and minutes follow the text as spin buttons (and AM or PM on a 12-hour clock), described by the field's sentence, and the calendar button is named \"Choose a date and time\". With ",
795
+ /* @__PURE__ */ jsx("code", { children: "typed={false}" }),
796
+ ", the field is one button, named by its label and its date together: \"Publish at 02/10/2026, 16:30\", or \"Expiry date 2 Oct 2026\"."
797
+ ] }),
798
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
799
+ "Text that is not a date sets ",
800
+ /* @__PURE__ */ jsx("code", { children: "aria-invalid" }),
801
+ ", and its sentence is the field's description and is said by a polite status that was in the page before, so a screen reader hears it as the person leaves the field. A Field's hint or error is read with it. Read only keeps focus and says it will not open."
802
+ ] }),
803
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
804
+ "The month and the year of the calendar are two selects named Month and Year (",
805
+ /* @__PURE__ */ jsx("code", { children: "labels.monthDropdown" }),
806
+ ",",
807
+ " ",
808
+ /* @__PURE__ */ jsx("code", { children: "labels.yearDropdown" }),
809
+ "), reached by Tab and changed with the arrow keys or the list, and the month is announced as it changes. Keep the previous and next buttons for a step of one month."
810
+ ] }),
811
+ "The clear button is out of the tab order, as the date picker’s; on a field that is a button, Backspace or Delete clears it too.",
812
+ "Month and day names, the order the date is typed in, the first day of the week and the words follow the locale and labels you pass."
813
+ ] })
814
+ }),
815
+ /* @__PURE__ */ jsxs(Section$1, {
816
+ id: "props",
817
+ title: "Props",
818
+ children: [/* @__PURE__ */ jsx(PropsTable, {
819
+ title: "DateInput",
820
+ rows: [
821
+ {
822
+ name: "value",
823
+ type: "string | null",
824
+ description: "Controlled value: YYYY-MM-DD, or YYYY-MM-DDTHH:mm with withTime, in local time. '' or null shows no date, and so does text that is not a date."
825
+ },
826
+ {
827
+ name: "defaultValue",
828
+ type: "string | null",
829
+ description: "Starting value when uncontrolled, in the same form."
830
+ },
831
+ {
832
+ name: "onChange",
833
+ type: "(value: string) => void",
834
+ description: "Called with the new value in the same form when a day is picked, the time changes or the field is cleared: '' once cleared, never null. Never on mount."
835
+ },
836
+ {
837
+ name: "withTime",
838
+ type: "boolean",
839
+ default: "false",
840
+ description: "Adds the time, typed after the date and under the calendar, as a datetime-local input does."
841
+ },
842
+ {
843
+ name: "min",
844
+ type: "string",
845
+ description: "The earliest day (and time, with withTime), in the same form as value."
846
+ },
847
+ {
848
+ name: "max",
849
+ type: "string",
850
+ description: "The latest day (and time, with withTime), in the same form as value. A day alone is the whole of that day with a time."
851
+ },
852
+ {
853
+ name: "typed",
854
+ type: "boolean",
855
+ default: "true",
856
+ description: "Lets the date be typed (the locale's numeric short date, or YYYY-MM-DD), with a calendar button beside it. With withTime the time is typed too, after the date. false keeps a button that opens the calendar."
857
+ },
858
+ {
859
+ name: "captionLayout",
860
+ type: "'auto' | 'label' | 'dropdown' | 'dropdown-months' | 'dropdown-years'",
861
+ default: "'auto'",
862
+ description: "The calendar's caption. auto gives a month and a year to choose from when the days that can be picked run for more than a year, and the month's name between the arrows when they do not. The DatePicker's own default is label."
863
+ },
864
+ {
865
+ name: "clearable",
866
+ type: "boolean",
867
+ default: "true",
868
+ description: "Adds a clear button (and Backspace or Delete on a field that is a button) while there is a date. Turn it off for a date that is required."
869
+ },
870
+ {
871
+ name: "invalid",
872
+ type: "boolean",
873
+ description: "The error look and aria-invalid. Inside a Field, follows the Field's error."
874
+ },
875
+ {
876
+ name: "aria-invalid",
877
+ type: "boolean | 'true' | 'false'",
878
+ description: "The native input's attribute: when true it gives the error look as invalid does."
879
+ }
880
+ ]
881
+ }), /* @__PURE__ */ jsxs("p", {
882
+ className: "doc-section__description",
883
+ children: [
884
+ "Everything else is the ",
885
+ /* @__PURE__ */ jsx(DocLink, {
886
+ to: "/components/date-picker#props",
887
+ children: "DatePicker"
888
+ }),
889
+ "'s: ",
890
+ /* @__PURE__ */ jsx("code", { children: "size" }),
891
+ ",",
892
+ " ",
893
+ /* @__PURE__ */ jsx("code", { children: "placeholder" }),
894
+ ", ",
895
+ /* @__PURE__ */ jsx("code", { children: "disabled" }),
896
+ ", ",
897
+ /* @__PURE__ */ jsx("code", { children: "readOnly" }),
898
+ ", ",
899
+ /* @__PURE__ */ jsx("code", { children: "name" }),
900
+ ", ",
901
+ /* @__PURE__ */ jsx("code", { children: "id" }),
902
+ ",",
903
+ " ",
904
+ /* @__PURE__ */ jsx("code", { children: "locale" }),
905
+ ", ",
906
+ /* @__PURE__ */ jsx("code", { children: "hourCycle" }),
907
+ ", ",
908
+ /* @__PURE__ */ jsx("code", { children: "weekStartsOn" }),
909
+ ", ",
910
+ /* @__PURE__ */ jsx("code", { children: "disabledDays" }),
911
+ ", ",
912
+ /* @__PURE__ */ jsx("code", { children: "labels" }),
913
+ ",",
914
+ " ",
915
+ /* @__PURE__ */ jsx("code", { children: "format" }),
916
+ " (for a field that is a button: with a time it defaults to the numeric short date and the time,",
917
+ " ",
918
+ /* @__PURE__ */ jsx("code", { children: "02/10/2026, 09:30" }),
919
+ ", as the typed field writes its date), ",
920
+ /* @__PURE__ */ jsx("code", { children: "today" }),
921
+ ", the open state, and the native attributes, which go to the text input (or to the button, for a field that is one) along with the ",
922
+ /* @__PURE__ */ jsx("code", { children: "ref" }),
923
+ ". The",
924
+ " ",
925
+ /* @__PURE__ */ jsx("code", { children: "className" }),
926
+ " and ",
927
+ /* @__PURE__ */ jsx("code", { children: "style" }),
928
+ " of a typed field go to its outer element, which holds the field and the sentence under it, so it is one item in a flex row or a grid and takes a width such as",
929
+ " ",
930
+ /* @__PURE__ */ jsx("code", { children: "w-44" }),
931
+ " there. The sentences a typed field says are ",
932
+ /* @__PURE__ */ jsx("code", { children: "labels.invalidDate" }),
933
+ ",",
934
+ " ",
935
+ /* @__PURE__ */ jsx("code", { children: "dateTooEarly" }),
936
+ ", ",
937
+ /* @__PURE__ */ jsx("code", { children: "dateTooLate" }),
938
+ " and ",
939
+ /* @__PURE__ */ jsx("code", { children: "dateUnavailable" }),
940
+ "; its hint is built from",
941
+ " ",
942
+ /* @__PURE__ */ jsx("code", { children: "labels.dayHint" }),
943
+ ", ",
944
+ /* @__PURE__ */ jsx("code", { children: "monthHint" }),
945
+ " and ",
946
+ /* @__PURE__ */ jsx("code", { children: "yearHint" }),
947
+ ". Every word added to the label objects since 1.1.0 is optional, with an English default, so an object written for that version still fits."
948
+ ]
949
+ })]
950
+ }),
951
+ /* @__PURE__ */ jsx(Fragment$1, {})
952
+ ]
953
+ });
954
+ }
955
+ //#endregion
956
+ export { Page, Preview };