@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,774 @@
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, o as Example, 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 { Field, Slider } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/slider.tsx
8
+ function Preview() {
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "slider-preview",
11
+ children: [/* @__PURE__ */ jsx(Field, {
12
+ label: "Font size",
13
+ children: /* @__PURE__ */ jsx(Slider, {
14
+ defaultValue: [16],
15
+ min: 8,
16
+ max: 120,
17
+ formatValue: (v) => `${v}px`
18
+ })
19
+ }), /* @__PURE__ */ jsx(Field, {
20
+ label: "Price",
21
+ children: /* @__PURE__ */ jsx(Slider, {
22
+ defaultValue: [20, 80],
23
+ max: 200,
24
+ showValue: "text",
25
+ formatValue: (v) => `£${v}`
26
+ })
27
+ })]
28
+ });
29
+ }
30
+ var px = (value) => `${value}px`;
31
+ var pounds = (value) => `£${value}`;
32
+ /** A controlled slider, with what it said as it moved and what it committed when it stopped. */
33
+ function FontSize() {
34
+ const [size, setSize] = useState([16]);
35
+ const [committed, setCommitted] = useState(16);
36
+ return /* @__PURE__ */ jsxs("div", {
37
+ className: "slider-stack",
38
+ children: [/* @__PURE__ */ jsx(Field, {
39
+ label: "Font size",
40
+ children: /* @__PURE__ */ jsx(Slider, {
41
+ value: size,
42
+ onValueChange: setSize,
43
+ onValueCommit: ([value]) => setCommitted(value),
44
+ min: 8,
45
+ max: 120,
46
+ formatValue: px
47
+ })
48
+ }), /* @__PURE__ */ jsxs("p", {
49
+ className: "slider-status",
50
+ role: "status",
51
+ children: [
52
+ "Now ",
53
+ size[0],
54
+ "px, committed ",
55
+ committed,
56
+ "px"
57
+ ]
58
+ })]
59
+ });
60
+ }
61
+ function PriceRange() {
62
+ const [price, setPrice] = useState([40, 160]);
63
+ return /* @__PURE__ */ jsx("div", {
64
+ className: "slider-stack slider-stack--wide",
65
+ children: /* @__PURE__ */ jsx(Field, {
66
+ label: "Price",
67
+ hint: "Products between the two prices are shown",
68
+ children: /* @__PURE__ */ jsx(Slider, {
69
+ value: price,
70
+ onValueChange: setPrice,
71
+ max: 250,
72
+ step: 5,
73
+ minStepsBetweenThumbs: 2,
74
+ formatValue: pounds
75
+ })
76
+ })
77
+ });
78
+ }
79
+ function Displays() {
80
+ return /* @__PURE__ */ jsxs("div", {
81
+ className: "slider-stack slider-stack--wide",
82
+ children: [
83
+ /* @__PURE__ */ jsx(Field, {
84
+ label: "Value box",
85
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "showValue=\"input\"" }), ", the default"] }),
86
+ children: /* @__PURE__ */ jsx(Slider, {
87
+ defaultValue: [24],
88
+ min: 8,
89
+ max: 120,
90
+ formatValue: px
91
+ })
92
+ }),
93
+ /* @__PURE__ */ jsx(Field, {
94
+ label: "Written value",
95
+ hint: /* @__PURE__ */ jsx("code", { children: "showValue=\"text\"" }),
96
+ children: /* @__PURE__ */ jsx(Slider, {
97
+ defaultValue: [60],
98
+ showValue: "text",
99
+ formatValue: (v) => `${v}%`
100
+ })
101
+ }),
102
+ /* @__PURE__ */ jsx(Field, {
103
+ label: "On the thumb",
104
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "tooltip" }), ": hover, focus or drag the thumb"] }),
105
+ children: /* @__PURE__ */ jsx(Slider, {
106
+ defaultValue: [35],
107
+ showValue: "none",
108
+ tooltip: true,
109
+ formatValue: (v) => `${v}%`
110
+ })
111
+ }),
112
+ /* @__PURE__ */ jsx(Field, {
113
+ label: "With its limits",
114
+ hint: /* @__PURE__ */ jsx("code", { children: "showLimits" }),
115
+ children: /* @__PURE__ */ jsx(Slider, {
116
+ defaultValue: [1.5],
117
+ min: .8,
118
+ max: 3,
119
+ step: .1,
120
+ showLimits: true
121
+ })
122
+ })
123
+ ]
124
+ });
125
+ }
126
+ function Decimals() {
127
+ return /* @__PURE__ */ jsxs("div", {
128
+ className: "slider-stack slider-stack--wide",
129
+ children: [
130
+ /* @__PURE__ */ jsx(Field, {
131
+ label: "Line height",
132
+ hint: "0.8 to 3, in steps of 0.1",
133
+ children: /* @__PURE__ */ jsx(Slider, {
134
+ defaultValue: [1.5],
135
+ min: .8,
136
+ max: 3,
137
+ step: .1
138
+ })
139
+ }),
140
+ /* @__PURE__ */ jsx(Field, {
141
+ label: "Letter spacing",
142
+ hint: "Below zero draws the letters closer",
143
+ children: /* @__PURE__ */ jsx(Slider, {
144
+ defaultValue: [-.5],
145
+ min: -5,
146
+ max: 10,
147
+ step: .1,
148
+ formatValue: (v) => `${v.toFixed(1)}px`,
149
+ showLimits: true
150
+ })
151
+ }),
152
+ /* @__PURE__ */ jsx(Field, {
153
+ label: "Zoom",
154
+ hint: "1 to 3 times, in steps of 0.05",
155
+ children: /* @__PURE__ */ jsx(Slider, {
156
+ defaultValue: [1.25],
157
+ min: 1,
158
+ max: 3,
159
+ step: .05,
160
+ formatValue: (v) => `${v.toFixed(2)}×`
161
+ })
162
+ })
163
+ ]
164
+ });
165
+ }
166
+ function Words() {
167
+ return /* @__PURE__ */ jsx("div", {
168
+ className: "slider-stack",
169
+ children: /* @__PURE__ */ jsx(Field, {
170
+ label: "Corner rounding",
171
+ hint: "Type a number, or the word Square",
172
+ children: /* @__PURE__ */ jsx(Slider, {
173
+ defaultValue: [0],
174
+ max: 32,
175
+ formatValue: (v) => v === 0 ? "Square" : `${v}px`
176
+ })
177
+ })
178
+ });
179
+ }
180
+ function Sizes() {
181
+ return /* @__PURE__ */ jsxs("div", {
182
+ className: "slider-stack slider-stack--wide",
183
+ children: [/* @__PURE__ */ jsx(Field, {
184
+ label: "Medium, an 18px thumb",
185
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "size=\"md\"" }), ", the default"] }),
186
+ children: /* @__PURE__ */ jsx(Slider, {
187
+ defaultValue: [40],
188
+ formatValue: (v) => `${v}%`
189
+ })
190
+ }), /* @__PURE__ */ jsx(Field, {
191
+ label: "Small, a 14px thumb",
192
+ hint: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "size=\"sm\"" }), ", for a dense inspector"] }),
193
+ children: /* @__PURE__ */ jsx(Slider, {
194
+ size: "sm",
195
+ defaultValue: [40],
196
+ formatValue: (v) => `${v}%`
197
+ })
198
+ })]
199
+ });
200
+ }
201
+ function States() {
202
+ return /* @__PURE__ */ jsxs("div", {
203
+ className: "slider-stack slider-stack--wide",
204
+ children: [
205
+ /* @__PURE__ */ jsx(Field, {
206
+ label: "Opacity",
207
+ description: "How much of the background shows through.",
208
+ hint: "0 is clear, 100 is solid",
209
+ children: /* @__PURE__ */ jsx(Slider, {
210
+ defaultValue: [80],
211
+ formatValue: (v) => `${v}%`
212
+ })
213
+ }),
214
+ /* @__PURE__ */ jsx(Field, {
215
+ label: "Overlay strength",
216
+ error: "Choose 40% or more so the heading stays readable",
217
+ children: /* @__PURE__ */ jsx(Slider, {
218
+ defaultValue: [20],
219
+ formatValue: (v) => `${v}%`
220
+ })
221
+ }),
222
+ /* @__PURE__ */ jsx(Field, {
223
+ label: "Section width",
224
+ hint: "Turn off Full width to set a width",
225
+ children: /* @__PURE__ */ jsx(Slider, {
226
+ defaultValue: [1200],
227
+ min: 600,
228
+ max: 1600,
229
+ step: 20,
230
+ disabled: true,
231
+ formatValue: px,
232
+ showLimits: true
233
+ })
234
+ })
235
+ ]
236
+ });
237
+ }
238
+ /** The builder's typography group, at an inspector's width. */
239
+ function Inspector() {
240
+ const [size, setSize] = useState([18]);
241
+ const [leading, setLeading] = useState([1.4]);
242
+ const [tracking, setTracking] = useState([0]);
243
+ return /* @__PURE__ */ jsxs("div", {
244
+ className: "slider-inspector",
245
+ "aria-label": "Heading typography",
246
+ role: "group",
247
+ children: [
248
+ /* @__PURE__ */ jsx("p", {
249
+ className: "slider-inspector__title",
250
+ children: "Typography"
251
+ }),
252
+ /* @__PURE__ */ jsx(Field, {
253
+ label: "Font size",
254
+ children: /* @__PURE__ */ jsx(Slider, {
255
+ size: "sm",
256
+ value: size,
257
+ onValueChange: setSize,
258
+ min: 8,
259
+ max: 120,
260
+ formatValue: px
261
+ })
262
+ }),
263
+ /* @__PURE__ */ jsx(Field, {
264
+ label: "Line height",
265
+ children: /* @__PURE__ */ jsx(Slider, {
266
+ size: "sm",
267
+ value: leading,
268
+ onValueChange: setLeading,
269
+ min: .8,
270
+ max: 3,
271
+ step: .1
272
+ })
273
+ }),
274
+ /* @__PURE__ */ jsx(Field, {
275
+ label: "Letter spacing",
276
+ children: /* @__PURE__ */ jsx(Slider, {
277
+ size: "sm",
278
+ value: tracking,
279
+ onValueChange: setTracking,
280
+ min: -5,
281
+ max: 10,
282
+ step: .1,
283
+ formatValue: (v) => `${v.toFixed(1)}px`
284
+ })
285
+ }),
286
+ /* @__PURE__ */ jsx("p", {
287
+ className: "slider-inspector__sample",
288
+ style: {
289
+ fontSize: Math.min(size[0], 40),
290
+ lineHeight: leading[0],
291
+ letterSpacing: `${tracking[0]}px`
292
+ },
293
+ children: "Arden ergonomic chair"
294
+ })
295
+ ]
296
+ });
297
+ }
298
+ function Keyboard() {
299
+ const [value, setValue] = useState([50]);
300
+ return /* @__PURE__ */ jsx("div", {
301
+ className: "slider-stack",
302
+ children: /* @__PURE__ */ jsx(Slider, {
303
+ "aria-label": "Volume",
304
+ value,
305
+ onValueChange: setValue,
306
+ formatValue: (v) => `${v}%`
307
+ })
308
+ });
309
+ }
310
+ function Page() {
311
+ return /* @__PURE__ */ jsxs(DocPage, {
312
+ title: "Slider",
313
+ status: "new",
314
+ importNames: ["Slider", "sliderLabels"],
315
+ lead: "A value, or a range of two, picked on a track. Drag a thumb, press the track, use the arrow keys, or type the exact number in the value box beside it: the thumb moves as you type, and the number is held to the bounds and the step when you leave the box.",
316
+ children: [
317
+ /* @__PURE__ */ jsxs(Section$1, {
318
+ id: "basics",
319
+ title: "Basics",
320
+ description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
321
+ "Give ",
322
+ /* @__PURE__ */ jsx("code", { children: "Slider" }),
323
+ " a ",
324
+ /* @__PURE__ */ jsx("code", { children: "value" }),
325
+ " and ",
326
+ /* @__PURE__ */ jsx("code", { children: "onValueChange" }),
327
+ ", or a ",
328
+ /* @__PURE__ */ jsx("code", { children: "defaultValue" }),
329
+ ". The value is a list, as Radix's is: one number for one thumb, two for a range. Set ",
330
+ /* @__PURE__ */ jsx("code", { children: "min" }),
331
+ ",",
332
+ " ",
333
+ /* @__PURE__ */ jsx("code", { children: "max" }),
334
+ " and ",
335
+ /* @__PURE__ */ jsx("code", { children: "step" }),
336
+ ", and a ",
337
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
338
+ " to write the value the way people read it. ",
339
+ /* @__PURE__ */ jsx("code", { children: "onValueChange" }),
340
+ " calls on every move, for a live preview; ",
341
+ /* @__PURE__ */ jsx("code", { children: "onValueCommit" }),
342
+ " calls once the change is finished (the thumb let go, a key pressed, the box left), for a save or an undo step."
343
+ ] }), /* @__PURE__ */ jsxs("p", { children: [
344
+ "Inside a ",
345
+ /* @__PURE__ */ jsx(DocLink, {
346
+ to: "/components/input#field",
347
+ children: "Field"
348
+ }),
349
+ ", the Field's label names the thumb and the value box, its hint describes them, and pressing the label puts you in the box."
350
+ ] })] }),
351
+ children: [/* @__PURE__ */ jsx(Example, {
352
+ code: `
353
+ const [size, setSize] = useState([16])
354
+
355
+ <Field label="Font size">
356
+ <Slider
357
+ value={size}
358
+ onValueChange={setSize}
359
+ onValueCommit={([value]) => save(value)}
360
+ min={8}
361
+ max={120}
362
+ formatValue={(v) => \`\${v}px\`}
363
+ />
364
+ </Field>`,
365
+ children: /* @__PURE__ */ jsx(FontSize, {})
366
+ }), /* @__PURE__ */ jsxs(Note, {
367
+ title: "When to reach for something else",
368
+ children: [
369
+ "A slider is for a value inside known bounds where the feel matters as much as the figure: a size, a strength, a zoom. For an amount someone types and reads exactly (a price, a quantity) use",
370
+ " ",
371
+ /* @__PURE__ */ jsx(DocLink, {
372
+ to: "/components/number-input",
373
+ children: "NumberInput"
374
+ }),
375
+ ". A slider with no bounds that fit on a track is a number field too."
376
+ ]
377
+ })]
378
+ }),
379
+ /* @__PURE__ */ jsx(Section$1, {
380
+ id: "range",
381
+ title: "A range",
382
+ description: /* @__PURE__ */ jsxs("p", { children: [
383
+ "Two values make two thumbs, each named for its end (\"Minimum Price\", \"Maximum Price\") and each with a value box at its end of the track. A thumb stops at the other rather than passing it: the low end stays low.",
384
+ " ",
385
+ /* @__PURE__ */ jsx("code", { children: "minStepsBetweenThumbs" }),
386
+ " keeps them that many steps apart. A press on the track moves the nearer thumb; where the two meet, the one on the side of the press."
387
+ ] }),
388
+ children: /* @__PURE__ */ jsx(Example, {
389
+ code: `
390
+ const [price, setPrice] = useState([40, 160])
391
+
392
+ <Field label="Price" hint="Products between the two prices are shown">
393
+ <Slider value={price} onValueChange={setPrice} max={250} step={5} minStepsBetweenThumbs={2} formatValue={(v) => \`£\${v}\`} />
394
+ </Field>`,
395
+ children: /* @__PURE__ */ jsx(PriceRange, {})
396
+ })
397
+ }),
398
+ /* @__PURE__ */ jsxs(Section$1, {
399
+ id: "showing-the-value",
400
+ title: "Showing the value",
401
+ description: /* @__PURE__ */ jsxs("p", { children: [
402
+ /* @__PURE__ */ jsx("code", { children: "showValue" }),
403
+ " decides what sits beside the track: ",
404
+ /* @__PURE__ */ jsx("code", { children: "input" }),
405
+ " (the default) a small value box to type in, ",
406
+ /* @__PURE__ */ jsx("code", { children: "text" }),
407
+ " the value written out, or ",
408
+ /* @__PURE__ */ jsx("code", { children: "none" }),
409
+ ". ",
410
+ /* @__PURE__ */ jsx("code", { children: "tooltip" }),
411
+ " puts the value on a tip over the thumb while it is hovered, focused or dragged, for a slider with no room beside it.",
412
+ " ",
413
+ /* @__PURE__ */ jsx("code", { children: "showLimits" }),
414
+ " writes the lowest and highest values under the ends of the track."
415
+ ] }),
416
+ children: [/* @__PURE__ */ jsx(Example, {
417
+ align: "fill",
418
+ code: `
419
+ <Slider defaultValue={[24]} min={8} max={120} formatValue={(v) => \`\${v}px\`} />
420
+ <Slider defaultValue={[60]} showValue="text" formatValue={(v) => \`\${v}%\`} />
421
+ <Slider defaultValue={[35]} showValue="none" tooltip formatValue={(v) => \`\${v}%\`} />
422
+ <Slider defaultValue={[1.5]} min={0.8} max={3} step={0.1} showLimits />`,
423
+ children: /* @__PURE__ */ jsx(Displays, {})
424
+ }), /* @__PURE__ */ jsx(Note, {
425
+ title: "Room for the tip",
426
+ children: "The tip draws over the thumb, inside the page, so a container that clips its overflow (a scrolling panel) can cut it off at the top. Leave about 32px above a slider that shows one."
427
+ })]
428
+ }),
429
+ /* @__PURE__ */ jsx(Section$1, {
430
+ id: "steps-and-decimals",
431
+ title: "Steps, decimals and negatives",
432
+ description: /* @__PURE__ */ jsxs("p", { children: [
433
+ "A step can be a decimal (0.1, 0.05) and the bounds can be below zero. Values are counted in steps from",
434
+ " ",
435
+ /* @__PURE__ */ jsx("code", { children: "min" }),
436
+ " and kept exact, so 0.8 in steps of 0.1 never shows 0.30000000000000004. The default format writes the step's decimals in the locale (\"1.5\", \"2.0\"). Arrows move one step, Shift with an arrow or Page Up and Page Down ten."
437
+ ] }),
438
+ children: /* @__PURE__ */ jsx(Example, {
439
+ align: "fill",
440
+ code: `
441
+ <Slider defaultValue={[1.5]} min={0.8} max={3} step={0.1} />
442
+ <Slider defaultValue={[-0.5]} min={-5} max={10} step={0.1} formatValue={(v) => \`\${v.toFixed(1)}px\`} showLimits />
443
+ <Slider defaultValue={[1.25]} min={1} max={3} step={0.05} formatValue={(v) => \`\${v.toFixed(2)}×\`} />`,
444
+ children: /* @__PURE__ */ jsx(Decimals, {})
445
+ })
446
+ }),
447
+ /* @__PURE__ */ jsx(Section$1, {
448
+ id: "typing",
449
+ title: "Typing a value",
450
+ description: /* @__PURE__ */ jsxs("p", { children: [
451
+ "The box shows the formatted value at rest and the plain number while it has focus, selected, so it can be typed over. As you type, the thumb follows, held to the bounds; the text stays as typed until you leave the box or press Enter, then the box writes the value it kept. It reads the text it writes: a unit or a sign around the number (\"16px\", \"−5\"), and a word ",
452
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
453
+ " writes for a value. Escape puts back the value the box had when it took focus; with nothing to put back, Escape is the page's (it closes a dialog). The arrow keys step in the box too. Pass ",
454
+ /* @__PURE__ */ jsx("code", { children: "parseValue" }),
455
+ " to read text your own way."
456
+ ] }),
457
+ children: /* @__PURE__ */ jsx(Example, {
458
+ code: `
459
+ <Field label="Corner rounding" hint="Type a number, or the word Square">
460
+ <Slider defaultValue={[0]} max={32} formatValue={(v) => (v === 0 ? 'Square' : \`\${v}px\`)} />
461
+ </Field>`,
462
+ children: /* @__PURE__ */ jsx(Words, {})
463
+ })
464
+ }),
465
+ /* @__PURE__ */ jsx(Section$1, {
466
+ id: "sizes",
467
+ title: "Sizes",
468
+ description: /* @__PURE__ */ jsx("p", { children: "Two sizes. Both keep a 30px value box and a hit area taller than the thumb." }),
469
+ children: /* @__PURE__ */ jsx(Example, {
470
+ align: "fill",
471
+ code: `
472
+ <Slider defaultValue={[40]} />
473
+ <Slider size="sm" defaultValue={[40]} />`,
474
+ children: /* @__PURE__ */ jsx(Sizes, {})
475
+ })
476
+ }),
477
+ /* @__PURE__ */ jsx(Section$1, {
478
+ id: "states",
479
+ title: "In a Field, and disabled",
480
+ description: /* @__PURE__ */ jsx("p", { children: "A Field's description and hint describe the thumb and the box, and its error marks the box. A disabled slider leaves the tab order, dims its track and thumb, and keeps its words readable." }),
481
+ children: /* @__PURE__ */ jsx(Example, {
482
+ align: "fill",
483
+ code: `
484
+ <Field label="Opacity" description="How much of the background shows through." hint="0 is clear, 100 is solid">
485
+ <Slider defaultValue={[80]} formatValue={(v) => \`\${v}%\`} />
486
+ </Field>
487
+ <Field label="Overlay strength" error="Choose 40% or more so the heading stays readable">
488
+ <Slider defaultValue={[20]} formatValue={(v) => \`\${v}%\`} />
489
+ </Field>
490
+ <Field label="Section width" hint="Turn off Full width to set a width">
491
+ <Slider defaultValue={[1200]} min={600} max={1600} step={20} disabled formatValue={(v) => \`\${v}px\`} showLimits />
492
+ </Field>`,
493
+ children: /* @__PURE__ */ jsx(States, {})
494
+ })
495
+ }),
496
+ /* @__PURE__ */ jsx(Section$1, {
497
+ id: "inspector",
498
+ title: "In an inspector",
499
+ description: /* @__PURE__ */ jsxs("p", { children: [
500
+ "The page builder's settings panel, at its 288px: small sliders for the type of the selected element, each changing the preview as it moves. A value box is as wide as the widest value it writes, and never under 68px; where one slider's values run wider, set ",
501
+ /* @__PURE__ */ jsx("code", { children: "--o-slider-value-w" }),
502
+ " on the panel's sliders to keep the tracks in line, as this panel does."
503
+ ] }),
504
+ children: /* @__PURE__ */ jsx(Example, {
505
+ code: `
506
+ <Field label="Font size">
507
+ <Slider size="sm" value={size} onValueChange={setSize} min={8} max={120} formatValue={(v) => \`\${v}px\`} />
508
+ </Field>
509
+ <Field label="Line height">
510
+ <Slider size="sm" value={leading} onValueChange={setLeading} min={0.8} max={3} step={0.1} />
511
+ </Field>
512
+ <Field label="Letter spacing">
513
+ <Slider size="sm" value={tracking} onValueChange={setTracking} min={-5} max={10} step={0.1} />
514
+ </Field>`,
515
+ children: /* @__PURE__ */ jsx(Inspector, {})
516
+ })
517
+ }),
518
+ /* @__PURE__ */ jsx(Section$1, {
519
+ id: "themes",
520
+ title: "Light and dark",
521
+ children: /* @__PURE__ */ jsx(ThemePair, {
522
+ align: "fill",
523
+ children: /* @__PURE__ */ jsxs("div", {
524
+ className: "slider-stack slider-stack--wide",
525
+ children: [/* @__PURE__ */ jsx(Field, {
526
+ label: "Font size",
527
+ children: /* @__PURE__ */ jsx(Slider, {
528
+ defaultValue: [32],
529
+ min: 8,
530
+ max: 120,
531
+ formatValue: px
532
+ })
533
+ }), /* @__PURE__ */ jsx(Field, {
534
+ label: "Price",
535
+ children: /* @__PURE__ */ jsx(Slider, {
536
+ defaultValue: [30, 120],
537
+ max: 200,
538
+ showValue: "text",
539
+ formatValue: pounds,
540
+ showLimits: true
541
+ })
542
+ })]
543
+ })
544
+ })
545
+ }),
546
+ /* @__PURE__ */ jsxs(Section$1, {
547
+ id: "keyboard",
548
+ title: "Keyboard",
549
+ description: /* @__PURE__ */ jsx("p", { children: "Tab to the thumb (and on to the box), then:" }),
550
+ children: [
551
+ /* @__PURE__ */ jsx(DocTable, {
552
+ columns: ["Keys", "On a thumb"],
553
+ rows: [
554
+ ["Right or Up arrow", "One step more. In right-to-left text, Right is one step less, as the track runs the other way."],
555
+ ["Left or Down arrow", "One step less."],
556
+ ["Shift with an arrow, Page Up, Page Down", "Ten steps."],
557
+ ["Home, End", "The lowest and highest the thumb may go (for a range, up to the other thumb)."]
558
+ ]
559
+ }),
560
+ /* @__PURE__ */ jsx(DocTable, {
561
+ columns: ["Keys", "In the value box"],
562
+ rows: [
563
+ ["Typing", "Moves the thumb as you type, held to the bounds."],
564
+ ["Enter", "Holds the value to the step and the bounds and commits it. Focus stays in the box."],
565
+ ["Up and Down arrows", "A step each, ten with Shift, committed each time."],
566
+ ["Escape", "Puts back the value from when the box took focus. With nothing to put back, it is the page’s."]
567
+ ]
568
+ }),
569
+ /* @__PURE__ */ jsx(Example, {
570
+ code: `<Slider aria-label="Volume" value={value} onValueChange={setValue} formatValue={(v) => \`\${v}%\`} />`,
571
+ children: /* @__PURE__ */ jsx(Keyboard, {})
572
+ })
573
+ ]
574
+ }),
575
+ /* @__PURE__ */ jsx(Section$1, {
576
+ id: "accessibility",
577
+ title: "Accessibility",
578
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
579
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
580
+ "Each thumb is a ",
581
+ /* @__PURE__ */ jsx("code", { children: "slider" }),
582
+ " with its value, bounds and spoken value (",
583
+ /* @__PURE__ */ jsx("code", { children: "aria-valuetext" }),
584
+ ", the formatted value, or ",
585
+ /* @__PURE__ */ jsx("code", { children: "getValueText" }),
586
+ "). A range thumb's bounds are the other thumb, so a screen reader says how far it can go."
587
+ ] }),
588
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
589
+ "Inside a Field, the label names every thumb and box; outside one, give the slider an ",
590
+ /* @__PURE__ */ jsx("code", { children: "aria-label" }),
591
+ ". A range's thumbs add their end before it (\"Minimum Price\"); translate the words with ",
592
+ /* @__PURE__ */ jsx("code", { children: "labels" }),
593
+ " ",
594
+ "(",
595
+ /* @__PURE__ */ jsx("code", { children: "sliderLabels" }),
596
+ " is the English set)."
597
+ ] }),
598
+ /* @__PURE__ */ jsx(Fragment$1, { children: "The written value, the limits and the tip are hidden from assistive technology: the thumb already says them." }),
599
+ /* @__PURE__ */ jsx(Fragment$1, { children: "The thumb's focus ring is drawn outside it at the kit's offset, apart from the hover halo. Under forced colours the track, fill and thumb take the system colours." }),
600
+ /* @__PURE__ */ jsx(Fragment$1, { children: "On a touch screen a press on the track waits for the finger to move: sideways it drags, up or down it scrolls the page and the thumb stays put, and a tap moves the thumb there. A drag the browser takes over for a scroll puts the value back and commits nothing. Under reduced motion the thumb jumps to a pressed place instead of gliding, and the tip fades in without rising." })
601
+ ] })
602
+ }),
603
+ /* @__PURE__ */ jsxs(Section$1, {
604
+ id: "guidelines",
605
+ title: "Guidelines",
606
+ children: [/* @__PURE__ */ jsx(DoDont, {
607
+ do: {
608
+ children: /* @__PURE__ */ jsx("div", {
609
+ className: "slider-dd",
610
+ children: /* @__PURE__ */ jsx(Field, {
611
+ label: "Line height",
612
+ children: /* @__PURE__ */ jsx(Slider, {
613
+ defaultValue: [1.5],
614
+ min: .8,
615
+ max: 3,
616
+ step: .1
617
+ })
618
+ })
619
+ }),
620
+ caption: "Use a slider for a bounded setting people tune by eye, with a box for the exact figure."
621
+ },
622
+ dont: {
623
+ children: /* @__PURE__ */ jsx("div", {
624
+ className: "slider-dd",
625
+ children: /* @__PURE__ */ jsx(Field, {
626
+ label: "Price",
627
+ children: /* @__PURE__ */ jsx(Slider, {
628
+ defaultValue: [249],
629
+ max: 5e3,
630
+ showValue: "none"
631
+ })
632
+ })
633
+ }),
634
+ caption: "Do not ask for an exact amount on a long track with nothing to read it by."
635
+ }
636
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
637
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
638
+ "Write the unit in ",
639
+ /* @__PURE__ */ jsx("code", { children: "formatValue" }),
640
+ " (\"16px\", \"60%\") so the box, the tip and the spoken value all carry it."
641
+ ] }),
642
+ /* @__PURE__ */ jsx(Fragment$1, { children: "Keep the step coarse enough that each arrow press changes something people can see." }),
643
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
644
+ "Use ",
645
+ /* @__PURE__ */ jsx("code", { children: "onValueCommit" }),
646
+ " for anything expensive (a save, a history entry) and ",
647
+ /* @__PURE__ */ jsx("code", { children: "onValueChange" }),
648
+ " for the preview."
649
+ ] })
650
+ ] })]
651
+ }),
652
+ /* @__PURE__ */ jsx(Fragment$1, {}),
653
+ /* @__PURE__ */ jsx(Section$1, {
654
+ id: "props",
655
+ title: "Props",
656
+ children: /* @__PURE__ */ jsx(PropsTable, { rows: [
657
+ {
658
+ name: "value",
659
+ type: "readonly number[]",
660
+ description: "The value, for a controlled slider: one number for one thumb, two for a range."
661
+ },
662
+ {
663
+ name: "defaultValue",
664
+ type: "readonly number[]",
665
+ default: "[min]",
666
+ description: "The value at first, when it is not controlled."
667
+ },
668
+ {
669
+ name: "onValueChange",
670
+ type: "(value: number[]) => void",
671
+ description: "Called on every change, while dragging and while typing in the box too."
672
+ },
673
+ {
674
+ name: "onValueCommit",
675
+ type: "(value: number[]) => void",
676
+ description: "Called once a change is finished (let go, a key, the box left or Enter), when the value differs from where it began."
677
+ },
678
+ {
679
+ name: "min",
680
+ type: "number",
681
+ default: "0",
682
+ description: "The lowest value."
683
+ },
684
+ {
685
+ name: "max",
686
+ type: "number",
687
+ default: "100",
688
+ description: "The highest value."
689
+ },
690
+ {
691
+ name: "step",
692
+ type: "number",
693
+ default: "1",
694
+ description: "The distance between values, decimals allowed, counted from min."
695
+ },
696
+ {
697
+ name: "minStepsBetweenThumbs",
698
+ type: "number",
699
+ default: "0",
700
+ description: "For a range, how many steps the thumbs keep apart."
701
+ },
702
+ {
703
+ name: "formatValue",
704
+ type: "(value: number) => string",
705
+ description: "Writes a value for people. Defaults to the number in the locale with the step's decimals."
706
+ },
707
+ {
708
+ name: "parseValue",
709
+ type: "(text: string) => number | null",
710
+ description: "Reads what is typed in the box. By default the number in the text, or a word formatValue writes."
711
+ },
712
+ {
713
+ name: "getValueText",
714
+ type: "(value: number, index: number) => string",
715
+ description: "What assistive tech says for a value. Defaults to formatValue."
716
+ },
717
+ {
718
+ name: "showValue",
719
+ type: "'input' | 'text' | 'none'",
720
+ default: "'input'",
721
+ description: "A value box, the value written, or nothing beside the track. A range has one at each end."
722
+ },
723
+ {
724
+ name: "tooltip",
725
+ type: "boolean",
726
+ default: "false",
727
+ description: "Shows the value on a tip over the thumb while hovered, focused or dragged."
728
+ },
729
+ {
730
+ name: "showLimits",
731
+ type: "boolean",
732
+ default: "false",
733
+ description: "Writes min and max under the ends of the track."
734
+ },
735
+ {
736
+ name: "size",
737
+ type: "'sm' | 'md'",
738
+ default: "'md'",
739
+ description: "An 18px thumb on a 6px track, or 14px on 4px."
740
+ },
741
+ {
742
+ name: "disabled",
743
+ type: "boolean",
744
+ default: "false",
745
+ description: "Leaves the tab order and does not move."
746
+ },
747
+ {
748
+ name: "name",
749
+ type: "string",
750
+ description: "Carries the value on a hidden input: name, or name[] for each value of a range."
751
+ },
752
+ {
753
+ name: "locale",
754
+ type: "string",
755
+ default: "'en-GB'",
756
+ description: "The locale the default format writes and the box reads."
757
+ },
758
+ {
759
+ name: "labels",
760
+ type: "Partial<SliderLabels>",
761
+ description: "The words a range’s thumbs are named by: start and end. sliderLabels is the English set."
762
+ },
763
+ {
764
+ name: "…div props",
765
+ type: "HTMLAttributes<HTMLDivElement>",
766
+ description: "className, style, id and the rest go to the root; aria-label, aria-labelledby and aria-describedby go to the thumbs and boxes."
767
+ }
768
+ ] })
769
+ })
770
+ ]
771
+ });
772
+ }
773
+ //#endregion
774
+ export { Page, Preview };