@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,117 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { p as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { C as Caption, S as Content, b as Icon, y 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
|
+
//#region src/blockquote/examples/testimonial.example.tsx
|
|
8
|
+
var testimonial_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Testimonial: () => Testimonial,
|
|
10
|
+
source: () => source
|
|
11
|
+
});
|
|
12
|
+
function Testimonial(props) {
|
|
13
|
+
const $ = c(13);
|
|
14
|
+
const { t } = useWords("blockquote");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
+
t0 = /* @__PURE__ */ jsx(Icon, {});
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
} else t0 = $[0];
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[1] !== t) {
|
|
22
|
+
t1 = t("quotation");
|
|
23
|
+
$[1] = t;
|
|
24
|
+
$[2] = t1;
|
|
25
|
+
} else t1 = $[2];
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[3] !== t1) {
|
|
28
|
+
t2 = /* @__PURE__ */ jsx(Content, { children: t1 });
|
|
29
|
+
$[3] = t1;
|
|
30
|
+
$[4] = t2;
|
|
31
|
+
} else t2 = $[4];
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[5] !== t) {
|
|
34
|
+
t3 = t("author");
|
|
35
|
+
$[5] = t;
|
|
36
|
+
$[6] = t3;
|
|
37
|
+
} else t3 = $[6];
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[7] !== t3) {
|
|
40
|
+
t4 = /* @__PURE__ */ jsx(Caption, { children: t3 });
|
|
41
|
+
$[7] = t3;
|
|
42
|
+
$[8] = t4;
|
|
43
|
+
} else t4 = $[8];
|
|
44
|
+
let t5;
|
|
45
|
+
if ($[9] !== props || $[10] !== t2 || $[11] !== t4) {
|
|
46
|
+
t5 = /* @__PURE__ */ jsxs(Root, {
|
|
47
|
+
...props,
|
|
48
|
+
children: [
|
|
49
|
+
t0,
|
|
50
|
+
t2,
|
|
51
|
+
t4
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
$[9] = props;
|
|
55
|
+
$[10] = t2;
|
|
56
|
+
$[11] = t4;
|
|
57
|
+
$[12] = t5;
|
|
58
|
+
} else t5 = $[12];
|
|
59
|
+
return t5;
|
|
60
|
+
}
|
|
61
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Blockquote } from \"@stealthscale/component-typography\";\n\nexport function Testimonial(props: Blockquote.RootProps): ReactElement {\n const { t } = useWords(\"blockquote\");\n\n return (\n <Blockquote.Root {...props}>\n <Blockquote.Icon />\n <Blockquote.Content>{t(\"quotation\")}</Blockquote.Content>\n <Blockquote.Caption>{t(\"author\")}</Blockquote.Caption>\n </Blockquote.Root>\n );\n}\n";
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/blockquote/blockquote.specimen.tsx
|
|
64
|
+
/**
|
|
65
|
+
* Catalogue page for the block quotation.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* `scenesOf` generates one scene per recipe axis. Every scene renders a customer testimonial with
|
|
69
|
+
* a lucide quote icon, the quotation and a caption. The look, size and alignment scenes render
|
|
70
|
+
* one quotation per row in a 512px room. The palette scene renders the surface look. Every scene
|
|
71
|
+
* renders a component from `examples/` and shows that file as its source. The words are keys
|
|
72
|
+
* under `blockquote` in `locales/en/specimen/blockquote.json`.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Renders the testimonial in a 512px room.
|
|
76
|
+
*/
|
|
77
|
+
function roomed(props) {
|
|
78
|
+
return /* @__PURE__ */ jsx(Room, {
|
|
79
|
+
size: "lg",
|
|
80
|
+
children: /* @__PURE__ */ jsx(Testimonial, { ...props })
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
var blockquote_specimen_default = specimen({
|
|
84
|
+
about: "blockquote.about",
|
|
85
|
+
id: "components/typography/blockquote",
|
|
86
|
+
imports: "import { Blockquote } from \"@stealthscale/component-typography\";",
|
|
87
|
+
scenes: scenesOf(recipe, {
|
|
88
|
+
axes: {
|
|
89
|
+
justify: {
|
|
90
|
+
direction: "column",
|
|
91
|
+
draw: roomed
|
|
92
|
+
},
|
|
93
|
+
palette: { with: { variant: "surface" } },
|
|
94
|
+
size: {
|
|
95
|
+
direction: "column",
|
|
96
|
+
draw: roomed
|
|
97
|
+
},
|
|
98
|
+
variant: {
|
|
99
|
+
direction: "column",
|
|
100
|
+
draw: roomed
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
draw: (props) => /* @__PURE__ */ jsx(Testimonial, { ...props }),
|
|
104
|
+
example: testimonial_example_exports,
|
|
105
|
+
namespace: "blockquote",
|
|
106
|
+
order: [
|
|
107
|
+
"variant",
|
|
108
|
+
"palette",
|
|
109
|
+
"size",
|
|
110
|
+
"justify",
|
|
111
|
+
"motion"
|
|
112
|
+
]
|
|
113
|
+
}),
|
|
114
|
+
title: "blockquote.title"
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { blockquote_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"CaptionProps": {"conditions": 284, "foreign": 1041}, "ContentProps": {"conditions": 284, "foreign": 1042}, "IconProps": {"conditions": 284, "foreign": 1178}, "RootProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"CaptionProps": [], "ContentProps": [], "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."}], "RootProps": [{"accepts": "\"center\" | \"end\" | \"start\"", "fallback": "", "kind": "variant", "name": "justify", "refers": [], "required": false, "says": "Inline alignment of the parts and their text."}, {"accepts": "\"reveal\" | \"rise\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Entrance animation of the root. 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 rule, the fill and the icon."}, {"accepts": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Body text style of the quotation, the gap between the parts one step larger than the size, and the start padding inside the rule."}, {"accepts": "\"glass\" | \"plain\" | \"solid\" | \"subtle\" | \"surface\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the root and the icon."}]};
|
|
3
|
+
export const shapes = {};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { d as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { _ as Code, t as Text } 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
|
+
//#region src/code/examples/failure.example.tsx
|
|
8
|
+
var failure_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Failure: () => Failure,
|
|
10
|
+
source: () => source$3
|
|
11
|
+
});
|
|
12
|
+
function Failure(props) {
|
|
13
|
+
const $ = c(2);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== props) {
|
|
16
|
+
t0 = /* @__PURE__ */ jsx(Code, {
|
|
17
|
+
...props,
|
|
18
|
+
children: "ENOENT"
|
|
19
|
+
});
|
|
20
|
+
$[0] = props;
|
|
21
|
+
$[1] = t0;
|
|
22
|
+
} else t0 = $[1];
|
|
23
|
+
return t0;
|
|
24
|
+
}
|
|
25
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { Code } from \"@stealthscale/component-typography\";\n\nexport function Failure(props: Parameters<typeof Code>[0]): ReactElement {\n return <Code {...props}>ENOENT</Code>;\n}\n";
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/code/examples/install.example.tsx
|
|
28
|
+
var install_example_exports = /* @__PURE__ */ __exportAll({
|
|
29
|
+
Install: () => Install,
|
|
30
|
+
source: () => source$2
|
|
31
|
+
});
|
|
32
|
+
function Install(props) {
|
|
33
|
+
const $ = c(2);
|
|
34
|
+
let t0;
|
|
35
|
+
if ($[0] !== props) {
|
|
36
|
+
t0 = /* @__PURE__ */ jsx(Code, {
|
|
37
|
+
...props,
|
|
38
|
+
children: "pnpm add"
|
|
39
|
+
});
|
|
40
|
+
$[0] = props;
|
|
41
|
+
$[1] = t0;
|
|
42
|
+
} else t0 = $[1];
|
|
43
|
+
return t0;
|
|
44
|
+
}
|
|
45
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { Code } from \"@stealthscale/component-typography\";\n\nexport function Install(props: Parameters<typeof Code>[0]): ReactElement {\n return <Code {...props}>pnpm add</Code>;\n}\n";
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/code/examples/sentence.example.tsx
|
|
48
|
+
var sentence_example_exports = /* @__PURE__ */ __exportAll({
|
|
49
|
+
Sentence: () => Sentence,
|
|
50
|
+
source: () => source$1
|
|
51
|
+
});
|
|
52
|
+
function Sentence() {
|
|
53
|
+
const $ = c(8);
|
|
54
|
+
const { t } = useWords("code");
|
|
55
|
+
let t0;
|
|
56
|
+
if ($[0] !== t) {
|
|
57
|
+
t0 = t("run");
|
|
58
|
+
$[0] = t;
|
|
59
|
+
$[1] = t0;
|
|
60
|
+
} else t0 = $[1];
|
|
61
|
+
let t1;
|
|
62
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
|
+
t1 = /* @__PURE__ */ jsx(Code, { children: "pnpm add @stealthscale/theme" });
|
|
64
|
+
$[2] = t1;
|
|
65
|
+
} else t1 = $[2];
|
|
66
|
+
let t2;
|
|
67
|
+
if ($[3] !== t) {
|
|
68
|
+
t2 = t("where");
|
|
69
|
+
$[3] = t;
|
|
70
|
+
$[4] = t2;
|
|
71
|
+
} else t2 = $[4];
|
|
72
|
+
let t3;
|
|
73
|
+
if ($[5] !== t0 || $[6] !== t2) {
|
|
74
|
+
t3 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
75
|
+
t0,
|
|
76
|
+
" ",
|
|
77
|
+
t1,
|
|
78
|
+
" ",
|
|
79
|
+
t2
|
|
80
|
+
] });
|
|
81
|
+
$[5] = t0;
|
|
82
|
+
$[6] = t2;
|
|
83
|
+
$[7] = t3;
|
|
84
|
+
} else t3 = $[7];
|
|
85
|
+
return t3;
|
|
86
|
+
}
|
|
87
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Code, Text } from \"@stealthscale/component-typography\";\n\nexport function Sentence(): ReactElement {\n const { t } = useWords(\"code\");\n\n return (\n <Text>\n {t(\"run\")} <Code>pnpm add @stealthscale/theme</Code> {t(\"where\")}\n </Text>\n );\n}\n";
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/code/examples/subpath.example.tsx
|
|
90
|
+
var subpath_example_exports = /* @__PURE__ */ __exportAll({
|
|
91
|
+
Subpath: () => Subpath,
|
|
92
|
+
source: () => source
|
|
93
|
+
});
|
|
94
|
+
function Subpath(props) {
|
|
95
|
+
const $ = c(10);
|
|
96
|
+
const { t } = useWords("code");
|
|
97
|
+
let t0;
|
|
98
|
+
if ($[0] !== t) {
|
|
99
|
+
t0 = t("subpath.before");
|
|
100
|
+
$[0] = t;
|
|
101
|
+
$[1] = t0;
|
|
102
|
+
} else t0 = $[1];
|
|
103
|
+
let t1;
|
|
104
|
+
if ($[2] !== props) {
|
|
105
|
+
t1 = /* @__PURE__ */ jsx(Code, {
|
|
106
|
+
...props,
|
|
107
|
+
children: "@stealthscale/component-screen/shell"
|
|
108
|
+
});
|
|
109
|
+
$[2] = props;
|
|
110
|
+
$[3] = t1;
|
|
111
|
+
} else t1 = $[3];
|
|
112
|
+
let t2;
|
|
113
|
+
if ($[4] !== t) {
|
|
114
|
+
t2 = t("subpath.after");
|
|
115
|
+
$[4] = t;
|
|
116
|
+
$[5] = t2;
|
|
117
|
+
} else t2 = $[5];
|
|
118
|
+
let t3;
|
|
119
|
+
if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
|
|
120
|
+
t3 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
121
|
+
t0,
|
|
122
|
+
" ",
|
|
123
|
+
t1,
|
|
124
|
+
" ",
|
|
125
|
+
t2
|
|
126
|
+
] });
|
|
127
|
+
$[6] = t0;
|
|
128
|
+
$[7] = t1;
|
|
129
|
+
$[8] = t2;
|
|
130
|
+
$[9] = t3;
|
|
131
|
+
} else t3 = $[9];
|
|
132
|
+
return t3;
|
|
133
|
+
}
|
|
134
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Code, Text } from \"@stealthscale/component-typography\";\n\nexport function Subpath(props: Parameters<typeof Code>[0]): ReactElement {\n const { t } = useWords(\"code\");\n\n return (\n <Text>\n {t(\"subpath.before\")} <Code {...props}>@stealthscale/component-screen/shell</Code>{\" \"}\n {t(\"subpath.after\")}\n </Text>\n );\n}\n";
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/code/code.specimen.tsx
|
|
137
|
+
/**
|
|
138
|
+
* Catalogue page for inline code.
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* `scenesOf` generates the look scene, crossed with the size axis, and the palette scene, crossed
|
|
142
|
+
* with the look axis. A hand-written scene renders a package path that `wrap` breaks in a 320px
|
|
143
|
+
* room, and another renders a command inside a line of body text. Every scene renders a component
|
|
144
|
+
* from `examples/` and shows that file as its source. Code is literal and the other words are
|
|
145
|
+
* keys under `code` in `locales/en/specimen/code.json`.
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* Hand-written scene for a package path longer than a line of its room, which `wrap` breaks.
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* The scene renders the path with `wrap` alone. Without it the path runs past its room, which is
|
|
152
|
+
* the fault the axis prevents.
|
|
153
|
+
*/
|
|
154
|
+
const wrapping = {
|
|
155
|
+
about: "code.wrap.about",
|
|
156
|
+
axes: ["wrap"],
|
|
157
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
158
|
+
size: "xs",
|
|
159
|
+
children: /* @__PURE__ */ jsx(Subpath, { wrap: true })
|
|
160
|
+
}),
|
|
161
|
+
example: subpath_example_exports,
|
|
162
|
+
props: { wrap: true },
|
|
163
|
+
title: "code.wrap.title"
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Hand-written scene for a command inside a line of body text.
|
|
167
|
+
*/
|
|
168
|
+
const inline = {
|
|
169
|
+
about: "code.sentence.about",
|
|
170
|
+
draw: Sentence,
|
|
171
|
+
example: sentence_example_exports,
|
|
172
|
+
title: "code.sentence.title"
|
|
173
|
+
};
|
|
174
|
+
var code_specimen_default = specimen({
|
|
175
|
+
about: "code.about",
|
|
176
|
+
id: "components/typography/code",
|
|
177
|
+
imports: "import { Code } from \"@stealthscale/component-typography\";",
|
|
178
|
+
scenes: [
|
|
179
|
+
...scenesOf(recipe, {
|
|
180
|
+
axes: {
|
|
181
|
+
palette: {
|
|
182
|
+
across: "variant",
|
|
183
|
+
draw: (props) => /* @__PURE__ */ jsx(Failure, { ...props }),
|
|
184
|
+
example: failure_example_exports
|
|
185
|
+
},
|
|
186
|
+
variant: { across: "size" }
|
|
187
|
+
},
|
|
188
|
+
draw: (props) => /* @__PURE__ */ jsx(Install, { ...props }),
|
|
189
|
+
example: install_example_exports,
|
|
190
|
+
namespace: "code",
|
|
191
|
+
order: ["variant", "palette"],
|
|
192
|
+
skip: { wrap: "rendered by the wrapping scene, with the value that breaks the path" }
|
|
193
|
+
}),
|
|
194
|
+
wrapping,
|
|
195
|
+
inline
|
|
196
|
+
],
|
|
197
|
+
title: "code.title"
|
|
198
|
+
});
|
|
199
|
+
//#endregion
|
|
200
|
+
export { code_specimen_default as default, inline, wrapping };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"CodeProps": {"conditions": 284, "foreign": 1041}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"CodeProps": [{"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": "\"md\" | \"sm\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Step of the code text style, with inline padding from the inset one size smaller."}, {"accepts": "\"outline\" | \"plain\" | \"solid\" | \"subtle\" | \"surface\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the snippet."}, {"accepts": "boolean", "fallback": "", "kind": "variant", "name": "wrap", "refers": [], "required": false, "says": "Breaks a snippet in running text where its line ends."}], "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,85 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { u as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { g as Em, t as Text } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { grounded, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/em/examples/export.example.tsx
|
|
8
|
+
var export_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Export: () => Export,
|
|
10
|
+
source: () => source
|
|
11
|
+
});
|
|
12
|
+
function Export(props) {
|
|
13
|
+
const $ = c(13);
|
|
14
|
+
const { t } = useWords("em");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("before");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== t) {
|
|
23
|
+
t1 = t("after");
|
|
24
|
+
$[2] = t;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else t1 = $[3];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Em, {
|
|
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("backup");
|
|
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 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Em, Text } from \"@stealthscale/component-typography\";\n\nexport function Export(props: Parameters<typeof Em>[0]): ReactElement {\n const { t } = useWords(\"em\");\n\n return (\n <Text>\n {t(\"before\")} <Em {...props}>{t(\"after\")}</Em> {t(\"backup\")}\n </Text>\n );\n}\n";
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/em/em.specimen.tsx
|
|
62
|
+
/**
|
|
63
|
+
* Catalogue page for the em element.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* `scenesOf` generates one scene per recipe axis. The example renders the stressed run inside a
|
|
67
|
+
* `Text` line, because stress is relative to the surrounding text. The tone scene renders the
|
|
68
|
+
* inverted ink on `bg.inverted` through `grounded`. Every scene renders the example and shows it
|
|
69
|
+
* as its source. The words are keys under `em` in `locales/en/specimen/em.json`.
|
|
70
|
+
*/
|
|
71
|
+
var em_specimen_default = specimen({
|
|
72
|
+
about: "em.about",
|
|
73
|
+
id: "components/typography/em",
|
|
74
|
+
imports: "import { Em, Text } from \"@stealthscale/component-typography\";",
|
|
75
|
+
scenes: scenesOf(recipe, {
|
|
76
|
+
axes: { tone: { draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Export, { ...props })) } },
|
|
77
|
+
draw: (props) => /* @__PURE__ */ jsx(Export, { ...props }),
|
|
78
|
+
example: export_example_exports,
|
|
79
|
+
namespace: "em",
|
|
80
|
+
order: ["tone", "motion"]
|
|
81
|
+
}),
|
|
82
|
+
title: "em.title"
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
export { em_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"EmProps": {"conditions": 284, "foreign": 1041}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"EmProps": [{"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": "Tone", "fallback": "", "kind": "variant", "name": "tone", "refers": ["kit.Tone"], "required": false, "says": "Foreground token of the text."}], "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,180 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { l as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { h as Heading } from "../../shared-CRBzNmJA.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Room, grounded, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/heading/examples/migration.example.tsx
|
|
8
|
+
var migration_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Migration: () => Migration,
|
|
10
|
+
source: () => source$3
|
|
11
|
+
});
|
|
12
|
+
function Migration(props) {
|
|
13
|
+
const $ = c(5);
|
|
14
|
+
const { t } = useWords("heading");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("migration");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
23
|
+
t1 = /* @__PURE__ */ jsx(Heading, {
|
|
24
|
+
as: "h3",
|
|
25
|
+
...props,
|
|
26
|
+
children: t0
|
|
27
|
+
});
|
|
28
|
+
$[2] = props;
|
|
29
|
+
$[3] = t0;
|
|
30
|
+
$[4] = t1;
|
|
31
|
+
} else t1 = $[4];
|
|
32
|
+
return t1;
|
|
33
|
+
}
|
|
34
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Heading } from \"@stealthscale/component-typography\";\n\nexport function Migration(props: Parameters<typeof Heading>[0]): ReactElement {\n const { t } = useWords(\"heading\");\n\n return (\n <Heading as=\"h3\" {...props}>\n {t(\"migration\")}\n </Heading>\n );\n}\n";
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/heading/examples/report.example.tsx
|
|
37
|
+
var report_example_exports = /* @__PURE__ */ __exportAll({
|
|
38
|
+
Report: () => Report,
|
|
39
|
+
source: () => source$2
|
|
40
|
+
});
|
|
41
|
+
function Report(props) {
|
|
42
|
+
const $ = c(5);
|
|
43
|
+
const { t } = useWords("heading");
|
|
44
|
+
let t0;
|
|
45
|
+
if ($[0] !== t) {
|
|
46
|
+
t0 = t("report");
|
|
47
|
+
$[0] = t;
|
|
48
|
+
$[1] = t0;
|
|
49
|
+
} else t0 = $[1];
|
|
50
|
+
let t1;
|
|
51
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
52
|
+
t1 = /* @__PURE__ */ jsx(Heading, {
|
|
53
|
+
as: "h3",
|
|
54
|
+
...props,
|
|
55
|
+
children: t0
|
|
56
|
+
});
|
|
57
|
+
$[2] = props;
|
|
58
|
+
$[3] = t0;
|
|
59
|
+
$[4] = t1;
|
|
60
|
+
} else t1 = $[4];
|
|
61
|
+
return t1;
|
|
62
|
+
}
|
|
63
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Heading } from \"@stealthscale/component-typography\";\n\nexport function Report(props: Parameters<typeof Heading>[0]): ReactElement {\n const { t } = useWords(\"heading\");\n\n return (\n <Heading as=\"h3\" {...props}>\n {t(\"report\")}\n </Heading>\n );\n}\n";
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/heading/examples/settings.example.tsx
|
|
66
|
+
var settings_example_exports = /* @__PURE__ */ __exportAll({
|
|
67
|
+
Settings: () => Settings,
|
|
68
|
+
source: () => source$1
|
|
69
|
+
});
|
|
70
|
+
function Settings(props) {
|
|
71
|
+
const $ = c(5);
|
|
72
|
+
const { t } = useWords("heading");
|
|
73
|
+
let t0;
|
|
74
|
+
if ($[0] !== t) {
|
|
75
|
+
t0 = t("settings");
|
|
76
|
+
$[0] = t;
|
|
77
|
+
$[1] = t0;
|
|
78
|
+
} else t0 = $[1];
|
|
79
|
+
let t1;
|
|
80
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
81
|
+
t1 = /* @__PURE__ */ jsx(Heading, {
|
|
82
|
+
as: "h3",
|
|
83
|
+
...props,
|
|
84
|
+
children: t0
|
|
85
|
+
});
|
|
86
|
+
$[2] = props;
|
|
87
|
+
$[3] = t0;
|
|
88
|
+
$[4] = t1;
|
|
89
|
+
} else t1 = $[4];
|
|
90
|
+
return t1;
|
|
91
|
+
}
|
|
92
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Heading } from \"@stealthscale/component-typography\";\n\nexport function Settings(props: Parameters<typeof Heading>[0]): ReactElement {\n const { t } = useWords(\"heading\");\n\n return (\n <Heading as=\"h3\" {...props}>\n {t(\"settings\")}\n </Heading>\n );\n}\n";
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/heading/examples/welcome.example.tsx
|
|
95
|
+
var welcome_example_exports = /* @__PURE__ */ __exportAll({
|
|
96
|
+
Welcome: () => Welcome,
|
|
97
|
+
source: () => source
|
|
98
|
+
});
|
|
99
|
+
function Welcome(props) {
|
|
100
|
+
const $ = c(5);
|
|
101
|
+
const { t } = useWords("heading");
|
|
102
|
+
let t0;
|
|
103
|
+
if ($[0] !== t) {
|
|
104
|
+
t0 = t("welcome");
|
|
105
|
+
$[0] = t;
|
|
106
|
+
$[1] = t0;
|
|
107
|
+
} else t0 = $[1];
|
|
108
|
+
let t1;
|
|
109
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
110
|
+
t1 = /* @__PURE__ */ jsx(Heading, {
|
|
111
|
+
as: "h3",
|
|
112
|
+
...props,
|
|
113
|
+
children: t0
|
|
114
|
+
});
|
|
115
|
+
$[2] = props;
|
|
116
|
+
$[3] = t0;
|
|
117
|
+
$[4] = t1;
|
|
118
|
+
} else t1 = $[4];
|
|
119
|
+
return t1;
|
|
120
|
+
}
|
|
121
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Heading } from \"@stealthscale/component-typography\";\n\nexport function Welcome(props: Parameters<typeof Heading>[0]): ReactElement {\n const { t } = useWords(\"heading\");\n\n return (\n <Heading as=\"h3\" {...props}>\n {t(\"welcome\")}\n </Heading>\n );\n}\n";
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/heading/heading.specimen.tsx
|
|
124
|
+
/**
|
|
125
|
+
* Catalogue page for the heading.
|
|
126
|
+
*
|
|
127
|
+
* @remarks
|
|
128
|
+
* `scenesOf` generates one scene per recipe axis. Every example renders an `h3`, one level below
|
|
129
|
+
* the scene's `h2`, so the page outline stays in order at every size. The display and effect
|
|
130
|
+
* scenes render at `2xl`. The tone scene renders the inverted ink on `bg.inverted` through
|
|
131
|
+
* `grounded`, and the truncation scene renders a long title in a 512px room. Every scene renders
|
|
132
|
+
* a component from `examples/` and shows that file as its source. The words are keys under
|
|
133
|
+
* `heading` in `locales/en/specimen/heading.json`.
|
|
134
|
+
*/
|
|
135
|
+
var heading_specimen_default = specimen({
|
|
136
|
+
about: "heading.about",
|
|
137
|
+
id: "components/typography/heading",
|
|
138
|
+
imports: "import { Heading } from \"@stealthscale/component-typography\";",
|
|
139
|
+
scenes: scenesOf(recipe, {
|
|
140
|
+
axes: {
|
|
141
|
+
display: {
|
|
142
|
+
draw: (props) => /* @__PURE__ */ jsx(Welcome, { ...props }),
|
|
143
|
+
example: welcome_example_exports,
|
|
144
|
+
with: { size: "2xl" }
|
|
145
|
+
},
|
|
146
|
+
effect: {
|
|
147
|
+
draw: (props) => /* @__PURE__ */ jsx(Welcome, { ...props }),
|
|
148
|
+
example: welcome_example_exports,
|
|
149
|
+
with: { size: "2xl" }
|
|
150
|
+
},
|
|
151
|
+
size: { direction: "column" },
|
|
152
|
+
tone: {
|
|
153
|
+
draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Settings, { ...props })),
|
|
154
|
+
example: settings_example_exports
|
|
155
|
+
},
|
|
156
|
+
truncate: {
|
|
157
|
+
direction: "column",
|
|
158
|
+
draw: (props) => /* @__PURE__ */ jsx(Room, {
|
|
159
|
+
size: "lg",
|
|
160
|
+
children: /* @__PURE__ */ jsx(Migration, { ...props })
|
|
161
|
+
}),
|
|
162
|
+
example: migration_example_exports
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
draw: (props) => /* @__PURE__ */ jsx(Report, { ...props }),
|
|
166
|
+
example: report_example_exports,
|
|
167
|
+
namespace: "heading",
|
|
168
|
+
order: [
|
|
169
|
+
"size",
|
|
170
|
+
"display",
|
|
171
|
+
"tone",
|
|
172
|
+
"effect",
|
|
173
|
+
"motion",
|
|
174
|
+
"truncate"
|
|
175
|
+
]
|
|
176
|
+
}),
|
|
177
|
+
title: "heading.title"
|
|
178
|
+
});
|
|
179
|
+
//#endregion
|
|
180
|
+
export { heading_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"HeadingProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"HeadingProps": [{"accepts": "boolean", "fallback": "", "kind": "variant", "name": "display", "refers": [], "required": false, "says": "Sets the display text role in place of the heading role."}, {"accepts": "\"gradient\" | \"shine\"", "fallback": "", "kind": "variant", "name": "effect", "refers": [], "required": false, "says": "Text effect."}, {"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": "\"2xl\" | \"3xl\" | \"4xl\" | \"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "Step of the heading text role, from `xs` to `4xl`."}, {"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."}]};
|
|
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": ""}]};
|