@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,1498 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as DocTable, d as Section, i as DocPage, l as Note, m as ThemePair, n as CodeBlock, o as Example, p as SubSection, r as DoDont, s as Guidelines } from "./docs-BNOb7AqR.js";
|
|
3
|
+
import { n as useCopied, t as LiveStatus } from "./_foundations-blXWyYh8.js";
|
|
4
|
+
import { createContext, useContext, useLayoutEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Badge, Button, Delta, Sparkline, Switch, ThemeScope } from "@orbitcommerce/constellation";
|
|
7
|
+
import { CheckIcon } from "@orbitcommerce/constellation/icons";
|
|
8
|
+
//#region src/pages/foundations/_colour-math.ts
|
|
9
|
+
var clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
10
|
+
var toLinear = (c) => c <= .04045 ? c / 12.92 : ((c + .055) / 1.055) ** 2.4;
|
|
11
|
+
var toGamma = (c) => c <= .0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - .055;
|
|
12
|
+
function oklabToSrgb(L, a, b) {
|
|
13
|
+
const l = (L + .3963377774 * a + .2158037573 * b) ** 3;
|
|
14
|
+
const m = (L - .1055613458 * a - .0638541728 * b) ** 3;
|
|
15
|
+
const s = (L - .0894841775 * a - 1.291485548 * b) ** 3;
|
|
16
|
+
return [
|
|
17
|
+
clamp01(toGamma(4.0767416621 * l - 3.3077115913 * m + .2309699292 * s)),
|
|
18
|
+
clamp01(toGamma(-1.2684380046 * l + 2.6097574011 * m - .3413193965 * s)),
|
|
19
|
+
clamp01(toGamma(-.0041960863 * l - .7034186147 * m + 1.707614701 * s))
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
/** A number, a percentage (scaled by `percentOf`), `none` (0), or an angle in degrees. */
|
|
23
|
+
function num(token, percentOf = 1) {
|
|
24
|
+
if (!token || token === "none") return 0;
|
|
25
|
+
if (token.endsWith("%")) return parseFloat(token) / 100 * percentOf;
|
|
26
|
+
if (token.endsWith("deg")) return parseFloat(token);
|
|
27
|
+
if (token.endsWith("turn")) return parseFloat(token) * 360;
|
|
28
|
+
if (token.endsWith("rad")) return parseFloat(token) * 180 / Math.PI;
|
|
29
|
+
return parseFloat(token);
|
|
30
|
+
}
|
|
31
|
+
/** Splits `fn(a b c / d)` or `fn(a, b, c, d)` into its channel tokens and alpha token. */
|
|
32
|
+
function channels(body) {
|
|
33
|
+
const [main = "", alpha] = body.split("/").map((s) => s.trim());
|
|
34
|
+
const parts = main.split(/[\s,]+/).filter(Boolean);
|
|
35
|
+
if (alpha === void 0 && parts.length === 4) return {
|
|
36
|
+
parts: parts.slice(0, 3),
|
|
37
|
+
alpha: parts[3]
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
parts,
|
|
41
|
+
alpha
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
var canvasContext;
|
|
45
|
+
/** Last resort: let the browser resolve the colour to sRGB through a 1 × 1 canvas. */
|
|
46
|
+
function viaCanvas(css) {
|
|
47
|
+
if (canvasContext === void 0) {
|
|
48
|
+
const canvas = document.createElement("canvas");
|
|
49
|
+
canvas.width = canvas.height = 1;
|
|
50
|
+
canvasContext = canvas.getContext("2d", { willReadFrequently: true });
|
|
51
|
+
}
|
|
52
|
+
const ctx = canvasContext;
|
|
53
|
+
if (!ctx) return null;
|
|
54
|
+
ctx.clearRect(0, 0, 1, 1);
|
|
55
|
+
ctx.fillStyle = "#000";
|
|
56
|
+
ctx.fillStyle = css;
|
|
57
|
+
ctx.fillRect(0, 0, 1, 1);
|
|
58
|
+
const [r = 0, g = 0, b = 0, a = 0] = ctx.getImageData(0, 0, 1, 1).data;
|
|
59
|
+
return {
|
|
60
|
+
r: r / 255,
|
|
61
|
+
g: g / 255,
|
|
62
|
+
b: b / 255,
|
|
63
|
+
a: a / 255
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** Parses a resolved CSS colour (as getComputedStyle returns it) into sRGB. */
|
|
67
|
+
function parseColor(input) {
|
|
68
|
+
const css = input.trim().toLowerCase();
|
|
69
|
+
if (!css) return null;
|
|
70
|
+
if (css === "transparent") return {
|
|
71
|
+
r: 0,
|
|
72
|
+
g: 0,
|
|
73
|
+
b: 0,
|
|
74
|
+
a: 0
|
|
75
|
+
};
|
|
76
|
+
const match = css.match(/^([a-z-]+)\((.*)\)$/);
|
|
77
|
+
if (!match) return viaCanvas(css);
|
|
78
|
+
const [, fn, body = ""] = match;
|
|
79
|
+
if (fn === "rgb" || fn === "rgba") {
|
|
80
|
+
const { parts, alpha } = channels(body);
|
|
81
|
+
const [r, g, b] = parts.map((p) => num(p, 255) / 255);
|
|
82
|
+
return {
|
|
83
|
+
r,
|
|
84
|
+
g,
|
|
85
|
+
b,
|
|
86
|
+
a: alpha === void 0 ? 1 : num(alpha)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (fn === "oklch") {
|
|
90
|
+
const { parts, alpha } = channels(body);
|
|
91
|
+
const L = num(parts[0]);
|
|
92
|
+
const C = num(parts[1], .4);
|
|
93
|
+
const h = num(parts[2]) * Math.PI / 180;
|
|
94
|
+
const [r, g, b] = oklabToSrgb(L, C * Math.cos(h), C * Math.sin(h));
|
|
95
|
+
return {
|
|
96
|
+
r,
|
|
97
|
+
g,
|
|
98
|
+
b,
|
|
99
|
+
a: alpha === void 0 ? 1 : num(alpha)
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (fn === "oklab") {
|
|
103
|
+
const { parts, alpha } = channels(body);
|
|
104
|
+
const [r, g, b] = oklabToSrgb(num(parts[0]), num(parts[1], .4), num(parts[2], .4));
|
|
105
|
+
return {
|
|
106
|
+
r,
|
|
107
|
+
g,
|
|
108
|
+
b,
|
|
109
|
+
a: alpha === void 0 ? 1 : num(alpha)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (fn === "color") {
|
|
113
|
+
const { parts, alpha } = channels(body);
|
|
114
|
+
const [space, ...rest] = parts;
|
|
115
|
+
const [x, y, z] = rest.map((p) => num(p));
|
|
116
|
+
const a = alpha === void 0 ? 1 : num(alpha);
|
|
117
|
+
if (space === "srgb") return {
|
|
118
|
+
r: x,
|
|
119
|
+
g: y,
|
|
120
|
+
b: z,
|
|
121
|
+
a
|
|
122
|
+
};
|
|
123
|
+
if (space === "srgb-linear") return {
|
|
124
|
+
r: toGamma(x),
|
|
125
|
+
g: toGamma(y),
|
|
126
|
+
b: toGamma(z),
|
|
127
|
+
a
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return viaCanvas(css);
|
|
131
|
+
}
|
|
132
|
+
/** `fg` laid over `bg` (source-over, in gamma-encoded sRGB, as browsers paint). */
|
|
133
|
+
function composite(fg, bg) {
|
|
134
|
+
const a = fg.a + bg.a * (1 - fg.a);
|
|
135
|
+
if (a === 0) return {
|
|
136
|
+
r: 0,
|
|
137
|
+
g: 0,
|
|
138
|
+
b: 0,
|
|
139
|
+
a: 0
|
|
140
|
+
};
|
|
141
|
+
const mix = (f, b) => (f * fg.a + b * bg.a * (1 - fg.a)) / a;
|
|
142
|
+
return {
|
|
143
|
+
r: mix(fg.r, bg.r),
|
|
144
|
+
g: mix(fg.g, bg.g),
|
|
145
|
+
b: mix(fg.b, bg.b),
|
|
146
|
+
a
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** WCAG 2 relative luminance. */
|
|
150
|
+
function luminance({ r, g, b }) {
|
|
151
|
+
return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
|
|
152
|
+
}
|
|
153
|
+
/** WCAG 2 contrast ratio of `fg` over `bg` (a translucent `fg` is laid over `bg` first). */
|
|
154
|
+
function contrastRatio(fg, bg) {
|
|
155
|
+
const [hi, lo] = [luminance(fg.a < 1 ? composite(fg, bg) : fg), luminance(bg)].sort((x, y) => y - x);
|
|
156
|
+
return (hi + .05) / (lo + .05);
|
|
157
|
+
}
|
|
158
|
+
/** `#336A65`. Alpha is ignored: report it separately. */
|
|
159
|
+
function toHex({ r, g, b }) {
|
|
160
|
+
return `#${[
|
|
161
|
+
r,
|
|
162
|
+
g,
|
|
163
|
+
b
|
|
164
|
+
].map((c) => Math.round(clamp01(c) * 255).toString(16).padStart(2, "0")).join("").toUpperCase()}`;
|
|
165
|
+
}
|
|
166
|
+
/** WCAG 2.2 levels for text: 7:1, 4.5:1, and 3:1 for large text and interface marks. */
|
|
167
|
+
function gradeOf(ratio) {
|
|
168
|
+
if (ratio >= 7) return "AAA";
|
|
169
|
+
if (ratio >= 4.5) return "AA";
|
|
170
|
+
if (ratio >= 3) return "AA large";
|
|
171
|
+
return "Below 3:1";
|
|
172
|
+
}
|
|
173
|
+
/** A ratio as people write it: 18.5:1. Truncated, never rounded up, so a 4.49 never reads as a pass. */
|
|
174
|
+
function formatRatio(ratio) {
|
|
175
|
+
return `${(Math.floor(ratio * 10) / 10).toFixed(1)}:1`;
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/pages/foundations/colour.tsx
|
|
179
|
+
var TEAL = [
|
|
180
|
+
"25",
|
|
181
|
+
"50",
|
|
182
|
+
"100",
|
|
183
|
+
"200",
|
|
184
|
+
"300",
|
|
185
|
+
"400",
|
|
186
|
+
"500",
|
|
187
|
+
"600",
|
|
188
|
+
"700",
|
|
189
|
+
"800",
|
|
190
|
+
"900",
|
|
191
|
+
"950"
|
|
192
|
+
].map((s) => `teal-${s}`);
|
|
193
|
+
var GREY = [
|
|
194
|
+
"0",
|
|
195
|
+
"25",
|
|
196
|
+
"50",
|
|
197
|
+
"75",
|
|
198
|
+
"100",
|
|
199
|
+
"150",
|
|
200
|
+
"200",
|
|
201
|
+
"300",
|
|
202
|
+
"400",
|
|
203
|
+
"500",
|
|
204
|
+
"550",
|
|
205
|
+
"600",
|
|
206
|
+
"700",
|
|
207
|
+
"800",
|
|
208
|
+
"850",
|
|
209
|
+
"900",
|
|
210
|
+
"925",
|
|
211
|
+
"950",
|
|
212
|
+
"975",
|
|
213
|
+
"1000"
|
|
214
|
+
].map((s) => `grey-${s}`);
|
|
215
|
+
var BRAND = [
|
|
216
|
+
"mint",
|
|
217
|
+
"ink",
|
|
218
|
+
"paper"
|
|
219
|
+
];
|
|
220
|
+
var STATUS = [
|
|
221
|
+
"green-500",
|
|
222
|
+
"green-100",
|
|
223
|
+
"red-500",
|
|
224
|
+
"red-100",
|
|
225
|
+
"amber-500",
|
|
226
|
+
"amber-100",
|
|
227
|
+
"blue-500",
|
|
228
|
+
"blue-100"
|
|
229
|
+
];
|
|
230
|
+
var PRIMITIVES = [
|
|
231
|
+
...TEAL,
|
|
232
|
+
...BRAND,
|
|
233
|
+
...GREY,
|
|
234
|
+
...STATUS
|
|
235
|
+
];
|
|
236
|
+
/** The names DESIGN.md gives the colours, so reviewers and designers share one vocabulary. */
|
|
237
|
+
var NAMES = {
|
|
238
|
+
"teal-50": "Teal Wash",
|
|
239
|
+
"teal-100": "Teal Tint",
|
|
240
|
+
"teal-400": "Night Line",
|
|
241
|
+
"teal-500": "Orbit Line",
|
|
242
|
+
"teal-600": "Orbit Teal",
|
|
243
|
+
"teal-700": "Deep Teal",
|
|
244
|
+
mint: "Orbit Mint",
|
|
245
|
+
ink: "Brand Ink",
|
|
246
|
+
paper: "Paper",
|
|
247
|
+
"grey-0": "Canvas White",
|
|
248
|
+
"grey-25": "Frost",
|
|
249
|
+
"grey-50": "Well",
|
|
250
|
+
"grey-75": "Porcelain",
|
|
251
|
+
"grey-100": "Pebble",
|
|
252
|
+
"grey-400": "Mist",
|
|
253
|
+
"grey-550": "Quiet Slate",
|
|
254
|
+
"grey-600": "Slate Ink",
|
|
255
|
+
"grey-925": "Graphite",
|
|
256
|
+
"grey-975": "Night Canvas",
|
|
257
|
+
"grey-1000": "Night Ground",
|
|
258
|
+
"green-500": "Ledger Green",
|
|
259
|
+
"green-100": "Green Wash",
|
|
260
|
+
"red-500": "Signal Red",
|
|
261
|
+
"red-100": "Red Wash",
|
|
262
|
+
"amber-500": "Strain Amber",
|
|
263
|
+
"amber-100": "Amber Wash",
|
|
264
|
+
"blue-500": "Notice Blue",
|
|
265
|
+
"blue-100": "Blue Wash"
|
|
266
|
+
};
|
|
267
|
+
/** Named values that are written straight into the theme rather than taken from a ramp. */
|
|
268
|
+
var RAW_NAMES = {
|
|
269
|
+
"oklch(95% 0.005 180)": "Night Ink",
|
|
270
|
+
"oklch(16% 0.02 190)": "Night On-Mint",
|
|
271
|
+
"oklch(92% 0.07 180)": "Comet Light"
|
|
272
|
+
};
|
|
273
|
+
var SEMANTIC = [
|
|
274
|
+
{
|
|
275
|
+
id: "backgrounds",
|
|
276
|
+
title: "Backgrounds",
|
|
277
|
+
description: "Two planes and the tones inside them: the porcelain ground, one raised canvas, and wells and fills for depth.",
|
|
278
|
+
rows: [
|
|
279
|
+
{
|
|
280
|
+
token: "bg-ground",
|
|
281
|
+
kind: "surface",
|
|
282
|
+
use: "The ground the sidebar and header sit on."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
token: "bg-canvas",
|
|
286
|
+
kind: "surface",
|
|
287
|
+
use: "The page canvas, and everything raised in light."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
token: "bg-raised",
|
|
291
|
+
kind: "surface",
|
|
292
|
+
use: "Menus, popovers, dialogs and raised cards. Graphite in dark."
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
token: "bg-sunken",
|
|
296
|
+
kind: "surface",
|
|
297
|
+
use: "Wells: the secondary pill's hover, read-only fields, sunken cards."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
token: "bg-muted",
|
|
301
|
+
kind: "surface",
|
|
302
|
+
use: "Soft pills, the segmented track, neutral badges, skeletons."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
token: "bg-inverse",
|
|
306
|
+
kind: "surface",
|
|
307
|
+
use: "Tooltips and inverse pills."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
token: "bg-hover",
|
|
311
|
+
kind: "tint",
|
|
312
|
+
use: "The one hover: nav rows, menu rows, ghost buttons, list rows."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
token: "bg-press",
|
|
316
|
+
kind: "tint",
|
|
317
|
+
use: "Pressed rows: a command result, the search clear button."
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
token: "bg-selected",
|
|
321
|
+
kind: "surface",
|
|
322
|
+
use: "The active nav pill."
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
token: "bg-overlay",
|
|
326
|
+
kind: "overlay",
|
|
327
|
+
use: "Dims the page behind a dialog, the palette and the phone drawer."
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: "text",
|
|
333
|
+
title: "Text",
|
|
334
|
+
description: "Words stay achromatic. Four steps of ink, and two for text on a fill.",
|
|
335
|
+
rows: [
|
|
336
|
+
{
|
|
337
|
+
token: "fg-1",
|
|
338
|
+
kind: "text",
|
|
339
|
+
use: "Every word and figure."
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
token: "fg-2",
|
|
343
|
+
kind: "text",
|
|
344
|
+
use: "Secondary text, descriptions, nav labels at rest."
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
token: "fg-3",
|
|
348
|
+
kind: "text",
|
|
349
|
+
use: "Meta lines, hints, placeholders, timestamps, section titles."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
token: "fg-4",
|
|
353
|
+
kind: "text",
|
|
354
|
+
use: "Marks only, never text: dial ticks, separators, idle dots."
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
token: "fg-inverse",
|
|
358
|
+
kind: "text",
|
|
359
|
+
on: "bg-inverse",
|
|
360
|
+
use: "Text on inverse surfaces: tooltips, inverse pills."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
token: "fg-on-accent",
|
|
364
|
+
kind: "text",
|
|
365
|
+
on: "accent",
|
|
366
|
+
use: "Text on the accent: the primary pill's label."
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
id: "borders",
|
|
372
|
+
title: "Borders",
|
|
373
|
+
description: "Hairlines in three strengths. A surface carries a hairline or a shadow, never both.",
|
|
374
|
+
rows: [
|
|
375
|
+
{
|
|
376
|
+
token: "border-1",
|
|
377
|
+
kind: "border",
|
|
378
|
+
use: "Row dividers and outlined cards."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
token: "border-2",
|
|
382
|
+
kind: "border",
|
|
383
|
+
use: "Field edges, the nested nav orbit, the tape rail."
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
token: "border-3",
|
|
387
|
+
kind: "border",
|
|
388
|
+
use: "Hover edges, the future arc of the day, scrollbar thumbs."
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: "accent",
|
|
394
|
+
title: "Accent",
|
|
395
|
+
description: "Orbit teal in light, Orbit Mint in dark. Lines, rings, focus, live marks, selection and the one primary pill.",
|
|
396
|
+
rows: [
|
|
397
|
+
{
|
|
398
|
+
token: "accent",
|
|
399
|
+
kind: "fill",
|
|
400
|
+
use: "The primary pill, a switch that is on, live dots, the chart line."
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
token: "accent-hover",
|
|
404
|
+
kind: "fill",
|
|
405
|
+
use: "The primary pill's hover."
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
token: "accent-press",
|
|
409
|
+
kind: "fill",
|
|
410
|
+
use: "Reserved for a pressed accent fill. No component reads it yet."
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
token: "accent-fg",
|
|
414
|
+
kind: "text",
|
|
415
|
+
use: "Teal as text: accent badges, nav counts, links."
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
token: "accent-subtle",
|
|
419
|
+
kind: "fill",
|
|
420
|
+
use: "The palest wash, for small marks only."
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
token: "accent-subtle-2",
|
|
424
|
+
kind: "fill",
|
|
425
|
+
use: "Nav counts and accent badges."
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
token: "accent-line",
|
|
429
|
+
kind: "line",
|
|
430
|
+
use: "Lines and rings: the empty-state orbit, a tab's underline, a badge's ring."
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
token: "accent-glow",
|
|
434
|
+
kind: "glow",
|
|
435
|
+
use: "The only coloured shadow: under a hovered primary pill."
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
token: "comet",
|
|
439
|
+
kind: "comet",
|
|
440
|
+
use: "The head of the comet that circles the primary pill."
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
id: "status",
|
|
446
|
+
title: "Status",
|
|
447
|
+
description: "For status only: paid, falling, strained, for your information. Each hue has a wash to sit on.",
|
|
448
|
+
rows: [
|
|
449
|
+
{
|
|
450
|
+
token: "positive",
|
|
451
|
+
kind: "fill",
|
|
452
|
+
use: "Rising figures and good states: paid, fulfilled."
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
token: "positive-subtle",
|
|
456
|
+
kind: "fill",
|
|
457
|
+
use: "The wash under a positive badge or delta."
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
token: "negative",
|
|
461
|
+
kind: "fill",
|
|
462
|
+
use: "Falling figures, refunds, field errors, destructive actions."
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
token: "negative-subtle",
|
|
466
|
+
kind: "fill",
|
|
467
|
+
use: "The wash under a negative badge or delta."
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
token: "warning",
|
|
471
|
+
kind: "fill",
|
|
472
|
+
use: "Strained states: an order waiting over a day, stock at zero."
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
token: "warning-subtle",
|
|
476
|
+
kind: "fill",
|
|
477
|
+
use: "The wash under a warning badge."
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
token: "info",
|
|
481
|
+
kind: "fill",
|
|
482
|
+
use: "Informational badges."
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
token: "info-subtle",
|
|
486
|
+
kind: "fill",
|
|
487
|
+
use: "The wash under an info badge."
|
|
488
|
+
}
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: "focus",
|
|
493
|
+
title: "Focus and selection",
|
|
494
|
+
description: "Keyboard focus is a 2px teal outline, 2px off the shape. Selected text takes a teal tint.",
|
|
495
|
+
rows: [{
|
|
496
|
+
token: "focus",
|
|
497
|
+
kind: "focus",
|
|
498
|
+
use: "The focus ring on every interactive part."
|
|
499
|
+
}, {
|
|
500
|
+
token: "selection",
|
|
501
|
+
kind: "selection",
|
|
502
|
+
use: "Selected text inside .o-root."
|
|
503
|
+
}]
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
id: "charts",
|
|
507
|
+
title: "Charts",
|
|
508
|
+
description: "One teal line over a wash that fades, the previous period in Mist, and gridlines you barely see.",
|
|
509
|
+
rows: [
|
|
510
|
+
{
|
|
511
|
+
token: "chart-1",
|
|
512
|
+
kind: "line",
|
|
513
|
+
use: "The series line."
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
token: "chart-1-fill",
|
|
517
|
+
kind: "fill",
|
|
518
|
+
use: "The wash under the line."
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
token: "chart-2",
|
|
522
|
+
kind: "dashed",
|
|
523
|
+
use: "The comparison line: the previous period."
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
token: "chart-grid",
|
|
527
|
+
kind: "grid",
|
|
528
|
+
use: "Gridlines."
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
];
|
|
533
|
+
var SEMANTIC_TOKENS = SEMANTIC.flatMap((g) => g.rows.map((r) => r.token));
|
|
534
|
+
var ReadoutContext = createContext(null);
|
|
535
|
+
function aliasOf(value, primitives) {
|
|
536
|
+
const direct = primitives.get(value);
|
|
537
|
+
if (direct) return direct;
|
|
538
|
+
let pretty = value;
|
|
539
|
+
for (const [v, name] of [...primitives.entries()].sort((a, b) => b[0].length - a[0].length)) pretty = pretty.split(v).join(name);
|
|
540
|
+
const mix = pretty.match(/^color-mix\(in oklch,\s*(.+?)\s+([\d.]+%),\s*transparent\)$/);
|
|
541
|
+
return mix ? `${mix[1]} at ${mix[2]}` : pretty;
|
|
542
|
+
}
|
|
543
|
+
function readScope(scope) {
|
|
544
|
+
const root = getComputedStyle(document.documentElement);
|
|
545
|
+
const primitives = /* @__PURE__ */ new Map();
|
|
546
|
+
for (const p of PRIMITIVES) {
|
|
547
|
+
const v = root.getPropertyValue(`--o-${p}`).trim();
|
|
548
|
+
if (v && !primitives.has(v)) primitives.set(v, p);
|
|
549
|
+
}
|
|
550
|
+
const style = getComputedStyle(scope);
|
|
551
|
+
const probe = document.createElement("span");
|
|
552
|
+
scope.appendChild(probe);
|
|
553
|
+
const out = {};
|
|
554
|
+
for (const token of [...PRIMITIVES, ...SEMANTIC_TOKENS]) {
|
|
555
|
+
const value = style.getPropertyValue(`--o-${token}`).trim();
|
|
556
|
+
probe.style.backgroundColor = `var(--o-${token})`;
|
|
557
|
+
const alias = aliasOf(value, primitives);
|
|
558
|
+
const direct = primitives.get(value);
|
|
559
|
+
out[token] = {
|
|
560
|
+
value,
|
|
561
|
+
alias,
|
|
562
|
+
name: direct && NAMES[direct] || RAW_NAMES[value],
|
|
563
|
+
color: parseColor(getComputedStyle(probe).backgroundColor)
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
probe.remove();
|
|
567
|
+
return out;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Reads every colour token in both themes once, from two hidden theme scopes, so every hex value
|
|
571
|
+
* and contrast ratio on the page comes from the live tokens.
|
|
572
|
+
*/
|
|
573
|
+
function Readings({ children }) {
|
|
574
|
+
const light = useRef(null);
|
|
575
|
+
const dark = useRef(null);
|
|
576
|
+
const [readouts, setReadouts] = useState(null);
|
|
577
|
+
useLayoutEffect(() => {
|
|
578
|
+
if (!light.current || !dark.current) return;
|
|
579
|
+
setReadouts({
|
|
580
|
+
light: readScope(light.current),
|
|
581
|
+
dark: readScope(dark.current)
|
|
582
|
+
});
|
|
583
|
+
}, []);
|
|
584
|
+
return /* @__PURE__ */ jsxs(ReadoutContext.Provider, {
|
|
585
|
+
value: readouts,
|
|
586
|
+
children: [
|
|
587
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
588
|
+
theme: "light",
|
|
589
|
+
ref: light,
|
|
590
|
+
hidden: true
|
|
591
|
+
}),
|
|
592
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
593
|
+
theme: "dark",
|
|
594
|
+
ref: dark,
|
|
595
|
+
hidden: true
|
|
596
|
+
}),
|
|
597
|
+
children
|
|
598
|
+
]
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
function useReadout(theme, token) {
|
|
602
|
+
return useContext(ReadoutContext)?.[theme][token];
|
|
603
|
+
}
|
|
604
|
+
function hexOf(readout) {
|
|
605
|
+
if (!readout?.color) return "";
|
|
606
|
+
const alpha = Math.round(readout.color.a * 100);
|
|
607
|
+
return alpha < 100 ? `${toHex(readout.color)} at ${alpha}%` : toHex(readout.color);
|
|
608
|
+
}
|
|
609
|
+
var R = 46;
|
|
610
|
+
var point = (deg, r = R) => {
|
|
611
|
+
const a = deg * Math.PI / 180;
|
|
612
|
+
return {
|
|
613
|
+
x: 60 + r * Math.sin(a),
|
|
614
|
+
y: 60 - r * Math.cos(a)
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
var NOW = 250;
|
|
618
|
+
var SALES = [
|
|
619
|
+
[42, 1.7],
|
|
620
|
+
[96, 2.6],
|
|
621
|
+
[112, 1.9],
|
|
622
|
+
[150, 3.2],
|
|
623
|
+
[178, 2.1],
|
|
624
|
+
[205, 2.4],
|
|
625
|
+
[231, 1.6]
|
|
626
|
+
];
|
|
627
|
+
/** The day as an orbit: teal as a line (the arc), a fill (the sales) and light (the satellite's core). */
|
|
628
|
+
function OrbitDrawing() {
|
|
629
|
+
const end = point(NOW);
|
|
630
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
631
|
+
className: "colour-hero__orbit",
|
|
632
|
+
viewBox: "0 0 120 120",
|
|
633
|
+
"aria-hidden": "true",
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ jsx("path", {
|
|
636
|
+
d: `M ${end.x.toFixed(2)} ${end.y.toFixed(2)} A ${R} ${R} 0 0 1 60 14`,
|
|
637
|
+
className: "colour-hero__future"
|
|
638
|
+
}),
|
|
639
|
+
/* @__PURE__ */ jsx("path", {
|
|
640
|
+
d: `M 60 14 A ${R} ${R} 0 1 1 ${end.x.toFixed(2)} ${end.y.toFixed(2)}`,
|
|
641
|
+
className: "colour-hero__arc"
|
|
642
|
+
}),
|
|
643
|
+
SALES.map(([deg, r]) => {
|
|
644
|
+
const p = point(deg);
|
|
645
|
+
return /* @__PURE__ */ jsx("circle", {
|
|
646
|
+
cx: p.x,
|
|
647
|
+
cy: p.y,
|
|
648
|
+
r,
|
|
649
|
+
className: "colour-hero__sale"
|
|
650
|
+
}, deg);
|
|
651
|
+
}),
|
|
652
|
+
/* @__PURE__ */ jsx("circle", {
|
|
653
|
+
cx: end.x,
|
|
654
|
+
cy: end.y,
|
|
655
|
+
r: "6",
|
|
656
|
+
className: "colour-hero__satellite"
|
|
657
|
+
}),
|
|
658
|
+
/* @__PURE__ */ jsx("circle", {
|
|
659
|
+
cx: end.x,
|
|
660
|
+
cy: end.y,
|
|
661
|
+
r: "2.3",
|
|
662
|
+
className: "colour-hero__core"
|
|
663
|
+
})
|
|
664
|
+
]
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
function HeroRole({ theme, token, label, kind }) {
|
|
668
|
+
const r = useReadout(theme, token);
|
|
669
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
670
|
+
className: "colour-hero__role",
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ jsx("span", {
|
|
673
|
+
className: "colour-hero__swatch",
|
|
674
|
+
"data-kind": kind,
|
|
675
|
+
style: { "--colour-spec": `var(--o-${token})` },
|
|
676
|
+
"aria-hidden": "true"
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ jsx("dt", { children: label }),
|
|
679
|
+
/* @__PURE__ */ jsxs("dd", { children: [
|
|
680
|
+
/* @__PURE__ */ jsxs("code", { children: ["--o-", token] }),
|
|
681
|
+
/* @__PURE__ */ jsx("span", { children: r?.name ?? r?.alias }),
|
|
682
|
+
/* @__PURE__ */ jsx("span", {
|
|
683
|
+
className: "colour-hero__hex",
|
|
684
|
+
children: hexOf(r)
|
|
685
|
+
})
|
|
686
|
+
] })
|
|
687
|
+
]
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
function TealHero() {
|
|
691
|
+
return /* @__PURE__ */ jsx("div", {
|
|
692
|
+
className: "colour-hero",
|
|
693
|
+
children: ["light", "dark"].map((theme) => /* @__PURE__ */ jsx(HeroTile, { theme }, theme))
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
function HeroTile({ theme }) {
|
|
697
|
+
const accent = useReadout(theme, "accent");
|
|
698
|
+
return /* @__PURE__ */ jsxs(ThemeScope, {
|
|
699
|
+
theme,
|
|
700
|
+
className: "colour-hero__tile",
|
|
701
|
+
children: [
|
|
702
|
+
/* @__PURE__ */ jsx("span", {
|
|
703
|
+
className: "colour-hero__theme",
|
|
704
|
+
children: theme === "light" ? "Light" : "Dark"
|
|
705
|
+
}),
|
|
706
|
+
/* @__PURE__ */ jsx(OrbitDrawing, {}),
|
|
707
|
+
/* @__PURE__ */ jsxs("div", {
|
|
708
|
+
className: "colour-hero__facts",
|
|
709
|
+
children: [
|
|
710
|
+
/* @__PURE__ */ jsx("p", {
|
|
711
|
+
className: "colour-hero__name",
|
|
712
|
+
children: theme === "light" ? "Orbit Teal" : "Orbit Mint"
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ jsx("p", {
|
|
715
|
+
className: "colour-hero__value",
|
|
716
|
+
children: hexOf(accent)
|
|
717
|
+
}),
|
|
718
|
+
/* @__PURE__ */ jsxs("dl", {
|
|
719
|
+
className: "colour-hero__roles",
|
|
720
|
+
children: [
|
|
721
|
+
/* @__PURE__ */ jsx(HeroRole, {
|
|
722
|
+
theme,
|
|
723
|
+
token: "accent",
|
|
724
|
+
label: "Fill",
|
|
725
|
+
kind: "fill"
|
|
726
|
+
}),
|
|
727
|
+
/* @__PURE__ */ jsx(HeroRole, {
|
|
728
|
+
theme,
|
|
729
|
+
token: "accent-line",
|
|
730
|
+
label: "Line",
|
|
731
|
+
kind: "line"
|
|
732
|
+
}),
|
|
733
|
+
/* @__PURE__ */ jsx(HeroRole, {
|
|
734
|
+
theme,
|
|
735
|
+
token: "comet",
|
|
736
|
+
label: "Light",
|
|
737
|
+
kind: "light"
|
|
738
|
+
})
|
|
739
|
+
]
|
|
740
|
+
})
|
|
741
|
+
]
|
|
742
|
+
})
|
|
743
|
+
]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
function Chip({ token, copied, onCopy }) {
|
|
747
|
+
const r = useReadout("light", token);
|
|
748
|
+
const ink = useReadout("light", "ink")?.color;
|
|
749
|
+
const white = useReadout("light", "grey-0")?.color;
|
|
750
|
+
const color = r?.color;
|
|
751
|
+
const label = color && ink && white ? contrastRatio(ink, color) >= contrastRatio(white, color) ? "ink" : "white" : void 0;
|
|
752
|
+
const hex = color ? toHex(color) : "";
|
|
753
|
+
const name = NAMES[token];
|
|
754
|
+
const lch = r?.value.replace(/^oklch\((.*)\)$/, "$1") ?? "";
|
|
755
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
756
|
+
type: "button",
|
|
757
|
+
className: "colour-chip",
|
|
758
|
+
"data-label": label,
|
|
759
|
+
"data-copied": copied ? "" : void 0,
|
|
760
|
+
style: { background: `var(--o-${token})` },
|
|
761
|
+
onClick: () => onCopy(token),
|
|
762
|
+
"aria-label": `${token}${name ? `, ${name}` : ""}, ${hex}. Copy var(--o-${token})`,
|
|
763
|
+
children: [
|
|
764
|
+
/* @__PURE__ */ jsx("span", {
|
|
765
|
+
className: "colour-chip__token",
|
|
766
|
+
children: token
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ jsx("span", {
|
|
769
|
+
className: "colour-chip__name",
|
|
770
|
+
children: name
|
|
771
|
+
}),
|
|
772
|
+
/* @__PURE__ */ jsx("span", {
|
|
773
|
+
className: "colour-chip__lch",
|
|
774
|
+
children: lch
|
|
775
|
+
}),
|
|
776
|
+
/* @__PURE__ */ jsx("span", {
|
|
777
|
+
className: "colour-chip__hex",
|
|
778
|
+
children: copied ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CheckIcon, {
|
|
779
|
+
weight: "bold",
|
|
780
|
+
"aria-hidden": "true"
|
|
781
|
+
}), " Copied"] }) : hex
|
|
782
|
+
})
|
|
783
|
+
]
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
function Ramp({ title, tokens, copied, onCopy }) {
|
|
787
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
788
|
+
className: "colour-ramp",
|
|
789
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
790
|
+
className: "colour-ramp__title",
|
|
791
|
+
children: title
|
|
792
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
793
|
+
className: "colour-ramp__chips",
|
|
794
|
+
children: tokens.map((t) => /* @__PURE__ */ jsx(Chip, {
|
|
795
|
+
token: t,
|
|
796
|
+
copied: copied === `var(--o-${t})`,
|
|
797
|
+
onCopy
|
|
798
|
+
}, t))
|
|
799
|
+
})]
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
function Ramps() {
|
|
803
|
+
const { copied, copy } = useCopied();
|
|
804
|
+
const onCopy = (token) => copy(`var(--o-${token})`);
|
|
805
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
|
|
806
|
+
className: "colour-ramps",
|
|
807
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
808
|
+
className: "colour-ramps__col",
|
|
809
|
+
children: [
|
|
810
|
+
/* @__PURE__ */ jsx(Ramp, {
|
|
811
|
+
title: "Teal",
|
|
812
|
+
tokens: TEAL,
|
|
813
|
+
copied,
|
|
814
|
+
onCopy
|
|
815
|
+
}),
|
|
816
|
+
/* @__PURE__ */ jsx(Ramp, {
|
|
817
|
+
title: "Mint and brand",
|
|
818
|
+
tokens: BRAND,
|
|
819
|
+
copied,
|
|
820
|
+
onCopy
|
|
821
|
+
}),
|
|
822
|
+
/* @__PURE__ */ jsx(Ramp, {
|
|
823
|
+
title: "Status",
|
|
824
|
+
tokens: STATUS,
|
|
825
|
+
copied,
|
|
826
|
+
onCopy
|
|
827
|
+
})
|
|
828
|
+
]
|
|
829
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
830
|
+
className: "colour-ramps__col",
|
|
831
|
+
children: /* @__PURE__ */ jsx(Ramp, {
|
|
832
|
+
title: "Grey",
|
|
833
|
+
tokens: GREY,
|
|
834
|
+
copied,
|
|
835
|
+
onCopy
|
|
836
|
+
})
|
|
837
|
+
})]
|
|
838
|
+
}), /* @__PURE__ */ jsx(LiveStatus, { message: copied ? `Copied ${copied}` : null })] });
|
|
839
|
+
}
|
|
840
|
+
function Specimen({ spec }) {
|
|
841
|
+
const style = {
|
|
842
|
+
"--colour-spec": `var(--o-${spec.token})`,
|
|
843
|
+
"--colour-spec-on": spec.on ? `var(--o-${spec.on})` : void 0
|
|
844
|
+
};
|
|
845
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
846
|
+
className: "colour-spec",
|
|
847
|
+
"data-kind": spec.kind,
|
|
848
|
+
"data-on": spec.on ? "" : void 0,
|
|
849
|
+
style,
|
|
850
|
+
"aria-hidden": "true",
|
|
851
|
+
children: [
|
|
852
|
+
spec.kind === "text" ? "Aa" : null,
|
|
853
|
+
spec.kind === "selection" ? /* @__PURE__ */ jsxs("span", { children: ["A", /* @__PURE__ */ jsx("span", {
|
|
854
|
+
className: "colour-spec__selected",
|
|
855
|
+
children: "a"
|
|
856
|
+
})] }) : null,
|
|
857
|
+
spec.kind === "overlay" ? /* @__PURE__ */ jsx("span", { className: "colour-spec__page" }) : null,
|
|
858
|
+
spec.kind === "comet" ? /* @__PURE__ */ jsx("span", { className: "colour-spec__comet" }) : null
|
|
859
|
+
]
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
function TokenCell({ spec, theme }) {
|
|
863
|
+
const r = useReadout(theme, spec.token);
|
|
864
|
+
return /* @__PURE__ */ jsxs(ThemeScope, {
|
|
865
|
+
theme,
|
|
866
|
+
className: "colour-cell",
|
|
867
|
+
role: "cell",
|
|
868
|
+
children: [/* @__PURE__ */ jsx(Specimen, { spec }), /* @__PURE__ */ jsxs("span", {
|
|
869
|
+
className: "colour-cell__text",
|
|
870
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
871
|
+
className: "colour-cell__primary",
|
|
872
|
+
"data-mono": r?.name ? void 0 : "",
|
|
873
|
+
children: r?.name ?? r?.alias
|
|
874
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
875
|
+
className: "colour-cell__secondary",
|
|
876
|
+
children: [r?.name ? `${r.alias} · ` : "", hexOf(r)]
|
|
877
|
+
})]
|
|
878
|
+
})]
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
function TokenTable({ title, rows }) {
|
|
882
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
883
|
+
className: "colour-table",
|
|
884
|
+
role: "table",
|
|
885
|
+
"aria-label": `${title} tokens in light and dark`,
|
|
886
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
887
|
+
className: "colour-table__head",
|
|
888
|
+
role: "row",
|
|
889
|
+
children: [
|
|
890
|
+
/* @__PURE__ */ jsx("span", {
|
|
891
|
+
role: "columnheader",
|
|
892
|
+
children: "Token"
|
|
893
|
+
}),
|
|
894
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
895
|
+
theme: "light",
|
|
896
|
+
role: "columnheader",
|
|
897
|
+
children: "Light"
|
|
898
|
+
}),
|
|
899
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
900
|
+
theme: "dark",
|
|
901
|
+
role: "columnheader",
|
|
902
|
+
children: "Dark"
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
}), rows.map((spec) => /* @__PURE__ */ jsxs("div", {
|
|
906
|
+
className: "colour-table__row",
|
|
907
|
+
role: "row",
|
|
908
|
+
children: [
|
|
909
|
+
/* @__PURE__ */ jsxs("div", {
|
|
910
|
+
className: "colour-table__info",
|
|
911
|
+
role: "rowheader",
|
|
912
|
+
children: [/* @__PURE__ */ jsxs("code", {
|
|
913
|
+
className: "colour-table__token",
|
|
914
|
+
children: ["--o-", spec.token]
|
|
915
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
916
|
+
className: "colour-table__use",
|
|
917
|
+
children: spec.use
|
|
918
|
+
})]
|
|
919
|
+
}),
|
|
920
|
+
/* @__PURE__ */ jsx(TokenCell, {
|
|
921
|
+
spec,
|
|
922
|
+
theme: "light"
|
|
923
|
+
}),
|
|
924
|
+
/* @__PURE__ */ jsx(TokenCell, {
|
|
925
|
+
spec,
|
|
926
|
+
theme: "dark"
|
|
927
|
+
})
|
|
928
|
+
]
|
|
929
|
+
}, spec.token))]
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
var TEXT_ON_PLANES = [
|
|
933
|
+
{
|
|
934
|
+
token: "fg-1",
|
|
935
|
+
label: "Words and figures"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
token: "fg-2",
|
|
939
|
+
label: "Secondary text"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
token: "fg-3",
|
|
943
|
+
label: "Meta, hints, placeholders"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
token: "fg-4",
|
|
947
|
+
label: "Marks only, never text",
|
|
948
|
+
marksOnly: true
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
token: "accent-fg",
|
|
952
|
+
label: "Teal text"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
token: "positive",
|
|
956
|
+
label: "Rising figures"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
token: "negative",
|
|
960
|
+
label: "Errors, falls"
|
|
961
|
+
}
|
|
962
|
+
];
|
|
963
|
+
var PLANES = [
|
|
964
|
+
{
|
|
965
|
+
theme: "light",
|
|
966
|
+
bg: "bg-canvas",
|
|
967
|
+
label: "Light canvas"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
theme: "light",
|
|
971
|
+
bg: "bg-ground",
|
|
972
|
+
label: "Light ground"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
theme: "dark",
|
|
976
|
+
bg: "bg-canvas",
|
|
977
|
+
label: "Dark canvas"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
theme: "dark",
|
|
981
|
+
bg: "bg-ground",
|
|
982
|
+
label: "Dark ground"
|
|
983
|
+
}
|
|
984
|
+
];
|
|
985
|
+
var TEXT_ON_FILLS = [
|
|
986
|
+
{
|
|
987
|
+
fg: "fg-on-accent",
|
|
988
|
+
bg: "accent",
|
|
989
|
+
label: "Primary pill",
|
|
990
|
+
sample: "Save changes"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
fg: "fg-inverse",
|
|
994
|
+
bg: "bg-inverse",
|
|
995
|
+
label: "Tooltip, inverse pill",
|
|
996
|
+
sample: "Copy link"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
fg: "fg-1",
|
|
1000
|
+
bg: "bg-muted",
|
|
1001
|
+
label: "Soft pill, neutral badge",
|
|
1002
|
+
sample: "Duplicate"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
fg: "accent-fg",
|
|
1006
|
+
bg: "accent-subtle-2",
|
|
1007
|
+
label: "Nav count, accent badge",
|
|
1008
|
+
sample: "12 new"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
fg: "fg-2",
|
|
1012
|
+
bg: "bg-sunken",
|
|
1013
|
+
label: "Text in a well",
|
|
1014
|
+
sample: "Read only"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
fg: "fg-3",
|
|
1018
|
+
bg: "bg-sunken",
|
|
1019
|
+
label: "Hint in a well",
|
|
1020
|
+
sample: "Optional"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
fg: "fg-1",
|
|
1024
|
+
bg: "bg-raised",
|
|
1025
|
+
label: "Menus and dialogs",
|
|
1026
|
+
sample: "Print label"
|
|
1027
|
+
}
|
|
1028
|
+
];
|
|
1029
|
+
function Grade({ ratio, marksOnly }) {
|
|
1030
|
+
const grade = gradeOf(ratio);
|
|
1031
|
+
if (marksOnly) return /* @__PURE__ */ jsx(Badge, {
|
|
1032
|
+
size: "sm",
|
|
1033
|
+
variant: "outline",
|
|
1034
|
+
children: "Marks only"
|
|
1035
|
+
});
|
|
1036
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
1037
|
+
size: "sm",
|
|
1038
|
+
tone: grade === "AAA" || grade === "AA" ? "positive" : grade === "AA large" ? "warning" : "negative",
|
|
1039
|
+
children: grade
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
/** Contrast of `fg` on `bg`; a translucent `bg` (dark theme washes) is first laid over the canvas it sits on. */
|
|
1043
|
+
function useRatio(theme, fg, bg) {
|
|
1044
|
+
const f = useReadout(theme, fg)?.color;
|
|
1045
|
+
const b = useReadout(theme, bg)?.color;
|
|
1046
|
+
const canvas = useReadout(theme, "bg-canvas")?.color;
|
|
1047
|
+
if (!f || !b || !canvas) return null;
|
|
1048
|
+
return contrastRatio(f, b.a < 1 ? composite(b, canvas) : b);
|
|
1049
|
+
}
|
|
1050
|
+
function PlaneCell({ theme, fg, bg, marksOnly }) {
|
|
1051
|
+
const ratio = useRatio(theme, fg, bg);
|
|
1052
|
+
return /* @__PURE__ */ jsxs(ThemeScope, {
|
|
1053
|
+
theme,
|
|
1054
|
+
className: "colour-contrast__cell",
|
|
1055
|
+
role: "cell",
|
|
1056
|
+
style: { background: `var(--o-${bg})` },
|
|
1057
|
+
children: [
|
|
1058
|
+
/* @__PURE__ */ jsx("span", {
|
|
1059
|
+
className: "colour-contrast__sample",
|
|
1060
|
+
style: { color: `var(--o-${fg})` },
|
|
1061
|
+
"aria-hidden": "true",
|
|
1062
|
+
children: "Aa"
|
|
1063
|
+
}),
|
|
1064
|
+
/* @__PURE__ */ jsx("span", {
|
|
1065
|
+
className: "colour-contrast__ratio",
|
|
1066
|
+
children: ratio === null ? "" : formatRatio(ratio)
|
|
1067
|
+
}),
|
|
1068
|
+
ratio === null ? null : /* @__PURE__ */ jsx(Grade, {
|
|
1069
|
+
ratio,
|
|
1070
|
+
marksOnly
|
|
1071
|
+
})
|
|
1072
|
+
]
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function ContrastOnPlanes() {
|
|
1076
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1077
|
+
className: "colour-contrast__scroll",
|
|
1078
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1079
|
+
className: "colour-contrast",
|
|
1080
|
+
role: "table",
|
|
1081
|
+
"aria-label": "Contrast of text tokens on the canvas and the ground, light and dark",
|
|
1082
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1083
|
+
className: "colour-contrast__head",
|
|
1084
|
+
role: "row",
|
|
1085
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1086
|
+
role: "columnheader",
|
|
1087
|
+
children: "Token"
|
|
1088
|
+
}), PLANES.map((p) => /* @__PURE__ */ jsx(ThemeScope, {
|
|
1089
|
+
theme: p.theme,
|
|
1090
|
+
role: "columnheader",
|
|
1091
|
+
style: { background: `var(--o-${p.bg})` },
|
|
1092
|
+
children: p.label
|
|
1093
|
+
}, p.label))]
|
|
1094
|
+
}), TEXT_ON_PLANES.map((row) => /* @__PURE__ */ jsxs("div", {
|
|
1095
|
+
className: "colour-contrast__row",
|
|
1096
|
+
role: "row",
|
|
1097
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1098
|
+
className: "colour-contrast__info",
|
|
1099
|
+
role: "rowheader",
|
|
1100
|
+
children: [/* @__PURE__ */ jsxs("code", { children: ["--o-", row.token] }), /* @__PURE__ */ jsx("span", { children: row.label })]
|
|
1101
|
+
}), PLANES.map((p) => /* @__PURE__ */ jsx(PlaneCell, {
|
|
1102
|
+
theme: p.theme,
|
|
1103
|
+
fg: row.token,
|
|
1104
|
+
bg: p.bg,
|
|
1105
|
+
marksOnly: row.marksOnly
|
|
1106
|
+
}, p.label))]
|
|
1107
|
+
}, row.token))]
|
|
1108
|
+
})
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
function FillCell({ theme, fg, bg, sample }) {
|
|
1112
|
+
const ratio = useRatio(theme, fg, bg);
|
|
1113
|
+
return /* @__PURE__ */ jsxs(ThemeScope, {
|
|
1114
|
+
theme,
|
|
1115
|
+
className: "colour-contrast__cell",
|
|
1116
|
+
role: "cell",
|
|
1117
|
+
children: [
|
|
1118
|
+
/* @__PURE__ */ jsx("span", {
|
|
1119
|
+
className: "colour-contrast__pill",
|
|
1120
|
+
style: {
|
|
1121
|
+
color: `var(--o-${fg})`,
|
|
1122
|
+
background: `var(--o-${bg})`
|
|
1123
|
+
},
|
|
1124
|
+
children: sample
|
|
1125
|
+
}),
|
|
1126
|
+
/* @__PURE__ */ jsx("span", {
|
|
1127
|
+
className: "colour-contrast__ratio",
|
|
1128
|
+
children: ratio === null ? "" : formatRatio(ratio)
|
|
1129
|
+
}),
|
|
1130
|
+
ratio === null ? null : /* @__PURE__ */ jsx(Grade, { ratio })
|
|
1131
|
+
]
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
function ContrastOnFills() {
|
|
1135
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1136
|
+
className: "colour-contrast__scroll",
|
|
1137
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1138
|
+
className: "colour-contrast",
|
|
1139
|
+
"data-columns": "2",
|
|
1140
|
+
role: "table",
|
|
1141
|
+
"aria-label": "Contrast of text on the fills it sits on, light and dark",
|
|
1142
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1143
|
+
className: "colour-contrast__head",
|
|
1144
|
+
role: "row",
|
|
1145
|
+
children: [
|
|
1146
|
+
/* @__PURE__ */ jsx("span", {
|
|
1147
|
+
role: "columnheader",
|
|
1148
|
+
children: "Pair"
|
|
1149
|
+
}),
|
|
1150
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
1151
|
+
theme: "light",
|
|
1152
|
+
role: "columnheader",
|
|
1153
|
+
children: "Light"
|
|
1154
|
+
}),
|
|
1155
|
+
/* @__PURE__ */ jsx(ThemeScope, {
|
|
1156
|
+
theme: "dark",
|
|
1157
|
+
role: "columnheader",
|
|
1158
|
+
children: "Dark"
|
|
1159
|
+
})
|
|
1160
|
+
]
|
|
1161
|
+
}), TEXT_ON_FILLS.map((row) => /* @__PURE__ */ jsxs("div", {
|
|
1162
|
+
className: "colour-contrast__row",
|
|
1163
|
+
role: "row",
|
|
1164
|
+
children: [
|
|
1165
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1166
|
+
className: "colour-contrast__info",
|
|
1167
|
+
role: "rowheader",
|
|
1168
|
+
children: [/* @__PURE__ */ jsxs("code", { children: [
|
|
1169
|
+
"--o-",
|
|
1170
|
+
row.fg,
|
|
1171
|
+
" on --o-",
|
|
1172
|
+
row.bg
|
|
1173
|
+
] }), /* @__PURE__ */ jsx("span", { children: row.label })]
|
|
1174
|
+
}),
|
|
1175
|
+
/* @__PURE__ */ jsx(FillCell, {
|
|
1176
|
+
theme: "light",
|
|
1177
|
+
fg: row.fg,
|
|
1178
|
+
bg: row.bg,
|
|
1179
|
+
sample: row.sample
|
|
1180
|
+
}),
|
|
1181
|
+
/* @__PURE__ */ jsx(FillCell, {
|
|
1182
|
+
theme: "dark",
|
|
1183
|
+
fg: row.fg,
|
|
1184
|
+
bg: row.bg,
|
|
1185
|
+
sample: row.sample
|
|
1186
|
+
})
|
|
1187
|
+
]
|
|
1188
|
+
}, `${row.fg}-${row.bg}`))]
|
|
1189
|
+
})
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
var WEEK = [
|
|
1193
|
+
820,
|
|
1194
|
+
940,
|
|
1195
|
+
760,
|
|
1196
|
+
1010,
|
|
1197
|
+
1180,
|
|
1198
|
+
990,
|
|
1199
|
+
1284
|
|
1200
|
+
];
|
|
1201
|
+
function Takings({ tone }) {
|
|
1202
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1203
|
+
className: "colour-figure",
|
|
1204
|
+
"data-tone": tone,
|
|
1205
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1206
|
+
className: "colour-figure__label",
|
|
1207
|
+
children: "Takings today"
|
|
1208
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1209
|
+
className: "colour-figure__value o-num",
|
|
1210
|
+
children: "£1,284.50"
|
|
1211
|
+
})]
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
function TealUse({ label, children }) {
|
|
1215
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
1216
|
+
className: "colour-use",
|
|
1217
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1218
|
+
className: "colour-use__stage",
|
|
1219
|
+
children
|
|
1220
|
+
}), /* @__PURE__ */ jsx("figcaption", { children: label })]
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
function Page() {
|
|
1224
|
+
return /* @__PURE__ */ jsx(DocPage, {
|
|
1225
|
+
title: "Colour",
|
|
1226
|
+
lead: "A faintly teal-tinted neutral world with warm ink for words. Orbit teal is a line of light: it draws rings, focus, live marks, selection and the one primary pill, and never fills a panel.",
|
|
1227
|
+
children: /* @__PURE__ */ jsxs(Readings, { children: [
|
|
1228
|
+
/* @__PURE__ */ jsx(Section, {
|
|
1229
|
+
id: "orbit-teal",
|
|
1230
|
+
title: "Orbit teal",
|
|
1231
|
+
description: /* @__PURE__ */ jsx("p", { children: "The logo colour, #336A65, is the accent in light. In dark it becomes Orbit Mint: the same teal, lit. Each theme uses it three ways: as a fill for small marks, as a line for rings and arcs, and as light for the comet." }),
|
|
1232
|
+
children: /* @__PURE__ */ jsx(TealHero, {})
|
|
1233
|
+
}),
|
|
1234
|
+
/* @__PURE__ */ jsx(Section, {
|
|
1235
|
+
id: "primitives",
|
|
1236
|
+
title: "Primitive ramps",
|
|
1237
|
+
description: /* @__PURE__ */ jsx("p", { children: "The raw ramps. Components never read these directly; they read the semantic tokens below, which the themes remap. Every grey carries a trace of the teal. Select a colour to copy its variable." }),
|
|
1238
|
+
children: /* @__PURE__ */ jsx(Ramps, {})
|
|
1239
|
+
}),
|
|
1240
|
+
/* @__PURE__ */ jsx(Section, {
|
|
1241
|
+
id: "semantic",
|
|
1242
|
+
title: "Semantic tokens",
|
|
1243
|
+
description: /* @__PURE__ */ jsx("p", { children: "What components read. Light and dark remap every one of them, so a component never asks which theme it is in. Values below are read from the live stylesheet." }),
|
|
1244
|
+
children: SEMANTIC.map((group) => /* @__PURE__ */ jsx(SubSection, {
|
|
1245
|
+
title: group.title,
|
|
1246
|
+
description: /* @__PURE__ */ jsx("p", { children: group.description }),
|
|
1247
|
+
children: /* @__PURE__ */ jsx(TokenTable, {
|
|
1248
|
+
title: group.title,
|
|
1249
|
+
rows: group.rows
|
|
1250
|
+
})
|
|
1251
|
+
}, group.id))
|
|
1252
|
+
}),
|
|
1253
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
1254
|
+
id: "contrast",
|
|
1255
|
+
title: "Contrast",
|
|
1256
|
+
description: /* @__PURE__ */ jsx("p", { children: "Measured live from the tokens on this page, against WCAG 2.2: 4.5:1 for text, 3:1 for large text. Every text token clears 4.5:1 on the canvas and on the ground, in both themes. Mist is only for marks that are not text, such as ticks and separators, so it is never used for words." }),
|
|
1257
|
+
children: [
|
|
1258
|
+
/* @__PURE__ */ jsx(ContrastOnPlanes, {}),
|
|
1259
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
1260
|
+
title: "Text on fills",
|
|
1261
|
+
description: /* @__PURE__ */ jsx("p", { children: "The pairs that put words on a coloured fill." }),
|
|
1262
|
+
children: /* @__PURE__ */ jsx(ContrastOnFills, {})
|
|
1263
|
+
}),
|
|
1264
|
+
/* @__PURE__ */ jsx(Note, {
|
|
1265
|
+
title: "Status text on a wash",
|
|
1266
|
+
children: "Badges and deltas do not use the raw status hue for their words: the text is the hue deepened with ink, so it reads as ink with a colour and holds its contrast on the wash."
|
|
1267
|
+
})
|
|
1268
|
+
]
|
|
1269
|
+
}),
|
|
1270
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
1271
|
+
id: "where-teal-goes",
|
|
1272
|
+
title: "Where teal may appear",
|
|
1273
|
+
description: /* @__PURE__ */ jsx("p", { children: "The Line-of-Light Rule: Orbit teal is drawn, never poured. Anything it fills is small: a dot, a count, a switch track, a pale wash under a badge. These are all the places it goes." }),
|
|
1274
|
+
children: [
|
|
1275
|
+
/* @__PURE__ */ jsx(Example, {
|
|
1276
|
+
align: "fill",
|
|
1277
|
+
code: `
|
|
1278
|
+
<Sparkline data={week} tone="accent" label="Takings this week, rising" />
|
|
1279
|
+
<Badge variant="outline" tone="accent">New</Badge>
|
|
1280
|
+
<Badge tone="accent" pulse>Live</Badge>
|
|
1281
|
+
<Switch defaultChecked label="Show prices with VAT" />
|
|
1282
|
+
<Badge tone="accent">12</Badge>
|
|
1283
|
+
<Button variant="primary">Fulfil orders</Button>`,
|
|
1284
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1285
|
+
className: "colour-uses",
|
|
1286
|
+
children: [
|
|
1287
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1288
|
+
label: "A line",
|
|
1289
|
+
children: /* @__PURE__ */ jsx(Sparkline, {
|
|
1290
|
+
data: WEEK,
|
|
1291
|
+
width: 120,
|
|
1292
|
+
height: 32,
|
|
1293
|
+
tone: "accent",
|
|
1294
|
+
label: "Takings this week, rising"
|
|
1295
|
+
})
|
|
1296
|
+
}),
|
|
1297
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1298
|
+
label: "A ring",
|
|
1299
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
1300
|
+
variant: "outline",
|
|
1301
|
+
tone: "accent",
|
|
1302
|
+
children: "New"
|
|
1303
|
+
})
|
|
1304
|
+
}),
|
|
1305
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1306
|
+
label: "Focus",
|
|
1307
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1308
|
+
size: "sm",
|
|
1309
|
+
style: {
|
|
1310
|
+
outline: "2px solid var(--o-focus)",
|
|
1311
|
+
outlineOffset: 2
|
|
1312
|
+
},
|
|
1313
|
+
tabIndex: -1,
|
|
1314
|
+
children: "Export"
|
|
1315
|
+
})
|
|
1316
|
+
}),
|
|
1317
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1318
|
+
label: "A live mark",
|
|
1319
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
1320
|
+
tone: "accent",
|
|
1321
|
+
pulse: true,
|
|
1322
|
+
children: "Live"
|
|
1323
|
+
})
|
|
1324
|
+
}),
|
|
1325
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1326
|
+
label: "What is selected",
|
|
1327
|
+
children: /* @__PURE__ */ jsx(Switch, {
|
|
1328
|
+
defaultChecked: true,
|
|
1329
|
+
label: "Show prices with VAT"
|
|
1330
|
+
})
|
|
1331
|
+
}),
|
|
1332
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1333
|
+
label: "A count",
|
|
1334
|
+
children: /* @__PURE__ */ jsx(Badge, {
|
|
1335
|
+
tone: "accent",
|
|
1336
|
+
children: "12"
|
|
1337
|
+
})
|
|
1338
|
+
}),
|
|
1339
|
+
/* @__PURE__ */ jsx(TealUse, {
|
|
1340
|
+
label: "The one primary pill",
|
|
1341
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1342
|
+
variant: "primary",
|
|
1343
|
+
size: "sm",
|
|
1344
|
+
children: "Fulfil orders"
|
|
1345
|
+
})
|
|
1346
|
+
})
|
|
1347
|
+
]
|
|
1348
|
+
})
|
|
1349
|
+
}),
|
|
1350
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
1351
|
+
do: {
|
|
1352
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1353
|
+
className: "colour-dodont-figure",
|
|
1354
|
+
children: [/* @__PURE__ */ jsx(Takings, {}), /* @__PURE__ */ jsx(Sparkline, {
|
|
1355
|
+
data: WEEK,
|
|
1356
|
+
width: 150,
|
|
1357
|
+
height: 34,
|
|
1358
|
+
tone: "accent",
|
|
1359
|
+
fill: true
|
|
1360
|
+
})]
|
|
1361
|
+
}),
|
|
1362
|
+
caption: "Teal draws the trend. The words and the figure stay ink."
|
|
1363
|
+
},
|
|
1364
|
+
dont: {
|
|
1365
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1366
|
+
className: "colour-dont-panel",
|
|
1367
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Takings today" }), /* @__PURE__ */ jsx("strong", {
|
|
1368
|
+
className: "o-num",
|
|
1369
|
+
children: "£1,284.50"
|
|
1370
|
+
})]
|
|
1371
|
+
}),
|
|
1372
|
+
caption: "A teal panel. Teal is never a surface, a heading or running text."
|
|
1373
|
+
}
|
|
1374
|
+
}),
|
|
1375
|
+
/* @__PURE__ */ jsx(DoDont, {
|
|
1376
|
+
do: {
|
|
1377
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1378
|
+
className: "colour-dodont-figure",
|
|
1379
|
+
children: [/* @__PURE__ */ jsx(Takings, {}), /* @__PURE__ */ jsx(Delta, {
|
|
1380
|
+
value: 12.4,
|
|
1381
|
+
label: "vs this time yesterday"
|
|
1382
|
+
})]
|
|
1383
|
+
}),
|
|
1384
|
+
caption: "The Ink Words Rule: the change tints its own pill, and the figure stays ink."
|
|
1385
|
+
},
|
|
1386
|
+
dont: {
|
|
1387
|
+
children: /* @__PURE__ */ jsx(Takings, { tone: "wrong" }),
|
|
1388
|
+
caption: "A green figure. Colour belongs to marks, and a coloured number is hard to read at a glance."
|
|
1389
|
+
}
|
|
1390
|
+
}),
|
|
1391
|
+
/* @__PURE__ */ jsx(Guidelines, { items: [
|
|
1392
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The Line-of-Light Rule." }), " Teal appears in lines, rings, focus, live marks, selection and the one primary pill. No teal panels, headings or running text."] }),
|
|
1393
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The Ink Words Rule." }), " Words and figures stay ink and its slate steps. A strained job turns its tile amber while its words stay ink."] }),
|
|
1394
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("strong", { children: "The Teal-in-the-Grey Rule." }), " Every grey between white and ink carries a trace of teal (hue 172 to 190, chroma 0.012 or less). Canvas White stays pure and Brand Ink stays warm."] }),
|
|
1395
|
+
"Status hues are for status only: paid, falling, strained, for your information. Never a category or a decoration.",
|
|
1396
|
+
"Read semantic tokens, never primitives or hex. Tints come from color-mix, never a new colour."
|
|
1397
|
+
] })
|
|
1398
|
+
]
|
|
1399
|
+
}),
|
|
1400
|
+
/* @__PURE__ */ jsxs(Section, {
|
|
1401
|
+
id: "dark",
|
|
1402
|
+
title: "Dark theme",
|
|
1403
|
+
description: /* @__PURE__ */ jsx("p", { children: "Night is its own palette, not an inversion. The same components on both, with nothing branching on the theme." }),
|
|
1404
|
+
children: [/* @__PURE__ */ jsxs(ThemePair, { children: [
|
|
1405
|
+
/* @__PURE__ */ jsx(Button, {
|
|
1406
|
+
variant: "primary",
|
|
1407
|
+
children: "Fulfil orders"
|
|
1408
|
+
}),
|
|
1409
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
1410
|
+
tone: "positive",
|
|
1411
|
+
dot: true,
|
|
1412
|
+
children: "Paid"
|
|
1413
|
+
}),
|
|
1414
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
1415
|
+
tone: "warning",
|
|
1416
|
+
dot: true,
|
|
1417
|
+
children: "Unfulfilled"
|
|
1418
|
+
}),
|
|
1419
|
+
/* @__PURE__ */ jsx(Delta, { value: 12.4 }),
|
|
1420
|
+
/* @__PURE__ */ jsx(Switch, {
|
|
1421
|
+
defaultChecked: true,
|
|
1422
|
+
"aria-label": "Show prices with VAT"
|
|
1423
|
+
})
|
|
1424
|
+
] }), /* @__PURE__ */ jsx(DocTable, {
|
|
1425
|
+
columns: [
|
|
1426
|
+
"Role",
|
|
1427
|
+
"Light",
|
|
1428
|
+
"Dark"
|
|
1429
|
+
],
|
|
1430
|
+
rows: [
|
|
1431
|
+
[
|
|
1432
|
+
"Accent",
|
|
1433
|
+
"Orbit Teal, white label",
|
|
1434
|
+
"Orbit Mint, Night On-Mint label"
|
|
1435
|
+
],
|
|
1436
|
+
[
|
|
1437
|
+
"Lines and rings",
|
|
1438
|
+
"Orbit Line (teal-500)",
|
|
1439
|
+
"Night Line (teal-400)"
|
|
1440
|
+
],
|
|
1441
|
+
[
|
|
1442
|
+
"The comet",
|
|
1443
|
+
"Comet Light",
|
|
1444
|
+
"Pure white"
|
|
1445
|
+
],
|
|
1446
|
+
[
|
|
1447
|
+
"Words",
|
|
1448
|
+
"Brand Ink, then Slate Ink and Quiet Slate",
|
|
1449
|
+
"Night Ink, with slate steps at 76, 64 and 48% lightness"
|
|
1450
|
+
],
|
|
1451
|
+
[
|
|
1452
|
+
"Ground and canvas",
|
|
1453
|
+
"Porcelain under Canvas White",
|
|
1454
|
+
"Night Ground under Night Canvas, Graphite raised"
|
|
1455
|
+
],
|
|
1456
|
+
[
|
|
1457
|
+
"Status",
|
|
1458
|
+
"Hues near 52 to 62% lightness on pale washes",
|
|
1459
|
+
"Hues lifted to 72 to 80% on 14% washes"
|
|
1460
|
+
],
|
|
1461
|
+
[
|
|
1462
|
+
"Shadows",
|
|
1463
|
+
"Teal-tinted near-black",
|
|
1464
|
+
"Black, with a faint white ring so they read on a dark ground"
|
|
1465
|
+
]
|
|
1466
|
+
]
|
|
1467
|
+
})]
|
|
1468
|
+
}),
|
|
1469
|
+
/* @__PURE__ */ jsx(Section, {
|
|
1470
|
+
id: "in-code",
|
|
1471
|
+
title: "In code",
|
|
1472
|
+
description: /* @__PURE__ */ jsx("p", { children: "Read the semantic tokens, and make tints with color-mix so they follow the theme." }),
|
|
1473
|
+
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
1474
|
+
lang: "css",
|
|
1475
|
+
code: `
|
|
1476
|
+
.order-note {
|
|
1477
|
+
background: var(--o-bg-sunken);
|
|
1478
|
+
color: var(--o-fg-2);
|
|
1479
|
+
box-shadow: inset 0 0 0 1px var(--o-border-1);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/* A tint of a token, never a new hex. It follows light and dark for free. */
|
|
1483
|
+
.order-note[data-strained] {
|
|
1484
|
+
background: color-mix(in oklch, var(--o-warning) 12%, transparent);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/* Teal as a line of light: a rule under the heading, not a teal heading. */
|
|
1488
|
+
.order-note__title {
|
|
1489
|
+
color: var(--o-fg-1);
|
|
1490
|
+
border-bottom: 1.5px solid var(--o-accent-line);
|
|
1491
|
+
}`
|
|
1492
|
+
})
|
|
1493
|
+
})
|
|
1494
|
+
] })
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
//#endregion
|
|
1498
|
+
export { Page };
|