@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
-
import { a as DocTable, d as Section, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-
|
|
4
|
-
import { t as Playground } from "./Playground-
|
|
3
|
+
import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { t as Playground } from "./Playground-Mk1yIWXb.js";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Button, IconButton, SearchField, Separator, Tooltip } from "@orbitcommerce/constellation";
|
|
8
|
-
import { ArrowClockwiseIcon, ArrowCounterClockwiseIcon, ArrowsClockwiseIcon, ArrowsDownUpIcon, BellIcon, CopySimpleIcon, DotsThreeIcon, DownloadSimpleIcon, FunnelSimpleIcon, GearSixIcon, LinkSimpleIcon, ListBulletsIcon, MagnifyingGlassIcon, PencilSimpleIcon, PlusIcon, QuestionIcon, TextBIcon, TextItalicIcon, TextUnderlineIcon, TrashIcon, XIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
import { ArrowClockwiseIcon, ArrowCounterClockwiseIcon, ArrowsClockwiseIcon, ArrowsDownUpIcon, BellIcon, CopySimpleIcon, DotsThreeIcon, DownloadSimpleIcon, FunnelSimpleIcon, GearSixIcon, LifebuoyIcon, LinkSimpleIcon, ListBulletsIcon, MagnifyingGlassIcon, MicrophoneIcon, PencilSimpleIcon, PlusIcon, QuestionIcon, SparkleIcon, TextBIcon, TextItalicIcon, TextUnderlineIcon, TrashIcon, XIcon } from "@orbitcommerce/constellation/icons";
|
|
9
9
|
//#region src/pages/components/icon-button.tsx
|
|
10
10
|
function Preview() {
|
|
11
11
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -79,6 +79,23 @@ var PLAYGROUND = [
|
|
|
79
79
|
],
|
|
80
80
|
default: "md"
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
prop: "indicator",
|
|
84
|
+
type: "select",
|
|
85
|
+
options: [
|
|
86
|
+
"none",
|
|
87
|
+
"3",
|
|
88
|
+
"120",
|
|
89
|
+
"dot"
|
|
90
|
+
],
|
|
91
|
+
default: "none",
|
|
92
|
+
toAttr: (v) => v === "none" ? null : v === "dot" ? "indicator=\"dot\" indicatorLabel=\"something new\"" : `indicator={${v}} indicatorLabel="${v} unread"`
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
prop: "pressed",
|
|
96
|
+
type: "boolean",
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
82
99
|
{
|
|
83
100
|
prop: "loading",
|
|
84
101
|
type: "boolean",
|
|
@@ -127,8 +144,7 @@ function FormattingToolbar() {
|
|
|
127
144
|
children: /* @__PURE__ */ jsx(IconButton, {
|
|
128
145
|
label,
|
|
129
146
|
size: "sm",
|
|
130
|
-
|
|
131
|
-
"aria-pressed": on[mark],
|
|
147
|
+
pressed: on[mark],
|
|
132
148
|
onClick: () => setOn((s) => ({
|
|
133
149
|
...s,
|
|
134
150
|
[mark]: !s[mark]
|
|
@@ -185,6 +201,23 @@ function FormattingToolbar() {
|
|
|
185
201
|
]
|
|
186
202
|
});
|
|
187
203
|
}
|
|
204
|
+
function AssistantToggle() {
|
|
205
|
+
const [open, setOpen] = useState(true);
|
|
206
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
207
|
+
content: "Assistant",
|
|
208
|
+
shortcut: [
|
|
209
|
+
"mod",
|
|
210
|
+
"shift",
|
|
211
|
+
"K"
|
|
212
|
+
],
|
|
213
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
214
|
+
label: "Assistant",
|
|
215
|
+
pressed: open,
|
|
216
|
+
onClick: () => setOpen((v) => !v),
|
|
217
|
+
children: /* @__PURE__ */ jsx(SparkleIcon, {})
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}
|
|
188
221
|
function RefreshButton() {
|
|
189
222
|
const [syncing, setSyncing] = useState(false);
|
|
190
223
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
@@ -208,7 +241,7 @@ function Page() {
|
|
|
208
241
|
importNames: ["IconButton", "Tooltip"],
|
|
209
242
|
lead: "A round button that holds a single icon, for compact actions in the header, toolbars and rows. It always carries a label: screen readers read it as the button's name, and a tooltip shows it to everyone else.",
|
|
210
243
|
children: [
|
|
211
|
-
/* @__PURE__ */ jsx(Section, {
|
|
244
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
212
245
|
id: "playground",
|
|
213
246
|
title: "Playground",
|
|
214
247
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -226,13 +259,16 @@ function Page() {
|
|
|
226
259
|
label: String(v.label),
|
|
227
260
|
variant: v.variant,
|
|
228
261
|
size: v.size,
|
|
262
|
+
indicator: v.indicator === "none" ? void 0 : v.indicator === "dot" ? "dot" : Number(v.indicator),
|
|
263
|
+
indicatorLabel: v.indicator === "none" ? void 0 : v.indicator === "dot" ? "something new" : `${Number(v.indicator)} unread`,
|
|
264
|
+
pressed: v.pressed ? true : void 0,
|
|
229
265
|
loading: Boolean(v.loading),
|
|
230
266
|
disabled: Boolean(v.disabled),
|
|
231
267
|
children: ICONS[String(v.children)]
|
|
232
268
|
})
|
|
233
269
|
})
|
|
234
270
|
}),
|
|
235
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
271
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
236
272
|
id: "variants",
|
|
237
273
|
title: "Variants",
|
|
238
274
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -291,7 +327,7 @@ function Page() {
|
|
|
291
327
|
rows: [
|
|
292
328
|
[/* @__PURE__ */ jsx("code", { children: "ghost" }), "The default. Header and toolbar actions, row actions, anything that repeats. Quiet until hovered."],
|
|
293
329
|
[/* @__PURE__ */ jsx("code", { children: "secondary" }), "Beside secondary pills, so the group reads as one set, e.g. More actions at the end of a row of buttons."],
|
|
294
|
-
[/* @__PURE__ */ jsx("code", { children: "soft" }), "A toggle that is on
|
|
330
|
+
[/* @__PURE__ */ jsx("code", { children: "soft" }), "Quiet filled actions in dense toolbars. A toggle that is on takes the accent wash and ink with pressed, whatever its variant."],
|
|
295
331
|
[/* @__PURE__ */ jsx("code", { children: "primary" }), "Rarely: the view's one primary action where there is no room for words, such as Add product on a phone."],
|
|
296
332
|
[/* @__PURE__ */ jsx("code", { children: "inverse" }), "Over photos and busy surfaces, e.g. removing an image from a product gallery."],
|
|
297
333
|
[/* @__PURE__ */ jsx("code", { children: "critical" }), "A destructive action standing on its own. In a list of rows a ghost bin is calmer. Confirm first either way."]
|
|
@@ -299,7 +335,7 @@ function Page() {
|
|
|
299
335
|
})
|
|
300
336
|
})]
|
|
301
337
|
}),
|
|
302
|
-
/* @__PURE__ */ jsx(Section, {
|
|
338
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
303
339
|
id: "both-themes",
|
|
304
340
|
title: "In both themes",
|
|
305
341
|
description: /* @__PURE__ */ jsx("p", { children: "Every variant, light and dark side by side. Hover the ghost button to see its tint." }),
|
|
@@ -332,10 +368,248 @@ function Page() {
|
|
|
332
368
|
label: "Delete product",
|
|
333
369
|
variant: "critical",
|
|
334
370
|
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ jsxs("span", {
|
|
373
|
+
className: "icon-button-on-canvas",
|
|
374
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
375
|
+
label: "Notifications",
|
|
376
|
+
indicator: 3,
|
|
377
|
+
indicatorLabel: "3 unread",
|
|
378
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
379
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
380
|
+
label: "Support",
|
|
381
|
+
indicator: "dot",
|
|
382
|
+
indicatorLabel: "something new",
|
|
383
|
+
children: /* @__PURE__ */ jsx(LifebuoyIcon, {})
|
|
384
|
+
})]
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
387
|
+
label: "Assistant",
|
|
388
|
+
pressed: true,
|
|
389
|
+
children: /* @__PURE__ */ jsx(SparkleIcon, {})
|
|
335
390
|
})
|
|
336
391
|
] })
|
|
337
392
|
}),
|
|
338
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
393
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
394
|
+
id: "indicator",
|
|
395
|
+
title: "Count and dot",
|
|
396
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
397
|
+
/* @__PURE__ */ jsx("code", { children: "indicator" }),
|
|
398
|
+
" hangs a count or a dot on the button's shoulder, for a bell with unread notifications or a help button with something new. A number draws a bubble, capped at ",
|
|
399
|
+
/* @__PURE__ */ jsx("code", { children: "indicatorMax" }),
|
|
400
|
+
" ",
|
|
401
|
+
"(99) and then \"99+\"; ",
|
|
402
|
+
/* @__PURE__ */ jsx("code", { children: "'dot'" }),
|
|
403
|
+
" draws a dot; ",
|
|
404
|
+
/* @__PURE__ */ jsx("code", { children: "0" }),
|
|
405
|
+
", ",
|
|
406
|
+
/* @__PURE__ */ jsx("code", { children: "false" }),
|
|
407
|
+
" or nothing draws neither. The bubble bumps each time the count changes."
|
|
408
|
+
] }), /* @__PURE__ */ jsxs("p", { children: [
|
|
409
|
+
"The mark is for sight only. Put what it means in the name with ",
|
|
410
|
+
/* @__PURE__ */ jsx("code", { children: "indicatorLabel" }),
|
|
411
|
+
": \"Notifications, 3 unread\". The ring round it is the colour of the surface the button sits on, the page ground by default; set ",
|
|
412
|
+
/* @__PURE__ */ jsx("code", { children: "--o-indicator-ring" }),
|
|
413
|
+
" where it sits on another."
|
|
414
|
+
] })] }),
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsxs(Example, {
|
|
417
|
+
surface: "ground",
|
|
418
|
+
code: `
|
|
419
|
+
<IconButton label="Notifications" indicator={3} indicatorLabel="3 unread"><BellIcon /></IconButton>
|
|
420
|
+
<IconButton label="Notifications" indicator={120} indicatorLabel="120 unread"><BellIcon /></IconButton>
|
|
421
|
+
<IconButton label="Support" indicator="dot" indicatorLabel="something new"><LifebuoyIcon /></IconButton>
|
|
422
|
+
<IconButton label="Notifications" indicator={0}><BellIcon /></IconButton>`,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
425
|
+
label: "Notifications",
|
|
426
|
+
indicator: 3,
|
|
427
|
+
indicatorLabel: "3 unread",
|
|
428
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
431
|
+
label: "Notifications",
|
|
432
|
+
indicator: 120,
|
|
433
|
+
indicatorLabel: "120 unread",
|
|
434
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
437
|
+
label: "Support",
|
|
438
|
+
indicator: "dot",
|
|
439
|
+
indicatorLabel: "something new",
|
|
440
|
+
children: /* @__PURE__ */ jsx(LifebuoyIcon, {})
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
443
|
+
label: "Notifications",
|
|
444
|
+
indicator: 0,
|
|
445
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
450
|
+
title: "At every size",
|
|
451
|
+
description: /* @__PURE__ */ jsx("p", { children: "The bubble and the dot keep their place against the glyph from 24px to 44px." }),
|
|
452
|
+
children: /* @__PURE__ */ jsxs(Example, {
|
|
453
|
+
surface: "ground",
|
|
454
|
+
code: `
|
|
455
|
+
<IconButton label="Notifications" size="xs" indicator={3} indicatorLabel="3 unread"><BellIcon /></IconButton>
|
|
456
|
+
<IconButton label="Notifications" size="sm" indicator={3} indicatorLabel="3 unread"><BellIcon /></IconButton>
|
|
457
|
+
<IconButton label="Notifications" size="md" indicator={3} indicatorLabel="3 unread"><BellIcon /></IconButton>
|
|
458
|
+
<IconButton label="Notifications" size="lg" indicator={3} indicatorLabel="3 unread"><BellIcon /></IconButton>
|
|
459
|
+
<IconButton label="Support" size="xs" indicator="dot" indicatorLabel="something new"><LifebuoyIcon /></IconButton>
|
|
460
|
+
<IconButton label="Support" size="sm" indicator="dot" indicatorLabel="something new"><LifebuoyIcon /></IconButton>
|
|
461
|
+
<IconButton label="Support" size="md" indicator="dot" indicatorLabel="something new"><LifebuoyIcon /></IconButton>
|
|
462
|
+
<IconButton label="Support" size="lg" indicator="dot" indicatorLabel="something new"><LifebuoyIcon /></IconButton>`,
|
|
463
|
+
children: [[
|
|
464
|
+
"xs",
|
|
465
|
+
"sm",
|
|
466
|
+
"md",
|
|
467
|
+
"lg"
|
|
468
|
+
].map((size) => /* @__PURE__ */ jsx(IconButton, {
|
|
469
|
+
label: "Notifications",
|
|
470
|
+
size,
|
|
471
|
+
indicator: 3,
|
|
472
|
+
indicatorLabel: "3 unread",
|
|
473
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
474
|
+
}, `n${size}`)), [
|
|
475
|
+
"xs",
|
|
476
|
+
"sm",
|
|
477
|
+
"md",
|
|
478
|
+
"lg"
|
|
479
|
+
].map((size) => /* @__PURE__ */ jsx(IconButton, {
|
|
480
|
+
label: "Support",
|
|
481
|
+
size,
|
|
482
|
+
indicator: "dot",
|
|
483
|
+
indicatorLabel: "something new",
|
|
484
|
+
children: /* @__PURE__ */ jsx(LifebuoyIcon, {})
|
|
485
|
+
}, `s${size}`))]
|
|
486
|
+
})
|
|
487
|
+
}),
|
|
488
|
+
/* @__PURE__ */ jsxs(SubSection, {
|
|
489
|
+
title: "Tone",
|
|
490
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
491
|
+
/* @__PURE__ */ jsx("code", { children: "indicatorTone" }),
|
|
492
|
+
" colours the mark when it means something other than \"new\": ",
|
|
493
|
+
/* @__PURE__ */ jsx("code", { children: "warning" }),
|
|
494
|
+
" ",
|
|
495
|
+
"(amber) for something to set up, as on the assistant's brand voice toggle; ",
|
|
496
|
+
/* @__PURE__ */ jsx("code", { children: "negative" }),
|
|
497
|
+
" for something that failed; ",
|
|
498
|
+
/* @__PURE__ */ jsx("code", { children: "positive" }),
|
|
499
|
+
". A count's ink reads on its fill in both themes. Colour says nothing to a screen reader, so say it in ",
|
|
500
|
+
/* @__PURE__ */ jsx("code", { children: "indicatorLabel" }),
|
|
501
|
+
": \"Brand voice, not set up\"."
|
|
502
|
+
] }),
|
|
503
|
+
children: [/* @__PURE__ */ jsxs(Example, {
|
|
504
|
+
code: `
|
|
505
|
+
<IconButton label="Brand voice" pressed indicator="dot" indicatorTone="warning" indicatorLabel="not set up">
|
|
506
|
+
<MicrophoneIcon />
|
|
507
|
+
</IconButton>
|
|
508
|
+
<IconButton label="Imports" indicator={2} indicatorTone="negative" indicatorLabel="2 failed">
|
|
509
|
+
<DownloadSimpleIcon />
|
|
510
|
+
</IconButton>
|
|
511
|
+
<IconButton label="Payouts" indicator="dot" indicatorTone="positive" indicatorLabel="ready">
|
|
512
|
+
<BellIcon />
|
|
513
|
+
</IconButton>`,
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
516
|
+
label: "Brand voice",
|
|
517
|
+
pressed: true,
|
|
518
|
+
indicator: "dot",
|
|
519
|
+
indicatorTone: "warning",
|
|
520
|
+
indicatorLabel: "not set up",
|
|
521
|
+
children: /* @__PURE__ */ jsx(MicrophoneIcon, {})
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
524
|
+
label: "Imports",
|
|
525
|
+
indicator: 2,
|
|
526
|
+
indicatorTone: "negative",
|
|
527
|
+
indicatorLabel: "2 failed",
|
|
528
|
+
children: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
|
|
529
|
+
}),
|
|
530
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
531
|
+
label: "Payouts",
|
|
532
|
+
indicator: "dot",
|
|
533
|
+
indicatorTone: "positive",
|
|
534
|
+
indicatorLabel: "ready",
|
|
535
|
+
children: /* @__PURE__ */ jsx(BellIcon, {})
|
|
536
|
+
})
|
|
537
|
+
]
|
|
538
|
+
}), /* @__PURE__ */ jsxs(ThemePair, { children: [
|
|
539
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
540
|
+
label: "Brand voice",
|
|
541
|
+
pressed: true,
|
|
542
|
+
indicator: "dot",
|
|
543
|
+
indicatorTone: "warning",
|
|
544
|
+
indicatorLabel: "not set up",
|
|
545
|
+
children: /* @__PURE__ */ jsx(MicrophoneIcon, {})
|
|
546
|
+
}),
|
|
547
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
548
|
+
label: "Imports",
|
|
549
|
+
indicator: 12,
|
|
550
|
+
indicatorTone: "warning",
|
|
551
|
+
indicatorLabel: "12 to review",
|
|
552
|
+
children: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
555
|
+
label: "Imports",
|
|
556
|
+
indicator: 2,
|
|
557
|
+
indicatorTone: "negative",
|
|
558
|
+
indicatorLabel: "2 failed",
|
|
559
|
+
children: /* @__PURE__ */ jsx(DownloadSimpleIcon, {})
|
|
560
|
+
})
|
|
561
|
+
] })]
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ jsx(Note, {
|
|
564
|
+
title: "While loading",
|
|
565
|
+
children: "The spinner takes the icon's place, and the count or dot with it."
|
|
566
|
+
})
|
|
567
|
+
]
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
570
|
+
id: "pressed",
|
|
571
|
+
title: "Pressed",
|
|
572
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
573
|
+
/* @__PURE__ */ jsx("code", { children: "pressed" }),
|
|
574
|
+
" makes the button a toggle: on takes the accent wash and ink and ",
|
|
575
|
+
/* @__PURE__ */ jsx("code", { children: "aria-pressed=\"true\"" }),
|
|
576
|
+
", off is ",
|
|
577
|
+
/* @__PURE__ */ jsxs("code", { children: ["pressed=", "{false}"] }),
|
|
578
|
+
" and reads as a toggle that is off. Leave it out for a button that is not a toggle. Use it for a panel's switch, such as an assistant that opens beside the page."
|
|
579
|
+
] }),
|
|
580
|
+
children: [
|
|
581
|
+
/* @__PURE__ */ jsx(Example, {
|
|
582
|
+
code: `
|
|
583
|
+
const [open, setOpen] = useState(true)
|
|
584
|
+
|
|
585
|
+
<Tooltip content="Assistant" shortcut={['mod', 'shift', 'K']}>
|
|
586
|
+
<IconButton label="Assistant" pressed={open} onClick={() => setOpen(!open)}>
|
|
587
|
+
<SparkleIcon />
|
|
588
|
+
</IconButton>
|
|
589
|
+
</Tooltip>`,
|
|
590
|
+
children: /* @__PURE__ */ jsx(AssistantToggle, {})
|
|
591
|
+
}),
|
|
592
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
593
|
+
title: "Open menus",
|
|
594
|
+
children: [
|
|
595
|
+
"A trigger that opens a menu or a popover keeps its hover look while it is open without ",
|
|
596
|
+
/* @__PURE__ */ jsx("code", { children: "pressed" }),
|
|
597
|
+
". Reserve ",
|
|
598
|
+
/* @__PURE__ */ jsx("code", { children: "pressed" }),
|
|
599
|
+
" for toggles that stay on."
|
|
600
|
+
]
|
|
601
|
+
}),
|
|
602
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
603
|
+
title: "Name the thing, not the action",
|
|
604
|
+
children: [
|
|
605
|
+
"Keep ",
|
|
606
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
607
|
+
" the same in both states. A screen reader adds \"pressed\" itself, so a name that says the action (\"Open assistant\") is read \"Open assistant, toggle button, pressed\". Name the thing (\"Assistant\"), as above."
|
|
608
|
+
]
|
|
609
|
+
})
|
|
610
|
+
]
|
|
611
|
+
}),
|
|
612
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
339
613
|
id: "sizes",
|
|
340
614
|
title: "Sizes",
|
|
341
615
|
description: /* @__PURE__ */ jsx("p", { children: "The control scale shared with every control in the kit, so an icon button lines up with the pills and fields beside it. The button is always a circle: its width is its height." }),
|
|
@@ -459,7 +733,7 @@ function Page() {
|
|
|
459
733
|
})
|
|
460
734
|
]
|
|
461
735
|
}),
|
|
462
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
736
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
463
737
|
id: "tooltip",
|
|
464
738
|
title: "With a tooltip",
|
|
465
739
|
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -561,7 +835,7 @@ function Page() {
|
|
|
561
835
|
})
|
|
562
836
|
]
|
|
563
837
|
}),
|
|
564
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
838
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
565
839
|
id: "toolbar",
|
|
566
840
|
title: "In a toolbar",
|
|
567
841
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -573,9 +847,9 @@ function Page() {
|
|
|
573
847
|
}),
|
|
574
848
|
". For a button that switches something on and off, pass",
|
|
575
849
|
" ",
|
|
850
|
+
/* @__PURE__ */ jsx("code", { children: "pressed" }),
|
|
851
|
+
": it takes the accent wash and ink and ",
|
|
576
852
|
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
577
|
-
" and switch it to ",
|
|
578
|
-
/* @__PURE__ */ jsx("code", { children: "soft" }),
|
|
579
853
|
" while it is on. Try the formatting buttons."
|
|
580
854
|
] }),
|
|
581
855
|
children: [/* @__PURE__ */ jsx(Example, {
|
|
@@ -584,13 +858,7 @@ const [bold, setBold] = useState(true)
|
|
|
584
858
|
|
|
585
859
|
<div role="group" aria-label="Text formatting">
|
|
586
860
|
<Tooltip content="Bold" shortcut={['mod', 'B']}>
|
|
587
|
-
<IconButton
|
|
588
|
-
label="Bold"
|
|
589
|
-
size="sm"
|
|
590
|
-
variant={bold ? 'soft' : 'ghost'}
|
|
591
|
-
aria-pressed={bold}
|
|
592
|
-
onClick={() => setBold(!bold)}
|
|
593
|
-
>
|
|
861
|
+
<IconButton label="Bold" size="sm" pressed={bold} onClick={() => setBold(!bold)}>
|
|
594
862
|
<TextBIcon />
|
|
595
863
|
</IconButton>
|
|
596
864
|
</Tooltip>
|
|
@@ -623,7 +891,7 @@ const [bold, setBold] = useState(true)
|
|
|
623
891
|
]
|
|
624
892
|
})]
|
|
625
893
|
}),
|
|
626
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
894
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
627
895
|
id: "loading",
|
|
628
896
|
title: "Loading",
|
|
629
897
|
description: /* @__PURE__ */ jsx("p", { children: "While the action runs, a comet circles the button (teal on every material but primary), presses are ignored and focus stays put. Press the refresh button to see it." }),
|
|
@@ -647,11 +915,11 @@ const [syncing, setSyncing] = useState(false)
|
|
|
647
915
|
children: "The spinner takes the icon's place, so the circle says something is happening but not what. For actions that take more than a moment, a Button with words (\"Syncing catalogue\") tells people more."
|
|
648
916
|
})]
|
|
649
917
|
}),
|
|
650
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
651
919
|
id: "disabled",
|
|
652
920
|
title: "Disabled",
|
|
653
921
|
description: /* @__PURE__ */ jsx("p", { children: "Drops to 45% and can no longer be focused, so a keyboard user never reaches its tooltip. Undo and redo are the fair use: when there is nothing to undo, the reason is obvious. Otherwise leave it enabled and explain the problem when it is pressed." }),
|
|
654
|
-
children: /* @__PURE__ */ jsxs(Example, {
|
|
922
|
+
children: [/* @__PURE__ */ jsxs(Example, {
|
|
655
923
|
code: `
|
|
656
924
|
<IconButton label="Undo" disabled><ArrowCounterClockwiseIcon /></IconButton>
|
|
657
925
|
<IconButton label="Redo" disabled><ArrowClockwiseIcon /></IconButton>
|
|
@@ -674,9 +942,33 @@ const [syncing, setSyncing] = useState(false)
|
|
|
674
942
|
children: /* @__PURE__ */ jsx(DotsThreeIcon, {})
|
|
675
943
|
})
|
|
676
944
|
]
|
|
677
|
-
})
|
|
945
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
946
|
+
title: "Off, with a reason",
|
|
947
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
948
|
+
"For anything else, give the reason: ",
|
|
949
|
+
/* @__PURE__ */ jsx("code", { children: "disabledReason" }),
|
|
950
|
+
" keeps the button focusable and makes the reason its description. Inside the Tooltip that shows its name, the reason goes under the name in the same tip rather than opening a second one, and the tip opens on a tap too. Hover, focus or tap it."
|
|
951
|
+
] }),
|
|
952
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
953
|
+
code: `
|
|
954
|
+
<Tooltip content="Delete card">
|
|
955
|
+
<IconButton label="Delete card" disabledReason="Set another card as the default first.">
|
|
956
|
+
<TrashIcon />
|
|
957
|
+
</IconButton>
|
|
958
|
+
</Tooltip>`,
|
|
959
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
960
|
+
content: "Delete card",
|
|
961
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
962
|
+
label: "Delete card",
|
|
963
|
+
variant: "secondary",
|
|
964
|
+
disabledReason: "Set another card as the default first.",
|
|
965
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
966
|
+
})
|
|
967
|
+
})
|
|
968
|
+
})
|
|
969
|
+
})]
|
|
678
970
|
}),
|
|
679
|
-
/* @__PURE__ */ jsxs(Section, {
|
|
971
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
680
972
|
id: "guidelines",
|
|
681
973
|
title: "Guidelines",
|
|
682
974
|
children: [
|
|
@@ -751,7 +1043,7 @@ const [syncing, setSyncing] = useState(false)
|
|
|
751
1043
|
] })
|
|
752
1044
|
]
|
|
753
1045
|
}),
|
|
754
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1046
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
755
1047
|
id: "accessibility",
|
|
756
1048
|
title: "Accessibility",
|
|
757
1049
|
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
@@ -764,8 +1056,18 @@ const [syncing, setSyncing] = useState(false)
|
|
|
764
1056
|
"A tooltip is not the name. While it is open it is linked to the button as a description, so keep it the same as the label, plus the shortcut if there is one.",
|
|
765
1057
|
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
766
1058
|
"Toggles take ",
|
|
1059
|
+
/* @__PURE__ */ jsx("code", { children: "pressed" }),
|
|
1060
|
+
", which sets ",
|
|
767
1061
|
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
768
|
-
", so screen readers announce them as on or off."
|
|
1062
|
+
", so screen readers announce them as on or off. Their ",
|
|
1063
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
1064
|
+
" names the thing and does not change with the state."
|
|
1065
|
+
] }),
|
|
1066
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1067
|
+
"A count or a dot is hidden from assistive tech. Say what it means in the name with",
|
|
1068
|
+
" ",
|
|
1069
|
+
/* @__PURE__ */ jsx("code", { children: "indicatorLabel" }),
|
|
1070
|
+
" (\"Notifications, 3 unread\"), so the number is never the only signal."
|
|
769
1071
|
] }),
|
|
770
1072
|
"Renders a native button, so Enter and Space press it. The teal focus ring is 2px, offset from the circle, and shows for keyboard focus only.",
|
|
771
1073
|
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
@@ -780,14 +1082,14 @@ const [syncing, setSyncing] = useState(false)
|
|
|
780
1082
|
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("code", { children: "xs" }), " is 24px, the smallest target WCAG 2.2 allows. Leave space around it."] })
|
|
781
1083
|
] })
|
|
782
1084
|
}),
|
|
783
|
-
/* @__PURE__ */ jsx(Section, {
|
|
1085
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
784
1086
|
id: "props",
|
|
785
1087
|
title: "Props",
|
|
786
1088
|
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
787
1089
|
"Also accepts every native button attribute, such as ",
|
|
788
|
-
/* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
|
|
789
|
-
" and ",
|
|
790
1090
|
/* @__PURE__ */ jsx("code", { children: "type" }),
|
|
1091
|
+
" and ",
|
|
1092
|
+
/* @__PURE__ */ jsx("code", { children: "onClick" }),
|
|
791
1093
|
"."
|
|
792
1094
|
] }),
|
|
793
1095
|
children: /* @__PURE__ */ jsx(PropsTable, { rows: [
|
|
@@ -830,6 +1132,43 @@ const [syncing, setSyncing] = useState(false)
|
|
|
830
1132
|
default: "'md'",
|
|
831
1133
|
description: "A circle 24, 30, 36 or 44px across."
|
|
832
1134
|
},
|
|
1135
|
+
{
|
|
1136
|
+
name: "indicator",
|
|
1137
|
+
type: "number | 'dot' | false",
|
|
1138
|
+
description: "A count bubble or an unread dot on the shoulder. 0, false or nothing draws neither. Hidden from assistive tech."
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
name: "indicatorLabel",
|
|
1142
|
+
type: "string",
|
|
1143
|
+
description: "Added to the accessible name while the indicator shows: \"Notifications, 3 unread\"."
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
name: "indicatorMax",
|
|
1147
|
+
type: "number",
|
|
1148
|
+
default: "99",
|
|
1149
|
+
description: "The largest count drawn as itself. Above it the bubble says \"99+\"."
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
name: "indicatorTone",
|
|
1153
|
+
type: "'accent' | 'positive' | 'warning' | 'negative'",
|
|
1154
|
+
default: "'accent'",
|
|
1155
|
+
description: "The mark's colour, when it means something other than new. Say what in indicatorLabel."
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
name: "disabledReason",
|
|
1159
|
+
type: "ReactNode",
|
|
1160
|
+
description: "Off but focusable, with the reason as its description and tooltip (under the name, inside a Tooltip of its own)."
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: "refreshing",
|
|
1164
|
+
type: "boolean",
|
|
1165
|
+
description: "A refetch is running: the glyph turns, presses wait. See Button."
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "pressed",
|
|
1169
|
+
type: "boolean",
|
|
1170
|
+
description: "A toggle: true takes the accent wash and ink and aria-pressed=\"true\", false aria-pressed=\"false\". Leave it out for a plain button. On a link (asChild) it only draws the wash. Keep the label the same in both states."
|
|
1171
|
+
},
|
|
833
1172
|
{
|
|
834
1173
|
name: "loading",
|
|
835
1174
|
type: "boolean",
|