@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,811 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { a as DocTable, d as Section$1, i as DocPage, l as Note, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button, IconButton, InspectorPanel, SegmentedControl, SidePanel, Tooltip, usePanelWidth } from "@orbitcommerce/constellation";
|
|
7
|
+
import { ArrowCounterClockwiseIcon, ImageSquareIcon, PaperPlaneRightIcon, RectangleIcon, SparkleIcon, SquaresFourIcon, TextTIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/components/side-panel.tsx
|
|
9
|
+
function Preview() {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: "side-panel-preview",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: "side-panel-preview__canvas",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "side-panel-preview__title" }),
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "side-panel-preview__line" }),
|
|
18
|
+
/* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "side-panel-preview__line",
|
|
20
|
+
"data-short": ""
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}), /* @__PURE__ */ jsx(SidePanel, {
|
|
24
|
+
open: true,
|
|
25
|
+
title: "Assistant",
|
|
26
|
+
width: 120,
|
|
27
|
+
className: "side-panel-preview__panel",
|
|
28
|
+
hideClose: true,
|
|
29
|
+
phoneModal: false,
|
|
30
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "side-panel-preview__bubbles",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
34
|
+
/* @__PURE__ */ jsx("span", { "data-own": "" }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", {})
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A static specimen of the panel as a phone draws it: the window decides that state, so it cannot be shown live here.
|
|
43
|
+
* Built from the component's own classes in a phone-sized frame that contains its fixed position, as AUTHORING.md
|
|
44
|
+
* allows for an overlay's open state.
|
|
45
|
+
*/
|
|
46
|
+
function PhoneSpecimen() {
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "side-panel-phone",
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "o-side-panel",
|
|
52
|
+
"data-mode": "push",
|
|
53
|
+
"data-side": "end",
|
|
54
|
+
"data-open": "",
|
|
55
|
+
"data-phone": "",
|
|
56
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
57
|
+
className: "o-side-panel__sheet",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxs("header", {
|
|
60
|
+
className: "o-side-panel__head",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "o-side-panel__mark",
|
|
64
|
+
children: /* @__PURE__ */ jsx("span", { className: "side-panel-face" })
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx("span", {
|
|
67
|
+
className: "o-side-panel__title",
|
|
68
|
+
children: "Assistant"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: "side-panel-phone__close",
|
|
72
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
73
|
+
viewBox: "0 0 16 16",
|
|
74
|
+
fill: "none",
|
|
75
|
+
stroke: "currentColor",
|
|
76
|
+
strokeWidth: 1.6,
|
|
77
|
+
strokeLinecap: "round",
|
|
78
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4 4l8 8M12 4l-8 8" })
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: "o-side-panel__body",
|
|
85
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
86
|
+
className: "side-panel-thread",
|
|
87
|
+
children: MESSAGES.slice(0, 2).map((message) => /* @__PURE__ */ jsx("li", {
|
|
88
|
+
className: "side-panel-thread__message",
|
|
89
|
+
"data-who": message.who,
|
|
90
|
+
children: message.text
|
|
91
|
+
}, message.text))
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("div", {
|
|
95
|
+
className: "o-side-panel__footer",
|
|
96
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
97
|
+
className: "side-panel-composer",
|
|
98
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: "side-panel-composer__field side-panel-phone__placeholder",
|
|
100
|
+
children: "Ask about your shop"
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Opens a demo's panel once the page is in the browser, on a screen wide enough to dock it. On a phone an open panel
|
|
111
|
+
* fills the screen, so the demos start closed there and the reader opens them.
|
|
112
|
+
*/
|
|
113
|
+
function useOpenWhenWide(setOpen) {
|
|
114
|
+
const open = useRef(setOpen);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (window.innerWidth >= 768) open.current(true);
|
|
117
|
+
}, []);
|
|
118
|
+
}
|
|
119
|
+
var MESSAGES = [
|
|
120
|
+
{
|
|
121
|
+
who: "you",
|
|
122
|
+
text: "Which orders are still waiting to be sent?"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
who: "assistant",
|
|
126
|
+
text: "Four orders from yesterday are unfulfilled. Two are for the Arden ergonomic chair, which is back in stock today."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
who: "you",
|
|
130
|
+
text: "Draft the delivery note for the two chairs."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
who: "assistant",
|
|
134
|
+
text: "Done. The notes are in Drafts, addressed to Priya Shah and Tom Alder. Shall I mark both orders as ready to pick?"
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
function AssistantDemo() {
|
|
138
|
+
const [open, setOpen] = useState(false);
|
|
139
|
+
useOpenWhenWide(setOpen);
|
|
140
|
+
const toggle = useRef(null);
|
|
141
|
+
const panel = usePanelWidth({
|
|
142
|
+
storageKey: "docs-side-panel-width",
|
|
143
|
+
defaultWidth: 340,
|
|
144
|
+
minWidth: 300,
|
|
145
|
+
maxWidth: 480
|
|
146
|
+
});
|
|
147
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
148
|
+
className: "side-panel-stage",
|
|
149
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
150
|
+
className: "side-panel-stage__canvas",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ jsx("h4", {
|
|
153
|
+
className: "side-panel-stage__heading",
|
|
154
|
+
children: "Orders"
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ jsx("p", {
|
|
157
|
+
className: "side-panel-stage__text",
|
|
158
|
+
children: "The page gives up room as the panel slides in, and takes it back as it goes. Drag the panel's left edge, or Tab to it and use the arrow keys."
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ jsx(Button, {
|
|
161
|
+
ref: toggle,
|
|
162
|
+
size: "sm",
|
|
163
|
+
icon: /* @__PURE__ */ jsx(SparkleIcon, {}),
|
|
164
|
+
onClick: () => setOpen((v) => !v),
|
|
165
|
+
"aria-expanded": open,
|
|
166
|
+
children: open ? "Close the assistant" : "Ask the assistant"
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}), /* @__PURE__ */ jsx(SidePanel, {
|
|
170
|
+
open,
|
|
171
|
+
onOpenChange: setOpen,
|
|
172
|
+
title: "Assistant",
|
|
173
|
+
mark: /* @__PURE__ */ jsx("span", {
|
|
174
|
+
className: "side-panel-face",
|
|
175
|
+
"aria-hidden": "true"
|
|
176
|
+
}),
|
|
177
|
+
actions: /* @__PURE__ */ jsx(Tooltip, {
|
|
178
|
+
content: "New conversation",
|
|
179
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
180
|
+
label: "New conversation",
|
|
181
|
+
size: "sm",
|
|
182
|
+
children: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {})
|
|
183
|
+
})
|
|
184
|
+
}),
|
|
185
|
+
resizable: true,
|
|
186
|
+
width: panel.width,
|
|
187
|
+
minWidth: 300,
|
|
188
|
+
maxWidth: 480,
|
|
189
|
+
onWidthChange: panel.setWidth,
|
|
190
|
+
onWidthCommit: panel.commit,
|
|
191
|
+
returnFocusRef: toggle,
|
|
192
|
+
className: "side-panel-stage__panel",
|
|
193
|
+
footer: /* @__PURE__ */ jsxs("form", {
|
|
194
|
+
className: "side-panel-composer",
|
|
195
|
+
onSubmit: (event) => event.preventDefault(),
|
|
196
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
197
|
+
className: "side-panel-composer__field",
|
|
198
|
+
placeholder: "Ask about your shop",
|
|
199
|
+
"aria-label": "Message the assistant"
|
|
200
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
201
|
+
label: "Send",
|
|
202
|
+
size: "sm",
|
|
203
|
+
variant: "primary",
|
|
204
|
+
type: "submit",
|
|
205
|
+
children: /* @__PURE__ */ jsx(PaperPlaneRightIcon, {})
|
|
206
|
+
})]
|
|
207
|
+
}),
|
|
208
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
209
|
+
className: "side-panel-thread",
|
|
210
|
+
children: MESSAGES.map((message) => /* @__PURE__ */ jsx("li", {
|
|
211
|
+
className: "side-panel-thread__message",
|
|
212
|
+
"data-who": message.who,
|
|
213
|
+
children: message.text
|
|
214
|
+
}, message.text))
|
|
215
|
+
})
|
|
216
|
+
})]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
var TILES = [
|
|
220
|
+
{
|
|
221
|
+
id: "heading",
|
|
222
|
+
label: "Heading",
|
|
223
|
+
icon: TextTIcon
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "image",
|
|
227
|
+
label: "Image",
|
|
228
|
+
icon: ImageSquareIcon
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "button",
|
|
232
|
+
label: "Button",
|
|
233
|
+
icon: RectangleIcon
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "grid",
|
|
237
|
+
label: "Product grid",
|
|
238
|
+
icon: SquaresFourIcon
|
|
239
|
+
}
|
|
240
|
+
];
|
|
241
|
+
function ToolPanelDemo() {
|
|
242
|
+
const [open, setOpen] = useState(false);
|
|
243
|
+
const [dropped, setDropped] = useState([]);
|
|
244
|
+
const [over, setOver] = useState(false);
|
|
245
|
+
const accept = (event) => {
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
setOver(false);
|
|
248
|
+
const id = event.dataTransfer.getData("text/plain");
|
|
249
|
+
const tile = TILES.find((t) => t.id === id);
|
|
250
|
+
if (tile) setDropped((list) => [...list, tile.label]);
|
|
251
|
+
};
|
|
252
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
253
|
+
className: "side-panel-stage",
|
|
254
|
+
"data-overlay": "",
|
|
255
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
256
|
+
className: "side-panel-stage__rail",
|
|
257
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
258
|
+
content: "Elements",
|
|
259
|
+
side: "right",
|
|
260
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
261
|
+
label: "Elements",
|
|
262
|
+
pressed: open,
|
|
263
|
+
onClick: () => setOpen((v) => !v),
|
|
264
|
+
children: /* @__PURE__ */ jsx(SquaresFourIcon, {})
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
268
|
+
className: "side-panel-stage__over",
|
|
269
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
270
|
+
className: "side-panel-stage__canvas side-panel-drop",
|
|
271
|
+
"data-over": over ? "" : void 0,
|
|
272
|
+
onDragOver: (event) => {
|
|
273
|
+
event.preventDefault();
|
|
274
|
+
setOver(true);
|
|
275
|
+
},
|
|
276
|
+
onDragLeave: () => setOver(false),
|
|
277
|
+
onDrop: accept,
|
|
278
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
279
|
+
className: "side-panel-stage__heading",
|
|
280
|
+
children: "Summer homepage"
|
|
281
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
282
|
+
className: "side-panel-stage__text",
|
|
283
|
+
children: dropped.length ? `Dropped: ${dropped.join(", ")}.` : "Open Elements and drag a tile onto the page. The panel lets the drop through and stays open."
|
|
284
|
+
})]
|
|
285
|
+
}), /* @__PURE__ */ jsx(SidePanel, {
|
|
286
|
+
open,
|
|
287
|
+
onOpenChange: setOpen,
|
|
288
|
+
side: "start",
|
|
289
|
+
mode: "overlay",
|
|
290
|
+
width: 288,
|
|
291
|
+
title: "Elements",
|
|
292
|
+
className: "side-panel-stage__floating",
|
|
293
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
294
|
+
className: "side-panel-tiles",
|
|
295
|
+
children: TILES.map((tile) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("div", {
|
|
296
|
+
className: "side-panel-tiles__tile",
|
|
297
|
+
draggable: true,
|
|
298
|
+
tabIndex: 0,
|
|
299
|
+
onDragStart: (event) => event.dataTransfer.setData("text/plain", tile.id),
|
|
300
|
+
children: [/* @__PURE__ */ jsx(tile.icon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: tile.label })]
|
|
301
|
+
}) }, tile.id))
|
|
302
|
+
})
|
|
303
|
+
})]
|
|
304
|
+
})]
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
var BLOCKS = [
|
|
308
|
+
"Hero banner",
|
|
309
|
+
"Free delivery strip",
|
|
310
|
+
"Bestsellers grid",
|
|
311
|
+
"Newsletter sign-up"
|
|
312
|
+
];
|
|
313
|
+
var DEVICES = [
|
|
314
|
+
{
|
|
315
|
+
value: "desktop",
|
|
316
|
+
label: "Desktop"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
value: "tablet",
|
|
320
|
+
label: "Tablet"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
value: "phone",
|
|
324
|
+
label: "Phone"
|
|
325
|
+
}
|
|
326
|
+
];
|
|
327
|
+
function InspectorDemo() {
|
|
328
|
+
const [blocks, setBlocks] = useState(BLOCKS);
|
|
329
|
+
const [selected, setSelected] = useState(null);
|
|
330
|
+
const [device, setDevice] = useState("desktop");
|
|
331
|
+
useOpenWhenWide((open) => setSelected(open ? 0 : null));
|
|
332
|
+
const canvas = useRef(null);
|
|
333
|
+
const name = selected === null ? "" : blocks[selected] ?? "";
|
|
334
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
335
|
+
className: "side-panel-stage",
|
|
336
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
337
|
+
className: "side-panel-stage__canvas",
|
|
338
|
+
ref: canvas,
|
|
339
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
340
|
+
className: "side-panel-inspector-bar",
|
|
341
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
342
|
+
"aria-label": "Canvas device",
|
|
343
|
+
size: "sm",
|
|
344
|
+
value: device,
|
|
345
|
+
onValueChange: setDevice,
|
|
346
|
+
options: DEVICES
|
|
347
|
+
})
|
|
348
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
349
|
+
className: "side-panel-blocks",
|
|
350
|
+
children: blocks.map((block, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
|
|
351
|
+
type: "button",
|
|
352
|
+
className: "side-panel-blocks__block",
|
|
353
|
+
"aria-pressed": selected === index,
|
|
354
|
+
onClick: () => setSelected(selected === index ? null : index),
|
|
355
|
+
children: block
|
|
356
|
+
}) }, block))
|
|
357
|
+
})]
|
|
358
|
+
}), /* @__PURE__ */ jsx(InspectorPanel, {
|
|
359
|
+
open: selected !== null,
|
|
360
|
+
name,
|
|
361
|
+
onRename: (next) => setBlocks((list) => list.map((b, i) => i === selected ? next : b)),
|
|
362
|
+
onDelete: () => {
|
|
363
|
+
setBlocks((list) => list.filter((_, i) => i !== selected));
|
|
364
|
+
setSelected(null);
|
|
365
|
+
},
|
|
366
|
+
deleteDisabledReason: blocks.length === 1 ? "The last section of a page stays" : void 0,
|
|
367
|
+
scrollKey: device,
|
|
368
|
+
scrollResetKey: name,
|
|
369
|
+
className: "side-panel-stage__panel",
|
|
370
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
371
|
+
className: "side-panel-settings",
|
|
372
|
+
children: [
|
|
373
|
+
"Layout",
|
|
374
|
+
"Spacing",
|
|
375
|
+
"Background",
|
|
376
|
+
"Typography",
|
|
377
|
+
"Border",
|
|
378
|
+
"Animation",
|
|
379
|
+
"Visibility"
|
|
380
|
+
].map((group) => /* @__PURE__ */ jsxs("section", {
|
|
381
|
+
className: "side-panel-settings__group",
|
|
382
|
+
children: [/* @__PURE__ */ jsx("h5", {
|
|
383
|
+
className: "side-panel-settings__heading",
|
|
384
|
+
children: group
|
|
385
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
386
|
+
className: "side-panel-settings__text",
|
|
387
|
+
children: device === "desktop" ? "Settings for wide screens." : device === "tablet" ? "Settings for tablets." : "Settings for phones."
|
|
388
|
+
})]
|
|
389
|
+
}, group))
|
|
390
|
+
})
|
|
391
|
+
})]
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
function Page() {
|
|
395
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
396
|
+
title: "Side panel",
|
|
397
|
+
status: "new",
|
|
398
|
+
importNames: [
|
|
399
|
+
"SidePanel",
|
|
400
|
+
"InspectorPanel",
|
|
401
|
+
"usePanelWidth"
|
|
402
|
+
],
|
|
403
|
+
lead: "A panel beside the content that is not a modal: the assistant docked beside a page, a builder's tool panels, its inspector. It docks, taking its room from the content, or floats over it; it resizes from the edge facing the content; and on a phone it becomes a full-screen dialog.",
|
|
404
|
+
children: [
|
|
405
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
406
|
+
id: "docked",
|
|
407
|
+
title: "Docked",
|
|
408
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
409
|
+
"In ",
|
|
410
|
+
/* @__PURE__ */ jsx("code", { children: "push" }),
|
|
411
|
+
" mode, the default, the panel takes its width from the content beside it, which gives up the room as it slides in. Its head holds a mark, the title, actions and the close button; the body scrolls; the footer stays under the body over a fade while there is more to scroll. With ",
|
|
412
|
+
/* @__PURE__ */ jsx("code", { children: "resizable" }),
|
|
413
|
+
", a separator on the edge facing the content resizes it within ",
|
|
414
|
+
/* @__PURE__ */ jsx("code", { children: "minWidth" }),
|
|
415
|
+
" and ",
|
|
416
|
+
/* @__PURE__ */ jsx("code", { children: "maxWidth" }),
|
|
417
|
+
"."
|
|
418
|
+
] }),
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx(Example, {
|
|
421
|
+
align: "fill",
|
|
422
|
+
code: `
|
|
423
|
+
const panel = usePanelWidth({ storageKey: 'assistant-width', minWidth: 300, maxWidth: 480 })
|
|
424
|
+
|
|
425
|
+
<SidePanel
|
|
426
|
+
open={open}
|
|
427
|
+
onOpenChange={setOpen}
|
|
428
|
+
title="Assistant"
|
|
429
|
+
mark={<AssistantFace />}
|
|
430
|
+
actions={<IconButton label="New conversation">…</IconButton>}
|
|
431
|
+
resizable
|
|
432
|
+
width={panel.width}
|
|
433
|
+
minWidth={300}
|
|
434
|
+
maxWidth={480}
|
|
435
|
+
onWidthChange={panel.setWidth}
|
|
436
|
+
onWidthCommit={panel.commit}
|
|
437
|
+
footer={<Composer />}
|
|
438
|
+
>
|
|
439
|
+
<Thread />
|
|
440
|
+
</SidePanel>`,
|
|
441
|
+
children: /* @__PURE__ */ jsx(AssistantDemo, {})
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ jsx(Fragment$1, {}),
|
|
444
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
445
|
+
title: "In the app shell",
|
|
446
|
+
children: [
|
|
447
|
+
"Put it in ",
|
|
448
|
+
/* @__PURE__ */ jsx("code", { children: "AppShell" }),
|
|
449
|
+
"'s ",
|
|
450
|
+
/* @__PURE__ */ jsx("code", { children: "aside" }),
|
|
451
|
+
" slot and it lines up with the canvas: open, the shell's 8px gap sits between the canvas and the panel; closed, it gives the gap back."
|
|
452
|
+
]
|
|
453
|
+
})
|
|
454
|
+
]
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
457
|
+
id: "floating",
|
|
458
|
+
title: "Floating",
|
|
459
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
460
|
+
"In ",
|
|
461
|
+
/* @__PURE__ */ jsx("code", { children: "overlay" }),
|
|
462
|
+
" mode the panel lies over the content, which keeps its place, over a click-away layer that closes it. A drag that starts in the panel passes through it and the layer to the content, and the panel stays open meanwhile, so an element can go from the panel straight onto the page. A drag your own code runs (a pointer drag engine) says so with ",
|
|
463
|
+
/* @__PURE__ */ jsx("code", { children: "dragging" }),
|
|
464
|
+
"."
|
|
465
|
+
] }),
|
|
466
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
467
|
+
align: "fill",
|
|
468
|
+
code: `
|
|
469
|
+
<SidePanel open={open} onOpenChange={setOpen} side="start" mode="overlay" width={288} title="Elements">
|
|
470
|
+
<ElementTiles />
|
|
471
|
+
</SidePanel>`,
|
|
472
|
+
children: /* @__PURE__ */ jsx(ToolPanelDemo, {})
|
|
473
|
+
}), /* @__PURE__ */ jsxs(Note, {
|
|
474
|
+
title: "Its container",
|
|
475
|
+
children: [
|
|
476
|
+
"A floating panel covers the nearest positioned ancestor: give the stage it floats over",
|
|
477
|
+
" ",
|
|
478
|
+
/* @__PURE__ */ jsx("code", { children: "position: relative" }),
|
|
479
|
+
"."
|
|
480
|
+
]
|
|
481
|
+
})]
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
484
|
+
id: "inspector",
|
|
485
|
+
title: "The inspector",
|
|
486
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
487
|
+
/* @__PURE__ */ jsx("code", { children: "InspectorPanel" }),
|
|
488
|
+
" is the builder's inspector: docked at the end, 320px, sliding in when something is selected and out when nothing is. Its head says \"Editing\" and the name, renames in place (the pencil, or a double click on the title; Enter keeps the name, Escape keeps the old one) and deletes. A delete that cannot happen says why and stays reachable. It leaves focus on the canvas as it opens, and its body keeps a scroll position for each",
|
|
489
|
+
" ",
|
|
490
|
+
/* @__PURE__ */ jsx("code", { children: "scrollKey" }),
|
|
491
|
+
": switch the device and come back."
|
|
492
|
+
] }),
|
|
493
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
494
|
+
align: "fill",
|
|
495
|
+
code: `
|
|
496
|
+
<InspectorPanel
|
|
497
|
+
open={selected !== null}
|
|
498
|
+
name={selected.name}
|
|
499
|
+
onRename={rename}
|
|
500
|
+
onDelete={remove}
|
|
501
|
+
deleteDisabledReason={isLastSection ? 'The last section of a page stays' : undefined}
|
|
502
|
+
scrollKey={device}
|
|
503
|
+
scrollResetKey={selected.id}
|
|
504
|
+
>
|
|
505
|
+
<Settings />
|
|
506
|
+
</InspectorPanel>`,
|
|
507
|
+
children: /* @__PURE__ */ jsx(InspectorDemo, {})
|
|
508
|
+
})
|
|
509
|
+
}),
|
|
510
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
511
|
+
id: "width",
|
|
512
|
+
title: "One width for several panels",
|
|
513
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
514
|
+
className: "side-panel-prose",
|
|
515
|
+
children: [
|
|
516
|
+
"The panel takes its width from ",
|
|
517
|
+
/* @__PURE__ */ jsx("code", { children: "width" }),
|
|
518
|
+
" and says when it changes. A builder whose tool panels share one width (so the canvas keeps its place as you move between them) keeps it in one place and saves it once a drag ends:",
|
|
519
|
+
" ",
|
|
520
|
+
/* @__PURE__ */ jsx("code", { children: "usePanelWidth" }),
|
|
521
|
+
" does both."
|
|
522
|
+
]
|
|
523
|
+
}), /* @__PURE__ */ jsx(DocTable, {
|
|
524
|
+
columns: [
|
|
525
|
+
"Callback",
|
|
526
|
+
"Called",
|
|
527
|
+
"For"
|
|
528
|
+
],
|
|
529
|
+
rows: [[
|
|
530
|
+
/* @__PURE__ */ jsx("code", { children: "onWidthChange" }),
|
|
531
|
+
"As the width changes, through a drag too",
|
|
532
|
+
"Drawing the new width"
|
|
533
|
+
], [
|
|
534
|
+
/* @__PURE__ */ jsx("code", { children: "onWidthCommit" }),
|
|
535
|
+
"Once a change is finished: a drag let go, a key pressed",
|
|
536
|
+
"Saving it"
|
|
537
|
+
]]
|
|
538
|
+
})]
|
|
539
|
+
}),
|
|
540
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
541
|
+
id: "phones",
|
|
542
|
+
title: "On a phone",
|
|
543
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
544
|
+
"Below 768px the open panel fills the screen as a dialog that holds focus: the rest of the page is out of reach until it closes, and Escape and its close button (always there on a phone) close it. A panel open as the page loads takes focus, and with two open the one on top holds the page without shutting out the other.",
|
|
545
|
+
" ",
|
|
546
|
+
/* @__PURE__ */ jsxs("code", { children: ["phoneModal=", "{false}"] }),
|
|
547
|
+
" keeps it as it is. The specimen below is drawn from the panel's own classes."
|
|
548
|
+
] }),
|
|
549
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
550
|
+
align: "center",
|
|
551
|
+
code: `<SidePanel open title="Assistant" …>…</SidePanel> // below 768px`,
|
|
552
|
+
children: /* @__PURE__ */ jsx(PhoneSpecimen, {})
|
|
553
|
+
})
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
556
|
+
id: "guidelines",
|
|
557
|
+
title: "Guidelines",
|
|
558
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
559
|
+
"Dock a panel that works with the page (an assistant, an inspector, a library you add from again and again); float one you open for a moment (a tool you pick from once).",
|
|
560
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
561
|
+
"Reach for a ",
|
|
562
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
563
|
+
to: "/components/dialog",
|
|
564
|
+
children: "Sheet or a dialog"
|
|
565
|
+
}),
|
|
566
|
+
" instead when the work needs the person's whole attention: they are modal."
|
|
567
|
+
] }),
|
|
568
|
+
"Keep the head to a title and one or two actions; the body holds the rest.",
|
|
569
|
+
"Give a resizable panel a range that keeps its content readable at both ends."
|
|
570
|
+
] })
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
573
|
+
id: "accessibility",
|
|
574
|
+
title: "Accessibility",
|
|
575
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
576
|
+
"Open, the panel is a complementary landmark named by its title (or label); on a phone it is a modal dialog.",
|
|
577
|
+
"Closed, it stays mounted and is inert: out of the tab order and out of what a screen reader reads.",
|
|
578
|
+
"Focus goes in as it opens (initialFocusRef, else the first field, else the first control) and back to what opened it as it closes. autoFocus={false} leaves focus where it is, as the inspector does.",
|
|
579
|
+
"Escape inside it closes it, unless something inside used the Escape first (a menu, a field).",
|
|
580
|
+
"The resize handle is a vertical separator: it is in the tab order, says the width and its range (aria-valuenow, aria-valuemin, aria-valuemax), and the arrow keys move it 16px (64px with Shift), towards the content to widen; Home and End go to the ends.",
|
|
581
|
+
"With reduced motion it no longer slides; it fades."
|
|
582
|
+
] })
|
|
583
|
+
}),
|
|
584
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
585
|
+
id: "props",
|
|
586
|
+
title: "Props",
|
|
587
|
+
description: /* @__PURE__ */ jsx("p", { children: "Also accepts every attribute of a div, which go on the outer box." }),
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
590
|
+
title: "SidePanel",
|
|
591
|
+
rows: [
|
|
592
|
+
{
|
|
593
|
+
name: "open",
|
|
594
|
+
type: "boolean",
|
|
595
|
+
required: true,
|
|
596
|
+
description: "Shown or not. It stays mounted while closed, inert."
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "onOpenChange",
|
|
600
|
+
type: "(open: boolean) => void",
|
|
601
|
+
description: "Asked to close: the close button, Escape, the scrim."
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "side",
|
|
605
|
+
type: "'start' | 'end'",
|
|
606
|
+
default: "'end'",
|
|
607
|
+
description: "Which side of the content it sits on."
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: "mode",
|
|
611
|
+
type: "'push' | 'overlay'",
|
|
612
|
+
default: "'push'",
|
|
613
|
+
description: "Docked beside the content, or floating over it."
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
name: "width",
|
|
617
|
+
type: "number",
|
|
618
|
+
description: "Controlled width, with onWidthChange."
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
name: "defaultWidth",
|
|
622
|
+
type: "number",
|
|
623
|
+
default: "360",
|
|
624
|
+
description: "Starting width when uncontrolled."
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: "onWidthChange",
|
|
628
|
+
type: "(width: number) => void",
|
|
629
|
+
description: "As the width changes."
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: "onWidthCommit",
|
|
633
|
+
type: "(width: number) => void",
|
|
634
|
+
description: "Once a change is finished: save it here."
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: "resizable",
|
|
638
|
+
type: "boolean",
|
|
639
|
+
default: "false",
|
|
640
|
+
description: "A separator on the edge facing the content."
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
name: "minWidth",
|
|
644
|
+
type: "number",
|
|
645
|
+
default: "240",
|
|
646
|
+
description: "The narrowest it is dragged to."
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
name: "maxWidth",
|
|
650
|
+
type: "number",
|
|
651
|
+
default: "600",
|
|
652
|
+
description: "The widest it is dragged to."
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: "title",
|
|
656
|
+
type: "ReactNode",
|
|
657
|
+
description: "The head’s title. It names the panel."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "titleAs",
|
|
661
|
+
type: "'h2' | 'h3' | 'h4'",
|
|
662
|
+
default: "'h2'",
|
|
663
|
+
description: "The heading element."
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
name: "label",
|
|
667
|
+
type: "string",
|
|
668
|
+
description: "The name when the title is not plain words."
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: "mark",
|
|
672
|
+
type: "ReactNode",
|
|
673
|
+
description: "Before the title: a face or an icon."
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: "onBack",
|
|
677
|
+
type: "() => void",
|
|
678
|
+
description: "A Back button before the title."
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
name: "actions",
|
|
682
|
+
type: "ReactNode",
|
|
683
|
+
description: "Buttons before the close button."
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: "hideClose",
|
|
687
|
+
type: "boolean",
|
|
688
|
+
default: "false",
|
|
689
|
+
description: "Leave the close button out."
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: "head",
|
|
693
|
+
type: "ReactNode",
|
|
694
|
+
description: "A whole head of your own."
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: "footer",
|
|
698
|
+
type: "ReactNode",
|
|
699
|
+
description: "Under the body, over a fade."
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "autoFocus",
|
|
703
|
+
type: "boolean",
|
|
704
|
+
default: "true",
|
|
705
|
+
description: "Take focus in as it opens."
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
name: "initialFocusRef",
|
|
709
|
+
type: "RefObject<HTMLElement>",
|
|
710
|
+
description: "Where focus goes as it opens."
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: "returnFocusRef",
|
|
714
|
+
type: "RefObject<HTMLElement>",
|
|
715
|
+
description: "Where focus goes as it closes."
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
name: "dragging",
|
|
719
|
+
type: "boolean",
|
|
720
|
+
default: "false",
|
|
721
|
+
description: "A drag your code runs: let it through, stay open."
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
name: "phoneModal",
|
|
725
|
+
type: "boolean",
|
|
726
|
+
default: "true",
|
|
727
|
+
description: "Below 768px, a full-screen dialog."
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: "scrollKey",
|
|
731
|
+
type: "string",
|
|
732
|
+
description: "The body keeps a scroll position for each key."
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: "scrollResetKey",
|
|
736
|
+
type: "unknown",
|
|
737
|
+
description: "A new value forgets them and starts at the top."
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
name: "labels",
|
|
741
|
+
type: "Partial<SidePanelLabels>",
|
|
742
|
+
description: "close, back, resize."
|
|
743
|
+
}
|
|
744
|
+
]
|
|
745
|
+
}),
|
|
746
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
747
|
+
title: "InspectorPanel",
|
|
748
|
+
rows: [
|
|
749
|
+
{
|
|
750
|
+
name: "name",
|
|
751
|
+
type: "string",
|
|
752
|
+
required: true,
|
|
753
|
+
description: "The name of what is selected."
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: "onRename",
|
|
757
|
+
type: "(name: string) => void",
|
|
758
|
+
description: "Renames it in place. Without it, no rename."
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: "onDelete",
|
|
762
|
+
type: "() => void",
|
|
763
|
+
description: "Deletes it. Without it, no delete button."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "deleteDisabledReason",
|
|
767
|
+
type: "string",
|
|
768
|
+
description: "Why it cannot be deleted; the button stays and says so."
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
name: "width",
|
|
772
|
+
type: "number",
|
|
773
|
+
default: "320",
|
|
774
|
+
description: "Its width."
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
name: "labels",
|
|
778
|
+
type: "Partial<InspectorPanelLabels>",
|
|
779
|
+
description: "editing (a function of the name), rename, name, delete."
|
|
780
|
+
}
|
|
781
|
+
]
|
|
782
|
+
}),
|
|
783
|
+
/* @__PURE__ */ jsx(PropsTable, {
|
|
784
|
+
title: "usePanelWidth",
|
|
785
|
+
rows: [
|
|
786
|
+
{
|
|
787
|
+
name: "storageKey",
|
|
788
|
+
type: "string",
|
|
789
|
+
description: "Where the width is saved. Without it, kept for the visit."
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: "defaultWidth",
|
|
793
|
+
type: "number",
|
|
794
|
+
default: "360",
|
|
795
|
+
description: "The width on a first visit."
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
name: "minWidth / maxWidth",
|
|
799
|
+
type: "number",
|
|
800
|
+
default: "240 / 600",
|
|
801
|
+
description: "The range it is kept in."
|
|
802
|
+
}
|
|
803
|
+
]
|
|
804
|
+
})
|
|
805
|
+
]
|
|
806
|
+
})
|
|
807
|
+
]
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
//#endregion
|
|
811
|
+
export { Page, Preview };
|