@orbitcommerce/constellation-docs 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs.css +14764 -2237
- package/dist/index.js +2 -2
- package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
- package/dist/pages/_address-data-L9BR499w.js +161 -0
- package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
- package/dist/pages/_card-art-0be5ncyV.js +18 -0
- package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
- package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
- package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
- package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
- package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
- package/dist/pages/address-block-BvxQWBTy.js +403 -0
- package/dist/pages/address-fields-CwSqro3W.js +277 -0
- package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
- package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
- package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
- package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
- package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
- package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
- package/dist/pages/board-card-D2tZY_mU.js +415 -0
- package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
- package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
- package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
- package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
- package/dist/pages/card-CXZ3V1d4.js +1612 -0
- package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
- package/dist/pages/chart-legend-B20AbakD.js +724 -0
- package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
- package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
- package/dist/pages/checklist-card-DEyykVFS.js +783 -0
- package/dist/pages/chip-Ck-o3Ui6.js +839 -0
- package/dist/pages/chip-list-k1LxXuCi.js +414 -0
- package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
- package/dist/pages/coachmark-Be2ghobT.js +366 -0
- package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
- package/dist/pages/collab-field-CfqqK7d2.js +696 -0
- package/dist/pages/color-field-CZpfcA-A.js +1127 -0
- package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
- package/dist/pages/comment-box-CDSGYhr5.js +346 -0
- package/dist/pages/composer-D4B0NgpA.js +689 -0
- package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
- package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
- package/dist/pages/context-menu-F9DV30ia.js +487 -0
- package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
- package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
- package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
- package/dist/pages/date-input-GOW067EB.js +956 -0
- package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
- package/dist/pages/description-list-BPeXn1eW.js +1268 -0
- package/dist/pages/device-switcher-BCaN99c1.js +554 -0
- package/dist/pages/dialog-CRpkRC98.js +3164 -0
- package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
- package/dist/pages/doodle-nzkqi2UI.js +201 -0
- package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
- package/dist/pages/drill-menu-cskH5mol.js +490 -0
- package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
- package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
- package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
- package/dist/pages/empty-state-4U2txFpI.js +1113 -0
- package/dist/pages/facet-filters-McbBeY9e.js +353 -0
- package/dist/pages/figure-D-HF5vCj.js +563 -0
- package/dist/pages/figure-strip-hg7txTc3.js +1381 -0
- package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
- package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
- package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
- package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
- package/dist/pages/form-grid-BfWCVlie.js +692 -0
- package/dist/pages/gallery-BBk2EOri.js +453 -0
- package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
- package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
- package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
- package/dist/pages/heatmap-BohgIcNk.js +507 -0
- package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
- package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
- package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
- package/dist/pages/hosted-field-BLh-53AE.js +208 -0
- package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
- package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
- package/dist/pages/image-cropper-NyougqLH.js +466 -0
- package/dist/pages/image-field-7knBv4mJ.js +567 -0
- package/dist/pages/import-result-CmTtGXW_.js +486 -0
- package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
- package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
- package/dist/pages/input-CzLCzfyx.js +2372 -0
- package/dist/pages/{installation-DpsX8G_n.js → installation-DRUWNVHP.js} +112 -29
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
- package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
- package/dist/pages/line-chart-CntWxeMF.js +1117 -0
- package/dist/pages/link-CXqvAg9z.js +689 -0
- package/dist/pages/link-picker-BMFGCC67.js +478 -0
- package/dist/pages/link-row-x8yaUuWc.js +595 -0
- package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
- package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
- package/dist/pages/loading-state-BNbCo51C.js +556 -0
- package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
- package/dist/pages/{logo-BfGF1Pq9.js → logo-D3a3QGKJ.js} +13 -13
- package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
- package/dist/pages/markdown-Ied72vMT.js +237 -0
- package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
- package/dist/pages/media-banner-DkStCia0.js +233 -0
- package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
- package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
- package/dist/pages/meta-line-D5p2TycR.js +371 -0
- package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
- package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
- package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
- package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/{overview-BPEbZQ6g.js → overview-BSfEqHY8.js} +4 -4
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
- package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
- package/dist/pages/password-field-DHEQKyUC.js +912 -0
- package/dist/pages/person-cell-BmjbADBz.js +564 -0
- package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
- package/dist/pages/plan-card-DRaA6RuB.js +621 -0
- package/dist/pages/plan-card-DtloWvMh.js +258 -0
- package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
- package/dist/pages/plan-grid-BCPvtP8J.js +251 -0
- package/dist/pages/point-list-BbPmZjsm.js +222 -0
- package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
- package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
- package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
- package/dist/pages/price-CRBLoa9h.js +604 -0
- package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
- package/dist/pages/print-page-BkLv6bW8.js +513 -0
- package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
- package/dist/pages/progress-CP_awmo4.js +904 -0
- package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
- package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-CbiibLwn.js} +581 -18
- package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
- package/dist/pages/rating-CweKN2SX.js +471 -0
- package/dist/pages/record-layout-DUP_X0RL.js +719 -0
- package/dist/pages/record-pager-y9D7JFgb.js +278 -0
- package/dist/pages/registry-CNR7zpf7.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.js} +4 -1
- package/dist/pages/repeater-BRZYKRQa.js +1351 -0
- package/dist/pages/reply-feedback-BDnHprla.js +192 -0
- package/dist/pages/reveal-BygENBbL.js +460 -0
- package/dist/pages/rich-text-DOFQZEpT.js +156 -0
- package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
- package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
- package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
- package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
- package/dist/pages/rule-list-DTCmIMpT.js +648 -0
- package/dist/pages/save-status-B5KkyMZP.js +378 -0
- package/dist/pages/schedule-YycI95O1.js +243 -0
- package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
- package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
- package/dist/pages/search-menu-DMuXyUUW.js +580 -0
- package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
- package/dist/pages/section-rail-BtTCETS5.js +637 -0
- package/dist/pages/section-v2Pubup9.js +639 -0
- package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
- package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
- package/dist/pages/share-list-D4wgBxKN.js +926 -0
- package/dist/pages/side-panel-CCtkrZjs.js +811 -0
- package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
- package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
- package/dist/pages/skip-link-BxznhSkz.js +252 -0
- package/dist/pages/slider-CAoPURKD.js +774 -0
- package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
- package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
- package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
- package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
- package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
- package/dist/pages/split-bar-DYgZnFID.js +414 -0
- package/dist/pages/split-button-Be08-VI-.js +335 -0
- package/dist/pages/split-pane-lSNZgTKt.js +523 -0
- package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
- package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
- package/dist/pages/status-dot-D99gAGsV.js +567 -0
- package/dist/pages/stepper-CxKTbEA-.js +1093 -0
- package/dist/pages/success-mark-CqFTOBEu.js +142 -0
- package/dist/pages/swatch-H_kNvHuC.js +565 -0
- package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
- package/dist/pages/table-mq_pNXza.js +3232 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -21
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
- package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
- package/dist/pages/time-input-CA9-uZAa.js +442 -0
- package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
- package/dist/pages/timeline-BsMUTlpR.js +1798 -0
- package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
- package/dist/pages/translation-field-CTRXiF2N.js +251 -0
- package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
- package/dist/pages/tree-select-DU1qXHy_.js +492 -0
- package/dist/pages/tree-view-g_RjLtAb.js +739 -0
- package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
- package/dist/pages/unit-input-Dml4fjmK.js +659 -0
- package/dist/pages/upload-rules-yozEzSah.js +419 -0
- package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
- package/dist/pages/value-change-CnubDKyO.js +489 -0
- package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
- package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
- package/dist/pages/working-status-CENemSsw.js +389 -0
- package/manifest.json +10989 -1108
- package/package.json +3 -3
- package/dist/pages/card-DUggbis3.js +0 -659
- package/dist/pages/checkbox-DwimQaK3.js +0 -365
- package/dist/pages/dialog-BRAf4LMh.js +0 -1451
- package/dist/pages/empty-state-C-mLrXW2.js +0 -417
- package/dist/pages/input-KF9Gkawf.js +0 -1093
- package/dist/pages/registry-CroHzK9I.js +0 -244
- package/dist/pages/skeleton-DLuBhP46.js +0 -561
- package/dist/pages/table-AMoODng4.js +0 -607
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { t as Playground } from "./Playground-Mk1yIWXb.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Alert, Button, CodeBlock } from "@orbitcommerce/constellation";
|
|
7
|
+
//#region src/pages/components/code-block.tsx
|
|
8
|
+
var CURL = `curl https://api.harbourdesk.example/v1/orders \\
|
|
9
|
+
-H "Authorization: Bearer sk_live_51Hx9kQ2eZvKYlo" \\
|
|
10
|
+
-H "Content-Type: application/json"`;
|
|
11
|
+
var CONFIG = `{
|
|
12
|
+
"mcpServers": {
|
|
13
|
+
"harbour-desk": {
|
|
14
|
+
"command": "npx",
|
|
15
|
+
"args": ["-y", "@harbourdesk/mcp"],
|
|
16
|
+
"env": {
|
|
17
|
+
"HARBOUR_API_KEY": "hd_live_YOUR_KEY",
|
|
18
|
+
"HARBOUR_STORE_ID": "915d996f-2582-46a4-8919"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}`;
|
|
23
|
+
var KEY = "sk_live_51Hx9kQ2eZvKYloM7nR4tBw8cXpA3dFg";
|
|
24
|
+
var LONG = `curl -X POST https://api.harbourdesk.example/v1/webhooks -H "Authorization: Bearer ${KEY}" -H "Content-Type: application/json" -d '{"topic":"orders/created","url":"https://hooks.example.com/orders"}'`;
|
|
25
|
+
var BACKUP_CODES = [
|
|
26
|
+
"4F7K-92QD",
|
|
27
|
+
"H2WM-7C3P",
|
|
28
|
+
"Z8RN-5T1L",
|
|
29
|
+
"Q6BG-3XYD",
|
|
30
|
+
"K9PD-4A2M",
|
|
31
|
+
"W3JH-8N6C",
|
|
32
|
+
"T7VC-1R5X",
|
|
33
|
+
"M4ZQ-9K2B",
|
|
34
|
+
"B6XL-2W8F",
|
|
35
|
+
"D5NP-7Y3Q"
|
|
36
|
+
];
|
|
37
|
+
function Preview() {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
style: { width: 236 },
|
|
40
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
41
|
+
code: "curl -X POST \\\n -d '{\"ok\":true}'",
|
|
42
|
+
size: "sm"
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var PLAYGROUND = [
|
|
47
|
+
{
|
|
48
|
+
prop: "variant",
|
|
49
|
+
type: "select",
|
|
50
|
+
options: ["block", "inline"],
|
|
51
|
+
default: "block",
|
|
52
|
+
toAttr: (v) => v === "block" ? null : "variant=\"inline\""
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
prop: "size",
|
|
56
|
+
type: "select",
|
|
57
|
+
options: ["sm", "md"],
|
|
58
|
+
default: "sm",
|
|
59
|
+
toAttr: () => null
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
prop: "language",
|
|
63
|
+
type: "text",
|
|
64
|
+
default: ""
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
prop: "wrap",
|
|
68
|
+
type: "boolean",
|
|
69
|
+
default: true,
|
|
70
|
+
toAttr: (v) => v ? null : "wrap={false}"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
prop: "copyable",
|
|
74
|
+
type: "boolean",
|
|
75
|
+
default: true,
|
|
76
|
+
toAttr: (v) => v ? null : "copyable={false}"
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
function Page() {
|
|
80
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
81
|
+
title: "Code block",
|
|
82
|
+
status: "new",
|
|
83
|
+
importNames: ["CodeBlock"],
|
|
84
|
+
lead: "A snippet, a command or a secret in monospace on a sunken well, with a button to copy it. Long lines wrap so a key is never cut off. It shows the text exactly as it will be copied, with no highlighting.",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
87
|
+
id: "playground",
|
|
88
|
+
title: "Playground",
|
|
89
|
+
description: /* @__PURE__ */ jsx("p", { children: "Press the button and paste somewhere: the whole snippet is copied, line breaks and all." }),
|
|
90
|
+
children: /* @__PURE__ */ jsx(Playground, {
|
|
91
|
+
component: "CodeBlock",
|
|
92
|
+
controls: PLAYGROUND,
|
|
93
|
+
extraCode: (v) => {
|
|
94
|
+
const inline = v.variant === "inline";
|
|
95
|
+
return [inline ? "code={apiKey}" : "code={snippet}", ...v.size === (inline ? "md" : "sm") ? [] : [`size="${v.size}"`]];
|
|
96
|
+
},
|
|
97
|
+
render: (v) => /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "code-block-stage",
|
|
99
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
100
|
+
code: v.variant === "inline" ? KEY : CURL,
|
|
101
|
+
variant: v.variant,
|
|
102
|
+
size: v.size,
|
|
103
|
+
language: String(v.language) || void 0,
|
|
104
|
+
wrap: Boolean(v.wrap),
|
|
105
|
+
copyable: Boolean(v.copyable)
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
111
|
+
id: "block",
|
|
112
|
+
title: "A command or a config",
|
|
113
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
114
|
+
"A block keeps its line breaks and indentation, and wraps a line that is too long. The copy button sits at the top right and stays there while the code runs down. 12px Geist Mono on a 16px line: the size of a command. Name the snippet with ",
|
|
115
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
116
|
+
" (the copy button is then \"Copy First request\") and, if it helps, its language in ",
|
|
117
|
+
/* @__PURE__ */ jsx("code", { children: "language" }),
|
|
118
|
+
"."
|
|
119
|
+
] }),
|
|
120
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
121
|
+
align: "fill",
|
|
122
|
+
code: `
|
|
123
|
+
<CodeBlock
|
|
124
|
+
label="First request"
|
|
125
|
+
code={\`curl https://api.harbourdesk.example/v1/orders \\\\
|
|
126
|
+
-H "Authorization: Bearer sk_live_51Hx9kQ2eZvKYlo"\`}
|
|
127
|
+
/>`,
|
|
128
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
129
|
+
className: "code-block-stack",
|
|
130
|
+
children: [/* @__PURE__ */ jsx(CodeBlock, {
|
|
131
|
+
label: "First request",
|
|
132
|
+
code: CURL
|
|
133
|
+
}), /* @__PURE__ */ jsx(CodeBlock, {
|
|
134
|
+
label: "Connect an assistant",
|
|
135
|
+
language: "json",
|
|
136
|
+
code: CONFIG
|
|
137
|
+
})]
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
142
|
+
id: "inline",
|
|
143
|
+
title: "A key or a URL",
|
|
144
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "variant=\"inline\"" }), " is one value on one line: a key, a signing secret, an address. 14px, the button centred beside it, and a click selects all of it. A key that is longer than the box breaks where it must rather than being cut off."] }),
|
|
145
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
146
|
+
align: "fill",
|
|
147
|
+
code: `
|
|
148
|
+
<CodeBlock variant="inline" label="API key" code={apiKey} />
|
|
149
|
+
<Alert tone="warning" size="sm">Copy it now. You will not be able to see it again.</Alert>`,
|
|
150
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
151
|
+
className: "code-block-stack",
|
|
152
|
+
children: [/* @__PURE__ */ jsx(CodeBlock, {
|
|
153
|
+
variant: "inline",
|
|
154
|
+
label: "API key",
|
|
155
|
+
code: KEY
|
|
156
|
+
}), /* @__PURE__ */ jsx(Alert, {
|
|
157
|
+
tone: "warning",
|
|
158
|
+
size: "sm",
|
|
159
|
+
children: "Copy it now. You will not be able to see it again."
|
|
160
|
+
})]
|
|
161
|
+
})
|
|
162
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
163
|
+
title: "A secret shown once",
|
|
164
|
+
children: "Put the value in a code block, say plainly that it will not be shown again, and use a dialog that cannot be closed by clicking outside it. Never a toast: it is gone before it is copied."
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
168
|
+
id: "wrap",
|
|
169
|
+
title: "Wrapping and scrolling",
|
|
170
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
171
|
+
"Wrapping is on, so a long command folds between its words and nothing is hidden; a word too long for the line, such as a key or a URL, breaks where it must. Turn it off with",
|
|
172
|
+
" ",
|
|
173
|
+
/* @__PURE__ */ jsxs("code", { children: ["wrap=", "{false}"] }),
|
|
174
|
+
" for a command that reads better on one line; it then scrolls sideways, and the block takes the keyboard so the arrow keys scroll it. ",
|
|
175
|
+
/* @__PURE__ */ jsx("code", { children: "maxHeight" }),
|
|
176
|
+
" keeps a long file from pushing the page down: the code scrolls inside it."
|
|
177
|
+
] }),
|
|
178
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
179
|
+
align: "fill",
|
|
180
|
+
code: `
|
|
181
|
+
<CodeBlock code={command} />
|
|
182
|
+
<CodeBlock wrap={false} label="Create a webhook" code={command} />
|
|
183
|
+
<CodeBlock maxHeight={96} label="Config" code={config} />`,
|
|
184
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
185
|
+
className: "code-block-stack",
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsx(CodeBlock, { code: LONG }),
|
|
188
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
189
|
+
wrap: false,
|
|
190
|
+
label: "Create a webhook",
|
|
191
|
+
code: LONG
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
194
|
+
maxHeight: 96,
|
|
195
|
+
label: "Config",
|
|
196
|
+
code: CONFIG
|
|
197
|
+
})
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
203
|
+
id: "list",
|
|
204
|
+
title: "A list of codes",
|
|
205
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
206
|
+
/* @__PURE__ */ jsx("code", { children: "variant=\"list\"" }),
|
|
207
|
+
" is a numbered grid of short codes shown together: backup codes for two-step sign-in, recovery keys, licence keys. Each code is a cell of its own, selectable in one click, and one Copy all button copies them all, one per line. ",
|
|
208
|
+
/* @__PURE__ */ jsx("code", { children: "columns" }),
|
|
209
|
+
" sets the grid: 2 by default, 3 or 4 in a wider space, and one column at phone width."
|
|
210
|
+
] }),
|
|
211
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
212
|
+
align: "fill",
|
|
213
|
+
code: `
|
|
214
|
+
<CodeBlock variant="list" label="Backup codes" codes={backupCodes} />
|
|
215
|
+
|
|
216
|
+
<CodeBlock variant="list" label="Backup codes" codes={backupCodes} columns={3} />`,
|
|
217
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
218
|
+
className: "code-block-stack",
|
|
219
|
+
children: [/* @__PURE__ */ jsx(CodeBlock, {
|
|
220
|
+
variant: "list",
|
|
221
|
+
label: "Backup codes",
|
|
222
|
+
codes: BACKUP_CODES
|
|
223
|
+
}), /* @__PURE__ */ jsx(CodeBlock, {
|
|
224
|
+
variant: "list",
|
|
225
|
+
label: "Backup codes",
|
|
226
|
+
codes: BACKUP_CODES,
|
|
227
|
+
columns: 3
|
|
228
|
+
})]
|
|
229
|
+
})
|
|
230
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
231
|
+
title: "Codes shown once",
|
|
232
|
+
children: "Say plainly, in the copy around the codes, that they will not be shown again and to save them now. The list copies all of them in one press; it does not save them."
|
|
233
|
+
})]
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
236
|
+
id: "saving-codes",
|
|
237
|
+
title: "Saving the codes: copy each, download, done",
|
|
238
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
239
|
+
"Where the codes are shown once (two-step backup codes, passkey recovery), give the list what saving them takes. ",
|
|
240
|
+
/* @__PURE__ */ jsx("code", { children: "copyEach" }),
|
|
241
|
+
" puts a small copy button after every code, named by the code, which turns to a tick. ",
|
|
242
|
+
/* @__PURE__ */ jsx("code", { children: "download" }),
|
|
243
|
+
" (a file name) adds Download, which saves the codes as a text file: the title (",
|
|
244
|
+
/* @__PURE__ */ jsx("code", { children: "downloadTitle" }),
|
|
245
|
+
", else the ",
|
|
246
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
247
|
+
"), \"Generated:\" and the date (",
|
|
248
|
+
/* @__PURE__ */ jsx("code", { children: "generatedLabel" }),
|
|
249
|
+
", British English by default), your ",
|
|
250
|
+
/* @__PURE__ */ jsx("code", { children: "downloadNotes" }),
|
|
251
|
+
", then the codes numbered one to a line."
|
|
252
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "actions" }), " sets controls of your own after them, \"I've saved them\" or \"Done\". With a Download or actions, Copy all moves from the corner into that row as a labelled button that turns to \"Copied\"."] })] }),
|
|
253
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
254
|
+
align: "fill",
|
|
255
|
+
code: `
|
|
256
|
+
<CodeBlock
|
|
257
|
+
variant="list"
|
|
258
|
+
label="Backup codes"
|
|
259
|
+
codes={backupCodes}
|
|
260
|
+
copyEach
|
|
261
|
+
download="harbour-desk-backup-codes.txt"
|
|
262
|
+
downloadTitle="Harbour Desk Co: two-step backup codes"
|
|
263
|
+
downloadNotes={['Each code can only be used once.', 'Keep these codes in a safe place.']}
|
|
264
|
+
actions={<Button variant="primary" size="sm" onClick={done}>I've saved them</Button>}
|
|
265
|
+
/>`,
|
|
266
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
267
|
+
className: "code-block-stack",
|
|
268
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
269
|
+
variant: "list",
|
|
270
|
+
label: "Backup codes",
|
|
271
|
+
codes: BACKUP_CODES,
|
|
272
|
+
copyEach: true,
|
|
273
|
+
download: "harbour-desk-backup-codes.txt",
|
|
274
|
+
downloadTitle: "Harbour Desk Co: two-step backup codes",
|
|
275
|
+
downloadNotes: ["Each code can only be used once.", "Keep these codes in a safe place."],
|
|
276
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
277
|
+
variant: "primary",
|
|
278
|
+
size: "sm",
|
|
279
|
+
children: "I've saved them"
|
|
280
|
+
})
|
|
281
|
+
})
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
286
|
+
id: "states",
|
|
287
|
+
title: "States",
|
|
288
|
+
description: /* @__PURE__ */ jsx("p", { children: "A block, one value, one that scrolls sideways and one with a height limit (both are tab stops), with no copy button (for code someone only reads) and with a language, in both themes. The well is the Well surface in light and in dark; nothing else draws an edge." }),
|
|
289
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
290
|
+
align: "fill",
|
|
291
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
292
|
+
className: "code-block-states",
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ jsx(CodeBlock, { code: CURL }),
|
|
295
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
296
|
+
variant: "inline",
|
|
297
|
+
code: KEY
|
|
298
|
+
}),
|
|
299
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
300
|
+
code: "{ \"ok\": true }",
|
|
301
|
+
copyable: false,
|
|
302
|
+
language: "json"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
305
|
+
variant: "inline",
|
|
306
|
+
size: "sm",
|
|
307
|
+
code: "ERR-7F3A2C1D"
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
310
|
+
wrap: false,
|
|
311
|
+
label: "Create a webhook",
|
|
312
|
+
code: LONG
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
315
|
+
maxHeight: 96,
|
|
316
|
+
label: "Config",
|
|
317
|
+
code: CONFIG
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
324
|
+
id: "guidelines",
|
|
325
|
+
title: "Guidelines",
|
|
326
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
327
|
+
do: {
|
|
328
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
329
|
+
className: "code-block-narrow",
|
|
330
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
331
|
+
variant: "inline",
|
|
332
|
+
size: "sm",
|
|
333
|
+
label: "API key",
|
|
334
|
+
code: "sk_live_51Hx9kQ2e"
|
|
335
|
+
})
|
|
336
|
+
}),
|
|
337
|
+
caption: "Show the whole value exactly as it will be copied, with a button that says what it copies."
|
|
338
|
+
},
|
|
339
|
+
dont: {
|
|
340
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
341
|
+
className: "code-block-narrow",
|
|
342
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
343
|
+
variant: "inline",
|
|
344
|
+
size: "sm",
|
|
345
|
+
label: "API key",
|
|
346
|
+
code: "sk_live_••••••••••••"
|
|
347
|
+
})
|
|
348
|
+
}),
|
|
349
|
+
caption: "Do not show dots and copy something else. What is shown and what is copied are the same text."
|
|
350
|
+
}
|
|
351
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
352
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
353
|
+
"A code block is for text people paste into a terminal, a config or another app. For a value in a form, use a",
|
|
354
|
+
" ",
|
|
355
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
356
|
+
to: "/components/copy-field",
|
|
357
|
+
children: "Copy field"
|
|
358
|
+
}),
|
|
359
|
+
"."
|
|
360
|
+
] }),
|
|
361
|
+
"Keep snippets short and runnable. A command with placeholders in capitals (YOUR_KEY) says what to replace.",
|
|
362
|
+
"There is no syntax highlighting: colour belongs to marks, and a highlighted block cannot be told apart from what is copied.",
|
|
363
|
+
/* @__PURE__ */ jsx(Fragment, { children: "The label names a snippet for assistive tech; the language is a quiet word above a block. Neither is a heading: put the heading above the block." }),
|
|
364
|
+
"Codes shown once (backup codes, a recovery key) should say so in the copy around them: that they will not be shown again, and to save them before leaving the page."
|
|
365
|
+
] })]
|
|
366
|
+
}),
|
|
367
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
368
|
+
id: "accessibility",
|
|
369
|
+
title: "Accessibility",
|
|
370
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
371
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
372
|
+
"The code is real text in a ",
|
|
373
|
+
/* @__PURE__ */ jsx("code", { children: "pre" }),
|
|
374
|
+
" and a ",
|
|
375
|
+
/* @__PURE__ */ jsx("code", { children: "code" }),
|
|
376
|
+
" (an inline value is a single",
|
|
377
|
+
" ",
|
|
378
|
+
/* @__PURE__ */ jsx("code", { children: "code" }),
|
|
379
|
+
"), so it can be selected, searched and read by a screen reader exactly as it is."
|
|
380
|
+
] }),
|
|
381
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
382
|
+
"A block that scrolls (wrapping off, or a ",
|
|
383
|
+
/* @__PURE__ */ jsx("code", { children: "maxHeight" }),
|
|
384
|
+
") is a tab stop with a focus ring, so a keyboard can scroll it, and a named group: its ",
|
|
385
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
386
|
+
", else its ",
|
|
387
|
+
/* @__PURE__ */ jsx("code", { children: "language" }),
|
|
388
|
+
", else \"Code\" (",
|
|
389
|
+
/* @__PURE__ */ jsx("code", { children: "codeLabel" }),
|
|
390
|
+
" changes that word). One that does not scroll is not a tab stop."
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
393
|
+
"The copy button is named \"Copy\" and then the ",
|
|
394
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
395
|
+
" (or the ",
|
|
396
|
+
/* @__PURE__ */ jsx("code", { children: "language" }),
|
|
397
|
+
"): \"Copy API key\", so several on a page tell each other apart. ",
|
|
398
|
+
/* @__PURE__ */ jsx("code", { children: "copyLabel" }),
|
|
399
|
+
" replaces the whole name, and a function builds it in your language from the label (or language). The result is said in a polite live region, \"Copied\" or \"Could not copy\"."
|
|
400
|
+
] }),
|
|
401
|
+
"Text holds 17:1 against the well in light and in dark, the language label 5:1 or more, and the copy glyph 6.8:1 or more.",
|
|
402
|
+
"Nothing moves: only the copy button's tick pops in, and under reduced motion it fades."
|
|
403
|
+
] })
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ jsx(Fragment, {}),
|
|
406
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
407
|
+
id: "props",
|
|
408
|
+
title: "Props",
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
411
|
+
title: "A block or an inline value",
|
|
412
|
+
rows: [
|
|
413
|
+
{
|
|
414
|
+
name: "code",
|
|
415
|
+
type: "string",
|
|
416
|
+
required: true,
|
|
417
|
+
description: "The text to show and copy, exactly as it is."
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "variant",
|
|
421
|
+
type: "'block' | 'inline'",
|
|
422
|
+
default: "'block'",
|
|
423
|
+
description: "A snippet of one or more lines, or a single value with the button centred beside it."
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "size",
|
|
427
|
+
type: "'sm' | 'md'",
|
|
428
|
+
default: "sm for a block, md for inline",
|
|
429
|
+
description: "12px for commands and config, 14px for keys."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "language",
|
|
433
|
+
type: "string",
|
|
434
|
+
description: "A quiet label above a block: \"bash\", \"json\". Names the copy button and the box that scrolls when there is no label."
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "label",
|
|
438
|
+
type: "string",
|
|
439
|
+
description: "What the snippet is, for assistive tech: \"API key\", \"curl example\". Names the block (or the box that scrolls) and the copy button: \"Copy API key\"."
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: "wrap",
|
|
443
|
+
type: "boolean",
|
|
444
|
+
default: "true",
|
|
445
|
+
description: "Wraps long lines, breaking a long key anywhere. false keeps each line whole and scrolls sideways."
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "maxHeight",
|
|
449
|
+
type: "number",
|
|
450
|
+
description: "Limits the height in px; the code scrolls inside it."
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: "copyable",
|
|
454
|
+
type: "boolean",
|
|
455
|
+
default: "true",
|
|
456
|
+
description: "Shows the copy button."
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "copyLabel",
|
|
460
|
+
type: "string | (what?: string) => string",
|
|
461
|
+
default: "'Copy' and the label",
|
|
462
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
463
|
+
"The copy button's whole name and tooltip. Left out, it is \"Copy\" and then the label (or the language). A function builds the name in your language and is given the label, else the language, else undefined: ",
|
|
464
|
+
/* @__PURE__ */ jsx("code", { children: "(what) => (what ? `Copier ${what}` : 'Copier')" }),
|
|
465
|
+
"."
|
|
466
|
+
] })
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: "codeLabel",
|
|
470
|
+
type: "string",
|
|
471
|
+
default: "'Code'",
|
|
472
|
+
description: "The name of the box that scrolls when there is neither a label nor a language."
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "copiedLabel, failedLabel",
|
|
476
|
+
type: "string",
|
|
477
|
+
default: "'Copied', 'Could not copy'",
|
|
478
|
+
description: "Said once it is copied, or when the browser would not."
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "onCopied",
|
|
482
|
+
type: "(code: string) => void",
|
|
483
|
+
description: "Called with the code once it is on the clipboard. It is called even if the block has gone by then (a panel that closed on the press, say), so leave alone anything that closed with it."
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: "onCopyFailed",
|
|
487
|
+
type: "() => void",
|
|
488
|
+
description: "Called when it could not be copied. Like onCopied, it is still called if the block has gone by then."
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
}),
|
|
492
|
+
/* @__PURE__ */ jsxs("p", {
|
|
493
|
+
className: "doc-section__description",
|
|
494
|
+
children: [
|
|
495
|
+
"Other attributes (",
|
|
496
|
+
/* @__PURE__ */ jsx("code", { children: "className" }),
|
|
497
|
+
", ",
|
|
498
|
+
/* @__PURE__ */ jsx("code", { children: "style" }),
|
|
499
|
+
", ",
|
|
500
|
+
/* @__PURE__ */ jsx("code", { children: "data-*" }),
|
|
501
|
+
") and the ",
|
|
502
|
+
/* @__PURE__ */ jsx("code", { children: "ref" }),
|
|
503
|
+
" go to the well. A block or an inline value always takes ",
|
|
504
|
+
/* @__PURE__ */ jsx("code", { children: "code" }),
|
|
505
|
+
"."
|
|
506
|
+
]
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
509
|
+
title: "A list of codes",
|
|
510
|
+
rows: [
|
|
511
|
+
{
|
|
512
|
+
name: "codes",
|
|
513
|
+
type: "string[]",
|
|
514
|
+
required: true,
|
|
515
|
+
description: "The codes, one per grid cell."
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
name: "variant",
|
|
519
|
+
type: "'list'",
|
|
520
|
+
required: true,
|
|
521
|
+
description: "A numbered grid of the codes with one Copy all that copies them one per line."
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
name: "columns",
|
|
525
|
+
type: "1 | 2 | 3 | 4",
|
|
526
|
+
default: "2",
|
|
527
|
+
description: "Grid columns: 1, 2, 3 or 4. One column at phone width."
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "copyAllLabel",
|
|
531
|
+
type: "string",
|
|
532
|
+
default: "'Copy all'",
|
|
533
|
+
description: "The Copy all button's name and tooltip."
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "copyEach",
|
|
537
|
+
type: "boolean",
|
|
538
|
+
default: "false",
|
|
539
|
+
description: "A small copy button after each code, which copies it alone and turns to a tick."
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: "copyCodeLabel",
|
|
543
|
+
type: "(code: string) => string",
|
|
544
|
+
default: "'Copy ' + code",
|
|
545
|
+
description: "Each code's copy button's name."
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: "download",
|
|
549
|
+
type: "string",
|
|
550
|
+
description: "A file name: adds Download, which saves the codes as a numbered text file."
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "downloadLabel",
|
|
554
|
+
type: "string",
|
|
555
|
+
default: "'Download'",
|
|
556
|
+
description: "The Download button's words."
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: "downloadTitle",
|
|
560
|
+
type: "string",
|
|
561
|
+
default: "label, else 'Codes'",
|
|
562
|
+
description: "The file's first line."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "downloadNotes",
|
|
566
|
+
type: "string[]",
|
|
567
|
+
description: "Lines under the date, before the codes."
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
name: "generatedLabel",
|
|
571
|
+
type: "(date: Date) => string",
|
|
572
|
+
default: "'Generated: 15 October 2026'",
|
|
573
|
+
description: "The file's second line, from the moment it is saved."
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "onDownload",
|
|
577
|
+
type: "(fileName: string) => void",
|
|
578
|
+
description: "Called once the file has been handed to the browser."
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: "actions",
|
|
582
|
+
type: "ReactNode",
|
|
583
|
+
description: "Controls of your own after Copy all and Download, in a row under the codes. With them (or download) Copy all is a labelled button in that row."
|
|
584
|
+
}
|
|
585
|
+
]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ jsxs("p", {
|
|
588
|
+
className: "doc-section__description",
|
|
589
|
+
children: [
|
|
590
|
+
"A list shares the props above except ",
|
|
591
|
+
/* @__PURE__ */ jsx("code", { children: "code" }),
|
|
592
|
+
", ",
|
|
593
|
+
/* @__PURE__ */ jsx("code", { children: "wrap" }),
|
|
594
|
+
" and ",
|
|
595
|
+
/* @__PURE__ */ jsx("code", { children: "maxHeight" }),
|
|
596
|
+
", which it does not use: ",
|
|
597
|
+
/* @__PURE__ */ jsx("code", { children: "size" }),
|
|
598
|
+
", ",
|
|
599
|
+
/* @__PURE__ */ jsx("code", { children: "language" }),
|
|
600
|
+
", ",
|
|
601
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
602
|
+
", ",
|
|
603
|
+
/* @__PURE__ */ jsx("code", { children: "copyable" }),
|
|
604
|
+
",",
|
|
605
|
+
" ",
|
|
606
|
+
/* @__PURE__ */ jsx("code", { children: "copiedLabel" }),
|
|
607
|
+
", ",
|
|
608
|
+
/* @__PURE__ */ jsx("code", { children: "failedLabel" }),
|
|
609
|
+
", ",
|
|
610
|
+
/* @__PURE__ */ jsx("code", { children: "onCopied" }),
|
|
611
|
+
" and ",
|
|
612
|
+
/* @__PURE__ */ jsx("code", { children: "onCopyFailed" }),
|
|
613
|
+
" all work."
|
|
614
|
+
]
|
|
615
|
+
})
|
|
616
|
+
]
|
|
617
|
+
})
|
|
618
|
+
]
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
//#endregion
|
|
622
|
+
export { Page, Preview };
|