@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,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 };
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect, useRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { IconButton, Kbd, cx } from "@orbitcommerce/constellation";
|
|
5
|
+
//#region src/pages/components/_overlays-specimens.tsx
|
|
6
|
+
/** Makes a still inert and invisible to assistive tech. */
|
|
7
|
+
function SpecimenFrame({ children, className, style }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
className: cx("overlays-specimen", className),
|
|
10
|
+
style,
|
|
11
|
+
inert: true,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function MenuSheet({ width, sub, children, style }) {
|
|
17
|
+
const sized = width ? {
|
|
18
|
+
"--o-menu-w": `${width}px`,
|
|
19
|
+
"--o-menu-min-w": `${width}px`
|
|
20
|
+
} : void 0;
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: "o-menu",
|
|
23
|
+
"data-sub": sub ? "" : void 0,
|
|
24
|
+
style: {
|
|
25
|
+
...sized,
|
|
26
|
+
...style
|
|
27
|
+
},
|
|
28
|
+
children
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function MenuRow({ icon, hint, shortcut, tone, highlighted, kind, checked, submenu, open, children }) {
|
|
32
|
+
const indicatorState = checked ? "checked" : "unchecked";
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "o-menu__item",
|
|
35
|
+
"data-tone": tone,
|
|
36
|
+
"data-kind": kind,
|
|
37
|
+
"data-highlighted": highlighted ? "" : void 0,
|
|
38
|
+
"aria-haspopup": submenu ? "menu" : void 0,
|
|
39
|
+
"data-state": submenu ? open ? "open" : "closed" : kind ? indicatorState : void 0,
|
|
40
|
+
children: [
|
|
41
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "o-menu__icon",
|
|
43
|
+
children: icon
|
|
44
|
+
}) : null,
|
|
45
|
+
/* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "o-menu__label",
|
|
47
|
+
children
|
|
48
|
+
}),
|
|
49
|
+
hint != null || shortcut?.length ? /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
className: "o-menu__end",
|
|
51
|
+
children: [hint != null ? /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "o-menu__hint",
|
|
53
|
+
children: hint
|
|
54
|
+
}) : null, shortcut?.length ? /* @__PURE__ */ jsx(Kbd, { keys: shortcut }) : null]
|
|
55
|
+
}) : null,
|
|
56
|
+
submenu ? /* @__PURE__ */ jsx("svg", {
|
|
57
|
+
className: "o-menu__chevron",
|
|
58
|
+
viewBox: "0 0 16 16",
|
|
59
|
+
children: /* @__PURE__ */ jsx("path", { d: "M6.25 4l4 4-4 4" })
|
|
60
|
+
}) : null,
|
|
61
|
+
kind === "checkbox" ? /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: "o-menu__indicator",
|
|
63
|
+
"data-state": indicatorState,
|
|
64
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
65
|
+
viewBox: "0 0 16 16",
|
|
66
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
67
|
+
className: "o-menu__check",
|
|
68
|
+
pathLength: 1,
|
|
69
|
+
d: "M3.6 8.4l2.9 2.9 5.9-6.6"
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}) : null,
|
|
73
|
+
kind === "radio" ? /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: "o-menu__indicator",
|
|
75
|
+
"data-state": indicatorState,
|
|
76
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
77
|
+
viewBox: "0 0 16 16",
|
|
78
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
79
|
+
className: "o-menu__radio-ring",
|
|
80
|
+
cx: "8",
|
|
81
|
+
cy: "8",
|
|
82
|
+
r: "5.6"
|
|
83
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
84
|
+
className: "o-menu__radio-dot",
|
|
85
|
+
cx: "8",
|
|
86
|
+
cy: "8",
|
|
87
|
+
r: "2.9"
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
}) : null
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function MenuHeading({ children }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("div", {
|
|
96
|
+
className: "o-menu__heading",
|
|
97
|
+
children
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function MenuRule() {
|
|
101
|
+
return /* @__PURE__ */ jsx("div", { className: "o-menu__separator" });
|
|
102
|
+
}
|
|
103
|
+
function PopoverSheet({ padding = "md", width, children, style }) {
|
|
104
|
+
return /* @__PURE__ */ jsx("div", {
|
|
105
|
+
className: "o-popover",
|
|
106
|
+
"data-padding": padding,
|
|
107
|
+
style: {
|
|
108
|
+
width,
|
|
109
|
+
...style
|
|
110
|
+
},
|
|
111
|
+
children
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function TooltipPill({ children, shortcut, side = "top", style }) {
|
|
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
|
+
});
|
|
132
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
133
|
+
className: "o-tooltip",
|
|
134
|
+
"data-side": side,
|
|
135
|
+
"data-shortcut": hasShortcut ? "" : void 0,
|
|
136
|
+
style,
|
|
137
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
138
|
+
ref: text,
|
|
139
|
+
className: "o-tooltip__text",
|
|
140
|
+
children
|
|
141
|
+
}), hasShortcut ? /* @__PURE__ */ jsx(Kbd, {
|
|
142
|
+
keys: shortcut,
|
|
143
|
+
className: "o-tooltip__keys"
|
|
144
|
+
}) : null]
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** The dialog sheet, taken out of its fixed, centred position so it can sit on a stage. */
|
|
148
|
+
function DialogSheet({ size = "md", bar, close = false, width, style, children }) {
|
|
149
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
150
|
+
className: "o-dialog",
|
|
151
|
+
"data-size": size,
|
|
152
|
+
"data-bar": bar === "footer" ? "footer" : bar ? "" : void 0,
|
|
153
|
+
"data-close": close ? "" : void 0,
|
|
154
|
+
style: {
|
|
155
|
+
position: "relative",
|
|
156
|
+
inset: "auto",
|
|
157
|
+
zIndex: "auto",
|
|
158
|
+
margin: 0,
|
|
159
|
+
maxHeight: "none",
|
|
160
|
+
...width !== void 0 ? {
|
|
161
|
+
width,
|
|
162
|
+
maxWidth: "100%"
|
|
163
|
+
} : { maxWidth: "100%" },
|
|
164
|
+
...style
|
|
165
|
+
},
|
|
166
|
+
children: [children, close ? /* @__PURE__ */ jsx(IconButton, {
|
|
167
|
+
label: "Close",
|
|
168
|
+
size: "sm",
|
|
169
|
+
className: "o-dialog__close",
|
|
170
|
+
tabIndex: -1,
|
|
171
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
172
|
+
viewBox: "0 0 16 16",
|
|
173
|
+
fill: "none",
|
|
174
|
+
stroke: "currentColor",
|
|
175
|
+
strokeWidth: 1.6,
|
|
176
|
+
strokeLinecap: "round",
|
|
177
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4.75 4.75l6.5 6.5M11.25 4.75l-6.5 6.5" })
|
|
178
|
+
})
|
|
179
|
+
}) : null]
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/** The palette's magnifier (SearchGlyph in SearchTrigger.tsx, which is internal). */
|
|
183
|
+
function SearchGlyphStill() {
|
|
184
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
185
|
+
viewBox: "0 0 16 16",
|
|
186
|
+
fill: "none",
|
|
187
|
+
stroke: "currentColor",
|
|
188
|
+
strokeWidth: 1.55,
|
|
189
|
+
strokeLinecap: "round",
|
|
190
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
191
|
+
cx: "7.1",
|
|
192
|
+
cy: "7.1",
|
|
193
|
+
r: "4.85"
|
|
194
|
+
}), /* @__PURE__ */ jsx("path", { d: "m10.7 10.7 3.1 3.1" })]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/** The open palette, taken out of its fixed position so it can sit on a stage. */
|
|
198
|
+
function PaletteStill({ query, placeholder = "Search orders, products, customers", groups, loading, footer = true, style }) {
|
|
199
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
200
|
+
className: "o-command",
|
|
201
|
+
"data-mode": "fade",
|
|
202
|
+
"data-phase": "open",
|
|
203
|
+
style: {
|
|
204
|
+
position: "relative",
|
|
205
|
+
top: "auto",
|
|
206
|
+
left: "auto",
|
|
207
|
+
right: "auto",
|
|
208
|
+
zIndex: "auto",
|
|
209
|
+
width: "100%",
|
|
210
|
+
maxWidth: 640,
|
|
211
|
+
...style
|
|
212
|
+
},
|
|
213
|
+
children: [/* @__PURE__ */ jsx("span", { className: "o-command__shadow" }), /* @__PURE__ */ jsx("div", {
|
|
214
|
+
className: "o-command__panel",
|
|
215
|
+
"data-loading": loading ? "" : void 0,
|
|
216
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
217
|
+
className: "o-command__root",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsxs("div", {
|
|
220
|
+
className: "o-command__input-row",
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsx("span", {
|
|
223
|
+
className: "o-command__input-icon",
|
|
224
|
+
children: /* @__PURE__ */ jsx(SearchGlyphStill, {})
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ jsx("span", {
|
|
227
|
+
className: "o-command__input",
|
|
228
|
+
style: {
|
|
229
|
+
display: "flex",
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
color: query ? void 0 : "var(--o-fg-3)"
|
|
232
|
+
},
|
|
233
|
+
children: query || placeholder
|
|
234
|
+
}),
|
|
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
|
+
})]
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ jsx("span", {
|
|
246
|
+
className: "o-command__track",
|
|
247
|
+
children: /* @__PURE__ */ jsx("span", { className: "o-command__comet" })
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ jsx("div", {
|
|
252
|
+
className: "o-command__list",
|
|
253
|
+
style: { height: "auto" },
|
|
254
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
255
|
+
"cmdk-list-sizer": "",
|
|
256
|
+
children: groups.map((group, g) => /* @__PURE__ */ jsxs("div", {
|
|
257
|
+
className: "o-command__group",
|
|
258
|
+
children: [group.heading ? /* @__PURE__ */ jsx("div", {
|
|
259
|
+
"cmdk-group-heading": "",
|
|
260
|
+
children: group.heading
|
|
261
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
262
|
+
"cmdk-group-items": "",
|
|
263
|
+
children: group.items.map((item, i) => /* @__PURE__ */ jsxs("div", {
|
|
264
|
+
className: "o-command__item",
|
|
265
|
+
"data-selected": item.selected ? "true" : void 0,
|
|
266
|
+
children: [
|
|
267
|
+
item.selected ? /* @__PURE__ */ jsx("span", { className: "o-command__mark" }) : null,
|
|
268
|
+
/* @__PURE__ */ jsx("span", {
|
|
269
|
+
className: "o-command__item-icon",
|
|
270
|
+
children: item.icon
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ jsx("span", {
|
|
273
|
+
className: "o-command__item-label",
|
|
274
|
+
children: item.label
|
|
275
|
+
}),
|
|
276
|
+
item.hint ? /* @__PURE__ */ jsx("span", {
|
|
277
|
+
className: "o-command__item-hint",
|
|
278
|
+
children: item.hint
|
|
279
|
+
}) : null,
|
|
280
|
+
item.shortcut?.length ? /* @__PURE__ */ jsx("span", {
|
|
281
|
+
className: "o-command__item-keys",
|
|
282
|
+
children: /* @__PURE__ */ jsx(Kbd, { keys: item.shortcut })
|
|
283
|
+
}) : null
|
|
284
|
+
]
|
|
285
|
+
}, i))
|
|
286
|
+
})]
|
|
287
|
+
}, group.heading ?? g))
|
|
288
|
+
})
|
|
289
|
+
}),
|
|
290
|
+
footer ? /* @__PURE__ */ jsx("div", {
|
|
291
|
+
className: "o-command__footer",
|
|
292
|
+
"data-default": footer === true ? "" : void 0,
|
|
293
|
+
children: footer === true ? /* @__PURE__ */ jsxs("span", {
|
|
294
|
+
className: "o-command__hints",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsxs("span", {
|
|
297
|
+
className: "o-command__hint",
|
|
298
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
299
|
+
className: "o-command__hint-keys",
|
|
300
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "up" }), /* @__PURE__ */ jsx(Kbd, { children: "down" })]
|
|
301
|
+
}), "to move"]
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ jsxs("span", {
|
|
304
|
+
className: "o-command__hint",
|
|
305
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "enter" }), "to open"]
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ jsxs("span", {
|
|
308
|
+
className: "o-command__hint",
|
|
309
|
+
children: [/* @__PURE__ */ jsx(Kbd, { children: "Esc" }), "to close"]
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
}) : footer
|
|
313
|
+
}) : null
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
})]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
export { MenuSheet as a, SpecimenFrame as c, MenuRule as i, TooltipPill as l, MenuHeading as n, PaletteStill as o, MenuRow as r, PopoverSheet as s, DialogSheet as t };
|
|
@@ -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 };
|