@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,865 @@
|
|
|
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, n as CodeBlock$1, o as Example, p as SubSection, s as Guidelines } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { d as formatGbp, f as formatGbpTick, g as takingsSeries } from "./_figures-data-DaDvB7Nm.js";
|
|
5
|
+
import { useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { AreaChart, Badge, Button, Menu, MenuContent, MenuItem, MenuTrigger, RollingNumber, SegmentedControl, Sidebar, SidebarItem, SidebarNav, SidebarSection, duration, ease, spring } from "@orbitcommerce/constellation";
|
|
8
|
+
import { ArrowClockwiseIcon, CaretDownIcon, ChartLineUpIcon, CopySimpleIcon, HouseIcon, PackageIcon, PlayIcon, PlusIcon, PrinterIcon, ReceiptIcon, TrashIcon, UsersThreeIcon } from "@orbitcommerce/constellation/icons";
|
|
9
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
10
|
+
//#region src/pages/foundations/motion.tsx
|
|
11
|
+
var DURATIONS = [
|
|
12
|
+
{
|
|
13
|
+
token: "instant",
|
|
14
|
+
use: "A tooltip leaving; the next tooltip along a toolbar"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
token: "fast",
|
|
18
|
+
use: "Hover and colour changes; most exits"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
token: "base",
|
|
22
|
+
use: "Fades behind overlays; shadows"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
token: "slow",
|
|
26
|
+
use: "A dialog arriving; a press springing back"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
token: "slower",
|
|
30
|
+
use: "The sidebar folding to its rail; the phone drawer"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
token: "focal",
|
|
34
|
+
use: "An area chart drawing its line: the one authored moment"
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
var EASINGS = [
|
|
38
|
+
{
|
|
39
|
+
token: "out",
|
|
40
|
+
name: "Arrive",
|
|
41
|
+
use: "Most state changes: confident, then gentle."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
token: "in",
|
|
45
|
+
name: "Leave",
|
|
46
|
+
use: "Things on their way out, such as a tooltip."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
token: "in-out",
|
|
50
|
+
name: "Move",
|
|
51
|
+
use: "A move between two resting places: the comet's pass."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
token: "brand",
|
|
55
|
+
name: "Orbit",
|
|
56
|
+
use: "Authored moments. Shared with orbitcommerce.net."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
token: "spring",
|
|
60
|
+
name: "Settle",
|
|
61
|
+
use: "Arrivals with a whisper of overshoot: overlays, presses."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
token: "spring-bouncy",
|
|
65
|
+
name: "Pop",
|
|
66
|
+
use: "Small confirmations only: a count changing, a dot landing."
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
var SPRINGS = [
|
|
70
|
+
{
|
|
71
|
+
name: "snappy",
|
|
72
|
+
use: "Pills, thumbs and indicators: the nav pill, the segmented thumb."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "soft",
|
|
76
|
+
use: "Panels, drawers, the command palette opening."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "gentle",
|
|
80
|
+
use: "Large layout moves."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "land",
|
|
84
|
+
use: "Critically damped, so it lands exactly: the palette folding back into its pill."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "bouncy",
|
|
88
|
+
use: "Small celebratory pops."
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
function useRootToken(name) {
|
|
92
|
+
const [value, setValue] = useState("");
|
|
93
|
+
useLayoutEffect(() => {
|
|
94
|
+
setValue(getComputedStyle(document.documentElement).getPropertyValue(name).trim());
|
|
95
|
+
}, [name]);
|
|
96
|
+
return value;
|
|
97
|
+
}
|
|
98
|
+
function bezierPoints(x1, y1, x2, y2) {
|
|
99
|
+
const points = [];
|
|
100
|
+
for (let i = 0; i <= 48; i++) {
|
|
101
|
+
const t = i / 48;
|
|
102
|
+
const u = 1 - t;
|
|
103
|
+
points.push([3 * u * u * t * x1 + 3 * u * t * t * x2 + t ** 3, 3 * u * u * t * y1 + 3 * u * t * t * y2 + t ** 3]);
|
|
104
|
+
}
|
|
105
|
+
return points;
|
|
106
|
+
}
|
|
107
|
+
/** The stops of a CSS linear() easing, with missing positions filled in the way the spec does. */
|
|
108
|
+
function linearPoints(body) {
|
|
109
|
+
const stops = [];
|
|
110
|
+
for (const entry of body.split(",")) {
|
|
111
|
+
const [v = "0", ...positions] = entry.trim().split(/\s+/);
|
|
112
|
+
if (positions.length === 0) stops.push({
|
|
113
|
+
v: parseFloat(v),
|
|
114
|
+
p: null
|
|
115
|
+
});
|
|
116
|
+
for (const p of positions) stops.push({
|
|
117
|
+
v: parseFloat(v),
|
|
118
|
+
p: parseFloat(p) / 100
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (stops.length < 2) return [[0, 0], [1, 1]];
|
|
122
|
+
stops[0].p ??= 0;
|
|
123
|
+
stops[stops.length - 1].p ??= 1;
|
|
124
|
+
let max = 0;
|
|
125
|
+
for (const s of stops) {
|
|
126
|
+
if (s.p === null) continue;
|
|
127
|
+
s.p = Math.max(s.p, max);
|
|
128
|
+
max = s.p;
|
|
129
|
+
}
|
|
130
|
+
for (let i = 1; i < stops.length; i++) {
|
|
131
|
+
if (stops[i].p !== null) continue;
|
|
132
|
+
let end = i;
|
|
133
|
+
while (stops[end].p === null) end++;
|
|
134
|
+
const from = stops[i - 1].p;
|
|
135
|
+
const to = stops[end].p;
|
|
136
|
+
for (let k = i; k < end; k++) stops[k].p = from + (to - from) * (k - i + 1) / (end - i + 1);
|
|
137
|
+
i = end;
|
|
138
|
+
}
|
|
139
|
+
return stops.map((s) => [s.p, s.v]);
|
|
140
|
+
}
|
|
141
|
+
function curvePoints(value) {
|
|
142
|
+
const bezier = value.match(/^cubic-bezier\(([^)]*)\)$/);
|
|
143
|
+
if (bezier) {
|
|
144
|
+
const [x1 = 0, y1 = 0, x2 = 1, y2 = 1] = (bezier[1] ?? "").split(",").map((n) => parseFloat(n));
|
|
145
|
+
return bezierPoints(x1, y1, x2, y2);
|
|
146
|
+
}
|
|
147
|
+
const linear = value.match(/^linear\((.*)\)$/);
|
|
148
|
+
if (linear) return linearPoints(linear[1] ?? "");
|
|
149
|
+
return [[0, 0], [1, 1]];
|
|
150
|
+
}
|
|
151
|
+
/** Progress against time, with room above 1 so an overshoot shows. */
|
|
152
|
+
function Curve({ value }) {
|
|
153
|
+
const points = useMemo(() => curvePoints(value), [value]);
|
|
154
|
+
const y = (v) => 6 + (1 - (v + .15) / 1.45) * 68;
|
|
155
|
+
const x = (p) => 4 + p * 92;
|
|
156
|
+
const d = points.map(([p, v], i) => `${i ? "L" : "M"}${x(p).toFixed(2)},${y(v).toFixed(2)}`).join(" ");
|
|
157
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
158
|
+
className: "motion-curve",
|
|
159
|
+
viewBox: "0 0 100 80",
|
|
160
|
+
"aria-hidden": "true",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx("line", {
|
|
163
|
+
x1: x(0),
|
|
164
|
+
x2: x(1),
|
|
165
|
+
y1: y(0),
|
|
166
|
+
y2: y(0),
|
|
167
|
+
className: "motion-curve__guide"
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ jsx("line", {
|
|
170
|
+
x1: x(0),
|
|
171
|
+
x2: x(1),
|
|
172
|
+
y1: y(1),
|
|
173
|
+
y2: y(1),
|
|
174
|
+
className: "motion-curve__guide",
|
|
175
|
+
"data-target": ""
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsx("path", {
|
|
178
|
+
d,
|
|
179
|
+
className: "motion-curve__line"
|
|
180
|
+
})
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** A mark that crosses its track with a CSS duration and easing. A new `run` restarts it. */
|
|
185
|
+
function CssTrack({ run, time, easing }) {
|
|
186
|
+
return /* @__PURE__ */ jsx("span", {
|
|
187
|
+
className: "motion-track",
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
190
|
+
className: "motion-mark",
|
|
191
|
+
"data-run": run > 0 ? "" : void 0,
|
|
192
|
+
style: {
|
|
193
|
+
"--motion-dur": time,
|
|
194
|
+
"--motion-ease": easing
|
|
195
|
+
}
|
|
196
|
+
}, run)
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function PlayButton({ onPlay, label = "Play" }) {
|
|
200
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
201
|
+
size: "sm",
|
|
202
|
+
icon: /* @__PURE__ */ jsx(PlayIcon, { weight: "fill" }),
|
|
203
|
+
onClick: onPlay,
|
|
204
|
+
children: label
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function ReducedNote() {
|
|
208
|
+
if (!useReducedMotion()) return null;
|
|
209
|
+
return /* @__PURE__ */ jsx("p", {
|
|
210
|
+
className: "motion-reduced",
|
|
211
|
+
children: "Your device asks for reduced motion, so the marks jump to where they end instead of travelling."
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function DurationDemo() {
|
|
215
|
+
const [run, setRun] = useState(0);
|
|
216
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
217
|
+
className: "motion-demo",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsxs("div", {
|
|
220
|
+
className: "motion-demo__bar",
|
|
221
|
+
children: [/* @__PURE__ */ jsx(PlayButton, { onPlay: () => setRun((r) => r + 1) }), /* @__PURE__ */ jsx("span", { children: "Every mark on the same curve, --o-ease-out." })]
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ jsx(ReducedNote, {}),
|
|
224
|
+
/* @__PURE__ */ jsx("div", {
|
|
225
|
+
className: "motion-rows",
|
|
226
|
+
children: DURATIONS.map((d) => /* @__PURE__ */ jsxs("div", {
|
|
227
|
+
className: "motion-row",
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ jsxs("span", {
|
|
230
|
+
className: "motion-row__label",
|
|
231
|
+
children: [/* @__PURE__ */ jsxs("code", { children: ["--o-dur-", d.token] }), /* @__PURE__ */ jsxs("strong", {
|
|
232
|
+
className: "o-num",
|
|
233
|
+
children: [Math.round(duration[d.token] * 1e3), "ms"]
|
|
234
|
+
})]
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ jsx(CssTrack, {
|
|
237
|
+
run,
|
|
238
|
+
time: `var(--o-dur-${d.token})`,
|
|
239
|
+
easing: "var(--o-ease-out)"
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ jsx("span", {
|
|
242
|
+
className: "motion-row__use",
|
|
243
|
+
children: d.use
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
}, d.token))
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function EasingRow({ token, name, use, run }) {
|
|
252
|
+
const value = useRootToken(`--o-ease-${token}`);
|
|
253
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
254
|
+
className: "motion-ease",
|
|
255
|
+
children: [/* @__PURE__ */ jsx(Curve, { value }), /* @__PURE__ */ jsxs("div", {
|
|
256
|
+
className: "motion-ease__body",
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsxs("span", {
|
|
259
|
+
className: "motion-ease__name",
|
|
260
|
+
children: [/* @__PURE__ */ jsx("strong", { children: name }), /* @__PURE__ */ jsxs("code", { children: ["--o-ease-", token] })]
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ jsx(CssTrack, {
|
|
263
|
+
run,
|
|
264
|
+
time: "var(--o-dur-focal)",
|
|
265
|
+
easing: `var(--o-ease-${token})`
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ jsx("span", {
|
|
268
|
+
className: "motion-ease__use",
|
|
269
|
+
children: use
|
|
270
|
+
})
|
|
271
|
+
]
|
|
272
|
+
})]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function EasingDemo() {
|
|
276
|
+
const [run, setRun] = useState(0);
|
|
277
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
278
|
+
className: "motion-demo",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsxs("div", {
|
|
281
|
+
className: "motion-demo__bar",
|
|
282
|
+
children: [/* @__PURE__ */ jsx(PlayButton, { onPlay: () => setRun((r) => r + 1) }), /* @__PURE__ */ jsx("span", { children: "Every mark over 720ms, so the curves can be compared." })]
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ jsx(ReducedNote, {}),
|
|
285
|
+
/* @__PURE__ */ jsx("div", {
|
|
286
|
+
className: "motion-eases",
|
|
287
|
+
children: EASINGS.map((e) => /* @__PURE__ */ jsx(EasingRow, {
|
|
288
|
+
...e,
|
|
289
|
+
run
|
|
290
|
+
}, e.token))
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function SpringDemo() {
|
|
296
|
+
const reduce = useReducedMotion();
|
|
297
|
+
const [run, setRun] = useState(0);
|
|
298
|
+
const track = useRef(null);
|
|
299
|
+
const [travel, setTravel] = useState(0);
|
|
300
|
+
useLayoutEffect(() => {
|
|
301
|
+
const el = track.current;
|
|
302
|
+
if (!el) return;
|
|
303
|
+
const measure = () => setTravel(Math.max(0, el.clientWidth - 24));
|
|
304
|
+
measure();
|
|
305
|
+
const observer = new ResizeObserver(measure);
|
|
306
|
+
observer.observe(el);
|
|
307
|
+
return () => observer.disconnect();
|
|
308
|
+
}, []);
|
|
309
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
310
|
+
className: "motion-demo",
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ jsxs("div", {
|
|
313
|
+
className: "motion-demo__bar",
|
|
314
|
+
children: [/* @__PURE__ */ jsx(PlayButton, { onPlay: () => setRun((r) => r + 1) }), /* @__PURE__ */ jsx("span", { children: "The presets from motion/react, each moving the same distance." })]
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ jsx(ReducedNote, {}),
|
|
317
|
+
/* @__PURE__ */ jsx("div", {
|
|
318
|
+
className: "motion-rows",
|
|
319
|
+
children: SPRINGS.map((s, i) => {
|
|
320
|
+
const preset = spring[s.name];
|
|
321
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
322
|
+
className: "motion-row",
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ jsxs("span", {
|
|
325
|
+
className: "motion-row__label",
|
|
326
|
+
children: [/* @__PURE__ */ jsxs("code", { children: ["spring.", s.name] }), /* @__PURE__ */ jsxs("strong", {
|
|
327
|
+
className: "o-num",
|
|
328
|
+
children: [
|
|
329
|
+
preset.stiffness,
|
|
330
|
+
"/",
|
|
331
|
+
preset.damping,
|
|
332
|
+
preset.mass !== 1 ? `/${preset.mass}` : ""
|
|
333
|
+
]
|
|
334
|
+
})]
|
|
335
|
+
}),
|
|
336
|
+
/* @__PURE__ */ jsx("span", {
|
|
337
|
+
className: "motion-track",
|
|
338
|
+
ref: i === 0 ? track : void 0,
|
|
339
|
+
"aria-hidden": "true",
|
|
340
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
341
|
+
className: "motion-mark",
|
|
342
|
+
initial: { x: 0 },
|
|
343
|
+
animate: { x: run > 0 ? travel : 0 },
|
|
344
|
+
transition: reduce ? { duration: 0 } : preset
|
|
345
|
+
}, run)
|
|
346
|
+
}),
|
|
347
|
+
/* @__PURE__ */ jsx("span", {
|
|
348
|
+
className: "motion-row__use",
|
|
349
|
+
children: s.use
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
}, s.name);
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
var GBP = {
|
|
359
|
+
style: "currency",
|
|
360
|
+
currency: "GBP"
|
|
361
|
+
};
|
|
362
|
+
var SALE_AMOUNTS = [
|
|
363
|
+
129,
|
|
364
|
+
45,
|
|
365
|
+
249,
|
|
366
|
+
68.5,
|
|
367
|
+
18.99,
|
|
368
|
+
579
|
|
369
|
+
];
|
|
370
|
+
function RollingDemo() {
|
|
371
|
+
const [value, setValue] = useState(2743.44);
|
|
372
|
+
const [sales, setSales] = useState(0);
|
|
373
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
374
|
+
className: "motion-rolling",
|
|
375
|
+
children: [/* @__PURE__ */ jsx(RollingNumber, {
|
|
376
|
+
className: "motion-rolling__value",
|
|
377
|
+
value,
|
|
378
|
+
format: GBP,
|
|
379
|
+
animateOnMount: false,
|
|
380
|
+
live: true
|
|
381
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
382
|
+
size: "sm",
|
|
383
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
384
|
+
onClick: () => {
|
|
385
|
+
setValue((v) => Math.round((v + (SALE_AMOUNTS[sales % SALE_AMOUNTS.length] ?? 45)) * 100) / 100);
|
|
386
|
+
setSales((n) => n + 1);
|
|
387
|
+
},
|
|
388
|
+
children: "Take a sale"
|
|
389
|
+
})]
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
var NAV = [
|
|
393
|
+
{
|
|
394
|
+
id: "home",
|
|
395
|
+
label: "Home",
|
|
396
|
+
icon: HouseIcon
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: "orders",
|
|
400
|
+
label: "Orders",
|
|
401
|
+
icon: ReceiptIcon,
|
|
402
|
+
badge: 5
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
id: "products",
|
|
406
|
+
label: "Products",
|
|
407
|
+
icon: PackageIcon
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
id: "customers",
|
|
411
|
+
label: "Customers",
|
|
412
|
+
icon: UsersThreeIcon
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: "analytics",
|
|
416
|
+
label: "Analytics",
|
|
417
|
+
icon: ChartLineUpIcon
|
|
418
|
+
}
|
|
419
|
+
];
|
|
420
|
+
function NavPillDemo() {
|
|
421
|
+
const [active, setActive] = useState("orders");
|
|
422
|
+
return /* @__PURE__ */ jsx("div", {
|
|
423
|
+
className: "motion-nav",
|
|
424
|
+
children: /* @__PURE__ */ jsx(Sidebar, {
|
|
425
|
+
label: "Example sidebar",
|
|
426
|
+
children: /* @__PURE__ */ jsx(SidebarNav, {
|
|
427
|
+
label: "Example pages",
|
|
428
|
+
children: /* @__PURE__ */ jsx(SidebarSection, {
|
|
429
|
+
title: "Store",
|
|
430
|
+
children: NAV.map(({ id, label, icon: Glyph, badge }) => /* @__PURE__ */ jsx(SidebarItem, {
|
|
431
|
+
itemId: id,
|
|
432
|
+
label,
|
|
433
|
+
icon: /* @__PURE__ */ jsx(Glyph, { weight: "regular" }),
|
|
434
|
+
activeIcon: /* @__PURE__ */ jsx(Glyph, { weight: "duotone" }),
|
|
435
|
+
active: active === id,
|
|
436
|
+
badge,
|
|
437
|
+
badgeLabel: badge ? `${badge} to fulfil` : void 0,
|
|
438
|
+
onSelect: () => setActive(id)
|
|
439
|
+
}, id))
|
|
440
|
+
})
|
|
441
|
+
})
|
|
442
|
+
})
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
var TAKINGS_14_DAYS = takingsSeries(14, "none");
|
|
446
|
+
function AreaChartDemo() {
|
|
447
|
+
const [run, setRun] = useState(0);
|
|
448
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
449
|
+
className: "motion-chart",
|
|
450
|
+
children: [/* @__PURE__ */ jsx(AreaChart, {
|
|
451
|
+
data: TAKINGS_14_DAYS,
|
|
452
|
+
height: 180,
|
|
453
|
+
formatValue: formatGbp,
|
|
454
|
+
formatTick: formatGbpTick
|
|
455
|
+
}, run), /* @__PURE__ */ jsx(Button, {
|
|
456
|
+
size: "sm",
|
|
457
|
+
variant: "soft",
|
|
458
|
+
icon: /* @__PURE__ */ jsx(ArrowClockwiseIcon, {}),
|
|
459
|
+
onClick: () => setRun((r) => r + 1),
|
|
460
|
+
children: "Replay arrival"
|
|
461
|
+
})]
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
function CountDemo() {
|
|
465
|
+
const [count, setCount] = useState(4);
|
|
466
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
467
|
+
className: "motion-count",
|
|
468
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
469
|
+
className: "motion-count__label",
|
|
470
|
+
children: ["Orders to fulfil ", /* @__PURE__ */ jsx(Badge, {
|
|
471
|
+
tone: "accent",
|
|
472
|
+
variant: "solid",
|
|
473
|
+
children: count
|
|
474
|
+
})]
|
|
475
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
476
|
+
size: "sm",
|
|
477
|
+
icon: /* @__PURE__ */ jsx(PlusIcon, {}),
|
|
478
|
+
onClick: () => setCount((n) => n + 1),
|
|
479
|
+
children: "New order"
|
|
480
|
+
})]
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
function DeviceSetting() {
|
|
484
|
+
const reduce = useReducedMotion();
|
|
485
|
+
return /* @__PURE__ */ jsx(Note, {
|
|
486
|
+
title: "On this device",
|
|
487
|
+
children: reduce ? "Reduced motion is on, so every demo on this page shows its still version." : "Full motion is on. Turn on reduced motion in your system settings to see every demo on this page hold still."
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
function Page() {
|
|
491
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
492
|
+
title: "Motion",
|
|
493
|
+
lead: "Orbital, and always explaining a change. Things settle into place on springs, light circles what is working, and nothing moves at idle unless it is live.",
|
|
494
|
+
importNames: [
|
|
495
|
+
"spring",
|
|
496
|
+
"ease",
|
|
497
|
+
"duration"
|
|
498
|
+
],
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
501
|
+
id: "durations",
|
|
502
|
+
title: "Durations",
|
|
503
|
+
description: /* @__PURE__ */ jsx("p", { children: "Six steps from instant to focal. Exits run faster than entrances: a menu opens in 200ms and closes in 110ms, a dialog arrives in 320ms and leaves in 150ms." }),
|
|
504
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
505
|
+
align: "fill",
|
|
506
|
+
children: /* @__PURE__ */ jsx(DurationDemo, {})
|
|
507
|
+
})
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
510
|
+
id: "easings",
|
|
511
|
+
title: "Easings",
|
|
512
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
513
|
+
"Arrivals take the confident ease-out or the settle spring. Authored moments take the Orbit curve. The two springs are sampled into ",
|
|
514
|
+
/* @__PURE__ */ jsx("code", { children: "linear()" }),
|
|
515
|
+
", so CSS can settle with an overshoot: about 3% for settle and 12% for pop. The curves below are drawn from the live tokens."
|
|
516
|
+
] }),
|
|
517
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
518
|
+
align: "fill",
|
|
519
|
+
children: /* @__PURE__ */ jsx(EasingDemo, {})
|
|
520
|
+
}), /* @__PURE__ */ jsx(Note, {
|
|
521
|
+
title: "Nothing slides in on linear time",
|
|
522
|
+
children: "The Settle Rule: things arrive on a curve that settles. Linear time is kept for loops that must turn at a steady speed, such as the comet in orbit while a button is loading."
|
|
523
|
+
})]
|
|
524
|
+
}),
|
|
525
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
526
|
+
id: "springs",
|
|
527
|
+
title: "Springs in JavaScript",
|
|
528
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
529
|
+
"Motion driven from React uses ",
|
|
530
|
+
/* @__PURE__ */ jsx("code", { children: "motion/react" }),
|
|
531
|
+
" with the presets from the package, so a shared layout glides on the same spring everywhere. Figures are stiffness and damping, then mass where it is not 1."
|
|
532
|
+
] }),
|
|
533
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
534
|
+
align: "fill",
|
|
535
|
+
code: `
|
|
536
|
+
import { motion, useReducedMotion } from 'motion/react'
|
|
537
|
+
import { spring } from '@orbitcommerce/constellation'
|
|
538
|
+
|
|
539
|
+
const reduce = useReducedMotion()
|
|
540
|
+
|
|
541
|
+
<motion.span layoutId="thumb" transition={reduce ? { duration: 0 } : spring.snappy} />`,
|
|
542
|
+
children: /* @__PURE__ */ jsx(SpringDemo, {})
|
|
543
|
+
}), /* @__PURE__ */ jsx(DocTable, {
|
|
544
|
+
columns: ["Export", "Values"],
|
|
545
|
+
rows: [
|
|
546
|
+
[/* @__PURE__ */ jsx("code", { children: "spring" }), "snappy, soft, gentle, land and bouncy, as motion transitions."],
|
|
547
|
+
[/* @__PURE__ */ jsx("code", { children: "ease" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
548
|
+
/* @__PURE__ */ jsx("code", { children: "out" }),
|
|
549
|
+
" [",
|
|
550
|
+
ease.out.join(", "),
|
|
551
|
+
"], ",
|
|
552
|
+
/* @__PURE__ */ jsx("code", { children: "inOut" }),
|
|
553
|
+
" [",
|
|
554
|
+
ease.inOut.join(", "),
|
|
555
|
+
"], ",
|
|
556
|
+
/* @__PURE__ */ jsx("code", { children: "brand" }),
|
|
557
|
+
" [",
|
|
558
|
+
ease.brand.join(", "),
|
|
559
|
+
"]"
|
|
560
|
+
] })],
|
|
561
|
+
[/* @__PURE__ */ jsx("code", { children: "duration" }), /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
562
|
+
"In seconds, matching the CSS steps:",
|
|
563
|
+
" ",
|
|
564
|
+
Object.entries(duration).map(([k, v]) => `${k} ${v}`).join(", "),
|
|
565
|
+
"."
|
|
566
|
+
] })]
|
|
567
|
+
]
|
|
568
|
+
})]
|
|
569
|
+
}),
|
|
570
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
571
|
+
id: "signature",
|
|
572
|
+
title: "Signature moments",
|
|
573
|
+
description: /* @__PURE__ */ jsx("p", { children: "Four moments carry the brand. Each lives in a component; try them here." }),
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
576
|
+
title: "The comet",
|
|
577
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
578
|
+
"Hover or focus the primary pill: a point of light with a fading tail passes once around it in 1.35s. While the action runs, it stays in orbit. See ",
|
|
579
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
580
|
+
to: "/components/button",
|
|
581
|
+
children: "Button"
|
|
582
|
+
}),
|
|
583
|
+
"."
|
|
584
|
+
] }),
|
|
585
|
+
children: /* @__PURE__ */ jsxs(Example, {
|
|
586
|
+
code: `
|
|
587
|
+
<Button variant="primary">Publish theme</Button>
|
|
588
|
+
<Button variant="primary" loading>Syncing catalogue</Button>`,
|
|
589
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
590
|
+
variant: "primary",
|
|
591
|
+
children: "Publish theme"
|
|
592
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
593
|
+
variant: "primary",
|
|
594
|
+
loading: true,
|
|
595
|
+
children: "Syncing catalogue"
|
|
596
|
+
})]
|
|
597
|
+
})
|
|
598
|
+
}),
|
|
599
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
600
|
+
title: "The gliding nav pill",
|
|
601
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
602
|
+
"One white pill marks the current page and glides between pages; one soft pill follows the pointer down the list. Both share a layout on the snappy spring, so the eye follows a single shape. Choose a page. See",
|
|
603
|
+
" ",
|
|
604
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
605
|
+
to: "/patterns/app-shell",
|
|
606
|
+
children: "App shell"
|
|
607
|
+
}),
|
|
608
|
+
"."
|
|
609
|
+
] }),
|
|
610
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
611
|
+
surface: "ground",
|
|
612
|
+
align: "center",
|
|
613
|
+
children: /* @__PURE__ */ jsx(NavPillDemo, {})
|
|
614
|
+
})
|
|
615
|
+
}),
|
|
616
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
617
|
+
title: "Rolling digits",
|
|
618
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
619
|
+
"Every digit is a reel. A change rolls each column like an odometer in 0.9s on the settle spring, each column to the right starting 25ms later. See ",
|
|
620
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
621
|
+
to: "/components/rolling-number",
|
|
622
|
+
children: "Rolling number"
|
|
623
|
+
}),
|
|
624
|
+
"."
|
|
625
|
+
] }),
|
|
626
|
+
children: /* @__PURE__ */ jsx(Example, { children: /* @__PURE__ */ jsx(RollingDemo, {}) })
|
|
627
|
+
}),
|
|
628
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
629
|
+
title: "The area chart arrival",
|
|
630
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
631
|
+
"The one authored moment: the chart draws its line from the first day to the last in 720ms, and the area fills in behind it. After that, only live things move. See",
|
|
632
|
+
" ",
|
|
633
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
634
|
+
to: "/components/area-chart",
|
|
635
|
+
children: "Area chart"
|
|
636
|
+
}),
|
|
637
|
+
"."
|
|
638
|
+
] }),
|
|
639
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
640
|
+
clientOnly: true,
|
|
641
|
+
children: /* @__PURE__ */ jsx(AreaChartDemo, {})
|
|
642
|
+
})
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
647
|
+
id: "choreography",
|
|
648
|
+
title: "Choreography",
|
|
649
|
+
description: /* @__PURE__ */ jsx("p", { children: "Overlays grow out of their trigger, scaling from 0.96 with a fade, and leave faster than they came. The 12% pop is kept for small confirmations: a count changing, a check landing." }),
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ jsxs(Example, {
|
|
652
|
+
align: "center",
|
|
653
|
+
children: [
|
|
654
|
+
/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
655
|
+
asChild: true,
|
|
656
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
657
|
+
iconEnd: /* @__PURE__ */ jsx(CaretDownIcon, {}),
|
|
658
|
+
children: "Order actions"
|
|
659
|
+
})
|
|
660
|
+
}), /* @__PURE__ */ jsxs(MenuContent, { children: [
|
|
661
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
662
|
+
icon: /* @__PURE__ */ jsx(PrinterIcon, {}),
|
|
663
|
+
children: "Print packing slip"
|
|
664
|
+
}),
|
|
665
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
666
|
+
icon: /* @__PURE__ */ jsx(CopySimpleIcon, {}),
|
|
667
|
+
children: "Duplicate order"
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
670
|
+
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
671
|
+
tone: "critical",
|
|
672
|
+
children: "Cancel order"
|
|
673
|
+
})
|
|
674
|
+
] })] }),
|
|
675
|
+
/* @__PURE__ */ jsx(CountDemo, {}),
|
|
676
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
677
|
+
"aria-label": "Date range",
|
|
678
|
+
defaultValue: "7d",
|
|
679
|
+
options: [
|
|
680
|
+
{
|
|
681
|
+
value: "today",
|
|
682
|
+
label: "Today"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
value: "7d",
|
|
686
|
+
label: "7 days"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
value: "30d",
|
|
690
|
+
label: "30 days"
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
})
|
|
694
|
+
]
|
|
695
|
+
}),
|
|
696
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
697
|
+
columns: [
|
|
698
|
+
"Moment",
|
|
699
|
+
"In",
|
|
700
|
+
"Out"
|
|
701
|
+
],
|
|
702
|
+
rows: [
|
|
703
|
+
[
|
|
704
|
+
"Menu and popover",
|
|
705
|
+
"Grows from the trigger in 200ms on the settle spring; rows rise 2px, 15ms apart",
|
|
706
|
+
"110ms"
|
|
707
|
+
],
|
|
708
|
+
[
|
|
709
|
+
"Tooltip",
|
|
710
|
+
"Grows in 140ms with a 3px drift; the next one along a toolbar fades in 90ms",
|
|
711
|
+
"90ms"
|
|
712
|
+
],
|
|
713
|
+
[
|
|
714
|
+
"Dialog",
|
|
715
|
+
"Rises 10px and settles in 320ms",
|
|
716
|
+
"150ms"
|
|
717
|
+
],
|
|
718
|
+
[
|
|
719
|
+
"Command palette",
|
|
720
|
+
"Grows out of the search pill on the soft spring",
|
|
721
|
+
"Folds back on the land spring"
|
|
722
|
+
],
|
|
723
|
+
[
|
|
724
|
+
"Empty state",
|
|
725
|
+
"The mark settles in; the words rise 6px after it, over 480ms",
|
|
726
|
+
"None"
|
|
727
|
+
],
|
|
728
|
+
[
|
|
729
|
+
"A list or a page arriving (Reveal)",
|
|
730
|
+
"Each item fades in and rises 6px, 40ms after the one before (75ms for sections)",
|
|
731
|
+
"None"
|
|
732
|
+
],
|
|
733
|
+
[
|
|
734
|
+
"Nav pill, segmented thumb, figure underline",
|
|
735
|
+
"Glide on the snappy spring",
|
|
736
|
+
"None"
|
|
737
|
+
]
|
|
738
|
+
]
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
741
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The Explain-a-Change Rule." }), " Motion explains a state change, gives feedback or keeps continuity. Nothing loops at idle except live indicators and loading."] }),
|
|
742
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The Pop Budget Rule." }), " Only glyph-sized things pop. Surfaces, sheets, buttons, thumbs and text always settle."] }),
|
|
743
|
+
"Exits are faster than entrances, and never bounce."
|
|
744
|
+
] })
|
|
745
|
+
]
|
|
746
|
+
}),
|
|
747
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
748
|
+
id: "reduced-motion",
|
|
749
|
+
title: "Reduced motion",
|
|
750
|
+
description: /* @__PURE__ */ jsx("p", { children: "The Stillness Rule: every component carries its own reduced-motion version. Movement (translate, scale, rotate, orbit) is dropped while opacity and colour stay, so every change of state is still legible." }),
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsx(DeviceSetting, {}),
|
|
753
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
754
|
+
columns: [
|
|
755
|
+
"Moment",
|
|
756
|
+
"Full motion",
|
|
757
|
+
"Reduced motion"
|
|
758
|
+
],
|
|
759
|
+
rows: [
|
|
760
|
+
[
|
|
761
|
+
"Button press",
|
|
762
|
+
"Dips to 0.965 and springs back",
|
|
763
|
+
"Colour changes only"
|
|
764
|
+
],
|
|
765
|
+
[
|
|
766
|
+
"The comet on hover",
|
|
767
|
+
"Passes once around the pill",
|
|
768
|
+
"Stays hidden"
|
|
769
|
+
],
|
|
770
|
+
[
|
|
771
|
+
"The comet while loading",
|
|
772
|
+
"Stays in orbit",
|
|
773
|
+
"Parks at one angle and breathes"
|
|
774
|
+
],
|
|
775
|
+
[
|
|
776
|
+
"Menus",
|
|
777
|
+
"Grow from the trigger, rows rise",
|
|
778
|
+
"Fade in"
|
|
779
|
+
],
|
|
780
|
+
[
|
|
781
|
+
"Tooltips and dialogs",
|
|
782
|
+
"Grow or rise into place",
|
|
783
|
+
"Fade"
|
|
784
|
+
],
|
|
785
|
+
[
|
|
786
|
+
"Nav pill, segmented thumb",
|
|
787
|
+
"Glide",
|
|
788
|
+
"Move straight to the new place"
|
|
789
|
+
],
|
|
790
|
+
[
|
|
791
|
+
"Rolling digits",
|
|
792
|
+
"Roll like an odometer",
|
|
793
|
+
"Swap with a fade"
|
|
794
|
+
],
|
|
795
|
+
[
|
|
796
|
+
"A list rising in",
|
|
797
|
+
"Fades and rises, one item after another",
|
|
798
|
+
"Fades, one item after another"
|
|
799
|
+
],
|
|
800
|
+
[
|
|
801
|
+
"Live dots",
|
|
802
|
+
"Send out a ring",
|
|
803
|
+
"Breathe in place"
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
"Area chart",
|
|
807
|
+
"Draws its line, the area filling in behind",
|
|
808
|
+
"Appears drawn"
|
|
809
|
+
],
|
|
810
|
+
[
|
|
811
|
+
"Skeleton and spinner",
|
|
812
|
+
"A sheen passes; the satellite circles",
|
|
813
|
+
"The skeleton holds still; the spinner breathes"
|
|
814
|
+
]
|
|
815
|
+
]
|
|
816
|
+
}),
|
|
817
|
+
/* @__PURE__ */ jsxs(SubSection, {
|
|
818
|
+
title: "In code",
|
|
819
|
+
children: [/* @__PURE__ */ jsx(CodeBlock$1, {
|
|
820
|
+
lang: "css",
|
|
821
|
+
code: `
|
|
822
|
+
.order-row {
|
|
823
|
+
transition:
|
|
824
|
+
background-color var(--o-dur-fast) var(--o-ease-out),
|
|
825
|
+
transform var(--o-dur-slow) var(--o-ease-spring);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.order-row:active {
|
|
829
|
+
transform: scale(0.99);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/* Last in every stylesheet: drop the movement, keep the colour. */
|
|
833
|
+
@media (prefers-reduced-motion: reduce) {
|
|
834
|
+
.order-row {
|
|
835
|
+
transition-property: background-color;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.order-row:active {
|
|
839
|
+
transform: none;
|
|
840
|
+
}
|
|
841
|
+
}`
|
|
842
|
+
}), /* @__PURE__ */ jsx(CodeBlock$1, {
|
|
843
|
+
lang: "tsx",
|
|
844
|
+
code: `
|
|
845
|
+
import { motion, useReducedMotion } from 'motion/react'
|
|
846
|
+
import { spring } from '@orbitcommerce/constellation'
|
|
847
|
+
|
|
848
|
+
function ActiveMark() {
|
|
849
|
+
const reduce = useReducedMotion()
|
|
850
|
+
return (
|
|
851
|
+
<motion.span
|
|
852
|
+
layoutId="active-mark"
|
|
853
|
+
transition={reduce ? { duration: 0 } : spring.snappy}
|
|
854
|
+
/>
|
|
855
|
+
)
|
|
856
|
+
}`
|
|
857
|
+
})]
|
|
858
|
+
})
|
|
859
|
+
]
|
|
860
|
+
})
|
|
861
|
+
]
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
//#endregion
|
|
865
|
+
export { Page };
|