@orbitcommerce/constellation-docs 0.0.0-stage → 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 (232) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +6 -2
  3. package/dist/docs.css +20787 -0
  4. package/dist/index.d.ts +33 -0
  5. package/dist/index.js +308 -0
  6. package/dist/pages/Playground-Mk1yIWXb.js +129 -0
  7. package/dist/pages/_address-data-L9BR499w.js +161 -0
  8. package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
  9. package/dist/pages/_card-art-0be5ncyV.js +18 -0
  10. package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
  11. package/dist/pages/_figures-data-DaDvB7Nm.js +606 -0
  12. package/dist/pages/_foundations-blXWyYh8.js +30 -0
  13. package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
  14. package/dist/pages/_overlays-specimens-bawR331Z.js +320 -0
  15. package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
  16. package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
  17. package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
  18. package/dist/pages/address-block-BZOOOPA9.js +368 -0
  19. package/dist/pages/address-fields-CwSqro3W.js +277 -0
  20. package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
  21. package/dist/pages/alert-D3i7xZTU.js +914 -0
  22. package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
  23. package/dist/pages/app-shell-D4hdlHps.js +1558 -0
  24. package/dist/pages/area-chart-BEWFwiB2.js +718 -0
  25. package/dist/pages/avatar-BFEqQViw.js +895 -0
  26. package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
  27. package/dist/pages/badge-0-PyMrih.js +1035 -0
  28. package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
  29. package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
  30. package/dist/pages/board-card-D2tZY_mU.js +415 -0
  31. package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
  32. package/dist/pages/button-DAyfssDY.js +715 -0
  33. package/dist/pages/calendar-Ds7KsgSI.js +682 -0
  34. package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
  35. package/dist/pages/card-CQEM1_wc.js +1567 -0
  36. package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
  37. package/dist/pages/chart-legend-B20AbakD.js +724 -0
  38. package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
  39. package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
  40. package/dist/pages/checklist-card-DEyykVFS.js +783 -0
  41. package/dist/pages/chip-Ck-o3Ui6.js +839 -0
  42. package/dist/pages/chip-list-k1LxXuCi.js +414 -0
  43. package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
  44. package/dist/pages/coachmark-Be2ghobT.js +366 -0
  45. package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
  46. package/dist/pages/collab-field-CfqqK7d2.js +696 -0
  47. package/dist/pages/color-field-CZpfcA-A.js +1127 -0
  48. package/dist/pages/colour-q2ntvI0w.js +1974 -0
  49. package/dist/pages/column-mapper-TsTG39cl.js +502 -0
  50. package/dist/pages/combobox-DvK2j5tI.js +1334 -0
  51. package/dist/pages/command-palette-CJ7uBA04.js +1386 -0
  52. package/dist/pages/comment-box-CDSGYhr5.js +346 -0
  53. package/dist/pages/composer-D4B0NgpA.js +689 -0
  54. package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
  55. package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
  56. package/dist/pages/context-menu-F9DV30ia.js +487 -0
  57. package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
  58. package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
  59. package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
  60. package/dist/pages/date-input-GOW067EB.js +956 -0
  61. package/dist/pages/date-picker-GdBciR99.js +1569 -0
  62. package/dist/pages/date-time-BLKCXtVZ.js +678 -0
  63. package/dist/pages/delta-CNAGv8JY.js +779 -0
  64. package/dist/pages/description-list-BPeXn1eW.js +1268 -0
  65. package/dist/pages/device-switcher-BCaN99c1.js +554 -0
  66. package/dist/pages/dialog-CRpkRC98.js +3164 -0
  67. package/dist/pages/docs-lM2UBSir.js +520 -0
  68. package/dist/pages/doodle-nzkqi2UI.js +201 -0
  69. package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
  70. package/dist/pages/drill-menu-cskH5mol.js +490 -0
  71. package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
  72. package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
  73. package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
  74. package/dist/pages/empty-state-4U2txFpI.js +1113 -0
  75. package/dist/pages/facet-filters-McbBeY9e.js +353 -0
  76. package/dist/pages/figure-D-HF5vCj.js +563 -0
  77. package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
  78. package/dist/pages/figure-tabs-QOeQMY6N.js +578 -0
  79. package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
  80. package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
  81. package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
  82. package/dist/pages/form-grid-BfWCVlie.js +692 -0
  83. package/dist/pages/gallery-BBk2EOri.js +453 -0
  84. package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
  85. package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
  86. package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
  87. package/dist/pages/heatmap-BohgIcNk.js +507 -0
  88. package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
  89. package/dist/pages/home-dashboard-CxPmvduE.js +962 -0
  90. package/dist/pages/host-B6znjEgQ.js +109 -0
  91. package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
  92. package/dist/pages/hosted-field-BLh-53AE.js +208 -0
  93. package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
  94. package/dist/pages/icon-button-Bu4Gj5sy.js +1200 -0
  95. package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
  96. package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
  97. package/dist/pages/icons-CJ9Aar3d.js +736 -0
  98. package/dist/pages/image-cropper-NyougqLH.js +466 -0
  99. package/dist/pages/image-field-7knBv4mJ.js +567 -0
  100. package/dist/pages/import-result-CmTtGXW_.js +486 -0
  101. package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
  102. package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
  103. package/dist/pages/input-CzLCzfyx.js +2372 -0
  104. package/dist/pages/installation-C3UcpQJT.js +528 -0
  105. package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
  106. package/dist/pages/kanban-Dy9sPAI0.js +740 -0
  107. package/dist/pages/kbd-UNj4zqxn.js +545 -0
  108. package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
  109. package/dist/pages/line-chart-CntWxeMF.js +1117 -0
  110. package/dist/pages/link-CXqvAg9z.js +689 -0
  111. package/dist/pages/link-picker-BMFGCC67.js +478 -0
  112. package/dist/pages/link-row-x8yaUuWc.js +595 -0
  113. package/dist/pages/live-globe-95ROMhGQ.js +715 -0
  114. package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
  115. package/dist/pages/loading-state-BNbCo51C.js +556 -0
  116. package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
  117. package/dist/pages/logo-B38rnzoq.js +571 -0
  118. package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
  119. package/dist/pages/markdown-Ied72vMT.js +237 -0
  120. package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
  121. package/dist/pages/media-banner-DkStCia0.js +233 -0
  122. package/dist/pages/menu-NrLYKqKp.js +2132 -0
  123. package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
  124. package/dist/pages/meta-line-D5p2TycR.js +371 -0
  125. package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
  126. package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
  127. package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
  128. package/dist/pages/motion-CrXtiBvA.js +865 -0
  129. package/dist/pages/number-input-CuyMZg18.js +968 -0
  130. package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
  131. package/dist/pages/orbit-spinner-Dxv5qAhr.js +348 -0
  132. package/dist/pages/otp-input-CVRoX1mw.js +591 -0
  133. package/dist/pages/overview-LA9XRhZc.js +130 -0
  134. package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
  135. package/dist/pages/pagination-C1EgVtW4.js +294 -0
  136. package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
  137. package/dist/pages/password-field-DHEQKyUC.js +912 -0
  138. package/dist/pages/person-cell-BmjbADBz.js +564 -0
  139. package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
  140. package/dist/pages/plan-card-DRaA6RuB.js +621 -0
  141. package/dist/pages/plan-card-DtloWvMh.js +258 -0
  142. package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
  143. package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
  144. package/dist/pages/point-list-BbPmZjsm.js +222 -0
  145. package/dist/pages/popover-C3Oar9D5.js +1198 -0
  146. package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
  147. package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
  148. package/dist/pages/price-CRBLoa9h.js +604 -0
  149. package/dist/pages/principles-pnDyfHpK.js +483 -0
  150. package/dist/pages/print-page-BkLv6bW8.js +513 -0
  151. package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
  152. package/dist/pages/progress-CP_awmo4.js +904 -0
  153. package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
  154. package/dist/pages/radio-group-C-4tg6FS.js +1639 -0
  155. package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
  156. package/dist/pages/rating-CweKN2SX.js +471 -0
  157. package/dist/pages/record-layout-DUP_X0RL.js +719 -0
  158. package/dist/pages/record-pager-y9D7JFgb.js +278 -0
  159. package/dist/pages/registry-BZg-xAbi.js +594 -0
  160. package/dist/pages/release-Cs6tl16C.js +16 -0
  161. package/dist/pages/repeater-BRZYKRQa.js +1351 -0
  162. package/dist/pages/reply-feedback-BDnHprla.js +192 -0
  163. package/dist/pages/reveal-BygENBbL.js +460 -0
  164. package/dist/pages/rich-text-DOFQZEpT.js +156 -0
  165. package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
  166. package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
  167. package/dist/pages/rolling-number-GR3Cyfpz.js +529 -0
  168. package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
  169. package/dist/pages/rule-list-DTCmIMpT.js +648 -0
  170. package/dist/pages/save-status-B5KkyMZP.js +378 -0
  171. package/dist/pages/schedule-YycI95O1.js +243 -0
  172. package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
  173. package/dist/pages/search-field-D1uG7R6A.js +693 -0
  174. package/dist/pages/search-menu-DMuXyUUW.js +580 -0
  175. package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
  176. package/dist/pages/section-rail-BtTCETS5.js +637 -0
  177. package/dist/pages/section-v2Pubup9.js +639 -0
  178. package/dist/pages/segmented-control-D-FB1K1T.js +1190 -0
  179. package/dist/pages/select-DZ43NpOm.js +1434 -0
  180. package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
  181. package/dist/pages/separator-CFwqRvfO.js +428 -0
  182. package/dist/pages/serp-preview-BGwORjmo.js +346 -0
  183. package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
  184. package/dist/pages/shape-DzniHAVT.js +627 -0
  185. package/dist/pages/share-list-D4wgBxKN.js +926 -0
  186. package/dist/pages/side-panel-CCtkrZjs.js +811 -0
  187. package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
  188. package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
  189. package/dist/pages/skip-link-BxznhSkz.js +252 -0
  190. package/dist/pages/slider-CAoPURKD.js +774 -0
  191. package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
  192. package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
  193. package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
  194. package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
  195. package/dist/pages/sparkline-D3aavCly.js +947 -0
  196. package/dist/pages/split-bar-DYgZnFID.js +414 -0
  197. package/dist/pages/split-button-Be08-VI-.js +335 -0
  198. package/dist/pages/split-pane-lSNZgTKt.js +523 -0
  199. package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
  200. package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
  201. package/dist/pages/status-dot-D99gAGsV.js +567 -0
  202. package/dist/pages/stepper-CxKTbEA-.js +1093 -0
  203. package/dist/pages/success-mark-CqFTOBEu.js +142 -0
  204. package/dist/pages/swatch-H_kNvHuC.js +565 -0
  205. package/dist/pages/switch-C93K6j9h.js +617 -0
  206. package/dist/pages/table-CL0vomno.js +3225 -0
  207. package/dist/pages/tabs-Dh0mUsLw.js +1690 -0
  208. package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
  209. package/dist/pages/task-card-Dv0sR1-w.js +295 -0
  210. package/dist/pages/textarea-CCM-SnGN.js +949 -0
  211. package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
  212. package/dist/pages/time-input-CA9-uZAa.js +442 -0
  213. package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
  214. package/dist/pages/timeline-BsMUTlpR.js +1798 -0
  215. package/dist/pages/toast-zXLRiMRT.js +1391 -0
  216. package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
  217. package/dist/pages/toolbar-B9l_fHKy.js +754 -0
  218. package/dist/pages/tooltip-LHtCUkF-.js +826 -0
  219. package/dist/pages/translation-field-CTRXiF2N.js +251 -0
  220. package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
  221. package/dist/pages/tree-select-DU1qXHy_.js +492 -0
  222. package/dist/pages/tree-view-g_RjLtAb.js +739 -0
  223. package/dist/pages/typography-BSijtiRl.js +876 -0
  224. package/dist/pages/unit-input-Dml4fjmK.js +659 -0
  225. package/dist/pages/upload-rules-yozEzSah.js +419 -0
  226. package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
  227. package/dist/pages/value-change-CnubDKyO.js +489 -0
  228. package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
  229. package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
  230. package/dist/pages/working-status-CENemSsw.js +389 -0
  231. package/manifest.json +13001 -0
  232. package/package.json +35 -4
@@ -0,0 +1,913 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section$1, i as DocPage, l as Note, 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, Card, CardHeader, Checkbox, Field, FormGrid, FormGridItem, IconButton, Input, Select, SettingRow, SettingRows, Switch, Tooltip, useSettingRowControl } from "@orbitcommerce/constellation";
7
+ import { ArrowRightIcon, QuestionIcon } from "@orbitcommerce/constellation/icons";
8
+ //#region src/pages/components/setting-row.tsx
9
+ function Preview() {
10
+ return /* @__PURE__ */ jsx("div", {
11
+ className: "setting-row-preview",
12
+ children: /* @__PURE__ */ jsx(SettingRow, {
13
+ title: "Order emails",
14
+ description: "Sent when an order is placed.",
15
+ children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true })
16
+ })
17
+ });
18
+ }
19
+ function Help({ children, label }) {
20
+ return /* @__PURE__ */ jsx(Tooltip, {
21
+ content: children,
22
+ children: /* @__PURE__ */ jsx(IconButton, {
23
+ label,
24
+ size: "xs",
25
+ variant: "ghost",
26
+ children: /* @__PURE__ */ jsx(QuestionIcon, {})
27
+ })
28
+ });
29
+ }
30
+ function OrderEmails() {
31
+ const [on, setOn] = useState(true);
32
+ return /* @__PURE__ */ jsxs("div", {
33
+ className: "setting-row-stage",
34
+ children: [/* @__PURE__ */ jsx(SettingRow, {
35
+ title: "Order emails",
36
+ description: "Send a confirmation to the customer when an order is placed.",
37
+ help: /* @__PURE__ */ jsx(Help, {
38
+ label: "About order emails",
39
+ children: "Customers also get a receipt when it ships."
40
+ }),
41
+ children: /* @__PURE__ */ jsx(Switch, {
42
+ checked: on,
43
+ onCheckedChange: setOn
44
+ })
45
+ }), /* @__PURE__ */ jsxs("p", {
46
+ className: "setting-row-status",
47
+ "aria-live": "polite",
48
+ children: [
49
+ "Order emails are ",
50
+ on ? "on" : "off",
51
+ ". Press the title or the switch to change it."
52
+ ]
53
+ })]
54
+ });
55
+ }
56
+ function Controls() {
57
+ return /* @__PURE__ */ jsx("div", {
58
+ className: "setting-row-stage",
59
+ children: /* @__PURE__ */ jsxs(SettingRows, { children: [
60
+ /* @__PURE__ */ jsx(SettingRow, {
61
+ title: "Currency",
62
+ description: "What prices are shown in.",
63
+ controlWidth: "13rem",
64
+ children: /* @__PURE__ */ jsx(Select, {
65
+ defaultValue: "gbp",
66
+ options: [
67
+ {
68
+ value: "gbp",
69
+ label: "Pound sterling"
70
+ },
71
+ {
72
+ value: "eur",
73
+ label: "Euro"
74
+ },
75
+ {
76
+ value: "usd",
77
+ label: "US dollar"
78
+ }
79
+ ]
80
+ })
81
+ }),
82
+ /* @__PURE__ */ jsx(SettingRow, {
83
+ title: "Order number prefix",
84
+ description: "Shown before every order number.",
85
+ controlWidth: "13rem",
86
+ children: /* @__PURE__ */ jsx(Input, { placeholder: "e.g. ORD-" })
87
+ }),
88
+ /* @__PURE__ */ jsx(SettingRow, {
89
+ title: "Delivery rules",
90
+ description: "Where you ship, and what it costs.",
91
+ children: /* @__PURE__ */ jsx(Button, {
92
+ size: "sm",
93
+ variant: "secondary",
94
+ iconEnd: /* @__PURE__ */ jsx(ArrowRightIcon, {}),
95
+ children: "Manage"
96
+ })
97
+ })
98
+ ] })
99
+ });
100
+ }
101
+ /** A switch inside a component of your own. It passes the row's props on to the switch, so the row, told to name it, does; and the row finds it by the role it draws. */
102
+ function MirrorSwitch(props) {
103
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Switch, {
104
+ ...props,
105
+ defaultChecked: true
106
+ }) });
107
+ }
108
+ function Stacking() {
109
+ return /* @__PURE__ */ jsx("div", {
110
+ className: "setting-row-resize",
111
+ children: /* @__PURE__ */ jsxs(SettingRows, {
112
+ size: "sm",
113
+ children: [
114
+ /* @__PURE__ */ jsx(SettingRow, {
115
+ title: "Show search suggestions",
116
+ description: "A switch stays beside its words.",
117
+ children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true })
118
+ }),
119
+ /* @__PURE__ */ jsx(SettingRow, {
120
+ title: "Mirror to the storefront",
121
+ description: "A switch inside a component of yours too.",
122
+ labelControl: true,
123
+ children: /* @__PURE__ */ jsx(MirrorSwitch, {})
124
+ }),
125
+ /* @__PURE__ */ jsx(SettingRow, {
126
+ title: "Currency",
127
+ description: "Anything else drops under them.",
128
+ controlWidth: "13rem",
129
+ children: /* @__PURE__ */ jsx(Select, {
130
+ defaultValue: "gbp",
131
+ options: [{
132
+ value: "gbp",
133
+ label: "Pound sterling"
134
+ }, {
135
+ value: "eur",
136
+ label: "Euro"
137
+ }]
138
+ })
139
+ })
140
+ ]
141
+ })
142
+ });
143
+ }
144
+ var FIELDS = [
145
+ {
146
+ id: "name",
147
+ title: "Product name",
148
+ note: "Always searchable.",
149
+ locked: true
150
+ },
151
+ {
152
+ id: "sku",
153
+ title: "SKU and barcode",
154
+ note: "Product and variant codes."
155
+ },
156
+ {
157
+ id: "brand",
158
+ title: "Brand name",
159
+ note: "Match products by their brand."
160
+ },
161
+ {
162
+ id: "tags",
163
+ title: "Product tags",
164
+ note: "Match products by their tags."
165
+ }
166
+ ];
167
+ function SearchFields() {
168
+ const [on, setOn] = useState({
169
+ name: true,
170
+ sku: true,
171
+ brand: true,
172
+ tags: false
173
+ });
174
+ return /* @__PURE__ */ jsxs(Card, {
175
+ className: "setting-row-card",
176
+ children: [/* @__PURE__ */ jsx(CardHeader, {
177
+ title: "Built-in fields",
178
+ description: "Choose what storefront search looks at."
179
+ }), /* @__PURE__ */ jsx(SettingRows, {
180
+ size: "sm",
181
+ "aria-label": "Searchable fields",
182
+ children: FIELDS.map((field) => /* @__PURE__ */ jsx(SettingRow, {
183
+ title: field.title,
184
+ description: field.note,
185
+ children: /* @__PURE__ */ jsx(Switch, {
186
+ checked: on[field.id],
187
+ disabled: field.locked,
188
+ onCheckedChange: (next) => setOn((was) => ({
189
+ ...was,
190
+ [field.id]: next
191
+ }))
192
+ })
193
+ }, field.id))
194
+ })]
195
+ });
196
+ }
197
+ function Dependent() {
198
+ const [suggestions, setSuggestions] = useState(true);
199
+ const [names, setNames] = useState(true);
200
+ const [categories, setCategories] = useState(true);
201
+ return /* @__PURE__ */ jsx("div", {
202
+ className: "setting-row-stage",
203
+ children: /* @__PURE__ */ jsxs(SettingRows, {
204
+ "aria-label": "Search suggestions",
205
+ children: [
206
+ /* @__PURE__ */ jsx(SettingRow, {
207
+ title: "Show search suggestions",
208
+ description: "Offer matches as the visitor types.",
209
+ children: /* @__PURE__ */ jsx(Switch, {
210
+ checked: suggestions,
211
+ onCheckedChange: setSuggestions
212
+ })
213
+ }),
214
+ /* @__PURE__ */ jsx(SettingRow, {
215
+ indent: true,
216
+ disabled: !suggestions,
217
+ title: "Product names",
218
+ children: /* @__PURE__ */ jsx(Checkbox, {
219
+ checked: names,
220
+ onCheckedChange: setNames
221
+ })
222
+ }),
223
+ /* @__PURE__ */ jsx(SettingRow, {
224
+ indent: true,
225
+ disabled: !suggestions,
226
+ title: "Category names",
227
+ children: /* @__PURE__ */ jsx(Checkbox, {
228
+ checked: categories,
229
+ onCheckedChange: setCategories
230
+ })
231
+ })
232
+ ]
233
+ })
234
+ });
235
+ }
236
+ function InAForm() {
237
+ const [sound, setSound] = useState(true);
238
+ return /* @__PURE__ */ jsx("div", {
239
+ className: "setting-row-stage",
240
+ children: /* @__PURE__ */ jsxs(FormGrid, { children: [
241
+ /* @__PURE__ */ jsx(Field, {
242
+ label: "Display name",
243
+ children: /* @__PURE__ */ jsx(Input, { defaultValue: "Test Owner" })
244
+ }),
245
+ /* @__PURE__ */ jsx(Field, {
246
+ label: "Tone",
247
+ children: /* @__PURE__ */ jsx(Select, {
248
+ defaultValue: "plain",
249
+ options: [{
250
+ value: "plain",
251
+ label: "Plain: no jargon"
252
+ }, {
253
+ value: "warm",
254
+ label: "Warm and friendly"
255
+ }]
256
+ })
257
+ }),
258
+ /* @__PURE__ */ jsx(FormGridItem, {
259
+ span: "full",
260
+ children: /* @__PURE__ */ jsx(SettingRow, {
261
+ divider: true,
262
+ align: "start",
263
+ title: "Notification sound",
264
+ description: "Play a sound when Nebula finishes replying.",
265
+ children: /* @__PURE__ */ jsx(Switch, {
266
+ checked: sound,
267
+ onCheckedChange: setSound
268
+ })
269
+ })
270
+ })
271
+ ] })
272
+ });
273
+ }
274
+ /** A control of your own, wired by the hook. */
275
+ function PlanSwitch() {
276
+ const wiring = useSettingRowControl();
277
+ return /* @__PURE__ */ jsx(Switch, {
278
+ ...wiring,
279
+ defaultChecked: true
280
+ });
281
+ }
282
+ function Everything() {
283
+ return /* @__PURE__ */ jsx("div", {
284
+ className: "setting-row-theme",
285
+ children: /* @__PURE__ */ jsxs(SettingRows, {
286
+ "aria-label": "Examples",
287
+ children: [
288
+ /* @__PURE__ */ jsx(SettingRow, {
289
+ title: "Order emails",
290
+ description: "Sent when an order is placed.",
291
+ children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true })
292
+ }),
293
+ /* @__PURE__ */ jsx(SettingRow, {
294
+ indent: true,
295
+ title: "Include the invoice",
296
+ children: /* @__PURE__ */ jsx(Checkbox, { defaultChecked: true })
297
+ }),
298
+ /* @__PURE__ */ jsx(SettingRow, {
299
+ title: "Currency",
300
+ controlWidth: "11rem",
301
+ children: /* @__PURE__ */ jsx(Select, {
302
+ defaultValue: "gbp",
303
+ options: [{
304
+ value: "gbp",
305
+ label: "Pound sterling"
306
+ }, {
307
+ value: "eur",
308
+ label: "Euro"
309
+ }]
310
+ })
311
+ }),
312
+ /* @__PURE__ */ jsx(SettingRow, {
313
+ title: "Delivery rules",
314
+ disabled: true,
315
+ children: /* @__PURE__ */ jsx(Switch, {})
316
+ })
317
+ ]
318
+ })
319
+ });
320
+ }
321
+ function PluginSettings() {
322
+ const [sync, setSync] = useState(true);
323
+ return /* @__PURE__ */ jsx(Card, {
324
+ padding: "lg",
325
+ className: "setting-row-card",
326
+ children: /* @__PURE__ */ jsxs(SettingRows, {
327
+ "aria-label": "Stock feed settings",
328
+ children: [
329
+ /* @__PURE__ */ jsx(SettingRow, {
330
+ title: "Feed key",
331
+ description: "The key the supplier gave you for their stock feed.",
332
+ required: true,
333
+ controlWidth: 288,
334
+ children: /* @__PURE__ */ jsx(Input, { placeholder: "sk_live_…" })
335
+ }),
336
+ /* @__PURE__ */ jsx(SettingRow, {
337
+ title: "Webhook address",
338
+ description: "Where the feed posts each change, as it happens.",
339
+ optional: true,
340
+ controlWidth: 288,
341
+ children: /* @__PURE__ */ jsx(Input, { placeholder: "https://" })
342
+ }),
343
+ /* @__PURE__ */ jsx(SettingRow, {
344
+ title: "Account reference",
345
+ description: "Printed on your purchase orders.",
346
+ optional: "If you have one",
347
+ controlWidth: 288,
348
+ children: /* @__PURE__ */ jsx(Input, {})
349
+ }),
350
+ /* @__PURE__ */ jsx(SettingRow, {
351
+ title: "Sync stock every hour",
352
+ description: "Levels are read from the feed on the hour.",
353
+ children: /* @__PURE__ */ jsx(Switch, {
354
+ checked: sync,
355
+ onCheckedChange: setSync
356
+ })
357
+ })
358
+ ]
359
+ })
360
+ });
361
+ }
362
+ function Page() {
363
+ return /* @__PURE__ */ jsxs(DocPage, {
364
+ title: "Setting row",
365
+ status: "new",
366
+ importNames: [
367
+ "SettingRow",
368
+ "SettingRows",
369
+ "useSettingRowControl"
370
+ ],
371
+ lead: "A line of a settings page: a title and a quiet sentence at the start, a control at the end. The title labels the control, wired for you, so a switch row reads 'Order emails, switch, on' and turns on when its words are pressed. Any control will do, because you pass it.",
372
+ children: [
373
+ /* @__PURE__ */ jsx(Section$1, {
374
+ id: "switch",
375
+ title: "Switch rows",
376
+ description: /* @__PURE__ */ jsxs("p", { children: [
377
+ "Put a ",
378
+ /* @__PURE__ */ jsx(DocLink, {
379
+ to: "/components/switch",
380
+ children: "Switch"
381
+ }),
382
+ " in the row and it is named by the title and described by the sentence under it. Pressing the title presses the switch, as pressing a label does. A ",
383
+ /* @__PURE__ */ jsx("code", { children: "help" }),
384
+ " control sits beside the title and outside the label, so it never touches the switch."
385
+ ] }),
386
+ children: /* @__PURE__ */ jsx(Example, {
387
+ align: "fill",
388
+ code: `
389
+ <SettingRow
390
+ title="Order emails"
391
+ description="Send a confirmation to the customer when an order is placed."
392
+ help={
393
+ <Tooltip content="Customers also get a receipt when it ships.">
394
+ <IconButton label="About order emails" size="xs" variant="ghost"><QuestionIcon /></IconButton>
395
+ </Tooltip>
396
+ }
397
+ >
398
+ <Switch checked={on} onCheckedChange={setOn} />
399
+ </SettingRow>`,
400
+ children: /* @__PURE__ */ jsx(OrderEmails, {})
401
+ })
402
+ }),
403
+ /* @__PURE__ */ jsxs(Section$1, {
404
+ id: "controls",
405
+ title: "Any control",
406
+ description: /* @__PURE__ */ jsxs("p", { children: [
407
+ "The control is whatever you pass: a ",
408
+ /* @__PURE__ */ jsx(DocLink, {
409
+ to: "/components/select",
410
+ children: "select"
411
+ }),
412
+ ", an",
413
+ " ",
414
+ /* @__PURE__ */ jsx(DocLink, {
415
+ to: "/components/input",
416
+ children: "input"
417
+ }),
418
+ ", a checkbox, a button. The title names a form control the row can recognise, given directly: the kit's switch, checkbox, radio group, select, input and textarea, or a native",
419
+ " ",
420
+ /* @__PURE__ */ jsx("code", { children: "input" }),
421
+ ", ",
422
+ /* @__PURE__ */ jsx("code", { children: "select" }),
423
+ " or ",
424
+ /* @__PURE__ */ jsx("code", { children: "textarea" }),
425
+ ". It keeps what the control already says for itself (its own ",
426
+ /* @__PURE__ */ jsx("code", { children: "id" }),
427
+ ", ",
428
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
429
+ " and ",
430
+ /* @__PURE__ */ jsx("code", { children: "disabled" }),
431
+ "). The row looks inside nothing, so everything else keeps the name it has and is only described: a button, a link, a trigger, a control in a wrapper, a component of yours. A select or an input needs a width beside the words: ",
432
+ /* @__PURE__ */ jsx("code", { children: "controlWidth" }),
433
+ " sets it, and it takes the full width when the row stacks."
434
+ ] }),
435
+ children: [
436
+ /* @__PURE__ */ jsx(Example, {
437
+ align: "fill",
438
+ code: `
439
+ <SettingRows>
440
+ <SettingRow title="Currency" description="What prices are shown in." controlWidth="13rem">
441
+ <Select defaultValue="gbp" options={[…]} />
442
+ </SettingRow>
443
+ <SettingRow title="Order number prefix" description="Shown before every order number." controlWidth="13rem">
444
+ <Input placeholder="e.g. ORD-" />
445
+ </SettingRow>
446
+ <SettingRow title="Delivery rules" description="Where you ship, and what it costs.">
447
+ <Button size="sm" variant="secondary" iconEnd={<ArrowRightIcon />}>Manage</Button>
448
+ </SettingRow>
449
+ </SettingRows>`,
450
+ children: /* @__PURE__ */ jsx(Controls, {})
451
+ }),
452
+ /* @__PURE__ */ jsxs(Note, {
453
+ title: "What the title names, and what keeps its own name",
454
+ children: [
455
+ "The title names only what the row can recognise by what it is. Everything else is never renamed, and pressing the title never presses it: the \"Manage\" button above is still \"Manage\", and the row only describes it. That goes for a",
456
+ " ",
457
+ /* @__PURE__ */ jsx("code", { children: "Button" }),
458
+ ", an ",
459
+ /* @__PURE__ */ jsx("code", { children: "IconButton" }),
460
+ ", a native ",
461
+ /* @__PURE__ */ jsx("code", { children: "button" }),
462
+ " or ",
463
+ /* @__PURE__ */ jsx("code", { children: "a" }),
464
+ ", a trigger given",
465
+ " ",
466
+ /* @__PURE__ */ jsx("code", { children: "asChild" }),
467
+ ", a ",
468
+ /* @__PURE__ */ jsx("code", { children: "Checkbox label=\"…\"" }),
469
+ " and a component of yours. A wrapped control is named by you:",
470
+ " ",
471
+ /* @__PURE__ */ jsx("code", { children: "<div><Select /></div>" }),
472
+ " is a ",
473
+ /* @__PURE__ */ jsx("code", { children: "div" }),
474
+ " to the row, so give the select its own name, or give a function that receives the wiring. ",
475
+ /* @__PURE__ */ jsx("code", { children: "labelControl" }),
476
+ " has the title name the one element you pass (a component of yours that forwards the props, or calls ",
477
+ /* @__PURE__ */ jsx("code", { children: "useSettingRowControl()" }),
478
+ "), or, as ",
479
+ /* @__PURE__ */ jsx("code", { children: "{false}" }),
480
+ ", leaves even a form control to its own name."
481
+ ]
482
+ }),
483
+ /* @__PURE__ */ jsx(CodeBlock$1, { code: `
484
+ // A wrapped control is named by you: an aria-label of its own …
485
+ <SettingRow title="Currency">
486
+ <div className="w-48"><Select aria-label="Currency" … /></div>
487
+ </SettingRow>
488
+
489
+ // … or the function form, which hands over the wiring to spread on the real control.
490
+ <SettingRow title="Currency" description="What prices are shown in.">
491
+ {(control) => <div className="w-48"><Select {...control} … /></div>}
492
+ </SettingRow>
493
+
494
+ // A component of yours that forwards the props: tell the row to name it.
495
+ <SettingRow title="Currency" labelControl>
496
+ <CurrencySelect />
497
+ </SettingRow>` })
498
+ ]
499
+ }),
500
+ /* @__PURE__ */ jsxs(Section$1, {
501
+ id: "stacking",
502
+ title: "Stacking when narrow",
503
+ description: /* @__PURE__ */ jsx("p", { children: "In a row narrower than 35rem (560px) the control drops under the words at full width, as a phone shows it. A switch or a checkbox stays beside them: it is small, and its place at the end is how it reads, wherever it sits (a switch inside a wrapper or a component of yours is found by the role it draws, when the row mounts and whenever the control's markup changes, so a switch that mounts after a skeleton is found too). It follows the row's own width, not the window's, so a row in a dialog or a docked panel stacks too. Drag the corner of the box to see it." }),
504
+ children: [/* @__PURE__ */ jsx(Example, {
505
+ align: "fill",
506
+ minHeight: 230,
507
+ code: `<SettingRow …>…</SettingRow> {/* stack="auto" is the default */}`,
508
+ children: /* @__PURE__ */ jsx(Stacking, {})
509
+ }), /* @__PURE__ */ jsx(DocTable, {
510
+ columns: ["stack", "The control in a narrow row"],
511
+ rows: [
512
+ [/* @__PURE__ */ jsx("code", { children: "auto" }), "Under the words at full width, unless it is a Switch or a Checkbox, or holds one. The default."],
513
+ [/* @__PURE__ */ jsx("code", { children: "never" }), "Beside the words at any width. For a control that is small whatever it is, and for a switch inside a component of yours when it must be right from the first paint on the server: the role is read in the browser, so the server draws it as a field."],
514
+ [/* @__PURE__ */ jsx("code", { children: "always" }), "Under the words at any width."]
515
+ ]
516
+ })]
517
+ }),
518
+ /* @__PURE__ */ jsxs(Section$1, {
519
+ id: "rows",
520
+ title: "A stack of rows",
521
+ description: /* @__PURE__ */ jsxs("p", { children: [
522
+ /* @__PURE__ */ jsx("code", { children: "SettingRows" }),
523
+ " stacks rows on a page or inside a ",
524
+ /* @__PURE__ */ jsx(DocLink, {
525
+ to: "/components/card",
526
+ children: "Card"
527
+ }),
528
+ ": it pads them, draws a hairline between each, and keeps its ends flush with what holds it (an indented last row included). ",
529
+ /* @__PURE__ */ jsx("code", { children: "size=\"sm\"" }),
530
+ " pads a row 10px, the default 16px. A row with ",
531
+ /* @__PURE__ */ jsx("code", { children: "indent" }),
532
+ " tucks under the setting it depends on, on a 2px line, with no hairline of its own. Give the stack an ",
533
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
534
+ " and it is a named group; without one it is a plain stack."
535
+ ] }),
536
+ children: [/* @__PURE__ */ jsx(Example, {
537
+ align: "fill",
538
+ code: `
539
+ <Card>
540
+ <CardHeader title="Built-in fields" description="Choose what storefront search looks at." />
541
+ <SettingRows size="sm" aria-label="Searchable fields">
542
+ <SettingRow title="Product name" description="Always searchable."><Switch checked disabled /></SettingRow>
543
+ <SettingRow title="SKU and barcode" description="Product and variant codes."><Switch checked /></SettingRow>
544
+ …
545
+ </SettingRows>
546
+ </Card>`,
547
+ children: /* @__PURE__ */ jsx(SearchFields, {})
548
+ }), /* @__PURE__ */ jsxs(SubSection, {
549
+ title: "Dependent options",
550
+ children: [/* @__PURE__ */ jsx("p", {
551
+ className: "setting-row-prose",
552
+ children: "A dependent option is disabled with the setting it depends on, not hidden: it stays where the person looks for it, and says why it is off. Turn the switch off to see them fade and lock."
553
+ }), /* @__PURE__ */ jsx(Example, {
554
+ align: "fill",
555
+ code: `
556
+ <SettingRows aria-label="Search suggestions">
557
+ <SettingRow title="Show search suggestions" description="Offer matches as the visitor types.">
558
+ <Switch checked={suggestions} onCheckedChange={setSuggestions} />
559
+ </SettingRow>
560
+ <SettingRow indent disabled={!suggestions} title="Product names"><Checkbox … /></SettingRow>
561
+ <SettingRow indent disabled={!suggestions} title="Category names"><Checkbox … /></SettingRow>
562
+ </SettingRows>`,
563
+ children: /* @__PURE__ */ jsx(Dependent, {})
564
+ })]
565
+ })]
566
+ }),
567
+ /* @__PURE__ */ jsx(Section$1, {
568
+ id: "in-a-form",
569
+ title: "In a form",
570
+ description: /* @__PURE__ */ jsxs("p", { children: [
571
+ "A switch that follows a form's fields takes ",
572
+ /* @__PURE__ */ jsx("code", { children: "divider" }),
573
+ ": a hairline above it and 16px under the hairline.",
574
+ " ",
575
+ /* @__PURE__ */ jsx("code", { children: "align=\"start\"" }),
576
+ " lines the switch up with the title, which reads better beside a long sentence. Inside a",
577
+ " ",
578
+ /* @__PURE__ */ jsx(DocLink, {
579
+ to: "/components/form-grid",
580
+ children: "FormGrid"
581
+ }),
582
+ " give it a cell that spans the line."
583
+ ] }),
584
+ children: /* @__PURE__ */ jsx(Example, {
585
+ align: "fill",
586
+ code: `
587
+ <FormGrid>
588
+ <Field label="Display name"><Input /></Field>
589
+ <Field label="Tone"><Select … /></Field>
590
+ <FormGridItem span="full">
591
+ <SettingRow divider align="start" title="Notification sound" description="Play a sound when Nebula finishes replying.">
592
+ <Switch checked={sound} onCheckedChange={setSound} />
593
+ </SettingRow>
594
+ </FormGridItem>
595
+ </FormGrid>`,
596
+ children: /* @__PURE__ */ jsx(InAForm, {})
597
+ })
598
+ }),
599
+ /* @__PURE__ */ jsx(Section$1, {
600
+ id: "required",
601
+ title: "Required or optional",
602
+ description: /* @__PURE__ */ jsxs("p", { children: [
603
+ /* @__PURE__ */ jsx("code", { children: "required" }),
604
+ " puts a red star after the title, as a ",
605
+ /* @__PURE__ */ jsx(DocLink, {
606
+ to: "/components/input",
607
+ children: "Field"
608
+ }),
609
+ " does, and sets ",
610
+ /* @__PURE__ */ jsx("code", { children: "aria-required" }),
611
+ " on the control the title names; the star itself is hidden from assistive tech, and the browser's own validation stays off until the control is given ",
612
+ /* @__PURE__ */ jsx("code", { children: "required" }),
613
+ " too. ",
614
+ /* @__PURE__ */ jsx("code", { children: "optional" }),
615
+ " says a quiet \"Optional\" beside the title instead, or your own words (\"If you have one\"); it is ignored when the row is required. Mark whichever is rarer in the form."
616
+ ] }),
617
+ children: /* @__PURE__ */ jsx(Example, {
618
+ align: "fill",
619
+ code: `
620
+ <SettingRows aria-label="Stock feed settings">
621
+ <SettingRow title="Feed key" description="The key the supplier gave you for their stock feed." required controlWidth={288}>
622
+ <Input placeholder="sk_live_…" />
623
+ </SettingRow>
624
+ <SettingRow title="Webhook address" description="Where the feed posts each change, as it happens." optional controlWidth={288}>
625
+ <Input placeholder="https://" />
626
+ </SettingRow>
627
+ <SettingRow title="Account reference" description="Printed on your purchase orders." optional="If you have one" controlWidth={288}>
628
+ <Input />
629
+ </SettingRow>
630
+ <SettingRow title="Sync stock every hour" description="Levels are read from the feed on the hour.">
631
+ <Switch checked={sync} onCheckedChange={setSync} />
632
+ </SettingRow>
633
+ </SettingRows>`,
634
+ children: /* @__PURE__ */ jsx(PluginSettings, {})
635
+ })
636
+ }),
637
+ /* @__PURE__ */ jsx(Section$1, {
638
+ id: "wiring",
639
+ title: "How it names the control",
640
+ description: /* @__PURE__ */ jsxs("p", { children: [
641
+ "The row gives its title an id, its description an id and the control an id. For a form control it recognises, the title is a ",
642
+ /* @__PURE__ */ jsx("code", { children: "label" }),
643
+ " for it, and the control gets ",
644
+ /* @__PURE__ */ jsx("code", { children: "aria-labelledby" }),
645
+ " (the title) and",
646
+ " ",
647
+ /* @__PURE__ */ jsx("code", { children: "aria-describedby" }),
648
+ " (the sentence); a control that already has its own keeps it: nothing is overwritten. Anything else is only described, unless you pass ",
649
+ /* @__PURE__ */ jsx("code", { children: "labelControl" }),
650
+ ". That is the whole of it, so no change to",
651
+ " ",
652
+ /* @__PURE__ */ jsx(DocLink, {
653
+ to: "/components/input",
654
+ children: "Field"
655
+ }),
656
+ " is needed and a row works with any control that takes an ",
657
+ /* @__PURE__ */ jsx("code", { children: "id" }),
658
+ " ",
659
+ "and the two attributes. With only text as the child there is nothing to name, so the title is a plain span."
660
+ ] }),
661
+ children: /* @__PURE__ */ jsxs(SubSection, {
662
+ title: "A control the row cannot see",
663
+ children: [
664
+ /* @__PURE__ */ jsxs("p", {
665
+ className: "setting-row-prose",
666
+ children: [
667
+ "Pass a function as the child to be handed the props and spread them where they belong, or call",
668
+ " ",
669
+ /* @__PURE__ */ jsx("code", { children: "useSettingRowControl()" }),
670
+ " inside a component of your own and spread what it returns on the real control, with",
671
+ " ",
672
+ /* @__PURE__ */ jsx("code", { children: "labelControl" }),
673
+ " on the row so the title names what the component holds (without it the hook hands over the sentence and ",
674
+ /* @__PURE__ */ jsx("code", { children: "disabled" }),
675
+ " only). It returns ",
676
+ /* @__PURE__ */ jsx("code", { children: "null" }),
677
+ " outside a row."
678
+ ]
679
+ }),
680
+ /* @__PURE__ */ jsx(CodeBlock$1, { code: `
681
+ // The function form: the props arrive ready to spread.
682
+ <SettingRow title="Plan" description="What you pay.">
683
+ {(control) => <MyPlanPicker {...control} />}
684
+ </SettingRow>
685
+
686
+ // The hook form: inside a component of your own, with the row told to name what it holds.
687
+ function PlanSwitch() {
688
+ const wiring = useSettingRowControl()
689
+ return <Switch {...wiring} />
690
+ }
691
+
692
+ <SettingRow title="Plan" labelControl><PlanSwitch /></SettingRow>` }),
693
+ /* @__PURE__ */ jsx(Example, {
694
+ align: "start",
695
+ code: `<SettingRow title="Plan" description="What you pay." labelControl><PlanSwitch /></SettingRow>`,
696
+ children: /* @__PURE__ */ jsx("div", {
697
+ className: "setting-row-stage",
698
+ children: /* @__PURE__ */ jsx(SettingRow, {
699
+ title: "Plan",
700
+ description: "What you pay.",
701
+ labelControl: true,
702
+ children: /* @__PURE__ */ jsx(PlanSwitch, {})
703
+ })
704
+ })
705
+ })
706
+ ]
707
+ })
708
+ }),
709
+ /* @__PURE__ */ jsx(Section$1, {
710
+ id: "both-themes",
711
+ title: "In both themes",
712
+ description: /* @__PURE__ */ jsx("p", { children: "A stack of rows with a switch, a dependent option, a select and a disabled row, light and dark side by side." }),
713
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx(Everything, {}) })
714
+ }),
715
+ /* @__PURE__ */ jsx(Fragment$1, {}),
716
+ /* @__PURE__ */ jsxs(Section$1, {
717
+ id: "guidelines",
718
+ title: "Guidelines",
719
+ children: [/* @__PURE__ */ jsx(DoDont, {
720
+ do: {
721
+ children: /* @__PURE__ */ jsx("div", {
722
+ className: "setting-row-dd",
723
+ children: /* @__PURE__ */ jsx(SettingRow, {
724
+ title: "Order emails",
725
+ description: "Sent when an order is placed.",
726
+ children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true })
727
+ })
728
+ }),
729
+ caption: "A title that names the setting, and a sentence on what turning it on does."
730
+ },
731
+ dont: {
732
+ children: /* @__PURE__ */ jsx("div", {
733
+ className: "setting-row-dd",
734
+ children: /* @__PURE__ */ jsx(SettingRow, {
735
+ title: "Do you want order emails to be turned on for your store?",
736
+ children: /* @__PURE__ */ jsx(Switch, { defaultChecked: true })
737
+ })
738
+ }),
739
+ caption: "A question as a title. A switch answers \"on or off\", so the title names the thing."
740
+ }
741
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
742
+ "Name the setting, not the control: \"Order emails\", not \"Toggle order emails\".",
743
+ "The description says what happens when it is on. Do not repeat the title.",
744
+ "A switch applies the moment it is pressed. A setting that needs saving belongs in a form, with the page’s save bar.",
745
+ "Disable a dependent option rather than hiding it, so the person can see it exists and what turns it on.",
746
+ "One control to a row. For several, use a form field group."
747
+ ] })]
748
+ }),
749
+ /* @__PURE__ */ jsx(Section$1, {
750
+ id: "accessibility",
751
+ title: "Accessibility",
752
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
753
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
754
+ "For a form control the row recognises, the title is a ",
755
+ /* @__PURE__ */ jsx("code", { children: "label" }),
756
+ " for it and its accessible name; the sentence is its accessible description. A screen reader announces \"Order emails, switch, on, Sent when an order is placed.\""
757
+ ] }),
758
+ "Pressing the title text presses such a control, as pressing a label does; the description and the space around the words do nothing. A help control sits outside the label and keeps its own name.",
759
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
760
+ "Everything else keeps the name it has, and pressing the title never presses it; the row only describes it: a button or link, a trigger, a control with a ",
761
+ /* @__PURE__ */ jsx("code", { children: "label" }),
762
+ " of its own, a control in a wrapper. A visible name must be part of the accessible name, so \"Manage\" stays \"Manage\". A wrapped control is named by you (an",
763
+ " ",
764
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
765
+ ", or the function form), and the row is told to name a component of yours by",
766
+ " ",
767
+ /* @__PURE__ */ jsx("code", { children: "labelControl" }),
768
+ "."
769
+ ] }),
770
+ "A disabled row disables its control natively and fades its words. Colour is never the only signal: a disabled switch is also announced as disabled.",
771
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
772
+ "A required row's star is hidden from assistive tech; the control the title names says it instead, with",
773
+ " ",
774
+ /* @__PURE__ */ jsx("code", { children: "aria-required" }),
775
+ " (\"Feed key, edit text, required\"). A control that already says it (a native",
776
+ " ",
777
+ /* @__PURE__ */ jsx("code", { children: "required" }),
778
+ ", or an ",
779
+ /* @__PURE__ */ jsx("code", { children: "aria-required" }),
780
+ " of its own) is left as it is. \"Optional\" is plain words beside the title, as a Field's are."
781
+ ] }),
782
+ "Stacking changes the layout, not the order: the words always come before the control."
783
+ ] })
784
+ }),
785
+ /* @__PURE__ */ jsxs(Section$1, {
786
+ id: "props",
787
+ title: "Props",
788
+ description: /* @__PURE__ */ jsx("p", { children: "SettingRow also accepts every native div attribute." }),
789
+ children: [
790
+ /* @__PURE__ */ jsx(PropsTable, {
791
+ title: "SettingRow",
792
+ rows: [
793
+ {
794
+ name: "title",
795
+ type: "ReactNode",
796
+ required: true,
797
+ description: "What the setting is. It is the control's label."
798
+ },
799
+ {
800
+ name: "description",
801
+ type: "ReactNode",
802
+ description: "A quiet sentence under the title. It describes the control."
803
+ },
804
+ {
805
+ name: "help",
806
+ type: "ReactNode",
807
+ description: "A small control beside the title, outside the label: a help button with a tooltip."
808
+ },
809
+ {
810
+ name: "children",
811
+ type: "ReactNode | (control) => ReactNode",
812
+ description: "The control. A kit form control or a native input, select or textarea given directly is named by the title. Anything else keeps its name; a wrapped control is named by you. A function is given the props to spread (id, aria-labelledby, aria-describedby, disabled)."
813
+ },
814
+ {
815
+ name: "align",
816
+ type: "'center' | 'start'",
817
+ default: "'center'",
818
+ description: "Where the control sits against the words: the middle, or the title line."
819
+ },
820
+ {
821
+ name: "indent",
822
+ type: "boolean",
823
+ default: "false",
824
+ description: "A dependent option: 16px in, on a 2px line."
825
+ },
826
+ {
827
+ name: "disabled",
828
+ type: "boolean",
829
+ default: "false",
830
+ description: "The words fade and the control is disabled (unless it says for itself that it is not)."
831
+ },
832
+ {
833
+ name: "required",
834
+ type: "boolean",
835
+ default: "false",
836
+ description: "A red star after the title, hidden from assistive tech, and aria-required on the control the title names."
837
+ },
838
+ {
839
+ name: "optional",
840
+ type: "boolean | string",
841
+ description: "A quiet \"Optional\" beside the title, or your own words. Ignored when required."
842
+ },
843
+ {
844
+ name: "divider",
845
+ type: "boolean",
846
+ default: "false",
847
+ description: "A hairline above the row, with 16px under it. Rows in a SettingRows do not need it."
848
+ },
849
+ {
850
+ name: "controlWidth",
851
+ type: "number | string",
852
+ description: "How wide the control is beside the words: px or any CSS length. A select or an input fills it."
853
+ },
854
+ {
855
+ name: "stack",
856
+ type: "'auto' | 'never' | 'always'",
857
+ default: "'auto'",
858
+ description: "What the control does in a row narrower than 35rem: drop under the words (auto: not a switch or a checkbox, including one inside a component of yours, found in the browser), stay, or always stack."
859
+ },
860
+ {
861
+ name: "labelControl",
862
+ type: "boolean",
863
+ default: "automatic",
864
+ description: "Whether the title names the control, and pressing it presses the control. Automatic: only for a kit Switch, Checkbox, RadioGroup, Select, Combobox, Input or Textarea, or a native input, select or textarea, given directly with no label of its own, and for a function child. true names the one element you pass (never a div or span); false leaves even a form control to its own name."
865
+ }
866
+ ]
867
+ }),
868
+ /* @__PURE__ */ jsx(PropsTable, {
869
+ title: "SettingRows",
870
+ rows: [{
871
+ name: "size",
872
+ type: "'sm' | 'md'",
873
+ default: "'md'",
874
+ description: "Row padding: 10px or 16px."
875
+ }, {
876
+ name: "aria-label / aria-labelledby",
877
+ type: "string",
878
+ description: "Names the stack, which is then a group. Without one it is a plain stack with no role."
879
+ }]
880
+ }),
881
+ /* @__PURE__ */ jsx(PropsTable, {
882
+ title: "useSettingRowControl()",
883
+ rows: [{
884
+ name: "returns",
885
+ type: "SettingRowControlProps | null",
886
+ description: "The id, aria-labelledby, aria-describedby and disabled of the surrounding row, to spread on a control. null outside a row."
887
+ }]
888
+ }),
889
+ /* @__PURE__ */ jsx(DocTable, {
890
+ columns: ["To do this", "Use"],
891
+ rows: [
892
+ ["A title, a sentence and a control on one line", "SettingRow"],
893
+ ["A list of things you can open, with actions at the end", /* @__PURE__ */ jsx(DocLink, {
894
+ to: "/components/row-list",
895
+ children: "Row list"
896
+ })],
897
+ ["A label above a field, with a hint and an error", /* @__PURE__ */ jsx(DocLink, {
898
+ to: "/components/input",
899
+ children: "Field"
900
+ })],
901
+ ["Fields in pairs", /* @__PURE__ */ jsx(DocLink, {
902
+ to: "/components/form-grid",
903
+ children: "Form grid"
904
+ })]
905
+ ]
906
+ })
907
+ ]
908
+ })
909
+ ]
910
+ });
911
+ }
912
+ //#endregion
913
+ export { Page, Preview };