@orbitcommerce/constellation-docs 0.0.0-stage → 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/LICENSE.md +6 -0
- package/README.md +6 -2
- package/dist/docs.css +20787 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +308 -0
- package/dist/pages/Playground-Mk1yIWXb.js +129 -0
- 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-DaDvB7Nm.js +606 -0
- package/dist/pages/_foundations-blXWyYh8.js +30 -0
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/_overlays-specimens-bawR331Z.js +320 -0
- 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-D3i7xZTU.js +914 -0
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/app-shell-D4hdlHps.js +1558 -0
- package/dist/pages/area-chart-BEWFwiB2.js +718 -0
- package/dist/pages/avatar-BFEqQViw.js +895 -0
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/badge-0-PyMrih.js +1035 -0
- 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-DAyfssDY.js +715 -0
- package/dist/pages/calendar-Ds7KsgSI.js +682 -0
- 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-q2ntvI0w.js +1974 -0
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/command-palette-CJ7uBA04.js +1386 -0
- 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-GdBciR99.js +1569 -0
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/delta-CNAGv8JY.js +779 -0
- 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-lM2UBSir.js +520 -0
- 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-QOeQMY6N.js +578 -0
- 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-CxPmvduE.js +962 -0
- package/dist/pages/host-B6znjEgQ.js +109 -0
- 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-Bu4Gj5sy.js +1200 -0
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/icons-CJ9Aar3d.js +736 -0
- 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-C3UcpQJT.js +528 -0
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/kbd-UNj4zqxn.js +545 -0
- 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-95ROMhGQ.js +715 -0
- 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-B38rnzoq.js +571 -0
- 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-NrLYKqKp.js +2132 -0
- 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-CrXtiBvA.js +865 -0
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/orbit-spinner-Dxv5qAhr.js +348 -0
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/overview-LA9XRhZc.js +130 -0
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/pagination-C1EgVtW4.js +294 -0
- 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-C3Oar9D5.js +1198 -0
- 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-pnDyfHpK.js +483 -0
- 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-C-4tg6FS.js +1639 -0
- 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-Cs6tl16C.js +16 -0
- 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-GR3Cyfpz.js +529 -0
- 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-D1uG7R6A.js +693 -0
- 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-D-FB1K1T.js +1190 -0
- package/dist/pages/select-DZ43NpOm.js +1434 -0
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/separator-CFwqRvfO.js +428 -0
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/shape-DzniHAVT.js +627 -0
- 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-D3aavCly.js +947 -0
- 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-C93K6j9h.js +617 -0
- package/dist/pages/table-CL0vomno.js +3225 -0
- package/dist/pages/tabs-Dh0mUsLw.js +1690 -0
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/textarea-CCM-SnGN.js +949 -0
- 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-zXLRiMRT.js +1391 -0
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/tooltip-LHtCUkF-.js +826 -0
- 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-BSijtiRl.js +876 -0
- 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 +13001 -0
- package/package.json +35 -4
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { d as Section$1, i as DocPage, l as Note, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
3
|
+
import { useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Button, Coachmark, IconTile, SegmentedControl } from "@orbitcommerce/constellation";
|
|
6
|
+
import { ArrowsOutCardinalIcon, SparkleIcon } from "@orbitcommerce/constellation/icons";
|
|
7
|
+
//#region src/pages/components/coachmark.tsx
|
|
8
|
+
function Preview() {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "coachmark-preview",
|
|
11
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: "coachmark-preview__control o-coachmark-target",
|
|
13
|
+
children: "Basic"
|
|
14
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: "o-popover o-coachmark coachmark-preview__sheet",
|
|
16
|
+
"data-padding": "none",
|
|
17
|
+
"data-arrow": "",
|
|
18
|
+
"data-variant": "coachmark",
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "o-coachmark__body",
|
|
21
|
+
children: [/* @__PURE__ */ jsx(IconTile, {
|
|
22
|
+
tone: "accent",
|
|
23
|
+
size: "sm",
|
|
24
|
+
children: /* @__PURE__ */ jsx(SparkleIcon, {})
|
|
25
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: "o-coachmark__text",
|
|
27
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
28
|
+
className: "o-coachmark__title",
|
|
29
|
+
children: "Moving things is in Pro"
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
33
|
+
className: "o-popover__arrow coachmark-preview__arrow",
|
|
34
|
+
viewBox: "0 0 16 8",
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0 0 L8 8 L16 0" })
|
|
37
|
+
})]
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** A storage that lasts as long as the page, so the example can be tried again. */
|
|
42
|
+
function pageStorage() {
|
|
43
|
+
const values = /* @__PURE__ */ new Map();
|
|
44
|
+
return {
|
|
45
|
+
getItem: (key) => values.get(key) ?? null,
|
|
46
|
+
setItem: (key, value) => void values.set(key, value),
|
|
47
|
+
clear: () => values.clear()
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
var BLOCKS = [
|
|
51
|
+
"Hero banner",
|
|
52
|
+
"Best sellers",
|
|
53
|
+
"Newsletter sign-up"
|
|
54
|
+
];
|
|
55
|
+
function DragHint() {
|
|
56
|
+
const [mode, setMode] = useState("basic");
|
|
57
|
+
const [tries, setTries] = useState(0);
|
|
58
|
+
const [round, setRound] = useState(0);
|
|
59
|
+
const storage = useMemo(pageStorage, []);
|
|
60
|
+
const toggle = useRef(null);
|
|
61
|
+
const start = useRef(null);
|
|
62
|
+
const press = (event) => {
|
|
63
|
+
if (mode === "basic") start.current = {
|
|
64
|
+
x: event.clientX,
|
|
65
|
+
y: event.clientY
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const move = (event) => {
|
|
69
|
+
const from = start.current;
|
|
70
|
+
if (!from || Math.hypot(event.clientX - from.x, event.clientY - from.y) < 8) return;
|
|
71
|
+
start.current = null;
|
|
72
|
+
setTries((count) => count + 1);
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
75
|
+
className: "coachmark-builder",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: "coachmark-builder__bar",
|
|
79
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "coachmark-builder__title",
|
|
81
|
+
children: "Home page"
|
|
82
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
83
|
+
ref: toggle,
|
|
84
|
+
className: "coachmark-builder__mode",
|
|
85
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
86
|
+
"aria-label": "Editing mode",
|
|
87
|
+
size: "sm",
|
|
88
|
+
value: mode,
|
|
89
|
+
onValueChange: (next) => setMode(next),
|
|
90
|
+
options: [{
|
|
91
|
+
value: "basic",
|
|
92
|
+
label: "Basic"
|
|
93
|
+
}, {
|
|
94
|
+
value: "pro",
|
|
95
|
+
label: "Pro"
|
|
96
|
+
}]
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: "coachmark-builder__canvas",
|
|
102
|
+
onPointerDown: press,
|
|
103
|
+
onPointerMove: move,
|
|
104
|
+
onPointerUp: () => start.current = null,
|
|
105
|
+
children: [
|
|
106
|
+
BLOCKS.map((block) => /* @__PURE__ */ jsxs("div", {
|
|
107
|
+
className: "coachmark-builder__block",
|
|
108
|
+
"data-mode": mode,
|
|
109
|
+
children: [/* @__PURE__ */ jsx(ArrowsOutCardinalIcon, {
|
|
110
|
+
className: "coachmark-builder__grip",
|
|
111
|
+
"aria-hidden": "true"
|
|
112
|
+
}), block]
|
|
113
|
+
}, `${block}-${round}`)),
|
|
114
|
+
/* @__PURE__ */ jsx("p", {
|
|
115
|
+
className: "coachmark-builder__note",
|
|
116
|
+
children: mode === "basic" ? "Try dragging a block. After two tries the hint appears." : "In Pro, blocks can be dragged."
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ jsx(Button, {
|
|
119
|
+
size: "sm",
|
|
120
|
+
variant: "ghost",
|
|
121
|
+
onClick: () => {
|
|
122
|
+
storage.clear();
|
|
123
|
+
setTries(0);
|
|
124
|
+
setMode("basic");
|
|
125
|
+
setRound((n) => n + 1);
|
|
126
|
+
},
|
|
127
|
+
children: "Start again"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx(Coachmark, {
|
|
132
|
+
target: toggle,
|
|
133
|
+
open: mode === "basic" && tries >= 2,
|
|
134
|
+
icon: /* @__PURE__ */ jsx(SparkleIcon, {}),
|
|
135
|
+
title: "Moving things is in Pro",
|
|
136
|
+
sessionKey: "orbit-pb-drag-hint-shown",
|
|
137
|
+
storage,
|
|
138
|
+
primaryAction: {
|
|
139
|
+
label: "Switch to Pro",
|
|
140
|
+
onSelect: () => setMode("pro")
|
|
141
|
+
},
|
|
142
|
+
secondaryAction: {
|
|
143
|
+
label: "Stay in Basic",
|
|
144
|
+
onSelect: () => {}
|
|
145
|
+
},
|
|
146
|
+
children: "Basic keeps the layout as the theme set it, so blocks stay put. Switch to Pro to drag them around."
|
|
147
|
+
}, round)
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function ShowOnDemand() {
|
|
152
|
+
const [open, setOpen] = useState(false);
|
|
153
|
+
const target = useRef(null);
|
|
154
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
155
|
+
className: "coachmark-demand",
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx(Button, {
|
|
158
|
+
ref: target,
|
|
159
|
+
icon: /* @__PURE__ */ jsx(SparkleIcon, {}),
|
|
160
|
+
variant: "secondary",
|
|
161
|
+
children: "Ask Nebula"
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ jsx(Button, {
|
|
164
|
+
size: "sm",
|
|
165
|
+
variant: "ghost",
|
|
166
|
+
onClick: () => setOpen(true),
|
|
167
|
+
children: "Show the hint"
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ jsx(Coachmark, {
|
|
170
|
+
target,
|
|
171
|
+
open,
|
|
172
|
+
onOpenChange: setOpen,
|
|
173
|
+
side: "top",
|
|
174
|
+
align: "start",
|
|
175
|
+
title: "Nebula can write this for you",
|
|
176
|
+
dismissLabel: "Got it",
|
|
177
|
+
children: "Ask for a product description and pick the version you like."
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function Page() {
|
|
183
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
184
|
+
title: "Coachmark",
|
|
185
|
+
status: "new",
|
|
186
|
+
importNames: ["Coachmark"],
|
|
187
|
+
lead: "A hint pinned to one control, with an arrow pointing at it, for the moment someone tries something that control explains. It pulses the control, says itself without taking focus, and offers two ways on.",
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
190
|
+
id: "basics",
|
|
191
|
+
title: "Basics",
|
|
192
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
193
|
+
"Give it the ",
|
|
194
|
+
/* @__PURE__ */ jsx("code", { children: "target" }),
|
|
195
|
+
" it points at (an element, a ref, or a selector for one in the page), a",
|
|
196
|
+
" ",
|
|
197
|
+
/* @__PURE__ */ jsx("code", { children: "title" }),
|
|
198
|
+
", a line of text, an ",
|
|
199
|
+
/* @__PURE__ */ jsx("code", { children: "icon" }),
|
|
200
|
+
" for its tile and its two actions. While",
|
|
201
|
+
" ",
|
|
202
|
+
/* @__PURE__ */ jsx("code", { children: "open" }),
|
|
203
|
+
" it sits beside the control with an arrow pointing at it, follows it as the page moves, and rings it in teal, pulsing three times. It is not modal: focus stays where it was and a click elsewhere leaves it up; one of its actions or Escape puts it away. Here, the builder's Basic mode: try dragging a block twice."
|
|
204
|
+
] }),
|
|
205
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
206
|
+
align: "fill",
|
|
207
|
+
minHeight: 360,
|
|
208
|
+
code: `
|
|
209
|
+
const [tries, setTries] = useState(0)
|
|
210
|
+
|
|
211
|
+
<Coachmark
|
|
212
|
+
target={modeToggleRef}
|
|
213
|
+
open={mode === 'basic' && tries >= 2}
|
|
214
|
+
icon={<SparkleIcon />}
|
|
215
|
+
title="Moving things is in Pro"
|
|
216
|
+
sessionKey="orbit-pb-drag-hint-shown"
|
|
217
|
+
primaryAction={{ label: 'Switch to Pro', onSelect: () => setMode('pro') }}
|
|
218
|
+
secondaryAction={{ label: 'Stay in Basic', onSelect: () => {} }}
|
|
219
|
+
>
|
|
220
|
+
Basic keeps the layout as the theme set it, so blocks stay put. Switch to Pro to drag them around.
|
|
221
|
+
</Coachmark>`,
|
|
222
|
+
children: /* @__PURE__ */ jsx(DragHint, {})
|
|
223
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
224
|
+
title: "Once a session",
|
|
225
|
+
children: [
|
|
226
|
+
"With a ",
|
|
227
|
+
/* @__PURE__ */ jsx("code", { children: "sessionKey" }),
|
|
228
|
+
" it shows only if that key is not yet set in the session's storage, and sets it as it shows, so the hint never nags. Where storage is blocked (a private window) it shows once for the page. Pass ",
|
|
229
|
+
/* @__PURE__ */ jsx("code", { children: "storage" }),
|
|
230
|
+
" to keep the key somewhere else; the example keeps it in the page, so Start again shows it again."
|
|
231
|
+
]
|
|
232
|
+
})]
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
235
|
+
id: "one-action",
|
|
236
|
+
title: "One way on",
|
|
237
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
238
|
+
"Without a ",
|
|
239
|
+
/* @__PURE__ */ jsx("code", { children: "secondaryAction" }),
|
|
240
|
+
" a plain dismiss button stands in (",
|
|
241
|
+
/* @__PURE__ */ jsx("code", { children: "dismissLabel" }),
|
|
242
|
+
", “Got it” by default). ",
|
|
243
|
+
/* @__PURE__ */ jsx("code", { children: "side" }),
|
|
244
|
+
" and ",
|
|
245
|
+
/* @__PURE__ */ jsx("code", { children: "align" }),
|
|
246
|
+
" place it; the arrow follows."
|
|
247
|
+
] }),
|
|
248
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
249
|
+
align: "fill",
|
|
250
|
+
minHeight: 260,
|
|
251
|
+
code: `
|
|
252
|
+
<Coachmark target={askRef} open={open} onOpenChange={setOpen} side="top" align="start" title="Nebula can write this for you">
|
|
253
|
+
Ask for a product description and pick the version you like.
|
|
254
|
+
</Coachmark>`,
|
|
255
|
+
children: /* @__PURE__ */ jsx(ShowOnDemand, {})
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
259
|
+
id: "guidelines",
|
|
260
|
+
title: "Guidelines",
|
|
261
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
262
|
+
"Show it when the person needs it, after they try the thing it explains, never as a tour on arrival.",
|
|
263
|
+
"One coachmark at a time, pointing at one control. Keep the text to a sentence or two.",
|
|
264
|
+
"The main action does the thing; the other leaves things as they are. Name both for what they do.",
|
|
265
|
+
"Give it a session key, so it does not come back on every page."
|
|
266
|
+
] })
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
269
|
+
id: "accessibility",
|
|
270
|
+
title: "Accessibility",
|
|
271
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
272
|
+
"It takes no focus. A polite status, in the page before it speaks, reads its title and text as it appears.",
|
|
273
|
+
"Its sheet is a group named by its title. Its buttons follow the page in the tab order, and Escape puts it away.",
|
|
274
|
+
"The ring on the control is a teal outline under forced colours. The pulse is a fading halo, nothing moves, so it stays under reduced motion.",
|
|
275
|
+
"It hides while the control is scrolled out of view."
|
|
276
|
+
] })
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
279
|
+
id: "props",
|
|
280
|
+
title: "Props",
|
|
281
|
+
children: /* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
282
|
+
{
|
|
283
|
+
name: "target",
|
|
284
|
+
type: "Element | RefObject<Element> | string",
|
|
285
|
+
required: true,
|
|
286
|
+
description: "The control it points at: an element, a ref, or a selector found in the page."
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "open",
|
|
290
|
+
type: "boolean",
|
|
291
|
+
default: "true",
|
|
292
|
+
description: "Whether it is wanted now."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "onOpenChange",
|
|
296
|
+
type: "(open: boolean) => void",
|
|
297
|
+
description: "Called with false when an action or Escape puts it away."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "title",
|
|
301
|
+
type: "ReactNode",
|
|
302
|
+
required: true,
|
|
303
|
+
description: "Also names the sheet."
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "children",
|
|
307
|
+
type: "ReactNode",
|
|
308
|
+
description: "The text under the title."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "icon",
|
|
312
|
+
type: "ReactNode",
|
|
313
|
+
description: "A glyph for its teal icon tile."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "primaryAction",
|
|
317
|
+
type: "{ label, onSelect }",
|
|
318
|
+
description: "The main action. Runs, then the coachmark closes."
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "secondaryAction",
|
|
322
|
+
type: "{ label, onSelect }",
|
|
323
|
+
description: "The other way on. Without it, a plain dismiss button."
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "dismissLabel",
|
|
327
|
+
type: "string",
|
|
328
|
+
default: "'Got it'",
|
|
329
|
+
description: "The plain dismiss button’s words."
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: "pulse",
|
|
333
|
+
type: "boolean",
|
|
334
|
+
default: "true",
|
|
335
|
+
description: "Ring and pulse the control while it shows."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "sessionKey",
|
|
339
|
+
type: "string",
|
|
340
|
+
description: "Shows once a session under this key."
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "storage",
|
|
344
|
+
type: "Pick<Storage, getItem | setItem>",
|
|
345
|
+
default: "sessionStorage",
|
|
346
|
+
description: "Where the key is kept."
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "side / align",
|
|
350
|
+
type: "Popover placement",
|
|
351
|
+
default: "'bottom' / 'end'",
|
|
352
|
+
description: "Where it sits against the control."
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "width",
|
|
356
|
+
type: "number",
|
|
357
|
+
default: "320",
|
|
358
|
+
description: "The sheet’s width in px."
|
|
359
|
+
}
|
|
360
|
+
] })
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
export { Page, Preview };
|