@stealthscale/plugin-theming 0.0.0-stage → 0.2.1
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 +21 -0
- package/README.md +135 -2
- package/dist/accessibility-Dg5Dh35o.js +409 -0
- package/dist/attributes-vx1W0PiK.js +26 -0
- package/dist/breakpoints-CJjhy79u.js +83 -0
- package/dist/code-DcoH6hCX.js +69 -0
- package/dist/conditions-CjjQwqro.js +338 -0
- package/dist/corners-CH5jyCks.js +92 -0
- package/dist/cursors-hl00ix41.js +54 -0
- package/dist/cyclonedx/bom.json +1 -0
- package/dist/density-DEW_j0I5.js +207 -0
- package/dist/depth-DCn3mAAJ.js +143 -0
- package/dist/doc-page-BQXdbP_h.js +439 -0
- package/dist/extending-CY7ry7Y4.js +31 -0
- package/dist/faces-D76c_Ryh.js +65 -0
- package/dist/gate-CoX2Yr9x.js +199 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +39 -0
- package/dist/layers-BxdWdfPg.js +53 -0
- package/dist/looks-BrROho5Y.js +107 -0
- package/dist/measure-uwF7Fmpy.js +137 -0
- package/dist/mode-colors-Cf_ZPo3g.js +260 -0
- package/dist/mode-panels-Bmh0ec0U.js +54 -0
- package/dist/motion-DRbsuZZo.js +202 -0
- package/dist/overview-BbE82N2c.js +192 -0
- package/dist/palettes-CZo2HrNT.js +49 -0
- package/dist/parts-BVmqVMgo.js +25 -0
- package/dist/recipes-C88xVIGB.js +32 -0
- package/dist/rows-Dv8c7jye.js +18 -0
- package/dist/sampler-Ue67PX2n.js +27 -0
- package/dist/series-AvSZjk2b.js +63 -0
- package/dist/setting-BsgJKTlh.js +12 -0
- package/dist/sizes-B7LgvyBS.js +98 -0
- package/dist/spacing-DMyyV6vX.js +75 -0
- package/dist/surfaces-Db0HjMwB.js +76 -0
- package/dist/text-styles-BZnXaigP.js +233 -0
- package/dist/theme.d.ts +12 -0
- package/dist/theme.js +23 -0
- package/dist/themes-yClyRA9e.js +305 -0
- package/dist/theming-text.recipe-Dvcza4j1.js +308 -0
- package/dist/token-table-yrZh5kLy.js +182 -0
- package/dist/tokens-7Pm-eLiZ.js +138 -0
- package/dist/use-readings-D56mNtEc.js +77 -0
- package/dist/variables-ymFs3Bzn.js +43 -0
- package/dist/worn-D4HEJsJ2.js +15 -0
- package/dist/writing-b05oSPB2.js +31 -0
- package/package.json +124 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { s as keyOf } from "./theming-text.recipe-Dvcza4j1.js";
|
|
2
|
+
import { n as variableOf } from "./variables-ymFs3Bzn.js";
|
|
3
|
+
import { n as useWords, t as DocPage } from "./doc-page-BQXdbP_h.js";
|
|
4
|
+
import { t as tokenRows } from "./rows-Dv8c7jye.js";
|
|
5
|
+
import { t as TokenTable } from "./token-table-yrZh5kLy.js";
|
|
6
|
+
import { n as ThemingMotion } from "./parts-BVmqVMgo.js";
|
|
7
|
+
import { ANIMATIONS, ANIMATION_STYLES, DURATIONS, EASINGS, PACES } from "@stealthscale/theme/contract";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { Grid, Stack } from "@stealthscale/component-layout";
|
|
11
|
+
import { Code } from "@stealthscale/component-typography";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Button } from "@stealthscale/component-actions";
|
|
14
|
+
//#region src/blocks/motion-grid.tsx
|
|
15
|
+
/**
|
|
16
|
+
* Renders a grid of motions, each played on a tile beside its name, and a control that plays them
|
|
17
|
+
* all again.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Renders a tile per motion and the replay control.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* A motion that runs once runs when its tile mounts, so the replay control mounts every tile
|
|
24
|
+
* again. A loop keeps running, and a motion the scroll drives moves as the page scrolls. Every
|
|
25
|
+
* motion stops for a reader who asked for less motion.
|
|
26
|
+
*/
|
|
27
|
+
function MotionGrid(t0) {
|
|
28
|
+
const $ = c(15);
|
|
29
|
+
const { names } = t0;
|
|
30
|
+
const { t } = useWords();
|
|
31
|
+
const [played, setPlayed] = useState(0);
|
|
32
|
+
let t1;
|
|
33
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t1 = () => {
|
|
35
|
+
setPlayed(_temp);
|
|
36
|
+
};
|
|
37
|
+
$[0] = t1;
|
|
38
|
+
} else t1 = $[0];
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[1] !== t) {
|
|
41
|
+
t2 = t("blocks.replay");
|
|
42
|
+
$[1] = t;
|
|
43
|
+
$[2] = t2;
|
|
44
|
+
} else t2 = $[2];
|
|
45
|
+
let t3;
|
|
46
|
+
if ($[3] !== t2) {
|
|
47
|
+
t3 = /* @__PURE__ */ jsx(Button, {
|
|
48
|
+
onClick: t1,
|
|
49
|
+
size: "sm",
|
|
50
|
+
variant: "outline",
|
|
51
|
+
children: t2
|
|
52
|
+
});
|
|
53
|
+
$[3] = t2;
|
|
54
|
+
$[4] = t3;
|
|
55
|
+
} else t3 = $[4];
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[5] !== names || $[6] !== played) {
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[8] !== played) {
|
|
60
|
+
t5 = (name) => /* @__PURE__ */ jsxs(Stack, {
|
|
61
|
+
direction: "row",
|
|
62
|
+
gap: "md",
|
|
63
|
+
children: [/* @__PURE__ */ jsx(ThemingMotion, { motion: keyOf(name) }), /* @__PURE__ */ jsx(Code, { children: name })]
|
|
64
|
+
}, `${name}-${String(played)}`);
|
|
65
|
+
$[8] = played;
|
|
66
|
+
$[9] = t5;
|
|
67
|
+
} else t5 = $[9];
|
|
68
|
+
t4 = names.map(t5);
|
|
69
|
+
$[5] = names;
|
|
70
|
+
$[6] = played;
|
|
71
|
+
$[7] = t4;
|
|
72
|
+
} else t4 = $[7];
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[10] !== t4) {
|
|
75
|
+
t5 = /* @__PURE__ */ jsx(Grid.Root, {
|
|
76
|
+
columns: "fill-xs",
|
|
77
|
+
gap: "md",
|
|
78
|
+
children: t4
|
|
79
|
+
});
|
|
80
|
+
$[10] = t4;
|
|
81
|
+
$[11] = t5;
|
|
82
|
+
} else t5 = $[11];
|
|
83
|
+
let t6;
|
|
84
|
+
if ($[12] !== t3 || $[13] !== t5) {
|
|
85
|
+
t6 = /* @__PURE__ */ jsxs(Stack, {
|
|
86
|
+
align: "flex-start",
|
|
87
|
+
gap: "lg",
|
|
88
|
+
children: [t3, t5]
|
|
89
|
+
});
|
|
90
|
+
$[12] = t3;
|
|
91
|
+
$[13] = t5;
|
|
92
|
+
$[14] = t6;
|
|
93
|
+
} else t6 = $[14];
|
|
94
|
+
return t6;
|
|
95
|
+
}
|
|
96
|
+
function _temp(count) {
|
|
97
|
+
return count + 1;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/pages/motion.tsx
|
|
101
|
+
/**
|
|
102
|
+
* Lists each pace's duration and curve, job by job.
|
|
103
|
+
*/
|
|
104
|
+
const JOBS = PACES.flatMap((pace) => ["durations", "easings"].map((category) => ({
|
|
105
|
+
name: `${category}.${pace}`,
|
|
106
|
+
variable: variableOf(category, pace)
|
|
107
|
+
})));
|
|
108
|
+
/**
|
|
109
|
+
* Lists the page's tables of tokens by their sections, in reading order.
|
|
110
|
+
*/
|
|
111
|
+
const TABLES = [
|
|
112
|
+
{
|
|
113
|
+
id: "durations",
|
|
114
|
+
rows: tokenRows("durations", DURATIONS)
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "easings",
|
|
118
|
+
rows: tokenRows("easings", EASINGS)
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "animations",
|
|
122
|
+
rows: tokenRows("animations", ANIMATIONS)
|
|
123
|
+
}
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* Renders the motion page.
|
|
127
|
+
*/
|
|
128
|
+
function MotionPage() {
|
|
129
|
+
const $ = c(12);
|
|
130
|
+
const { t } = useWords();
|
|
131
|
+
let t0;
|
|
132
|
+
if ($[0] !== t) {
|
|
133
|
+
t0 = t("motion.sections.paces.title");
|
|
134
|
+
$[0] = t;
|
|
135
|
+
$[1] = t0;
|
|
136
|
+
} else t0 = $[1];
|
|
137
|
+
let t1;
|
|
138
|
+
if ($[2] !== t0) {
|
|
139
|
+
t1 = {
|
|
140
|
+
block: /* @__PURE__ */ jsx(TokenTable, {
|
|
141
|
+
caption: t0,
|
|
142
|
+
rows: JOBS
|
|
143
|
+
}),
|
|
144
|
+
id: "paces"
|
|
145
|
+
};
|
|
146
|
+
$[2] = t0;
|
|
147
|
+
$[3] = t1;
|
|
148
|
+
} else t1 = $[3];
|
|
149
|
+
let t2;
|
|
150
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
151
|
+
t2 = { id: "statement" };
|
|
152
|
+
$[4] = t2;
|
|
153
|
+
} else t2 = $[4];
|
|
154
|
+
let t3;
|
|
155
|
+
if ($[5] !== t || $[6] !== t1) {
|
|
156
|
+
let t4;
|
|
157
|
+
if ($[8] !== t) {
|
|
158
|
+
t4 = (t5) => {
|
|
159
|
+
const { id, rows } = t5;
|
|
160
|
+
return {
|
|
161
|
+
block: /* @__PURE__ */ jsx(TokenTable, {
|
|
162
|
+
caption: t(`motion.sections.${id}.title`, { defaultValue: id }),
|
|
163
|
+
rows
|
|
164
|
+
}),
|
|
165
|
+
id
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
$[8] = t;
|
|
169
|
+
$[9] = t4;
|
|
170
|
+
} else t4 = $[9];
|
|
171
|
+
let t5;
|
|
172
|
+
let t6;
|
|
173
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
174
|
+
t5 = {
|
|
175
|
+
block: /* @__PURE__ */ jsx(MotionGrid, { names: ANIMATION_STYLES }),
|
|
176
|
+
id: "styles"
|
|
177
|
+
};
|
|
178
|
+
t6 = { id: "reduced" };
|
|
179
|
+
$[10] = t5;
|
|
180
|
+
$[11] = t6;
|
|
181
|
+
} else {
|
|
182
|
+
t5 = $[10];
|
|
183
|
+
t6 = $[11];
|
|
184
|
+
}
|
|
185
|
+
t3 = /* @__PURE__ */ jsx(DocPage, {
|
|
186
|
+
page: "motion",
|
|
187
|
+
sections: [
|
|
188
|
+
t1,
|
|
189
|
+
t2,
|
|
190
|
+
...TABLES.map(t4),
|
|
191
|
+
t5,
|
|
192
|
+
t6
|
|
193
|
+
]
|
|
194
|
+
});
|
|
195
|
+
$[5] = t;
|
|
196
|
+
$[6] = t1;
|
|
197
|
+
$[7] = t3;
|
|
198
|
+
} else t3 = $[7];
|
|
199
|
+
return t3;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
export { MotionPage };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { n as useWords, t as DocPage } from "./doc-page-BQXdbP_h.js";
|
|
2
|
+
import { themingContract } from "@stealthscale/plugin-theming-contract";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Grid } from "@stealthscale/component-layout";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Link } from "@stealthscale/component-navigation";
|
|
7
|
+
import { Card } from "@stealthscale/component-surfaces";
|
|
8
|
+
import { createLink, useRouteHref } from "@stealthscale/provider-router";
|
|
9
|
+
//#region src/blocks/page-card.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Renders the navigation package's link as the router's link, so a title navigates without a
|
|
12
|
+
* reload.
|
|
13
|
+
*/
|
|
14
|
+
const Opening = createLink(Link);
|
|
15
|
+
/**
|
|
16
|
+
* Renders the page's card in the outline look, its title linking to the page.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* The title is the link, so a screen reader lists the page by its name, and the interactive card
|
|
20
|
+
* stretches the link over the whole card.
|
|
21
|
+
*/
|
|
22
|
+
function PageCard(t0) {
|
|
23
|
+
const $ = c(15);
|
|
24
|
+
const { route, slug } = t0;
|
|
25
|
+
const { t } = useWords();
|
|
26
|
+
const href = useRouteHref(route);
|
|
27
|
+
const t1 = `${slug}.title`;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[0] !== slug || $[1] !== t || $[2] !== t1) {
|
|
30
|
+
t2 = t(t1, { defaultValue: slug });
|
|
31
|
+
$[0] = slug;
|
|
32
|
+
$[1] = t;
|
|
33
|
+
$[2] = t1;
|
|
34
|
+
$[3] = t2;
|
|
35
|
+
} else t2 = $[3];
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[4] !== href || $[5] !== t2) {
|
|
38
|
+
t3 = /* @__PURE__ */ jsx(Card.Title, {
|
|
39
|
+
as: "h3",
|
|
40
|
+
children: /* @__PURE__ */ jsx(Opening, {
|
|
41
|
+
inherit: true,
|
|
42
|
+
to: href,
|
|
43
|
+
variant: "plain",
|
|
44
|
+
children: t2
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
$[4] = href;
|
|
48
|
+
$[5] = t2;
|
|
49
|
+
$[6] = t3;
|
|
50
|
+
} else t3 = $[6];
|
|
51
|
+
const t4 = `${slug}.about`;
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[7] !== t || $[8] !== t4) {
|
|
54
|
+
t5 = t(t4, { defaultValue: "" });
|
|
55
|
+
$[7] = t;
|
|
56
|
+
$[8] = t4;
|
|
57
|
+
$[9] = t5;
|
|
58
|
+
} else t5 = $[9];
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[10] !== t5) {
|
|
61
|
+
t6 = /* @__PURE__ */ jsx(Card.Description, { children: t5 });
|
|
62
|
+
$[10] = t5;
|
|
63
|
+
$[11] = t6;
|
|
64
|
+
} else t6 = $[11];
|
|
65
|
+
let t7;
|
|
66
|
+
if ($[12] !== t3 || $[13] !== t6) {
|
|
67
|
+
t7 = /* @__PURE__ */ jsx(Card.Root, {
|
|
68
|
+
interactive: true,
|
|
69
|
+
variant: "outline",
|
|
70
|
+
children: /* @__PURE__ */ jsxs(Card.Header, { children: [t3, t6] })
|
|
71
|
+
});
|
|
72
|
+
$[12] = t3;
|
|
73
|
+
$[13] = t6;
|
|
74
|
+
$[14] = t7;
|
|
75
|
+
} else t7 = $[14];
|
|
76
|
+
return t7;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/menus.ts
|
|
80
|
+
/**
|
|
81
|
+
* The prefix of every page's path, which leaves the page's slug.
|
|
82
|
+
*/
|
|
83
|
+
const PREFIX = "theming/";
|
|
84
|
+
/**
|
|
85
|
+
* Returns a menu's rank, which puts a menu without one after every ranked menu.
|
|
86
|
+
*/
|
|
87
|
+
function rankOf(menu) {
|
|
88
|
+
return menu.order ?? Number.MAX_SAFE_INTEGER;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the menus by their rank, an unranked menu last.
|
|
92
|
+
*
|
|
93
|
+
* @param menus - The contract's menus, by name.
|
|
94
|
+
*/
|
|
95
|
+
function menusByRank(menus) {
|
|
96
|
+
return Object.values(menus).toSorted((one, other) => rankOf(one) - rankOf(other));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns the name a menu's qualified id ends with: `color` for `theming/color`.
|
|
100
|
+
*
|
|
101
|
+
* @param menu - A menu of the contract, whose id starts with the plugin's id.
|
|
102
|
+
*/
|
|
103
|
+
function nameOf(menu) {
|
|
104
|
+
return menu.id.slice(menu.id.indexOf("/") + 1);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Returns the pages a menu lists, by their rank, each with its slug.
|
|
108
|
+
*
|
|
109
|
+
* @param routes - The contract's routes, by name.
|
|
110
|
+
* @param menu - The qualified id of the menu.
|
|
111
|
+
*/
|
|
112
|
+
function pagesOf(routes, menu) {
|
|
113
|
+
return Object.values(routes).flatMap((route) => route.navigation?.menu?.id === menu && route.path?.startsWith(PREFIX) === true ? [{
|
|
114
|
+
order: route.navigation.order ?? 0,
|
|
115
|
+
route,
|
|
116
|
+
slug: route.path.slice(8)
|
|
117
|
+
}] : []).toSorted((one, other) => one.order - other.order).map(({ route, slug }) => ({
|
|
118
|
+
route,
|
|
119
|
+
slug
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/blocks/page-cards.tsx
|
|
124
|
+
/**
|
|
125
|
+
* Renders the menu's pages in the order the menu lists them, in columns as wide as the room allows.
|
|
126
|
+
*/
|
|
127
|
+
function PageCards(t0) {
|
|
128
|
+
const $ = c(4);
|
|
129
|
+
const { menu } = t0;
|
|
130
|
+
let t1;
|
|
131
|
+
if ($[0] !== menu) {
|
|
132
|
+
t1 = pagesOf(themingContract.routes, menu).map(_temp$1);
|
|
133
|
+
$[0] = menu;
|
|
134
|
+
$[1] = t1;
|
|
135
|
+
} else t1 = $[1];
|
|
136
|
+
let t2;
|
|
137
|
+
if ($[2] !== t1) {
|
|
138
|
+
t2 = /* @__PURE__ */ jsx(Grid.Root, {
|
|
139
|
+
columns: "fill-xs",
|
|
140
|
+
gap: "md",
|
|
141
|
+
children: t1
|
|
142
|
+
});
|
|
143
|
+
$[2] = t1;
|
|
144
|
+
$[3] = t2;
|
|
145
|
+
} else t2 = $[3];
|
|
146
|
+
return t2;
|
|
147
|
+
}
|
|
148
|
+
function _temp$1(t0) {
|
|
149
|
+
const { route, slug } = t0;
|
|
150
|
+
return /* @__PURE__ */ jsx(PageCard, {
|
|
151
|
+
route,
|
|
152
|
+
slug
|
|
153
|
+
}, route.id);
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/pages/overview.tsx
|
|
157
|
+
/**
|
|
158
|
+
* The sections that open the overview, before a section per group of pages.
|
|
159
|
+
*/
|
|
160
|
+
const OPENING = [
|
|
161
|
+
"statement",
|
|
162
|
+
"tokens",
|
|
163
|
+
"scoping",
|
|
164
|
+
"modes",
|
|
165
|
+
"reading"
|
|
166
|
+
];
|
|
167
|
+
/**
|
|
168
|
+
* Renders the overview, with a section per menu in the sidebar's order.
|
|
169
|
+
*/
|
|
170
|
+
function OverviewPage() {
|
|
171
|
+
const $ = c(1);
|
|
172
|
+
let t0;
|
|
173
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
174
|
+
t0 = /* @__PURE__ */ jsx(DocPage, {
|
|
175
|
+
page: "overview",
|
|
176
|
+
sections: [...OPENING.map(_temp), ...menusByRank(themingContract.menus).map(_temp2)]
|
|
177
|
+
});
|
|
178
|
+
$[0] = t0;
|
|
179
|
+
} else t0 = $[0];
|
|
180
|
+
return t0;
|
|
181
|
+
}
|
|
182
|
+
function _temp2(menu) {
|
|
183
|
+
return {
|
|
184
|
+
block: /* @__PURE__ */ jsx(PageCards, { menu: menu.id }),
|
|
185
|
+
id: nameOf(menu)
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function _temp(id) {
|
|
189
|
+
return { id };
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
export { OverviewPage };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { n as variableOf } from "./variables-ymFs3Bzn.js";
|
|
2
|
+
import { t as DocPage } from "./doc-page-BQXdbP_h.js";
|
|
3
|
+
import { t as ModeColors } from "./mode-colors-Cf_ZPo3g.js";
|
|
4
|
+
import { PALETTES, ROLES } from "@stealthscale/theme/contract";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/pages/palettes.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Returns a palette's roles as the rows of a color table: each on the page, and the label on the
|
|
10
|
+
* solid.
|
|
11
|
+
*/
|
|
12
|
+
function rowsOf(palette) {
|
|
13
|
+
const solid = {
|
|
14
|
+
name: `${palette}.solid`,
|
|
15
|
+
variable: variableOf("colors", `${palette}.solid`)
|
|
16
|
+
};
|
|
17
|
+
return ROLES.map((role) => ({
|
|
18
|
+
against: role === "contrast" ? solid : void 0,
|
|
19
|
+
name: `${palette}.${role}`,
|
|
20
|
+
variable: variableOf("colors", `${palette}.${role}`)
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The page's sections: the roles, then a section per palette.
|
|
25
|
+
*/
|
|
26
|
+
const SECTIONS = [{ id: "roles" }, ...PALETTES.map((palette) => ({
|
|
27
|
+
block: /* @__PURE__ */ jsx(ModeColors, {
|
|
28
|
+
name: palette,
|
|
29
|
+
rows: rowsOf(palette)
|
|
30
|
+
}),
|
|
31
|
+
id: palette
|
|
32
|
+
}))];
|
|
33
|
+
/**
|
|
34
|
+
* Renders the palettes page.
|
|
35
|
+
*/
|
|
36
|
+
function PalettesPage() {
|
|
37
|
+
const $ = c(1);
|
|
38
|
+
let t0;
|
|
39
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
40
|
+
t0 = /* @__PURE__ */ jsx(DocPage, {
|
|
41
|
+
page: "palettes",
|
|
42
|
+
sections: SECTIONS
|
|
43
|
+
});
|
|
44
|
+
$[0] = t0;
|
|
45
|
+
} else t0 = $[0];
|
|
46
|
+
return t0;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { PalettesPage };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { a as recipe$4, i as recipe, n as recipe$1, o as recipe$2, t as recipe$3 } from "./theming-text.recipe-Dvcza4j1.js";
|
|
2
|
+
import { createRecipeContext } from "@stealthscale/theme";
|
|
3
|
+
//#region src/parts.ts
|
|
4
|
+
/**
|
|
5
|
+
* Renders a div as the panel that shows a block in one color mode.
|
|
6
|
+
*/
|
|
7
|
+
const ThemingPanel = createRecipeContext(recipe).withContext("div");
|
|
8
|
+
/**
|
|
9
|
+
* Renders a span that shows a token, in the shape passed as `shape`.
|
|
10
|
+
*/
|
|
11
|
+
const ThemingSample = createRecipeContext(recipe$1).withContext("span");
|
|
12
|
+
/**
|
|
13
|
+
* Renders a div that shows a layer style, in the look passed as `look`.
|
|
14
|
+
*/
|
|
15
|
+
const ThemingLook = createRecipeContext(recipe$2).withContext("div");
|
|
16
|
+
/**
|
|
17
|
+
* Renders a span of words in the text style passed as `text`.
|
|
18
|
+
*/
|
|
19
|
+
const ThemingText = createRecipeContext(recipe$3).withContext("span");
|
|
20
|
+
/**
|
|
21
|
+
* Renders a span that plays the animation style passed as `motion`.
|
|
22
|
+
*/
|
|
23
|
+
const ThemingMotion = createRecipeContext(recipe$4).withContext("span");
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ThemingText as a, ThemingSample as i, ThemingMotion as n, ThemingPanel as r, ThemingLook as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { t as DocPage } from "./doc-page-BQXdbP_h.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/pages/recipes.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The page's sections, in reading order.
|
|
7
|
+
*/
|
|
8
|
+
const SECTIONS = [
|
|
9
|
+
{ id: "binding" },
|
|
10
|
+
{ id: "writing" },
|
|
11
|
+
{ id: "parts" },
|
|
12
|
+
{ id: "layers" },
|
|
13
|
+
{ id: "emitted" },
|
|
14
|
+
{ id: "classes" }
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* Renders the recipes page.
|
|
18
|
+
*/
|
|
19
|
+
function RecipesPage() {
|
|
20
|
+
const $ = c(1);
|
|
21
|
+
let t0;
|
|
22
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t0 = /* @__PURE__ */ jsx(DocPage, {
|
|
24
|
+
page: "recipes",
|
|
25
|
+
sections: SECTIONS
|
|
26
|
+
});
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
} else t0 = $[0];
|
|
29
|
+
return t0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { RecipesPage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as variableOf, t as referenceOf } from "./variables-ymFs3Bzn.js";
|
|
2
|
+
//#region src/blocks/rows.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns a row per name: the name, its custom property, and a sample where the caller renders one.
|
|
5
|
+
*
|
|
6
|
+
* @param category - The tokens' category, such as `spacing`.
|
|
7
|
+
* @param names - The tokens' paths inside the category, in the order the table lists them.
|
|
8
|
+
* @param sample - Renders a token's sample from its reference, `var(--spacing-gap-md)`.
|
|
9
|
+
*/
|
|
10
|
+
function tokenRows(category, names, sample) {
|
|
11
|
+
return names.map((name) => ({
|
|
12
|
+
name,
|
|
13
|
+
variable: variableOf(category, name),
|
|
14
|
+
...sample === void 0 ? {} : { sample: sample(referenceOf(category, name)) }
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { tokenRows as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { r as SAMPLE } from "./theming-text.recipe-Dvcza4j1.js";
|
|
2
|
+
import { i as ThemingSample } from "./parts-BVmqVMgo.js";
|
|
3
|
+
import { t as setting } from "./setting-BsgJKTlh.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/blocks/sampler.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Returns a function that renders a sample from a token's reference.
|
|
8
|
+
*
|
|
9
|
+
* @param shape - The sample's shape.
|
|
10
|
+
* @param property - The value of the sample the token sets, such as `radius`.
|
|
11
|
+
* @param words - The words a text sample is set in. A sample of another shape renders none.
|
|
12
|
+
*/
|
|
13
|
+
function sampler(shape, property, words) {
|
|
14
|
+
/**
|
|
15
|
+
* Renders the sample of one token.
|
|
16
|
+
*/
|
|
17
|
+
function sampled(reference) {
|
|
18
|
+
return /* @__PURE__ */ jsx(ThemingSample, {
|
|
19
|
+
shape,
|
|
20
|
+
style: setting(SAMPLE[property], reference),
|
|
21
|
+
children: words
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return sampled;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { sampler as t };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { n as variableOf } from "./variables-ymFs3Bzn.js";
|
|
2
|
+
import { n as useWords, t as DocPage } from "./doc-page-BQXdbP_h.js";
|
|
3
|
+
import { t as ModeColors } from "./mode-colors-Cf_ZPo3g.js";
|
|
4
|
+
import { SERIES } from "@stealthscale/theme/contract";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/pages/series.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Returns the series colors as rows measured against one surface.
|
|
10
|
+
*/
|
|
11
|
+
function rowsOn(surface) {
|
|
12
|
+
return SERIES.map((step) => ({
|
|
13
|
+
against: {
|
|
14
|
+
name: surface,
|
|
15
|
+
variable: variableOf("colors", surface)
|
|
16
|
+
},
|
|
17
|
+
name: `series.${step}`,
|
|
18
|
+
variable: variableOf("colors", `series.${step}`)
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders the series page: how the colors are chosen, then the colors on each surface, each list
|
|
23
|
+
* named by its surface.
|
|
24
|
+
*/
|
|
25
|
+
function SeriesPage() {
|
|
26
|
+
const $ = c(3);
|
|
27
|
+
const { t } = useWords();
|
|
28
|
+
let t0;
|
|
29
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t0 = { id: "order" };
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
} else t0 = $[0];
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[1] !== t) {
|
|
35
|
+
t1 = /* @__PURE__ */ jsx(DocPage, {
|
|
36
|
+
page: "series",
|
|
37
|
+
sections: [t0, ...[{
|
|
38
|
+
id: "page",
|
|
39
|
+
surface: "bg"
|
|
40
|
+
}, {
|
|
41
|
+
id: "panel",
|
|
42
|
+
surface: "bg.panel"
|
|
43
|
+
}].map((t2) => {
|
|
44
|
+
const { id, surface } = t2;
|
|
45
|
+
return {
|
|
46
|
+
block: /* @__PURE__ */ jsx(ModeColors, {
|
|
47
|
+
name: t("blocks.onSurface", {
|
|
48
|
+
name: "series",
|
|
49
|
+
surface
|
|
50
|
+
}),
|
|
51
|
+
rows: rowsOn(surface)
|
|
52
|
+
}),
|
|
53
|
+
id
|
|
54
|
+
};
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
$[1] = t;
|
|
58
|
+
$[2] = t1;
|
|
59
|
+
} else t1 = $[2];
|
|
60
|
+
return t1;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { SeriesPage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/reading/setting.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns a style that sets one custom property.
|
|
4
|
+
*
|
|
5
|
+
* @param property - The custom property, such as `--theming-radius`.
|
|
6
|
+
* @param value - Its value, such as `var(--radii-l2)`.
|
|
7
|
+
*/
|
|
8
|
+
function setting(property, value) {
|
|
9
|
+
return { [property]: value };
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { setting as t };
|