@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,234 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { o as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { d as Group, t as Text, u as Root } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Room, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
import { Stack } from "@stealthscale/component-layout";
|
|
8
|
+
//#region src/kbd/examples/escape.example.tsx
|
|
9
|
+
var escape_example_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Escape: () => Escape,
|
|
11
|
+
source: () => source$3
|
|
12
|
+
});
|
|
13
|
+
function Escape(props) {
|
|
14
|
+
const $ = c(2);
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== props) {
|
|
17
|
+
t0 = /* @__PURE__ */ jsx(Root, {
|
|
18
|
+
...props,
|
|
19
|
+
children: "Esc"
|
|
20
|
+
});
|
|
21
|
+
$[0] = props;
|
|
22
|
+
$[1] = t0;
|
|
23
|
+
} else t0 = $[1];
|
|
24
|
+
return t0;
|
|
25
|
+
}
|
|
26
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { Kbd } from \"@stealthscale/component-typography\";\n\nexport function Escape(props: Kbd.RootProps): ReactElement {\n return <Kbd.Root {...props}>Esc</Kbd.Root>;\n}\n";
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/kbd/examples/keys.example.tsx
|
|
29
|
+
var keys_example_exports = /* @__PURE__ */ __exportAll({
|
|
30
|
+
Keys: () => Keys,
|
|
31
|
+
source: () => source$2
|
|
32
|
+
});
|
|
33
|
+
const KEYS = [
|
|
34
|
+
"⌘",
|
|
35
|
+
"⌥",
|
|
36
|
+
"⇧",
|
|
37
|
+
"⌃",
|
|
38
|
+
"↵",
|
|
39
|
+
"⌫",
|
|
40
|
+
"↑",
|
|
41
|
+
"↓",
|
|
42
|
+
"Tab",
|
|
43
|
+
"Esc"
|
|
44
|
+
];
|
|
45
|
+
function Keys() {
|
|
46
|
+
const $ = c(1);
|
|
47
|
+
let t0;
|
|
48
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
|
+
t0 = /* @__PURE__ */ jsx(Stack, {
|
|
50
|
+
direction: "row",
|
|
51
|
+
gap: "xs",
|
|
52
|
+
wrap: true,
|
|
53
|
+
children: KEYS.map(_temp$1)
|
|
54
|
+
});
|
|
55
|
+
$[0] = t0;
|
|
56
|
+
} else t0 = $[0];
|
|
57
|
+
return t0;
|
|
58
|
+
}
|
|
59
|
+
function _temp$1(key) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Root, { children: key }, key);
|
|
61
|
+
}
|
|
62
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\n\nimport { Kbd } from \"@stealthscale/component-typography\";\n\nconst KEYS = [\"⌘\", \"⌥\", \"⇧\", \"⌃\", \"↵\", \"⌫\", \"↑\", \"↓\", \"Tab\", \"Esc\"];\n\nexport function Keys(): ReactElement {\n return (\n <Stack direction=\"row\" gap=\"xs\" wrap>\n {KEYS.map((key) => (\n <Kbd.Root key={key}>{key}</Kbd.Root>\n ))}\n </Stack>\n );\n}\n";
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/kbd/examples/sentence.example.tsx
|
|
65
|
+
var sentence_example_exports = /* @__PURE__ */ __exportAll({
|
|
66
|
+
Sentence: () => Sentence,
|
|
67
|
+
source: () => source$1
|
|
68
|
+
});
|
|
69
|
+
function Sentence() {
|
|
70
|
+
const $ = c(8);
|
|
71
|
+
const { t } = useWords("kbd");
|
|
72
|
+
let t0;
|
|
73
|
+
if ($[0] !== t) {
|
|
74
|
+
t0 = t("press");
|
|
75
|
+
$[0] = t;
|
|
76
|
+
$[1] = t0;
|
|
77
|
+
} else t0 = $[1];
|
|
78
|
+
let t1;
|
|
79
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t1 = /* @__PURE__ */ jsxs(Group, { children: [/* @__PURE__ */ jsx(Root, { children: "⌘" }), /* @__PURE__ */ jsx(Root, { children: "K" })] });
|
|
81
|
+
$[2] = t1;
|
|
82
|
+
} else t1 = $[2];
|
|
83
|
+
let t2;
|
|
84
|
+
if ($[3] !== t) {
|
|
85
|
+
t2 = t("find");
|
|
86
|
+
$[3] = t;
|
|
87
|
+
$[4] = t2;
|
|
88
|
+
} else t2 = $[4];
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[5] !== t0 || $[6] !== t2) {
|
|
91
|
+
t3 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
92
|
+
t0,
|
|
93
|
+
" ",
|
|
94
|
+
t1,
|
|
95
|
+
" ",
|
|
96
|
+
t2
|
|
97
|
+
] });
|
|
98
|
+
$[5] = t0;
|
|
99
|
+
$[6] = t2;
|
|
100
|
+
$[7] = t3;
|
|
101
|
+
} else t3 = $[7];
|
|
102
|
+
return t3;
|
|
103
|
+
}
|
|
104
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Kbd, Text } from \"@stealthscale/component-typography\";\n\nexport function Sentence(): ReactElement {\n const { t } = useWords(\"kbd\");\n\n return (\n <Text>\n {t(\"press\")}{\" \"}\n <Kbd.Group>\n <Kbd.Root>⌘</Kbd.Root>\n <Kbd.Root>K</Kbd.Root>\n </Kbd.Group>{\" \"}\n {t(\"find\")}\n </Text>\n );\n}\n";
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/kbd/examples/shortcuts.example.tsx
|
|
107
|
+
var shortcuts_example_exports = /* @__PURE__ */ __exportAll({
|
|
108
|
+
Shortcuts: () => Shortcuts,
|
|
109
|
+
source: () => source
|
|
110
|
+
});
|
|
111
|
+
const SHORTCUTS = [
|
|
112
|
+
{
|
|
113
|
+
command: "palette",
|
|
114
|
+
keys: ["⌘", "K"]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
command: "save",
|
|
118
|
+
keys: ["⌘", "S"]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
command: "undo",
|
|
122
|
+
keys: ["⌘", "Z"]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
command: "redo",
|
|
126
|
+
keys: [
|
|
127
|
+
"⇧",
|
|
128
|
+
"⌘",
|
|
129
|
+
"Z"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
function Shortcuts() {
|
|
134
|
+
const $ = c(4);
|
|
135
|
+
const { t } = useWords("kbd");
|
|
136
|
+
let t0;
|
|
137
|
+
if ($[0] !== t) {
|
|
138
|
+
t0 = SHORTCUTS.map((t1) => {
|
|
139
|
+
const { command, keys } = t1;
|
|
140
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
141
|
+
direction: "row",
|
|
142
|
+
justify: "between",
|
|
143
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
144
|
+
size: "sm",
|
|
145
|
+
children: t(`commands.${command}`)
|
|
146
|
+
}), /* @__PURE__ */ jsx(Group, {
|
|
147
|
+
size: "sm",
|
|
148
|
+
children: keys.map(_temp)
|
|
149
|
+
})]
|
|
150
|
+
}, command);
|
|
151
|
+
});
|
|
152
|
+
$[0] = t;
|
|
153
|
+
$[1] = t0;
|
|
154
|
+
} else t0 = $[1];
|
|
155
|
+
let t1;
|
|
156
|
+
if ($[2] !== t0) {
|
|
157
|
+
t1 = /* @__PURE__ */ jsx(Stack, {
|
|
158
|
+
gap: "sm",
|
|
159
|
+
children: t0
|
|
160
|
+
});
|
|
161
|
+
$[2] = t0;
|
|
162
|
+
$[3] = t1;
|
|
163
|
+
} else t1 = $[3];
|
|
164
|
+
return t1;
|
|
165
|
+
}
|
|
166
|
+
function _temp(key) {
|
|
167
|
+
return /* @__PURE__ */ jsx(Root, { children: key }, key);
|
|
168
|
+
}
|
|
169
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Kbd, Text } from \"@stealthscale/component-typography\";\n\nconst SHORTCUTS = [\n { command: \"palette\", keys: [\"⌘\", \"K\"] },\n { command: \"save\", keys: [\"⌘\", \"S\"] },\n { command: \"undo\", keys: [\"⌘\", \"Z\"] },\n { command: \"redo\", keys: [\"⇧\", \"⌘\", \"Z\"] },\n] as const;\n\nexport function Shortcuts(): ReactElement {\n const { t } = useWords(\"kbd\");\n\n return (\n <Stack gap=\"sm\">\n {SHORTCUTS.map(({ command, keys }) => (\n <Stack direction=\"row\" justify=\"between\" key={command}>\n <Text size=\"sm\">{t(`commands.${command}`)}</Text>\n <Kbd.Group size=\"sm\">\n {keys.map((key) => (\n <Kbd.Root key={key}>{key}</Kbd.Root>\n ))}\n </Kbd.Group>\n </Stack>\n ))}\n </Stack>\n );\n}\n";
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/kbd/kbd.specimen.tsx
|
|
172
|
+
/**
|
|
173
|
+
* Catalogue page for the keycap.
|
|
174
|
+
*
|
|
175
|
+
* @remarks
|
|
176
|
+
* `scenesOf` generates the look scene, crossed with the size axis, and the palette scene, crossed
|
|
177
|
+
* with the look axis. Hand-written scenes render the modifier and named keys, a combination
|
|
178
|
+
* inside a line of body text, and a list of commands with their combinations in a 384px room.
|
|
179
|
+
* Every scene renders a component from `examples/` and shows that file as its source. Key labels
|
|
180
|
+
* are literal and the other words are keys under `kbd` in `locales/en/specimen/kbd.json`.
|
|
181
|
+
*/
|
|
182
|
+
/**
|
|
183
|
+
* Hand-written scene for the modifier and named keys.
|
|
184
|
+
*/
|
|
185
|
+
const named = {
|
|
186
|
+
about: "kbd.keys.about",
|
|
187
|
+
draw: Keys,
|
|
188
|
+
example: keys_example_exports,
|
|
189
|
+
title: "kbd.keys.title"
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Hand-written scene for a combination inside a line of body text.
|
|
193
|
+
*/
|
|
194
|
+
const inline = {
|
|
195
|
+
about: "kbd.sentence.about",
|
|
196
|
+
draw: Sentence,
|
|
197
|
+
example: sentence_example_exports,
|
|
198
|
+
title: "kbd.sentence.title"
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Hand-written scene for a list of commands in a 384px room.
|
|
202
|
+
*/
|
|
203
|
+
const listed = {
|
|
204
|
+
about: "kbd.shortcuts.about",
|
|
205
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
206
|
+
size: "sm",
|
|
207
|
+
children: /* @__PURE__ */ jsx(Shortcuts, {})
|
|
208
|
+
}),
|
|
209
|
+
example: shortcuts_example_exports,
|
|
210
|
+
title: "kbd.shortcuts.title"
|
|
211
|
+
};
|
|
212
|
+
var kbd_specimen_default = specimen({
|
|
213
|
+
about: "kbd.about",
|
|
214
|
+
id: "components/typography/kbd",
|
|
215
|
+
imports: "import { Kbd } from \"@stealthscale/component-typography\";",
|
|
216
|
+
scenes: [
|
|
217
|
+
...scenesOf(recipe, {
|
|
218
|
+
axes: {
|
|
219
|
+
palette: { across: "variant" },
|
|
220
|
+
variant: { across: "size" }
|
|
221
|
+
},
|
|
222
|
+
draw: (props) => /* @__PURE__ */ jsx(Escape, { ...props }),
|
|
223
|
+
example: escape_example_exports,
|
|
224
|
+
namespace: "kbd",
|
|
225
|
+
order: ["variant", "palette"]
|
|
226
|
+
}),
|
|
227
|
+
named,
|
|
228
|
+
inline,
|
|
229
|
+
listed
|
|
230
|
+
],
|
|
231
|
+
title: "kbd.title"
|
|
232
|
+
});
|
|
233
|
+
//#endregion
|
|
234
|
+
export { kbd_specimen_default as default, inline, listed, named };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"GroupProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1041}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"GroupProps": [{"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "Semantic palette of the fill, the edge and the text."}, {"accepts": "\"lg\" | \"md\" | \"sm\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Height, minimum width, inline padding and text style."}, {"accepts": "\"outline\" | \"plain\" | \"raised\" | \"subtle\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the keycap."}], "RootProps": [{"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "Semantic palette of the fill, the edge and the text."}, {"accepts": "\"lg\" | \"md\" | \"sm\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Height, minimum width, inline padding and text style."}, {"accepts": "\"outline\" | \"plain\" | \"raised\" | \"subtle\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the keycap."}], "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."}]};
|
|
3
|
+
export const shapes = {"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": ""}]};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { c as Indicator, o as Root, s as Item, x as Icon } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Room, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
import { CheckIcon } from "lucide-react";
|
|
8
|
+
//#region src/list/examples/features.example.tsx
|
|
9
|
+
var features_example_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Features: () => Features,
|
|
11
|
+
source: () => source$1
|
|
12
|
+
});
|
|
13
|
+
const FEATURES = [
|
|
14
|
+
"invoices",
|
|
15
|
+
"currencies",
|
|
16
|
+
"sso"
|
|
17
|
+
];
|
|
18
|
+
function Features(props) {
|
|
19
|
+
const $ = c(5);
|
|
20
|
+
const { t } = useWords("list");
|
|
21
|
+
let t0;
|
|
22
|
+
if ($[0] !== t) {
|
|
23
|
+
t0 = FEATURES.map((feature) => /* @__PURE__ */ jsxs(Item, { children: [/* @__PURE__ */ jsx(Indicator, { children: /* @__PURE__ */ jsx(Icon, {
|
|
24
|
+
as: CheckIcon,
|
|
25
|
+
tone: "success"
|
|
26
|
+
}) }), t(`features.${feature}`)] }, feature));
|
|
27
|
+
$[0] = t;
|
|
28
|
+
$[1] = t0;
|
|
29
|
+
} else t0 = $[1];
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
32
|
+
t1 = /* @__PURE__ */ jsx(Root, {
|
|
33
|
+
variant: "plain",
|
|
34
|
+
...props,
|
|
35
|
+
children: t0
|
|
36
|
+
});
|
|
37
|
+
$[2] = props;
|
|
38
|
+
$[3] = t0;
|
|
39
|
+
$[4] = t1;
|
|
40
|
+
} else t1 = $[4];
|
|
41
|
+
return t1;
|
|
42
|
+
}
|
|
43
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { CheckIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Icon, List } from \"@stealthscale/component-typography\";\n\nconst FEATURES = [\"invoices\", \"currencies\", \"sso\"] as const;\n\nexport function Features(props: List.RootProps): ReactElement {\n const { t } = useWords(\"list\");\n\n return (\n <List.Root variant=\"plain\" {...props}>\n {FEATURES.map((feature) => (\n <List.Item key={feature}>\n <List.Indicator>\n <Icon as={CheckIcon} tone=\"success\" />\n </List.Indicator>\n {t(`features.${feature}`)}\n </List.Item>\n ))}\n </List.Root>\n );\n}\n";
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/list/examples/steps.example.tsx
|
|
46
|
+
var steps_example_exports = /* @__PURE__ */ __exportAll({
|
|
47
|
+
Steps: () => Steps,
|
|
48
|
+
source: () => source
|
|
49
|
+
});
|
|
50
|
+
function Steps(props) {
|
|
51
|
+
const $ = c(17);
|
|
52
|
+
const { t } = useWords("list");
|
|
53
|
+
let t0;
|
|
54
|
+
if ($[0] !== t) {
|
|
55
|
+
t0 = t("steps.verify");
|
|
56
|
+
$[0] = t;
|
|
57
|
+
$[1] = t0;
|
|
58
|
+
} else t0 = $[1];
|
|
59
|
+
let t1;
|
|
60
|
+
if ($[2] !== t0) {
|
|
61
|
+
t1 = /* @__PURE__ */ jsx(Item, { children: t0 });
|
|
62
|
+
$[2] = t0;
|
|
63
|
+
$[3] = t1;
|
|
64
|
+
} else t1 = $[3];
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[4] !== t) {
|
|
67
|
+
t2 = t("steps.connect");
|
|
68
|
+
$[4] = t;
|
|
69
|
+
$[5] = t2;
|
|
70
|
+
} else t2 = $[5];
|
|
71
|
+
let t3;
|
|
72
|
+
if ($[6] !== t2) {
|
|
73
|
+
t3 = /* @__PURE__ */ jsx(Item, { children: t2 });
|
|
74
|
+
$[6] = t2;
|
|
75
|
+
$[7] = t3;
|
|
76
|
+
} else t3 = $[7];
|
|
77
|
+
let t4;
|
|
78
|
+
if ($[8] !== t) {
|
|
79
|
+
t4 = t("steps.invite");
|
|
80
|
+
$[8] = t;
|
|
81
|
+
$[9] = t4;
|
|
82
|
+
} else t4 = $[9];
|
|
83
|
+
let t5;
|
|
84
|
+
if ($[10] !== t4) {
|
|
85
|
+
t5 = /* @__PURE__ */ jsx(Item, { children: t4 });
|
|
86
|
+
$[10] = t4;
|
|
87
|
+
$[11] = t5;
|
|
88
|
+
} else t5 = $[11];
|
|
89
|
+
let t6;
|
|
90
|
+
if ($[12] !== props || $[13] !== t1 || $[14] !== t3 || $[15] !== t5) {
|
|
91
|
+
t6 = /* @__PURE__ */ jsxs(Root, {
|
|
92
|
+
...props,
|
|
93
|
+
children: [
|
|
94
|
+
t1,
|
|
95
|
+
t3,
|
|
96
|
+
t5
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
$[12] = props;
|
|
100
|
+
$[13] = t1;
|
|
101
|
+
$[14] = t3;
|
|
102
|
+
$[15] = t5;
|
|
103
|
+
$[16] = t6;
|
|
104
|
+
} else t6 = $[16];
|
|
105
|
+
return t6;
|
|
106
|
+
}
|
|
107
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { List } from \"@stealthscale/component-typography\";\n\nexport function Steps(props: List.RootProps): ReactElement {\n const { t } = useWords(\"list\");\n\n return (\n <List.Root {...props}>\n <List.Item>{t(\"steps.verify\")}</List.Item>\n <List.Item>{t(\"steps.connect\")}</List.Item>\n <List.Item>{t(\"steps.invite\")}</List.Item>\n </List.Root>\n );\n}\n";
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/list/list.specimen.tsx
|
|
110
|
+
/**
|
|
111
|
+
* Catalogue page for the list.
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* `scenesOf` generates the marker, gap, alignment and motion scenes. The marker scene renders a
|
|
115
|
+
* counting marker on an `ol` and the others on a `ul`. The alignment scene renders the feature
|
|
116
|
+
* list in a 320px room, where its last item wraps. A hand-written scene renders the `plain` look
|
|
117
|
+
* with a lucide check in each indicator, and every other scene renders the `marker` look. Every
|
|
118
|
+
* scene renders a component from `examples/` and shows that file as its source. The words are
|
|
119
|
+
* keys under `list` in `locales/en/specimen/list.json`.
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Lists the markers that count, which render on an `ol`.
|
|
123
|
+
*/
|
|
124
|
+
const COUNTING = /* @__PURE__ */ new Set([
|
|
125
|
+
"decimal",
|
|
126
|
+
"leading-zero",
|
|
127
|
+
"lower-alpha",
|
|
128
|
+
"lower-greek",
|
|
129
|
+
"lower-roman",
|
|
130
|
+
"upper-alpha",
|
|
131
|
+
"upper-roman"
|
|
132
|
+
]);
|
|
133
|
+
/**
|
|
134
|
+
* Hand-written scene for the plain look with an indicator on each item.
|
|
135
|
+
*/
|
|
136
|
+
const plain = {
|
|
137
|
+
about: "list.variant.about",
|
|
138
|
+
axes: ["variant"],
|
|
139
|
+
draw: Features,
|
|
140
|
+
example: features_example_exports,
|
|
141
|
+
title: "list.variant.title"
|
|
142
|
+
};
|
|
143
|
+
var list_specimen_default = specimen({
|
|
144
|
+
about: "list.about",
|
|
145
|
+
id: "components/typography/list",
|
|
146
|
+
imports: "import { List } from \"@stealthscale/component-typography\";",
|
|
147
|
+
scenes: [...scenesOf(recipe, {
|
|
148
|
+
axes: {
|
|
149
|
+
align: {
|
|
150
|
+
draw: (props) => /* @__PURE__ */ jsx(Room, {
|
|
151
|
+
size: "xs",
|
|
152
|
+
children: /* @__PURE__ */ jsx(Features, { ...props })
|
|
153
|
+
}),
|
|
154
|
+
example: features_example_exports
|
|
155
|
+
},
|
|
156
|
+
marker: { draw: (props) => /* @__PURE__ */ jsx(Steps, {
|
|
157
|
+
as: COUNTING.has(props.marker) ? "ol" : "ul",
|
|
158
|
+
...props
|
|
159
|
+
}) }
|
|
160
|
+
},
|
|
161
|
+
draw: (props) => /* @__PURE__ */ jsx(Steps, { ...props }),
|
|
162
|
+
example: steps_example_exports,
|
|
163
|
+
namespace: "list",
|
|
164
|
+
order: [
|
|
165
|
+
"marker",
|
|
166
|
+
"gap",
|
|
167
|
+
"align",
|
|
168
|
+
"motion"
|
|
169
|
+
],
|
|
170
|
+
skip: { variant: "The plain scene renders the plain look, and every other scene the marker look." }
|
|
171
|
+
}), plain],
|
|
172
|
+
title: "list.title"
|
|
173
|
+
});
|
|
174
|
+
//#endregion
|
|
175
|
+
export { list_specimen_default as default, plain };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"IndicatorProps": {"conditions": 284, "foreign": 1041}, "ItemProps": {"conditions": 284, "foreign": 1042}, "RootProps": {"conditions": 284, "foreign": 1039}, "IconProps": {"conditions": 284, "foreign": 1178}};
|
|
2
|
+
export const parts = {"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."}], "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 = {"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,127 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { c as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { p as Mark, t as Text } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/mark/examples/hit.example.tsx
|
|
8
|
+
var hit_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Hit: () => Hit,
|
|
10
|
+
source: () => source$1
|
|
11
|
+
});
|
|
12
|
+
function Hit(props) {
|
|
13
|
+
const $ = c(13);
|
|
14
|
+
const { t } = useWords("mark");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("found");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== t) {
|
|
23
|
+
t1 = t("term");
|
|
24
|
+
$[2] = t;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else t1 = $[3];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Mark, {
|
|
30
|
+
...props,
|
|
31
|
+
children: t1
|
|
32
|
+
});
|
|
33
|
+
$[4] = props;
|
|
34
|
+
$[5] = t1;
|
|
35
|
+
$[6] = t2;
|
|
36
|
+
} else t2 = $[6];
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[7] !== t) {
|
|
39
|
+
t3 = t("files");
|
|
40
|
+
$[7] = t;
|
|
41
|
+
$[8] = t3;
|
|
42
|
+
} else t3 = $[8];
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[9] !== t0 || $[10] !== t2 || $[11] !== t3) {
|
|
45
|
+
t4 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
46
|
+
t0,
|
|
47
|
+
" ",
|
|
48
|
+
t2,
|
|
49
|
+
" ",
|
|
50
|
+
t3
|
|
51
|
+
] });
|
|
52
|
+
$[9] = t0;
|
|
53
|
+
$[10] = t2;
|
|
54
|
+
$[11] = t3;
|
|
55
|
+
$[12] = t4;
|
|
56
|
+
} else t4 = $[12];
|
|
57
|
+
return t4;
|
|
58
|
+
}
|
|
59
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Mark, Text } from \"@stealthscale/component-typography\";\n\nexport function Hit(props: Parameters<typeof Mark>[0]): ReactElement {\n const { t } = useWords(\"mark\");\n\n return (\n <Text>\n {t(\"found\")} <Mark {...props}>{t(\"term\")}</Mark> {t(\"files\")}\n </Text>\n );\n}\n";
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/mark/examples/term.example.tsx
|
|
62
|
+
var term_example_exports = /* @__PURE__ */ __exportAll({
|
|
63
|
+
Term: () => Term,
|
|
64
|
+
source: () => source
|
|
65
|
+
});
|
|
66
|
+
function Term(props) {
|
|
67
|
+
const $ = c(5);
|
|
68
|
+
const { t } = useWords("mark");
|
|
69
|
+
let t0;
|
|
70
|
+
if ($[0] !== t) {
|
|
71
|
+
t0 = t("term");
|
|
72
|
+
$[0] = t;
|
|
73
|
+
$[1] = t0;
|
|
74
|
+
} else t0 = $[1];
|
|
75
|
+
let t1;
|
|
76
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
77
|
+
t1 = /* @__PURE__ */ jsx(Mark, {
|
|
78
|
+
...props,
|
|
79
|
+
children: t0
|
|
80
|
+
});
|
|
81
|
+
$[2] = props;
|
|
82
|
+
$[3] = t0;
|
|
83
|
+
$[4] = t1;
|
|
84
|
+
} else t1 = $[4];
|
|
85
|
+
return t1;
|
|
86
|
+
}
|
|
87
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Mark } from \"@stealthscale/component-typography\";\n\nexport function Term(props: Parameters<typeof Mark>[0]): ReactElement {\n const { t } = useWords(\"mark\");\n\n return <Mark {...props}>{t(\"term\")}</Mark>;\n}\n";
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/mark/mark.specimen.tsx
|
|
90
|
+
/**
|
|
91
|
+
* Catalogue page for the highlight.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* `scenesOf` generates one scene per recipe axis. The palette scene crosses the look axis and
|
|
95
|
+
* renders the highlighted word alone, so each of its 48 cells is one line in a 95px column at
|
|
96
|
+
* 1280px. The other scenes render the highlight inside a `Text` line, because a highlight is read
|
|
97
|
+
* against the surrounding text. The corner scene crosses the inset axis. Every scene renders a
|
|
98
|
+
* component from `examples/` and shows that file as its source. The words are keys under `mark`
|
|
99
|
+
* in `locales/en/specimen/mark.json`.
|
|
100
|
+
*/
|
|
101
|
+
var mark_specimen_default = specimen({
|
|
102
|
+
about: "mark.about",
|
|
103
|
+
id: "components/typography/mark",
|
|
104
|
+
imports: "import { Mark, Text } from \"@stealthscale/component-typography\";",
|
|
105
|
+
scenes: scenesOf(recipe, {
|
|
106
|
+
axes: {
|
|
107
|
+
palette: {
|
|
108
|
+
across: "variant",
|
|
109
|
+
draw: (props) => /* @__PURE__ */ jsx(Term, { ...props }),
|
|
110
|
+
example: term_example_exports
|
|
111
|
+
},
|
|
112
|
+
radius: { across: "inset" }
|
|
113
|
+
},
|
|
114
|
+
draw: (props) => /* @__PURE__ */ jsx(Hit, { ...props }),
|
|
115
|
+
example: hit_example_exports,
|
|
116
|
+
namespace: "mark",
|
|
117
|
+
order: [
|
|
118
|
+
"palette",
|
|
119
|
+
"radius",
|
|
120
|
+
"effect",
|
|
121
|
+
"motion"
|
|
122
|
+
]
|
|
123
|
+
}),
|
|
124
|
+
title: "mark.title"
|
|
125
|
+
});
|
|
126
|
+
//#endregion
|
|
127
|
+
export { mark_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"MarkProps": {"conditions": 284, "foreign": 1040}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"MarkProps": [{"accepts": "\"glow\" | \"shine\"", "fallback": "", "kind": "variant", "name": "effect", "refers": [], "required": false, "says": "Effect around the highlight."}, {"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": "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."}]};
|
|
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": ""}]};
|