@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,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"pages": [
|
|
4
|
+
{
|
|
5
|
+
"about": "blockquote.about",
|
|
6
|
+
"group": "",
|
|
7
|
+
"id": "components/typography/blockquote",
|
|
8
|
+
"module": "blockquote/blockquote.js",
|
|
9
|
+
"namespace": "",
|
|
10
|
+
"props": "blockquote/blockquote.props.js",
|
|
11
|
+
"specimen": "src/blockquote/blockquote.specimen.tsx",
|
|
12
|
+
"title": "blockquote.title"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"about": "code.about",
|
|
16
|
+
"group": "",
|
|
17
|
+
"id": "components/typography/code",
|
|
18
|
+
"module": "code/code.js",
|
|
19
|
+
"namespace": "",
|
|
20
|
+
"props": "code/code.props.js",
|
|
21
|
+
"specimen": "src/code/code.specimen.tsx",
|
|
22
|
+
"title": "code.title"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"about": "em.about",
|
|
26
|
+
"group": "",
|
|
27
|
+
"id": "components/typography/em",
|
|
28
|
+
"module": "em/em.js",
|
|
29
|
+
"namespace": "",
|
|
30
|
+
"props": "em/em.props.js",
|
|
31
|
+
"specimen": "src/em/em.specimen.tsx",
|
|
32
|
+
"title": "em.title"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"about": "heading.about",
|
|
36
|
+
"group": "",
|
|
37
|
+
"id": "components/typography/heading",
|
|
38
|
+
"module": "heading/heading.js",
|
|
39
|
+
"namespace": "",
|
|
40
|
+
"props": "heading/heading.props.js",
|
|
41
|
+
"specimen": "src/heading/heading.specimen.tsx",
|
|
42
|
+
"title": "heading.title"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"about": "highlight.about",
|
|
46
|
+
"group": "",
|
|
47
|
+
"id": "components/typography/highlight",
|
|
48
|
+
"module": "highlight/highlight.js",
|
|
49
|
+
"namespace": "",
|
|
50
|
+
"props": "highlight/highlight.props.js",
|
|
51
|
+
"specimen": "src/highlight/highlight.specimen.tsx",
|
|
52
|
+
"title": "highlight.title"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"about": "icon.about",
|
|
56
|
+
"group": "",
|
|
57
|
+
"id": "components/typography/icon",
|
|
58
|
+
"module": "icon/icon.js",
|
|
59
|
+
"namespace": "",
|
|
60
|
+
"props": "icon/icon.props.js",
|
|
61
|
+
"specimen": "src/icon/icon.specimen.tsx",
|
|
62
|
+
"title": "icon.title"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"about": "kbd.about",
|
|
66
|
+
"group": "",
|
|
67
|
+
"id": "components/typography/kbd",
|
|
68
|
+
"module": "kbd/kbd.js",
|
|
69
|
+
"namespace": "",
|
|
70
|
+
"props": "kbd/kbd.props.js",
|
|
71
|
+
"specimen": "src/kbd/kbd.specimen.tsx",
|
|
72
|
+
"title": "kbd.title"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"about": "list.about",
|
|
76
|
+
"group": "",
|
|
77
|
+
"id": "components/typography/list",
|
|
78
|
+
"module": "list/list.js",
|
|
79
|
+
"namespace": "",
|
|
80
|
+
"props": "list/list.props.js",
|
|
81
|
+
"specimen": "src/list/list.specimen.tsx",
|
|
82
|
+
"title": "list.title"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"about": "mark.about",
|
|
86
|
+
"group": "",
|
|
87
|
+
"id": "components/typography/mark",
|
|
88
|
+
"module": "mark/mark.js",
|
|
89
|
+
"namespace": "",
|
|
90
|
+
"props": "mark/mark.props.js",
|
|
91
|
+
"specimen": "src/mark/mark.specimen.tsx",
|
|
92
|
+
"title": "mark.title"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"about": "quote.about",
|
|
96
|
+
"group": "",
|
|
97
|
+
"id": "components/typography/quote",
|
|
98
|
+
"module": "quote/quote.js",
|
|
99
|
+
"namespace": "",
|
|
100
|
+
"props": "quote/quote.props.js",
|
|
101
|
+
"specimen": "src/quote/quote.specimen.tsx",
|
|
102
|
+
"title": "quote.title"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"about": "span.about",
|
|
106
|
+
"group": "",
|
|
107
|
+
"id": "components/typography/span",
|
|
108
|
+
"module": "span/span.js",
|
|
109
|
+
"namespace": "",
|
|
110
|
+
"props": "span/span.props.js",
|
|
111
|
+
"specimen": "src/span/span.specimen.tsx",
|
|
112
|
+
"title": "span.title"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"about": "strong.about",
|
|
116
|
+
"group": "",
|
|
117
|
+
"id": "components/typography/strong",
|
|
118
|
+
"module": "strong/strong.js",
|
|
119
|
+
"namespace": "",
|
|
120
|
+
"props": "strong/strong.props.js",
|
|
121
|
+
"specimen": "src/strong/strong.specimen.tsx",
|
|
122
|
+
"title": "strong.title"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"about": "text.about",
|
|
126
|
+
"group": "",
|
|
127
|
+
"id": "components/typography/text",
|
|
128
|
+
"module": "text/text.js",
|
|
129
|
+
"namespace": "",
|
|
130
|
+
"props": "text/text.props.js",
|
|
131
|
+
"specimen": "src/text/text.specimen.tsx",
|
|
132
|
+
"title": "text.title"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"requires": {
|
|
136
|
+
"@stealthscale/component-forms": "^0.3.0",
|
|
137
|
+
"@stealthscale/component-layout": "^0.2.0",
|
|
138
|
+
"@stealthscale/specimen": "^0.3.0",
|
|
139
|
+
"lucide-react": "^1.52.0"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { i as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { i as Quote, 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/quote/examples/audit.example.tsx
|
|
8
|
+
var audit_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Audit: () => Audit,
|
|
10
|
+
source: () => source
|
|
11
|
+
});
|
|
12
|
+
function Audit(props) {
|
|
13
|
+
const $ = c(13);
|
|
14
|
+
const { t } = useWords("quote");
|
|
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("claim");
|
|
24
|
+
$[2] = t;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else t1 = $[3];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Quote, {
|
|
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("after");
|
|
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
|
+
t3
|
|
50
|
+
] });
|
|
51
|
+
$[9] = t0;
|
|
52
|
+
$[10] = t2;
|
|
53
|
+
$[11] = t3;
|
|
54
|
+
$[12] = t4;
|
|
55
|
+
} else t4 = $[12];
|
|
56
|
+
return t4;
|
|
57
|
+
}
|
|
58
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Quote, Text } from \"@stealthscale/component-typography\";\n\nexport function Audit(props: Parameters<typeof Quote>[0]): ReactElement {\n const { t } = useWords(\"quote\");\n\n return (\n <Text>\n {t(\"before\")} <Quote {...props}>{t(\"claim\")}</Quote>\n {t(\"after\")}\n </Text>\n );\n}\n";
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/quote/quote.specimen.tsx
|
|
61
|
+
/**
|
|
62
|
+
* Catalogue page for the inline quotation.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* `scenesOf` generates one scene per recipe axis. The example renders the quotation inside a
|
|
66
|
+
* `Text` line, because an inline quotation is read against the surrounding text. The tone scene
|
|
67
|
+
* renders the inverted ink on `bg.inverted` through `grounded`. Every scene renders the example
|
|
68
|
+
* and shows it as its source. The words are keys under `quote` in
|
|
69
|
+
* `locales/en/specimen/quote.json`.
|
|
70
|
+
*/
|
|
71
|
+
var quote_specimen_default = specimen({
|
|
72
|
+
about: "quote.about",
|
|
73
|
+
id: "components/typography/quote",
|
|
74
|
+
imports: "import { Quote, Text } from \"@stealthscale/component-typography\";",
|
|
75
|
+
scenes: scenesOf(recipe, {
|
|
76
|
+
axes: { tone: { draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Audit, { ...props })) } },
|
|
77
|
+
draw: (props) => /* @__PURE__ */ jsx(Audit, { ...props }),
|
|
78
|
+
example: audit_example_exports,
|
|
79
|
+
namespace: "quote",
|
|
80
|
+
order: [
|
|
81
|
+
"marks",
|
|
82
|
+
"tone",
|
|
83
|
+
"motion"
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
86
|
+
title: "quote.title"
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
export { quote_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"QuoteProps": {"conditions": 284, "foreign": 1042}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"QuoteProps": [{"accepts": "\"auto\" | \"none\"", "fallback": "", "kind": "variant", "name": "marks", "refers": [], "required": false, "says": "Quotation marks."}, {"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,121 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { r as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { r as Span, 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, grounded, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/span/examples/path.example.tsx
|
|
8
|
+
var path_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Path: () => Path,
|
|
10
|
+
source: () => source$1
|
|
11
|
+
});
|
|
12
|
+
function Path(props) {
|
|
13
|
+
const $ = c(5);
|
|
14
|
+
const { t } = useWords("span");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("path");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
23
|
+
t1 = /* @__PURE__ */ jsx(Text, { children: /* @__PURE__ */ jsx(Span, {
|
|
24
|
+
...props,
|
|
25
|
+
children: t0
|
|
26
|
+
}) });
|
|
27
|
+
$[2] = props;
|
|
28
|
+
$[3] = t0;
|
|
29
|
+
$[4] = t1;
|
|
30
|
+
} else t1 = $[4];
|
|
31
|
+
return t1;
|
|
32
|
+
}
|
|
33
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Span, Text } from \"@stealthscale/component-typography\";\n\nexport function Path(props: Parameters<typeof Span>[0]): ReactElement {\n const { t } = useWords(\"span\");\n\n return (\n <Text>\n <Span {...props}>{t(\"path\")}</Span>\n </Text>\n );\n}\n";
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/span/examples/total.example.tsx
|
|
36
|
+
var total_example_exports = /* @__PURE__ */ __exportAll({
|
|
37
|
+
Total: () => Total,
|
|
38
|
+
source: () => source
|
|
39
|
+
});
|
|
40
|
+
function Total(props) {
|
|
41
|
+
const $ = c(10);
|
|
42
|
+
const { t } = useWords("span");
|
|
43
|
+
let t0;
|
|
44
|
+
if ($[0] !== t) {
|
|
45
|
+
t0 = t("due");
|
|
46
|
+
$[0] = t;
|
|
47
|
+
$[1] = t0;
|
|
48
|
+
} else t0 = $[1];
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[2] !== t) {
|
|
51
|
+
t1 = t("total");
|
|
52
|
+
$[2] = t;
|
|
53
|
+
$[3] = t1;
|
|
54
|
+
} else t1 = $[3];
|
|
55
|
+
let t2;
|
|
56
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
57
|
+
t2 = /* @__PURE__ */ jsx(Span, {
|
|
58
|
+
...props,
|
|
59
|
+
children: t1
|
|
60
|
+
});
|
|
61
|
+
$[4] = props;
|
|
62
|
+
$[5] = t1;
|
|
63
|
+
$[6] = t2;
|
|
64
|
+
} else t2 = $[6];
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[7] !== t0 || $[8] !== t2) {
|
|
67
|
+
t3 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
68
|
+
t0,
|
|
69
|
+
" ",
|
|
70
|
+
t2
|
|
71
|
+
] });
|
|
72
|
+
$[7] = t0;
|
|
73
|
+
$[8] = t2;
|
|
74
|
+
$[9] = t3;
|
|
75
|
+
} else t3 = $[9];
|
|
76
|
+
return t3;
|
|
77
|
+
}
|
|
78
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Span, Text } from \"@stealthscale/component-typography\";\n\nexport function Total(props: Parameters<typeof Span>[0]): ReactElement {\n const { t } = useWords(\"span\");\n\n return (\n <Text>\n {t(\"due\")} <Span {...props}>{t(\"total\")}</Span>\n </Text>\n );\n}\n";
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/span/span.specimen.tsx
|
|
81
|
+
/**
|
|
82
|
+
* Catalogue page for the span.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* `scenesOf` generates one scene per recipe axis. Every example renders the span inside a `Text`
|
|
86
|
+
* line. The tone scene crosses the weight axis and renders the inverted ink on `bg.inverted`
|
|
87
|
+
* through `grounded`. The truncation scene renders a log path in a 320px room. Every scene
|
|
88
|
+
* renders a component from `examples/` and shows that file as its source. The words are keys
|
|
89
|
+
* under `span` in `locales/en/specimen/span.json`.
|
|
90
|
+
*/
|
|
91
|
+
var span_specimen_default = specimen({
|
|
92
|
+
about: "span.about",
|
|
93
|
+
id: "components/typography/span",
|
|
94
|
+
imports: "import { Span, Text } from \"@stealthscale/component-typography\";",
|
|
95
|
+
scenes: scenesOf(recipe, {
|
|
96
|
+
axes: {
|
|
97
|
+
tone: {
|
|
98
|
+
across: "weight",
|
|
99
|
+
draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Total, { ...props }))
|
|
100
|
+
},
|
|
101
|
+
truncate: {
|
|
102
|
+
draw: (props) => /* @__PURE__ */ jsx(Room, {
|
|
103
|
+
size: "xs",
|
|
104
|
+
children: /* @__PURE__ */ jsx(Path, { ...props })
|
|
105
|
+
}),
|
|
106
|
+
example: path_example_exports
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
draw: (props) => /* @__PURE__ */ jsx(Total, { ...props }),
|
|
110
|
+
example: total_example_exports,
|
|
111
|
+
namespace: "span",
|
|
112
|
+
order: [
|
|
113
|
+
"tone",
|
|
114
|
+
"truncate",
|
|
115
|
+
"motion"
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
title: "span.title"
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { span_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"SpanProps": {"conditions": 284, "foreign": 1040}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"SpanProps": [{"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."}, {"accepts": "boolean", "fallback": "", "kind": "variant", "name": "truncate", "refers": [], "required": false, "says": "Cuts the run to one line that ends in an ellipsis."}, {"accepts": "Weight", "fallback": "", "kind": "variant", "name": "weight", "refers": ["kit.Weight"], "required": false, "says": "Font weight token."}], "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,80 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { n as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { n as Strong, 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/strong/examples/warning.example.tsx
|
|
8
|
+
var warning_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Warning: () => Warning,
|
|
10
|
+
source: () => source
|
|
11
|
+
});
|
|
12
|
+
function Warning(props) {
|
|
13
|
+
const $ = c(10);
|
|
14
|
+
const { t } = useWords("strong");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("subject");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== t) {
|
|
23
|
+
t1 = t("permanent");
|
|
24
|
+
$[2] = t;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else t1 = $[3];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Strong, {
|
|
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] !== t0 || $[8] !== t2) {
|
|
39
|
+
t3 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
40
|
+
t0,
|
|
41
|
+
" ",
|
|
42
|
+
t2
|
|
43
|
+
] });
|
|
44
|
+
$[7] = t0;
|
|
45
|
+
$[8] = t2;
|
|
46
|
+
$[9] = t3;
|
|
47
|
+
} else t3 = $[9];
|
|
48
|
+
return t3;
|
|
49
|
+
}
|
|
50
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Strong, Text } from \"@stealthscale/component-typography\";\n\nexport function Warning(props: Parameters<typeof Strong>[0]): ReactElement {\n const { t } = useWords(\"strong\");\n\n return (\n <Text>\n {t(\"subject\")} <Strong {...props}>{t(\"permanent\")}</Strong>\n </Text>\n );\n}\n";
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/strong/strong.specimen.tsx
|
|
53
|
+
/**
|
|
54
|
+
* Catalogue page for the strong element.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* `scenesOf` generates one scene per recipe axis. The example renders the strong run inside a
|
|
58
|
+
* `Text` line, because importance is relative to the surrounding text. The tone scene crosses the
|
|
59
|
+
* weight axis and renders the inverted ink on `bg.inverted` through `grounded`. Every scene
|
|
60
|
+
* renders the example and shows it as its source. The words are keys under `strong` in
|
|
61
|
+
* `locales/en/specimen/strong.json`.
|
|
62
|
+
*/
|
|
63
|
+
var strong_specimen_default = specimen({
|
|
64
|
+
about: "strong.about",
|
|
65
|
+
id: "components/typography/strong",
|
|
66
|
+
imports: "import { Strong, Text } from \"@stealthscale/component-typography\";",
|
|
67
|
+
scenes: scenesOf(recipe, {
|
|
68
|
+
axes: { tone: {
|
|
69
|
+
across: "weight",
|
|
70
|
+
draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Warning, { ...props }))
|
|
71
|
+
} },
|
|
72
|
+
draw: (props) => /* @__PURE__ */ jsx(Warning, { ...props }),
|
|
73
|
+
example: warning_example_exports,
|
|
74
|
+
namespace: "strong",
|
|
75
|
+
order: ["tone", "motion"]
|
|
76
|
+
}),
|
|
77
|
+
title: "strong.title"
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
export { strong_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"StrongProps": {"conditions": 284, "foreign": 1041}, "TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"StrongProps": [{"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."}, {"accepts": "\"bold\" | \"medium\" | \"semibold\"", "fallback": "", "kind": "variant", "name": "weight", "refers": [], "required": false, "says": "Font weight token: `medium`, `semibold` or `bold`."}], "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,143 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { t as recipe } from "../../recipes-DuvOpofr.js";
|
|
3
|
+
import { t as Text } 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/text/examples/payment.example.tsx
|
|
8
|
+
var payment_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Payment: () => Payment,
|
|
10
|
+
source: () => source$2
|
|
11
|
+
});
|
|
12
|
+
function Payment(props) {
|
|
13
|
+
const $ = c(5);
|
|
14
|
+
const { t } = useWords("text");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("payment");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
23
|
+
t1 = /* @__PURE__ */ jsx(Text, {
|
|
24
|
+
...props,
|
|
25
|
+
children: t0
|
|
26
|
+
});
|
|
27
|
+
$[2] = props;
|
|
28
|
+
$[3] = t0;
|
|
29
|
+
$[4] = t1;
|
|
30
|
+
} else t1 = $[4];
|
|
31
|
+
return t1;
|
|
32
|
+
}
|
|
33
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Text } from \"@stealthscale/component-typography\";\n\nexport function Payment(props: Parameters<typeof Text>[0]): ReactElement {\n const { t } = useWords(\"text\");\n\n return <Text {...props}>{t(\"payment\")}</Text>;\n}\n";
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/text/examples/release.example.tsx
|
|
36
|
+
var release_example_exports = /* @__PURE__ */ __exportAll({
|
|
37
|
+
Release: () => Release,
|
|
38
|
+
source: () => source$1
|
|
39
|
+
});
|
|
40
|
+
function Release(props) {
|
|
41
|
+
const $ = c(5);
|
|
42
|
+
const { t } = useWords("text");
|
|
43
|
+
let t0;
|
|
44
|
+
if ($[0] !== t) {
|
|
45
|
+
t0 = t("release");
|
|
46
|
+
$[0] = t;
|
|
47
|
+
$[1] = t0;
|
|
48
|
+
} else t0 = $[1];
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
51
|
+
t1 = /* @__PURE__ */ jsx(Text, {
|
|
52
|
+
...props,
|
|
53
|
+
children: t0
|
|
54
|
+
});
|
|
55
|
+
$[2] = props;
|
|
56
|
+
$[3] = t0;
|
|
57
|
+
$[4] = t1;
|
|
58
|
+
} else t1 = $[4];
|
|
59
|
+
return t1;
|
|
60
|
+
}
|
|
61
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Text } from \"@stealthscale/component-typography\";\n\nexport function Release(props: Parameters<typeof Text>[0]): ReactElement {\n const { t } = useWords(\"text\");\n\n return <Text {...props}>{t(\"release\")}</Text>;\n}\n";
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/text/examples/session.example.tsx
|
|
64
|
+
var session_example_exports = /* @__PURE__ */ __exportAll({
|
|
65
|
+
Session: () => Session,
|
|
66
|
+
source: () => source
|
|
67
|
+
});
|
|
68
|
+
function Session(props) {
|
|
69
|
+
const $ = c(5);
|
|
70
|
+
const { t } = useWords("text");
|
|
71
|
+
let t0;
|
|
72
|
+
if ($[0] !== t) {
|
|
73
|
+
t0 = t("session");
|
|
74
|
+
$[0] = t;
|
|
75
|
+
$[1] = t0;
|
|
76
|
+
} else t0 = $[1];
|
|
77
|
+
let t1;
|
|
78
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
79
|
+
t1 = /* @__PURE__ */ jsx(Text, {
|
|
80
|
+
...props,
|
|
81
|
+
children: t0
|
|
82
|
+
});
|
|
83
|
+
$[2] = props;
|
|
84
|
+
$[3] = t0;
|
|
85
|
+
$[4] = t1;
|
|
86
|
+
} else t1 = $[4];
|
|
87
|
+
return t1;
|
|
88
|
+
}
|
|
89
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Text } from \"@stealthscale/component-typography\";\n\nexport function Session(props: Parameters<typeof Text>[0]): ReactElement {\n const { t } = useWords(\"text\");\n\n return <Text {...props}>{t(\"session\")}</Text>;\n}\n";
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/text/text.specimen.tsx
|
|
92
|
+
/**
|
|
93
|
+
* Renders the release note in a 576px room.
|
|
94
|
+
*/
|
|
95
|
+
function columned(props) {
|
|
96
|
+
return /* @__PURE__ */ jsx(Room, {
|
|
97
|
+
size: "xl",
|
|
98
|
+
children: /* @__PURE__ */ jsx(Release, { ...props })
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
var text_specimen_default = specimen({
|
|
102
|
+
about: "text.about",
|
|
103
|
+
id: "components/typography/text",
|
|
104
|
+
imports: "import { Text } from \"@stealthscale/component-typography\";",
|
|
105
|
+
scenes: scenesOf(recipe, {
|
|
106
|
+
axes: {
|
|
107
|
+
align: {
|
|
108
|
+
direction: "column",
|
|
109
|
+
draw: columned,
|
|
110
|
+
example: release_example_exports
|
|
111
|
+
},
|
|
112
|
+
mask: {
|
|
113
|
+
direction: "column",
|
|
114
|
+
draw: columned,
|
|
115
|
+
example: release_example_exports
|
|
116
|
+
},
|
|
117
|
+
tone: {
|
|
118
|
+
across: "weight",
|
|
119
|
+
draw: (props) => grounded(props.tone, /* @__PURE__ */ jsx(Payment, { ...props })),
|
|
120
|
+
example: payment_example_exports
|
|
121
|
+
},
|
|
122
|
+
truncate: {
|
|
123
|
+
direction: "column",
|
|
124
|
+
draw: columned,
|
|
125
|
+
example: release_example_exports
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
draw: (props) => /* @__PURE__ */ jsx(Session, { ...props }),
|
|
129
|
+
example: session_example_exports,
|
|
130
|
+
namespace: "text",
|
|
131
|
+
order: [
|
|
132
|
+
"size",
|
|
133
|
+
"tone",
|
|
134
|
+
"align",
|
|
135
|
+
"truncate",
|
|
136
|
+
"motion",
|
|
137
|
+
"mask"
|
|
138
|
+
]
|
|
139
|
+
}),
|
|
140
|
+
title: "text.title"
|
|
141
|
+
});
|
|
142
|
+
//#endregion
|
|
143
|
+
export { text_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"TextProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"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": ""}]};
|