@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
|
@@ -0,0 +1,1307 @@
|
|
|
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, 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
|
+
import { useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Checkbox, Field, TagInput } from "@orbitcommerce/constellation";
|
|
8
|
+
//#region src/pages/components/_tag-input-examples.tsx
|
|
9
|
+
var CUSTOMER_TAGS = [
|
|
10
|
+
{
|
|
11
|
+
value: "tag-vip",
|
|
12
|
+
label: "VIP"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "tag-trade",
|
|
16
|
+
label: "Trade"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "tag-wholesale",
|
|
20
|
+
label: "Wholesale"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "tag-newsletter",
|
|
24
|
+
label: "Newsletter"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "tag-repeat",
|
|
28
|
+
label: "Repeat buyer"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "tag-local",
|
|
32
|
+
label: "Local pickup"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "tag-staff",
|
|
36
|
+
label: "Staff"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: "tag-b2b",
|
|
40
|
+
label: "B2B"
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
var pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
44
|
+
function CustomerTags() {
|
|
45
|
+
const [catalogue, setCatalogue] = useState(CUSTOMER_TAGS);
|
|
46
|
+
const [value, setValue] = useState(["tag-vip", "tag-trade"]);
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "tag-input-stack",
|
|
49
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
50
|
+
label: "Customer tags",
|
|
51
|
+
hint: "Pick a tag, or type a new one and press Enter.",
|
|
52
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
53
|
+
options: catalogue,
|
|
54
|
+
value,
|
|
55
|
+
onValueChange: setValue,
|
|
56
|
+
onCreate: async (name) => {
|
|
57
|
+
await pause(500);
|
|
58
|
+
const option = {
|
|
59
|
+
value: `tag-${name.toLowerCase().replace(/\s+/g, "-")}`,
|
|
60
|
+
label: name
|
|
61
|
+
};
|
|
62
|
+
setCatalogue((now) => [...now, option]);
|
|
63
|
+
return option;
|
|
64
|
+
},
|
|
65
|
+
placeholder: "Add a tag"
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
var MANY = Array.from({ length: 40 }, (_, at) => ({
|
|
71
|
+
value: `segment-${at + 1}`,
|
|
72
|
+
label: [
|
|
73
|
+
"Spring",
|
|
74
|
+
"Summer",
|
|
75
|
+
"Autumn",
|
|
76
|
+
"Winter"
|
|
77
|
+
][at % 4] + ` campaign ${Math.floor(at / 4) + 1}`
|
|
78
|
+
}));
|
|
79
|
+
async function searchSegments({ term, page, pageSize }) {
|
|
80
|
+
await pause(350);
|
|
81
|
+
const all = MANY.filter((option) => option.label.toLowerCase().includes(term.toLowerCase()));
|
|
82
|
+
return {
|
|
83
|
+
options: all.slice((page - 1) * pageSize, page * pageSize),
|
|
84
|
+
total: all.length
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function PickOnly() {
|
|
88
|
+
const [value, setValue] = useState(["segment-1"]);
|
|
89
|
+
return /* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: "tag-input-stack",
|
|
91
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
92
|
+
label: "Campaign segments",
|
|
93
|
+
hint: "Only segments that exist can be added.",
|
|
94
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
95
|
+
onSearch: searchSegments,
|
|
96
|
+
selectedOptions: [MANY[0]],
|
|
97
|
+
value,
|
|
98
|
+
onValueChange: setValue,
|
|
99
|
+
placeholder: "Search segments"
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
var postcodeRule = (tag) => /^[A-Z]{1,2}(\d[A-Z\d]?)?\*?$/.test(tag) ? null : `${tag} is not a postcode area or district`;
|
|
105
|
+
function PostcodeRules() {
|
|
106
|
+
const [value, setValue] = useState([
|
|
107
|
+
"SW1A",
|
|
108
|
+
"EC*",
|
|
109
|
+
"NOWHERE"
|
|
110
|
+
]);
|
|
111
|
+
return /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: "tag-input-stack",
|
|
113
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
114
|
+
label: "Postcodes in this zone",
|
|
115
|
+
hint: "An area (SW), a district (SW1A) or a district with a wildcard (EC*).",
|
|
116
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
117
|
+
value,
|
|
118
|
+
onValueChange: setValue,
|
|
119
|
+
validate: postcodeRule,
|
|
120
|
+
keepInvalid: true,
|
|
121
|
+
transform: (tag) => tag.toUpperCase().replace(/\s+/g, ""),
|
|
122
|
+
separators: [",", " "],
|
|
123
|
+
describeTag: (tag) => tag.endsWith("*") ? {
|
|
124
|
+
label: `${tag.slice(0, -1)} (every district)`,
|
|
125
|
+
tone: "info"
|
|
126
|
+
} : void 0
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function Keywords$1() {
|
|
132
|
+
const [value, setValue] = useState([
|
|
133
|
+
"refund",
|
|
134
|
+
"returns",
|
|
135
|
+
"delivery"
|
|
136
|
+
]);
|
|
137
|
+
return /* @__PURE__ */ jsx("div", {
|
|
138
|
+
className: "tag-input-stack",
|
|
139
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
140
|
+
label: "Keywords that start this reply",
|
|
141
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
142
|
+
value,
|
|
143
|
+
onValueChange: setValue,
|
|
144
|
+
max: 5,
|
|
145
|
+
showMax: true,
|
|
146
|
+
validate: (tag) => tag.length > 20 ? "Keep each keyword to 20 characters" : null,
|
|
147
|
+
placeholder: "Add a keyword"
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function SavedTags() {
|
|
153
|
+
const [value, setValue] = useState(["VIP"]);
|
|
154
|
+
const [failNext, setFailNext] = useState(false);
|
|
155
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
156
|
+
className: "tag-input-stack",
|
|
157
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
158
|
+
label: "Tags on Priya Shah",
|
|
159
|
+
hint: "Each change saves as you make it.",
|
|
160
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
161
|
+
value,
|
|
162
|
+
onValueChange: async (next) => {
|
|
163
|
+
await pause(900);
|
|
164
|
+
if (failNext) {
|
|
165
|
+
setFailNext(false);
|
|
166
|
+
throw new Error("Offline");
|
|
167
|
+
}
|
|
168
|
+
setValue(next);
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
}), /* @__PURE__ */ jsx(Checkbox, {
|
|
172
|
+
size: "sm",
|
|
173
|
+
label: "Make the next save fail",
|
|
174
|
+
checked: failNext,
|
|
175
|
+
onCheckedChange: setFailNext
|
|
176
|
+
})]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function OptionNames() {
|
|
180
|
+
const [value, setValue] = useState(["Colour"]);
|
|
181
|
+
return /* @__PURE__ */ jsx("div", {
|
|
182
|
+
className: "tag-input-stack",
|
|
183
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
184
|
+
label: "Swatch option names",
|
|
185
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
186
|
+
value,
|
|
187
|
+
onValueChange: setValue,
|
|
188
|
+
suggestionLimit: 3,
|
|
189
|
+
suggestions: [
|
|
190
|
+
{
|
|
191
|
+
value: "Colour",
|
|
192
|
+
meta: "12 values"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
value: "Finish",
|
|
196
|
+
meta: "6 values"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
value: "Fabric",
|
|
200
|
+
meta: "18 values"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
value: "Frame",
|
|
204
|
+
meta: "4 values"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
value: "Leg colour",
|
|
208
|
+
meta: "5 values"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function OptionValues() {
|
|
216
|
+
const [value, setValue] = useState([
|
|
217
|
+
"Oak",
|
|
218
|
+
"Ash",
|
|
219
|
+
"Walnut"
|
|
220
|
+
]);
|
|
221
|
+
const [renamed, setRenamed] = useState(null);
|
|
222
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
223
|
+
className: "tag-input-stack",
|
|
224
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
225
|
+
label: "Values of Finish",
|
|
226
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
227
|
+
value,
|
|
228
|
+
onValueChange: setValue,
|
|
229
|
+
renameable: true,
|
|
230
|
+
onRename: (from, to) => setRenamed(`${from} is now ${to}`),
|
|
231
|
+
reorderable: true,
|
|
232
|
+
addButton: true,
|
|
233
|
+
hint: "Drag a value by its grip to reorder it, or press its word to rename it. Enter or a comma adds each new one.",
|
|
234
|
+
transform: (tag) => tag.replace(/\s+/g, " "),
|
|
235
|
+
max: 5
|
|
236
|
+
})
|
|
237
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
238
|
+
className: "tag-input-status",
|
|
239
|
+
role: "status",
|
|
240
|
+
children: renamed
|
|
241
|
+
})]
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/pages/components/tag-input.tsx
|
|
246
|
+
var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
247
|
+
var isEmail = (value) => EMAIL.test(value);
|
|
248
|
+
var code = (value) => /* @__PURE__ */ jsx("code", { children: value });
|
|
249
|
+
function Preview() {
|
|
250
|
+
return /* @__PURE__ */ jsx("div", {
|
|
251
|
+
className: "tag-input-preview",
|
|
252
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
253
|
+
"aria-label": "Keywords",
|
|
254
|
+
size: "sm",
|
|
255
|
+
defaultValue: ["ceramics", "walnut"]
|
|
256
|
+
})
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
var PLAYGROUND = [
|
|
260
|
+
{
|
|
261
|
+
prop: "size",
|
|
262
|
+
type: "select",
|
|
263
|
+
options: [
|
|
264
|
+
"sm",
|
|
265
|
+
"md",
|
|
266
|
+
"lg"
|
|
267
|
+
],
|
|
268
|
+
default: "md"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
prop: "allowDuplicates",
|
|
272
|
+
type: "boolean",
|
|
273
|
+
default: false
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
prop: "addOnBlur",
|
|
277
|
+
type: "boolean",
|
|
278
|
+
default: true,
|
|
279
|
+
toAttr: (v) => v ? null : "addOnBlur={false}"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
prop: "invalid",
|
|
283
|
+
type: "boolean",
|
|
284
|
+
default: false
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
prop: "disabled",
|
|
288
|
+
type: "boolean",
|
|
289
|
+
default: false
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
prop: "max",
|
|
293
|
+
type: "text",
|
|
294
|
+
default: "",
|
|
295
|
+
toAttr: (v) => String(v).trim() === "" ? null : `max={${Number(v)}}`
|
|
296
|
+
}
|
|
297
|
+
];
|
|
298
|
+
function Keywords() {
|
|
299
|
+
const [tags, setTags] = useState(["ceramics", "walnut"]);
|
|
300
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
301
|
+
className: "tag-input-stack",
|
|
302
|
+
children: [/* @__PURE__ */ jsx(Field, {
|
|
303
|
+
label: "Keywords",
|
|
304
|
+
hint: "Press Enter or comma to add one; Backspace takes the last back",
|
|
305
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
306
|
+
value: tags,
|
|
307
|
+
onValueChange: setTags,
|
|
308
|
+
placeholder: "Add a keyword"
|
|
309
|
+
})
|
|
310
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
311
|
+
className: "tag-input-note",
|
|
312
|
+
children: ["The value: ", /* @__PURE__ */ jsx("code", { children: JSON.stringify(tags) })]
|
|
313
|
+
})]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function Codes() {
|
|
317
|
+
const [codes, setCodes] = useState(["ARD-01", "HRB-12"]);
|
|
318
|
+
return /* @__PURE__ */ jsx("div", {
|
|
319
|
+
className: "tag-input-stack",
|
|
320
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
321
|
+
label: "Product codes",
|
|
322
|
+
hint: "Enter, a comma or a semicolon adds one; spaces are kept",
|
|
323
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
324
|
+
value: codes,
|
|
325
|
+
onValueChange: setCodes,
|
|
326
|
+
separators: [",", ";"],
|
|
327
|
+
transform: (tag) => tag.toUpperCase(),
|
|
328
|
+
placeholder: "ARD-01"
|
|
329
|
+
})
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
function Limited() {
|
|
334
|
+
const [seasons, setSeasons] = useState([
|
|
335
|
+
"spring",
|
|
336
|
+
"summer",
|
|
337
|
+
"autumn"
|
|
338
|
+
]);
|
|
339
|
+
return /* @__PURE__ */ jsx("div", {
|
|
340
|
+
className: "tag-input-stack",
|
|
341
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
342
|
+
label: "Season tags",
|
|
343
|
+
hint: "Up to three tags",
|
|
344
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
345
|
+
max: 3,
|
|
346
|
+
value: seasons,
|
|
347
|
+
onValueChange: setSeasons,
|
|
348
|
+
placeholder: "Add a season"
|
|
349
|
+
})
|
|
350
|
+
})
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function Invites() {
|
|
354
|
+
const [emails, setEmails] = useState(["priya.shah@harbourdesk.co.uk"]);
|
|
355
|
+
return /* @__PURE__ */ jsx("div", {
|
|
356
|
+
className: "tag-input-stack",
|
|
357
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
358
|
+
label: "Invites",
|
|
359
|
+
hint: "Only email addresses are accepted",
|
|
360
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
361
|
+
value: emails,
|
|
362
|
+
onValueChange: setEmails,
|
|
363
|
+
transform: (tag) => tag.toLowerCase(),
|
|
364
|
+
validate: (tag) => isEmail(tag) ? null : "Use an email address",
|
|
365
|
+
placeholder: "name@example.co.uk"
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
function Repeats() {
|
|
371
|
+
const [notes, setNotes] = useState(["fragile"]);
|
|
372
|
+
return /* @__PURE__ */ jsx("div", {
|
|
373
|
+
className: "tag-input-stack",
|
|
374
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
375
|
+
label: "Handling notes",
|
|
376
|
+
hint: "With allowDuplicates, the same word is taken twice",
|
|
377
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
378
|
+
allowDuplicates: true,
|
|
379
|
+
value: notes,
|
|
380
|
+
onValueChange: setNotes,
|
|
381
|
+
placeholder: "Add a handling note"
|
|
382
|
+
})
|
|
383
|
+
})
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
function Sizes() {
|
|
387
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
388
|
+
className: "tag-input-column",
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
391
|
+
size: "sm",
|
|
392
|
+
"aria-label": "Small",
|
|
393
|
+
defaultValue: ["small"]
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
396
|
+
"aria-label": "Medium",
|
|
397
|
+
defaultValue: ["medium"]
|
|
398
|
+
}),
|
|
399
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
400
|
+
size: "lg",
|
|
401
|
+
"aria-label": "Large",
|
|
402
|
+
defaultValue: ["large"]
|
|
403
|
+
})
|
|
404
|
+
]
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
function Matrix() {
|
|
408
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
409
|
+
className: "tag-input-matrix",
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
412
|
+
"aria-label": "Empty",
|
|
413
|
+
placeholder: "Add a keyword"
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
416
|
+
"aria-label": "With tags",
|
|
417
|
+
defaultValue: [
|
|
418
|
+
"ceramics",
|
|
419
|
+
"walnut",
|
|
420
|
+
"hand-thrown"
|
|
421
|
+
]
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ jsx(Field, {
|
|
424
|
+
label: "Invalid",
|
|
425
|
+
error: "Add at least one keyword",
|
|
426
|
+
children: /* @__PURE__ */ jsx(TagInput, { placeholder: "Add a keyword" })
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
429
|
+
"aria-label": "Disabled",
|
|
430
|
+
disabled: true,
|
|
431
|
+
defaultValue: ["ceramics", "walnut"]
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
434
|
+
"aria-label": "Read-only",
|
|
435
|
+
readOnly: true,
|
|
436
|
+
defaultValue: ["ceramics", "walnut"]
|
|
437
|
+
})
|
|
438
|
+
]
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function Page() {
|
|
442
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
443
|
+
title: "Tag input",
|
|
444
|
+
status: "new",
|
|
445
|
+
importNames: ["TagInput"],
|
|
446
|
+
lead: "A field box where typed text becomes removable chips: keywords, invite emails, product codes. Press Enter or a comma to add one, take it back with Backspace or its remove button, and paste a whole list in one go.",
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
449
|
+
id: "playground",
|
|
450
|
+
title: "Playground",
|
|
451
|
+
description: /* @__PURE__ */ jsx("p", { children: "Add and remove tags, change the props, and see the code for what is on the stage." }),
|
|
452
|
+
children: /* @__PURE__ */ jsx(Playground, {
|
|
453
|
+
component: "TagInput",
|
|
454
|
+
controls: PLAYGROUND,
|
|
455
|
+
minHeight: 240,
|
|
456
|
+
extraCode: () => ["defaultValue={['ceramics', 'walnut']}", "placeholder=\"Add a keyword\""],
|
|
457
|
+
render: (v) => /* @__PURE__ */ jsx("div", {
|
|
458
|
+
className: "tag-input-stage",
|
|
459
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
460
|
+
"aria-label": "Keywords",
|
|
461
|
+
size: v.size,
|
|
462
|
+
allowDuplicates: Boolean(v.allowDuplicates),
|
|
463
|
+
addOnBlur: Boolean(v.addOnBlur),
|
|
464
|
+
invalid: Boolean(v.invalid),
|
|
465
|
+
disabled: Boolean(v.disabled),
|
|
466
|
+
max: String(v.max).trim() === "" ? void 0 : Number(v.max),
|
|
467
|
+
defaultValue: ["ceramics", "walnut"],
|
|
468
|
+
placeholder: "Add a keyword"
|
|
469
|
+
})
|
|
470
|
+
})
|
|
471
|
+
})
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
474
|
+
id: "basics",
|
|
475
|
+
title: "Basics",
|
|
476
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
477
|
+
"TagInput is a field that holds a list of short strings. The person types one and presses Enter, or a comma; the text becomes a small ",
|
|
478
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
479
|
+
to: "/components/chip",
|
|
480
|
+
children: "Chip"
|
|
481
|
+
}),
|
|
482
|
+
" before the caret, with a remove button. The value is a ",
|
|
483
|
+
/* @__PURE__ */ jsx("code", { children: "string[]" }),
|
|
484
|
+
". Pass ",
|
|
485
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
486
|
+
" and ",
|
|
487
|
+
/* @__PURE__ */ jsx("code", { children: "onValueChange" }),
|
|
488
|
+
", or",
|
|
489
|
+
" ",
|
|
490
|
+
/* @__PURE__ */ jsx("code", { children: "defaultValue" }),
|
|
491
|
+
" to let it keep its own."
|
|
492
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [
|
|
493
|
+
"Reach for it when the tags are free text: keywords, tags a merchant writes, invite emails, product codes. When instead the tags are picked from a catalogue with search, use a",
|
|
494
|
+
" ",
|
|
495
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
496
|
+
to: "/components/combobox#create",
|
|
497
|
+
children: "Combobox"
|
|
498
|
+
}),
|
|
499
|
+
" with ",
|
|
500
|
+
/* @__PURE__ */ jsx("code", { children: "multiple" }),
|
|
501
|
+
" and",
|
|
502
|
+
" ",
|
|
503
|
+
/* @__PURE__ */ jsx("code", { children: "onCreate" }),
|
|
504
|
+
", so a person searches the list and can still add one that is not there. The two look alike and do different jobs: a Combobox knows its options, a TagInput does not."
|
|
505
|
+
] })] }),
|
|
506
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
507
|
+
align: "start",
|
|
508
|
+
code: `
|
|
509
|
+
const [tags, setTags] = useState(['ceramics', 'walnut'])
|
|
510
|
+
|
|
511
|
+
<Field label="Keywords" hint="Press Enter or comma to add one; Backspace takes the last back">
|
|
512
|
+
<TagInput value={tags} onValueChange={setTags} placeholder="Add a keyword" />
|
|
513
|
+
</Field>`,
|
|
514
|
+
children: /* @__PURE__ */ jsx(Keywords, {})
|
|
515
|
+
}), /* @__PURE__ */ jsx(DocTable, {
|
|
516
|
+
columns: ["Reach for", "When"],
|
|
517
|
+
rows: [
|
|
518
|
+
[code("TagInput"), "Free-typed tags with no fixed list: keywords, emails, codes, labels."],
|
|
519
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
520
|
+
to: "/components/combobox#create",
|
|
521
|
+
children: "Combobox"
|
|
522
|
+
}), "Tags chosen from a catalogue with search, which can also create a new one with onCreate."],
|
|
523
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
524
|
+
to: "/components/select",
|
|
525
|
+
children: "Select"
|
|
526
|
+
}), "One choice from a fixed list."],
|
|
527
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
528
|
+
to: "/components/input#field",
|
|
529
|
+
children: "Input"
|
|
530
|
+
}), "One free-typed value, not a list."],
|
|
531
|
+
[/* @__PURE__ */ jsx(DocLink, {
|
|
532
|
+
to: "/components/chip",
|
|
533
|
+
children: "Chip"
|
|
534
|
+
}), "A tag or pick already made, to read or take away."]
|
|
535
|
+
]
|
|
536
|
+
})]
|
|
537
|
+
}),
|
|
538
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
539
|
+
id: "adding",
|
|
540
|
+
title: "Adding and taking back",
|
|
541
|
+
description: /* @__PURE__ */ jsx("p", { children: "Enter adds what is typed when there is something to add; an empty Enter is left to submit a form. A separator key adds too, and never lands in the box. With nothing typed, Backspace takes the last tag back and hands focus to the input. A tag's remove button takes that one away, and focus returns to the input." }),
|
|
542
|
+
children: [/* @__PURE__ */ jsx(SubSection, {
|
|
543
|
+
title: "Other separators",
|
|
544
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
545
|
+
/* @__PURE__ */ jsx("code", { children: "separators" }),
|
|
546
|
+
" lists the keys besides Enter that add the text. The default is",
|
|
547
|
+
" ",
|
|
548
|
+
/* @__PURE__ */ jsx("code", { children: "[',']" }),
|
|
549
|
+
". Here a semicolon works too, and ",
|
|
550
|
+
/* @__PURE__ */ jsx("code", { children: "transform" }),
|
|
551
|
+
" upper-cases what is added."
|
|
552
|
+
] }),
|
|
553
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
554
|
+
align: "start",
|
|
555
|
+
code: `
|
|
556
|
+
const [codes, setCodes] = useState(['ARD-01', 'HRB-12'])
|
|
557
|
+
|
|
558
|
+
<Field label="Product codes" hint="Enter, a comma or a semicolon adds one; spaces are kept">
|
|
559
|
+
<TagInput
|
|
560
|
+
value={codes}
|
|
561
|
+
onValueChange={setCodes}
|
|
562
|
+
separators={[',', ';']}
|
|
563
|
+
transform={(tag) => tag.toUpperCase()}
|
|
564
|
+
placeholder="ARD-01"
|
|
565
|
+
/>
|
|
566
|
+
</Field>`,
|
|
567
|
+
children: /* @__PURE__ */ jsx(Codes, {})
|
|
568
|
+
})
|
|
569
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
570
|
+
title: "Pasting a list",
|
|
571
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
572
|
+
"Paste text that holds a separator or a line break and each piece is added in order, under the same checks. Anything refused stays in the box, joined by ",
|
|
573
|
+
/* @__PURE__ */ jsx("code", { children: "\", \"" }),
|
|
574
|
+
", with the first refusal's message under it. Text with no separator pastes normally, so a tag can be finished by hand."
|
|
575
|
+
] }),
|
|
576
|
+
children: /* @__PURE__ */ jsxs(Note, { children: [
|
|
577
|
+
"A paste is taken whole: \"desks, chairs\" pasted into an empty box adds ",
|
|
578
|
+
/* @__PURE__ */ jsx("code", { children: "desks" }),
|
|
579
|
+
" and",
|
|
580
|
+
" ",
|
|
581
|
+
/* @__PURE__ */ jsx("code", { children: "chairs" }),
|
|
582
|
+
" in one go, and the status says \"desks, chairs added\"."
|
|
583
|
+
] })
|
|
584
|
+
})]
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
587
|
+
id: "checks",
|
|
588
|
+
title: "Checks and limits",
|
|
589
|
+
description: /* @__PURE__ */ jsx("p", { children: "A tag can be refused before it is added: too many, already there, or not what the field wants." }),
|
|
590
|
+
children: [
|
|
591
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
592
|
+
title: "A limit",
|
|
593
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
594
|
+
/* @__PURE__ */ jsx("code", { children: "max" }),
|
|
595
|
+
" is the most tags the list takes. At the limit, adding is refused with",
|
|
596
|
+
" ",
|
|
597
|
+
/* @__PURE__ */ jsx("code", { children: "labels.full" }),
|
|
598
|
+
" (\"You can add up to 3 tags\") and the text stays in the box."
|
|
599
|
+
] }),
|
|
600
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
601
|
+
align: "start",
|
|
602
|
+
code: `
|
|
603
|
+
const [seasons, setSeasons] = useState(['spring', 'summer', 'autumn'])
|
|
604
|
+
|
|
605
|
+
<Field label="Season tags" hint="Up to three tags">
|
|
606
|
+
<TagInput max={3} value={seasons} onValueChange={setSeasons} placeholder="Add a season" />
|
|
607
|
+
</Field>`,
|
|
608
|
+
children: /* @__PURE__ */ jsx(Limited, {})
|
|
609
|
+
})
|
|
610
|
+
}),
|
|
611
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
612
|
+
title: "A rule",
|
|
613
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "validate(tag, tags)" }), " returns a message to refuse the tag, or nothing to accept it: an email that is not one, a code of the wrong shape, a word on a block list. The message is shown under the box as a Field's error line, in the place of a Field's hint, the field reads as invalid, and it is cleared on the next keystroke. Type a word that is not an email below and press Enter."] }),
|
|
614
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
615
|
+
align: "start",
|
|
616
|
+
code: `
|
|
617
|
+
const [emails, setEmails] = useState(['priya.shah@harbourdesk.co.uk'])
|
|
618
|
+
|
|
619
|
+
<Field label="Invites" hint="Only email addresses are accepted">
|
|
620
|
+
<TagInput
|
|
621
|
+
value={emails}
|
|
622
|
+
onValueChange={setEmails}
|
|
623
|
+
transform={(tag) => tag.toLowerCase()}
|
|
624
|
+
validate={(tag) => (isEmail(tag) ? null : 'Use an email address')}
|
|
625
|
+
placeholder="name@example.co.uk"
|
|
626
|
+
/>
|
|
627
|
+
</Field>`,
|
|
628
|
+
children: /* @__PURE__ */ jsx(Invites, {})
|
|
629
|
+
})
|
|
630
|
+
}),
|
|
631
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
632
|
+
title: "The same tag twice",
|
|
633
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
634
|
+
"A tag already in the list is refused, comparing without case, and says ",
|
|
635
|
+
/* @__PURE__ */ jsx("code", { children: "labels.duplicate" }),
|
|
636
|
+
" ",
|
|
637
|
+
"(\"walnut is already added\"). Pass ",
|
|
638
|
+
/* @__PURE__ */ jsx("code", { children: "allowDuplicates" }),
|
|
639
|
+
" to take it again, when order or count matters more than the set."
|
|
640
|
+
] }),
|
|
641
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
642
|
+
align: "start",
|
|
643
|
+
code: `
|
|
644
|
+
const [notes, setNotes] = useState(['fragile'])
|
|
645
|
+
|
|
646
|
+
<Field label="Handling notes" hint="With allowDuplicates, the same word is taken twice">
|
|
647
|
+
<TagInput allowDuplicates value={notes} onValueChange={setNotes} placeholder="Add a handling note" />
|
|
648
|
+
</Field>`,
|
|
649
|
+
children: /* @__PURE__ */ jsx(Repeats, {})
|
|
650
|
+
})
|
|
651
|
+
})
|
|
652
|
+
]
|
|
653
|
+
}),
|
|
654
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
655
|
+
id: "states",
|
|
656
|
+
title: "Sizes and states",
|
|
657
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
658
|
+
"The box takes the same three heights as ",
|
|
659
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
660
|
+
to: "/components/input",
|
|
661
|
+
children: "Input"
|
|
662
|
+
}),
|
|
663
|
+
": ",
|
|
664
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
665
|
+
" ",
|
|
666
|
+
"(30px), ",
|
|
667
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
668
|
+
" (36px, default) and ",
|
|
669
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
670
|
+
" (44px). It grows to several lines as tags wrap, the caret following the last tag, and a long tag is cut short with an ellipsis inside the box. In an ",
|
|
671
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
672
|
+
" box the chips are a step larger, so their words sit beside the typing at its size."
|
|
673
|
+
] }),
|
|
674
|
+
children: [
|
|
675
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
676
|
+
title: "Sizes",
|
|
677
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
678
|
+
align: "start",
|
|
679
|
+
code: `
|
|
680
|
+
<TagInput size="sm" defaultValue={['small']} aria-label="Small" />
|
|
681
|
+
<TagInput defaultValue={['medium']} aria-label="Medium" />
|
|
682
|
+
<TagInput size="lg" defaultValue={['large']} aria-label="Large" />`,
|
|
683
|
+
children: /* @__PURE__ */ jsx(Sizes, {})
|
|
684
|
+
})
|
|
685
|
+
}),
|
|
686
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
687
|
+
title: "Invalid, required, disabled and read-only",
|
|
688
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
689
|
+
/* @__PURE__ */ jsx("code", { children: "invalid" }),
|
|
690
|
+
" gives the box the error treatment and sets ",
|
|
691
|
+
/* @__PURE__ */ jsx("code", { children: "aria-invalid" }),
|
|
692
|
+
"; inside a",
|
|
693
|
+
" ",
|
|
694
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
695
|
+
to: "/components/input#field",
|
|
696
|
+
children: "Field"
|
|
697
|
+
}),
|
|
698
|
+
" it follows the Field's error instead, and a refusal marks it invalid on its own. A ",
|
|
699
|
+
/* @__PURE__ */ jsx("code", { children: "required" }),
|
|
700
|
+
" Field tells assistive tech the field must be filled and is not left empty in a form when there are tags already."
|
|
701
|
+
] }), /* @__PURE__ */ jsx("p", { children: "A disabled box sinks to the well and its chips dim; it takes nothing. A read-only box keeps its tags but cannot add or remove them: the input is read-only and the chips have no remove button." })] }),
|
|
702
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
703
|
+
align: "start",
|
|
704
|
+
code: `
|
|
705
|
+
<TagInput aria-label="Invalid" invalid defaultValue={['ceramics']} />
|
|
706
|
+
|
|
707
|
+
<Field label="Invalid, in a Field" error="Add at least one keyword">
|
|
708
|
+
<TagInput placeholder="Add a keyword" />
|
|
709
|
+
</Field>
|
|
710
|
+
|
|
711
|
+
<Field label="Required" required hint="The label carries a star and aria-required">
|
|
712
|
+
<TagInput placeholder="Add a keyword" />
|
|
713
|
+
</Field>
|
|
714
|
+
|
|
715
|
+
<TagInput aria-label="Disabled" disabled defaultValue={['ceramics']} />
|
|
716
|
+
<TagInput aria-label="Read-only" readOnly defaultValue={['ceramics']} />`,
|
|
717
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
718
|
+
className: "tag-input-column",
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
721
|
+
"aria-label": "Invalid",
|
|
722
|
+
invalid: true,
|
|
723
|
+
defaultValue: ["ceramics"]
|
|
724
|
+
}),
|
|
725
|
+
/* @__PURE__ */ jsx(Field, {
|
|
726
|
+
label: "Invalid, in a Field",
|
|
727
|
+
error: "Add at least one keyword",
|
|
728
|
+
children: /* @__PURE__ */ jsx(TagInput, { placeholder: "Add a keyword" })
|
|
729
|
+
}),
|
|
730
|
+
/* @__PURE__ */ jsx(Field, {
|
|
731
|
+
label: "Required",
|
|
732
|
+
required: true,
|
|
733
|
+
hint: "The label carries a star and aria-required",
|
|
734
|
+
children: /* @__PURE__ */ jsx(TagInput, { placeholder: "Add a keyword" })
|
|
735
|
+
}),
|
|
736
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
737
|
+
"aria-label": "Disabled",
|
|
738
|
+
disabled: true,
|
|
739
|
+
defaultValue: ["ceramics"]
|
|
740
|
+
}),
|
|
741
|
+
/* @__PURE__ */ jsx(TagInput, {
|
|
742
|
+
"aria-label": "Read-only",
|
|
743
|
+
readOnly: true,
|
|
744
|
+
defaultValue: ["ceramics"]
|
|
745
|
+
})
|
|
746
|
+
]
|
|
747
|
+
})
|
|
748
|
+
})
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
751
|
+
title: "The placeholder shows only while there are no tags",
|
|
752
|
+
description: /* @__PURE__ */ jsx("p", { children: "A placeholder on a box that already holds tags would sit among them, so it is dropped once the list is not empty. Keep it short, and say what to type, not what the field is: the label says that." }),
|
|
753
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
754
|
+
align: "start",
|
|
755
|
+
code: `
|
|
756
|
+
<TagInput aria-label="Keywords" placeholder="Add a keyword" />
|
|
757
|
+
<TagInput aria-label="Keywords" defaultValue={['ceramics']} placeholder="Add a keyword" />`,
|
|
758
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
759
|
+
className: "tag-input-column",
|
|
760
|
+
children: [/* @__PURE__ */ jsx(TagInput, {
|
|
761
|
+
"aria-label": "Empty",
|
|
762
|
+
placeholder: "Add a keyword"
|
|
763
|
+
}), /* @__PURE__ */ jsx(TagInput, {
|
|
764
|
+
"aria-label": "With a tag",
|
|
765
|
+
defaultValue: ["ceramics"],
|
|
766
|
+
placeholder: "Add a keyword"
|
|
767
|
+
})]
|
|
768
|
+
})
|
|
769
|
+
})
|
|
770
|
+
})
|
|
771
|
+
]
|
|
772
|
+
}),
|
|
773
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
774
|
+
id: "catalogue",
|
|
775
|
+
title: "Picking from a catalogue",
|
|
776
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
777
|
+
"Give ",
|
|
778
|
+
/* @__PURE__ */ jsx("code", { children: "options" }),
|
|
779
|
+
" (a list it filters as you type) or ",
|
|
780
|
+
/* @__PURE__ */ jsx("code", { children: "onSearch" }),
|
|
781
|
+
" (a server asked a page at a time) and the value holds the tags' ids. A list hangs under the box on the combobox pattern: the arrows move through it while the caret stays in the box, Enter or a press picks, and the picked tags leave the list. A typed or pasted name is matched to its tag whatever its case, so \"vip, trade\" picks two. With ",
|
|
782
|
+
/* @__PURE__ */ jsx("code", { children: "onCreate" }),
|
|
783
|
+
", a name there is none for is created: its chip shows at once, busy, and goes again, with the reason, if creating fails. Without it, the field only picks."
|
|
784
|
+
] }),
|
|
785
|
+
children: [/* @__PURE__ */ jsx(SubSection, {
|
|
786
|
+
title: "Pick or create",
|
|
787
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
788
|
+
align: "fill",
|
|
789
|
+
minHeight: 360,
|
|
790
|
+
code: `
|
|
791
|
+
<Field label="Customer tags" hint="Pick a tag, or type a new one and press Enter.">
|
|
792
|
+
<TagInput
|
|
793
|
+
options={tags} // { value: id, label: name }[]
|
|
794
|
+
value={tagIds}
|
|
795
|
+
onValueChange={setTagIds}
|
|
796
|
+
onCreate={async (name) => api.createTag(name)} // resolves { value, label }
|
|
797
|
+
/>
|
|
798
|
+
</Field>`,
|
|
799
|
+
children: /* @__PURE__ */ jsx(CustomerTags, {})
|
|
800
|
+
})
|
|
801
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
802
|
+
title: "A server search, pick only",
|
|
803
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
804
|
+
/* @__PURE__ */ jsx("code", { children: "onSearch" }),
|
|
805
|
+
" is asked for the first page as the list opens and again as the typing pauses (",
|
|
806
|
+
/* @__PURE__ */ jsx("code", { children: "searchDelay" }),
|
|
807
|
+
"), and for the next page as the list's end comes into view. ",
|
|
808
|
+
/* @__PURE__ */ jsx("code", { children: "selectedOptions" }),
|
|
809
|
+
" ",
|
|
810
|
+
"names the picked tags before any page has brought them."
|
|
811
|
+
] }),
|
|
812
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
813
|
+
align: "fill",
|
|
814
|
+
minHeight: 360,
|
|
815
|
+
code: `
|
|
816
|
+
<TagInput
|
|
817
|
+
onSearch={({ term, page, pageSize, signal }) => api.segments({ term, page, pageSize, signal })} // { options, total }
|
|
818
|
+
selectedOptions={pickedSegments}
|
|
819
|
+
value={segmentIds}
|
|
820
|
+
onValueChange={setSegmentIds}
|
|
821
|
+
/>`,
|
|
822
|
+
children: /* @__PURE__ */ jsx(PickOnly, {})
|
|
823
|
+
})
|
|
824
|
+
})]
|
|
825
|
+
}),
|
|
826
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
827
|
+
id: "rules",
|
|
828
|
+
title: "Entries that break a rule",
|
|
829
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
830
|
+
"Every chip is checked by ",
|
|
831
|
+
/* @__PURE__ */ jsx("code", { children: "validate" }),
|
|
832
|
+
", the ones already in the list too: a chip that breaks a rule is drawn red with a mark, the box is ",
|
|
833
|
+
/* @__PURE__ */ jsx("code", { children: "aria-invalid" }),
|
|
834
|
+
", and the first one's message shows under it. With",
|
|
835
|
+
" ",
|
|
836
|
+
/* @__PURE__ */ jsx("code", { children: "keepInvalid" }),
|
|
837
|
+
", an entry the rule refuses is kept as such a chip instead of staying in the input, and a press on it puts it back in the box to be put right. ",
|
|
838
|
+
/* @__PURE__ */ jsx("code", { children: "describeTag" }),
|
|
839
|
+
" gives a chip words and a tone of its own: here a wildcard district reads \"EC (every district)\"."
|
|
840
|
+
] }),
|
|
841
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
842
|
+
align: "fill",
|
|
843
|
+
code: `
|
|
844
|
+
<TagInput
|
|
845
|
+
value={postcodes}
|
|
846
|
+
onValueChange={setPostcodes}
|
|
847
|
+
validate={(tag) => (isPostcodeRule(tag) ? null : \`\${tag} is not a postcode area or district\`)}
|
|
848
|
+
keepInvalid
|
|
849
|
+
transform={(tag) => tag.toUpperCase().replace(/\\s+/g, '')}
|
|
850
|
+
separators={[',', ' ']}
|
|
851
|
+
describeTag={(tag) => (tag.endsWith('*') ? { label: \`\${tag.slice(0, -1)} (every district)\`, tone: 'info' } : undefined)}
|
|
852
|
+
/>`,
|
|
853
|
+
children: /* @__PURE__ */ jsx(PostcodeRules, {})
|
|
854
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
855
|
+
title: "A cap that says itself",
|
|
856
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "showMax" }), " says \"5 maximum\" under the box and closes the box at the cap: the input stays focused, read only, and the chips can still be removed to make room."] }),
|
|
857
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
858
|
+
align: "fill",
|
|
859
|
+
code: `
|
|
860
|
+
<TagInput value={keywords} onValueChange={setKeywords} max={5} showMax
|
|
861
|
+
validate={(tag) => (tag.length > 20 ? 'Keep each keyword to 20 characters' : null)} />`,
|
|
862
|
+
children: /* @__PURE__ */ jsx(Keywords$1, {})
|
|
863
|
+
})
|
|
864
|
+
})]
|
|
865
|
+
}),
|
|
866
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
867
|
+
id: "saving",
|
|
868
|
+
title: "Saving each change",
|
|
869
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
870
|
+
"Return a promise from ",
|
|
871
|
+
/* @__PURE__ */ jsx("code", { children: "onValueChange" }),
|
|
872
|
+
" and each add or removal saves as it is made: the chip shows a spinner until the promise settles, and a change that fails is put back with \"That change was not saved. Try again.\" Tick the box below to make the next save fail."
|
|
873
|
+
] }),
|
|
874
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
875
|
+
align: "fill",
|
|
876
|
+
code: `
|
|
877
|
+
<TagInput
|
|
878
|
+
value={tags}
|
|
879
|
+
onValueChange={async (next) => {
|
|
880
|
+
await api.saveCustomerTags(customer.id, next) // throws on failure: the change is put back
|
|
881
|
+
setTags(next)
|
|
882
|
+
}}
|
|
883
|
+
/>`,
|
|
884
|
+
children: /* @__PURE__ */ jsx(SavedTags, {})
|
|
885
|
+
})
|
|
886
|
+
}),
|
|
887
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
888
|
+
id: "suggestions",
|
|
889
|
+
title: "Suggestions",
|
|
890
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
891
|
+
/* @__PURE__ */ jsx("code", { children: "suggestions" }),
|
|
892
|
+
" are dashed chips under the box that add a tag with a press, each with a quiet figure (\"12 values\"); the ones already added leave. Past ",
|
|
893
|
+
/* @__PURE__ */ jsx("code", { children: "suggestionLimit" }),
|
|
894
|
+
" a Show all button shows the rest and hands focus to the first of them."
|
|
895
|
+
] }),
|
|
896
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
897
|
+
align: "fill",
|
|
898
|
+
code: `
|
|
899
|
+
<TagInput value={names} onValueChange={setNames} suggestionLimit={3} suggestions={[
|
|
900
|
+
{ value: 'Colour', meta: '12 values' },
|
|
901
|
+
{ value: 'Finish', meta: '6 values' },
|
|
902
|
+
{ value: 'Fabric', meta: '18 values' },
|
|
903
|
+
{ value: 'Frame', meta: '4 values' },
|
|
904
|
+
{ value: 'Leg colour', meta: '5 values' },
|
|
905
|
+
]} />`,
|
|
906
|
+
children: /* @__PURE__ */ jsx(OptionNames, {})
|
|
907
|
+
})
|
|
908
|
+
}),
|
|
909
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
910
|
+
id: "rename",
|
|
911
|
+
title: "Renaming and reordering",
|
|
912
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
913
|
+
/* @__PURE__ */ jsx("code", { children: "renameable" }),
|
|
914
|
+
" makes each chip's word a button that turns into a field: Enter, or leaving the field, renames it through ",
|
|
915
|
+
/* @__PURE__ */ jsx("code", { children: "transform" }),
|
|
916
|
+
" and the same checks as a new tag (a name another chip has is refused, and the field stays); Escape leaves it as it was. Focus goes back to the chip either way. ",
|
|
917
|
+
/* @__PURE__ */ jsx("code", { children: "onRename" }),
|
|
918
|
+
" ",
|
|
919
|
+
"hears the old name and the new one, for the variants that use it. ",
|
|
920
|
+
/* @__PURE__ */ jsx("code", { children: "reorderable" }),
|
|
921
|
+
" puts a grip at each chip's start that moves it along the row: dragged with a mouse or a touch (the chips make way as it passes), or lifted from the keyboard with Space, moved with the arrow keys (the other way round right to left) and dropped with Space, Escape putting it back. Every move is said, focus stays on the grip, and the new order arrives through",
|
|
922
|
+
" ",
|
|
923
|
+
/* @__PURE__ */ jsx("code", { children: "onValueChange" }),
|
|
924
|
+
" (",
|
|
925
|
+
/* @__PURE__ */ jsx("code", { children: "onReorder" }),
|
|
926
|
+
" hears the old and new place). ",
|
|
927
|
+
/* @__PURE__ */ jsx("code", { children: "addButton" }),
|
|
928
|
+
" sets an Add button beside the box, and ",
|
|
929
|
+
/* @__PURE__ */ jsx("code", { children: "hint" }),
|
|
930
|
+
" a quiet line under it."
|
|
931
|
+
] }),
|
|
932
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
933
|
+
align: "fill",
|
|
934
|
+
code: `
|
|
935
|
+
<TagInput
|
|
936
|
+
value={values}
|
|
937
|
+
onValueChange={setValues}
|
|
938
|
+
renameable
|
|
939
|
+
onRename={(from, to) => renameVariantValue('Finish', from, to)}
|
|
940
|
+
reorderable
|
|
941
|
+
addButton
|
|
942
|
+
hint="Drag a value by its grip to reorder it, or press its word to rename it. Enter or a comma adds each new one."
|
|
943
|
+
transform={(tag) => tag.replace(/\\s+/g, ' ')}
|
|
944
|
+
max={5}
|
|
945
|
+
/>`,
|
|
946
|
+
children: /* @__PURE__ */ jsx(OptionValues, {})
|
|
947
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
948
|
+
title: "While a change saves",
|
|
949
|
+
children: "The grips are held (in the page, quieter) while a change saves or a chip is renamed, so the order is never moved under a save that has not landed."
|
|
950
|
+
})]
|
|
951
|
+
}),
|
|
952
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
953
|
+
id: "themes",
|
|
954
|
+
title: "In both themes",
|
|
955
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
956
|
+
align: "start",
|
|
957
|
+
minHeight: 360,
|
|
958
|
+
children: /* @__PURE__ */ jsx(Matrix, {})
|
|
959
|
+
})
|
|
960
|
+
}),
|
|
961
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
962
|
+
id: "accessibility",
|
|
963
|
+
title: "Accessibility",
|
|
964
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
965
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
966
|
+
"The input is a text field with a name: a Field label, or ",
|
|
967
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
968
|
+
". Inside a Field it takes the Field's ",
|
|
969
|
+
/* @__PURE__ */ jsx("code", { children: "id" }),
|
|
970
|
+
", ",
|
|
971
|
+
/* @__PURE__ */ jsx("code", { children: "aria-describedby" }),
|
|
972
|
+
" and invalid state, and a ",
|
|
973
|
+
/* @__PURE__ */ jsx("code", { children: "required" }),
|
|
974
|
+
" ",
|
|
975
|
+
"Field adds ",
|
|
976
|
+
/* @__PURE__ */ jsx("code", { children: "aria-required" }),
|
|
977
|
+
"."
|
|
978
|
+
] }),
|
|
979
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
980
|
+
"The tags are a real list: a ",
|
|
981
|
+
/* @__PURE__ */ jsx("code", { children: "ul" }),
|
|
982
|
+
" with ",
|
|
983
|
+
/* @__PURE__ */ jsx("code", { children: "role=\"list\"" }),
|
|
984
|
+
" of ",
|
|
985
|
+
/* @__PURE__ */ jsx("code", { children: "li" }),
|
|
986
|
+
" with",
|
|
987
|
+
" ",
|
|
988
|
+
/* @__PURE__ */ jsx("code", { children: "role=\"listitem\"" }),
|
|
989
|
+
", each holding a chip. A screen reader counts them. The list's own box steps aside so the caret can follow the last chip, and Safari can drop the semantics of a list whose box is gone, which is why the roles are said outright. The remove button is named for its tag (\"Remove ceramics\"), takes Tab and Enter or Space, and hands focus back to the input when the tag goes."
|
|
990
|
+
] }),
|
|
991
|
+
"Keyboard: Enter adds the typed text (an empty Enter is left to submit a form), a separator key adds and never lands in the box, Backspace on an empty box takes the last tag back, and typing clears a refusal. A press on the box outside the tags and the input focuses the input.",
|
|
992
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
993
|
+
"A refusal is announced and shown: the box is ",
|
|
994
|
+
/* @__PURE__ */ jsx("code", { children: "aria-invalid" }),
|
|
995
|
+
", the message is linked by",
|
|
996
|
+
" ",
|
|
997
|
+
/* @__PURE__ */ jsx("code", { children: "aria-describedby" }),
|
|
998
|
+
", and one polite status, in the page from the first render, says \"ceramics added\", \"walnut removed\", or the refusal."
|
|
999
|
+
] }),
|
|
1000
|
+
"Colour is not the only signal: an invalid box has a red border and a message with its mark under it, and a disabled box sinks to the well, its chips dim, and it takes no input."
|
|
1001
|
+
] })
|
|
1002
|
+
}),
|
|
1003
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1004
|
+
id: "guidelines",
|
|
1005
|
+
title: "Guidelines",
|
|
1006
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
1007
|
+
do: {
|
|
1008
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1009
|
+
className: "tag-input-stage",
|
|
1010
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
1011
|
+
"aria-label": "Keywords",
|
|
1012
|
+
size: "sm",
|
|
1013
|
+
defaultValue: ["ceramics", "walnut"],
|
|
1014
|
+
placeholder: "Add a keyword"
|
|
1015
|
+
})
|
|
1016
|
+
}),
|
|
1017
|
+
caption: "Use it for free-typed tags. The box says what is in the list, and a tag is one press from gone."
|
|
1018
|
+
},
|
|
1019
|
+
dont: {
|
|
1020
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1021
|
+
className: "tag-input-stage",
|
|
1022
|
+
children: /* @__PURE__ */ jsx(TagInput, {
|
|
1023
|
+
"aria-label": "Category",
|
|
1024
|
+
size: "sm",
|
|
1025
|
+
defaultValue: ["Furniture"],
|
|
1026
|
+
validate: (tag) => [
|
|
1027
|
+
"Furniture",
|
|
1028
|
+
"Lighting",
|
|
1029
|
+
"Textiles"
|
|
1030
|
+
].includes(tag) ? null : "Not a category",
|
|
1031
|
+
placeholder: "Type a category"
|
|
1032
|
+
})
|
|
1033
|
+
}),
|
|
1034
|
+
caption: "Do not use it to pick from a known list. Use a Combobox with multiple and onCreate, so the options are searched, not remembered."
|
|
1035
|
+
}
|
|
1036
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1037
|
+
/* @__PURE__ */ jsx(Fragment$1, { children: "Say what belongs in the field with the label and the placeholder: \"Keywords\", \"Invites\", \"Product codes\". The tags themselves are short: a word or two, not a sentence." }),
|
|
1038
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1039
|
+
"Give it a ",
|
|
1040
|
+
/* @__PURE__ */ jsx("code", { children: "max" }),
|
|
1041
|
+
" where the count matters, and say what happens at the limit in words beside the field, not only in the refusal."
|
|
1042
|
+
] }),
|
|
1043
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1044
|
+
"Normalise what is added with ",
|
|
1045
|
+
/* @__PURE__ */ jsx("code", { children: "transform" }),
|
|
1046
|
+
" (lower-case an email, upper-case a code) so the list stays tidy, and use ",
|
|
1047
|
+
/* @__PURE__ */ jsx("code", { children: "validate" }),
|
|
1048
|
+
" to keep what is not a tag out."
|
|
1049
|
+
] }),
|
|
1050
|
+
"Keep the number of tags to what fits in two or three lines. For a long list, show the count beside the field or move the tags to a list below.",
|
|
1051
|
+
"Removing a tag changes the data: do it at once, and let the page say so."
|
|
1052
|
+
] })]
|
|
1053
|
+
}),
|
|
1054
|
+
/* @__PURE__ */ jsx(Fragment$1, {}),
|
|
1055
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
1056
|
+
id: "props",
|
|
1057
|
+
title: "Props",
|
|
1058
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every native attribute of the text input." }),
|
|
1059
|
+
children: [
|
|
1060
|
+
/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
1061
|
+
{
|
|
1062
|
+
name: "value",
|
|
1063
|
+
type: "string[]",
|
|
1064
|
+
description: "The tags, when the page holds them."
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: "defaultValue",
|
|
1068
|
+
type: "string[]",
|
|
1069
|
+
default: "[]",
|
|
1070
|
+
description: "The starting tags, when the field keeps its own."
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
name: "onValueChange",
|
|
1074
|
+
type: "(tags: string[]) => void | Promise<unknown>",
|
|
1075
|
+
description: "Called with the new list whenever a tag is added or removed. Return a promise to save each change: its chip is busy until it settles, and a failed change is put back."
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
name: "max",
|
|
1079
|
+
type: "number",
|
|
1080
|
+
description: "The most tags allowed. No limit when left out; adding past it is refused with labels.full."
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: "separators",
|
|
1084
|
+
type: "string[]",
|
|
1085
|
+
default: "[',']",
|
|
1086
|
+
description: "The keys besides Enter that add the typed text. A separator never lands in the box."
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
name: "validate",
|
|
1090
|
+
type: "(tag: string, tags: string[]) => string | null | undefined",
|
|
1091
|
+
description: "Return a message to refuse the tag, or nothing to accept it. The message shows under the box."
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
name: "allowDuplicates",
|
|
1095
|
+
type: "boolean",
|
|
1096
|
+
default: "false",
|
|
1097
|
+
description: "Take a tag that is already in the list. Duplicates compare without case."
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: "transform",
|
|
1101
|
+
type: "(tag: string) => string",
|
|
1102
|
+
description: "Applied to the trimmed text before the checks, e.g. to lower-case an email."
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
name: "addOnBlur",
|
|
1106
|
+
type: "boolean",
|
|
1107
|
+
default: "true",
|
|
1108
|
+
description: "Add what is typed when the box loses focus."
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
name: "size",
|
|
1112
|
+
type: "'sm' | 'md' | 'lg'",
|
|
1113
|
+
default: "'md'",
|
|
1114
|
+
description: "The box height: 30px, 36px or 44px, the same as Input and Button."
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
name: "invalid",
|
|
1118
|
+
type: "boolean",
|
|
1119
|
+
description: "The error treatment and aria-invalid. Inside a Field it follows the Field's error, and a refusal sets it too."
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
name: "labels",
|
|
1123
|
+
type: "Partial<TagInputLabels>",
|
|
1124
|
+
description: "Words for another language. Anything left out stays English; tagInputLabels is the English set."
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
name: "placeholder",
|
|
1128
|
+
type: "string",
|
|
1129
|
+
description: "The empty box. Shown only while there are no tags."
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
name: "disabled, readOnly",
|
|
1133
|
+
type: "boolean",
|
|
1134
|
+
description: "Disabled takes nothing and dims; read-only keeps the tags but cannot add or remove them and draws no remove buttons."
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: "required",
|
|
1138
|
+
type: "boolean",
|
|
1139
|
+
description: "Says to assistive tech the field must hold tags, and is not left empty in a form when there are tags already. The browser does not validate it."
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
name: "name",
|
|
1143
|
+
type: "string",
|
|
1144
|
+
description: "For a form: one hidden input per tag, so the list is submitted."
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: "options",
|
|
1148
|
+
type: "TagInputOption[]",
|
|
1149
|
+
description: "Catalogue mode: the tags to pick from ({ value: id, label, description, tone, color }). The value holds ids."
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
name: "onSearch",
|
|
1153
|
+
type: "(query) => Promise<TagInputPage>",
|
|
1154
|
+
description: "Catalogue mode: a server asked for a page ({ term, page, pageSize, signal }); answers { options, total, hasMore }."
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
name: "pageSize, searchDelay",
|
|
1158
|
+
type: "number",
|
|
1159
|
+
default: "10, 300",
|
|
1160
|
+
description: "Tags per page, and the pause before a search, in ms."
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: "selectedOptions",
|
|
1164
|
+
type: "TagInputOption[]",
|
|
1165
|
+
description: "Catalogue mode: the picked tags, for their names before a page brings them."
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "onCreate",
|
|
1169
|
+
type: "(name) => TagInputOption | Promise<TagInputOption>",
|
|
1170
|
+
description: "Catalogue mode: creates a tag for a name there is none for. Leave it out to pick only."
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: "keepInvalid",
|
|
1174
|
+
type: "boolean",
|
|
1175
|
+
default: "false",
|
|
1176
|
+
description: "Keeps an entry validate refuses as a red chip; a press puts it back in the box."
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
name: "showMax",
|
|
1180
|
+
type: "boolean",
|
|
1181
|
+
default: "false",
|
|
1182
|
+
description: "Says \"N maximum\" under the box and closes the box at the cap."
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: "describeTag",
|
|
1186
|
+
type: "(tag) => { label, tone, color } | undefined",
|
|
1187
|
+
description: "A chip's own words and tone."
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
name: "suggestions",
|
|
1191
|
+
type: "TagInputSuggestion[]",
|
|
1192
|
+
description: "Chips under the box that add a tag with a press ({ value, label, meta })."
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
name: "suggestionLimit",
|
|
1196
|
+
type: "number",
|
|
1197
|
+
default: "6",
|
|
1198
|
+
description: "How many suggestions show before Show all."
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
name: "renameable",
|
|
1202
|
+
type: "boolean",
|
|
1203
|
+
default: "false",
|
|
1204
|
+
description: "A press on a chip's word renames it in place. Not in catalogue mode."
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "onRename",
|
|
1208
|
+
type: "(from, to, index) => void",
|
|
1209
|
+
description: "Called when a chip is renamed."
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
name: "reorderable",
|
|
1213
|
+
type: "boolean",
|
|
1214
|
+
default: "false",
|
|
1215
|
+
description: "A grip at each chip's start moves it along the row, by pointer, touch or keyboard."
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
name: "onReorder",
|
|
1219
|
+
type: "(from, to) => void",
|
|
1220
|
+
description: "Called with a moved chip's old and new place, beside onValueChange."
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
name: "addButton",
|
|
1224
|
+
type: "boolean",
|
|
1225
|
+
default: "false",
|
|
1226
|
+
description: "An Add button beside the box."
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
name: "hint",
|
|
1230
|
+
type: "ReactNode",
|
|
1231
|
+
description: "A quiet line under the box, read as the input's description."
|
|
1232
|
+
}
|
|
1233
|
+
] }),
|
|
1234
|
+
/* @__PURE__ */ jsxs("p", {
|
|
1235
|
+
className: "doc-section__description",
|
|
1236
|
+
children: [
|
|
1237
|
+
/* @__PURE__ */ jsx("code", { children: "ref" }),
|
|
1238
|
+
", ",
|
|
1239
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
1240
|
+
" and every native input prop go to the text input; ",
|
|
1241
|
+
/* @__PURE__ */ jsx("code", { children: "className" }),
|
|
1242
|
+
" ",
|
|
1243
|
+
"and ",
|
|
1244
|
+
/* @__PURE__ */ jsx("code", { children: "style" }),
|
|
1245
|
+
" go to the box around it. Put it in a",
|
|
1246
|
+
" ",
|
|
1247
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
1248
|
+
to: "/components/input#field",
|
|
1249
|
+
children: "Field"
|
|
1250
|
+
}),
|
|
1251
|
+
" to label it."
|
|
1252
|
+
]
|
|
1253
|
+
}),
|
|
1254
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1255
|
+
title: "TagInputLabels",
|
|
1256
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
1257
|
+
columns: ["Word", "Default"],
|
|
1258
|
+
rows: [
|
|
1259
|
+
[code("remove"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `Remove ${tag}`" }), ", the name of a tag's remove button."] })],
|
|
1260
|
+
[code("added"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `${tag} added`" }), ", announced when a tag is added."] })],
|
|
1261
|
+
[code("removed"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `${tag} removed`" }), ", announced when a tag is removed."] })],
|
|
1262
|
+
[code("full"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(max) => `You can add up to ${max} tags`" }), ", shown at the limit."] })],
|
|
1263
|
+
[code("duplicate"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `${tag} is already added`" }), ", shown for a repeat."] })],
|
|
1264
|
+
[code("invalidChip"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `${tag}, not valid. Select to edit`" }), ", names an invalid chip's button."] })],
|
|
1265
|
+
[code("maximum"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(max) => `${max} maximum`" }), ", the helper with showMax."] })],
|
|
1266
|
+
[code("create, createFailed, unknown"), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1267
|
+
"Catalogue: ",
|
|
1268
|
+
/* @__PURE__ */ jsx("code", { children: "Add \"Gold\"" }),
|
|
1269
|
+
", ",
|
|
1270
|
+
/* @__PURE__ */ jsx("code", { children: "Gold could not be created" }),
|
|
1271
|
+
", ",
|
|
1272
|
+
/* @__PURE__ */ jsx("code", { children: "There is no tag called Gold" }),
|
|
1273
|
+
"."
|
|
1274
|
+
] })],
|
|
1275
|
+
[code("list, notFound, loading, error, retry"), /* @__PURE__ */ jsx(Fragment$1, { children: "Catalogue: the list's name, and what it says while empty, loading or failed." })],
|
|
1276
|
+
[code("saveFailed"), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("code", { children: "That change was not saved. Try again." }) })],
|
|
1277
|
+
[code("addSuggestion, showAll, suggestions"), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1278
|
+
/* @__PURE__ */ jsx("code", { children: "Add Colour, 12 values" }),
|
|
1279
|
+
", ",
|
|
1280
|
+
/* @__PURE__ */ jsx("code", { children: "Show all 5" }),
|
|
1281
|
+
", ",
|
|
1282
|
+
/* @__PURE__ */ jsx("code", { children: "Suggestions" }),
|
|
1283
|
+
"."
|
|
1284
|
+
] })],
|
|
1285
|
+
[code("rename, add"), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1286
|
+
/* @__PURE__ */ jsx("code", { children: "(tag) => `Rename ${tag}`" }),
|
|
1287
|
+
" and ",
|
|
1288
|
+
/* @__PURE__ */ jsx("code", { children: "Add" }),
|
|
1289
|
+
"."
|
|
1290
|
+
] })],
|
|
1291
|
+
[code("reorder, reorderInstructions"), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "(tag) => `Reorder ${tag}`" }), ", and the sentence every grip is described by."] })],
|
|
1292
|
+
[code("lifted, moved, dropped, cancelled"), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1293
|
+
"What a move says, as the sortable list says it: ",
|
|
1294
|
+
/* @__PURE__ */ jsx("code", { children: "Ash moved to position 3 of 4" }),
|
|
1295
|
+
"."
|
|
1296
|
+
] })],
|
|
1297
|
+
[code("wait"), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("code", { children: "Still saving. Try again in a moment." }) })]
|
|
1298
|
+
]
|
|
1299
|
+
})
|
|
1300
|
+
})
|
|
1301
|
+
]
|
|
1302
|
+
})
|
|
1303
|
+
]
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
export { Page, Preview };
|