@orbitcommerce/constellation-docs 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs.css +14764 -2237
- package/dist/index.js +2 -2
- package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
- package/dist/pages/_address-data-L9BR499w.js +161 -0
- package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
- package/dist/pages/_card-art-0be5ncyV.js +18 -0
- package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
- package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
- package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
- package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
- package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
- package/dist/pages/address-block-BvxQWBTy.js +403 -0
- package/dist/pages/address-fields-CwSqro3W.js +277 -0
- package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
- package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
- package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
- package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
- package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
- package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
- package/dist/pages/board-card-D2tZY_mU.js +415 -0
- package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
- package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
- package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
- package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
- package/dist/pages/card-CXZ3V1d4.js +1612 -0
- package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
- package/dist/pages/chart-legend-B20AbakD.js +724 -0
- package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
- package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
- package/dist/pages/checklist-card-DEyykVFS.js +783 -0
- package/dist/pages/chip-Ck-o3Ui6.js +839 -0
- package/dist/pages/chip-list-k1LxXuCi.js +414 -0
- package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
- package/dist/pages/coachmark-Be2ghobT.js +366 -0
- package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
- package/dist/pages/collab-field-CfqqK7d2.js +696 -0
- package/dist/pages/color-field-CZpfcA-A.js +1127 -0
- package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
- package/dist/pages/comment-box-CDSGYhr5.js +346 -0
- package/dist/pages/composer-D4B0NgpA.js +689 -0
- package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
- package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
- package/dist/pages/context-menu-F9DV30ia.js +487 -0
- package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
- package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
- package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
- package/dist/pages/date-input-GOW067EB.js +956 -0
- package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
- package/dist/pages/description-list-BPeXn1eW.js +1268 -0
- package/dist/pages/device-switcher-BCaN99c1.js +554 -0
- package/dist/pages/dialog-CRpkRC98.js +3164 -0
- package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
- package/dist/pages/doodle-nzkqi2UI.js +201 -0
- package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
- package/dist/pages/drill-menu-cskH5mol.js +490 -0
- package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
- package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
- package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
- package/dist/pages/empty-state-4U2txFpI.js +1113 -0
- package/dist/pages/facet-filters-McbBeY9e.js +353 -0
- package/dist/pages/figure-D-HF5vCj.js +563 -0
- package/dist/pages/figure-strip-hg7txTc3.js +1381 -0
- package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
- package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
- package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
- package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
- package/dist/pages/form-grid-BfWCVlie.js +692 -0
- package/dist/pages/gallery-BBk2EOri.js +453 -0
- package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
- package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
- package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
- package/dist/pages/heatmap-BohgIcNk.js +507 -0
- package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
- package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
- package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
- package/dist/pages/hosted-field-BLh-53AE.js +208 -0
- package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
- package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
- package/dist/pages/image-cropper-NyougqLH.js +466 -0
- package/dist/pages/image-field-7knBv4mJ.js +567 -0
- package/dist/pages/import-result-CmTtGXW_.js +486 -0
- package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
- package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
- package/dist/pages/input-CzLCzfyx.js +2372 -0
- package/dist/pages/{installation-DpsX8G_n.js → installation-DRUWNVHP.js} +112 -29
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
- package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
- package/dist/pages/line-chart-CntWxeMF.js +1117 -0
- package/dist/pages/link-CXqvAg9z.js +689 -0
- package/dist/pages/link-picker-BMFGCC67.js +478 -0
- package/dist/pages/link-row-x8yaUuWc.js +595 -0
- package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
- package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
- package/dist/pages/loading-state-BNbCo51C.js +556 -0
- package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
- package/dist/pages/{logo-BfGF1Pq9.js → logo-D3a3QGKJ.js} +13 -13
- package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
- package/dist/pages/markdown-Ied72vMT.js +237 -0
- package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
- package/dist/pages/media-banner-DkStCia0.js +233 -0
- package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
- package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
- package/dist/pages/meta-line-D5p2TycR.js +371 -0
- package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
- package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
- package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
- package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/{overview-BPEbZQ6g.js → overview-BSfEqHY8.js} +4 -4
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
- package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
- package/dist/pages/password-field-DHEQKyUC.js +912 -0
- package/dist/pages/person-cell-BmjbADBz.js +564 -0
- package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
- package/dist/pages/plan-card-DRaA6RuB.js +621 -0
- package/dist/pages/plan-card-DtloWvMh.js +258 -0
- package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
- package/dist/pages/plan-grid-BCPvtP8J.js +251 -0
- package/dist/pages/point-list-BbPmZjsm.js +222 -0
- package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
- package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
- package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
- package/dist/pages/price-CRBLoa9h.js +604 -0
- package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
- package/dist/pages/print-page-BkLv6bW8.js +513 -0
- package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
- package/dist/pages/progress-CP_awmo4.js +904 -0
- package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
- package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-CbiibLwn.js} +581 -18
- package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
- package/dist/pages/rating-CweKN2SX.js +471 -0
- package/dist/pages/record-layout-DUP_X0RL.js +719 -0
- package/dist/pages/record-pager-y9D7JFgb.js +278 -0
- package/dist/pages/registry-CNR7zpf7.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.js} +4 -1
- package/dist/pages/repeater-BRZYKRQa.js +1351 -0
- package/dist/pages/reply-feedback-BDnHprla.js +192 -0
- package/dist/pages/reveal-BygENBbL.js +460 -0
- package/dist/pages/rich-text-DOFQZEpT.js +156 -0
- package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
- package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
- package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
- package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
- package/dist/pages/rule-list-DTCmIMpT.js +648 -0
- package/dist/pages/save-status-B5KkyMZP.js +378 -0
- package/dist/pages/schedule-YycI95O1.js +243 -0
- package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
- package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
- package/dist/pages/search-menu-DMuXyUUW.js +580 -0
- package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
- package/dist/pages/section-rail-BtTCETS5.js +637 -0
- package/dist/pages/section-v2Pubup9.js +639 -0
- package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
- package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
- package/dist/pages/share-list-D4wgBxKN.js +926 -0
- package/dist/pages/side-panel-CCtkrZjs.js +811 -0
- package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
- package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
- package/dist/pages/skip-link-BxznhSkz.js +252 -0
- package/dist/pages/slider-CAoPURKD.js +774 -0
- package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
- package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
- package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
- package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
- package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
- package/dist/pages/split-bar-DYgZnFID.js +414 -0
- package/dist/pages/split-button-Be08-VI-.js +335 -0
- package/dist/pages/split-pane-lSNZgTKt.js +523 -0
- package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
- package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
- package/dist/pages/status-dot-D99gAGsV.js +567 -0
- package/dist/pages/stepper-CxKTbEA-.js +1093 -0
- package/dist/pages/success-mark-CqFTOBEu.js +142 -0
- package/dist/pages/swatch-H_kNvHuC.js +565 -0
- package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
- package/dist/pages/table-mq_pNXza.js +3232 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -21
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
- package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
- package/dist/pages/time-input-CA9-uZAa.js +442 -0
- package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
- package/dist/pages/timeline-BsMUTlpR.js +1798 -0
- package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
- package/dist/pages/translation-field-CTRXiF2N.js +251 -0
- package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
- package/dist/pages/tree-select-DU1qXHy_.js +492 -0
- package/dist/pages/tree-view-g_RjLtAb.js +739 -0
- package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
- package/dist/pages/unit-input-Dml4fjmK.js +659 -0
- package/dist/pages/upload-rules-yozEzSah.js +419 -0
- package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
- package/dist/pages/value-change-CnubDKyO.js +489 -0
- package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
- package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
- package/dist/pages/working-status-CENemSsw.js +389 -0
- package/manifest.json +10989 -1108
- package/package.json +3 -3
- package/dist/pages/card-DUggbis3.js +0 -659
- package/dist/pages/checkbox-DwimQaK3.js +0 -365
- package/dist/pages/dialog-BRAf4LMh.js +0 -1451
- package/dist/pages/empty-state-C-mLrXW2.js +0 -417
- package/dist/pages/input-KF9Gkawf.js +0 -1093
- package/dist/pages/registry-CroHzK9I.js +0 -244
- package/dist/pages/skeleton-DLuBhP46.js +0 -561
- package/dist/pages/table-AMoODng4.js +0 -607
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as DocTable, d as Section, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-
|
|
3
|
-
import { t as Playground } from "./Playground-
|
|
2
|
+
import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
3
|
+
import { t as Playground } from "./Playground-Mk1yIWXb.js";
|
|
4
4
|
import { useId, useState } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { AreaChart, Delta, SegmentedControl } from "@orbitcommerce/constellation";
|
|
7
|
-
import { DesktopIcon, DeviceMobileIcon, DeviceTabletIcon, RowsIcon, SquaresFourIcon, TextAlignCenterIcon, TextAlignLeftIcon, TextAlignRightIcon } from "@orbitcommerce/constellation/icons";
|
|
7
|
+
import { DesktopIcon, DeviceMobileIcon, DeviceTabletIcon, RowsIcon, SquaresFourIcon, TextAlignCenterIcon, TextAlignJustifyIcon, TextAlignLeftIcon, TextAlignRightIcon, TextBIcon, TextItalicIcon, TextUnderlineIcon } from "@orbitcommerce/constellation/icons";
|
|
8
8
|
//#region src/pages/components/segmented-control.tsx
|
|
9
9
|
function Preview() {
|
|
10
10
|
return /* @__PURE__ */ jsx(SegmentedControl, {
|
|
@@ -194,6 +194,112 @@ function TakingsChart() {
|
|
|
194
194
|
})]
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
+
var TEXT_STYLES = [
|
|
198
|
+
{
|
|
199
|
+
value: "bold",
|
|
200
|
+
label: "Bold",
|
|
201
|
+
icon: /* @__PURE__ */ jsx(TextBIcon, {}),
|
|
202
|
+
iconOnly: true,
|
|
203
|
+
shortcut: ["mod", "B"]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
value: "italic",
|
|
207
|
+
label: "Italic",
|
|
208
|
+
icon: /* @__PURE__ */ jsx(TextItalicIcon, {}),
|
|
209
|
+
iconOnly: true,
|
|
210
|
+
shortcut: ["mod", "I"]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
value: "underline",
|
|
214
|
+
label: "Underline",
|
|
215
|
+
icon: /* @__PURE__ */ jsx(TextUnderlineIcon, {}),
|
|
216
|
+
iconOnly: true,
|
|
217
|
+
shortcut: ["mod", "U"]
|
|
218
|
+
}
|
|
219
|
+
];
|
|
220
|
+
/** Bold, italic and underline at once, over a line of text that wears them. */
|
|
221
|
+
function TextStyleChoice() {
|
|
222
|
+
const [styles, setStyles] = useState(["bold"]);
|
|
223
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
224
|
+
className: "segmented-control-inspector",
|
|
225
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
226
|
+
type: "multiple",
|
|
227
|
+
"aria-label": "Text style",
|
|
228
|
+
size: "sm",
|
|
229
|
+
options: TEXT_STYLES,
|
|
230
|
+
value: styles,
|
|
231
|
+
onValueChange: setStyles
|
|
232
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
233
|
+
className: "segmented-control-sample",
|
|
234
|
+
style: {
|
|
235
|
+
fontWeight: styles.includes("bold") ? 700 : 400,
|
|
236
|
+
fontStyle: styles.includes("italic") ? "italic" : "normal",
|
|
237
|
+
textDecoration: styles.includes("underline") ? "underline" : "none"
|
|
238
|
+
},
|
|
239
|
+
children: "Arden ergonomic chair, in stock"
|
|
240
|
+
})]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
var ALIGNMENT = [
|
|
244
|
+
{
|
|
245
|
+
value: "left",
|
|
246
|
+
label: "Align left",
|
|
247
|
+
icon: /* @__PURE__ */ jsx(TextAlignLeftIcon, {}),
|
|
248
|
+
iconOnly: true
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
value: "center",
|
|
252
|
+
label: "Align centre",
|
|
253
|
+
icon: /* @__PURE__ */ jsx(TextAlignCenterIcon, {}),
|
|
254
|
+
iconOnly: true
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
value: "right",
|
|
258
|
+
label: "Align right",
|
|
259
|
+
icon: /* @__PURE__ */ jsx(TextAlignRightIcon, {}),
|
|
260
|
+
iconOnly: true
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
value: "justify",
|
|
264
|
+
label: "Justify",
|
|
265
|
+
icon: /* @__PURE__ */ jsx(TextAlignJustifyIcon, {}),
|
|
266
|
+
iconOnly: true
|
|
267
|
+
}
|
|
268
|
+
];
|
|
269
|
+
var PREVIEW_DEVICES = [
|
|
270
|
+
{
|
|
271
|
+
value: "desktop",
|
|
272
|
+
label: "Desktop",
|
|
273
|
+
icon: /* @__PURE__ */ jsx(DesktopIcon, {}),
|
|
274
|
+
iconOnly: true
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
value: "tablet",
|
|
278
|
+
label: "Tablet",
|
|
279
|
+
icon: /* @__PURE__ */ jsx(DeviceTabletIcon, {}),
|
|
280
|
+
iconOnly: true
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
value: "mobile",
|
|
284
|
+
label: "Mobile",
|
|
285
|
+
icon: /* @__PURE__ */ jsx(DeviceMobileIcon, {}),
|
|
286
|
+
iconOnly: true
|
|
287
|
+
}
|
|
288
|
+
];
|
|
289
|
+
var GROUP_BY = [
|
|
290
|
+
{
|
|
291
|
+
value: "colour",
|
|
292
|
+
label: "Colour"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
value: "size",
|
|
296
|
+
label: "Size"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
value: "material",
|
|
300
|
+
label: "Material"
|
|
301
|
+
}
|
|
302
|
+
];
|
|
197
303
|
var ACCESS = [
|
|
198
304
|
{
|
|
199
305
|
value: "full",
|
|
@@ -249,7 +355,7 @@ function Page() {
|
|
|
249
355
|
importNames: ["SegmentedControl"],
|
|
250
356
|
lead: "A pill track for choosing one of a few views: the date range of a chart, a grid or a list, a device to preview on. The chosen option rides a raised thumb that glides between them.",
|
|
251
357
|
children: [
|
|
252
|
-
/* @__PURE__ */ jsx(Section, {
|
|
358
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
253
359
|
id: "playground",
|
|
254
360
|
title: "Playground",
|
|
255
361
|
description: /* @__PURE__ */ jsx("p", { children: "Change the props, then click between the options to watch the thumb glide." }),
|
|
@@ -268,7 +374,7 @@ function Page() {
|
|
|
268
374
|
})
|
|
269
375
|
})
|
|
270
376
|
}),
|
|
271
|
-
/* @__PURE__ */ jsx(Section, {
|
|
377
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
272
378
|
id: "controlled",
|
|
273
379
|
title: "A date range for a chart",
|
|
274
380
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -297,7 +403,7 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
297
403
|
children: /* @__PURE__ */ jsx(TakingsChart, {})
|
|
298
404
|
})
|
|
299
405
|
}),
|
|
300
|
-
/* @__PURE__ */ jsx(Section, {
|
|
406
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
301
407
|
id: "sizes",
|
|
302
408
|
title: "Sizes",
|
|
303
409
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -325,18 +431,22 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
325
431
|
})
|
|
326
432
|
})
|
|
327
433
|
}),
|
|
328
|
-
/* @__PURE__ */ jsx(Section, {
|
|
434
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
329
435
|
id: "full-width",
|
|
330
436
|
title: "Full width",
|
|
331
|
-
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
332
|
-
"
|
|
333
|
-
/* @__PURE__ */ jsx("
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
437
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
438
|
+
/* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "fullWidth" }), " stretches the track and shares it equally between the options. Use it in dialogs, popovers and narrow panels, where the control is the width of the fields around it."] }),
|
|
439
|
+
/* @__PURE__ */ jsx("p", { children: "It never squeezes an option below its words. A track that does not fit its container, full width or not (on a phone, say), scrolls sideways instead: it fades at whichever end has more to show and keeps the chosen option in view, as tabs do." }),
|
|
440
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
441
|
+
"The control has no visible label of its own and cannot sit in a Field. For a visible label, write it above and point ",
|
|
442
|
+
/* @__PURE__ */ jsx("code", { children: "aria-labelledby" }),
|
|
443
|
+
" at it, in place of ",
|
|
444
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
445
|
+
". A hint below can be linked with ",
|
|
446
|
+
/* @__PURE__ */ jsx("code", { children: "aria-describedby" }),
|
|
447
|
+
"."
|
|
448
|
+
] })
|
|
449
|
+
] }),
|
|
340
450
|
children: /* @__PURE__ */ jsx(Example, {
|
|
341
451
|
align: "fill",
|
|
342
452
|
code: `
|
|
@@ -357,7 +467,7 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
357
467
|
children: /* @__PURE__ */ jsx(AccessChoice, {})
|
|
358
468
|
})
|
|
359
469
|
}),
|
|
360
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
470
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
361
471
|
id: "icons",
|
|
362
472
|
title: "With icons",
|
|
363
473
|
description: /* @__PURE__ */ jsx("p", { children: "A leading icon on each option, for views that have a well-known picture." }),
|
|
@@ -391,7 +501,7 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
391
501
|
/* @__PURE__ */ jsx("code", { children: "iconOnly" }),
|
|
392
502
|
" on an option and keep its ",
|
|
393
503
|
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
394
|
-
": the icon is centred
|
|
504
|
+
": the icon is centred, the label becomes what screen readers say, and it shows as a tooltip on hover and keyboard focus. Drop the words only where the icons are well known, like text alignment in the page builder."
|
|
395
505
|
] }),
|
|
396
506
|
children: /* @__PURE__ */ jsx(Example, {
|
|
397
507
|
code: `
|
|
@@ -429,7 +539,232 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
429
539
|
})
|
|
430
540
|
})]
|
|
431
541
|
}),
|
|
432
|
-
/* @__PURE__ */ jsx(Section, {
|
|
542
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
543
|
+
id: "tooltips",
|
|
544
|
+
title: "Tooltips",
|
|
545
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
546
|
+
"An icon-only option shows its ",
|
|
547
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
548
|
+
" in a tooltip on hover and on keyboard focus, so the name is on screen and not only read out. Give any option a ",
|
|
549
|
+
/* @__PURE__ */ jsx("code", { children: "tooltip" }),
|
|
550
|
+
" of its own, a short sentence about what it does, and a ",
|
|
551
|
+
/* @__PURE__ */ jsx("code", { children: "shortcut" }),
|
|
552
|
+
" to show its keys after the words. ",
|
|
553
|
+
/* @__PURE__ */ jsx("code", { children: "tooltip: false" }),
|
|
554
|
+
" ",
|
|
555
|
+
"turns one off."
|
|
556
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [
|
|
557
|
+
"The tooltips share their timing: once one is open, the next opens at once as the pointer moves along.",
|
|
558
|
+
" ",
|
|
559
|
+
/* @__PURE__ */ jsx("code", { children: "tooltipSide=\"bottom\"" }),
|
|
560
|
+
" opens them below, for a control in a top bar."
|
|
561
|
+
] })] }),
|
|
562
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
563
|
+
code: `
|
|
564
|
+
<SegmentedControl
|
|
565
|
+
aria-label="Preview device"
|
|
566
|
+
size="sm"
|
|
567
|
+
tooltipSide="bottom"
|
|
568
|
+
options={[
|
|
569
|
+
{ value: 'desktop', label: 'Desktop', icon: <DesktopIcon />, iconOnly: true },
|
|
570
|
+
{ value: 'tablet', label: 'Tablet', icon: <DeviceTabletIcon />, iconOnly: true },
|
|
571
|
+
{ value: 'mobile', label: 'Mobile', icon: <DeviceMobileIcon />, iconOnly: true },
|
|
572
|
+
]}
|
|
573
|
+
/>
|
|
574
|
+
<SegmentedControl
|
|
575
|
+
aria-label="Editor mode"
|
|
576
|
+
size="sm"
|
|
577
|
+
options={[
|
|
578
|
+
{ value: 'basic', label: 'Basic', tooltip: 'The settings most pages need' },
|
|
579
|
+
{ value: 'pro', label: 'Pro', tooltip: 'Every setting, for fine control' },
|
|
580
|
+
]}
|
|
581
|
+
/>`,
|
|
582
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
583
|
+
className: "segmented-control-row",
|
|
584
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
585
|
+
"aria-label": "Preview device",
|
|
586
|
+
size: "sm",
|
|
587
|
+
tooltipSide: "bottom",
|
|
588
|
+
options: PREVIEW_DEVICES
|
|
589
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
590
|
+
"aria-label": "Editor mode",
|
|
591
|
+
size: "sm",
|
|
592
|
+
options: [{
|
|
593
|
+
value: "basic",
|
|
594
|
+
label: "Basic",
|
|
595
|
+
tooltip: "The settings most pages need"
|
|
596
|
+
}, {
|
|
597
|
+
value: "pro",
|
|
598
|
+
label: "Pro",
|
|
599
|
+
tooltip: "Every setting, for fine control"
|
|
600
|
+
}]
|
|
601
|
+
})]
|
|
602
|
+
})
|
|
603
|
+
})
|
|
604
|
+
}),
|
|
605
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
606
|
+
id: "multiple",
|
|
607
|
+
title: "Several at once",
|
|
608
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
609
|
+
/* @__PURE__ */ jsx("code", { children: "type=\"multiple\"" }),
|
|
610
|
+
" makes a row of toggles: any number can be on, each with a raised thumb of its own, as bold, italic and underline are in a text editor. ",
|
|
611
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
612
|
+
" is an array, and",
|
|
613
|
+
" ",
|
|
614
|
+
/* @__PURE__ */ jsx("code", { children: "onValueChange" }),
|
|
615
|
+
" reports every option that is on, in the options' order. It is a group of pressed buttons rather than a radio group: the arrow keys move along the row, and Space or Enter turns one on or off."
|
|
616
|
+
] }),
|
|
617
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
618
|
+
code: `
|
|
619
|
+
const [styles, setStyles] = useState<TextStyle[]>(['bold'])
|
|
620
|
+
|
|
621
|
+
<SegmentedControl
|
|
622
|
+
type="multiple"
|
|
623
|
+
aria-label="Text style"
|
|
624
|
+
size="sm"
|
|
625
|
+
value={styles}
|
|
626
|
+
onValueChange={setStyles}
|
|
627
|
+
options={[
|
|
628
|
+
{ value: 'bold', label: 'Bold', icon: <TextBIcon />, iconOnly: true, shortcut: ['mod', 'B'] },
|
|
629
|
+
{ value: 'italic', label: 'Italic', icon: <TextItalicIcon />, iconOnly: true, shortcut: ['mod', 'I'] },
|
|
630
|
+
{ value: 'underline', label: 'Underline', icon: <TextUnderlineIcon />, iconOnly: true, shortcut: ['mod', 'U'] },
|
|
631
|
+
]}
|
|
632
|
+
/>`,
|
|
633
|
+
children: /* @__PURE__ */ jsx(TextStyleChoice, {})
|
|
634
|
+
})
|
|
635
|
+
}),
|
|
636
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
637
|
+
id: "grid",
|
|
638
|
+
title: "A grid",
|
|
639
|
+
description: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("p", { children: [
|
|
640
|
+
/* @__PURE__ */ jsx("code", { children: "columns" }),
|
|
641
|
+
" lays the options in a grid of equal columns that fills its container, as the font style pair does in an inspector panel. ",
|
|
642
|
+
/* @__PURE__ */ jsx("code", { children: "columns=\"wrap\"" }),
|
|
643
|
+
" lets them run onto more rows instead. Either way the track never scrolls sideways: it grows down, and rounds off at the curve of one row, so a single row is still the pill."
|
|
644
|
+
] }) }),
|
|
645
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
646
|
+
align: "fill",
|
|
647
|
+
code: `
|
|
648
|
+
<SegmentedControl
|
|
649
|
+
aria-label="Font style"
|
|
650
|
+
columns={2}
|
|
651
|
+
options={[
|
|
652
|
+
{ value: 'normal', label: 'Normal' },
|
|
653
|
+
{ value: 'italic', label: <span style={{ fontStyle: 'italic' }}>Italic</span> },
|
|
654
|
+
]}
|
|
655
|
+
/>
|
|
656
|
+
<SegmentedControl aria-label="Card layout" columns={3} options={layouts} />`,
|
|
657
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
658
|
+
className: "segmented-control-inspector",
|
|
659
|
+
children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
660
|
+
"aria-label": "Font style",
|
|
661
|
+
columns: 2,
|
|
662
|
+
size: "sm",
|
|
663
|
+
defaultValue: "normal",
|
|
664
|
+
options: [{
|
|
665
|
+
value: "normal",
|
|
666
|
+
label: "Normal"
|
|
667
|
+
}, {
|
|
668
|
+
value: "italic",
|
|
669
|
+
label: /* @__PURE__ */ jsx("span", {
|
|
670
|
+
style: { fontStyle: "italic" },
|
|
671
|
+
children: "Italic"
|
|
672
|
+
})
|
|
673
|
+
}]
|
|
674
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
675
|
+
"aria-label": "Card layout",
|
|
676
|
+
columns: 3,
|
|
677
|
+
size: "sm",
|
|
678
|
+
defaultValue: "grid-3",
|
|
679
|
+
options: [
|
|
680
|
+
{
|
|
681
|
+
value: "grid-2",
|
|
682
|
+
label: "2 across"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
value: "grid-3",
|
|
686
|
+
label: "3 across"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
value: "grid-4",
|
|
690
|
+
label: "4 across"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
value: "list",
|
|
694
|
+
label: "List"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
value: "carousel",
|
|
698
|
+
label: "Carousel"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
value: "masonry",
|
|
702
|
+
label: "Masonry"
|
|
703
|
+
}
|
|
704
|
+
]
|
|
705
|
+
})]
|
|
706
|
+
})
|
|
707
|
+
})
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
710
|
+
id: "caption",
|
|
711
|
+
title: "A caption",
|
|
712
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "caption" }), " writes the chosen option's name in a quiet line under the track, for icon-only options whose choice has no words on screen. Pass a function for words of your own. It is for the eye: the chosen option already says its name to assistive tech, so the caption is hidden from it."] }),
|
|
713
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
714
|
+
code: `
|
|
715
|
+
<SegmentedControl aria-label="Text alignment" size="sm" caption options={alignment} defaultValue="left" />`,
|
|
716
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
717
|
+
"aria-label": "Text alignment",
|
|
718
|
+
size: "sm",
|
|
719
|
+
caption: true,
|
|
720
|
+
options: ALIGNMENT,
|
|
721
|
+
defaultValue: "left"
|
|
722
|
+
})
|
|
723
|
+
})
|
|
724
|
+
}),
|
|
725
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
726
|
+
id: "chips",
|
|
727
|
+
title: "Chips",
|
|
728
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
729
|
+
/* @__PURE__ */ jsx("code", { children: "variant=\"chips\"" }),
|
|
730
|
+
" drops the track for loose pills: the chosen one in the accent wash with a teal hairline inside it, the others lighting on hover. Use it for a second-level choice that sits inside something else, such as \"Group by\" over a variant table, where a full track would be too heavy.",
|
|
731
|
+
" ",
|
|
732
|
+
/* @__PURE__ */ jsx("code", { children: "size=\"xs\"" }),
|
|
733
|
+
" makes them 24px, a size only chips have."
|
|
734
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [
|
|
735
|
+
"Tabs have the same look, for a section's sub-tabs: ",
|
|
736
|
+
/* @__PURE__ */ jsx("code", { children: "<TabsList variant=\"chips\">" }),
|
|
737
|
+
"."
|
|
738
|
+
] })] }),
|
|
739
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
740
|
+
code: `
|
|
741
|
+
<SegmentedControl aria-label="Group by" variant="chips" size="xs" options={groupBy} defaultValue="colour" />
|
|
742
|
+
<SegmentedControl aria-label="Group by" variant="chips" size="sm" options={groupBy} defaultValue="colour" />`,
|
|
743
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
744
|
+
className: "segmented-control-rows",
|
|
745
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
746
|
+
className: "segmented-control-chips-row",
|
|
747
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
748
|
+
className: "segmented-control-chips-row__label",
|
|
749
|
+
children: "Group by"
|
|
750
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
751
|
+
"aria-label": "Group by",
|
|
752
|
+
variant: "chips",
|
|
753
|
+
size: "xs",
|
|
754
|
+
options: GROUP_BY,
|
|
755
|
+
defaultValue: "colour"
|
|
756
|
+
})]
|
|
757
|
+
}), /* @__PURE__ */ jsx(SegmentedControl, {
|
|
758
|
+
"aria-label": "Group by",
|
|
759
|
+
variant: "chips",
|
|
760
|
+
size: "sm",
|
|
761
|
+
options: GROUP_BY,
|
|
762
|
+
defaultValue: "colour"
|
|
763
|
+
})]
|
|
764
|
+
})
|
|
765
|
+
})
|
|
766
|
+
}),
|
|
767
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
433
768
|
id: "disabled",
|
|
434
769
|
title: "Disabled",
|
|
435
770
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -481,11 +816,11 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
481
816
|
})
|
|
482
817
|
})
|
|
483
818
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
485
820
|
id: "keyboard",
|
|
486
821
|
title: "Keyboard",
|
|
487
822
|
description: /* @__PURE__ */ jsx("p", { children: "It behaves as a radio group: one Tab stop, and the arrows move the choice." }),
|
|
488
|
-
children: /* @__PURE__ */ jsx(DocTable, {
|
|
823
|
+
children: [/* @__PURE__ */ jsx(DocTable, {
|
|
489
824
|
columns: ["Key", "What it does"],
|
|
490
825
|
rows: [
|
|
491
826
|
["Tab", "Moves focus to the chosen option. The whole control is one Tab stop."],
|
|
@@ -493,9 +828,24 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
493
828
|
["Left and up arrows", "Choose the previous option, the same way. Left and right swap in right-to-left layouts."],
|
|
494
829
|
["Home, End", "Choose the first or the last enabled option."]
|
|
495
830
|
]
|
|
496
|
-
})
|
|
831
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
832
|
+
title: "Several at once",
|
|
833
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
834
|
+
"With ",
|
|
835
|
+
/* @__PURE__ */ jsx("code", { children: "type=\"multiple\"" }),
|
|
836
|
+
", moving and choosing are apart."
|
|
837
|
+
] }),
|
|
838
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
839
|
+
columns: ["Key", "What it does"],
|
|
840
|
+
rows: [
|
|
841
|
+
["Tab", "Moves focus to the first option that is on, or the first option. The whole row is one Tab stop."],
|
|
842
|
+
["Arrows, Home, End", "Move focus along the row, without changing anything."],
|
|
843
|
+
["Space, Enter", "Turn the focused option on or off."]
|
|
844
|
+
]
|
|
845
|
+
})
|
|
846
|
+
})]
|
|
497
847
|
}),
|
|
498
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
848
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
499
849
|
id: "motion",
|
|
500
850
|
title: "The gliding thumb",
|
|
501
851
|
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", { children: "There is one thumb, and it moves: a raised pill (white in light, a step lighter than the track in dark) that glides to the new choice on the snappy spring. The chosen label turns semibold without changing width, because an invisible semibold copy of the text holds the space." }), /* @__PURE__ */ jsx("p", { children: "Under reduced motion the thumb jumps straight to the new option, and only the text colour fades. Click along the options, or use the arrow keys." })] }),
|
|
@@ -540,7 +890,7 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
540
890
|
})
|
|
541
891
|
}), /* @__PURE__ */ jsx(Note, { children: "The width is only held when the label is a string. Pass words as plain strings: text wrapped in an element still turns semibold, and nudges the row when it does." })]
|
|
542
892
|
}),
|
|
543
|
-
/* @__PURE__ */ jsx(Section, {
|
|
893
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
544
894
|
id: "both-themes",
|
|
545
895
|
title: "In both themes",
|
|
546
896
|
description: /* @__PURE__ */ jsx("p", { children: "Text, icons and icon only, light and dark side by side. In dark the thumb is a lighter step of the track." }),
|
|
@@ -589,11 +939,25 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
589
939
|
iconOnly: true
|
|
590
940
|
}
|
|
591
941
|
]
|
|
942
|
+
}),
|
|
943
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
944
|
+
type: "multiple",
|
|
945
|
+
"aria-label": "Text style",
|
|
946
|
+
size: "sm",
|
|
947
|
+
options: TEXT_STYLES,
|
|
948
|
+
defaultValue: ["bold", "italic"]
|
|
949
|
+
}),
|
|
950
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
951
|
+
"aria-label": "Group by",
|
|
952
|
+
variant: "chips",
|
|
953
|
+
size: "xs",
|
|
954
|
+
options: GROUP_BY,
|
|
955
|
+
defaultValue: "size"
|
|
592
956
|
})
|
|
593
957
|
]
|
|
594
958
|
}) })
|
|
595
959
|
}),
|
|
596
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
960
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
597
961
|
id: "guidelines",
|
|
598
962
|
title: "Guidelines",
|
|
599
963
|
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
@@ -646,7 +1010,7 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
646
1010
|
"Drop the words only when every icon is unmistakable, and keep a hidden label on each."
|
|
647
1011
|
] })]
|
|
648
1012
|
}),
|
|
649
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1013
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
650
1014
|
id: "accessibility",
|
|
651
1015
|
title: "Accessibility",
|
|
652
1016
|
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
@@ -670,12 +1034,23 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
670
1034
|
/* @__PURE__ */ jsx("code", { children: "aria-disabled" }),
|
|
671
1035
|
" on the group."
|
|
672
1036
|
] }),
|
|
673
|
-
"Icons are hidden from assistive tech, so an icon-only option needs its hidden text label.",
|
|
1037
|
+
"Icons are hidden from assistive tech, so an icon-only option needs its hidden text label, which also shows as its tooltip.",
|
|
1038
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1039
|
+
"With ",
|
|
1040
|
+
/* @__PURE__ */ jsx("code", { children: "type=\"multiple\"" }),
|
|
1041
|
+
" it is a ",
|
|
1042
|
+
/* @__PURE__ */ jsx("code", { children: "group" }),
|
|
1043
|
+
" of buttons carrying ",
|
|
1044
|
+
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
1045
|
+
", with one Tab stop: the arrows move focus, and Space or Enter toggles."
|
|
1046
|
+
] }),
|
|
1047
|
+
"A caption is hidden from assistive tech: the chosen option already says its name.",
|
|
1048
|
+
"Under forced colours the chosen option keeps a system outline, as its thumb fill is dropped.",
|
|
674
1049
|
"The focus ring is teal, 2px, just outside the option, for keyboard focus only.",
|
|
675
1050
|
"Under reduced motion the thumb jumps instead of gliding."
|
|
676
1051
|
] })
|
|
677
1052
|
}),
|
|
678
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
1053
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
679
1054
|
id: "props",
|
|
680
1055
|
title: "Props",
|
|
681
1056
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -702,26 +1077,54 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
702
1077
|
type: "string",
|
|
703
1078
|
description: "The id of a visible heading that names the group, in place of aria-label."
|
|
704
1079
|
},
|
|
1080
|
+
{
|
|
1081
|
+
name: "type",
|
|
1082
|
+
type: "'single' | 'multiple'",
|
|
1083
|
+
default: "'single'",
|
|
1084
|
+
description: "One option at a time (a radio group), or any number on at once (a row of toggles)."
|
|
1085
|
+
},
|
|
705
1086
|
{
|
|
706
1087
|
name: "value",
|
|
707
|
-
type: "V",
|
|
708
|
-
description: "The chosen value, when you control it."
|
|
1088
|
+
type: "V | V[]",
|
|
1089
|
+
description: "The chosen value, or with type=\"multiple\" the options that are on, when you control it."
|
|
709
1090
|
},
|
|
710
1091
|
{
|
|
711
1092
|
name: "defaultValue",
|
|
712
|
-
type: "V",
|
|
713
|
-
description: "The starting value when uncontrolled. Defaults to the first enabled option."
|
|
1093
|
+
type: "V | V[]",
|
|
1094
|
+
description: "The starting value when uncontrolled. Defaults to the first enabled option, or none with type=\"multiple\"."
|
|
714
1095
|
},
|
|
715
1096
|
{
|
|
716
1097
|
name: "onValueChange",
|
|
717
|
-
type: "(value: V) => void",
|
|
718
|
-
description: "Called when the choice changes, by click or by arrow key."
|
|
1098
|
+
type: "(value: V) => void | (value: V[]) => void",
|
|
1099
|
+
description: "Called when the choice changes, by click or by arrow key; with type=\"multiple\", with every option that is on."
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
name: "variant",
|
|
1103
|
+
type: "'track' | 'chips'",
|
|
1104
|
+
default: "'track'",
|
|
1105
|
+
description: "A pill track with a raised thumb, or loose pills with the chosen one in the accent wash."
|
|
719
1106
|
},
|
|
720
1107
|
{
|
|
721
1108
|
name: "size",
|
|
722
|
-
type: "'sm' | 'md'",
|
|
1109
|
+
type: "'xs' | 'sm' | 'md'",
|
|
723
1110
|
default: "'md'",
|
|
724
|
-
description: "30 or 36px tall."
|
|
1111
|
+
description: "30 or 36px tall; xs is 24px, for chips (the track draws it at sm)."
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
name: "columns",
|
|
1115
|
+
type: "number | 'wrap'",
|
|
1116
|
+
description: "A grid of this many equal columns that fills its container, or options that wrap onto more rows. Never scrolls."
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
name: "caption",
|
|
1120
|
+
type: "boolean | (chosen) => ReactNode",
|
|
1121
|
+
description: "A quiet line under the track naming the choice, or what the function makes of the chosen options."
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
name: "tooltipSide",
|
|
1125
|
+
type: "'top' | 'bottom'",
|
|
1126
|
+
default: "'top'",
|
|
1127
|
+
description: "Where the options’ tooltips open."
|
|
725
1128
|
},
|
|
726
1129
|
{
|
|
727
1130
|
name: "fullWidth",
|
|
@@ -760,7 +1163,17 @@ const [range, setRange] = useState<Range>('30d')
|
|
|
760
1163
|
name: "iconOnly",
|
|
761
1164
|
type: "boolean",
|
|
762
1165
|
default: "false",
|
|
763
|
-
description: "Show the icon alone, centred on a round thumb. Needs an icon."
|
|
1166
|
+
description: "Show the icon alone, centred on a round thumb, with the label as its tooltip. Needs an icon."
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
name: "tooltip",
|
|
1170
|
+
type: "ReactNode | false",
|
|
1171
|
+
description: "A tooltip of its own on hover and keyboard focus. Icon-only options, and options with a shortcut, show the label by default; false for none."
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: "shortcut",
|
|
1175
|
+
type: "string[]",
|
|
1176
|
+
description: "Keys drawn as keycaps after the tooltip's words, e.g. ['mod', 'B']. Visual only."
|
|
764
1177
|
},
|
|
765
1178
|
{
|
|
766
1179
|
name: "disabled",
|