@orbitcommerce/constellation-docs 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-BZOOOPA9.js +368 -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-CQEM1_wc.js +1567 -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-BB3mNl7D.js +1364 -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-C3UcpQJT.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-B38rnzoq.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-LA9XRhZc.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-cfPVTB5V.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-C-4tg6FS.js} +580 -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-BZg-xAbi.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-Cs6tl16C.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-CL0vomno.js +3225 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -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 +10984 -1108
- package/package.json +2 -2
- 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,11 +1,333 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
-
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-
|
|
4
|
-
import { t as Playground } from "./Playground-
|
|
3
|
+
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";
|
|
4
|
+
import { t as Playground } from "./Playground-Mk1yIWXb.js";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { Badge, Button, Field, Input, RadioGroup, RadioGroupItem } from "@orbitcommerce/constellation";
|
|
8
|
-
import { CheckCircleIcon } from "@orbitcommerce/constellation/icons";
|
|
7
|
+
import { Badge, Button, ConfirmDialog, Field, Input, RadioCardSummary, RadioGroup, RadioGroupItem } from "@orbitcommerce/constellation";
|
|
8
|
+
import { CheckCircleIcon, CubeIcon, DownloadSimpleIcon, GiftIcon, PackageIcon, StackIcon } from "@orbitcommerce/constellation/icons";
|
|
9
|
+
//#region src/pages/components/_choice-card-examples.tsx
|
|
10
|
+
function ProductType() {
|
|
11
|
+
const [type, setType] = useState("physical");
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "radio-stack",
|
|
14
|
+
children: /* @__PURE__ */ jsxs(RadioGroup, {
|
|
15
|
+
"aria-label": "Product type",
|
|
16
|
+
variant: "card",
|
|
17
|
+
columns: 2,
|
|
18
|
+
value: type,
|
|
19
|
+
onValueChange: setType,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
22
|
+
value: "physical",
|
|
23
|
+
label: "Physical product",
|
|
24
|
+
description: "Shipped or collected. Stock is counted.",
|
|
25
|
+
icon: /* @__PURE__ */ jsx(PackageIcon, {})
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
28
|
+
value: "digital",
|
|
29
|
+
label: "Digital product",
|
|
30
|
+
description: "A download sent after payment.",
|
|
31
|
+
icon: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
34
|
+
value: "bundle",
|
|
35
|
+
label: "Bundle",
|
|
36
|
+
description: "Several products sold as one.",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(StackIcon, {}),
|
|
38
|
+
badge: /* @__PURE__ */ jsx(Badge, {
|
|
39
|
+
size: "sm",
|
|
40
|
+
tone: "accent",
|
|
41
|
+
children: "New"
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
45
|
+
value: "gift-card",
|
|
46
|
+
label: "Gift card",
|
|
47
|
+
description: "A balance to spend in your shop.",
|
|
48
|
+
icon: /* @__PURE__ */ jsx(GiftIcon, {})
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function Sketch({ kind }) {
|
|
55
|
+
const block = (x, y, w, h, tone = "fill") => /* @__PURE__ */ jsx("rect", {
|
|
56
|
+
x,
|
|
57
|
+
y,
|
|
58
|
+
width: w,
|
|
59
|
+
height: h,
|
|
60
|
+
rx: 3,
|
|
61
|
+
className: tone === "ink" ? "radio-sketch__ink" : "radio-sketch__fill"
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
64
|
+
viewBox: "0 0 160 96",
|
|
65
|
+
className: "radio-sketch",
|
|
66
|
+
role: "presentation",
|
|
67
|
+
children: kind === "gallery" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
68
|
+
block(10, 10, 84, 76),
|
|
69
|
+
block(102, 12, 48, 6, "ink"),
|
|
70
|
+
block(102, 24, 34, 4),
|
|
71
|
+
block(102, 34, 40, 4),
|
|
72
|
+
block(102, 70, 48, 14, "ink")
|
|
73
|
+
] }) : kind === "stacked" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
74
|
+
block(10, 10, 140, 46),
|
|
75
|
+
block(10, 62, 60, 6, "ink"),
|
|
76
|
+
block(10, 74, 90, 4),
|
|
77
|
+
block(110, 66, 40, 14, "ink")
|
|
78
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
79
|
+
block(10, 10, 66, 76),
|
|
80
|
+
block(84, 10, 66, 36),
|
|
81
|
+
block(84, 54, 50, 6, "ink"),
|
|
82
|
+
block(84, 70, 66, 14, "ink")
|
|
83
|
+
] })
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function LayoutChooser() {
|
|
87
|
+
return /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: "radio-stack radio-stack--wide",
|
|
89
|
+
children: /* @__PURE__ */ jsxs(RadioGroup, {
|
|
90
|
+
"aria-label": "Product page layout",
|
|
91
|
+
variant: "card",
|
|
92
|
+
columns: 3,
|
|
93
|
+
indicator: false,
|
|
94
|
+
defaultValue: "gallery",
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
97
|
+
value: "gallery",
|
|
98
|
+
label: "Gallery",
|
|
99
|
+
description: "Photos beside the details.",
|
|
100
|
+
media: /* @__PURE__ */ jsx(Sketch, { kind: "gallery" }),
|
|
101
|
+
selectedPill: true
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
104
|
+
value: "stacked",
|
|
105
|
+
label: "Stacked",
|
|
106
|
+
description: "A wide photo, then the details.",
|
|
107
|
+
media: /* @__PURE__ */ jsx(Sketch, { kind: "stacked" }),
|
|
108
|
+
selectedPill: true
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
111
|
+
value: "split",
|
|
112
|
+
label: "Split",
|
|
113
|
+
description: "Two photos and the details.",
|
|
114
|
+
media: /* @__PURE__ */ jsx(Sketch, { kind: "split" }),
|
|
115
|
+
selectedPill: true
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
var PER_MONTH = {
|
|
122
|
+
unit: "/mo",
|
|
123
|
+
unitLabel: "per month"
|
|
124
|
+
};
|
|
125
|
+
var PLANS = [
|
|
126
|
+
{
|
|
127
|
+
value: "starter",
|
|
128
|
+
label: "Starter",
|
|
129
|
+
description: "One shop, up to 100 products.",
|
|
130
|
+
price: { free: true }
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
value: "growth",
|
|
134
|
+
label: "Growth",
|
|
135
|
+
description: "Unlimited products and two staff.",
|
|
136
|
+
price: {
|
|
137
|
+
amount: 25,
|
|
138
|
+
compareAt: 35,
|
|
139
|
+
...PER_MONTH,
|
|
140
|
+
note: "14-day free trial"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
value: "scale",
|
|
145
|
+
label: "Scale",
|
|
146
|
+
description: "Ten staff, B2B pricing and the API.",
|
|
147
|
+
price: {
|
|
148
|
+
amount: 129,
|
|
149
|
+
...PER_MONTH
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: "enterprise",
|
|
154
|
+
label: "Enterprise",
|
|
155
|
+
description: "Several shops, single sign-on, a named contact.",
|
|
156
|
+
price: { onRequest: true }
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
var pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
160
|
+
function PlanTiers() {
|
|
161
|
+
const [plan, setPlan] = useState("starter");
|
|
162
|
+
const [asking, setAsking] = useState(null);
|
|
163
|
+
const [busy, setBusy] = useState(false);
|
|
164
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
165
|
+
className: "radio-stack",
|
|
166
|
+
children: [/* @__PURE__ */ jsx(RadioGroup, {
|
|
167
|
+
"aria-label": "Plan",
|
|
168
|
+
variant: "card",
|
|
169
|
+
activation: "manual",
|
|
170
|
+
busy,
|
|
171
|
+
value: plan,
|
|
172
|
+
onValueChange: setPlan,
|
|
173
|
+
onBeforeValueChange: (next) => new Promise((resolve) => setAsking({
|
|
174
|
+
next,
|
|
175
|
+
resolve
|
|
176
|
+
})),
|
|
177
|
+
children: PLANS.map((tier) => /* @__PURE__ */ jsx(RadioGroupItem, {
|
|
178
|
+
value: tier.value,
|
|
179
|
+
label: tier.label,
|
|
180
|
+
description: tier.description,
|
|
181
|
+
price: tier.price,
|
|
182
|
+
current: tier.value === "starter",
|
|
183
|
+
disabled: tier.value === "enterprise",
|
|
184
|
+
badge: tier.value === "starter" ? /* @__PURE__ */ jsx(Badge, {
|
|
185
|
+
size: "sm",
|
|
186
|
+
children: "Current"
|
|
187
|
+
}) : tier.value === "growth" ? /* @__PURE__ */ jsx(Badge, {
|
|
188
|
+
size: "sm",
|
|
189
|
+
tone: "accent",
|
|
190
|
+
children: "Recommended"
|
|
191
|
+
}) : null,
|
|
192
|
+
selectedPill: true
|
|
193
|
+
}, tier.value))
|
|
194
|
+
}), /* @__PURE__ */ jsx(ConfirmDialog, {
|
|
195
|
+
open: asking !== null,
|
|
196
|
+
onOpenChange: (open) => {
|
|
197
|
+
if (!open && asking) {
|
|
198
|
+
asking.resolve(false);
|
|
199
|
+
setAsking(null);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
title: `Move to ${PLANS.find((tier) => tier.value === asking?.next)?.label ?? ""}?`,
|
|
203
|
+
description: "The new price starts on your next bill. You can move back at any time.",
|
|
204
|
+
confirmLabel: "Change plan",
|
|
205
|
+
onConfirm: async () => {
|
|
206
|
+
const answer = asking;
|
|
207
|
+
setAsking(null);
|
|
208
|
+
setBusy(true);
|
|
209
|
+
await pause(1200);
|
|
210
|
+
setBusy(false);
|
|
211
|
+
answer?.resolve(true);
|
|
212
|
+
}
|
|
213
|
+
})]
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function PlanFigures() {
|
|
217
|
+
return /* @__PURE__ */ jsx("div", {
|
|
218
|
+
className: "radio-stack radio-stack--wide",
|
|
219
|
+
children: /* @__PURE__ */ jsxs(RadioGroup, {
|
|
220
|
+
"aria-label": "Plan, by its figure",
|
|
221
|
+
variant: "card",
|
|
222
|
+
columns: 3,
|
|
223
|
+
defaultValue: "growth",
|
|
224
|
+
indicator: false,
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
227
|
+
value: "starter",
|
|
228
|
+
label: "Starter",
|
|
229
|
+
description: "One shop, up to 100 products.",
|
|
230
|
+
price: {
|
|
231
|
+
free: true,
|
|
232
|
+
size: "display"
|
|
233
|
+
},
|
|
234
|
+
selectedPill: true
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
237
|
+
value: "growth",
|
|
238
|
+
label: "Growth",
|
|
239
|
+
description: "Unlimited products and two staff.",
|
|
240
|
+
price: {
|
|
241
|
+
amount: 25,
|
|
242
|
+
compareAt: 35,
|
|
243
|
+
...PER_MONTH,
|
|
244
|
+
size: "display",
|
|
245
|
+
note: "Billed £300 a year"
|
|
246
|
+
},
|
|
247
|
+
badge: /* @__PURE__ */ jsx(Badge, {
|
|
248
|
+
size: "sm",
|
|
249
|
+
tone: "accent",
|
|
250
|
+
children: "Recommended"
|
|
251
|
+
}),
|
|
252
|
+
selectedPill: true
|
|
253
|
+
}),
|
|
254
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
255
|
+
value: "scale",
|
|
256
|
+
label: "Scale",
|
|
257
|
+
description: "Ten staff, B2B pricing and the API.",
|
|
258
|
+
price: {
|
|
259
|
+
amount: 99,
|
|
260
|
+
from: true,
|
|
261
|
+
...PER_MONTH,
|
|
262
|
+
size: "display"
|
|
263
|
+
},
|
|
264
|
+
selectedPill: true
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
})
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function DeliveryPrices() {
|
|
271
|
+
return /* @__PURE__ */ jsx("div", {
|
|
272
|
+
className: "radio-stack",
|
|
273
|
+
children: /* @__PURE__ */ jsxs(RadioGroup, {
|
|
274
|
+
"aria-label": "Delivery",
|
|
275
|
+
defaultValue: "standard",
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
278
|
+
value: "standard",
|
|
279
|
+
label: "Standard",
|
|
280
|
+
description: "3 to 5 working days",
|
|
281
|
+
price: { free: true }
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
284
|
+
value: "next-day",
|
|
285
|
+
label: "Next day",
|
|
286
|
+
description: "Order by 2pm",
|
|
287
|
+
price: {
|
|
288
|
+
amount: 4.95,
|
|
289
|
+
compareAt: 6.95
|
|
290
|
+
}
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ jsx(RadioGroupItem, {
|
|
293
|
+
value: "timed",
|
|
294
|
+
label: "Timed slot",
|
|
295
|
+
description: "Choose a two-hour window",
|
|
296
|
+
price: { amount: 12 }
|
|
297
|
+
})
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function TypeSummary() {
|
|
303
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
304
|
+
className: "radio-stack",
|
|
305
|
+
children: [/* @__PURE__ */ jsx(RadioCardSummary, {
|
|
306
|
+
title: "Physical product",
|
|
307
|
+
description: "Shipped or collected. Stock is counted.",
|
|
308
|
+
icon: /* @__PURE__ */ jsx(CubeIcon, {}),
|
|
309
|
+
badge: /* @__PURE__ */ jsx(Badge, {
|
|
310
|
+
size: "sm",
|
|
311
|
+
children: "Set when created"
|
|
312
|
+
})
|
|
313
|
+
}), /* @__PURE__ */ jsx(RadioCardSummary, {
|
|
314
|
+
title: "Growth",
|
|
315
|
+
description: "Unlimited products and two staff.",
|
|
316
|
+
price: {
|
|
317
|
+
amount: 25,
|
|
318
|
+
compareAt: 35,
|
|
319
|
+
unit: "/mo",
|
|
320
|
+
unitLabel: "per month"
|
|
321
|
+
},
|
|
322
|
+
action: /* @__PURE__ */ jsx(Button, {
|
|
323
|
+
size: "sm",
|
|
324
|
+
variant: "secondary",
|
|
325
|
+
children: "Change"
|
|
326
|
+
})
|
|
327
|
+
})]
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
//#endregion
|
|
9
331
|
//#region src/pages/components/radio-group.tsx
|
|
10
332
|
var SPEEDS = [
|
|
11
333
|
{
|
|
@@ -309,10 +631,14 @@ function Page() {
|
|
|
309
631
|
return /* @__PURE__ */ jsxs(DocPage, {
|
|
310
632
|
title: "Radio group",
|
|
311
633
|
status: "new",
|
|
312
|
-
importNames: [
|
|
634
|
+
importNames: [
|
|
635
|
+
"RadioGroup",
|
|
636
|
+
"RadioGroupItem",
|
|
637
|
+
"RadioCardSummary"
|
|
638
|
+
],
|
|
313
639
|
lead: "One choice out of a few, with every option in view: what happens when stock runs out, how long customers have to return an item. Options are rows beside their labels, or cards for settings that choose between richer options.",
|
|
314
640
|
children: [
|
|
315
|
-
/* @__PURE__ */ jsx(Section, {
|
|
641
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
316
642
|
id: "playground",
|
|
317
643
|
title: "Playground",
|
|
318
644
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -353,7 +679,7 @@ function Page() {
|
|
|
353
679
|
})
|
|
354
680
|
})
|
|
355
681
|
}),
|
|
356
|
-
/* @__PURE__ */ jsx(Section, {
|
|
682
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
357
683
|
id: "basics",
|
|
358
684
|
title: "Basics",
|
|
359
685
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -403,7 +729,7 @@ const [policy, setPolicy] = useState('stop')
|
|
|
403
729
|
children: /* @__PURE__ */ jsx(SoldOutPolicy, {})
|
|
404
730
|
})
|
|
405
731
|
}),
|
|
406
|
-
/* @__PURE__ */ jsx(Section, {
|
|
732
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
407
733
|
id: "cards",
|
|
408
734
|
title: "Cards",
|
|
409
735
|
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "variant=\"card\"" }), " turns each option into a tile, for settings that choose between richer options. The whole tile is the radio: clicking anywhere on it chooses, its edge takes the teal when chosen, and the focus ring goes round the tile. A label can carry a small Badge, as here."] }),
|
|
@@ -432,7 +758,7 @@ const [policy, setPolicy] = useState('stop')
|
|
|
432
758
|
children: /* @__PURE__ */ jsx(AccountsChoice, {})
|
|
433
759
|
})
|
|
434
760
|
}),
|
|
435
|
-
/* @__PURE__ */ jsx(Section, {
|
|
761
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
436
762
|
id: "hints",
|
|
437
763
|
title: "Hints",
|
|
438
764
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -473,7 +799,7 @@ const [policy, setPolicy] = useState('stop')
|
|
|
473
799
|
})
|
|
474
800
|
})
|
|
475
801
|
}),
|
|
476
|
-
/* @__PURE__ */ jsx(Section, {
|
|
802
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
477
803
|
id: "orientation",
|
|
478
804
|
title: "Horizontal",
|
|
479
805
|
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "orientation=\"horizontal\"" }), " sets short options in a row that wraps when it runs out of room. Cards in a row share the width equally, and fall into a column on a phone. The arrow keys move between options whichever way they run."] }),
|
|
@@ -551,7 +877,7 @@ const [policy, setPolicy] = useState('stop')
|
|
|
551
877
|
})
|
|
552
878
|
})
|
|
553
879
|
}),
|
|
554
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
880
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
555
881
|
id: "errors",
|
|
556
882
|
title: "In a field, with an error",
|
|
557
883
|
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -586,7 +912,7 @@ const [error, setError] = useState<string>()
|
|
|
586
912
|
", as here."
|
|
587
913
|
] })]
|
|
588
914
|
}),
|
|
589
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
915
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
590
916
|
id: "states",
|
|
591
917
|
title: "States",
|
|
592
918
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -694,7 +1020,7 @@ const [error, setError] = useState<string>()
|
|
|
694
1020
|
})
|
|
695
1021
|
})]
|
|
696
1022
|
}),
|
|
697
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1023
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
698
1024
|
id: "own-labels",
|
|
699
1025
|
title: "Your own labels",
|
|
700
1026
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -727,7 +1053,7 @@ const [error, setError] = useState<string>()
|
|
|
727
1053
|
children: /* @__PURE__ */ jsx(AltTextTemplate, {})
|
|
728
1054
|
})
|
|
729
1055
|
}),
|
|
730
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1056
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
731
1057
|
id: "sizes",
|
|
732
1058
|
title: "Sizes",
|
|
733
1059
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -760,7 +1086,147 @@ const [error, setError] = useState<string>()
|
|
|
760
1086
|
})
|
|
761
1087
|
})
|
|
762
1088
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1090
|
+
id: "choice-cards",
|
|
1091
|
+
title: "Choice cards",
|
|
1092
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1093
|
+
"Cards for choices that need more than a line: a product's type, a plan, a page layout. A card takes an",
|
|
1094
|
+
" ",
|
|
1095
|
+
/* @__PURE__ */ jsx("code", { children: "icon" }),
|
|
1096
|
+
" on a small tile that turns teal with the choice, or a ",
|
|
1097
|
+
/* @__PURE__ */ jsx("code", { children: "media" }),
|
|
1098
|
+
" picture above its words, a ",
|
|
1099
|
+
/* @__PURE__ */ jsx("code", { children: "badge" }),
|
|
1100
|
+
" beside its title (part of the radio's name), and a ",
|
|
1101
|
+
/* @__PURE__ */ jsx("code", { children: "selectedPill" }),
|
|
1102
|
+
" shown while it is chosen. The group sets them in ",
|
|
1103
|
+
/* @__PURE__ */ jsx("code", { children: "columns" }),
|
|
1104
|
+
", as many as fit at 11.5rem, and",
|
|
1105
|
+
" ",
|
|
1106
|
+
/* @__PURE__ */ jsxs("code", { children: ["indicator=", "{false}"] }),
|
|
1107
|
+
" hides the radios where the edge and the pill say it."
|
|
1108
|
+
] }),
|
|
1109
|
+
children: [
|
|
1110
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1111
|
+
title: "Icon tiles and columns",
|
|
1112
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1113
|
+
align: "fill",
|
|
1114
|
+
code: `
|
|
1115
|
+
<RadioGroup aria-label="Product type" variant="card" columns={2} value={type} onValueChange={setType}>
|
|
1116
|
+
<RadioGroupItem value="physical" label="Physical product" description="Shipped or collected. Stock is counted." icon={<PackageIcon />} />
|
|
1117
|
+
<RadioGroupItem value="digital" label="Digital product" description="A download sent after payment." icon={<DownloadSimpleIcon />} />
|
|
1118
|
+
<RadioGroupItem value="bundle" label="Bundle" description="Several products sold as one." icon={<StackIcon />}
|
|
1119
|
+
badge={<Badge size="sm" tone="accent">New</Badge>} />
|
|
1120
|
+
<RadioGroupItem value="gift-card" label="Gift card" description="A balance to spend in your shop." icon={<GiftIcon />} />
|
|
1121
|
+
</RadioGroup>`,
|
|
1122
|
+
children: /* @__PURE__ */ jsx(ProductType, {})
|
|
1123
|
+
})
|
|
1124
|
+
}),
|
|
1125
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1126
|
+
title: "Pictures, no radios, a Selected pill",
|
|
1127
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1128
|
+
align: "fill",
|
|
1129
|
+
code: `
|
|
1130
|
+
<RadioGroup aria-label="Product page layout" variant="card" columns={3} indicator={false} defaultValue="gallery">
|
|
1131
|
+
<RadioGroupItem value="gallery" label="Gallery" description="Photos beside the details." media={<GallerySketch />} selectedPill />
|
|
1132
|
+
<RadioGroupItem value="stacked" label="Stacked" description="A wide photo, then the details." media={<StackedSketch />} selectedPill />
|
|
1133
|
+
<RadioGroupItem value="split" label="Split" description="Two photos and the details." media={<SplitSketch />} selectedPill />
|
|
1134
|
+
</RadioGroup>`,
|
|
1135
|
+
children: /* @__PURE__ */ jsx(LayoutChooser, {})
|
|
1136
|
+
})
|
|
1137
|
+
}),
|
|
1138
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1139
|
+
title: "Plans: prices, the current one, manual activation, a confirmation and a busy group",
|
|
1140
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1141
|
+
/* @__PURE__ */ jsx("code", { children: "activation=\"manual\"" }),
|
|
1142
|
+
" lets the arrow keys move between cards without choosing; Space or a press chooses. ",
|
|
1143
|
+
/* @__PURE__ */ jsx("code", { children: "onBeforeValueChange" }),
|
|
1144
|
+
" is asked first, with the new value and the current one: return or resolve ",
|
|
1145
|
+
/* @__PURE__ */ jsx("code", { children: "false" }),
|
|
1146
|
+
" to keep the current choice, here after a confirmation. The ",
|
|
1147
|
+
/* @__PURE__ */ jsx("code", { children: "current" }),
|
|
1148
|
+
" ",
|
|
1149
|
+
"option (the plan the shop is on) stays in the tab order with ",
|
|
1150
|
+
/* @__PURE__ */ jsx("code", { children: "aria-disabled" }),
|
|
1151
|
+
" but cannot be chosen; say so in its badge. ",
|
|
1152
|
+
/* @__PURE__ */ jsx("code", { children: "price" }),
|
|
1153
|
+
" draws the option's price with ",
|
|
1154
|
+
/* @__PURE__ */ jsx("code", { children: "Price" }),
|
|
1155
|
+
", read after its name: Free, an amount with a struck compare-at price (\"Was £35, now £25 per month\") and a note line for a trial, From, or Price on request. ",
|
|
1156
|
+
/* @__PURE__ */ jsx("code", { children: "busy" }),
|
|
1157
|
+
" holds the whole group while the change is made on the server: nothing can be chosen and focus stays where it was. Change the plan here to see it."
|
|
1158
|
+
] }),
|
|
1159
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1160
|
+
align: "fill",
|
|
1161
|
+
code: `
|
|
1162
|
+
<RadioGroup
|
|
1163
|
+
aria-label="Plan"
|
|
1164
|
+
variant="card"
|
|
1165
|
+
activation="manual"
|
|
1166
|
+
busy={saving}
|
|
1167
|
+
value={plan}
|
|
1168
|
+
onValueChange={setPlan}
|
|
1169
|
+
onBeforeValueChange={(next) => confirmPlanChange(next)} // resolves true or false
|
|
1170
|
+
>
|
|
1171
|
+
<RadioGroupItem value="starter" label="Starter" description="One shop, up to 100 products."
|
|
1172
|
+
price={{ free: true }} current badge={<Badge size="sm">Current</Badge>} selectedPill />
|
|
1173
|
+
<RadioGroupItem value="growth" label="Growth" description="Unlimited products and two staff."
|
|
1174
|
+
price={{ amount: 25, compareAt: 35, unit: '/mo', unitLabel: 'per month', note: '14-day free trial' }}
|
|
1175
|
+
badge={<Badge size="sm" tone="accent">Recommended</Badge>} selectedPill />
|
|
1176
|
+
<RadioGroupItem value="scale" label="Scale" description="Ten staff, B2B pricing and the API."
|
|
1177
|
+
price={{ amount: 129, unit: '/mo', unitLabel: 'per month' }} selectedPill />
|
|
1178
|
+
<RadioGroupItem value="enterprise" label="Enterprise" description="Several shops, single sign-on, a named contact."
|
|
1179
|
+
price={{ onRequest: true }} disabled selectedPill />
|
|
1180
|
+
</RadioGroup>`,
|
|
1181
|
+
children: /* @__PURE__ */ jsx(PlanTiers, {})
|
|
1182
|
+
})
|
|
1183
|
+
}),
|
|
1184
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1185
|
+
title: "A plan's figure, and prices in a list",
|
|
1186
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "price={{ size: 'display' }}" }), " sets the plan's figure under its words, on the display face, for cards that sell a plan; a row's price stays at its end, lined up on the end edge, as in the delivery list. Whole amounts drop their pence."] }),
|
|
1187
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1188
|
+
align: "fill",
|
|
1189
|
+
code: `
|
|
1190
|
+
<RadioGroup aria-label="Plan" variant="card" columns={3} defaultValue="growth" indicator={false}>
|
|
1191
|
+
<RadioGroupItem value="starter" label="Starter" price={{ free: true, size: 'display' }} selectedPill />
|
|
1192
|
+
<RadioGroupItem value="growth" label="Growth" badge={<Badge size="sm" tone="accent">Recommended</Badge>}
|
|
1193
|
+
price={{ amount: 25, compareAt: 35, unit: '/mo', unitLabel: 'per month', size: 'display', note: 'Billed £300 a year' }} selectedPill />
|
|
1194
|
+
<RadioGroupItem value="scale" label="Scale" price={{ amount: 99, from: true, unit: '/mo', unitLabel: 'per month', size: 'display' }} selectedPill />
|
|
1195
|
+
</RadioGroup>
|
|
1196
|
+
|
|
1197
|
+
<RadioGroup aria-label="Delivery" defaultValue="standard">
|
|
1198
|
+
<RadioGroupItem value="standard" label="Standard" description="3 to 5 working days" price={{ free: true }} />
|
|
1199
|
+
<RadioGroupItem value="next-day" label="Next day" description="Order by 2pm" price={{ amount: 4.95, compareAt: 6.95 }} />
|
|
1200
|
+
<RadioGroupItem value="timed" label="Timed slot" description="Choose a two-hour window" price={{ amount: 12 }} />
|
|
1201
|
+
</RadioGroup>`,
|
|
1202
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1203
|
+
className: "radio-stack radio-stack--wide radio-stack--apart",
|
|
1204
|
+
children: [/* @__PURE__ */ jsx(PlanFigures, {}), /* @__PURE__ */ jsx(DeliveryPrices, {})]
|
|
1205
|
+
})
|
|
1206
|
+
})
|
|
1207
|
+
}),
|
|
1208
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1209
|
+
title: "A summary of the choice",
|
|
1210
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
1211
|
+
/* @__PURE__ */ jsx("code", { children: "RadioCardSummary" }),
|
|
1212
|
+
" shows the chosen option in the card's look with no radio: a choice fixed once made (a product's type, on edit), or one changed elsewhere, with an ",
|
|
1213
|
+
/* @__PURE__ */ jsx("code", { children: "action" }),
|
|
1214
|
+
" such as Change."
|
|
1215
|
+
] }),
|
|
1216
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
1217
|
+
align: "fill",
|
|
1218
|
+
code: `
|
|
1219
|
+
<RadioCardSummary title="Physical product" description="Shipped or collected. Stock is counted." icon={<CubeIcon />}
|
|
1220
|
+
badge={<Badge size="sm">Set when created</Badge>} />
|
|
1221
|
+
<RadioCardSummary title="Growth" description="Unlimited products and two staff."
|
|
1222
|
+
price={{ amount: 25, compareAt: 35, unit: '/mo', unitLabel: 'per month' }}
|
|
1223
|
+
action={<Button size="sm" variant="secondary">Change</Button>} />`,
|
|
1224
|
+
children: /* @__PURE__ */ jsx(TypeSummary, {})
|
|
1225
|
+
})
|
|
1226
|
+
})
|
|
1227
|
+
]
|
|
1228
|
+
}),
|
|
1229
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
764
1230
|
id: "both-themes",
|
|
765
1231
|
title: "In both themes",
|
|
766
1232
|
description: /* @__PURE__ */ jsx("p", { children: "A list with a chosen option and one that is off, and cards with a chosen tile, light and dark side by side." }),
|
|
@@ -806,7 +1272,7 @@ const [error, setError] = useState<string>()
|
|
|
806
1272
|
})
|
|
807
1273
|
})
|
|
808
1274
|
}),
|
|
809
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
1275
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
810
1276
|
id: "guidelines",
|
|
811
1277
|
title: "Guidelines",
|
|
812
1278
|
children: [
|
|
@@ -926,7 +1392,7 @@ const [error, setError] = useState<string>()
|
|
|
926
1392
|
})
|
|
927
1393
|
]
|
|
928
1394
|
}),
|
|
929
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1395
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
930
1396
|
id: "accessibility",
|
|
931
1397
|
title: "Accessibility",
|
|
932
1398
|
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
@@ -955,7 +1421,7 @@ const [error, setError] = useState<string>()
|
|
|
955
1421
|
"Under reduced motion the dot fades in at full size, and nothing sinks when pressed."
|
|
956
1422
|
] })
|
|
957
1423
|
}),
|
|
958
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
1424
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
959
1425
|
id: "props",
|
|
960
1426
|
title: "Props",
|
|
961
1427
|
children: [
|
|
@@ -1010,6 +1476,34 @@ const [error, setError] = useState<string>()
|
|
|
1010
1476
|
name: "name, required, form",
|
|
1011
1477
|
type: "string, boolean, string",
|
|
1012
1478
|
description: "For the hidden radio inputs that forms submit."
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: "columns",
|
|
1482
|
+
type: "1 | 2 | 3 | 4",
|
|
1483
|
+
description: "Up to this many columns, as many as fit at 11.5rem."
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: "activation",
|
|
1487
|
+
type: "'automatic' | 'manual'",
|
|
1488
|
+
default: "'automatic'",
|
|
1489
|
+
description: "Manual: the arrows only move; Space or a press chooses."
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
name: "indicator",
|
|
1493
|
+
type: "boolean",
|
|
1494
|
+
default: "true",
|
|
1495
|
+
description: "Draws the cards' radios."
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
name: "onBeforeValueChange",
|
|
1499
|
+
type: "(next, current) => boolean | void | Promise<boolean | void>",
|
|
1500
|
+
description: "Asked before a choice lands: false keeps the current one."
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
name: "busy",
|
|
1504
|
+
type: "boolean",
|
|
1505
|
+
default: "false",
|
|
1506
|
+
description: "A call runs against the choice: every option held (aria-disabled), focus kept, the group aria-busy."
|
|
1013
1507
|
}
|
|
1014
1508
|
]
|
|
1015
1509
|
}),
|
|
@@ -1051,6 +1545,74 @@ const [error, setError] = useState<string>()
|
|
|
1051
1545
|
name: "disabled",
|
|
1052
1546
|
type: "boolean",
|
|
1053
1547
|
description: "This option off. Say why in its description."
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
name: "icon",
|
|
1551
|
+
type: "ReactNode",
|
|
1552
|
+
description: "Card: a mark on a small tile that turns teal with the choice."
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
name: "media",
|
|
1556
|
+
type: "ReactNode",
|
|
1557
|
+
description: "Card: a picture or sketch above the words."
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: "badge",
|
|
1561
|
+
type: "ReactNode",
|
|
1562
|
+
description: "A badge beside the label, part of the radio's name."
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
name: "selectedPill",
|
|
1566
|
+
type: "ReactNode | true",
|
|
1567
|
+
description: "Card: a pill while chosen; true says \"Selected\"."
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
name: "indicator",
|
|
1571
|
+
type: "boolean",
|
|
1572
|
+
description: "Card: draws this card's radio, whatever the group says."
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
name: "current",
|
|
1576
|
+
type: "boolean",
|
|
1577
|
+
default: "false",
|
|
1578
|
+
description: "The option there is now: focusable, aria-disabled, never chosen."
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
name: "price",
|
|
1582
|
+
type: "Omit<PriceProps, 'align'>",
|
|
1583
|
+
description: "The option's price, drawn by Price and read after the name: at the end (size row), or under the words (size display)."
|
|
1584
|
+
}
|
|
1585
|
+
]
|
|
1586
|
+
}),
|
|
1587
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
1588
|
+
title: "RadioCardSummary",
|
|
1589
|
+
rows: [
|
|
1590
|
+
{
|
|
1591
|
+
name: "title",
|
|
1592
|
+
type: "ReactNode",
|
|
1593
|
+
required: true,
|
|
1594
|
+
description: "The chosen option's name."
|
|
1595
|
+
},
|
|
1596
|
+
{
|
|
1597
|
+
name: "description, hint, icon, media, badge",
|
|
1598
|
+
type: "ReactNode",
|
|
1599
|
+
description: "As on a card."
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
name: "price",
|
|
1603
|
+
type: "Omit<PriceProps, 'align'>",
|
|
1604
|
+
description: "As on a card."
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
name: "action",
|
|
1608
|
+
type: "ReactNode",
|
|
1609
|
+
description: "A control at the end, such as Change."
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
name: "size",
|
|
1613
|
+
type: "'sm' | 'md'",
|
|
1614
|
+
default: "'md'",
|
|
1615
|
+
description: "The card's padding."
|
|
1054
1616
|
}
|
|
1055
1617
|
]
|
|
1056
1618
|
}),
|