@orbitcommerce/constellation-docs 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs.css +14764 -2237
- package/dist/index.js +2 -2
- package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
- package/dist/pages/_address-data-L9BR499w.js +161 -0
- package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
- package/dist/pages/_card-art-0be5ncyV.js +18 -0
- package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
- package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
- package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
- package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
- package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
- package/dist/pages/address-block-BZOOOPA9.js +368 -0
- package/dist/pages/address-fields-CwSqro3W.js +277 -0
- package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
- package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
- package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
- package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
- package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
- package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
- package/dist/pages/board-card-D2tZY_mU.js +415 -0
- package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
- package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
- package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
- package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
- package/dist/pages/card-CQEM1_wc.js +1567 -0
- package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
- package/dist/pages/chart-legend-B20AbakD.js +724 -0
- package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
- package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
- package/dist/pages/checklist-card-DEyykVFS.js +783 -0
- package/dist/pages/chip-Ck-o3Ui6.js +839 -0
- package/dist/pages/chip-list-k1LxXuCi.js +414 -0
- package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
- package/dist/pages/coachmark-Be2ghobT.js +366 -0
- package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
- package/dist/pages/collab-field-CfqqK7d2.js +696 -0
- package/dist/pages/color-field-CZpfcA-A.js +1127 -0
- package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
- package/dist/pages/comment-box-CDSGYhr5.js +346 -0
- package/dist/pages/composer-D4B0NgpA.js +689 -0
- package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
- package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
- package/dist/pages/context-menu-F9DV30ia.js +487 -0
- package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
- package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
- package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
- package/dist/pages/date-input-GOW067EB.js +956 -0
- package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
- package/dist/pages/description-list-BPeXn1eW.js +1268 -0
- package/dist/pages/device-switcher-BCaN99c1.js +554 -0
- package/dist/pages/dialog-CRpkRC98.js +3164 -0
- package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
- package/dist/pages/doodle-nzkqi2UI.js +201 -0
- package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
- package/dist/pages/drill-menu-cskH5mol.js +490 -0
- package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
- package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
- package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
- package/dist/pages/empty-state-4U2txFpI.js +1113 -0
- package/dist/pages/facet-filters-McbBeY9e.js +353 -0
- package/dist/pages/figure-D-HF5vCj.js +563 -0
- package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
- package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
- package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
- package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
- package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
- package/dist/pages/form-grid-BfWCVlie.js +692 -0
- package/dist/pages/gallery-BBk2EOri.js +453 -0
- package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
- package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
- package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
- package/dist/pages/heatmap-BohgIcNk.js +507 -0
- package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
- package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
- package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
- package/dist/pages/hosted-field-BLh-53AE.js +208 -0
- package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
- package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
- package/dist/pages/image-cropper-NyougqLH.js +466 -0
- package/dist/pages/image-field-7knBv4mJ.js +567 -0
- package/dist/pages/import-result-CmTtGXW_.js +486 -0
- package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
- package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
- package/dist/pages/input-CzLCzfyx.js +2372 -0
- package/dist/pages/{installation-DpsX8G_n.js → installation-C3UcpQJT.js} +112 -29
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
- package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
- package/dist/pages/line-chart-CntWxeMF.js +1117 -0
- package/dist/pages/link-CXqvAg9z.js +689 -0
- package/dist/pages/link-picker-BMFGCC67.js +478 -0
- package/dist/pages/link-row-x8yaUuWc.js +595 -0
- package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
- package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
- package/dist/pages/loading-state-BNbCo51C.js +556 -0
- package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
- package/dist/pages/{logo-BfGF1Pq9.js → logo-B38rnzoq.js} +13 -13
- package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
- package/dist/pages/markdown-Ied72vMT.js +237 -0
- package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
- package/dist/pages/media-banner-DkStCia0.js +233 -0
- package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
- package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
- package/dist/pages/meta-line-D5p2TycR.js +371 -0
- package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
- package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
- package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
- package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/{overview-BPEbZQ6g.js → overview-LA9XRhZc.js} +4 -4
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
- package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
- package/dist/pages/password-field-DHEQKyUC.js +912 -0
- package/dist/pages/person-cell-BmjbADBz.js +564 -0
- package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
- package/dist/pages/plan-card-DRaA6RuB.js +621 -0
- package/dist/pages/plan-card-DtloWvMh.js +258 -0
- package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
- package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
- package/dist/pages/point-list-BbPmZjsm.js +222 -0
- package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
- package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
- package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
- package/dist/pages/price-CRBLoa9h.js +604 -0
- package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
- package/dist/pages/print-page-BkLv6bW8.js +513 -0
- package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
- package/dist/pages/progress-CP_awmo4.js +904 -0
- package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
- package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-C-4tg6FS.js} +580 -18
- package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
- package/dist/pages/rating-CweKN2SX.js +471 -0
- package/dist/pages/record-layout-DUP_X0RL.js +719 -0
- package/dist/pages/record-pager-y9D7JFgb.js +278 -0
- package/dist/pages/registry-BZg-xAbi.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-Cs6tl16C.js} +4 -1
- package/dist/pages/repeater-BRZYKRQa.js +1351 -0
- package/dist/pages/reply-feedback-BDnHprla.js +192 -0
- package/dist/pages/reveal-BygENBbL.js +460 -0
- package/dist/pages/rich-text-DOFQZEpT.js +156 -0
- package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
- package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
- package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
- package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
- package/dist/pages/rule-list-DTCmIMpT.js +648 -0
- package/dist/pages/save-status-B5KkyMZP.js +378 -0
- package/dist/pages/schedule-YycI95O1.js +243 -0
- package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
- package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
- package/dist/pages/search-menu-DMuXyUUW.js +580 -0
- package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
- package/dist/pages/section-rail-BtTCETS5.js +637 -0
- package/dist/pages/section-v2Pubup9.js +639 -0
- package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
- package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
- package/dist/pages/share-list-D4wgBxKN.js +926 -0
- package/dist/pages/side-panel-CCtkrZjs.js +811 -0
- package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
- package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
- package/dist/pages/skip-link-BxznhSkz.js +252 -0
- package/dist/pages/slider-CAoPURKD.js +774 -0
- package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
- package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
- package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
- package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
- package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
- package/dist/pages/split-bar-DYgZnFID.js +414 -0
- package/dist/pages/split-button-Be08-VI-.js +335 -0
- package/dist/pages/split-pane-lSNZgTKt.js +523 -0
- package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
- package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
- package/dist/pages/status-dot-D99gAGsV.js +567 -0
- package/dist/pages/stepper-CxKTbEA-.js +1093 -0
- package/dist/pages/success-mark-CqFTOBEu.js +142 -0
- package/dist/pages/swatch-H_kNvHuC.js +565 -0
- package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
- package/dist/pages/table-CL0vomno.js +3225 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -21
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
- package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
- package/dist/pages/time-input-CA9-uZAa.js +442 -0
- package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
- package/dist/pages/timeline-BsMUTlpR.js +1798 -0
- package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
- package/dist/pages/translation-field-CTRXiF2N.js +251 -0
- package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
- package/dist/pages/tree-select-DU1qXHy_.js +492 -0
- package/dist/pages/tree-view-g_RjLtAb.js +739 -0
- package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
- package/dist/pages/unit-input-Dml4fjmK.js +659 -0
- package/dist/pages/upload-rules-yozEzSah.js +419 -0
- package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
- package/dist/pages/value-change-CnubDKyO.js +489 -0
- package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
- package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
- package/dist/pages/working-status-CENemSsw.js +389 -0
- package/manifest.json +10984 -1108
- package/package.json +2 -2
- package/dist/pages/card-DUggbis3.js +0 -659
- package/dist/pages/checkbox-DwimQaK3.js +0 -365
- package/dist/pages/dialog-BRAf4LMh.js +0 -1451
- package/dist/pages/empty-state-C-mLrXW2.js +0 -417
- package/dist/pages/input-KF9Gkawf.js +0 -1093
- package/dist/pages/registry-CroHzK9I.js +0 -244
- package/dist/pages/skeleton-DLuBhP46.js +0 -561
- package/dist/pages/table-AMoODng4.js +0 -607
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { u as figuresFor } from "./_figures-data-DaDvB7Nm.js";
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { AreaChart, Delta, FigureStrip, FigureTabs, RollingNumber, SegmentedControl, Sparkline, percentChange } from "@orbitcommerce/constellation";
|
|
6
|
+
//#region src/pages/components/_kpi-examples.tsx
|
|
7
|
+
var PERIODS = [
|
|
8
|
+
{
|
|
9
|
+
value: "7",
|
|
10
|
+
label: "7 days"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: "30",
|
|
14
|
+
label: "30 days"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "90",
|
|
18
|
+
label: "90 days"
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
/** A day's date, as the charts take it, counted back from a fixed day. */
|
|
22
|
+
var dayOf = (index, days) => {
|
|
23
|
+
return new Date(Date.UTC(2026, 8, 30 - (days - 1 - index))).toISOString().slice(0, 10);
|
|
24
|
+
};
|
|
25
|
+
/** A smooth, rising or falling series of whole numbers, from the day number alone. */
|
|
26
|
+
function series(days, base, swing, phase, rise) {
|
|
27
|
+
return Array.from({ length: days }, (_, index) => ({
|
|
28
|
+
date: dayOf(index, days),
|
|
29
|
+
value: Math.max(0, Math.round(base + swing * Math.sin((index + phase) / 2.7) + rise * index))
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
var SUPPLIER = {
|
|
33
|
+
live: {
|
|
34
|
+
label: "Live products",
|
|
35
|
+
base: 396,
|
|
36
|
+
swing: 4,
|
|
37
|
+
phase: 1,
|
|
38
|
+
rise: .6
|
|
39
|
+
},
|
|
40
|
+
stores: {
|
|
41
|
+
label: "Connected stores",
|
|
42
|
+
base: 34,
|
|
43
|
+
swing: 1,
|
|
44
|
+
phase: 3,
|
|
45
|
+
rise: .15
|
|
46
|
+
},
|
|
47
|
+
orders: {
|
|
48
|
+
label: "Purchase orders",
|
|
49
|
+
base: 3,
|
|
50
|
+
swing: 2,
|
|
51
|
+
phase: 0,
|
|
52
|
+
rise: .06
|
|
53
|
+
},
|
|
54
|
+
views: {
|
|
55
|
+
label: "Profile views",
|
|
56
|
+
base: 36,
|
|
57
|
+
swing: 12,
|
|
58
|
+
phase: 2,
|
|
59
|
+
rise: .2
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var count = new Intl.NumberFormat("en-GB", { maximumFractionDigits: 0 });
|
|
63
|
+
var sum = (data) => data.reduce((total, point) => total + point.value, 0);
|
|
64
|
+
var last = (data) => data[data.length - 1]?.value ?? 0;
|
|
65
|
+
/** The supplier dashboard's metrics strip: four figures with trends, a period footer, and the chart under it. */
|
|
66
|
+
function SupplierMetrics({ initial = "orders" }) {
|
|
67
|
+
const [period, setPeriod] = useState("30");
|
|
68
|
+
const [active, setActive] = useState(initial);
|
|
69
|
+
const days = Number(period);
|
|
70
|
+
const data = useMemo(() => {
|
|
71
|
+
const out = {};
|
|
72
|
+
for (const key of Object.keys(SUPPLIER)) {
|
|
73
|
+
const { base, swing, phase, rise } = SUPPLIER[key];
|
|
74
|
+
out[key] = series(days * 2, base, swing, phase, rise);
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}, [days]);
|
|
78
|
+
const now = (key) => data[key].slice(days);
|
|
79
|
+
const before = (key) => data[key].slice(0, days);
|
|
80
|
+
const vs = `vs previous ${days} days`;
|
|
81
|
+
const items = [
|
|
82
|
+
{
|
|
83
|
+
key: "live",
|
|
84
|
+
label: SUPPLIER.live.label,
|
|
85
|
+
value: count.format(last(now("live"))),
|
|
86
|
+
hint: "Visible to connected stores"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "stores",
|
|
90
|
+
label: SUPPLIER.stores.label,
|
|
91
|
+
value: count.format(last(now("stores"))),
|
|
92
|
+
hint: `${last(now("stores")) - last(before("stores"))} new in the last ${days} days`
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "orders",
|
|
96
|
+
label: SUPPLIER.orders.label,
|
|
97
|
+
value: count.format(sum(now("orders"))),
|
|
98
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
99
|
+
variant: "sentence",
|
|
100
|
+
size: "sm",
|
|
101
|
+
precision: 0,
|
|
102
|
+
value: percentChange(sum(now("orders")), sum(before("orders"))),
|
|
103
|
+
label: vs
|
|
104
|
+
})
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "views",
|
|
108
|
+
label: SUPPLIER.views.label,
|
|
109
|
+
value: count.format(sum(now("views"))),
|
|
110
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
111
|
+
variant: "sentence",
|
|
112
|
+
size: "sm",
|
|
113
|
+
precision: 0,
|
|
114
|
+
value: percentChange(sum(now("views")), sum(before("views"))),
|
|
115
|
+
label: vs
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
].map((item) => ({
|
|
119
|
+
...item,
|
|
120
|
+
trend: /* @__PURE__ */ jsx(Sparkline, {
|
|
121
|
+
data: now(item.key).map((point) => point.value),
|
|
122
|
+
width: 72,
|
|
123
|
+
height: 28
|
|
124
|
+
})
|
|
125
|
+
}));
|
|
126
|
+
return /* @__PURE__ */ jsx(FigureStrip, {
|
|
127
|
+
"aria-label": "Your numbers",
|
|
128
|
+
items,
|
|
129
|
+
active,
|
|
130
|
+
onActiveChange: setActive,
|
|
131
|
+
panel: (key) => /* @__PURE__ */ jsx(AreaChart, {
|
|
132
|
+
height: 220,
|
|
133
|
+
data: now(key),
|
|
134
|
+
valueLabel: SUPPLIER[key].label,
|
|
135
|
+
formatValue: (value) => count.format(value),
|
|
136
|
+
formatTick: (value) => count.format(value)
|
|
137
|
+
}),
|
|
138
|
+
footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SegmentedControl, {
|
|
139
|
+
"aria-label": "Period",
|
|
140
|
+
size: "sm",
|
|
141
|
+
value: period,
|
|
142
|
+
onValueChange: setPeriod,
|
|
143
|
+
options: PERIODS
|
|
144
|
+
}), /* @__PURE__ */ jsxs("span", { children: [
|
|
145
|
+
"Purchase orders and profile views cover the last ",
|
|
146
|
+
days,
|
|
147
|
+
" days"
|
|
148
|
+
] })] })
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** The same strip with every trend on its way. */
|
|
152
|
+
function SupplierMetricsLoading() {
|
|
153
|
+
const items = Object.keys(SUPPLIER).map((key) => ({
|
|
154
|
+
key,
|
|
155
|
+
label: SUPPLIER[key].label,
|
|
156
|
+
value: "",
|
|
157
|
+
trendLoading: true
|
|
158
|
+
}));
|
|
159
|
+
return /* @__PURE__ */ jsx(FigureStrip, {
|
|
160
|
+
"aria-label": "Your numbers, loading",
|
|
161
|
+
items,
|
|
162
|
+
loading: true,
|
|
163
|
+
active: null,
|
|
164
|
+
onActiveChange: () => {},
|
|
165
|
+
panel: () => null
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
var MONTH = figuresFor("30");
|
|
169
|
+
/** A shop's 30 days as FigureTabs with its chart drawn for it: trends, the panel, and a footer with the chevron. */
|
|
170
|
+
function PerformanceTabs() {
|
|
171
|
+
const [selected, setSelected] = useState("sales");
|
|
172
|
+
return /* @__PURE__ */ jsx(FigureTabs, {
|
|
173
|
+
"aria-label": "Headline figures",
|
|
174
|
+
value: selected,
|
|
175
|
+
onValueChange: setSelected,
|
|
176
|
+
items: MONTH.map((figure) => ({
|
|
177
|
+
key: figure.key,
|
|
178
|
+
label: figure.label,
|
|
179
|
+
value: /* @__PURE__ */ jsx(RollingNumber, {
|
|
180
|
+
value: figure.amount,
|
|
181
|
+
format: figure.numberFormat
|
|
182
|
+
}),
|
|
183
|
+
change: /* @__PURE__ */ jsx(Delta, {
|
|
184
|
+
value: figure.change,
|
|
185
|
+
size: "sm"
|
|
186
|
+
}),
|
|
187
|
+
trend: /* @__PURE__ */ jsx(Sparkline, {
|
|
188
|
+
data: figure.series.map((point) => point.value),
|
|
189
|
+
width: 72,
|
|
190
|
+
height: 28
|
|
191
|
+
})
|
|
192
|
+
})),
|
|
193
|
+
panel: (key) => {
|
|
194
|
+
const figure = MONTH.find((each) => each.key === key) ?? MONTH[0];
|
|
195
|
+
return /* @__PURE__ */ jsx(AreaChart, {
|
|
196
|
+
height: 240,
|
|
197
|
+
data: figure.series,
|
|
198
|
+
valueLabel: figure.label,
|
|
199
|
+
compareLabel: "Previous period",
|
|
200
|
+
formatValue: figure.format,
|
|
201
|
+
formatTick: figure.formatTick
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
footer: /* @__PURE__ */ jsx("span", { children: "The last 30 days, against the 30 before" })
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { SupplierMetrics as n, SupplierMetricsLoading as r, PerformanceTabs as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useLayoutEffect, useRef } from "react";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { IconButton, Kbd, cx } from "@orbitcommerce/constellation";
|
|
4
5
|
//#region src/pages/components/_overlays-specimens.tsx
|
|
@@ -112,12 +113,29 @@ function PopoverSheet({ padding = "md", width, children, style }) {
|
|
|
112
113
|
}
|
|
113
114
|
function TooltipPill({ children, shortcut, side = "top", style }) {
|
|
114
115
|
const hasShortcut = !!shortcut?.length;
|
|
116
|
+
const text = useRef(null);
|
|
117
|
+
useLayoutEffect(() => {
|
|
118
|
+
const words = text.current;
|
|
119
|
+
if (!words) return;
|
|
120
|
+
words.style.width = "";
|
|
121
|
+
const range = document.createRange();
|
|
122
|
+
range.selectNodeContents(words);
|
|
123
|
+
const rects = [...range.getClientRects()].filter((rect) => rect.width);
|
|
124
|
+
const tops = [...new Set(rects.map((rect) => Math.round(rect.top)))];
|
|
125
|
+
if (tops.length < 2) return;
|
|
126
|
+
const widest = Math.max(...tops.map((top) => {
|
|
127
|
+
const line = rects.filter((rect) => Math.round(rect.top) === top);
|
|
128
|
+
return Math.max(...line.map((rect) => rect.right)) - Math.min(...line.map((rect) => rect.left));
|
|
129
|
+
}));
|
|
130
|
+
words.style.width = `${Math.ceil(widest)}px`;
|
|
131
|
+
});
|
|
115
132
|
return /* @__PURE__ */ jsxs("div", {
|
|
116
133
|
className: "o-tooltip",
|
|
117
134
|
"data-side": side,
|
|
118
135
|
"data-shortcut": hasShortcut ? "" : void 0,
|
|
119
136
|
style,
|
|
120
137
|
children: [/* @__PURE__ */ jsx("span", {
|
|
138
|
+
ref: text,
|
|
121
139
|
className: "o-tooltip__text",
|
|
122
140
|
children
|
|
123
141
|
}), hasShortcut ? /* @__PURE__ */ jsx(Kbd, {
|
|
@@ -127,10 +145,11 @@ function TooltipPill({ children, shortcut, side = "top", style }) {
|
|
|
127
145
|
});
|
|
128
146
|
}
|
|
129
147
|
/** The dialog sheet, taken out of its fixed, centred position so it can sit on a stage. */
|
|
130
|
-
function DialogSheet({ size = "md", close = false, width, style, children }) {
|
|
148
|
+
function DialogSheet({ size = "md", bar, close = false, width, style, children }) {
|
|
131
149
|
return /* @__PURE__ */ jsxs("div", {
|
|
132
150
|
className: "o-dialog",
|
|
133
151
|
"data-size": size,
|
|
152
|
+
"data-bar": bar === "footer" ? "footer" : bar ? "" : void 0,
|
|
134
153
|
"data-close": close ? "" : void 0,
|
|
135
154
|
style: {
|
|
136
155
|
position: "relative",
|
|
@@ -213,9 +232,15 @@ function PaletteStill({ query, placeholder = "Search orders, products, customers
|
|
|
213
232
|
},
|
|
214
233
|
children: query || placeholder
|
|
215
234
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
className: "o-
|
|
218
|
-
children: "
|
|
235
|
+
/* @__PURE__ */ jsxs("span", {
|
|
236
|
+
className: "o-kbd o-command__esc",
|
|
237
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
238
|
+
className: "o-command__esc-key",
|
|
239
|
+
children: "Esc"
|
|
240
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
241
|
+
className: "o-command__esc-word",
|
|
242
|
+
children: "Cancel"
|
|
243
|
+
})]
|
|
219
244
|
}),
|
|
220
245
|
/* @__PURE__ */ jsx("span", {
|
|
221
246
|
className: "o-command__track",
|
|
@@ -254,10 +279,7 @@ function PaletteStill({ query, placeholder = "Search orders, products, customers
|
|
|
254
279
|
}) : null,
|
|
255
280
|
item.shortcut?.length ? /* @__PURE__ */ jsx("span", {
|
|
256
281
|
className: "o-command__item-keys",
|
|
257
|
-
children:
|
|
258
|
-
className: "o-command-key",
|
|
259
|
-
children: key
|
|
260
|
-
}, key))
|
|
282
|
+
children: /* @__PURE__ */ jsx(Kbd, { keys: item.shortcut })
|
|
261
283
|
}) : null
|
|
262
284
|
]
|
|
263
285
|
}, i))
|
|
@@ -275,28 +297,16 @@ function PaletteStill({ query, placeholder = "Search orders, products, customers
|
|
|
275
297
|
className: "o-command__hint",
|
|
276
298
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
277
299
|
className: "o-command__hint-keys",
|
|
278
|
-
children: [/* @__PURE__ */ jsx("
|
|
279
|
-
className: "o-command-key",
|
|
280
|
-
children: "↑"
|
|
281
|
-
}), /* @__PURE__ */ jsx("kbd", {
|
|
282
|
-
className: "o-command-key",
|
|
283
|
-
children: "↓"
|
|
284
|
-
})]
|
|
300
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "up" }), /* @__PURE__ */ jsx(Kbd, { children: "down" })]
|
|
285
301
|
}), "to move"]
|
|
286
302
|
}),
|
|
287
303
|
/* @__PURE__ */ jsxs("span", {
|
|
288
304
|
className: "o-command__hint",
|
|
289
|
-
children: [/* @__PURE__ */ jsx("
|
|
290
|
-
className: "o-command-key",
|
|
291
|
-
children: "↵"
|
|
292
|
-
}), "to open"]
|
|
305
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "enter" }), "to open"]
|
|
293
306
|
}),
|
|
294
307
|
/* @__PURE__ */ jsxs("span", {
|
|
295
308
|
className: "o-command__hint",
|
|
296
|
-
children: [/* @__PURE__ */ jsx("
|
|
297
|
-
className: "o-command-key",
|
|
298
|
-
children: "esc"
|
|
299
|
-
}), "to close"]
|
|
309
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "Esc" }), "to close"]
|
|
300
310
|
})
|
|
301
311
|
]
|
|
302
312
|
}) : footer
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/pages/components/_preview-specimens.tsx
|
|
4
|
+
/** The shop's stylesheet, as a storefront would ship it: put inside the shadow root with `isolateStyles`. */
|
|
5
|
+
var SHOP_STYLES = `
|
|
6
|
+
:host { display: block; color: #1c1917; font-family: ui-sans-serif, system-ui, sans-serif; }
|
|
7
|
+
.shop { min-height: 100%; background: #fafaf9; }
|
|
8
|
+
.shop-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 32px; border-bottom: 1px solid #e7e5e4; background: #ffffff; }
|
|
9
|
+
.shop-logo { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
|
|
10
|
+
.shop-nav { display: flex; gap: 24px; color: #57534e; font-size: 15px; }
|
|
11
|
+
.shop-basket { padding: 8px 16px; border-radius: 999px; background: #0f766e; color: #f0fdfa; font-size: 14px; font-weight: 600; }
|
|
12
|
+
.shop-hero { display: grid; gap: 12px; padding: 56px 32px; background: #134e4a; color: #f0fdfa; }
|
|
13
|
+
.shop-hero h2 { margin: 0; max-width: 16ch; font-size: 40px; line-height: 1.08; letter-spacing: -0.02em; }
|
|
14
|
+
.shop-hero p { margin: 0; max-width: 44ch; color: #ccfbf1; font-size: 17px; line-height: 1.5; }
|
|
15
|
+
.shop-cta { justify-self: start; margin-top: 8px; padding: 12px 22px; border-radius: 999px; background: #f0fdfa; color: #134e4a; font-size: 15px; font-weight: 600; }
|
|
16
|
+
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 32px 32px 48px; }
|
|
17
|
+
.shop-card { overflow: hidden; border: 1px solid #e7e5e4; border-radius: 14px; background: #ffffff; }
|
|
18
|
+
.shop-thumb { height: 180px; }
|
|
19
|
+
.shop-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
|
|
20
|
+
.shop-name { font-size: 15px; font-weight: 600; }
|
|
21
|
+
.shop-price { color: #0f766e; font-variant-numeric: tabular-nums; }
|
|
22
|
+
@container (max-width: 820px) {
|
|
23
|
+
.shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
24
|
+
.shop-hero h2 { font-size: 34px; }
|
|
25
|
+
}
|
|
26
|
+
@container (max-width: 560px) {
|
|
27
|
+
.shop-header { padding: 16px 20px; }
|
|
28
|
+
.shop-nav { display: none; }
|
|
29
|
+
.shop-hero { padding: 40px 20px; }
|
|
30
|
+
.shop-hero h2 { font-size: 28px; }
|
|
31
|
+
.shop-grid { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 40px; }
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
var PRODUCTS = [
|
|
35
|
+
{
|
|
36
|
+
name: "Arden oak side table",
|
|
37
|
+
price: "£89.00",
|
|
38
|
+
tint: "#0d9488"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "Linen cushion cover",
|
|
42
|
+
price: "£18.00",
|
|
43
|
+
tint: "#b45309"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "Harbour stoneware mug",
|
|
47
|
+
price: "£12.50",
|
|
48
|
+
tint: "#475569"
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
/** The shop's header on its own, as a header band above a builder canvas shows it. */
|
|
52
|
+
function ShopHeader() {
|
|
53
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
54
|
+
className: "shop-header",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx("h1", {
|
|
57
|
+
className: "shop-logo",
|
|
58
|
+
children: "Harbour & Heath"
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsxs("nav", {
|
|
61
|
+
className: "shop-nav",
|
|
62
|
+
"aria-label": "Shop",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx("span", { children: "Living" }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { children: "Kitchen" }),
|
|
66
|
+
/* @__PURE__ */ jsx("span", { children: "Journal" }),
|
|
67
|
+
/* @__PURE__ */ jsx("span", { children: "About" })
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: "shop-basket",
|
|
72
|
+
children: "Basket (2)"
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/** The shop's home page, as the page builder would render it. */
|
|
78
|
+
function ShopHome() {
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: "shop",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(ShopHeader, {}),
|
|
83
|
+
/* @__PURE__ */ jsxs("section", {
|
|
84
|
+
className: "shop-hero",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx("h2", { children: "Pieces made to be lived with" }),
|
|
87
|
+
/* @__PURE__ */ jsx("p", { children: "Oak, linen and stoneware from small workshops along the coast, made to last and easy to care for." }),
|
|
88
|
+
/* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "shop-cta",
|
|
90
|
+
children: "Shop the autumn edit"
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("main", {
|
|
95
|
+
className: "shop-grid",
|
|
96
|
+
children: PRODUCTS.map((product) => /* @__PURE__ */ jsxs("article", {
|
|
97
|
+
className: "shop-card",
|
|
98
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
99
|
+
className: "shop-thumb",
|
|
100
|
+
style: { background: product.tint }
|
|
101
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: "shop-body",
|
|
103
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
104
|
+
className: "shop-name",
|
|
105
|
+
children: product.name
|
|
106
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: "shop-price",
|
|
108
|
+
children: product.price
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
}, product.name))
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** A sale landing page drawn as a picture: what a stored screenshot of a page looks like. Drawn, so no network. */
|
|
117
|
+
var SALE_PAGE_IMAGE = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="900" viewBox="0 0 1280 900">
|
|
118
|
+
<rect width="1280" height="900" fill="#fffbeb"/>
|
|
119
|
+
<rect width="1280" height="84" fill="#ffffff"/>
|
|
120
|
+
<rect y="83" width="1280" height="1" fill="#e7e5e4"/>
|
|
121
|
+
<rect x="40" y="30" width="190" height="24" rx="6" fill="#292524"/>
|
|
122
|
+
<rect x="720" y="34" width="70" height="16" rx="8" fill="#a8a29e"/>
|
|
123
|
+
<rect x="820" y="34" width="70" height="16" rx="8" fill="#a8a29e"/>
|
|
124
|
+
<rect x="920" y="34" width="70" height="16" rx="8" fill="#a8a29e"/>
|
|
125
|
+
<rect x="1090" y="24" width="150" height="36" rx="18" fill="#b45309"/>
|
|
126
|
+
<rect x="40" y="132" width="1200" height="380" rx="20" fill="#b45309"/>
|
|
127
|
+
<rect x="96" y="214" width="560" height="56" rx="10" fill="#fffbeb"/>
|
|
128
|
+
<rect x="96" y="290" width="420" height="56" rx="10" fill="#fffbeb"/>
|
|
129
|
+
<rect x="96" y="380" width="360" height="18" rx="9" fill="#fde68a"/>
|
|
130
|
+
<rect x="96" y="430" width="200" height="48" rx="24" fill="#fffbeb"/>
|
|
131
|
+
<circle cx="1000" cy="322" r="130" fill="#f59e0b"/>
|
|
132
|
+
<rect x="40" y="552" width="380" height="300" rx="16" fill="#ffffff"/>
|
|
133
|
+
<rect x="450" y="552" width="380" height="300" rx="16" fill="#ffffff"/>
|
|
134
|
+
<rect x="860" y="552" width="380" height="300" rx="16" fill="#ffffff"/>
|
|
135
|
+
<rect x="40" y="552" width="380" height="200" rx="16" fill="#0d9488"/>
|
|
136
|
+
<rect x="450" y="552" width="380" height="200" rx="16" fill="#7c2d12"/>
|
|
137
|
+
<rect x="860" y="552" width="380" height="200" rx="16" fill="#475569"/>
|
|
138
|
+
<rect x="64" y="776" width="220" height="16" rx="8" fill="#44403c"/>
|
|
139
|
+
<rect x="474" y="776" width="180" height="16" rx="8" fill="#44403c"/>
|
|
140
|
+
<rect x="884" y="776" width="240" height="16" rx="8" fill="#44403c"/>
|
|
141
|
+
<rect x="64" y="808" width="80" height="14" rx="7" fill="#b45309"/>
|
|
142
|
+
<rect x="474" y="808" width="80" height="14" rx="7" fill="#b45309"/>
|
|
143
|
+
<rect x="884" y="808" width="80" height="14" rx="7" fill="#b45309"/>
|
|
144
|
+
</svg>`)}`;
|
|
145
|
+
/** A saved page whose only content is a slot the storefront fills: at a thumbnail's size it draws nothing. */
|
|
146
|
+
function SlotOnlyPage() {
|
|
147
|
+
return /* @__PURE__ */ jsx("div", {
|
|
148
|
+
className: "shop",
|
|
149
|
+
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {}) })
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { SlotOnlyPage as a, ShopHome as i, SHOP_STYLES as n, ShopHeader as r, SALE_PAGE_IMAGE as t };
|