@stealthscale/component-typography 0.3.1 → 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 +1 -1
- 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 +4 -3
- /package/dist/{recipe-DuvOpofr.js → recipes-DuvOpofr.js} +0 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { f as Highlight, o as Root, s as Item, t as Text } from "../../shared-CRBzNmJA.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Matrix, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
8
|
+
import { SearchInput } from "@stealthscale/component-forms";
|
|
9
|
+
import { Stack } from "@stealthscale/component-layout";
|
|
10
|
+
//#region src/highlight/examples/letters.example.tsx
|
|
11
|
+
var letters_example_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Letters: () => Letters,
|
|
13
|
+
source: () => source$3
|
|
14
|
+
});
|
|
15
|
+
function Letters(props) {
|
|
16
|
+
const $ = c(8);
|
|
17
|
+
const { t } = useWords("highlight");
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== t) {
|
|
20
|
+
t0 = t("letters.query");
|
|
21
|
+
$[0] = t;
|
|
22
|
+
$[1] = t0;
|
|
23
|
+
} else t0 = $[1];
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[2] !== t) {
|
|
26
|
+
t1 = t("letters.text");
|
|
27
|
+
$[2] = t;
|
|
28
|
+
$[3] = t1;
|
|
29
|
+
} else t1 = $[3];
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[4] !== props || $[5] !== t0 || $[6] !== t1) {
|
|
32
|
+
t2 = /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(Highlight, {
|
|
33
|
+
query: t0,
|
|
34
|
+
...props,
|
|
35
|
+
children: t1
|
|
36
|
+
}) });
|
|
37
|
+
$[4] = props;
|
|
38
|
+
$[5] = t0;
|
|
39
|
+
$[6] = t1;
|
|
40
|
+
$[7] = t2;
|
|
41
|
+
} else t2 = $[7];
|
|
42
|
+
return t2;
|
|
43
|
+
}
|
|
44
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Highlight, HighlightProps, Text } from \"@stealthscale/component-typography\";\n\nexport function Letters(props: Omit<HighlightProps, \"children\" | \"query\">): ReactElement {\n const { t } = useWords(\"highlight\");\n\n return (\n <Text>\n <Highlight query={t(\"letters.query\")} {...props}>\n {t(\"letters.text\")}\n </Highlight>\n </Text>\n );\n}\n";
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/highlight/examples/looks.example.tsx
|
|
47
|
+
var looks_example_exports = /* @__PURE__ */ __exportAll({
|
|
48
|
+
Looks: () => Looks,
|
|
49
|
+
source: () => source$2
|
|
50
|
+
});
|
|
51
|
+
function Looks(props) {
|
|
52
|
+
const $ = c(8);
|
|
53
|
+
const { t } = useWords("highlight");
|
|
54
|
+
let t0;
|
|
55
|
+
if ($[0] !== t) {
|
|
56
|
+
t0 = t("looks.query");
|
|
57
|
+
$[0] = t;
|
|
58
|
+
$[1] = t0;
|
|
59
|
+
} else t0 = $[1];
|
|
60
|
+
let t1;
|
|
61
|
+
if ($[2] !== t) {
|
|
62
|
+
t1 = t("looks.text");
|
|
63
|
+
$[2] = t;
|
|
64
|
+
$[3] = t1;
|
|
65
|
+
} else t1 = $[3];
|
|
66
|
+
let t2;
|
|
67
|
+
if ($[4] !== props || $[5] !== t0 || $[6] !== t1) {
|
|
68
|
+
t2 = /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(Highlight, {
|
|
69
|
+
query: t0,
|
|
70
|
+
...props,
|
|
71
|
+
children: t1
|
|
72
|
+
}) });
|
|
73
|
+
$[4] = props;
|
|
74
|
+
$[5] = t0;
|
|
75
|
+
$[6] = t1;
|
|
76
|
+
$[7] = t2;
|
|
77
|
+
} else t2 = $[7];
|
|
78
|
+
return t2;
|
|
79
|
+
}
|
|
80
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Highlight, HighlightProps, Text } from \"@stealthscale/component-typography\";\n\nexport function Looks(props: Omit<HighlightProps, \"children\" | \"query\">): ReactElement {\n const { t } = useWords(\"highlight\");\n\n return (\n <Text>\n <Highlight query={t(\"looks.query\")} {...props}>\n {t(\"looks.text\")}\n </Highlight>\n </Text>\n );\n}\n";
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/highlight/examples/search.example.tsx
|
|
83
|
+
var search_example_exports = /* @__PURE__ */ __exportAll({
|
|
84
|
+
Search: () => Search,
|
|
85
|
+
source: () => source$1
|
|
86
|
+
});
|
|
87
|
+
const ARTICLES = [
|
|
88
|
+
"refunds",
|
|
89
|
+
"chargebacks",
|
|
90
|
+
"payouts",
|
|
91
|
+
"methods",
|
|
92
|
+
"fees"
|
|
93
|
+
];
|
|
94
|
+
function Search() {
|
|
95
|
+
const $ = c(34);
|
|
96
|
+
const { t } = useWords("highlight");
|
|
97
|
+
let t0;
|
|
98
|
+
if ($[0] !== t) {
|
|
99
|
+
t0 = () => t("search.query");
|
|
100
|
+
$[0] = t;
|
|
101
|
+
$[1] = t0;
|
|
102
|
+
} else t0 = $[1];
|
|
103
|
+
const [query, setQuery] = useState(t0);
|
|
104
|
+
let T0;
|
|
105
|
+
let T1;
|
|
106
|
+
let t1;
|
|
107
|
+
let t2;
|
|
108
|
+
let t3;
|
|
109
|
+
if ($[2] !== query || $[3] !== t) {
|
|
110
|
+
const typed = query.trim().toLocaleLowerCase();
|
|
111
|
+
let t4;
|
|
112
|
+
if ($[9] !== t) {
|
|
113
|
+
t4 = (key) => t(`search.articles.${key}`);
|
|
114
|
+
$[9] = t;
|
|
115
|
+
$[10] = t4;
|
|
116
|
+
} else t4 = $[10];
|
|
117
|
+
const titles = ARTICLES.map(t4).filter((title) => title.toLocaleLowerCase().includes(typed));
|
|
118
|
+
T1 = Stack;
|
|
119
|
+
t2 = "md";
|
|
120
|
+
let t5;
|
|
121
|
+
if ($[11] !== t) {
|
|
122
|
+
t5 = t("search.label");
|
|
123
|
+
$[11] = t;
|
|
124
|
+
$[12] = t5;
|
|
125
|
+
} else t5 = $[12];
|
|
126
|
+
let t6;
|
|
127
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
128
|
+
t6 = /* @__PURE__ */ jsx(XIcon, {});
|
|
129
|
+
$[13] = t6;
|
|
130
|
+
} else t6 = $[13];
|
|
131
|
+
let t7;
|
|
132
|
+
if ($[14] !== t) {
|
|
133
|
+
t7 = t("search.clear");
|
|
134
|
+
$[14] = t;
|
|
135
|
+
$[15] = t7;
|
|
136
|
+
} else t7 = $[15];
|
|
137
|
+
let t8;
|
|
138
|
+
if ($[16] !== t) {
|
|
139
|
+
t8 = t("search.label");
|
|
140
|
+
$[16] = t;
|
|
141
|
+
$[17] = t8;
|
|
142
|
+
} else t8 = $[17];
|
|
143
|
+
let t9;
|
|
144
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
145
|
+
t9 = /* @__PURE__ */ jsx(SearchIcon, {});
|
|
146
|
+
$[18] = t9;
|
|
147
|
+
} else t9 = $[18];
|
|
148
|
+
if ($[19] !== query || $[20] !== t5 || $[21] !== t7 || $[22] !== t8) {
|
|
149
|
+
t3 = /* @__PURE__ */ jsx(SearchInput, {
|
|
150
|
+
"aria-label": t5,
|
|
151
|
+
clearIndicator: t6,
|
|
152
|
+
clearLabel: t7,
|
|
153
|
+
onValueChange: setQuery,
|
|
154
|
+
placeholder: t8,
|
|
155
|
+
searchIndicator: t9,
|
|
156
|
+
value: query
|
|
157
|
+
});
|
|
158
|
+
$[19] = query;
|
|
159
|
+
$[20] = t5;
|
|
160
|
+
$[21] = t7;
|
|
161
|
+
$[22] = t8;
|
|
162
|
+
$[23] = t3;
|
|
163
|
+
} else t3 = $[23];
|
|
164
|
+
T0 = Root;
|
|
165
|
+
let t10;
|
|
166
|
+
if ($[24] !== query) {
|
|
167
|
+
t10 = (title_0) => /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(Highlight, {
|
|
168
|
+
query,
|
|
169
|
+
children: title_0
|
|
170
|
+
}) }, title_0);
|
|
171
|
+
$[24] = query;
|
|
172
|
+
$[25] = t10;
|
|
173
|
+
} else t10 = $[25];
|
|
174
|
+
t1 = titles.map(t10);
|
|
175
|
+
$[2] = query;
|
|
176
|
+
$[3] = t;
|
|
177
|
+
$[4] = T0;
|
|
178
|
+
$[5] = T1;
|
|
179
|
+
$[6] = t1;
|
|
180
|
+
$[7] = t2;
|
|
181
|
+
$[8] = t3;
|
|
182
|
+
} else {
|
|
183
|
+
T0 = $[4];
|
|
184
|
+
T1 = $[5];
|
|
185
|
+
t1 = $[6];
|
|
186
|
+
t2 = $[7];
|
|
187
|
+
t3 = $[8];
|
|
188
|
+
}
|
|
189
|
+
let t4;
|
|
190
|
+
if ($[26] !== T0 || $[27] !== t1) {
|
|
191
|
+
t4 = /* @__PURE__ */ jsx(T0, { children: t1 });
|
|
192
|
+
$[26] = T0;
|
|
193
|
+
$[27] = t1;
|
|
194
|
+
$[28] = t4;
|
|
195
|
+
} else t4 = $[28];
|
|
196
|
+
let t5;
|
|
197
|
+
if ($[29] !== T1 || $[30] !== t2 || $[31] !== t3 || $[32] !== t4) {
|
|
198
|
+
t5 = /* @__PURE__ */ jsxs(T1, {
|
|
199
|
+
gap: t2,
|
|
200
|
+
children: [t3, t4]
|
|
201
|
+
});
|
|
202
|
+
$[29] = T1;
|
|
203
|
+
$[30] = t2;
|
|
204
|
+
$[31] = t3;
|
|
205
|
+
$[32] = t4;
|
|
206
|
+
$[33] = t5;
|
|
207
|
+
} else t5 = $[33];
|
|
208
|
+
return t5;
|
|
209
|
+
}
|
|
210
|
+
const source$1 = "import { type ReactElement, useState } from \"react\";\n\nimport { SearchIcon, XIcon } from \"lucide-react\";\n\nimport { SearchInput } from \"@stealthscale/component-forms\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Highlight, List } from \"@stealthscale/component-typography\";\n\nconst ARTICLES = [\"refunds\", \"chargebacks\", \"payouts\", \"methods\", \"fees\"] as const;\n\nexport function Search(): ReactElement {\n const { t } = useWords(\"highlight\");\n const [query, setQuery] = useState(() => t(\"search.query\"));\n const typed = query.trim().toLocaleLowerCase();\n const titles = ARTICLES.map((key) => t(`search.articles.${key}`)).filter((title) =>\n title.toLocaleLowerCase().includes(typed),\n );\n\n return (\n <Stack gap=\"md\">\n <SearchInput\n aria-label={t(\"search.label\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"search.clear\")}\n onValueChange={setQuery}\n placeholder={t(\"search.label\")}\n searchIndicator={<SearchIcon />}\n value={query}\n />\n <List.Root>\n {titles.map((title) => (\n <List.Item key={title}>\n <Highlight query={query}>{title}</Highlight>\n </List.Item>\n ))}\n </List.Root>\n </Stack>\n );\n}\n";
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/highlight/examples/terms.example.tsx
|
|
213
|
+
var terms_example_exports = /* @__PURE__ */ __exportAll({
|
|
214
|
+
Terms: () => Terms,
|
|
215
|
+
source: () => source
|
|
216
|
+
});
|
|
217
|
+
function Terms() {
|
|
218
|
+
const $ = c(12);
|
|
219
|
+
const { t } = useWords("highlight");
|
|
220
|
+
let t0;
|
|
221
|
+
if ($[0] !== t) {
|
|
222
|
+
t0 = t("terms.refund");
|
|
223
|
+
$[0] = t;
|
|
224
|
+
$[1] = t0;
|
|
225
|
+
} else t0 = $[1];
|
|
226
|
+
let t1;
|
|
227
|
+
if ($[2] !== t) {
|
|
228
|
+
t1 = t("terms.chargeback");
|
|
229
|
+
$[2] = t;
|
|
230
|
+
$[3] = t1;
|
|
231
|
+
} else t1 = $[3];
|
|
232
|
+
let t2;
|
|
233
|
+
if ($[4] !== t0 || $[5] !== t1) {
|
|
234
|
+
t2 = [t0, t1];
|
|
235
|
+
$[4] = t0;
|
|
236
|
+
$[5] = t1;
|
|
237
|
+
$[6] = t2;
|
|
238
|
+
} else t2 = $[6];
|
|
239
|
+
let t3;
|
|
240
|
+
if ($[7] !== t) {
|
|
241
|
+
t3 = t("terms.text");
|
|
242
|
+
$[7] = t;
|
|
243
|
+
$[8] = t3;
|
|
244
|
+
} else t3 = $[8];
|
|
245
|
+
let t4;
|
|
246
|
+
if ($[9] !== t2 || $[10] !== t3) {
|
|
247
|
+
t4 = /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(Highlight, {
|
|
248
|
+
query: t2,
|
|
249
|
+
children: t3
|
|
250
|
+
}) });
|
|
251
|
+
$[9] = t2;
|
|
252
|
+
$[10] = t3;
|
|
253
|
+
$[11] = t4;
|
|
254
|
+
} else t4 = $[11];
|
|
255
|
+
return t4;
|
|
256
|
+
}
|
|
257
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Highlight, Text } from \"@stealthscale/component-typography\";\n\nexport function Terms(): ReactElement {\n const { t } = useWords(\"highlight\");\n\n return (\n <Text>\n <Highlight query={[t(\"terms.refund\"), t(\"terms.chargeback\")]}>{t(\"terms.text\")}</Highlight>\n </Text>\n );\n}\n";
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/highlight/highlight.specimen.tsx
|
|
260
|
+
/**
|
|
261
|
+
* Values of `ignoreCase` in the letter case scene, the default first.
|
|
262
|
+
*/
|
|
263
|
+
const CASES = [true, false];
|
|
264
|
+
/**
|
|
265
|
+
* Looks of the mark in the looks scene, the default first.
|
|
266
|
+
*/
|
|
267
|
+
const LOOKS = [
|
|
268
|
+
"subtle",
|
|
269
|
+
"solid",
|
|
270
|
+
"surface",
|
|
271
|
+
"outline",
|
|
272
|
+
"plain",
|
|
273
|
+
"text"
|
|
274
|
+
];
|
|
275
|
+
/**
|
|
276
|
+
* Hand-written scene for search results filtered and marked as a person types.
|
|
277
|
+
*/
|
|
278
|
+
const searched = {
|
|
279
|
+
about: "highlight.search.about",
|
|
280
|
+
draw: Search,
|
|
281
|
+
example: search_example_exports,
|
|
282
|
+
title: "highlight.search.title"
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Hand-written scene for several terms in one text.
|
|
286
|
+
*/
|
|
287
|
+
const listed = {
|
|
288
|
+
about: "highlight.terms.about",
|
|
289
|
+
draw: Terms,
|
|
290
|
+
example: terms_example_exports,
|
|
291
|
+
title: "highlight.terms.title"
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Hand-written scene for letter case ignored and matched.
|
|
295
|
+
*/
|
|
296
|
+
const cased = {
|
|
297
|
+
about: "highlight.letters.about",
|
|
298
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
299
|
+
knob: "ignoreCase",
|
|
300
|
+
of: CASES,
|
|
301
|
+
children: (ignoreCase) => /* @__PURE__ */ jsx(Letters, { ignoreCase })
|
|
302
|
+
}),
|
|
303
|
+
example: letters_example_exports,
|
|
304
|
+
props: { ignoreCase: true },
|
|
305
|
+
title: "highlight.letters.title"
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Hand-written scene for the mark's looks on every match.
|
|
309
|
+
*/
|
|
310
|
+
const looked = {
|
|
311
|
+
about: "highlight.looks.about",
|
|
312
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
313
|
+
knob: "variant",
|
|
314
|
+
of: LOOKS,
|
|
315
|
+
children: (variant) => /* @__PURE__ */ jsx(Looks, { variant })
|
|
316
|
+
}),
|
|
317
|
+
example: looks_example_exports,
|
|
318
|
+
props: { variant: "subtle" },
|
|
319
|
+
title: "highlight.looks.title"
|
|
320
|
+
};
|
|
321
|
+
var highlight_specimen_default = specimen({
|
|
322
|
+
about: "highlight.about",
|
|
323
|
+
id: "components/typography/highlight",
|
|
324
|
+
imports: "import { Highlight } from \"@stealthscale/component-typography\";",
|
|
325
|
+
scenes: [
|
|
326
|
+
searched,
|
|
327
|
+
listed,
|
|
328
|
+
cased,
|
|
329
|
+
looked
|
|
330
|
+
],
|
|
331
|
+
title: "highlight.title"
|
|
332
|
+
});
|
|
333
|
+
//#endregion
|
|
334
|
+
export { cased, highlight_specimen_default as default, listed, looked, searched };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"HighlightProps": {"conditions": 284, "foreign": 1039}, "TextProps": {"conditions": 284, "foreign": 1039}, "IndicatorProps": {"conditions": 284, "foreign": 1041}, "ItemProps": {"conditions": 284, "foreign": 1042}, "RootProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"HighlightProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "children", "refers": [], "required": true, "says": "Text to search, as a string."}, {"accepts": "\"glow\" | \"shine\"", "fallback": "", "kind": "variant", "name": "effect", "refers": [], "required": false, "says": "Effect around the highlight."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "ignoreCase", "refers": [], "required": false, "says": "Whether a match ignores letter case, true unless stated."}, {"accepts": "\"md\" | \"none\" | \"sm\" | \"xs\"", "fallback": "", "kind": "variant", "name": "inset", "refers": [], "required": false, "says": "Inline padding from the inset scale, or `none`. The plain and text looks set no padding."}, {"accepts": "\"fade\" | \"reveal\" | \"rise\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Entrance animation. Each value reads the theme's animation style of the same name."}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "Semantic palette of the fill and the edge, and of the text in the plain and text looks."}, {"accepts": "string | readonly string[]", "fallback": "", "kind": "option", "name": "query", "refers": [], "required": true, "says": "Term or terms to mark."}, {"accepts": "Corner", "fallback": "", "kind": "variant", "name": "radius", "refers": ["kit.Corner"], "required": false, "says": "Corner radius token."}, {"accepts": "\"outline\" | \"plain\" | \"solid\" | \"subtle\" | \"surface\" | \"text\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the highlight."}], "TextProps": [{"accepts": "\"center\" | \"end\" | \"justify\" | \"start\"", "fallback": "", "kind": "variant", "name": "align", "refers": [], "required": false, "says": "Inline alignment of the lines. `start` and `end` follow the writing direction."}, {"accepts": "\"bottom\" | \"edges\" | \"radial\"", "fallback": "", "kind": "variant", "name": "mask", "refers": [], "required": false, "says": "Fade mask, read from the theme's `mask.*` layer styles."}, {"accepts": "\"fade\" | \"reveal\" | \"rise\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Entrance animation. Each value reads the theme's animation style of the same name."}, {"accepts": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Step of the body text role, from `xs` to `xl`."}, {"accepts": "Tone", "fallback": "", "kind": "variant", "name": "tone", "refers": ["kit.Tone"], "required": false, "says": "Foreground token of the text."}, {"accepts": "boolean", "fallback": "", "kind": "variant", "name": "truncate", "refers": [], "required": false, "says": "Cuts the text to one line that ends in an ellipsis."}, {"accepts": "Weight", "fallback": "", "kind": "variant", "name": "weight", "refers": ["kit.Weight"], "required": false, "says": "Font weight token."}], "IndicatorProps": [], "ItemProps": [], "RootProps": [{"accepts": "\"center\" | \"end\" | \"start\"", "fallback": "", "kind": "variant", "name": "align", "refers": [], "required": false, "says": "Block alignment of an item's indicator against its text, in the `plain` look."}, {"accepts": "Scale", "fallback": "", "kind": "variant", "name": "gap", "refers": ["kit.Scale"], "required": false, "says": "Gap token between the items."}, {"accepts": "\"circle\" | \"dash\" | \"decimal\" | \"disc\" | \"leading-zero\" | \"lower-alpha\" | \"lower-greek\" | \"lower-roman\" | \"square\" | \"upper-alpha\" | \"upper-roman\"", "fallback": "", "kind": "variant", "name": "marker", "refers": [], "required": false, "says": "Browser marker type of the items, in the `marker` look."}, {"accepts": "\"reveal\" | \"rise\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Entrance animation of each item. Each value reads the theme's animation style of the same name."}, {"accepts": "\"marker\" | \"plain\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the list."}]};
|
|
3
|
+
export const shapes = {"kit.Corner": [{"accepts": "", "name": "\"full\"", "says": ""}, {"accepts": "", "name": "\"l1\"", "says": ""}, {"accepts": "", "name": "\"l2\"", "says": ""}, {"accepts": "", "name": "\"l3\"", "says": ""}], "kit.Tone": [{"accepts": "", "name": "\"default\"", "says": ""}, {"accepts": "", "name": "\"error\"", "says": ""}, {"accepts": "", "name": "\"info\"", "says": ""}, {"accepts": "", "name": "\"inverted\"", "says": ""}, {"accepts": "", "name": "\"muted\"", "says": ""}, {"accepts": "", "name": "\"subtle\"", "says": ""}, {"accepts": "", "name": "\"success\"", "says": ""}, {"accepts": "", "name": "\"warning\"", "says": ""}], "kit.Weight": [{"accepts": "", "name": "\"bold\"", "says": ""}, {"accepts": "", "name": "\"medium\"", "says": ""}, {"accepts": "", "name": "\"normal\"", "says": ""}, {"accepts": "", "name": "\"semibold\"", "says": ""}], "kit.Scale": [{"accepts": "", "name": "\"2xl\"", "says": ""}, {"accepts": "", "name": "\"3xl\"", "says": ""}, {"accepts": "", "name": "\"4xl\"", "says": ""}, {"accepts": "", "name": "\"lg\"", "says": ""}, {"accepts": "", "name": "\"md\"", "says": ""}, {"accepts": "", "name": "\"sm\"", "says": ""}, {"accepts": "", "name": "\"xl\"", "says": ""}, {"accepts": "", "name": "\"xs\"", "says": ""}]};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { f as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { x as Icon } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { grounded, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
import { ArrowRightIcon, StarIcon } from "lucide-react";
|
|
8
|
+
//#region src/icon/examples/favourite.example.tsx
|
|
9
|
+
var favourite_example_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Favourite: () => Favourite,
|
|
11
|
+
source: () => source$1
|
|
12
|
+
});
|
|
13
|
+
function Favourite(props) {
|
|
14
|
+
const $ = c(5);
|
|
15
|
+
const { t } = useWords("icon");
|
|
16
|
+
let t0;
|
|
17
|
+
if ($[0] !== t) {
|
|
18
|
+
t0 = t("star");
|
|
19
|
+
$[0] = t;
|
|
20
|
+
$[1] = t0;
|
|
21
|
+
} else t0 = $[1];
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
24
|
+
t1 = /* @__PURE__ */ jsx(Icon, {
|
|
25
|
+
"aria-hidden": false,
|
|
26
|
+
"aria-label": t0,
|
|
27
|
+
as: StarIcon,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
$[2] = props;
|
|
31
|
+
$[3] = t0;
|
|
32
|
+
$[4] = t1;
|
|
33
|
+
} else t1 = $[4];
|
|
34
|
+
return t1;
|
|
35
|
+
}
|
|
36
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { StarIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Icon } from \"@stealthscale/component-typography\";\n\nexport function Favourite(props: Parameters<typeof Icon>[0]): ReactElement {\n const { t } = useWords(\"icon\");\n\n return <Icon aria-hidden={false} aria-label={t(\"star\")} as={StarIcon} {...props} />;\n}\n";
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/icon/examples/next.example.tsx
|
|
39
|
+
var next_example_exports = /* @__PURE__ */ __exportAll({
|
|
40
|
+
Next: () => Next,
|
|
41
|
+
source: () => source
|
|
42
|
+
});
|
|
43
|
+
function Next(props) {
|
|
44
|
+
const $ = c(5);
|
|
45
|
+
const { t } = useWords("icon");
|
|
46
|
+
let t0;
|
|
47
|
+
if ($[0] !== t) {
|
|
48
|
+
t0 = t("arrow");
|
|
49
|
+
$[0] = t;
|
|
50
|
+
$[1] = t0;
|
|
51
|
+
} else t0 = $[1];
|
|
52
|
+
let t1;
|
|
53
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
54
|
+
t1 = /* @__PURE__ */ jsx(Icon, {
|
|
55
|
+
"aria-hidden": false,
|
|
56
|
+
"aria-label": t0,
|
|
57
|
+
as: ArrowRightIcon,
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
$[2] = props;
|
|
61
|
+
$[3] = t0;
|
|
62
|
+
$[4] = t1;
|
|
63
|
+
} else t1 = $[4];
|
|
64
|
+
return t1;
|
|
65
|
+
}
|
|
66
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { ArrowRightIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Icon } from \"@stealthscale/component-typography\";\n\nexport function Next(props: Parameters<typeof Icon>[0]): ReactElement {\n const { t } = useWords(\"icon\");\n\n return <Icon aria-hidden={false} aria-label={t(\"arrow\")} as={ArrowRightIcon} {...props} />;\n}\n";
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/icon/icon.specimen.tsx
|
|
69
|
+
/**
|
|
70
|
+
* Catalogue page for the icon.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* `scenesOf` generates one scene per recipe axis. The examples pass lucide icons through `as`: a
|
|
74
|
+
* star for the size, ink and motion scenes, and an arrow for the mirroring scene, because a
|
|
75
|
+
* mirrored star looks the same. The ink, motion and mirroring scenes render at `lg`. The tone
|
|
76
|
+
* scene renders the inverted ink on `bg.inverted` through `grounded`. Every scene renders a
|
|
77
|
+
* component from `examples/` and shows that file as its source. The words are keys under `icon`
|
|
78
|
+
* in `locales/en/specimen/icon.json`.
|
|
79
|
+
*/
|
|
80
|
+
var icon_specimen_default = specimen({
|
|
81
|
+
about: "icon.about",
|
|
82
|
+
id: "components/typography/icon",
|
|
83
|
+
imports: "import { Icon } from \"@stealthscale/component-typography\";",
|
|
84
|
+
scenes: scenesOf(recipe, {
|
|
85
|
+
axes: {
|
|
86
|
+
mirrored: {
|
|
87
|
+
draw: (props) => /* @__PURE__ */ jsx(Next, { ...props }),
|
|
88
|
+
example: next_example_exports,
|
|
89
|
+
with: { size: "lg" }
|
|
90
|
+
},
|
|
91
|
+
motion: { with: { size: "lg" } },
|
|
92
|
+
tone: {
|
|
93
|
+
draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Favourite, { ...props })),
|
|
94
|
+
with: { size: "lg" }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
draw: (props) => /* @__PURE__ */ jsx(Favourite, { ...props }),
|
|
98
|
+
example: favourite_example_exports,
|
|
99
|
+
namespace: "icon",
|
|
100
|
+
order: [
|
|
101
|
+
"size",
|
|
102
|
+
"tone",
|
|
103
|
+
"motion",
|
|
104
|
+
"mirrored"
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
title: "icon.title"
|
|
108
|
+
});
|
|
109
|
+
//#endregion
|
|
110
|
+
export { icon_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"IconProps": {"conditions": 284, "foreign": 1178}};
|
|
2
|
+
export const parts = {"IconProps": [{"accepts": "boolean", "fallback": "", "kind": "variant", "name": "mirrored", "refers": [], "required": false, "says": "Mirrors the icon in a right-to-left page, for an icon that points, such as an arrow."}, {"accepts": "\"float\" | \"spin\" | \"twinkle\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Motion. Each value reads the theme's animation style of the same name."}, {"accepts": "\"2xl\" | \"3xl\" | \"4xl\" | \"inherit\" | \"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Box size from the icon scale, or `1em` at `inherit`."}, {"accepts": "\"current\" | \"default\" | \"error\" | \"info\" | \"inverted\" | \"muted\" | \"subtle\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "tone", "refers": [], "required": false, "says": "Foreground token of the icon."}]};
|
|
3
|
+
export const shapes = {};
|