@orbitcommerce/constellation-docs 0.0.0-stage → 1.0.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 +8260 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +308 -0
- package/dist/pages/Playground-CNbBbErC.js +129 -0
- package/dist/pages/_figures-data-BDmScEny.js +606 -0
- package/dist/pages/_foundations-blXWyYh8.js +30 -0
- package/dist/pages/_overlays-specimens-Dpn6oiyH.js +310 -0
- package/dist/pages/alert-BD4e6QTh.js +769 -0
- package/dist/pages/app-shell-KbA-nRqZ.js +1479 -0
- package/dist/pages/area-chart-B91dLcGo.js +562 -0
- package/dist/pages/avatar-DPPHXJAu.js +713 -0
- package/dist/pages/badge-C9JR0thI.js +729 -0
- package/dist/pages/button-D3V912P4.js +518 -0
- package/dist/pages/calendar-DSDZ9nRH.js +630 -0
- package/dist/pages/card-DUggbis3.js +659 -0
- package/dist/pages/checkbox-DwimQaK3.js +365 -0
- package/dist/pages/colour-BwuO8xAv.js +1498 -0
- package/dist/pages/command-palette-xAD7fOg6.js +1243 -0
- package/dist/pages/date-picker-BYSa816m.js +1421 -0
- package/dist/pages/delta-CtAo0eIM.js +574 -0
- package/dist/pages/dialog-BRAf4LMh.js +1451 -0
- package/dist/pages/docs-BNOb7AqR.js +515 -0
- package/dist/pages/empty-state-C-mLrXW2.js +417 -0
- package/dist/pages/figure-tabs-CoPFzzKz.js +460 -0
- package/dist/pages/home-dashboard-CFQwDtC9.js +959 -0
- package/dist/pages/host-B6znjEgQ.js +109 -0
- package/dist/pages/icon-button-C9eSVPPW.js +861 -0
- package/dist/pages/icons-sxkTs5Ob.js +473 -0
- package/dist/pages/input-KF9Gkawf.js +1093 -0
- package/dist/pages/installation-DpsX8G_n.js +445 -0
- package/dist/pages/kbd-cNfDoikz.js +544 -0
- package/dist/pages/live-globe-ClvLn9Lb.js +571 -0
- package/dist/pages/logo-BfGF1Pq9.js +571 -0
- package/dist/pages/menu-by2sgQ09.js +1618 -0
- package/dist/pages/motion-BvTGc2Dk.js +855 -0
- package/dist/pages/orbit-spinner-Dil1Z3Oy.js +332 -0
- package/dist/pages/overview-BPEbZQ6g.js +130 -0
- package/dist/pages/pagination-BBUnGvv5.js +249 -0
- package/dist/pages/popover-Db1gLDpb.js +1136 -0
- package/dist/pages/principles-CeAIOIdt.js +483 -0
- package/dist/pages/radio-group-CkdBWWfG.js +1077 -0
- package/dist/pages/registry-CroHzK9I.js +244 -0
- package/dist/pages/release-Dvo684UJ.js +13 -0
- package/dist/pages/rolling-number-qmvH84Mq.js +529 -0
- package/dist/pages/search-field-BN7MWGQ4.js +693 -0
- package/dist/pages/segmented-control-CTbIpRBW.js +777 -0
- package/dist/pages/select-DguELoRR.js +1429 -0
- package/dist/pages/separator-CPZub9pv.js +351 -0
- package/dist/pages/shape-DKvA0YKr.js +627 -0
- package/dist/pages/skeleton-DLuBhP46.js +561 -0
- package/dist/pages/sparkline-DMMYGbHn.js +668 -0
- package/dist/pages/switch-B-Qe4kcT.js +517 -0
- package/dist/pages/table-AMoODng4.js +607 -0
- package/dist/pages/tabs-B4M-usCV.js +1455 -0
- package/dist/pages/textarea-fTuUZRQb.js +693 -0
- package/dist/pages/toast-CKP03zjy.js +1176 -0
- package/dist/pages/tooltip-CBYil3kt.js +697 -0
- package/dist/pages/typography-PCbg8Bhg.js +735 -0
- package/manifest.json +3125 -0
- package/package.json +35 -4
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as DocTable, d as Section, i as DocPage, m as ThemePair, n as CodeBlock, o as Example, p as SubSection, r as DoDont, s as Guidelines } from "./docs-BNOb7AqR.js";
|
|
3
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Avatar, Button, Card, CardBody, CardHeader, Input, SearchField, SegmentedControl, ThemeScope } from "@orbitcommerce/constellation";
|
|
6
|
+
import { PackageIcon } from "@orbitcommerce/constellation/icons";
|
|
7
|
+
//#region src/pages/foundations/shape.tsx
|
|
8
|
+
var RADII = [
|
|
9
|
+
{
|
|
10
|
+
token: "--o-radius-xs",
|
|
11
|
+
value: "var(--o-radius-xs)",
|
|
12
|
+
px: 6,
|
|
13
|
+
use: "Keycaps, the chart plot"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
token: "--o-radius-sm",
|
|
17
|
+
value: "var(--o-radius-sm)",
|
|
18
|
+
px: 8,
|
|
19
|
+
use: "Command icon tiles, small focus shapes"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
token: "--o-radius-md",
|
|
23
|
+
value: "var(--o-radius-md)",
|
|
24
|
+
px: 12,
|
|
25
|
+
use: "Fields, icon tiles, chart readouts"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
token: "--o-menu-radius",
|
|
29
|
+
value: "14px",
|
|
30
|
+
px: 14,
|
|
31
|
+
use: "Menus, popovers, the store switcher"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
token: "--o-radius-lg",
|
|
35
|
+
value: "var(--o-radius-lg)",
|
|
36
|
+
px: 16,
|
|
37
|
+
use: "Cards, the canvas on phones"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
token: "--o-canvas-radius",
|
|
41
|
+
value: "var(--o-canvas-radius)",
|
|
42
|
+
px: 18,
|
|
43
|
+
use: "The page canvas"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
token: "--o-radius-xl",
|
|
47
|
+
value: "var(--o-radius-xl)",
|
|
48
|
+
px: 20,
|
|
49
|
+
use: "Dialogs, the command palette"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
token: "--o-radius-pill",
|
|
53
|
+
value: "var(--o-radius-pill)",
|
|
54
|
+
px: "pill",
|
|
55
|
+
use: "Everything that can be pressed"
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
var ALTITUDE = [
|
|
59
|
+
{
|
|
60
|
+
name: "Field",
|
|
61
|
+
px: 12,
|
|
62
|
+
lift: "hairline"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "Menu",
|
|
66
|
+
px: 14,
|
|
67
|
+
lift: "floating"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "Card",
|
|
71
|
+
px: 16,
|
|
72
|
+
lift: "raised"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Canvas",
|
|
76
|
+
px: 18,
|
|
77
|
+
lift: "canvas"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "Dialog",
|
|
81
|
+
px: 20,
|
|
82
|
+
lift: "modal"
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
var SHADOWS = [
|
|
86
|
+
{
|
|
87
|
+
token: "--o-shadow-pill",
|
|
88
|
+
name: "Pill",
|
|
89
|
+
use: "Secondary pills, the active nav pill, the segmented thumb",
|
|
90
|
+
radius: "var(--o-radius-pill)"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
token: "--o-shadow-canvas",
|
|
94
|
+
name: "Canvas",
|
|
95
|
+
use: "The page canvas and panels docked beside it",
|
|
96
|
+
radius: "var(--o-canvas-radius)"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
token: "--o-shadow-1",
|
|
100
|
+
name: "Low",
|
|
101
|
+
use: "Raised cards at rest",
|
|
102
|
+
radius: "var(--o-radius-lg)"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
token: "--o-shadow-2",
|
|
106
|
+
name: "Floating",
|
|
107
|
+
use: "Menus, popovers, tooltips, chart readouts",
|
|
108
|
+
radius: "14px"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
token: "--o-shadow-3",
|
|
112
|
+
name: "Modal",
|
|
113
|
+
use: "Dialogs, the command palette, the phone drawer",
|
|
114
|
+
radius: "var(--o-radius-xl)"
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
var SPACE = [
|
|
118
|
+
["0-5", 2],
|
|
119
|
+
["1", 4],
|
|
120
|
+
["1-5", 6],
|
|
121
|
+
["2", 8],
|
|
122
|
+
["2-5", 10],
|
|
123
|
+
["3", 12],
|
|
124
|
+
["4", 16],
|
|
125
|
+
["5", 20],
|
|
126
|
+
["6", 24],
|
|
127
|
+
["8", 32],
|
|
128
|
+
["10", 40],
|
|
129
|
+
["12", 48],
|
|
130
|
+
["16", 64]
|
|
131
|
+
];
|
|
132
|
+
var RANGES = [
|
|
133
|
+
{
|
|
134
|
+
value: "today",
|
|
135
|
+
label: "Today"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
value: "7d",
|
|
139
|
+
label: "7 days"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
value: "30d",
|
|
143
|
+
label: "30 days"
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
/** The control ladder: real components at each height, sitting between two guides. */
|
|
147
|
+
var LADDER = [
|
|
148
|
+
{
|
|
149
|
+
size: "lg",
|
|
150
|
+
px: 44,
|
|
151
|
+
controls: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
152
|
+
variant: "primary",
|
|
153
|
+
size: "lg",
|
|
154
|
+
children: "Start selling"
|
|
155
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
156
|
+
size: "lg",
|
|
157
|
+
placeholder: "Shop name",
|
|
158
|
+
"aria-label": "Shop name"
|
|
159
|
+
})] })
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
size: "md",
|
|
163
|
+
px: 36,
|
|
164
|
+
controls: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Button, { children: "Save changes" }),
|
|
166
|
+
/* @__PURE__ */ jsx(Input, {
|
|
167
|
+
placeholder: "Product name",
|
|
168
|
+
"aria-label": "Product name"
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ jsx(SearchField, {
|
|
171
|
+
placeholder: "Search orders",
|
|
172
|
+
"aria-label": "Search orders"
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
175
|
+
"aria-label": "Date range",
|
|
176
|
+
options: RANGES
|
|
177
|
+
})
|
|
178
|
+
] })
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
size: "sm",
|
|
182
|
+
px: 30,
|
|
183
|
+
controls: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
184
|
+
/* @__PURE__ */ jsx(Button, {
|
|
185
|
+
size: "sm",
|
|
186
|
+
children: "Export"
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ jsx(Input, {
|
|
189
|
+
size: "sm",
|
|
190
|
+
placeholder: "SKU",
|
|
191
|
+
"aria-label": "SKU"
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ jsx(SearchField, {
|
|
194
|
+
size: "sm",
|
|
195
|
+
placeholder: "Filter",
|
|
196
|
+
"aria-label": "Filter products"
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx(SegmentedControl, {
|
|
199
|
+
size: "sm",
|
|
200
|
+
"aria-label": "Date range, small",
|
|
201
|
+
options: RANGES
|
|
202
|
+
})
|
|
203
|
+
] })
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
size: "xs",
|
|
207
|
+
px: 24,
|
|
208
|
+
controls: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
209
|
+
size: "xs",
|
|
210
|
+
children: "Apply"
|
|
211
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
212
|
+
size: "xs",
|
|
213
|
+
variant: "soft",
|
|
214
|
+
children: "Undo"
|
|
215
|
+
})] })
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
/** Reads the shadow tokens as the stylesheet declares them, per theme. */
|
|
219
|
+
function useShadowValues() {
|
|
220
|
+
const light = useRef(null);
|
|
221
|
+
const dark = useRef(null);
|
|
222
|
+
const [values, setValues] = useState(null);
|
|
223
|
+
useLayoutEffect(() => {
|
|
224
|
+
const read = (el) => {
|
|
225
|
+
const style = el ? getComputedStyle(el) : null;
|
|
226
|
+
return Object.fromEntries(SHADOWS.map((s) => [s.token, style?.getPropertyValue(s.token).trim() ?? ""]));
|
|
227
|
+
};
|
|
228
|
+
setValues({
|
|
229
|
+
light: read(light.current),
|
|
230
|
+
dark: read(dark.current)
|
|
231
|
+
});
|
|
232
|
+
}, []);
|
|
233
|
+
return {
|
|
234
|
+
values,
|
|
235
|
+
probes: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ThemeScope, {
|
|
236
|
+
theme: "light",
|
|
237
|
+
ref: light,
|
|
238
|
+
hidden: true
|
|
239
|
+
}), /* @__PURE__ */ jsx(ThemeScope, {
|
|
240
|
+
theme: "dark",
|
|
241
|
+
ref: dark,
|
|
242
|
+
hidden: true
|
|
243
|
+
})] })
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function ShadowTiles() {
|
|
247
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
248
|
+
className: "shape-shadows",
|
|
249
|
+
children: [SHADOWS.map((s) => /* @__PURE__ */ jsxs("figure", {
|
|
250
|
+
className: "shape-shadow",
|
|
251
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
252
|
+
className: "shape-shadow__tile",
|
|
253
|
+
style: {
|
|
254
|
+
boxShadow: `var(${s.token})`,
|
|
255
|
+
borderRadius: s.radius
|
|
256
|
+
}
|
|
257
|
+
}), /* @__PURE__ */ jsxs("figcaption", { children: [/* @__PURE__ */ jsx("strong", { children: s.name }), /* @__PURE__ */ jsx("code", {
|
|
258
|
+
className: "shape-token",
|
|
259
|
+
children: s.token
|
|
260
|
+
})] })]
|
|
261
|
+
}, s.token)), /* @__PURE__ */ jsxs("figure", {
|
|
262
|
+
className: "shape-shadow",
|
|
263
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
264
|
+
className: "shape-shadow__tile",
|
|
265
|
+
"data-glow": ""
|
|
266
|
+
}), /* @__PURE__ */ jsxs("figcaption", { children: [/* @__PURE__ */ jsx("strong", { children: "Teal glow" }), /* @__PURE__ */ jsx("code", {
|
|
267
|
+
className: "shape-token",
|
|
268
|
+
children: "--o-accent-glow"
|
|
269
|
+
})] })]
|
|
270
|
+
})]
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function Planes() {
|
|
274
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
275
|
+
className: "shape-planes",
|
|
276
|
+
"aria-hidden": "true",
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ jsxs("div", {
|
|
279
|
+
className: "shape-planes__sidebar",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__store" }),
|
|
282
|
+
/* @__PURE__ */ jsx("span", {
|
|
283
|
+
className: "shape-planes__nav",
|
|
284
|
+
"data-active": ""
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__nav" }),
|
|
287
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__nav" }),
|
|
288
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__nav" })
|
|
289
|
+
]
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ jsx("div", {
|
|
292
|
+
className: "shape-planes__header",
|
|
293
|
+
children: /* @__PURE__ */ jsx("span", { className: "shape-planes__search" })
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ jsxs("div", {
|
|
296
|
+
className: "shape-planes__canvas",
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__title" }),
|
|
299
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__rule" }),
|
|
300
|
+
/* @__PURE__ */ jsx("span", { className: "shape-planes__row" }),
|
|
301
|
+
/* @__PURE__ */ jsx("span", {
|
|
302
|
+
className: "shape-planes__row",
|
|
303
|
+
"data-short": ""
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ jsxs("span", {
|
|
306
|
+
className: "shape-planes__well",
|
|
307
|
+
children: [/* @__PURE__ */ jsx("span", { className: "shape-planes__pebble" }), /* @__PURE__ */ jsx("span", { className: "shape-planes__pebble" })]
|
|
308
|
+
})
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
function Page() {
|
|
315
|
+
const { values, probes } = useShadowValues();
|
|
316
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
317
|
+
title: "Shape and depth",
|
|
318
|
+
lead: "Pills for everything that can be pressed, sheets that round as they rise, and two planes: the porcelain ground and one white canvas raised on it.",
|
|
319
|
+
children: [
|
|
320
|
+
probes,
|
|
321
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
322
|
+
id: "radius",
|
|
323
|
+
title: "Radius scale",
|
|
324
|
+
description: /* @__PURE__ */ jsx("p", { children: "Every radius in use. The Pill Rule: if it can be pressed, it is a pill, and variants change the material, never the shape. Surfaces take the soft corners, rounder the higher they float." }),
|
|
325
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
326
|
+
className: "shape-radii",
|
|
327
|
+
children: RADII.map((r) => /* @__PURE__ */ jsxs("figure", {
|
|
328
|
+
className: "shape-radius",
|
|
329
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
330
|
+
className: "shape-radius__tile",
|
|
331
|
+
style: { "--shape-r": r.value }
|
|
332
|
+
}), /* @__PURE__ */ jsxs("figcaption", { children: [
|
|
333
|
+
/* @__PURE__ */ jsx("strong", {
|
|
334
|
+
className: "o-num",
|
|
335
|
+
children: r.px === "pill" ? "Pill" : `${r.px}px`
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ jsx("code", {
|
|
338
|
+
className: "shape-token",
|
|
339
|
+
children: r.token
|
|
340
|
+
}),
|
|
341
|
+
/* @__PURE__ */ jsx("span", { children: r.use })
|
|
342
|
+
] })]
|
|
343
|
+
}, r.token))
|
|
344
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
345
|
+
title: "People are circles, stores are rounded squares",
|
|
346
|
+
description: /* @__PURE__ */ jsx("p", { children: "Avatars of people are circles. Stores, brands and products are squares with corners at 28% of their size. Rows inside sheets take their own small radius: 9px in menus, 10px in command results." }),
|
|
347
|
+
children: /* @__PURE__ */ jsxs(Example, {
|
|
348
|
+
code: `
|
|
349
|
+
<Avatar name="Priya Shah" size="lg" />
|
|
350
|
+
<Avatar name="Harbour Desk Co" shape="square" size="lg" />`,
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
353
|
+
name: "Priya Shah",
|
|
354
|
+
size: "xl"
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
357
|
+
name: "Priya Shah",
|
|
358
|
+
size: "lg"
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ jsx(Avatar, { name: "Priya Shah" }),
|
|
361
|
+
/* @__PURE__ */ jsx("span", {
|
|
362
|
+
className: "shape-divider",
|
|
363
|
+
"aria-hidden": "true"
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
366
|
+
name: "Harbour Desk Co",
|
|
367
|
+
shape: "square",
|
|
368
|
+
size: "xl"
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
371
|
+
name: "Harbour Desk Co",
|
|
372
|
+
shape: "square",
|
|
373
|
+
size: "lg"
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ jsx(Avatar, {
|
|
376
|
+
name: "Harbour Desk Co",
|
|
377
|
+
shape: "square"
|
|
378
|
+
})
|
|
379
|
+
]
|
|
380
|
+
})
|
|
381
|
+
})]
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ jsx(Section, {
|
|
384
|
+
id: "altitude",
|
|
385
|
+
title: "Altitude",
|
|
386
|
+
description: /* @__PURE__ */ jsx("p", { children: "The Altitude Rule: the higher a surface floats, the rounder its corners. A field sits in the page at 12px, a menu floats at 14px, a card at 16px, the canvas at 18px and a dialog, highest of all, at 20px." }),
|
|
387
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
388
|
+
align: "fill",
|
|
389
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
390
|
+
className: "shape-altitude",
|
|
391
|
+
children: ALTITUDE.map((a) => /* @__PURE__ */ jsxs("div", {
|
|
392
|
+
className: "shape-altitude__step",
|
|
393
|
+
"data-lift": a.lift,
|
|
394
|
+
style: { borderRadius: a.px },
|
|
395
|
+
children: [/* @__PURE__ */ jsx("strong", { children: a.name }), /* @__PURE__ */ jsxs("span", {
|
|
396
|
+
className: "o-num",
|
|
397
|
+
children: [a.px, "px"]
|
|
398
|
+
})]
|
|
399
|
+
}, a.name))
|
|
400
|
+
})
|
|
401
|
+
})
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
404
|
+
id: "controls",
|
|
405
|
+
title: "Control heights",
|
|
406
|
+
description: /* @__PURE__ */ jsx("p", { children: "Every control snaps to one ladder: 24, 30, 36 and 44px. Buttons, fields, search and segmented controls of the same size share a height, so any toolbar lines up. 36px is the default." }),
|
|
407
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
408
|
+
align: "fill",
|
|
409
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
410
|
+
className: "shape-ladder",
|
|
411
|
+
children: LADDER.map((row) => /* @__PURE__ */ jsxs("div", {
|
|
412
|
+
className: "shape-ladder__row",
|
|
413
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
414
|
+
className: "shape-ladder__label",
|
|
415
|
+
children: [/* @__PURE__ */ jsxs("strong", {
|
|
416
|
+
className: "o-num",
|
|
417
|
+
children: [row.px, "px"]
|
|
418
|
+
}), /* @__PURE__ */ jsxs("code", {
|
|
419
|
+
className: "shape-token",
|
|
420
|
+
children: ["--o-control-", row.size]
|
|
421
|
+
})]
|
|
422
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
423
|
+
className: "shape-ladder__controls",
|
|
424
|
+
"data-size": row.size,
|
|
425
|
+
children: row.controls
|
|
426
|
+
})]
|
|
427
|
+
}, row.size))
|
|
428
|
+
})
|
|
429
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
430
|
+
title: "Rows and fixed sizes",
|
|
431
|
+
description: /* @__PURE__ */ jsx("p", { children: "The density of a working tool: rows of 32 to 56px." }),
|
|
432
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
433
|
+
columns: ["Part", "Size"],
|
|
434
|
+
rows: [
|
|
435
|
+
["Header", "60px"],
|
|
436
|
+
["Sidebar", "256px wide, 68px as an icon rail"],
|
|
437
|
+
["Nav rows", "32px, nested rows 30px"],
|
|
438
|
+
["Menu rows", "34px"],
|
|
439
|
+
["Order tape rows", "52px"],
|
|
440
|
+
["Top product rows", "56px"],
|
|
441
|
+
["Badge and delta", "22px, 18px at sm"],
|
|
442
|
+
["Switch", "36 by 20px, 30 by 17px at sm"],
|
|
443
|
+
["Avatar", "20, 24, 32, 40 and 56px"]
|
|
444
|
+
]
|
|
445
|
+
})
|
|
446
|
+
})]
|
|
447
|
+
}),
|
|
448
|
+
/* @__PURE__ */ jsx(Section, {
|
|
449
|
+
id: "planes",
|
|
450
|
+
title: "Two planes",
|
|
451
|
+
description: /* @__PURE__ */ jsx("p", { children: "Flat inside the page, lifted at the frame. The sidebar and header share the porcelain ground, so the white canvas is the only raised plane. Inside the canvas, depth is tonal: hairlines, sunken wells and pebble fills." }),
|
|
452
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
453
|
+
caption: "The One Raised Page Rule: navigation and page sections never lift off the ground with shadows of their own.",
|
|
454
|
+
children: /* @__PURE__ */ jsx(Planes, {})
|
|
455
|
+
})
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
458
|
+
id: "shadows",
|
|
459
|
+
title: "Shadows",
|
|
460
|
+
description: /* @__PURE__ */ jsx("p", { children: "Kept for what floats over the page, and for pills, which carry a hairline ring and a 1px drop so a white pill still reads on a white canvas. In light, shadows are teal-tinted near-black; in dark they deepen to black and gain a faint white ring, because a shadow alone vanishes on a dark ground." }),
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ jsx(ThemePair, {
|
|
463
|
+
align: "fill",
|
|
464
|
+
children: /* @__PURE__ */ jsx(ShadowTiles, {})
|
|
465
|
+
}),
|
|
466
|
+
/* @__PURE__ */ jsx(DocTable, {
|
|
467
|
+
columns: [
|
|
468
|
+
"Token",
|
|
469
|
+
"Used for",
|
|
470
|
+
"Light",
|
|
471
|
+
"Dark"
|
|
472
|
+
],
|
|
473
|
+
rows: SHADOWS.map((s) => [
|
|
474
|
+
/* @__PURE__ */ jsx("code", { children: s.token }),
|
|
475
|
+
s.use,
|
|
476
|
+
/* @__PURE__ */ jsx("code", {
|
|
477
|
+
className: "shape-value",
|
|
478
|
+
children: values?.light[s.token]
|
|
479
|
+
}),
|
|
480
|
+
/* @__PURE__ */ jsx("code", {
|
|
481
|
+
className: "shape-value",
|
|
482
|
+
children: values?.dark[s.token]
|
|
483
|
+
})
|
|
484
|
+
])
|
|
485
|
+
}),
|
|
486
|
+
/* @__PURE__ */ jsxs("p", {
|
|
487
|
+
className: "doc-section__description shape-after-table",
|
|
488
|
+
children: [
|
|
489
|
+
"The one coloured shadow is the teal glow under a hovered primary pill, made from ",
|
|
490
|
+
/* @__PURE__ */ jsx("code", { children: "--o-accent-glow" }),
|
|
491
|
+
". Behind a dialog the page dims with ",
|
|
492
|
+
/* @__PURE__ */ jsx("code", { children: "--o-bg-overlay" }),
|
|
493
|
+
" under a 3px blur."
|
|
494
|
+
]
|
|
495
|
+
})
|
|
496
|
+
]
|
|
497
|
+
}),
|
|
498
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
499
|
+
id: "hairline-or-shadow",
|
|
500
|
+
title: "Hairline or shadow",
|
|
501
|
+
description: /* @__PURE__ */ jsx("p", { children: "The Hairline-or-Shadow Rule: a surface carries a 1px hairline or an elevation shadow, never both. A card that lifts swaps its hairline for a transparent border, so changing variant never moves its content." }),
|
|
502
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
503
|
+
do: {
|
|
504
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Card, {
|
|
505
|
+
padding: "sm",
|
|
506
|
+
className: "shape-card",
|
|
507
|
+
children: /* @__PURE__ */ jsx(CardHeader, {
|
|
508
|
+
title: "Outline",
|
|
509
|
+
description: "Hairline only"
|
|
510
|
+
})
|
|
511
|
+
}), /* @__PURE__ */ jsx(Card, {
|
|
512
|
+
padding: "sm",
|
|
513
|
+
variant: "raised",
|
|
514
|
+
className: "shape-card",
|
|
515
|
+
children: /* @__PURE__ */ jsx(CardHeader, {
|
|
516
|
+
title: "Raised",
|
|
517
|
+
description: "Shadow only"
|
|
518
|
+
})
|
|
519
|
+
})] }),
|
|
520
|
+
caption: "One edge per surface: a hairline on the canvas, a shadow on the ground."
|
|
521
|
+
},
|
|
522
|
+
dont: {
|
|
523
|
+
children: /* @__PURE__ */ jsx(Card, {
|
|
524
|
+
padding: "sm",
|
|
525
|
+
className: "shape-card",
|
|
526
|
+
style: { boxShadow: "var(--o-shadow-2)" },
|
|
527
|
+
children: /* @__PURE__ */ jsx(CardHeader, {
|
|
528
|
+
title: "Both",
|
|
529
|
+
description: "Hairline and shadow"
|
|
530
|
+
})
|
|
531
|
+
}),
|
|
532
|
+
caption: "A hairline and a shadow together look heavy and blur which plane the surface is on."
|
|
533
|
+
}
|
|
534
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
535
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The No-Box Rule." }), " Group with space, weight and a hairline before reaching for a card. A card earns its border only when the grouping cannot be read without one."] }),
|
|
536
|
+
"Hairlines come in three strengths: 8% for row dividers and outlined cards, 13% for field edges, 22% for hover edges.",
|
|
537
|
+
"Never lift the sidebar or header off the ground, and never give a page section its own shadow."
|
|
538
|
+
] })]
|
|
539
|
+
}),
|
|
540
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
541
|
+
id: "spacing",
|
|
542
|
+
title: "Spacing",
|
|
543
|
+
description: /* @__PURE__ */ jsx("p", { children: "A 4px base with 2px half-steps. Component interiors live on 2 to 12px, with odd pixels (5, 7, 9, 11px) kept as optical corrections around icons; layouts use 16px and up." }),
|
|
544
|
+
children: [
|
|
545
|
+
/* @__PURE__ */ jsx("div", {
|
|
546
|
+
className: "shape-space",
|
|
547
|
+
children: SPACE.map(([token, px]) => /* @__PURE__ */ jsxs("div", {
|
|
548
|
+
className: "shape-space__row",
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ jsxs("code", { children: ["--o-space-", token] }),
|
|
551
|
+
/* @__PURE__ */ jsxs("span", {
|
|
552
|
+
className: "shape-space__px o-num",
|
|
553
|
+
children: [px, "px"]
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ jsx("span", {
|
|
556
|
+
className: "shape-space__bar",
|
|
557
|
+
style: { width: `var(--o-space-${token})` },
|
|
558
|
+
"aria-hidden": "true"
|
|
559
|
+
})
|
|
560
|
+
]
|
|
561
|
+
}, token))
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
564
|
+
title: "Layout",
|
|
565
|
+
children: /* @__PURE__ */ jsx(DocTable, {
|
|
566
|
+
columns: ["Where", "Spacing"],
|
|
567
|
+
rows: [
|
|
568
|
+
["Canvas inset from the window edge", "8px, 6px on phones"],
|
|
569
|
+
["Page padding inside the canvas", "24px 28px 40px, 16px 14px 32px on phones"],
|
|
570
|
+
["Between sections on the canvas", "44 to 56px"],
|
|
571
|
+
["Card padding", "20px (16px at sm, 24px at lg), 16px between parts"],
|
|
572
|
+
["Dialog padding", "24px, 20px on phones"],
|
|
573
|
+
["Home dashboard", "1180px wide at most; 48px between the live globe and Next up; 56px in the lower split"]
|
|
574
|
+
]
|
|
575
|
+
})
|
|
576
|
+
}),
|
|
577
|
+
/* @__PURE__ */ jsx(CodeBlock, {
|
|
578
|
+
lang: "css",
|
|
579
|
+
code: `
|
|
580
|
+
.order-summary {
|
|
581
|
+
display: grid;
|
|
582
|
+
gap: var(--o-space-4);
|
|
583
|
+
padding: var(--o-space-5);
|
|
584
|
+
border-radius: var(--o-radius-lg);
|
|
585
|
+
box-shadow: inset 0 0 0 1px var(--o-border-1);
|
|
586
|
+
}`
|
|
587
|
+
})
|
|
588
|
+
]
|
|
589
|
+
}),
|
|
590
|
+
/* @__PURE__ */ jsx(Section, {
|
|
591
|
+
id: "in-context",
|
|
592
|
+
title: "In context",
|
|
593
|
+
description: /* @__PURE__ */ jsx("p", { children: "Pills inside a card inside the canvas: each level rounder than the one it sits in." }),
|
|
594
|
+
children: /* @__PURE__ */ jsx(Example, { children: /* @__PURE__ */ jsx("div", {
|
|
595
|
+
className: "shape-context",
|
|
596
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
597
|
+
className: "shape-context__card",
|
|
598
|
+
children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
599
|
+
icon: /* @__PURE__ */ jsx(PackageIcon, {}),
|
|
600
|
+
title: "Arden ergonomic chair",
|
|
601
|
+
description: "12 in stock · SKU ARD-CHR-BLK",
|
|
602
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
603
|
+
size: "sm",
|
|
604
|
+
variant: "soft",
|
|
605
|
+
children: "Edit"
|
|
606
|
+
})
|
|
607
|
+
}), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsxs("div", {
|
|
608
|
+
className: "shape-context__row",
|
|
609
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
610
|
+
size: "sm",
|
|
611
|
+
prefix: "£",
|
|
612
|
+
defaultValue: "249.00",
|
|
613
|
+
"aria-label": "Price"
|
|
614
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
615
|
+
size: "sm",
|
|
616
|
+
variant: "primary",
|
|
617
|
+
children: "Save price"
|
|
618
|
+
})]
|
|
619
|
+
}) })]
|
|
620
|
+
})
|
|
621
|
+
}) })
|
|
622
|
+
})
|
|
623
|
+
]
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
//#endregion
|
|
627
|
+
export { Page };
|