@stealthscale/component-navigation 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 -2304
- package/dist/pages/breadcrumb/breadcrumb.js +274 -0
- package/dist/pages/breadcrumb/breadcrumb.props.js +3 -0
- package/dist/pages/link/link.js +151 -0
- package/dist/pages/link/link.props.js +3 -0
- package/dist/pages/nav-list/nav-list.js +698 -0
- package/dist/pages/nav-list/nav-list.props.js +3 -0
- package/dist/pages/navigation-menu/navigation-menu.js +789 -0
- package/dist/pages/navigation-menu/navigation-menu.props.js +3 -0
- package/dist/pages/pages.json +73 -0
- package/dist/pages/pagination/pagination.js +859 -0
- package/dist/pages/pagination/pagination.props.js +3 -0
- package/dist/pages/toc/toc.js +254 -0
- package/dist/pages/toc/toc.props.js +3 -0
- package/dist/shared-Cz6A-cF-.js +2305 -0
- package/dist/theme.js +1 -1
- package/locales/en/specimen/breadcrumb.json +22 -0
- package/locales/en/specimen/link.json +19 -0
- package/locales/en/specimen/nav-list.json +43 -0
- package/locales/en/specimen/navigation-menu.json +104 -0
- package/locales/en/specimen/pagination.json +49 -0
- package/locales/en/specimen/toc.json +29 -0
- package/package.json +11 -10
- /package/dist/{recipe-BN0p1O6u.js → recipes-BN0p1O6u.js} +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { s as recipe } from "../../recipes-BN0p1O6u.js";
|
|
3
|
+
import { B as Separator, G as Ellipsis, H as List, K as CurrentLink, U as Link, V as Root, W as Item } from "../../shared-Cz6A-cF-.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { landmarked, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/breadcrumb/examples/collapsed.example.tsx
|
|
8
|
+
var collapsed_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Collapsed: () => Collapsed,
|
|
10
|
+
source: () => source$1
|
|
11
|
+
});
|
|
12
|
+
function Collapsed(props) {
|
|
13
|
+
const $ = c(24);
|
|
14
|
+
const { t } = useWords("breadcrumb");
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== t) {
|
|
17
|
+
t0 = t("label");
|
|
18
|
+
$[0] = t;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== t) {
|
|
23
|
+
t1 = t("home");
|
|
24
|
+
$[2] = t;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else t1 = $[3];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[4] !== t1) {
|
|
29
|
+
t2 = /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(Link, {
|
|
30
|
+
href: "#home",
|
|
31
|
+
children: t1
|
|
32
|
+
}) });
|
|
33
|
+
$[4] = t1;
|
|
34
|
+
$[5] = t2;
|
|
35
|
+
} else t2 = $[5];
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t3 = /* @__PURE__ */ jsx(Separator, { children: "/" });
|
|
39
|
+
$[6] = t3;
|
|
40
|
+
} else t3 = $[6];
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[7] !== t) {
|
|
43
|
+
t4 = t("dropped", { count: 4 });
|
|
44
|
+
$[7] = t;
|
|
45
|
+
$[8] = t4;
|
|
46
|
+
} else t4 = $[8];
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[9] !== t4) {
|
|
49
|
+
t5 = /* @__PURE__ */ jsx(Ellipsis, {
|
|
50
|
+
"aria-label": t4,
|
|
51
|
+
children: "…"
|
|
52
|
+
});
|
|
53
|
+
$[9] = t4;
|
|
54
|
+
$[10] = t5;
|
|
55
|
+
} else t5 = $[10];
|
|
56
|
+
let t6;
|
|
57
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
58
|
+
t6 = /* @__PURE__ */ jsx(Separator, { children: "/" });
|
|
59
|
+
$[11] = t6;
|
|
60
|
+
} else t6 = $[11];
|
|
61
|
+
let t7;
|
|
62
|
+
if ($[12] !== t) {
|
|
63
|
+
t7 = t("april");
|
|
64
|
+
$[12] = t;
|
|
65
|
+
$[13] = t7;
|
|
66
|
+
} else t7 = $[13];
|
|
67
|
+
let t8;
|
|
68
|
+
if ($[14] !== t7) {
|
|
69
|
+
t8 = /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(CurrentLink, { children: t7 }) });
|
|
70
|
+
$[14] = t7;
|
|
71
|
+
$[15] = t8;
|
|
72
|
+
} else t8 = $[15];
|
|
73
|
+
let t9;
|
|
74
|
+
if ($[16] !== t2 || $[17] !== t5 || $[18] !== t8) {
|
|
75
|
+
t9 = /* @__PURE__ */ jsxs(List, { children: [
|
|
76
|
+
t2,
|
|
77
|
+
t3,
|
|
78
|
+
t5,
|
|
79
|
+
t6,
|
|
80
|
+
t8
|
|
81
|
+
] });
|
|
82
|
+
$[16] = t2;
|
|
83
|
+
$[17] = t5;
|
|
84
|
+
$[18] = t8;
|
|
85
|
+
$[19] = t9;
|
|
86
|
+
} else t9 = $[19];
|
|
87
|
+
let t10;
|
|
88
|
+
if ($[20] !== props || $[21] !== t0 || $[22] !== t9) {
|
|
89
|
+
t10 = /* @__PURE__ */ jsx(Root, {
|
|
90
|
+
"aria-label": t0,
|
|
91
|
+
...props,
|
|
92
|
+
children: t9
|
|
93
|
+
});
|
|
94
|
+
$[20] = props;
|
|
95
|
+
$[21] = t0;
|
|
96
|
+
$[22] = t9;
|
|
97
|
+
$[23] = t10;
|
|
98
|
+
} else t10 = $[23];
|
|
99
|
+
return t10;
|
|
100
|
+
}
|
|
101
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Breadcrumb } from \"@stealthscale/component-navigation\";\n\nexport function Collapsed(props: Breadcrumb.RootProps): ReactElement {\n const { t } = useWords(\"breadcrumb\");\n\n return (\n <Breadcrumb.Root aria-label={t(\"label\")} {...props}>\n <Breadcrumb.List>\n <Breadcrumb.Item>\n <Breadcrumb.Link href=\"#home\">{t(\"home\")}</Breadcrumb.Link>\n </Breadcrumb.Item>\n <Breadcrumb.Separator>/</Breadcrumb.Separator>\n <Breadcrumb.Ellipsis aria-label={t(\"dropped\", { count: 4 })}>…</Breadcrumb.Ellipsis>\n <Breadcrumb.Separator>/</Breadcrumb.Separator>\n <Breadcrumb.Item>\n <Breadcrumb.CurrentLink>{t(\"april\")}</Breadcrumb.CurrentLink>\n </Breadcrumb.Item>\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n}\n";
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/breadcrumb/examples/trail.example.tsx
|
|
104
|
+
var trail_example_exports = /* @__PURE__ */ __exportAll({
|
|
105
|
+
Trail: () => Trail,
|
|
106
|
+
source: () => source
|
|
107
|
+
});
|
|
108
|
+
function Trail(props) {
|
|
109
|
+
const $ = c(24);
|
|
110
|
+
const { t } = useWords("breadcrumb");
|
|
111
|
+
let t0;
|
|
112
|
+
if ($[0] !== t) {
|
|
113
|
+
t0 = t("label");
|
|
114
|
+
$[0] = t;
|
|
115
|
+
$[1] = t0;
|
|
116
|
+
} else t0 = $[1];
|
|
117
|
+
let t1;
|
|
118
|
+
if ($[2] !== t) {
|
|
119
|
+
t1 = t("home");
|
|
120
|
+
$[2] = t;
|
|
121
|
+
$[3] = t1;
|
|
122
|
+
} else t1 = $[3];
|
|
123
|
+
let t2;
|
|
124
|
+
if ($[4] !== t1) {
|
|
125
|
+
t2 = /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(Link, {
|
|
126
|
+
href: "#home",
|
|
127
|
+
children: t1
|
|
128
|
+
}) });
|
|
129
|
+
$[4] = t1;
|
|
130
|
+
$[5] = t2;
|
|
131
|
+
} else t2 = $[5];
|
|
132
|
+
let t3;
|
|
133
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
134
|
+
t3 = /* @__PURE__ */ jsx(Separator, { children: "/" });
|
|
135
|
+
$[6] = t3;
|
|
136
|
+
} else t3 = $[6];
|
|
137
|
+
let t4;
|
|
138
|
+
if ($[7] !== t) {
|
|
139
|
+
t4 = t("invoices");
|
|
140
|
+
$[7] = t;
|
|
141
|
+
$[8] = t4;
|
|
142
|
+
} else t4 = $[8];
|
|
143
|
+
let t5;
|
|
144
|
+
if ($[9] !== t4) {
|
|
145
|
+
t5 = /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(Link, {
|
|
146
|
+
href: "#invoices",
|
|
147
|
+
children: t4
|
|
148
|
+
}) });
|
|
149
|
+
$[9] = t4;
|
|
150
|
+
$[10] = t5;
|
|
151
|
+
} else t5 = $[10];
|
|
152
|
+
let t6;
|
|
153
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t6 = /* @__PURE__ */ jsx(Separator, { children: "/" });
|
|
155
|
+
$[11] = t6;
|
|
156
|
+
} else t6 = $[11];
|
|
157
|
+
let t7;
|
|
158
|
+
if ($[12] !== t) {
|
|
159
|
+
t7 = t("april");
|
|
160
|
+
$[12] = t;
|
|
161
|
+
$[13] = t7;
|
|
162
|
+
} else t7 = $[13];
|
|
163
|
+
let t8;
|
|
164
|
+
if ($[14] !== t7) {
|
|
165
|
+
t8 = /* @__PURE__ */ jsx(Item, { children: /* @__PURE__ */ jsx(CurrentLink, { children: t7 }) });
|
|
166
|
+
$[14] = t7;
|
|
167
|
+
$[15] = t8;
|
|
168
|
+
} else t8 = $[15];
|
|
169
|
+
let t9;
|
|
170
|
+
if ($[16] !== t2 || $[17] !== t5 || $[18] !== t8) {
|
|
171
|
+
t9 = /* @__PURE__ */ jsxs(List, { children: [
|
|
172
|
+
t2,
|
|
173
|
+
t3,
|
|
174
|
+
t5,
|
|
175
|
+
t6,
|
|
176
|
+
t8
|
|
177
|
+
] });
|
|
178
|
+
$[16] = t2;
|
|
179
|
+
$[17] = t5;
|
|
180
|
+
$[18] = t8;
|
|
181
|
+
$[19] = t9;
|
|
182
|
+
} else t9 = $[19];
|
|
183
|
+
let t10;
|
|
184
|
+
if ($[20] !== props || $[21] !== t0 || $[22] !== t9) {
|
|
185
|
+
t10 = /* @__PURE__ */ jsx(Root, {
|
|
186
|
+
"aria-label": t0,
|
|
187
|
+
...props,
|
|
188
|
+
children: t9
|
|
189
|
+
});
|
|
190
|
+
$[20] = props;
|
|
191
|
+
$[21] = t0;
|
|
192
|
+
$[22] = t9;
|
|
193
|
+
$[23] = t10;
|
|
194
|
+
} else t10 = $[23];
|
|
195
|
+
return t10;
|
|
196
|
+
}
|
|
197
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Breadcrumb } from \"@stealthscale/component-navigation\";\n\nexport function Trail(props: Breadcrumb.RootProps): ReactElement {\n const { t } = useWords(\"breadcrumb\");\n\n return (\n <Breadcrumb.Root aria-label={t(\"label\")} {...props}>\n <Breadcrumb.List>\n <Breadcrumb.Item>\n <Breadcrumb.Link href=\"#home\">{t(\"home\")}</Breadcrumb.Link>\n </Breadcrumb.Item>\n <Breadcrumb.Separator>/</Breadcrumb.Separator>\n <Breadcrumb.Item>\n <Breadcrumb.Link href=\"#invoices\">{t(\"invoices\")}</Breadcrumb.Link>\n </Breadcrumb.Item>\n <Breadcrumb.Separator>/</Breadcrumb.Separator>\n <Breadcrumb.Item>\n <Breadcrumb.CurrentLink>{t(\"april\")}</Breadcrumb.CurrentLink>\n </Breadcrumb.Item>\n </Breadcrumb.List>\n </Breadcrumb.Root>\n );\n}\n";
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/breadcrumb/breadcrumb.specimen.tsx
|
|
200
|
+
/**
|
|
201
|
+
* Renders the trail example with a landmark name that includes the cell's props.
|
|
202
|
+
*
|
|
203
|
+
* @remarks
|
|
204
|
+
* Every cell renders a `nav`, and the page's eight trails with one name fail axe
|
|
205
|
+
* `landmark-unique`. The name is set here, so the example's source keeps its single label.
|
|
206
|
+
*/
|
|
207
|
+
function Labelled(props) {
|
|
208
|
+
const $ = c(6);
|
|
209
|
+
const { t } = useWords("breadcrumb");
|
|
210
|
+
let t0;
|
|
211
|
+
if ($[0] !== props || $[1] !== t) {
|
|
212
|
+
t0 = landmarked(t("label"), props);
|
|
213
|
+
$[0] = props;
|
|
214
|
+
$[1] = t;
|
|
215
|
+
$[2] = t0;
|
|
216
|
+
} else t0 = $[2];
|
|
217
|
+
let t1;
|
|
218
|
+
if ($[3] !== props || $[4] !== t0) {
|
|
219
|
+
t1 = /* @__PURE__ */ jsx(Trail, {
|
|
220
|
+
...props,
|
|
221
|
+
"aria-label": t0
|
|
222
|
+
});
|
|
223
|
+
$[3] = props;
|
|
224
|
+
$[4] = t0;
|
|
225
|
+
$[5] = t1;
|
|
226
|
+
} else t1 = $[5];
|
|
227
|
+
return t1;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Renders the collapsed example with a landmark name apart from the catalogue's own breadcrumb.
|
|
231
|
+
*/
|
|
232
|
+
function Shortened() {
|
|
233
|
+
const $ = c(4);
|
|
234
|
+
const { t } = useWords("breadcrumb");
|
|
235
|
+
let t0;
|
|
236
|
+
if ($[0] !== t) {
|
|
237
|
+
t0 = t("shortened");
|
|
238
|
+
$[0] = t;
|
|
239
|
+
$[1] = t0;
|
|
240
|
+
} else t0 = $[1];
|
|
241
|
+
let t1;
|
|
242
|
+
if ($[2] !== t0) {
|
|
243
|
+
t1 = /* @__PURE__ */ jsx(Collapsed, { "aria-label": t0 });
|
|
244
|
+
$[2] = t0;
|
|
245
|
+
$[3] = t1;
|
|
246
|
+
} else t1 = $[3];
|
|
247
|
+
return t1;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Hand-written scene for a trail with its middle crumbs replaced by an ellipsis.
|
|
251
|
+
*/
|
|
252
|
+
const shortened = {
|
|
253
|
+
about: "breadcrumb.collapsed.about",
|
|
254
|
+
draw: Shortened,
|
|
255
|
+
example: collapsed_example_exports,
|
|
256
|
+
title: "breadcrumb.collapsed.title"
|
|
257
|
+
};
|
|
258
|
+
var breadcrumb_specimen_default = specimen({
|
|
259
|
+
about: "breadcrumb.about",
|
|
260
|
+
id: "components/navigation/breadcrumb",
|
|
261
|
+
imports: "import { Breadcrumb } from \"@stealthscale/component-navigation\";",
|
|
262
|
+
scenes: [...scenesOf(recipe, {
|
|
263
|
+
axes: {
|
|
264
|
+
size: { direction: "column" },
|
|
265
|
+
variant: { direction: "column" }
|
|
266
|
+
},
|
|
267
|
+
draw: (props) => /* @__PURE__ */ jsx(Labelled, { ...props }),
|
|
268
|
+
example: trail_example_exports,
|
|
269
|
+
namespace: "breadcrumb"
|
|
270
|
+
}), shortened],
|
|
271
|
+
title: "breadcrumb.title"
|
|
272
|
+
});
|
|
273
|
+
//#endregion
|
|
274
|
+
export { breadcrumb_specimen_default as default, shortened };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"CurrentLinkProps": {"conditions": 284, "foreign": 1041}, "EllipsisProps": {"conditions": 284, "foreign": 1042}, "ItemProps": {"conditions": 284, "foreign": 1042}, "LinkProps": {"conditions": 284, "foreign": 1049}, "ListProps": {"conditions": 284, "foreign": 1043}, "RootProps": {"conditions": 284, "foreign": 1041}, "SeparatorProps": {"conditions": 284, "foreign": 1042}};
|
|
2
|
+
export const parts = {"CurrentLinkProps": [], "EllipsisProps": [], "ItemProps": [], "LinkProps": [], "ListProps": [], "RootProps": [{"accepts": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "The text style of the root and the gap between list rows."}, {"accepts": "\"plain\" | \"underline\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Whether the links show an underline at rest or only on hover."}], "SeparatorProps": []};
|
|
3
|
+
export const shapes = {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { o as recipe } from "../../recipes-BN0p1O6u.js";
|
|
3
|
+
import { L as Link } from "../../shared-Cz6A-cF-.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
|
+
import { Text } from "@stealthscale/component-typography";
|
|
8
|
+
//#region src/link/examples/footnote.example.tsx
|
|
9
|
+
var footnote_example_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Footnote: () => Footnote,
|
|
11
|
+
source: () => source$1
|
|
12
|
+
});
|
|
13
|
+
function Footnote(props) {
|
|
14
|
+
const $ = c(13);
|
|
15
|
+
const { t } = useWords("link");
|
|
16
|
+
let t0;
|
|
17
|
+
if ($[0] !== t) {
|
|
18
|
+
t0 = t("before");
|
|
19
|
+
$[0] = t;
|
|
20
|
+
$[1] = t0;
|
|
21
|
+
} else t0 = $[1];
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[2] !== t) {
|
|
24
|
+
t1 = t("terms");
|
|
25
|
+
$[2] = t;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
} else t1 = $[3];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsx(Link, {
|
|
31
|
+
href: "#terms",
|
|
32
|
+
...props,
|
|
33
|
+
children: t1
|
|
34
|
+
});
|
|
35
|
+
$[4] = props;
|
|
36
|
+
$[5] = t1;
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
} else t2 = $[6];
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[7] !== t) {
|
|
41
|
+
t3 = t("after");
|
|
42
|
+
$[7] = t;
|
|
43
|
+
$[8] = t3;
|
|
44
|
+
} else t3 = $[8];
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[9] !== t0 || $[10] !== t2 || $[11] !== t3) {
|
|
47
|
+
t4 = /* @__PURE__ */ jsxs(Text, {
|
|
48
|
+
tone: "muted",
|
|
49
|
+
children: [
|
|
50
|
+
t0,
|
|
51
|
+
" ",
|
|
52
|
+
t2,
|
|
53
|
+
t3
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
$[9] = t0;
|
|
57
|
+
$[10] = t2;
|
|
58
|
+
$[11] = t3;
|
|
59
|
+
$[12] = t4;
|
|
60
|
+
} else t4 = $[12];
|
|
61
|
+
return t4;
|
|
62
|
+
}
|
|
63
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Link } from \"@stealthscale/component-navigation\";\n\nexport function Footnote(props: Parameters<typeof Link>[0]): ReactElement {\n const { t } = useWords(\"link\");\n\n return (\n <Text tone=\"muted\">\n {t(\"before\")}{\" \"}\n <Link href=\"#terms\" {...props}>\n {t(\"terms\")}\n </Link>\n {t(\"after\")}\n </Text>\n );\n}\n";
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/link/examples/terms.example.tsx
|
|
66
|
+
var terms_example_exports = /* @__PURE__ */ __exportAll({
|
|
67
|
+
Terms: () => Terms,
|
|
68
|
+
source: () => source
|
|
69
|
+
});
|
|
70
|
+
function Terms(props) {
|
|
71
|
+
const $ = c(13);
|
|
72
|
+
const { t } = useWords("link");
|
|
73
|
+
let t0;
|
|
74
|
+
if ($[0] !== t) {
|
|
75
|
+
t0 = t("before");
|
|
76
|
+
$[0] = t;
|
|
77
|
+
$[1] = t0;
|
|
78
|
+
} else t0 = $[1];
|
|
79
|
+
let t1;
|
|
80
|
+
if ($[2] !== t) {
|
|
81
|
+
t1 = t("terms");
|
|
82
|
+
$[2] = t;
|
|
83
|
+
$[3] = t1;
|
|
84
|
+
} else t1 = $[3];
|
|
85
|
+
let t2;
|
|
86
|
+
if ($[4] !== props || $[5] !== t1) {
|
|
87
|
+
t2 = /* @__PURE__ */ jsx(Link, {
|
|
88
|
+
href: "#terms",
|
|
89
|
+
...props,
|
|
90
|
+
children: t1
|
|
91
|
+
});
|
|
92
|
+
$[4] = props;
|
|
93
|
+
$[5] = t1;
|
|
94
|
+
$[6] = t2;
|
|
95
|
+
} else t2 = $[6];
|
|
96
|
+
let t3;
|
|
97
|
+
if ($[7] !== t) {
|
|
98
|
+
t3 = t("after");
|
|
99
|
+
$[7] = t;
|
|
100
|
+
$[8] = t3;
|
|
101
|
+
} else t3 = $[8];
|
|
102
|
+
let t4;
|
|
103
|
+
if ($[9] !== t0 || $[10] !== t2 || $[11] !== t3) {
|
|
104
|
+
t4 = /* @__PURE__ */ jsxs(Text, { children: [
|
|
105
|
+
t0,
|
|
106
|
+
" ",
|
|
107
|
+
t2,
|
|
108
|
+
t3
|
|
109
|
+
] });
|
|
110
|
+
$[9] = t0;
|
|
111
|
+
$[10] = t2;
|
|
112
|
+
$[11] = t3;
|
|
113
|
+
$[12] = t4;
|
|
114
|
+
} else t4 = $[12];
|
|
115
|
+
return t4;
|
|
116
|
+
}
|
|
117
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Link } from \"@stealthscale/component-navigation\";\n\nexport function Terms(props: Parameters<typeof Link>[0]): ReactElement {\n const { t } = useWords(\"link\");\n\n return (\n <Text>\n {t(\"before\")}{\" \"}\n <Link href=\"#terms\" {...props}>\n {t(\"terms\")}\n </Link>\n {t(\"after\")}\n </Text>\n );\n}\n";
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/link/link.specimen.tsx
|
|
120
|
+
/**
|
|
121
|
+
* Catalogue page for the link.
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* `scenesOf` generates one scene per recipe axis. Every scene renders a component from
|
|
125
|
+
* `examples/` and shows that file as its source. Each link stands inside a sentence, because a
|
|
126
|
+
* reader finds a link by its contrast with the text around it. The inherit scene sets the
|
|
127
|
+
* sentence in muted text, because a link that inherits body text is identical to one that
|
|
128
|
+
* inherits nothing. The words are keys under `link` in `locales/en/specimen/link.json`.
|
|
129
|
+
*/
|
|
130
|
+
var link_specimen_default = specimen({
|
|
131
|
+
about: "link.about",
|
|
132
|
+
id: "components/navigation/link",
|
|
133
|
+
imports: "import { Link } from \"@stealthscale/component-navigation\";",
|
|
134
|
+
scenes: scenesOf(recipe, {
|
|
135
|
+
axes: { inherit: {
|
|
136
|
+
draw: (props) => /* @__PURE__ */ jsx(Footnote, { ...props }),
|
|
137
|
+
example: footnote_example_exports
|
|
138
|
+
} },
|
|
139
|
+
draw: (props) => /* @__PURE__ */ jsx(Terms, { ...props }),
|
|
140
|
+
example: terms_example_exports,
|
|
141
|
+
namespace: "link",
|
|
142
|
+
order: [
|
|
143
|
+
"variant",
|
|
144
|
+
"palette",
|
|
145
|
+
"inherit"
|
|
146
|
+
]
|
|
147
|
+
}),
|
|
148
|
+
title: "link.title"
|
|
149
|
+
});
|
|
150
|
+
//#endregion
|
|
151
|
+
export { link_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"LinkProps": {"conditions": 284, "foreign": 1049}};
|
|
2
|
+
export const parts = {"LinkProps": [{"accepts": "boolean", "fallback": "", "kind": "variant", "name": "inherit", "refers": [], "required": false, "says": "Whether the link inherits the text color in place of the link ink."}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "The semantic palette the ink and the focus ring read from."}, {"accepts": "\"plain\" | \"underline\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Whether the underline shows at rest or only on hover."}]};
|
|
3
|
+
export const shapes = {};
|