@stealthscale/component-typography 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cyclonedx/bom.json +1 -1
- package/dist/index.js +1 -515
- package/dist/pages/blockquote/blockquote.js +117 -0
- package/dist/pages/blockquote/blockquote.props.js +3 -0
- package/dist/pages/code/code.js +200 -0
- package/dist/pages/code/code.props.js +3 -0
- package/dist/pages/em/em.js +85 -0
- package/dist/pages/em/em.props.js +3 -0
- package/dist/pages/heading/heading.js +180 -0
- package/dist/pages/heading/heading.props.js +3 -0
- package/dist/pages/highlight/highlight.js +334 -0
- package/dist/pages/highlight/highlight.props.js +3 -0
- package/dist/pages/icon/icon.js +110 -0
- package/dist/pages/icon/icon.props.js +3 -0
- package/dist/pages/kbd/kbd.js +234 -0
- package/dist/pages/kbd/kbd.props.js +3 -0
- package/dist/pages/list/list.js +175 -0
- package/dist/pages/list/list.props.js +3 -0
- package/dist/pages/mark/mark.js +127 -0
- package/dist/pages/mark/mark.props.js +3 -0
- package/dist/pages/pages.json +141 -0
- package/dist/pages/quote/quote.js +89 -0
- package/dist/pages/quote/quote.props.js +3 -0
- package/dist/pages/span/span.js +121 -0
- package/dist/pages/span/span.props.js +3 -0
- package/dist/pages/strong/strong.js +80 -0
- package/dist/pages/strong/strong.props.js +3 -0
- package/dist/pages/text/text.js +143 -0
- package/dist/pages/text/text.props.js +3 -0
- package/dist/shared-CRBzNmJA.js +516 -0
- package/dist/theme.js +23 -14
- package/locales/en/specimen/blockquote.json +26 -0
- package/locales/en/specimen/code.json +26 -0
- package/locales/en/specimen/em.json +15 -0
- package/locales/en/specimen/heading.json +32 -0
- package/locales/en/specimen/highlight.json +37 -0
- package/locales/en/specimen/icon.json +22 -0
- package/locales/en/specimen/kbd.json +32 -0
- package/locales/en/specimen/list.json +34 -0
- package/locales/en/specimen/mark.json +23 -0
- package/locales/en/specimen/quote.json +19 -0
- package/locales/en/specimen/span.json +19 -0
- package/locales/en/specimen/strong.json +14 -0
- package/locales/en/specimen/text.json +31 -0
- package/package.json +5 -4
- /package/dist/{recipe-DuvOpofr.js → recipes-DuvOpofr.js} +0 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as recipe$8, c as recipe$5, d as recipe$2, f as recipe$1, i as recipe$9, l as recipe$4, n as recipe$11, o as recipe$6, p as recipe, r as recipe$10, s as recipe$7, t as recipe$12, u as recipe$3 } from "./recipes-DuvOpofr.js";
|
|
3
|
+
import { createRecipeContext, createSlotRecipeContext } from "@stealthscale/theme";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment } from "react";
|
|
7
|
+
import { useHighlight } from "@stealthscale/hooks";
|
|
8
|
+
//#region src/blockquote/context.ts
|
|
9
|
+
/**
|
|
10
|
+
* Binds the blockquote slot recipe to React.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
14
|
+
* at build time and must not load the React runtime.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Creates the blockquote recipe's `withProvider` and `withContext` bindings.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* `withProvider` binds the root, which takes the variants and provides the slot classes.
|
|
21
|
+
* `withContext` binds each other part, which reads its slot classes from the root.
|
|
22
|
+
*/
|
|
23
|
+
const { withContext: withContext$11, withProvider: withProvider$1 } = createSlotRecipeContext(recipe);
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/blockquote/caption.ts
|
|
26
|
+
/**
|
|
27
|
+
* Renders a `figcaption` element with the caption slot's classes.
|
|
28
|
+
*/
|
|
29
|
+
const Caption = withContext$11("figcaption", "caption");
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/blockquote/content.ts
|
|
32
|
+
/**
|
|
33
|
+
* Renders a `blockquote` element with the content slot's classes.
|
|
34
|
+
*/
|
|
35
|
+
const Content = withContext$11("blockquote", "content");
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/icon/context.ts
|
|
38
|
+
/**
|
|
39
|
+
* Binds the icon recipe to React.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
43
|
+
* at build time and must not load the React runtime.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Creates the icon recipe's `withContext` binding and its `PropsProvider`.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* `PropsProvider` sets variants on every element bound below it.
|
|
50
|
+
*/
|
|
51
|
+
const { PropsProvider: PropsProvider$5, withContext: withContext$10 } = createRecipeContext(recipe$1);
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/icon/icon.ts
|
|
54
|
+
/**
|
|
55
|
+
* Renders an `svg` element with the classes of the icon recipe, hidden and in the `img` role.
|
|
56
|
+
*/
|
|
57
|
+
const Icon$1 = withContext$10("svg", { defaultProps: {
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
role: "img"
|
|
60
|
+
} });
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/blockquote/icon.tsx
|
|
63
|
+
/**
|
|
64
|
+
* Renders the package's `Icon` with the icon slot's classes.
|
|
65
|
+
*/
|
|
66
|
+
const Slot = withContext$11(Icon$1, "icon");
|
|
67
|
+
/**
|
|
68
|
+
* Path of the quote mark in a 24-unit box: two filled marks with square tops.
|
|
69
|
+
*/
|
|
70
|
+
const MARK = "M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z";
|
|
71
|
+
/**
|
|
72
|
+
* Renders the quote mark, or the children in its place.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* The `viewBox` defaults to the mark's 24-unit box, and a `viewBox` passed by the caller takes
|
|
76
|
+
* precedence.
|
|
77
|
+
*/
|
|
78
|
+
function Icon(t0) {
|
|
79
|
+
const $ = c(8);
|
|
80
|
+
let children;
|
|
81
|
+
let props;
|
|
82
|
+
if ($[0] !== t0) {
|
|
83
|
+
({children, ...props} = t0);
|
|
84
|
+
$[0] = t0;
|
|
85
|
+
$[1] = children;
|
|
86
|
+
$[2] = props;
|
|
87
|
+
} else {
|
|
88
|
+
children = $[1];
|
|
89
|
+
props = $[2];
|
|
90
|
+
}
|
|
91
|
+
let t1;
|
|
92
|
+
if ($[3] !== children) {
|
|
93
|
+
t1 = children ?? /* @__PURE__ */ jsx("path", { d: MARK });
|
|
94
|
+
$[3] = children;
|
|
95
|
+
$[4] = t1;
|
|
96
|
+
} else t1 = $[4];
|
|
97
|
+
let t2;
|
|
98
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
99
|
+
t2 = /* @__PURE__ */ jsx(Slot, {
|
|
100
|
+
viewBox: "0 0 24 24",
|
|
101
|
+
...props,
|
|
102
|
+
children: t1
|
|
103
|
+
});
|
|
104
|
+
$[5] = props;
|
|
105
|
+
$[6] = t1;
|
|
106
|
+
$[7] = t2;
|
|
107
|
+
} else t2 = $[7];
|
|
108
|
+
return t2;
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/blockquote/root.ts
|
|
112
|
+
/**
|
|
113
|
+
* Renders a `figure` element with the root slot's classes and provides the variants to the parts.
|
|
114
|
+
*/
|
|
115
|
+
const Root$2 = withProvider$1("figure", "root");
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/blockquote/index.ts
|
|
118
|
+
var blockquote_exports = /* @__PURE__ */ __exportAll({
|
|
119
|
+
Caption: () => Caption,
|
|
120
|
+
Content: () => Content,
|
|
121
|
+
Icon: () => Icon,
|
|
122
|
+
Root: () => Root$2
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/code/context.ts
|
|
126
|
+
/**
|
|
127
|
+
* Binds the code recipe to React.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
131
|
+
* at build time and must not load the React runtime.
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* Creates the code recipe's `withContext` binding and its `PropsProvider`.
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* `PropsProvider` sets variants on every element bound below it.
|
|
138
|
+
*/
|
|
139
|
+
const { PropsProvider: PropsProvider$4, withContext: withContext$9 } = createRecipeContext(recipe$2);
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/code/code.ts
|
|
142
|
+
/**
|
|
143
|
+
* Renders a `code` element with the classes of the code recipe.
|
|
144
|
+
*/
|
|
145
|
+
const Code = withContext$9("code");
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/em/context.ts
|
|
148
|
+
/**
|
|
149
|
+
* Binds the em recipe to React.
|
|
150
|
+
*
|
|
151
|
+
* @remarks
|
|
152
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
153
|
+
* at build time and must not load the React runtime.
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* Creates the em recipe's `withContext` binding.
|
|
157
|
+
*/
|
|
158
|
+
const { withContext: withContext$8 } = createRecipeContext(recipe$3);
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/em/em.ts
|
|
161
|
+
/**
|
|
162
|
+
* Renders an `em` element with the classes of the em recipe.
|
|
163
|
+
*/
|
|
164
|
+
const Em = withContext$8("em");
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/heading/context.ts
|
|
167
|
+
/**
|
|
168
|
+
* Binds the heading recipe to React.
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
172
|
+
* at build time and must not load the React runtime.
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* Creates the heading recipe's `withContext` binding and its `PropsProvider`.
|
|
176
|
+
*
|
|
177
|
+
* @remarks
|
|
178
|
+
* `PropsProvider` sets variants on every element bound below it.
|
|
179
|
+
*/
|
|
180
|
+
const { PropsProvider: PropsProvider$3, withContext: withContext$7 } = createRecipeContext(recipe$4);
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/heading/heading.ts
|
|
183
|
+
/**
|
|
184
|
+
* Renders an `h2` element with the classes of the heading recipe.
|
|
185
|
+
*/
|
|
186
|
+
const Heading = withContext$7("h2");
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/mark/context.ts
|
|
189
|
+
/**
|
|
190
|
+
* Binds the mark recipe to React.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
194
|
+
* at build time and must not load the React runtime.
|
|
195
|
+
*/
|
|
196
|
+
/**
|
|
197
|
+
* Creates the mark recipe's `withContext` binding and its `PropsProvider`.
|
|
198
|
+
*
|
|
199
|
+
* @remarks
|
|
200
|
+
* `PropsProvider` sets variants on every element bound below it. The package exports it as
|
|
201
|
+
* `MarkPropsProvider`, so a search results list sets one look for all of its highlights.
|
|
202
|
+
*/
|
|
203
|
+
const { PropsProvider: PropsProvider$2, withContext: withContext$6 } = createRecipeContext(recipe$5);
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/mark/mark.ts
|
|
206
|
+
/**
|
|
207
|
+
* Renders a `mark` element with the classes of the mark recipe.
|
|
208
|
+
*/
|
|
209
|
+
const Mark = withContext$6("mark");
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/highlight/highlight.tsx
|
|
212
|
+
/**
|
|
213
|
+
* Renders a text with every match of a search query in a mark.
|
|
214
|
+
*
|
|
215
|
+
* @remarks
|
|
216
|
+
* The text renders as it is, and each run that matches the query renders in `Mark` with the props
|
|
217
|
+
* the caller gives, so a theme styles a match as it styles any highlight. A match takes the
|
|
218
|
+
* `none` inset unless a caller states one, because a match inside a word is split by padding.
|
|
219
|
+
* The matching is `useHighlight`'s: every occurrence, letter case ignored unless `ignoreCase` is
|
|
220
|
+
* false, each term trimmed, the longer term first. The component renders no element of its own,
|
|
221
|
+
* so it takes the place of a string inside the caller's text. A screen reader announces a `mark`
|
|
222
|
+
* only where its user asks for highlights.
|
|
223
|
+
*/
|
|
224
|
+
/**
|
|
225
|
+
* Renders the text with each match in a mark.
|
|
226
|
+
*
|
|
227
|
+
* @param props - The text, the query, whether case is ignored, and the props of every `Mark`.
|
|
228
|
+
* @returns The runs of the text.
|
|
229
|
+
*/
|
|
230
|
+
function Highlight(t0) {
|
|
231
|
+
const $ = c(10);
|
|
232
|
+
let children;
|
|
233
|
+
let ignoreCase;
|
|
234
|
+
let props;
|
|
235
|
+
let query;
|
|
236
|
+
let t1;
|
|
237
|
+
if ($[0] !== t0) {
|
|
238
|
+
({children, ignoreCase, inset: t1, query, ...props} = t0);
|
|
239
|
+
$[0] = t0;
|
|
240
|
+
$[1] = children;
|
|
241
|
+
$[2] = ignoreCase;
|
|
242
|
+
$[3] = props;
|
|
243
|
+
$[4] = query;
|
|
244
|
+
$[5] = t1;
|
|
245
|
+
} else {
|
|
246
|
+
children = $[1];
|
|
247
|
+
ignoreCase = $[2];
|
|
248
|
+
props = $[3];
|
|
249
|
+
query = $[4];
|
|
250
|
+
t1 = $[5];
|
|
251
|
+
}
|
|
252
|
+
const inset = t1 === void 0 ? "none" : t1;
|
|
253
|
+
const runs = [];
|
|
254
|
+
let start = 0;
|
|
255
|
+
let t2;
|
|
256
|
+
if ($[6] !== children || $[7] !== ignoreCase || $[8] !== query) {
|
|
257
|
+
t2 = {
|
|
258
|
+
ignoreCase,
|
|
259
|
+
query,
|
|
260
|
+
text: children
|
|
261
|
+
};
|
|
262
|
+
$[6] = children;
|
|
263
|
+
$[7] = ignoreCase;
|
|
264
|
+
$[8] = query;
|
|
265
|
+
$[9] = t2;
|
|
266
|
+
} else t2 = $[9];
|
|
267
|
+
for (const { match, text } of useHighlight(t2)) {
|
|
268
|
+
runs.push(match ? /* @__PURE__ */ jsx(Mark, {
|
|
269
|
+
inset,
|
|
270
|
+
...props,
|
|
271
|
+
children: text
|
|
272
|
+
}, start) : /* @__PURE__ */ jsx(Fragment, { children: text }, start));
|
|
273
|
+
start = start + text.length;
|
|
274
|
+
}
|
|
275
|
+
return runs;
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/kbd/context.ts
|
|
279
|
+
/**
|
|
280
|
+
* Binds the kbd and kbd-group recipes to React.
|
|
281
|
+
*
|
|
282
|
+
* @remarks
|
|
283
|
+
* The bindings are a separate module from the recipes, because the theme compiler imports a
|
|
284
|
+
* recipe at build time and must not load the React runtime.
|
|
285
|
+
*/
|
|
286
|
+
/**
|
|
287
|
+
* Creates the kbd recipe's `withContext` binding and its `PropsProvider`.
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* `Kbd.Group` sets its size, look and palette on every keycap inside it through `PropsProvider`.
|
|
291
|
+
*/
|
|
292
|
+
const { PropsProvider: PropsProvider$1, withContext: withContext$5 } = createRecipeContext(recipe$6);
|
|
293
|
+
/**
|
|
294
|
+
* Creates the kbd-group recipe's `withContext` binding.
|
|
295
|
+
*/
|
|
296
|
+
const { withContext: withGroupContext } = createRecipeContext(recipe$7);
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/kbd/group.tsx
|
|
299
|
+
/**
|
|
300
|
+
* Renders the outer `kbd` element with the classes of the kbd-group recipe.
|
|
301
|
+
*/
|
|
302
|
+
const Row = withGroupContext("kbd");
|
|
303
|
+
/**
|
|
304
|
+
* Renders a key combination and sets its size, look and palette on every keycap inside it.
|
|
305
|
+
*
|
|
306
|
+
* @remarks
|
|
307
|
+
* An axis the caller leaves unset is not passed down, so a keycap keeps the recipe's default. The
|
|
308
|
+
* recipe runtime reads an axis passed as undefined as a selection and writes no class for it.
|
|
309
|
+
*/
|
|
310
|
+
function Group(t0) {
|
|
311
|
+
const $ = c(20);
|
|
312
|
+
let palette;
|
|
313
|
+
let props;
|
|
314
|
+
let size;
|
|
315
|
+
let variant;
|
|
316
|
+
if ($[0] !== t0) {
|
|
317
|
+
({palette, size, variant, ...props} = t0);
|
|
318
|
+
$[0] = t0;
|
|
319
|
+
$[1] = palette;
|
|
320
|
+
$[2] = props;
|
|
321
|
+
$[3] = size;
|
|
322
|
+
$[4] = variant;
|
|
323
|
+
} else {
|
|
324
|
+
palette = $[1];
|
|
325
|
+
props = $[2];
|
|
326
|
+
size = $[3];
|
|
327
|
+
variant = $[4];
|
|
328
|
+
}
|
|
329
|
+
let t1;
|
|
330
|
+
if ($[5] !== palette) {
|
|
331
|
+
t1 = palette === void 0 ? {} : { palette };
|
|
332
|
+
$[5] = palette;
|
|
333
|
+
$[6] = t1;
|
|
334
|
+
} else t1 = $[6];
|
|
335
|
+
let t2;
|
|
336
|
+
if ($[7] !== size) {
|
|
337
|
+
t2 = size === void 0 ? {} : { size };
|
|
338
|
+
$[7] = size;
|
|
339
|
+
$[8] = t2;
|
|
340
|
+
} else t2 = $[8];
|
|
341
|
+
let t3;
|
|
342
|
+
if ($[9] !== variant) {
|
|
343
|
+
t3 = variant === void 0 ? {} : { variant };
|
|
344
|
+
$[9] = variant;
|
|
345
|
+
$[10] = t3;
|
|
346
|
+
} else t3 = $[10];
|
|
347
|
+
let t4;
|
|
348
|
+
if ($[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
|
|
349
|
+
t4 = {
|
|
350
|
+
...t1,
|
|
351
|
+
...t2,
|
|
352
|
+
...t3
|
|
353
|
+
};
|
|
354
|
+
$[11] = t1;
|
|
355
|
+
$[12] = t2;
|
|
356
|
+
$[13] = t3;
|
|
357
|
+
$[14] = t4;
|
|
358
|
+
} else t4 = $[14];
|
|
359
|
+
const chosen = t4;
|
|
360
|
+
let t5;
|
|
361
|
+
if ($[15] !== props) {
|
|
362
|
+
t5 = /* @__PURE__ */ jsx(Row, { ...props });
|
|
363
|
+
$[15] = props;
|
|
364
|
+
$[16] = t5;
|
|
365
|
+
} else t5 = $[16];
|
|
366
|
+
let t6;
|
|
367
|
+
if ($[17] !== chosen || $[18] !== t5) {
|
|
368
|
+
t6 = /* @__PURE__ */ jsx(PropsProvider$1, {
|
|
369
|
+
value: chosen,
|
|
370
|
+
children: t5
|
|
371
|
+
});
|
|
372
|
+
$[17] = chosen;
|
|
373
|
+
$[18] = t5;
|
|
374
|
+
$[19] = t6;
|
|
375
|
+
} else t6 = $[19];
|
|
376
|
+
return t6;
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/kbd/root.ts
|
|
380
|
+
/**
|
|
381
|
+
* Renders a `kbd` element with the classes of the kbd recipe.
|
|
382
|
+
*/
|
|
383
|
+
const Root$1 = withContext$5("kbd");
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/kbd/index.ts
|
|
386
|
+
var kbd_exports = /* @__PURE__ */ __exportAll({
|
|
387
|
+
Group: () => Group,
|
|
388
|
+
Root: () => Root$1
|
|
389
|
+
});
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/list/context.ts
|
|
392
|
+
/**
|
|
393
|
+
* Binds the list slot recipe to React.
|
|
394
|
+
*
|
|
395
|
+
* @remarks
|
|
396
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
397
|
+
* at build time and must not load the React runtime.
|
|
398
|
+
*/
|
|
399
|
+
/**
|
|
400
|
+
* Creates the list recipe's `withProvider` and `withContext` bindings.
|
|
401
|
+
*
|
|
402
|
+
* @remarks
|
|
403
|
+
* `withProvider` binds the root, which takes the variants and provides the slot classes.
|
|
404
|
+
* `withContext` binds each other part, which reads its slot classes from the root.
|
|
405
|
+
*/
|
|
406
|
+
const { withContext: withContext$4, withProvider } = createSlotRecipeContext(recipe$8);
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region src/list/indicator.ts
|
|
409
|
+
/**
|
|
410
|
+
* Renders a `span` element with the indicator slot's classes, hidden from assistive technology.
|
|
411
|
+
*/
|
|
412
|
+
const Indicator = withContext$4("span", "indicator", { defaultProps: { "aria-hidden": true } });
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region src/list/item.ts
|
|
415
|
+
/**
|
|
416
|
+
* Renders an `li` element with the item slot's classes.
|
|
417
|
+
*/
|
|
418
|
+
const Item = withContext$4("li", "item");
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/list/root.ts
|
|
421
|
+
/**
|
|
422
|
+
* Renders a `ul` element in the `list` role with the root slot's classes, and provides the
|
|
423
|
+
* variants to the items.
|
|
424
|
+
*/
|
|
425
|
+
const Root = withProvider("ul", "root", {
|
|
426
|
+
defaultProps: { role: "list" },
|
|
427
|
+
forwardProps: ["start"]
|
|
428
|
+
});
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/list/index.ts
|
|
431
|
+
var list_exports = /* @__PURE__ */ __exportAll({
|
|
432
|
+
Indicator: () => Indicator,
|
|
433
|
+
Item: () => Item,
|
|
434
|
+
Root: () => Root
|
|
435
|
+
});
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/quote/context.ts
|
|
438
|
+
/**
|
|
439
|
+
* Binds the quote recipe to React.
|
|
440
|
+
*
|
|
441
|
+
* @remarks
|
|
442
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
443
|
+
* at build time and must not load the React runtime.
|
|
444
|
+
*/
|
|
445
|
+
/**
|
|
446
|
+
* Creates the quote recipe's `withContext` binding.
|
|
447
|
+
*/
|
|
448
|
+
const { withContext: withContext$3 } = createRecipeContext(recipe$9);
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/quote/quote.ts
|
|
451
|
+
/**
|
|
452
|
+
* Renders a `q` element with the classes of the quote recipe.
|
|
453
|
+
*/
|
|
454
|
+
const Quote = withContext$3("q");
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/span/context.ts
|
|
457
|
+
/**
|
|
458
|
+
* Binds the span recipe to React.
|
|
459
|
+
*
|
|
460
|
+
* @remarks
|
|
461
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
462
|
+
* at build time and must not load the React runtime.
|
|
463
|
+
*/
|
|
464
|
+
/**
|
|
465
|
+
* Creates the span recipe's `withContext` binding.
|
|
466
|
+
*/
|
|
467
|
+
const { withContext: withContext$2 } = createRecipeContext(recipe$10);
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/span/span.ts
|
|
470
|
+
/**
|
|
471
|
+
* Renders a `span` element with the classes of the span recipe.
|
|
472
|
+
*/
|
|
473
|
+
const Span = withContext$2("span");
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/strong/context.ts
|
|
476
|
+
/**
|
|
477
|
+
* Binds the strong recipe to React.
|
|
478
|
+
*
|
|
479
|
+
* @remarks
|
|
480
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
481
|
+
* at build time and must not load the React runtime.
|
|
482
|
+
*/
|
|
483
|
+
/**
|
|
484
|
+
* Creates the strong recipe's `withContext` binding.
|
|
485
|
+
*/
|
|
486
|
+
const { withContext: withContext$1 } = createRecipeContext(recipe$11);
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/strong/strong.ts
|
|
489
|
+
/**
|
|
490
|
+
* Renders a `strong` element with the classes of the strong recipe.
|
|
491
|
+
*/
|
|
492
|
+
const Strong = withContext$1("strong");
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region src/text/context.ts
|
|
495
|
+
/**
|
|
496
|
+
* Binds the text recipe to React.
|
|
497
|
+
*
|
|
498
|
+
* @remarks
|
|
499
|
+
* The binding is a separate module from the recipe, because the theme compiler imports the recipe
|
|
500
|
+
* at build time and must not load the React runtime.
|
|
501
|
+
*/
|
|
502
|
+
/**
|
|
503
|
+
* Creates the text recipe's `withContext` binding and its `PropsProvider`.
|
|
504
|
+
*
|
|
505
|
+
* @remarks
|
|
506
|
+
* `PropsProvider` sets variants on every element bound below it.
|
|
507
|
+
*/
|
|
508
|
+
const { PropsProvider, withContext } = createRecipeContext(recipe$12);
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region src/text/text.ts
|
|
511
|
+
/**
|
|
512
|
+
* Renders a `p` element with the classes of the text recipe.
|
|
513
|
+
*/
|
|
514
|
+
const Text = withContext("p");
|
|
515
|
+
//#endregion
|
|
516
|
+
export { Caption as C, Content as S, Code as _, list_exports as a, Icon as b, Indicator as c, Group as d, Highlight as f, Em as g, Heading as h, Quote as i, kbd_exports as l, PropsProvider$2 as m, Strong as n, Root as o, Mark as p, Span as r, Item as s, Text as t, Root$1 as u, blockquote_exports as v, Icon$1 as x, Root$2 as y };
|
package/dist/theme.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { a as recipe$12, c as recipe$6, d as recipe, f as recipe$3, i as recipe$7, l as recipe$2, n as recipe$9, o as recipe$4, p as recipe$11, r as recipe$8, s as recipe$5, t as recipe$10, u as recipe$1 } from "./
|
|
1
|
+
import { a as recipe$12, c as recipe$6, d as recipe, f as recipe$3, i as recipe$7, l as recipe$2, n as recipe$9, o as recipe$4, p as recipe$11, r as recipe$8, s as recipe$5, t as recipe$10, u as recipe$1 } from "./recipes-DuvOpofr.js";
|
|
2
2
|
import { definePreset } from "@stealthscale/theme/authoring";
|
|
3
|
-
//#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
//#endregion
|
|
4
|
+
const theme_default$published = ((preset) => {
|
|
5
|
+
const extend = preset.theme.extend;
|
|
6
|
+
return {
|
|
7
|
+
...preset,
|
|
8
|
+
theme: {
|
|
9
|
+
...preset.theme,
|
|
10
|
+
extend: {
|
|
11
|
+
...extend,
|
|
12
|
+
"recipes": {
|
|
13
|
+
...extend["recipes"],
|
|
14
|
+
"mark": {
|
|
15
|
+
...extend["recipes"]["mark"],
|
|
16
|
+
staticCss: [...extend["recipes"]["mark"].staticCss ?? [], { "inset": ["none"] }]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
})(definePreset({
|
|
13
23
|
name: "@stealthscale/component-typography",
|
|
14
24
|
theme: { extend: {
|
|
15
25
|
recipes: {
|
|
@@ -30,6 +40,5 @@ var theme_default = definePreset({
|
|
|
30
40
|
list: recipe$12
|
|
31
41
|
}
|
|
32
42
|
} }
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export { theme_default as default };
|
|
43
|
+
}));
|
|
44
|
+
export { theme_default$published as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Renders a quotation as its own block: a `figure` with an icon, the quotation and a caption.",
|
|
3
|
+
"author": "Priya Raman, Head of Finance at Northwind",
|
|
4
|
+
"justify": {
|
|
5
|
+
"about": "The three alignments in a 512px room. At `start` the icon hangs in a start gutter, and at `center` and `end` it sits above the quotation.",
|
|
6
|
+
"title": "Alignment"
|
|
7
|
+
},
|
|
8
|
+
"motion": {
|
|
9
|
+
"about": "The animation a quotation enters with. Each one runs once when the quotation mounts.",
|
|
10
|
+
"title": "Motion"
|
|
11
|
+
},
|
|
12
|
+
"palette": {
|
|
13
|
+
"about": "Every palette in the surface look: the fill in `colorPalette.subtle`, the rule and the icon in `colorPalette.solid`.",
|
|
14
|
+
"title": "Palettes"
|
|
15
|
+
},
|
|
16
|
+
"quotation": "Moving billing to one ledger cut our month-end close from nine days to two.",
|
|
17
|
+
"size": {
|
|
18
|
+
"about": "The five sizes. Each sets the body text style, the gaps and the start padding, and the icon is one line of the quotation tall.",
|
|
19
|
+
"title": "Sizes"
|
|
20
|
+
},
|
|
21
|
+
"title": "Blockquote",
|
|
22
|
+
"variant": {
|
|
23
|
+
"about": "`subtle` and `solid` render a rule down the start edge. `surface` adds a fill and rounds the end corners. `glass` renders the theme's glass surface. `plain` renders no rule.",
|
|
24
|
+
"title": "Looks"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Renders code inside a line of text in a look, a size and a palette.",
|
|
3
|
+
"palette": {
|
|
4
|
+
"about": "Every look in every palette.",
|
|
5
|
+
"title": "Palettes"
|
|
6
|
+
},
|
|
7
|
+
"run": "Run",
|
|
8
|
+
"sentence": {
|
|
9
|
+
"about": "A command at `md` inside a line of body text.",
|
|
10
|
+
"title": "In a sentence"
|
|
11
|
+
},
|
|
12
|
+
"subpath": {
|
|
13
|
+
"after": "in the application's bar.",
|
|
14
|
+
"before": "Import the switchers from"
|
|
15
|
+
},
|
|
16
|
+
"title": "Code",
|
|
17
|
+
"variant": {
|
|
18
|
+
"about": "Every look at both sizes. `plain` sets no inline padding.",
|
|
19
|
+
"title": "Looks and sizes"
|
|
20
|
+
},
|
|
21
|
+
"where": "in the application's directory.",
|
|
22
|
+
"wrap": {
|
|
23
|
+
"about": "A package path longer than a line of its 320px room. With `wrap` the path breaks where the line ends.",
|
|
24
|
+
"title": "Wrapping"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Marks stressed text. The element has the emphasis role.",
|
|
3
|
+
"after": "after",
|
|
4
|
+
"backup": "the backup finishes.",
|
|
5
|
+
"before": "The export starts",
|
|
6
|
+
"motion": {
|
|
7
|
+
"about": "The animation a stressed run enters with. Each one runs once when the run mounts.",
|
|
8
|
+
"title": "Motion"
|
|
9
|
+
},
|
|
10
|
+
"title": "Em",
|
|
11
|
+
"tone": {
|
|
12
|
+
"about": "The stressed run in every text ink, inside a line of body text. The inverted ink is for a dark surface, so its cell renders on `bg.inverted`.",
|
|
13
|
+
"title": "Inks"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Renders a heading in a heading text role, a text ink, a text effect and an entrance motion. `as` sets the heading level.",
|
|
3
|
+
"display": {
|
|
4
|
+
"about": "The heading at size `2xl` in the heading text role and in the display text role. The display role is heavier and tighter.",
|
|
5
|
+
"title": "Display"
|
|
6
|
+
},
|
|
7
|
+
"effect": {
|
|
8
|
+
"about": "`gradient` fills the words with a gradient. `shine` moves a highlight across them.",
|
|
9
|
+
"title": "Effects"
|
|
10
|
+
},
|
|
11
|
+
"migration": "Migrate every workspace to the new billing plan before the end of the quarter",
|
|
12
|
+
"motion": {
|
|
13
|
+
"about": "The animation a heading enters with. Each one runs once when the heading mounts.",
|
|
14
|
+
"title": "Motion"
|
|
15
|
+
},
|
|
16
|
+
"report": "Quarterly report",
|
|
17
|
+
"settings": "Account settings",
|
|
18
|
+
"size": {
|
|
19
|
+
"about": "The eight steps of the heading text role. `size` sets the prominence and `as` sets the level.",
|
|
20
|
+
"title": "Sizes"
|
|
21
|
+
},
|
|
22
|
+
"title": "Heading",
|
|
23
|
+
"tone": {
|
|
24
|
+
"about": "Every text ink. The inverted ink is for a dark surface, so its cell renders on `bg.inverted`.",
|
|
25
|
+
"title": "Inks"
|
|
26
|
+
},
|
|
27
|
+
"truncate": {
|
|
28
|
+
"about": "A heading that wraps, and the same heading cut to one line with an ellipsis, in a 512px room.",
|
|
29
|
+
"title": "Truncate"
|
|
30
|
+
},
|
|
31
|
+
"welcome": "Welcome back, Ada"
|
|
32
|
+
}
|