@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,511 @@
|
|
|
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 { CopyField, Field } from "@orbitcommerce/constellation";
|
|
7
|
+
//#region src/pages/components/copy-field.tsx
|
|
8
|
+
var INVITE = "https://app.harbourdesk.example/invite/9f3a2c71";
|
|
9
|
+
var SETUP_KEY = "JBSWY3DPEHPK3PXP";
|
|
10
|
+
var SECRET = "whsec_4f9a1c2e7b8d3a56e0c1";
|
|
11
|
+
function Preview() {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
style: { width: 232 },
|
|
14
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
15
|
+
"aria-label": "Invitation link",
|
|
16
|
+
value: INVITE,
|
|
17
|
+
size: "sm"
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var PLAYGROUND = [
|
|
22
|
+
{
|
|
23
|
+
prop: "action",
|
|
24
|
+
type: "select",
|
|
25
|
+
options: ["icon", "button"],
|
|
26
|
+
default: "icon",
|
|
27
|
+
toAttr: (v) => v === "icon" ? null : "action=\"button\""
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
prop: "mono",
|
|
31
|
+
type: "boolean",
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
prop: "masked",
|
|
36
|
+
type: "boolean",
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
prop: "size",
|
|
41
|
+
type: "select",
|
|
42
|
+
options: [
|
|
43
|
+
"sm",
|
|
44
|
+
"md",
|
|
45
|
+
"lg"
|
|
46
|
+
],
|
|
47
|
+
default: "md"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
prop: "disabled",
|
|
51
|
+
type: "boolean",
|
|
52
|
+
default: false
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
/** A secret the page does not hold: fetched on the first reveal or copy, after a short wait that stands in for the request. */
|
|
56
|
+
var fetchSecret = () => new Promise((resolve) => setTimeout(() => resolve("whsec_4f9b2c7e1a5d83"), 900));
|
|
57
|
+
function Page() {
|
|
58
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
59
|
+
title: "Copy field",
|
|
60
|
+
status: "new",
|
|
61
|
+
importNames: ["CopyField"],
|
|
62
|
+
lead: "A value to read and copy, never to type: an invitation link, an API key, a two-factor setup key. A read-only field that selects all of its value when you focus it, with a button to copy it that says Copied and says so plainly when the browser would not.",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
65
|
+
id: "playground",
|
|
66
|
+
title: "Playground",
|
|
67
|
+
description: /* @__PURE__ */ jsx("p", { children: "Press the button and paste somewhere. Click into the field: its whole value is selected, so a keyboard can copy it by hand." }),
|
|
68
|
+
children: /* @__PURE__ */ jsx(Playground, {
|
|
69
|
+
component: "CopyField",
|
|
70
|
+
controls: PLAYGROUND,
|
|
71
|
+
extraCode: (v) => v.action === "button" ? ["value={link}", "copyLabel=\"Copy link\""] : ["value={link}"],
|
|
72
|
+
render: (v) => /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "cf-stage",
|
|
74
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
75
|
+
label: "Invitation link",
|
|
76
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
77
|
+
value: INVITE,
|
|
78
|
+
action: v.action,
|
|
79
|
+
copyLabel: v.action === "button" ? "Copy link" : "Copy",
|
|
80
|
+
mono: Boolean(v.mono),
|
|
81
|
+
masked: Boolean(v.masked),
|
|
82
|
+
size: v.size,
|
|
83
|
+
disabled: Boolean(v.disabled)
|
|
84
|
+
}, String(v.action))
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
90
|
+
id: "link",
|
|
91
|
+
title: "A link with a labelled button",
|
|
92
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
93
|
+
"When copying is the point of the field, the button says so: ",
|
|
94
|
+
/* @__PURE__ */ jsx("code", { children: "action=\"button\"" }),
|
|
95
|
+
" puts a secondary button with words beside the field, the same height, 12px away. The icon turns to a tick and the words stay where they are, so nothing shifts and the button keeps its name. This is the vendor dashboard's referral link and invitation link."
|
|
96
|
+
] }),
|
|
97
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
98
|
+
align: "fill",
|
|
99
|
+
code: `
|
|
100
|
+
<Field label="Invitation link" hint="Anyone with the link can join your team">
|
|
101
|
+
<CopyField action="button" copyLabel="Copy link" value={acceptUrl} />
|
|
102
|
+
</Field>`,
|
|
103
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
104
|
+
className: "cf-stack",
|
|
105
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
106
|
+
label: "Invitation link",
|
|
107
|
+
hint: "Anyone with the link can join your team",
|
|
108
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
109
|
+
action: "button",
|
|
110
|
+
copyLabel: "Copy link",
|
|
111
|
+
value: INVITE
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
118
|
+
id: "key",
|
|
119
|
+
title: "A key with an icon",
|
|
120
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
121
|
+
"The default is an icon button inside the end of the field, for a value that is copied now and then: a two-factor setup key, a tracking number. ",
|
|
122
|
+
/* @__PURE__ */ jsx("code", { children: "mono" }),
|
|
123
|
+
" sets the value in the monospace face, which keeps the characters of a key apart (an O from a 0, an l from a 1) and never turns two of them into one (no ligatures). In a Field the button is named \"Copy\" and then the field's label, so leave",
|
|
124
|
+
" ",
|
|
125
|
+
/* @__PURE__ */ jsx("code", { children: "copyLabel" }),
|
|
126
|
+
" alone: the label finishes the name, \"Copy Setup key\"."
|
|
127
|
+
] }),
|
|
128
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
129
|
+
align: "fill",
|
|
130
|
+
code: `
|
|
131
|
+
<Field label="Setup key" hint="Or enter this key in your authenticator app">
|
|
132
|
+
<CopyField mono value={totpSecret} />
|
|
133
|
+
</Field>`,
|
|
134
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: "cf-stack",
|
|
136
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
137
|
+
label: "Setup key",
|
|
138
|
+
hint: "Or enter this key in your authenticator app",
|
|
139
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
140
|
+
mono: true,
|
|
141
|
+
value: SETUP_KEY
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
148
|
+
id: "masked",
|
|
149
|
+
title: "A secret behind an eye",
|
|
150
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "masked" }), " shows dots until the eye is pressed, for a value that should not be on screen while someone shares it. What is copied is always the whole value, hidden or shown, so a secret can be copied without being seen. The eye comes before the copy button and neither takes focus from the field."] }),
|
|
151
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
152
|
+
align: "fill",
|
|
153
|
+
code: `
|
|
154
|
+
<Field label="Signing secret" hint="Keep it private. Use it to check that a request came from us">
|
|
155
|
+
<CopyField mono masked value={secret} />
|
|
156
|
+
</Field>`,
|
|
157
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
158
|
+
className: "cf-stack",
|
|
159
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
160
|
+
label: "Signing secret",
|
|
161
|
+
hint: "Keep it private. Use it to check that a request came from us",
|
|
162
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
163
|
+
mono: true,
|
|
164
|
+
masked: true,
|
|
165
|
+
value: SECRET
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
170
|
+
title: "Masking is not security",
|
|
171
|
+
children: [
|
|
172
|
+
"A masked value is still in the page, and a password manager or the page's code can read it. It keeps a secret off a shared screen; it does not keep it from someone with the device. A secret shown once, when it is created, belongs in a dialog that cannot be dismissed by accident, with the value in a",
|
|
173
|
+
" ",
|
|
174
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
175
|
+
to: "/components/code-block",
|
|
176
|
+
children: "Code block"
|
|
177
|
+
}),
|
|
178
|
+
"."
|
|
179
|
+
]
|
|
180
|
+
})]
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
183
|
+
id: "lazy",
|
|
184
|
+
title: "A secret fetched when it is asked for",
|
|
185
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
186
|
+
/* @__PURE__ */ jsx("code", { children: "loadValue" }),
|
|
187
|
+
" in place of ",
|
|
188
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
189
|
+
" fetches the secret on the first press of the eye or of copy, so the page does not hold it until someone wants it. Until then the field is masked, whatever",
|
|
190
|
+
" ",
|
|
191
|
+
/* @__PURE__ */ jsx("code", { children: "masked" }),
|
|
192
|
+
" says; the button pressed shows it is busy while the value comes. The value is kept once it has come. A fetch that fails leaves the field hidden, says \"Could not load the value\" politely, goes to",
|
|
193
|
+
" ",
|
|
194
|
+
/* @__PURE__ */ jsx("code", { children: "onLoadError" }),
|
|
195
|
+
" (for your toast), and the next press asks again."
|
|
196
|
+
] }),
|
|
197
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
198
|
+
align: "fill",
|
|
199
|
+
code: `
|
|
200
|
+
<Field label="Signing secret">
|
|
201
|
+
<CopyField mono loadValue={() => api.plugins.webhookSecret(pluginId).then((s) => s.secret)} onLoadError={toastError} />
|
|
202
|
+
</Field>`,
|
|
203
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
204
|
+
className: "cf-stack",
|
|
205
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
206
|
+
label: "Signing secret",
|
|
207
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
208
|
+
mono: true,
|
|
209
|
+
loadValue: fetchSecret
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
216
|
+
id: "sizes",
|
|
217
|
+
title: "Sizes",
|
|
218
|
+
description: /* @__PURE__ */ jsx("p", { children: "The field follows an Input: 30, 36 (default) or 44px, and the labelled button follows it, so the two always line up." }),
|
|
219
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
220
|
+
align: "fill",
|
|
221
|
+
code: `
|
|
222
|
+
<CopyField size="sm" value={link} />
|
|
223
|
+
<CopyField value={link} />
|
|
224
|
+
<CopyField size="lg" value={link} />
|
|
225
|
+
|
|
226
|
+
<CopyField size="sm" action="button" copyLabel="Copy link" value={link} />
|
|
227
|
+
<CopyField action="button" copyLabel="Copy link" value={link} />
|
|
228
|
+
<CopyField size="lg" action="button" copyLabel="Copy link" value={link} />`,
|
|
229
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
230
|
+
className: "cf-stack cf-stack--tight",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
233
|
+
"aria-label": "Small",
|
|
234
|
+
size: "sm",
|
|
235
|
+
value: INVITE
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
238
|
+
"aria-label": "Default",
|
|
239
|
+
value: INVITE
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
242
|
+
"aria-label": "Large",
|
|
243
|
+
size: "lg",
|
|
244
|
+
value: INVITE
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
247
|
+
"aria-label": "Small with button",
|
|
248
|
+
size: "sm",
|
|
249
|
+
action: "button",
|
|
250
|
+
copyLabel: "Copy link",
|
|
251
|
+
value: INVITE
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
254
|
+
"aria-label": "Default with button",
|
|
255
|
+
action: "button",
|
|
256
|
+
copyLabel: "Copy link",
|
|
257
|
+
value: INVITE
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
260
|
+
"aria-label": "Large with button",
|
|
261
|
+
size: "lg",
|
|
262
|
+
action: "button",
|
|
263
|
+
copyLabel: "Copy link",
|
|
264
|
+
value: INVITE
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
271
|
+
id: "states",
|
|
272
|
+
title: "States",
|
|
273
|
+
description: /* @__PURE__ */ jsx("p", { children: "A copy field is read-only, so it sinks to the Well; it still takes focus, and hover and focus draw the same hairline and halo as an Input. Disabled dims it and its buttons together. A value longer than the field scrolls inside it; it is whole when copied." }),
|
|
274
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
275
|
+
align: "fill",
|
|
276
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
277
|
+
className: "cf-states",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
280
|
+
"aria-label": "Link",
|
|
281
|
+
value: INVITE
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
284
|
+
"aria-label": "Key",
|
|
285
|
+
mono: true,
|
|
286
|
+
value: SETUP_KEY
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
289
|
+
"aria-label": "Secret",
|
|
290
|
+
mono: true,
|
|
291
|
+
masked: true,
|
|
292
|
+
value: SECRET
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
295
|
+
"aria-label": "Disabled",
|
|
296
|
+
value: INVITE,
|
|
297
|
+
disabled: true
|
|
298
|
+
}),
|
|
299
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
300
|
+
"aria-label": "Long value",
|
|
301
|
+
value: `${INVITE}?utm_source=email&utm_medium=invite&utm_campaign=autumn-team-welcome`
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ jsx(CopyField, {
|
|
304
|
+
"aria-label": "Link with button",
|
|
305
|
+
action: "button",
|
|
306
|
+
copyLabel: "Copy link",
|
|
307
|
+
value: INVITE
|
|
308
|
+
})
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
})
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
314
|
+
id: "guidelines",
|
|
315
|
+
title: "Guidelines",
|
|
316
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
317
|
+
do: {
|
|
318
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
319
|
+
className: "cf-narrow",
|
|
320
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
321
|
+
label: "Invitation link",
|
|
322
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
323
|
+
size: "sm",
|
|
324
|
+
value: INVITE,
|
|
325
|
+
copyLabel: "Copy link"
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
}),
|
|
329
|
+
caption: "A value people copy, in a copy field: one press, and nothing to select by hand."
|
|
330
|
+
},
|
|
331
|
+
dont: {
|
|
332
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
333
|
+
className: "cf-narrow",
|
|
334
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
335
|
+
label: "Invitation link",
|
|
336
|
+
children: /* @__PURE__ */ jsx(CopyField, {
|
|
337
|
+
size: "sm",
|
|
338
|
+
value: INVITE,
|
|
339
|
+
copyLabel: "Copy link",
|
|
340
|
+
disabled: true
|
|
341
|
+
})
|
|
342
|
+
})
|
|
343
|
+
}),
|
|
344
|
+
caption: "Do not disable it to stop edits: it is already read-only, and a disabled field cannot be focused or selected."
|
|
345
|
+
}
|
|
346
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
347
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
348
|
+
"For a value people also need to ",
|
|
349
|
+
/* @__PURE__ */ jsx("em", { children: "change" }),
|
|
350
|
+
", use an ",
|
|
351
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
352
|
+
to: "/components/input",
|
|
353
|
+
children: "Input"
|
|
354
|
+
}),
|
|
355
|
+
" and a button of your own. For a multi-line snippet use ",
|
|
356
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
357
|
+
to: "/components/code-block",
|
|
358
|
+
children: "Code block"
|
|
359
|
+
}),
|
|
360
|
+
"."
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
363
|
+
"Several on a page need telling apart. An icon button is named \"Copy\" and then its field, \"Copy Setup key\", so give each a label. A labelled button says it in its own words, ",
|
|
364
|
+
/* @__PURE__ */ jsx("code", { children: "copyLabel=\"Copy link\"" }),
|
|
365
|
+
"."
|
|
366
|
+
] }),
|
|
367
|
+
"Label the field in the Field around it. The label is the name of the value; the button says what it does.",
|
|
368
|
+
"Keep the confirmation in the button. A toast on top of the tick is two answers to one press.",
|
|
369
|
+
"Show a secret once, on creation, and say so. A copy field is for what stays readable."
|
|
370
|
+
] })]
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
373
|
+
id: "accessibility",
|
|
374
|
+
title: "Accessibility",
|
|
375
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
376
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
377
|
+
"The value is a real, focusable, read-only ",
|
|
378
|
+
/* @__PURE__ */ jsx("code", { children: "input" }),
|
|
379
|
+
", so a screen reader reads it with the Field's label, and it can be selected and copied by hand: focusing it selects all of it."
|
|
380
|
+
] }),
|
|
381
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
382
|
+
"The icon button is named by its words and then the field's label (or its own ",
|
|
383
|
+
/* @__PURE__ */ jsx("code", { children: "aria-label" }),
|
|
384
|
+
"), \"Copy Setup key\", and so is the eye (\"Show value Signing secret\"), so several on a page tell each other apart. The labelled button's name is its visible words."
|
|
385
|
+
] }),
|
|
386
|
+
/* @__PURE__ */ jsx(Fragment, { children: "The result is said, not only shown: a polite live region says \"Copied\" or \"Could not copy\", again on a second press. The button keeps its name while it does." }),
|
|
387
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
388
|
+
"The eye of a masked value says whether it will show or hide. A masked value is a password input, so it is not read aloud while it is hidden; an ",
|
|
389
|
+
/* @__PURE__ */ jsx("code", { children: "aria-live" }),
|
|
390
|
+
" region never reads the value itself."
|
|
391
|
+
] }),
|
|
392
|
+
"Password managers and spelling correctors are told to leave it alone (autocomplete off, no capitals, no correction).",
|
|
393
|
+
"Every part is reached with Tab in reading order: the field, the eye, then the copy button."
|
|
394
|
+
] })
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ jsx(Fragment, {}),
|
|
397
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
398
|
+
id: "props",
|
|
399
|
+
title: "Props",
|
|
400
|
+
children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
401
|
+
{
|
|
402
|
+
name: "value",
|
|
403
|
+
type: "string",
|
|
404
|
+
description: "The value to show and copy, exactly as it is. Leave it out with loadValue."
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "loadValue",
|
|
408
|
+
type: "() => Promise<string>",
|
|
409
|
+
description: "Fetches the value on the first reveal or copy; masked until then, busy while it comes, kept once it has."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "onLoadError",
|
|
413
|
+
type: "(error: unknown) => void",
|
|
414
|
+
description: "Called with the reason when loadValue fails."
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: "loadFailedLabel",
|
|
418
|
+
type: "string",
|
|
419
|
+
default: "'Could not load the value'",
|
|
420
|
+
description: "Said politely when loadValue fails."
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: "action",
|
|
424
|
+
type: "'icon' | 'button'",
|
|
425
|
+
default: "'icon'",
|
|
426
|
+
description: "An icon button inside the end of the field, or a labelled button beside it."
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: "copyLabel",
|
|
430
|
+
type: "string",
|
|
431
|
+
default: "'Copy'",
|
|
432
|
+
description: "The button's name (and the icon's tooltip), or its visible words for action=\"button\"."
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: "copiedLabel",
|
|
436
|
+
type: "string",
|
|
437
|
+
default: "'Copied'",
|
|
438
|
+
description: "Said once the value is on the clipboard."
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "failedLabel",
|
|
442
|
+
type: "string",
|
|
443
|
+
default: "'Could not copy'",
|
|
444
|
+
description: "Said when the browser would not copy it."
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: "mono",
|
|
448
|
+
type: "boolean",
|
|
449
|
+
default: "false",
|
|
450
|
+
description: "The value in the monospace face, at the field's own size."
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: "masked",
|
|
454
|
+
type: "boolean",
|
|
455
|
+
default: "false",
|
|
456
|
+
description: "Dots until the eye is pressed. What is copied is always the whole value."
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "showLabel, hideLabel",
|
|
460
|
+
type: "string",
|
|
461
|
+
default: "'Show value', 'Hide value'",
|
|
462
|
+
description: "The eye's names."
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: "onCopied",
|
|
466
|
+
type: "(value: string) => void",
|
|
467
|
+
description: "Called with the value once it is on the clipboard. It is called even if the field has gone by then (a dialog that closed on the press, say), so leave alone anything that closed with it."
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "onCopyFailed",
|
|
471
|
+
type: "(error?: unknown) => void",
|
|
472
|
+
description: "Called when it could not be copied, with the reason when loadValue failed. Like onCopied, it is still called if the field has gone by then."
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "size",
|
|
476
|
+
type: "'sm' | 'md' | 'lg'",
|
|
477
|
+
default: "'md'",
|
|
478
|
+
description: "The field, and the labelled button, which follows it."
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "disabled",
|
|
482
|
+
type: "boolean",
|
|
483
|
+
description: "Dims the field and its buttons together."
|
|
484
|
+
}
|
|
485
|
+
] }), /* @__PURE__ */ jsxs("p", {
|
|
486
|
+
className: "doc-section__description",
|
|
487
|
+
children: [
|
|
488
|
+
"Every other input attribute, and the ",
|
|
489
|
+
/* @__PURE__ */ jsx("code", { children: "ref" }),
|
|
490
|
+
", go to the ",
|
|
491
|
+
/* @__PURE__ */ jsx("code", { children: "input" }),
|
|
492
|
+
". ",
|
|
493
|
+
/* @__PURE__ */ jsx("code", { children: "className" }),
|
|
494
|
+
" and",
|
|
495
|
+
" ",
|
|
496
|
+
/* @__PURE__ */ jsx("code", { children: "style" }),
|
|
497
|
+
" go to the wrapper around the field and its button. Put it in a",
|
|
498
|
+
" ",
|
|
499
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
500
|
+
to: "/components/input#field",
|
|
501
|
+
children: "Field"
|
|
502
|
+
}),
|
|
503
|
+
" for its label, hint and error."
|
|
504
|
+
]
|
|
505
|
+
})]
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
export { Page, Preview };
|