@stealthscale/component-screen 0.2.1 → 0.2.3

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.
Files changed (44) hide show
  1. package/dist/cyclonedx/bom.json +1 -1
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.js +1 -8216
  4. package/dist/pages/action-bar/action-bar.js +471 -0
  5. package/dist/pages/action-bar/action-bar.props.js +3 -0
  6. package/dist/pages/app-shell/app-shell.js +4899 -0
  7. package/dist/pages/app-shell/app-shell.props.js +3 -0
  8. package/dist/pages/floating-panel/floating-panel.js +995 -0
  9. package/dist/pages/floating-panel/floating-panel.props.js +3 -0
  10. package/dist/pages/locale-switcher/locale-switcher.js +180 -0
  11. package/dist/pages/locale-switcher/locale-switcher.props.js +3 -0
  12. package/dist/pages/page/page.js +2308 -0
  13. package/dist/pages/page/page.props.js +3 -0
  14. package/dist/pages/pages.json +123 -0
  15. package/dist/pages/section/section.js +1241 -0
  16. package/dist/pages/section/section.props.js +3 -0
  17. package/dist/pages/sidebar/sidebar.js +1743 -0
  18. package/dist/pages/sidebar/sidebar.props.js +3 -0
  19. package/dist/pages/splitter/splitter.js +1563 -0
  20. package/dist/pages/splitter/splitter.props.js +3 -0
  21. package/dist/pages/switcher/switcher.js +900 -0
  22. package/dist/pages/switcher/switcher.props.js +3 -0
  23. package/dist/pages/theme-switcher/theme-switcher.js +180 -0
  24. package/dist/pages/theme-switcher/theme-switcher.props.js +3 -0
  25. package/dist/pages/toolbar/toolbar.js +1045 -0
  26. package/dist/pages/toolbar/toolbar.props.js +3 -0
  27. package/dist/{recipe-sZAQY6Kq.js → recipes-Cmy1leBm.js} +312 -30
  28. package/dist/shared-DxlFabHA.js +9547 -0
  29. package/dist/shell.js +1 -165
  30. package/dist/theme.js +3 -4
  31. package/locales/en/specimen/action-bar.json +46 -0
  32. package/locales/en/specimen/app-shell.json +288 -0
  33. package/locales/en/specimen/floating-panel.json +70 -0
  34. package/locales/en/specimen/locale-switcher.json +15 -0
  35. package/locales/en/specimen/page.json +198 -0
  36. package/locales/en/specimen/section.json +91 -0
  37. package/locales/en/specimen/sidebar.json +87 -0
  38. package/locales/en/specimen/splitter.json +93 -0
  39. package/locales/en/specimen/switcher.json +61 -0
  40. package/locales/en/specimen/theme-switcher.json +15 -0
  41. package/locales/en/specimen/toolbar.json +80 -0
  42. package/package.json +25 -24
  43. package/dist/recipe-DRMsitrw.js +0 -283
  44. package/dist/root-qEh4u7y5.js +0 -1182
@@ -0,0 +1,1743 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { i as recipe } from "../../recipes-Cmy1leBm.js";
3
+ import { A as Nav, At as Trigger, Bt as Body, D as Separator, F as Footer, I as Empty, It as Navbar, L as Content, Lt as Main, M as NavHeading, N as NavAction, Nt as Root$2, O as Search, P as Header, Rt as Header$1, X as Title, ct as Description, et as Root$1, j as NavLabel, k as Root, ot as Header$2, zt as Footer$1 } from "../../shared-DxlFabHA.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { Button, ButtonPropsProvider } from "@stealthscale/component-actions";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Fragment as Fragment$1, useEffect, useId, useState } from "react";
8
+ import { NavList } from "@stealthscale/component-navigation";
9
+ import { Stack } from "@stealthscale/component-layout";
10
+ import { Room, Sample, Screen, scenesOf, specimen, useWords } from "@stealthscale/specimen";
11
+ import { ArchiveIcon, BoxIcon, Building2Icon, ChartColumnIcon, CompassIcon, CreditCardIcon, FileTextIcon, FolderIcon, GitBranchIcon, HouseIcon, LayoutDashboardIcon, MenuIcon, PaletteIcon, PlayIcon, PlusIcon, ReceiptIcon, SearchIcon, SettingsIcon, ShieldCheckIcon, SquareIcon, TrendingUpIcon, UserCheckIcon, UserIcon, UsersIcon, XIcon } from "lucide-react";
12
+ import { Text } from "@stealthscale/component-typography";
13
+ //#region src/sidebar/examples/console.example.tsx
14
+ var console_example_exports = /* @__PURE__ */ __exportAll({
15
+ Console: () => Console,
16
+ source: () => source$7
17
+ });
18
+ const BLOCKS = [{
19
+ label: "platform",
20
+ rows: [
21
+ ["overview", HouseIcon],
22
+ ["runs", PlayIcon],
23
+ ["pipelines", GitBranchIcon],
24
+ ["approvals", ShieldCheckIcon]
25
+ ]
26
+ }, {
27
+ label: "projects",
28
+ rows: [
29
+ "billing",
30
+ "checkout",
31
+ "onboarding",
32
+ "catalog",
33
+ "warehouse"
34
+ ].map((project) => [project, FolderIcon])
35
+ }];
36
+ function Console(props) {
37
+ const $ = c(48);
38
+ const { t } = useWords("sidebar");
39
+ let t0;
40
+ if ($[0] !== t) {
41
+ t0 = t("ledger");
42
+ $[0] = t;
43
+ $[1] = t0;
44
+ } else t0 = $[1];
45
+ let t1;
46
+ if ($[2] !== t) {
47
+ t1 = t("production");
48
+ $[2] = t;
49
+ $[3] = t1;
50
+ } else t1 = $[3];
51
+ let t2;
52
+ if ($[4] !== t1) {
53
+ t2 = /* @__PURE__ */ jsx(Text, {
54
+ as: "span",
55
+ size: "sm",
56
+ tone: "subtle",
57
+ weight: "normal",
58
+ children: t1
59
+ });
60
+ $[4] = t1;
61
+ $[5] = t2;
62
+ } else t2 = $[5];
63
+ let t3;
64
+ if ($[6] !== t0 || $[7] !== t2) {
65
+ t3 = /* @__PURE__ */ jsxs(Text, {
66
+ as: "p",
67
+ size: "sm",
68
+ truncate: true,
69
+ weight: "medium",
70
+ children: [
71
+ t0,
72
+ " ",
73
+ t2
74
+ ]
75
+ });
76
+ $[6] = t0;
77
+ $[7] = t2;
78
+ $[8] = t3;
79
+ } else t3 = $[8];
80
+ let t4;
81
+ if ($[9] !== t) {
82
+ t4 = t("findPage");
83
+ $[9] = t;
84
+ $[10] = t4;
85
+ } else t4 = $[10];
86
+ let t5;
87
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
88
+ t5 = /* @__PURE__ */ jsx(XIcon, {});
89
+ $[11] = t5;
90
+ } else t5 = $[11];
91
+ let t6;
92
+ if ($[12] !== t) {
93
+ t6 = t("clearFilter");
94
+ $[12] = t;
95
+ $[13] = t6;
96
+ } else t6 = $[13];
97
+ let t7;
98
+ if ($[14] !== t) {
99
+ t7 = t("filter");
100
+ $[14] = t;
101
+ $[15] = t7;
102
+ } else t7 = $[15];
103
+ let t8;
104
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
105
+ t8 = /* @__PURE__ */ jsx(SearchIcon, {});
106
+ $[16] = t8;
107
+ } else t8 = $[16];
108
+ let t9;
109
+ if ($[17] !== t4 || $[18] !== t6 || $[19] !== t7) {
110
+ t9 = /* @__PURE__ */ jsx(Search, {
111
+ "aria-label": t4,
112
+ clearIndicator: t5,
113
+ clearLabel: t6,
114
+ placeholder: t7,
115
+ searchIndicator: t8,
116
+ shortcut: "k"
117
+ });
118
+ $[17] = t4;
119
+ $[18] = t6;
120
+ $[19] = t7;
121
+ $[20] = t9;
122
+ } else t9 = $[20];
123
+ let t10;
124
+ if ($[21] !== t3 || $[22] !== t9) {
125
+ t10 = /* @__PURE__ */ jsxs(Header, { children: [t3, t9] });
126
+ $[21] = t3;
127
+ $[22] = t9;
128
+ $[23] = t10;
129
+ } else t10 = $[23];
130
+ let t11;
131
+ if ($[24] !== t) {
132
+ t11 = BLOCKS.map((t12, at) => {
133
+ const { label, rows } = t12;
134
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [at > 0 && /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Nav, { children: [
135
+ /* @__PURE__ */ jsx(NavLabel, {
136
+ as: "h3",
137
+ children: t(label)
138
+ }),
139
+ label === "projects" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(NavAction, {
140
+ "aria-label": t("newProject"),
141
+ children: /* @__PURE__ */ jsx(PlusIcon, {})
142
+ }), /* @__PURE__ */ jsx(Search, {
143
+ "aria-label": t("filterProjects"),
144
+ clearIndicator: /* @__PURE__ */ jsx(XIcon, {}),
145
+ clearLabel: t("clearFilter"),
146
+ placeholder: t("filterProjectsHint")
147
+ })] }),
148
+ /* @__PURE__ */ jsx(NavList.Root, { children: rows.map((t13) => {
149
+ const [row, Glyph] = t13;
150
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
151
+ "aria-current": row === "runs" ? "page" : void 0,
152
+ href: `#${row}`,
153
+ tooltip: t(row),
154
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(row) })]
155
+ }) }, row);
156
+ }) }),
157
+ /* @__PURE__ */ jsx(Empty, { children: t(`${label}Empty`) })
158
+ ] })] }, label);
159
+ });
160
+ $[24] = t;
161
+ $[25] = t11;
162
+ } else t11 = $[25];
163
+ let t12;
164
+ if ($[26] !== t11) {
165
+ t12 = /* @__PURE__ */ jsx(Content, { children: t11 });
166
+ $[26] = t11;
167
+ $[27] = t12;
168
+ } else t12 = $[27];
169
+ let t13;
170
+ if ($[28] !== t) {
171
+ t13 = t("account");
172
+ $[28] = t;
173
+ $[29] = t13;
174
+ } else t13 = $[29];
175
+ let t14;
176
+ if ($[30] !== t) {
177
+ t14 = t("person");
178
+ $[30] = t;
179
+ $[31] = t14;
180
+ } else t14 = $[31];
181
+ let t15;
182
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
183
+ t15 = /* @__PURE__ */ jsx(UserIcon, {});
184
+ $[32] = t15;
185
+ } else t15 = $[32];
186
+ let t16;
187
+ if ($[33] !== t) {
188
+ t16 = t("person");
189
+ $[33] = t;
190
+ $[34] = t16;
191
+ } else t16 = $[34];
192
+ let t17;
193
+ if ($[35] !== t16) {
194
+ t17 = /* @__PURE__ */ jsx("span", { children: t16 });
195
+ $[35] = t16;
196
+ $[36] = t17;
197
+ } else t17 = $[36];
198
+ let t18;
199
+ if ($[37] !== t14 || $[38] !== t17) {
200
+ t18 = /* @__PURE__ */ jsx(NavList.Root, { children: /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
201
+ href: "#account",
202
+ tooltip: t14,
203
+ children: [t15, t17]
204
+ }) }) });
205
+ $[37] = t14;
206
+ $[38] = t17;
207
+ $[39] = t18;
208
+ } else t18 = $[39];
209
+ let t19;
210
+ if ($[40] !== t13 || $[41] !== t18) {
211
+ t19 = /* @__PURE__ */ jsx(Footer, { children: /* @__PURE__ */ jsx(Nav, {
212
+ "aria-label": t13,
213
+ children: t18
214
+ }) });
215
+ $[40] = t13;
216
+ $[41] = t18;
217
+ $[42] = t19;
218
+ } else t19 = $[42];
219
+ let t20;
220
+ if ($[43] !== props || $[44] !== t10 || $[45] !== t12 || $[46] !== t19) {
221
+ t20 = /* @__PURE__ */ jsxs(Root, {
222
+ ...props,
223
+ children: [
224
+ t10,
225
+ t12,
226
+ t19
227
+ ]
228
+ });
229
+ $[43] = props;
230
+ $[44] = t10;
231
+ $[45] = t12;
232
+ $[46] = t19;
233
+ $[47] = t20;
234
+ } else t20 = $[47];
235
+ return t20;
236
+ }
237
+ const source$7 = "import { Fragment, type ReactElement } from \"react\";\n\nimport {\n FolderIcon,\n GitBranchIcon,\n HouseIcon,\n PlayIcon,\n PlusIcon,\n SearchIcon,\n ShieldCheckIcon,\n UserIcon,\n XIcon,\n} from \"lucide-react\";\n\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nconst BLOCKS = [\n {\n label: \"platform\",\n rows: [\n [\"overview\", HouseIcon],\n [\"runs\", PlayIcon],\n [\"pipelines\", GitBranchIcon],\n [\"approvals\", ShieldCheckIcon],\n ],\n },\n {\n label: \"projects\",\n rows: [\"billing\", \"checkout\", \"onboarding\", \"catalog\", \"warehouse\"].map(\n (project) => [project, FolderIcon] as const,\n ),\n },\n] as const;\n\nexport function Console(props: Sidebar.RootProps): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <Sidebar.Root {...props}>\n <Sidebar.Header>\n <Text as=\"p\" size=\"sm\" truncate weight=\"medium\">\n {t(\"ledger\")}{\" \"}\n <Text as=\"span\" size=\"sm\" tone=\"subtle\" weight=\"normal\">\n {t(\"production\")}\n </Text>\n </Text>\n <Sidebar.Search\n aria-label={t(\"findPage\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"clearFilter\")}\n placeholder={t(\"filter\")}\n searchIndicator={<SearchIcon />}\n shortcut=\"k\"\n />\n </Sidebar.Header>\n <Sidebar.Content>\n {BLOCKS.map(({ label, rows }, at) => (\n <Fragment key={label}>\n {at > 0 && <Sidebar.Separator />}\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(label)}</Sidebar.NavLabel>\n {label === \"projects\" && (\n <>\n <Sidebar.NavAction aria-label={t(\"newProject\")}>\n <PlusIcon />\n </Sidebar.NavAction>\n <Sidebar.Search\n aria-label={t(\"filterProjects\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"clearFilter\")}\n placeholder={t(\"filterProjectsHint\")}\n />\n </>\n )}\n <NavList.Root>\n {rows.map(([row, Glyph]) => (\n <NavList.Item key={row}>\n <NavList.Link\n aria-current={row === \"runs\" ? \"page\" : undefined}\n href={`#${row}`}\n tooltip={t(row)}\n >\n <Glyph />\n <span>{t(row)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n <Sidebar.Empty>{t(`${label}Empty`)}</Sidebar.Empty>\n </Sidebar.Nav>\n </Fragment>\n ))}\n </Sidebar.Content>\n <Sidebar.Footer>\n <Sidebar.Nav aria-label={t(\"account\")}>\n <NavList.Root>\n <NavList.Item>\n <NavList.Link href=\"#account\" tooltip={t(\"person\")}>\n <UserIcon />\n <span>{t(\"person\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Footer>\n </Sidebar.Root>\n );\n}\n";
238
+ //#endregion
239
+ //#region src/sidebar/examples/filter.example.tsx
240
+ var filter_example_exports = /* @__PURE__ */ __exportAll({
241
+ Filter: () => Filter,
242
+ source: () => source$6
243
+ });
244
+ const PAGES$3 = [
245
+ ["overview", LayoutDashboardIcon],
246
+ ["invoices", FileTextIcon],
247
+ ["customers", UsersIcon],
248
+ ["reports", ChartColumnIcon]
249
+ ];
250
+ function Filter() {
251
+ const $ = c(29);
252
+ const { t } = useWords("sidebar");
253
+ let t0;
254
+ if ($[0] !== t) {
255
+ t0 = t("pages");
256
+ $[0] = t;
257
+ $[1] = t0;
258
+ } else t0 = $[1];
259
+ let t1;
260
+ if ($[2] !== t0) {
261
+ t1 = /* @__PURE__ */ jsx(NavLabel, {
262
+ as: "h3",
263
+ children: t0
264
+ });
265
+ $[2] = t0;
266
+ $[3] = t1;
267
+ } else t1 = $[3];
268
+ let t2;
269
+ if ($[4] !== t) {
270
+ t2 = t("filterPages");
271
+ $[4] = t;
272
+ $[5] = t2;
273
+ } else t2 = $[5];
274
+ let t3;
275
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
276
+ t3 = /* @__PURE__ */ jsx(XIcon, {});
277
+ $[6] = t3;
278
+ } else t3 = $[6];
279
+ let t4;
280
+ if ($[7] !== t) {
281
+ t4 = t("clearFilter");
282
+ $[7] = t;
283
+ $[8] = t4;
284
+ } else t4 = $[8];
285
+ let t5;
286
+ if ($[9] !== t) {
287
+ t5 = t("filterPlaceholder");
288
+ $[9] = t;
289
+ $[10] = t5;
290
+ } else t5 = $[10];
291
+ let t6;
292
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
293
+ t6 = /* @__PURE__ */ jsx(SearchIcon, {});
294
+ $[11] = t6;
295
+ } else t6 = $[11];
296
+ let t7;
297
+ if ($[12] !== t2 || $[13] !== t4 || $[14] !== t5) {
298
+ t7 = /* @__PURE__ */ jsx(Search, {
299
+ "aria-label": t2,
300
+ clearIndicator: t3,
301
+ clearLabel: t4,
302
+ placeholder: t5,
303
+ searchIndicator: t6
304
+ });
305
+ $[12] = t2;
306
+ $[13] = t4;
307
+ $[14] = t5;
308
+ $[15] = t7;
309
+ } else t7 = $[15];
310
+ let t8;
311
+ if ($[16] !== t) {
312
+ t8 = PAGES$3.map((t9) => {
313
+ const [page, Glyph] = t9;
314
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
315
+ href: `#${page}`,
316
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(page) })]
317
+ }) }, page);
318
+ });
319
+ $[16] = t;
320
+ $[17] = t8;
321
+ } else t8 = $[17];
322
+ let t9;
323
+ if ($[18] !== t8) {
324
+ t9 = /* @__PURE__ */ jsx(NavList.Root, { children: t8 });
325
+ $[18] = t8;
326
+ $[19] = t9;
327
+ } else t9 = $[19];
328
+ let t10;
329
+ if ($[20] !== t) {
330
+ t10 = t("noMatch");
331
+ $[20] = t;
332
+ $[21] = t10;
333
+ } else t10 = $[21];
334
+ let t11;
335
+ if ($[22] !== t10) {
336
+ t11 = /* @__PURE__ */ jsx(Empty, { children: t10 });
337
+ $[22] = t10;
338
+ $[23] = t11;
339
+ } else t11 = $[23];
340
+ let t12;
341
+ if ($[24] !== t1 || $[25] !== t11 || $[26] !== t7 || $[27] !== t9) {
342
+ t12 = /* @__PURE__ */ jsx(Root, {
343
+ variant: "subtle",
344
+ children: /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [
345
+ t1,
346
+ t7,
347
+ t9,
348
+ t11
349
+ ] }) })
350
+ });
351
+ $[24] = t1;
352
+ $[25] = t11;
353
+ $[26] = t7;
354
+ $[27] = t9;
355
+ $[28] = t12;
356
+ } else t12 = $[28];
357
+ return t12;
358
+ }
359
+ const source$6 = "import { type ComponentType, type ReactElement } from \"react\";\n\nimport {\n ChartColumnIcon,\n FileTextIcon,\n LayoutDashboardIcon,\n SearchIcon,\n UsersIcon,\n XIcon,\n} from \"lucide-react\";\n\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nconst PAGES: ReadonlyArray<readonly [string, ComponentType]> = [\n [\"overview\", LayoutDashboardIcon],\n [\"invoices\", FileTextIcon],\n [\"customers\", UsersIcon],\n [\"reports\", ChartColumnIcon],\n];\n\nexport function Filter(): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <Sidebar.Root variant=\"subtle\">\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(\"pages\")}</Sidebar.NavLabel>\n <Sidebar.Search\n aria-label={t(\"filterPages\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"clearFilter\")}\n placeholder={t(\"filterPlaceholder\")}\n searchIndicator={<SearchIcon />}\n />\n <NavList.Root>\n {PAGES.map(([page, Glyph]) => (\n <NavList.Item key={page}>\n <NavList.Link href={`#${page}`}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n <Sidebar.Empty>{t(\"noMatch\")}</Sidebar.Empty>\n </Sidebar.Nav>\n </Sidebar.Content>\n </Sidebar.Root>\n );\n}\n";
360
+ //#endregion
361
+ //#region src/sidebar/examples/guides.example.tsx
362
+ var guides_example_exports = /* @__PURE__ */ __exportAll({
363
+ Guides: () => Guides,
364
+ source: () => source$5
365
+ });
366
+ function Guides() {
367
+ const $ = c(53);
368
+ const { t } = useWords("sidebar");
369
+ const id = useId();
370
+ let t0;
371
+ if ($[0] !== t) {
372
+ t0 = t("handbook");
373
+ $[0] = t;
374
+ $[1] = t0;
375
+ } else t0 = $[1];
376
+ let t1;
377
+ if ($[2] !== t0) {
378
+ t1 = /* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsx("span", { children: t0 }) });
379
+ $[2] = t0;
380
+ $[3] = t1;
381
+ } else t1 = $[3];
382
+ let t2;
383
+ if ($[4] !== t) {
384
+ t2 = t("documentation");
385
+ $[4] = t;
386
+ $[5] = t2;
387
+ } else t2 = $[5];
388
+ const t3 = `${id}-guides`;
389
+ let t4;
390
+ if ($[6] !== t) {
391
+ t4 = t("guides");
392
+ $[6] = t;
393
+ $[7] = t4;
394
+ } else t4 = $[7];
395
+ let t5;
396
+ if ($[8] !== t3 || $[9] !== t4) {
397
+ t5 = /* @__PURE__ */ jsx(NavHeading, {
398
+ as: "h3",
399
+ id: t3,
400
+ children: t4
401
+ });
402
+ $[8] = t3;
403
+ $[9] = t4;
404
+ $[10] = t5;
405
+ } else t5 = $[10];
406
+ const t6 = `${id}-guides`;
407
+ let t7;
408
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
409
+ t7 = /* @__PURE__ */ jsx(CompassIcon, {});
410
+ $[11] = t7;
411
+ } else t7 = $[11];
412
+ let t8;
413
+ if ($[12] !== t) {
414
+ t8 = t("start");
415
+ $[12] = t;
416
+ $[13] = t8;
417
+ } else t8 = $[13];
418
+ let t9;
419
+ if ($[14] !== t8) {
420
+ t9 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
421
+ "aria-current": "page",
422
+ href: "#start",
423
+ children: [t7, /* @__PURE__ */ jsx("span", { children: t8 })]
424
+ }) });
425
+ $[14] = t8;
426
+ $[15] = t9;
427
+ } else t9 = $[15];
428
+ let t10;
429
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
430
+ t10 = /* @__PURE__ */ jsx(PaletteIcon, {});
431
+ $[16] = t10;
432
+ } else t10 = $[16];
433
+ let t11;
434
+ if ($[17] !== t) {
435
+ t11 = t("theming");
436
+ $[17] = t;
437
+ $[18] = t11;
438
+ } else t11 = $[18];
439
+ let t12;
440
+ if ($[19] !== t11) {
441
+ t12 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
442
+ href: "#theming",
443
+ children: [t10, /* @__PURE__ */ jsx("span", { children: t11 })]
444
+ }) });
445
+ $[19] = t11;
446
+ $[20] = t12;
447
+ } else t12 = $[20];
448
+ let t13;
449
+ if ($[21] !== t12 || $[22] !== t6 || $[23] !== t9) {
450
+ t13 = /* @__PURE__ */ jsxs(NavList.Root, {
451
+ "aria-labelledby": t6,
452
+ children: [t9, t12]
453
+ });
454
+ $[21] = t12;
455
+ $[22] = t6;
456
+ $[23] = t9;
457
+ $[24] = t13;
458
+ } else t13 = $[24];
459
+ const t14 = `${id}-components`;
460
+ let t15;
461
+ if ($[25] !== t) {
462
+ t15 = t("components");
463
+ $[25] = t;
464
+ $[26] = t15;
465
+ } else t15 = $[26];
466
+ let t16;
467
+ if ($[27] !== t14 || $[28] !== t15) {
468
+ t16 = /* @__PURE__ */ jsx(NavHeading, {
469
+ as: "h3",
470
+ id: t14,
471
+ children: t15
472
+ });
473
+ $[27] = t14;
474
+ $[28] = t15;
475
+ $[29] = t16;
476
+ } else t16 = $[29];
477
+ const t17 = `${id}-components`;
478
+ let t18;
479
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
480
+ t18 = /* @__PURE__ */ jsx(SquareIcon, {});
481
+ $[30] = t18;
482
+ } else t18 = $[30];
483
+ let t19;
484
+ if ($[31] !== t) {
485
+ t19 = t("button");
486
+ $[31] = t;
487
+ $[32] = t19;
488
+ } else t19 = $[32];
489
+ let t20;
490
+ if ($[33] !== t19) {
491
+ t20 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
492
+ href: "#button",
493
+ children: [t18, /* @__PURE__ */ jsx("span", { children: t19 })]
494
+ }) });
495
+ $[33] = t19;
496
+ $[34] = t20;
497
+ } else t20 = $[34];
498
+ let t21;
499
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
500
+ t21 = /* @__PURE__ */ jsx(BoxIcon, {});
501
+ $[35] = t21;
502
+ } else t21 = $[35];
503
+ let t22;
504
+ if ($[36] !== t) {
505
+ t22 = t("card");
506
+ $[36] = t;
507
+ $[37] = t22;
508
+ } else t22 = $[37];
509
+ let t23;
510
+ if ($[38] !== t22) {
511
+ t23 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
512
+ href: "#card",
513
+ children: [t21, /* @__PURE__ */ jsx("span", { children: t22 })]
514
+ }) });
515
+ $[38] = t22;
516
+ $[39] = t23;
517
+ } else t23 = $[39];
518
+ let t24;
519
+ if ($[40] !== t17 || $[41] !== t20 || $[42] !== t23) {
520
+ t24 = /* @__PURE__ */ jsxs(NavList.Root, {
521
+ "aria-labelledby": t17,
522
+ children: [t20, t23]
523
+ });
524
+ $[40] = t17;
525
+ $[41] = t20;
526
+ $[42] = t23;
527
+ $[43] = t24;
528
+ } else t24 = $[43];
529
+ let t25;
530
+ if ($[44] !== t13 || $[45] !== t16 || $[46] !== t2 || $[47] !== t24 || $[48] !== t5) {
531
+ t25 = /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, {
532
+ "aria-label": t2,
533
+ children: [
534
+ t5,
535
+ t13,
536
+ t16,
537
+ t24
538
+ ]
539
+ }) });
540
+ $[44] = t13;
541
+ $[45] = t16;
542
+ $[46] = t2;
543
+ $[47] = t24;
544
+ $[48] = t5;
545
+ $[49] = t25;
546
+ } else t25 = $[49];
547
+ let t26;
548
+ if ($[50] !== t1 || $[51] !== t25) {
549
+ t26 = /* @__PURE__ */ jsxs(Root, {
550
+ variant: "subtle",
551
+ children: [t1, t25]
552
+ });
553
+ $[50] = t1;
554
+ $[51] = t25;
555
+ $[52] = t26;
556
+ } else t26 = $[52];
557
+ return t26;
558
+ }
559
+ const source$5 = "import { type ReactElement, useId } from \"react\";\n\nimport { BoxIcon, CompassIcon, PaletteIcon, SquareIcon } from \"lucide-react\";\n\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nexport function Guides(): ReactElement {\n const { t } = useWords(\"sidebar\");\n const id = useId();\n\n return (\n <Sidebar.Root variant=\"subtle\">\n <Sidebar.Header>\n <span>{t(\"handbook\")}</span>\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav aria-label={t(\"documentation\")}>\n <Sidebar.NavHeading as=\"h3\" id={`${id}-guides`}>\n {t(\"guides\")}\n </Sidebar.NavHeading>\n <NavList.Root aria-labelledby={`${id}-guides`}>\n <NavList.Item>\n <NavList.Link aria-current=\"page\" href=\"#start\">\n <CompassIcon />\n <span>{t(\"start\")}</span>\n </NavList.Link>\n </NavList.Item>\n <NavList.Item>\n <NavList.Link href=\"#theming\">\n <PaletteIcon />\n <span>{t(\"theming\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n <Sidebar.NavHeading as=\"h3\" id={`${id}-components`}>\n {t(\"components\")}\n </Sidebar.NavHeading>\n <NavList.Root aria-labelledby={`${id}-components`}>\n <NavList.Item>\n <NavList.Link href=\"#button\">\n <SquareIcon />\n <span>{t(\"button\")}</span>\n </NavList.Link>\n </NavList.Item>\n <NavList.Item>\n <NavList.Link href=\"#card\">\n <BoxIcon />\n <span>{t(\"card\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n </Sidebar.Root>\n );\n}\n";
560
+ //#endregion
561
+ //#region src/sidebar/examples/phone.example.tsx
562
+ var phone_example_exports = /* @__PURE__ */ __exportAll({
563
+ Phone: () => Phone,
564
+ source: () => source$4
565
+ });
566
+ const GHOST$1 = {
567
+ shape: "square",
568
+ size: "sm",
569
+ variant: "ghost"
570
+ };
571
+ const PAGES$2 = [
572
+ [
573
+ "overview",
574
+ HouseIcon,
575
+ void 0
576
+ ],
577
+ [
578
+ "runs",
579
+ PlayIcon,
580
+ "page"
581
+ ],
582
+ [
583
+ "pipelines",
584
+ GitBranchIcon,
585
+ void 0
586
+ ],
587
+ [
588
+ "approvals",
589
+ ShieldCheckIcon,
590
+ void 0
591
+ ]
592
+ ];
593
+ function Phone(props) {
594
+ const $ = c(66);
595
+ const { t } = useWords("sidebar");
596
+ let t0;
597
+ if ($[0] !== t) {
598
+ t0 = t("navigation");
599
+ $[0] = t;
600
+ $[1] = t0;
601
+ } else t0 = $[1];
602
+ let t1;
603
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
604
+ t1 = /* @__PURE__ */ jsx(MenuIcon, {});
605
+ $[2] = t1;
606
+ } else t1 = $[2];
607
+ let t2;
608
+ if ($[3] !== t0) {
609
+ t2 = /* @__PURE__ */ jsx(Header$1, { children: /* @__PURE__ */ jsx(ButtonPropsProvider, {
610
+ value: GHOST$1,
611
+ children: /* @__PURE__ */ jsx(Trigger, {
612
+ "aria-label": t0,
613
+ as: Button,
614
+ children: t1
615
+ })
616
+ }) });
617
+ $[3] = t0;
618
+ $[4] = t2;
619
+ } else t2 = $[4];
620
+ let t3;
621
+ if ($[5] !== t) {
622
+ t3 = t("ledger");
623
+ $[5] = t;
624
+ $[6] = t3;
625
+ } else t3 = $[6];
626
+ let t4;
627
+ if ($[7] !== t3) {
628
+ t4 = /* @__PURE__ */ jsx(Text, {
629
+ as: "p",
630
+ size: "sm",
631
+ truncate: true,
632
+ weight: "medium",
633
+ children: t3
634
+ });
635
+ $[7] = t3;
636
+ $[8] = t4;
637
+ } else t4 = $[8];
638
+ let t5;
639
+ if ($[9] !== t) {
640
+ t5 = t("findPage");
641
+ $[9] = t;
642
+ $[10] = t5;
643
+ } else t5 = $[10];
644
+ let t6;
645
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
646
+ t6 = /* @__PURE__ */ jsx(XIcon, {});
647
+ $[11] = t6;
648
+ } else t6 = $[11];
649
+ let t7;
650
+ if ($[12] !== t) {
651
+ t7 = t("clearFilter");
652
+ $[12] = t;
653
+ $[13] = t7;
654
+ } else t7 = $[13];
655
+ let t8;
656
+ if ($[14] !== t) {
657
+ t8 = t("filter");
658
+ $[14] = t;
659
+ $[15] = t8;
660
+ } else t8 = $[15];
661
+ let t9;
662
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
663
+ t9 = /* @__PURE__ */ jsx(SearchIcon, {});
664
+ $[16] = t9;
665
+ } else t9 = $[16];
666
+ let t10;
667
+ if ($[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
668
+ t10 = /* @__PURE__ */ jsx(Search, {
669
+ "aria-label": t5,
670
+ clearIndicator: t6,
671
+ clearLabel: t7,
672
+ placeholder: t8,
673
+ searchIndicator: t9
674
+ });
675
+ $[17] = t5;
676
+ $[18] = t7;
677
+ $[19] = t8;
678
+ $[20] = t10;
679
+ } else t10 = $[20];
680
+ let t11;
681
+ if ($[21] !== t10 || $[22] !== t4) {
682
+ t11 = /* @__PURE__ */ jsxs(Header, { children: [t4, t10] });
683
+ $[21] = t10;
684
+ $[22] = t4;
685
+ $[23] = t11;
686
+ } else t11 = $[23];
687
+ let t12;
688
+ if ($[24] !== t) {
689
+ t12 = t("platform");
690
+ $[24] = t;
691
+ $[25] = t12;
692
+ } else t12 = $[25];
693
+ let t13;
694
+ if ($[26] !== t12) {
695
+ t13 = /* @__PURE__ */ jsx(NavLabel, {
696
+ as: "h3",
697
+ children: t12
698
+ });
699
+ $[26] = t12;
700
+ $[27] = t13;
701
+ } else t13 = $[27];
702
+ let t14;
703
+ if ($[28] !== t) {
704
+ t14 = PAGES$2.map((t15) => {
705
+ const [page, Glyph, current] = t15;
706
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
707
+ "aria-current": current,
708
+ href: `#${page}`,
709
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(page) })]
710
+ }) }, page);
711
+ });
712
+ $[28] = t;
713
+ $[29] = t14;
714
+ } else t14 = $[29];
715
+ let t15;
716
+ if ($[30] !== t14) {
717
+ t15 = /* @__PURE__ */ jsx(NavList.Root, { children: t14 });
718
+ $[30] = t14;
719
+ $[31] = t15;
720
+ } else t15 = $[31];
721
+ let t16;
722
+ if ($[32] !== t13 || $[33] !== t15) {
723
+ t16 = /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [t13, t15] }) });
724
+ $[32] = t13;
725
+ $[33] = t15;
726
+ $[34] = t16;
727
+ } else t16 = $[34];
728
+ let t17;
729
+ if ($[35] !== t11 || $[36] !== t16) {
730
+ t17 = /* @__PURE__ */ jsx(Navbar, { children: /* @__PURE__ */ jsxs(Root, {
731
+ variant: "subtle",
732
+ children: [t11, t16]
733
+ }) });
734
+ $[35] = t11;
735
+ $[36] = t16;
736
+ $[37] = t17;
737
+ } else t17 = $[37];
738
+ let t18;
739
+ if ($[38] !== t) {
740
+ t18 = t("runs");
741
+ $[38] = t;
742
+ $[39] = t18;
743
+ } else t18 = $[39];
744
+ let t19;
745
+ if ($[40] !== t18) {
746
+ t19 = /* @__PURE__ */ jsx(Title, {
747
+ as: "h3",
748
+ children: t18
749
+ });
750
+ $[40] = t18;
751
+ $[41] = t19;
752
+ } else t19 = $[41];
753
+ let t20;
754
+ if ($[42] !== t) {
755
+ t20 = t("runsAbout");
756
+ $[42] = t;
757
+ $[43] = t20;
758
+ } else t20 = $[43];
759
+ let t21;
760
+ if ($[44] !== t20) {
761
+ t21 = /* @__PURE__ */ jsx(Description, { children: t20 });
762
+ $[44] = t20;
763
+ $[45] = t21;
764
+ } else t21 = $[45];
765
+ let t22;
766
+ if ($[46] !== t19 || $[47] !== t21) {
767
+ t22 = /* @__PURE__ */ jsx(Main, { children: /* @__PURE__ */ jsx(Root$1, {
768
+ size: "sm",
769
+ children: /* @__PURE__ */ jsxs(Header$2, { children: [t19, t21] })
770
+ }) });
771
+ $[46] = t19;
772
+ $[47] = t21;
773
+ $[48] = t22;
774
+ } else t22 = $[48];
775
+ let t23;
776
+ if ($[49] !== t17 || $[50] !== t22) {
777
+ t23 = /* @__PURE__ */ jsxs(Body, { children: [t17, t22] });
778
+ $[49] = t17;
779
+ $[50] = t22;
780
+ $[51] = t23;
781
+ } else t23 = $[51];
782
+ let t24;
783
+ if ($[52] !== t) {
784
+ t24 = t("places");
785
+ $[52] = t;
786
+ $[53] = t24;
787
+ } else t24 = $[53];
788
+ let t25;
789
+ if ($[54] !== t) {
790
+ t25 = PAGES$2.map((t26) => {
791
+ const [page_0, Glyph_0, current_0] = t26;
792
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
793
+ "aria-current": current_0,
794
+ href: `#${page_0}`,
795
+ children: [/* @__PURE__ */ jsx(Glyph_0, {}), /* @__PURE__ */ jsx("span", { children: t(page_0) })]
796
+ }) }, page_0);
797
+ });
798
+ $[54] = t;
799
+ $[55] = t25;
800
+ } else t25 = $[55];
801
+ let t26;
802
+ if ($[56] !== t25) {
803
+ t26 = /* @__PURE__ */ jsx(NavList.Root, {
804
+ variant: "dock",
805
+ children: t25
806
+ });
807
+ $[56] = t25;
808
+ $[57] = t26;
809
+ } else t26 = $[57];
810
+ let t27;
811
+ if ($[58] !== t24 || $[59] !== t26) {
812
+ t27 = /* @__PURE__ */ jsx(Footer$1, {
813
+ when: "narrow",
814
+ children: /* @__PURE__ */ jsx("nav", {
815
+ "aria-label": t24,
816
+ children: t26
817
+ })
818
+ });
819
+ $[58] = t24;
820
+ $[59] = t26;
821
+ $[60] = t27;
822
+ } else t27 = $[60];
823
+ let t28;
824
+ if ($[61] !== props || $[62] !== t2 || $[63] !== t23 || $[64] !== t27) {
825
+ t28 = /* @__PURE__ */ jsxs(Root$2, {
826
+ ...props,
827
+ children: [
828
+ t2,
829
+ t23,
830
+ t27
831
+ ]
832
+ });
833
+ $[61] = props;
834
+ $[62] = t2;
835
+ $[63] = t23;
836
+ $[64] = t27;
837
+ $[65] = t28;
838
+ } else t28 = $[65];
839
+ return t28;
840
+ }
841
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport {\n GitBranchIcon,\n HouseIcon,\n MenuIcon,\n PlayIcon,\n SearchIcon,\n ShieldCheckIcon,\n XIcon,\n} from \"lucide-react\";\n\nimport { Button, ButtonPropsProvider } from \"@stealthscale/component-actions\";\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { AppShell, Page, Sidebar } from \"@stealthscale/component-screen\";\n\nconst GHOST = { shape: \"square\", size: \"sm\", variant: \"ghost\" } as const;\n\nconst PAGES = [\n [\"overview\", HouseIcon, undefined],\n [\"runs\", PlayIcon, \"page\"],\n [\"pipelines\", GitBranchIcon, undefined],\n [\"approvals\", ShieldCheckIcon, undefined],\n] as const;\n\nexport function Phone(props: AppShell.RootProps): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <AppShell.Root {...props}>\n <AppShell.Header>\n <ButtonPropsProvider value={GHOST}>\n <AppShell.Trigger aria-label={t(\"navigation\")} as={Button}>\n <MenuIcon />\n </AppShell.Trigger>\n </ButtonPropsProvider>\n </AppShell.Header>\n <AppShell.Body>\n <AppShell.Navbar>\n <Sidebar.Root variant=\"subtle\">\n <Sidebar.Header>\n <Text as=\"p\" size=\"sm\" truncate weight=\"medium\">\n {t(\"ledger\")}\n </Text>\n <Sidebar.Search\n aria-label={t(\"findPage\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"clearFilter\")}\n placeholder={t(\"filter\")}\n searchIndicator={<SearchIcon />}\n />\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(\"platform\")}</Sidebar.NavLabel>\n <NavList.Root>\n {PAGES.map(([page, Glyph, current]) => (\n <NavList.Item key={page}>\n <NavList.Link aria-current={current} href={`#${page}`}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n </Sidebar.Root>\n </AppShell.Navbar>\n <AppShell.Main>\n <Page.Root size=\"sm\">\n <Page.Header>\n <Page.Title as=\"h3\">{t(\"runs\")}</Page.Title>\n <Page.Description>{t(\"runsAbout\")}</Page.Description>\n </Page.Header>\n </Page.Root>\n </AppShell.Main>\n </AppShell.Body>\n <AppShell.Footer when=\"narrow\">\n <nav aria-label={t(\"places\")}>\n <NavList.Root variant=\"dock\">\n {PAGES.map(([page, Glyph, current]) => (\n <NavList.Item key={page}>\n <NavList.Link aria-current={current} href={`#${page}`}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n </nav>\n </AppShell.Footer>\n </AppShell.Root>\n );\n}\n";
842
+ //#endregion
843
+ //#region src/sidebar/examples/rail.example.tsx
844
+ var rail_example_exports = /* @__PURE__ */ __exportAll({
845
+ Rail: () => Rail,
846
+ source: () => source$3
847
+ });
848
+ const PAGES$1 = [
849
+ [
850
+ "overview",
851
+ LayoutDashboardIcon,
852
+ "page"
853
+ ],
854
+ [
855
+ "invoices",
856
+ FileTextIcon,
857
+ void 0
858
+ ],
859
+ [
860
+ "customers",
861
+ UsersIcon,
862
+ void 0
863
+ ]
864
+ ];
865
+ function Rail() {
866
+ const $ = c(35);
867
+ const { t } = useWords("sidebar");
868
+ let t0;
869
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
870
+ t0 = /* @__PURE__ */ jsx(Building2Icon, {});
871
+ $[0] = t0;
872
+ } else t0 = $[0];
873
+ let t1;
874
+ if ($[1] !== t) {
875
+ t1 = t("acme");
876
+ $[1] = t;
877
+ $[2] = t1;
878
+ } else t1 = $[2];
879
+ let t2;
880
+ if ($[3] !== t1) {
881
+ t2 = /* @__PURE__ */ jsxs(Header, { children: [t0, /* @__PURE__ */ jsx("span", { children: t1 })] });
882
+ $[3] = t1;
883
+ $[4] = t2;
884
+ } else t2 = $[4];
885
+ let t3;
886
+ if ($[5] !== t) {
887
+ t3 = t("workspace");
888
+ $[5] = t;
889
+ $[6] = t3;
890
+ } else t3 = $[6];
891
+ let t4;
892
+ if ($[7] !== t3) {
893
+ t4 = /* @__PURE__ */ jsx(NavLabel, {
894
+ as: "h3",
895
+ children: t3
896
+ });
897
+ $[7] = t3;
898
+ $[8] = t4;
899
+ } else t4 = $[8];
900
+ let t5;
901
+ if ($[9] !== t) {
902
+ t5 = PAGES$1.map((t6) => {
903
+ const [page, Glyph, current] = t6;
904
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
905
+ "aria-current": current,
906
+ href: `#${page}`,
907
+ tooltip: t(page),
908
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(page) })]
909
+ }) }, page);
910
+ });
911
+ $[9] = t;
912
+ $[10] = t5;
913
+ } else t5 = $[10];
914
+ let t6;
915
+ if ($[11] !== t5) {
916
+ t6 = /* @__PURE__ */ jsx(NavList.Root, { children: t5 });
917
+ $[11] = t5;
918
+ $[12] = t6;
919
+ } else t6 = $[12];
920
+ let t7;
921
+ if ($[13] !== t4 || $[14] !== t6) {
922
+ t7 = /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [t4, t6] }) });
923
+ $[13] = t4;
924
+ $[14] = t6;
925
+ $[15] = t7;
926
+ } else t7 = $[15];
927
+ let t8;
928
+ if ($[16] !== t) {
929
+ t8 = t("account");
930
+ $[16] = t;
931
+ $[17] = t8;
932
+ } else t8 = $[17];
933
+ let t9;
934
+ if ($[18] !== t) {
935
+ t9 = t("person");
936
+ $[18] = t;
937
+ $[19] = t9;
938
+ } else t9 = $[19];
939
+ let t10;
940
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
941
+ t10 = /* @__PURE__ */ jsx(UserIcon, {});
942
+ $[20] = t10;
943
+ } else t10 = $[20];
944
+ let t11;
945
+ if ($[21] !== t) {
946
+ t11 = t("person");
947
+ $[21] = t;
948
+ $[22] = t11;
949
+ } else t11 = $[22];
950
+ let t12;
951
+ if ($[23] !== t11) {
952
+ t12 = /* @__PURE__ */ jsx("span", { children: t11 });
953
+ $[23] = t11;
954
+ $[24] = t12;
955
+ } else t12 = $[24];
956
+ let t13;
957
+ if ($[25] !== t12 || $[26] !== t9) {
958
+ t13 = /* @__PURE__ */ jsx(NavList.Root, { children: /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
959
+ href: "#account",
960
+ tooltip: t9,
961
+ children: [t10, t12]
962
+ }) }) });
963
+ $[25] = t12;
964
+ $[26] = t9;
965
+ $[27] = t13;
966
+ } else t13 = $[27];
967
+ let t14;
968
+ if ($[28] !== t13 || $[29] !== t8) {
969
+ t14 = /* @__PURE__ */ jsx(Footer, { children: /* @__PURE__ */ jsx(Nav, {
970
+ "aria-label": t8,
971
+ children: t13
972
+ }) });
973
+ $[28] = t13;
974
+ $[29] = t8;
975
+ $[30] = t14;
976
+ } else t14 = $[30];
977
+ let t15;
978
+ if ($[31] !== t14 || $[32] !== t2 || $[33] !== t7) {
979
+ t15 = /* @__PURE__ */ jsxs(Root, {
980
+ iconic: true,
981
+ variant: "outline",
982
+ children: [
983
+ t2,
984
+ t7,
985
+ t14
986
+ ]
987
+ });
988
+ $[31] = t14;
989
+ $[32] = t2;
990
+ $[33] = t7;
991
+ $[34] = t15;
992
+ } else t15 = $[34];
993
+ return t15;
994
+ }
995
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport {\n Building2Icon,\n FileTextIcon,\n LayoutDashboardIcon,\n UserIcon,\n UsersIcon,\n} from \"lucide-react\";\n\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nconst PAGES = [\n [\"overview\", LayoutDashboardIcon, \"page\"],\n [\"invoices\", FileTextIcon, undefined],\n [\"customers\", UsersIcon, undefined],\n] as const;\n\nexport function Rail(): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <Sidebar.Root iconic variant=\"outline\">\n <Sidebar.Header>\n <Building2Icon />\n <span>{t(\"acme\")}</span>\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(\"workspace\")}</Sidebar.NavLabel>\n <NavList.Root>\n {PAGES.map(([page, Glyph, current]) => (\n <NavList.Item key={page}>\n <NavList.Link aria-current={current} href={`#${page}`} tooltip={t(page)}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n <Sidebar.Footer>\n <Sidebar.Nav aria-label={t(\"account\")}>\n <NavList.Root>\n <NavList.Item>\n <NavList.Link href=\"#account\" tooltip={t(\"person\")}>\n <UserIcon />\n <span>{t(\"person\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Footer>\n </Sidebar.Root>\n );\n}\n";
996
+ //#endregion
997
+ //#region src/sidebar/examples/shell.example.tsx
998
+ var shell_example_exports = /* @__PURE__ */ __exportAll({
999
+ Shell: () => Shell,
1000
+ source: () => source$2
1001
+ });
1002
+ const GHOST = {
1003
+ shape: "square",
1004
+ size: "sm",
1005
+ variant: "ghost"
1006
+ };
1007
+ const PAGES = [
1008
+ [
1009
+ "overview",
1010
+ HouseIcon,
1011
+ void 0
1012
+ ],
1013
+ [
1014
+ "runs",
1015
+ PlayIcon,
1016
+ "page"
1017
+ ],
1018
+ [
1019
+ "pipelines",
1020
+ GitBranchIcon,
1021
+ void 0
1022
+ ],
1023
+ [
1024
+ "approvals",
1025
+ ShieldCheckIcon,
1026
+ void 0
1027
+ ]
1028
+ ];
1029
+ function Shell(props) {
1030
+ const $ = c(72);
1031
+ const { t } = useWords("sidebar");
1032
+ let t0;
1033
+ if ($[0] !== t) {
1034
+ t0 = t("navigation");
1035
+ $[0] = t;
1036
+ $[1] = t0;
1037
+ } else t0 = $[1];
1038
+ let t1;
1039
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1040
+ t1 = /* @__PURE__ */ jsx(MenuIcon, {});
1041
+ $[2] = t1;
1042
+ } else t1 = $[2];
1043
+ let t2;
1044
+ if ($[3] !== t0) {
1045
+ t2 = /* @__PURE__ */ jsx(Header$1, { children: /* @__PURE__ */ jsx(ButtonPropsProvider, {
1046
+ value: GHOST,
1047
+ children: /* @__PURE__ */ jsx(Trigger, {
1048
+ "aria-label": t0,
1049
+ as: Button,
1050
+ children: t1
1051
+ })
1052
+ }) });
1053
+ $[3] = t0;
1054
+ $[4] = t2;
1055
+ } else t2 = $[4];
1056
+ let t3;
1057
+ if ($[5] !== t) {
1058
+ t3 = t("ledger");
1059
+ $[5] = t;
1060
+ $[6] = t3;
1061
+ } else t3 = $[6];
1062
+ let t4;
1063
+ if ($[7] !== t3) {
1064
+ t4 = /* @__PURE__ */ jsx(Text, {
1065
+ as: "p",
1066
+ size: "sm",
1067
+ truncate: true,
1068
+ weight: "medium",
1069
+ children: t3
1070
+ });
1071
+ $[7] = t3;
1072
+ $[8] = t4;
1073
+ } else t4 = $[8];
1074
+ let t5;
1075
+ if ($[9] !== t) {
1076
+ t5 = t("findPage");
1077
+ $[9] = t;
1078
+ $[10] = t5;
1079
+ } else t5 = $[10];
1080
+ let t6;
1081
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1082
+ t6 = /* @__PURE__ */ jsx(XIcon, {});
1083
+ $[11] = t6;
1084
+ } else t6 = $[11];
1085
+ let t7;
1086
+ if ($[12] !== t) {
1087
+ t7 = t("clearFilter");
1088
+ $[12] = t;
1089
+ $[13] = t7;
1090
+ } else t7 = $[13];
1091
+ let t8;
1092
+ if ($[14] !== t) {
1093
+ t8 = t("filter");
1094
+ $[14] = t;
1095
+ $[15] = t8;
1096
+ } else t8 = $[15];
1097
+ let t9;
1098
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
1099
+ t9 = /* @__PURE__ */ jsx(SearchIcon, {});
1100
+ $[16] = t9;
1101
+ } else t9 = $[16];
1102
+ let t10;
1103
+ if ($[17] !== t5 || $[18] !== t7 || $[19] !== t8) {
1104
+ t10 = /* @__PURE__ */ jsx(Search, {
1105
+ "aria-label": t5,
1106
+ clearIndicator: t6,
1107
+ clearLabel: t7,
1108
+ placeholder: t8,
1109
+ searchIndicator: t9
1110
+ });
1111
+ $[17] = t5;
1112
+ $[18] = t7;
1113
+ $[19] = t8;
1114
+ $[20] = t10;
1115
+ } else t10 = $[20];
1116
+ let t11;
1117
+ if ($[21] !== t10 || $[22] !== t4) {
1118
+ t11 = /* @__PURE__ */ jsxs(Header, { children: [t4, t10] });
1119
+ $[21] = t10;
1120
+ $[22] = t4;
1121
+ $[23] = t11;
1122
+ } else t11 = $[23];
1123
+ let t12;
1124
+ if ($[24] !== t) {
1125
+ t12 = t("platform");
1126
+ $[24] = t;
1127
+ $[25] = t12;
1128
+ } else t12 = $[25];
1129
+ let t13;
1130
+ if ($[26] !== t12) {
1131
+ t13 = /* @__PURE__ */ jsx(NavLabel, {
1132
+ as: "h3",
1133
+ children: t12
1134
+ });
1135
+ $[26] = t12;
1136
+ $[27] = t13;
1137
+ } else t13 = $[27];
1138
+ let t14;
1139
+ if ($[28] !== t) {
1140
+ t14 = PAGES.map((t15) => {
1141
+ const [page, Glyph, current] = t15;
1142
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1143
+ "aria-current": current,
1144
+ href: `#${page}`,
1145
+ tooltip: t(page),
1146
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(page) })]
1147
+ }) }, page);
1148
+ });
1149
+ $[28] = t;
1150
+ $[29] = t14;
1151
+ } else t14 = $[29];
1152
+ let t15;
1153
+ if ($[30] !== t14) {
1154
+ t15 = /* @__PURE__ */ jsx(NavList.Root, { children: t14 });
1155
+ $[30] = t14;
1156
+ $[31] = t15;
1157
+ } else t15 = $[31];
1158
+ let t16;
1159
+ if ($[32] !== t13 || $[33] !== t15) {
1160
+ t16 = /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [t13, t15] }) });
1161
+ $[32] = t13;
1162
+ $[33] = t15;
1163
+ $[34] = t16;
1164
+ } else t16 = $[34];
1165
+ let t17;
1166
+ if ($[35] !== t) {
1167
+ t17 = t("account");
1168
+ $[35] = t;
1169
+ $[36] = t17;
1170
+ } else t17 = $[36];
1171
+ let t18;
1172
+ if ($[37] !== t) {
1173
+ t18 = t("person");
1174
+ $[37] = t;
1175
+ $[38] = t18;
1176
+ } else t18 = $[38];
1177
+ let t19;
1178
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
1179
+ t19 = /* @__PURE__ */ jsx(UserIcon, {});
1180
+ $[39] = t19;
1181
+ } else t19 = $[39];
1182
+ let t20;
1183
+ if ($[40] !== t) {
1184
+ t20 = t("person");
1185
+ $[40] = t;
1186
+ $[41] = t20;
1187
+ } else t20 = $[41];
1188
+ let t21;
1189
+ if ($[42] !== t20) {
1190
+ t21 = /* @__PURE__ */ jsx("span", { children: t20 });
1191
+ $[42] = t20;
1192
+ $[43] = t21;
1193
+ } else t21 = $[43];
1194
+ let t22;
1195
+ if ($[44] !== t18 || $[45] !== t21) {
1196
+ t22 = /* @__PURE__ */ jsx(NavList.Root, { children: /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1197
+ href: "#account",
1198
+ tooltip: t18,
1199
+ children: [t19, t21]
1200
+ }) }) });
1201
+ $[44] = t18;
1202
+ $[45] = t21;
1203
+ $[46] = t22;
1204
+ } else t22 = $[46];
1205
+ let t23;
1206
+ if ($[47] !== t17 || $[48] !== t22) {
1207
+ t23 = /* @__PURE__ */ jsx(Footer, { children: /* @__PURE__ */ jsx(Nav, {
1208
+ "aria-label": t17,
1209
+ children: t22
1210
+ }) });
1211
+ $[47] = t17;
1212
+ $[48] = t22;
1213
+ $[49] = t23;
1214
+ } else t23 = $[49];
1215
+ let t24;
1216
+ if ($[50] !== t11 || $[51] !== t16 || $[52] !== t23) {
1217
+ t24 = /* @__PURE__ */ jsx(Navbar, {
1218
+ collapse: "icons",
1219
+ foldsBelow: "sm",
1220
+ children: /* @__PURE__ */ jsxs(Root, {
1221
+ variant: "subtle",
1222
+ children: [
1223
+ t11,
1224
+ t16,
1225
+ t23
1226
+ ]
1227
+ })
1228
+ });
1229
+ $[50] = t11;
1230
+ $[51] = t16;
1231
+ $[52] = t23;
1232
+ $[53] = t24;
1233
+ } else t24 = $[53];
1234
+ let t25;
1235
+ if ($[54] !== t) {
1236
+ t25 = t("runs");
1237
+ $[54] = t;
1238
+ $[55] = t25;
1239
+ } else t25 = $[55];
1240
+ let t26;
1241
+ if ($[56] !== t25) {
1242
+ t26 = /* @__PURE__ */ jsx(Title, {
1243
+ as: "h3",
1244
+ children: t25
1245
+ });
1246
+ $[56] = t25;
1247
+ $[57] = t26;
1248
+ } else t26 = $[57];
1249
+ let t27;
1250
+ if ($[58] !== t) {
1251
+ t27 = t("runsAbout");
1252
+ $[58] = t;
1253
+ $[59] = t27;
1254
+ } else t27 = $[59];
1255
+ let t28;
1256
+ if ($[60] !== t27) {
1257
+ t28 = /* @__PURE__ */ jsx(Description, { children: t27 });
1258
+ $[60] = t27;
1259
+ $[61] = t28;
1260
+ } else t28 = $[61];
1261
+ let t29;
1262
+ if ($[62] !== t26 || $[63] !== t28) {
1263
+ t29 = /* @__PURE__ */ jsx(Main, { children: /* @__PURE__ */ jsx(Root$1, {
1264
+ size: "sm",
1265
+ children: /* @__PURE__ */ jsxs(Header$2, { children: [t26, t28] })
1266
+ }) });
1267
+ $[62] = t26;
1268
+ $[63] = t28;
1269
+ $[64] = t29;
1270
+ } else t29 = $[64];
1271
+ let t30;
1272
+ if ($[65] !== t24 || $[66] !== t29) {
1273
+ t30 = /* @__PURE__ */ jsxs(Body, { children: [t24, t29] });
1274
+ $[65] = t24;
1275
+ $[66] = t29;
1276
+ $[67] = t30;
1277
+ } else t30 = $[67];
1278
+ let t31;
1279
+ if ($[68] !== props || $[69] !== t2 || $[70] !== t30) {
1280
+ t31 = /* @__PURE__ */ jsxs(Root$2, {
1281
+ ...props,
1282
+ children: [t2, t30]
1283
+ });
1284
+ $[68] = props;
1285
+ $[69] = t2;
1286
+ $[70] = t30;
1287
+ $[71] = t31;
1288
+ } else t31 = $[71];
1289
+ return t31;
1290
+ }
1291
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport {\n GitBranchIcon,\n HouseIcon,\n MenuIcon,\n PlayIcon,\n SearchIcon,\n ShieldCheckIcon,\n UserIcon,\n XIcon,\n} from \"lucide-react\";\n\nimport { Button, ButtonPropsProvider } from \"@stealthscale/component-actions\";\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { AppShell, Page, Sidebar } from \"@stealthscale/component-screen\";\n\nconst GHOST = { shape: \"square\", size: \"sm\", variant: \"ghost\" } as const;\n\nconst PAGES = [\n [\"overview\", HouseIcon, undefined],\n [\"runs\", PlayIcon, \"page\"],\n [\"pipelines\", GitBranchIcon, undefined],\n [\"approvals\", ShieldCheckIcon, undefined],\n] as const;\n\nexport function Shell(props: AppShell.RootProps): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <AppShell.Root {...props}>\n <AppShell.Header>\n <ButtonPropsProvider value={GHOST}>\n <AppShell.Trigger aria-label={t(\"navigation\")} as={Button}>\n <MenuIcon />\n </AppShell.Trigger>\n </ButtonPropsProvider>\n </AppShell.Header>\n <AppShell.Body>\n <AppShell.Navbar collapse=\"icons\" foldsBelow=\"sm\">\n <Sidebar.Root variant=\"subtle\">\n <Sidebar.Header>\n <Text as=\"p\" size=\"sm\" truncate weight=\"medium\">\n {t(\"ledger\")}\n </Text>\n <Sidebar.Search\n aria-label={t(\"findPage\")}\n clearIndicator={<XIcon />}\n clearLabel={t(\"clearFilter\")}\n placeholder={t(\"filter\")}\n searchIndicator={<SearchIcon />}\n />\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(\"platform\")}</Sidebar.NavLabel>\n <NavList.Root>\n {PAGES.map(([page, Glyph, current]) => (\n <NavList.Item key={page}>\n <NavList.Link aria-current={current} href={`#${page}`} tooltip={t(page)}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n <Sidebar.Footer>\n <Sidebar.Nav aria-label={t(\"account\")}>\n <NavList.Root>\n <NavList.Item>\n <NavList.Link href=\"#account\" tooltip={t(\"person\")}>\n <UserIcon />\n <span>{t(\"person\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Footer>\n </Sidebar.Root>\n </AppShell.Navbar>\n <AppShell.Main>\n <Page.Root size=\"sm\">\n <Page.Header>\n <Page.Title as=\"h3\">{t(\"runs\")}</Page.Title>\n <Page.Description>{t(\"runsAbout\")}</Page.Description>\n </Page.Header>\n </Page.Root>\n </AppShell.Main>\n </AppShell.Body>\n </AppShell.Root>\n );\n}\n";
1292
+ //#endregion
1293
+ //#region src/sidebar/examples/sizes.example.tsx
1294
+ var sizes_example_exports = /* @__PURE__ */ __exportAll({
1295
+ Sizes: () => Sizes,
1296
+ source: () => source$1
1297
+ });
1298
+ const SIZES = [
1299
+ {
1300
+ label: "reports",
1301
+ pages: [["revenue", TrendingUpIcon], ["expenses", ReceiptIcon]],
1302
+ size: "sm"
1303
+ },
1304
+ {
1305
+ label: "customers",
1306
+ pages: [["active", UserCheckIcon], ["archived", ArchiveIcon]],
1307
+ size: "md"
1308
+ },
1309
+ {
1310
+ label: "settings",
1311
+ pages: [["general", SettingsIcon], ["billing", CreditCardIcon]],
1312
+ size: "lg"
1313
+ }
1314
+ ];
1315
+ function Sizes() {
1316
+ const $ = c(4);
1317
+ const { t } = useWords("sidebar");
1318
+ let t0;
1319
+ if ($[0] !== t) {
1320
+ t0 = SIZES.map((t1) => {
1321
+ const { label, pages, size } = t1;
1322
+ return /* @__PURE__ */ jsxs(Root, {
1323
+ size,
1324
+ variant: "outline",
1325
+ children: [/* @__PURE__ */ jsxs(Header, { children: [/* @__PURE__ */ jsx("span", { children: t("acme") }), /* @__PURE__ */ jsx(Search, {
1326
+ "aria-label": t("findPageIn", { section: t(label) }),
1327
+ placeholder: t("filter"),
1328
+ searchIndicator: /* @__PURE__ */ jsx(SearchIcon, {})
1329
+ })] }), /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [/* @__PURE__ */ jsx(NavLabel, {
1330
+ as: "h3",
1331
+ children: t(label)
1332
+ }), /* @__PURE__ */ jsx(NavList.Root, { children: pages.map((t2, at) => {
1333
+ const [page, Glyph] = t2;
1334
+ return /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1335
+ "aria-current": at === 0 ? "page" : void 0,
1336
+ href: `#${page}`,
1337
+ children: [/* @__PURE__ */ jsx(Glyph, {}), /* @__PURE__ */ jsx("span", { children: t(page) })]
1338
+ }) }, page);
1339
+ }) })] }) })]
1340
+ }, size);
1341
+ });
1342
+ $[0] = t;
1343
+ $[1] = t0;
1344
+ } else t0 = $[1];
1345
+ let t1;
1346
+ if ($[2] !== t0) {
1347
+ t1 = /* @__PURE__ */ jsx(Stack, {
1348
+ gap: "lg",
1349
+ children: t0
1350
+ });
1351
+ $[2] = t0;
1352
+ $[3] = t1;
1353
+ } else t1 = $[3];
1354
+ return t1;
1355
+ }
1356
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport {\n ArchiveIcon,\n CreditCardIcon,\n ReceiptIcon,\n SearchIcon,\n SettingsIcon,\n TrendingUpIcon,\n UserCheckIcon,\n} from \"lucide-react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nconst SIZES = [\n {\n label: \"reports\",\n pages: [\n [\"revenue\", TrendingUpIcon],\n [\"expenses\", ReceiptIcon],\n ],\n size: \"sm\",\n },\n {\n label: \"customers\",\n pages: [\n [\"active\", UserCheckIcon],\n [\"archived\", ArchiveIcon],\n ],\n size: \"md\",\n },\n {\n label: \"settings\",\n pages: [\n [\"general\", SettingsIcon],\n [\"billing\", CreditCardIcon],\n ],\n size: \"lg\",\n },\n] as const;\n\nexport function Sizes(): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <Stack gap=\"lg\">\n {SIZES.map(({ label, pages, size }) => (\n <Sidebar.Root key={size} size={size} variant=\"outline\">\n <Sidebar.Header>\n <span>{t(\"acme\")}</span>\n <Sidebar.Search\n aria-label={t(\"findPageIn\", { section: t(label) })}\n placeholder={t(\"filter\")}\n searchIndicator={<SearchIcon />}\n />\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(label)}</Sidebar.NavLabel>\n <NavList.Root>\n {pages.map(([page, Glyph], at) => (\n <NavList.Item key={page}>\n <NavList.Link aria-current={at === 0 ? \"page\" : undefined} href={`#${page}`}>\n <Glyph />\n <span>{t(page)}</span>\n </NavList.Link>\n </NavList.Item>\n ))}\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n </Sidebar.Root>\n ))}\n </Stack>\n );\n}\n";
1357
+ //#endregion
1358
+ //#region src/sidebar/examples/workspace.example.tsx
1359
+ var workspace_example_exports = /* @__PURE__ */ __exportAll({
1360
+ Workspace: () => Workspace,
1361
+ source: () => source
1362
+ });
1363
+ function Workspace(props) {
1364
+ const $ = c(53);
1365
+ const { t } = useWords("sidebar");
1366
+ let t0;
1367
+ if ($[0] !== t) {
1368
+ t0 = t("acme");
1369
+ $[0] = t;
1370
+ $[1] = t0;
1371
+ } else t0 = $[1];
1372
+ let t1;
1373
+ if ($[2] !== t) {
1374
+ t1 = t("production");
1375
+ $[2] = t;
1376
+ $[3] = t1;
1377
+ } else t1 = $[3];
1378
+ let t2;
1379
+ if ($[4] !== t1) {
1380
+ t2 = /* @__PURE__ */ jsx(Text, {
1381
+ as: "span",
1382
+ size: "sm",
1383
+ tone: "subtle",
1384
+ weight: "normal",
1385
+ children: t1
1386
+ });
1387
+ $[4] = t1;
1388
+ $[5] = t2;
1389
+ } else t2 = $[5];
1390
+ let t3;
1391
+ if ($[6] !== t0 || $[7] !== t2) {
1392
+ t3 = /* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsxs(Text, {
1393
+ as: "p",
1394
+ size: "sm",
1395
+ truncate: true,
1396
+ weight: "medium",
1397
+ children: [
1398
+ t0,
1399
+ " ",
1400
+ t2
1401
+ ]
1402
+ }) });
1403
+ $[6] = t0;
1404
+ $[7] = t2;
1405
+ $[8] = t3;
1406
+ } else t3 = $[8];
1407
+ let t4;
1408
+ if ($[9] !== t) {
1409
+ t4 = t("workspace");
1410
+ $[9] = t;
1411
+ $[10] = t4;
1412
+ } else t4 = $[10];
1413
+ let t5;
1414
+ if ($[11] !== t4) {
1415
+ t5 = /* @__PURE__ */ jsx(NavLabel, {
1416
+ as: "h3",
1417
+ children: t4
1418
+ });
1419
+ $[11] = t4;
1420
+ $[12] = t5;
1421
+ } else t5 = $[12];
1422
+ let t6;
1423
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
1424
+ t6 = /* @__PURE__ */ jsx(LayoutDashboardIcon, {});
1425
+ $[13] = t6;
1426
+ } else t6 = $[13];
1427
+ let t7;
1428
+ if ($[14] !== t) {
1429
+ t7 = t("overview");
1430
+ $[14] = t;
1431
+ $[15] = t7;
1432
+ } else t7 = $[15];
1433
+ let t8;
1434
+ if ($[16] !== t7) {
1435
+ t8 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1436
+ "aria-current": "page",
1437
+ href: "#overview",
1438
+ children: [t6, /* @__PURE__ */ jsx("span", { children: t7 })]
1439
+ }) });
1440
+ $[16] = t7;
1441
+ $[17] = t8;
1442
+ } else t8 = $[17];
1443
+ let t9;
1444
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
1445
+ t9 = /* @__PURE__ */ jsx(FileTextIcon, {});
1446
+ $[18] = t9;
1447
+ } else t9 = $[18];
1448
+ let t10;
1449
+ if ($[19] !== t) {
1450
+ t10 = t("invoices");
1451
+ $[19] = t;
1452
+ $[20] = t10;
1453
+ } else t10 = $[20];
1454
+ let t11;
1455
+ if ($[21] !== t10) {
1456
+ t11 = /* @__PURE__ */ jsxs(NavList.Link, {
1457
+ href: "#invoices",
1458
+ children: [t9, /* @__PURE__ */ jsx("span", { children: t10 })]
1459
+ });
1460
+ $[21] = t10;
1461
+ $[22] = t11;
1462
+ } else t11 = $[22];
1463
+ let t12;
1464
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
1465
+ t12 = /* @__PURE__ */ jsx(NavList.Badge, { children: "3" });
1466
+ $[23] = t12;
1467
+ } else t12 = $[23];
1468
+ let t13;
1469
+ if ($[24] !== t11) {
1470
+ t13 = /* @__PURE__ */ jsxs(NavList.Item, { children: [t11, t12] });
1471
+ $[24] = t11;
1472
+ $[25] = t13;
1473
+ } else t13 = $[25];
1474
+ let t14;
1475
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
1476
+ t14 = /* @__PURE__ */ jsx(UsersIcon, {});
1477
+ $[26] = t14;
1478
+ } else t14 = $[26];
1479
+ let t15;
1480
+ if ($[27] !== t) {
1481
+ t15 = t("customers");
1482
+ $[27] = t;
1483
+ $[28] = t15;
1484
+ } else t15 = $[28];
1485
+ let t16;
1486
+ if ($[29] !== t15) {
1487
+ t16 = /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1488
+ href: "#customers",
1489
+ children: [t14, /* @__PURE__ */ jsx("span", { children: t15 })]
1490
+ }) });
1491
+ $[29] = t15;
1492
+ $[30] = t16;
1493
+ } else t16 = $[30];
1494
+ let t17;
1495
+ if ($[31] !== t13 || $[32] !== t16 || $[33] !== t8) {
1496
+ t17 = /* @__PURE__ */ jsxs(NavList.Root, { children: [
1497
+ t8,
1498
+ t13,
1499
+ t16
1500
+ ] });
1501
+ $[31] = t13;
1502
+ $[32] = t16;
1503
+ $[33] = t8;
1504
+ $[34] = t17;
1505
+ } else t17 = $[34];
1506
+ let t18;
1507
+ if ($[35] !== t17 || $[36] !== t5) {
1508
+ t18 = /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Nav, { children: [t5, t17] }) });
1509
+ $[35] = t17;
1510
+ $[36] = t5;
1511
+ $[37] = t18;
1512
+ } else t18 = $[37];
1513
+ let t19;
1514
+ if ($[38] !== t) {
1515
+ t19 = t("account");
1516
+ $[38] = t;
1517
+ $[39] = t19;
1518
+ } else t19 = $[39];
1519
+ let t20;
1520
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
1521
+ t20 = /* @__PURE__ */ jsx(UserIcon, {});
1522
+ $[40] = t20;
1523
+ } else t20 = $[40];
1524
+ let t21;
1525
+ if ($[41] !== t) {
1526
+ t21 = t("person");
1527
+ $[41] = t;
1528
+ $[42] = t21;
1529
+ } else t21 = $[42];
1530
+ let t22;
1531
+ if ($[43] !== t21) {
1532
+ t22 = /* @__PURE__ */ jsx(NavList.Root, { children: /* @__PURE__ */ jsx(NavList.Item, { children: /* @__PURE__ */ jsxs(NavList.Link, {
1533
+ href: "#account",
1534
+ children: [t20, /* @__PURE__ */ jsx("span", { children: t21 })]
1535
+ }) }) });
1536
+ $[43] = t21;
1537
+ $[44] = t22;
1538
+ } else t22 = $[44];
1539
+ let t23;
1540
+ if ($[45] !== t19 || $[46] !== t22) {
1541
+ t23 = /* @__PURE__ */ jsx(Footer, { children: /* @__PURE__ */ jsx(Nav, {
1542
+ "aria-label": t19,
1543
+ children: t22
1544
+ }) });
1545
+ $[45] = t19;
1546
+ $[46] = t22;
1547
+ $[47] = t23;
1548
+ } else t23 = $[47];
1549
+ let t24;
1550
+ if ($[48] !== props || $[49] !== t18 || $[50] !== t23 || $[51] !== t3) {
1551
+ t24 = /* @__PURE__ */ jsxs(Root, {
1552
+ ...props,
1553
+ children: [
1554
+ t3,
1555
+ t18,
1556
+ t23
1557
+ ]
1558
+ });
1559
+ $[48] = props;
1560
+ $[49] = t18;
1561
+ $[50] = t23;
1562
+ $[51] = t3;
1563
+ $[52] = t24;
1564
+ } else t24 = $[52];
1565
+ return t24;
1566
+ }
1567
+ const source = "import { type ReactElement } from \"react\";\n\nimport { FileTextIcon, LayoutDashboardIcon, UserIcon, UsersIcon } from \"lucide-react\";\n\nimport { NavList } from \"@stealthscale/component-navigation\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sidebar } from \"@stealthscale/component-screen\";\n\nexport function Workspace(props: Sidebar.RootProps): ReactElement {\n const { t } = useWords(\"sidebar\");\n\n return (\n <Sidebar.Root {...props}>\n <Sidebar.Header>\n <Text as=\"p\" size=\"sm\" truncate weight=\"medium\">\n {t(\"acme\")}{\" \"}\n <Text as=\"span\" size=\"sm\" tone=\"subtle\" weight=\"normal\">\n {t(\"production\")}\n </Text>\n </Text>\n </Sidebar.Header>\n <Sidebar.Content>\n <Sidebar.Nav>\n <Sidebar.NavLabel as=\"h3\">{t(\"workspace\")}</Sidebar.NavLabel>\n <NavList.Root>\n <NavList.Item>\n <NavList.Link aria-current=\"page\" href=\"#overview\">\n <LayoutDashboardIcon />\n <span>{t(\"overview\")}</span>\n </NavList.Link>\n </NavList.Item>\n <NavList.Item>\n <NavList.Link href=\"#invoices\">\n <FileTextIcon />\n <span>{t(\"invoices\")}</span>\n </NavList.Link>\n <NavList.Badge>3</NavList.Badge>\n </NavList.Item>\n <NavList.Item>\n <NavList.Link href=\"#customers\">\n <UsersIcon />\n <span>{t(\"customers\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Content>\n <Sidebar.Footer>\n <Sidebar.Nav aria-label={t(\"account\")}>\n <NavList.Root>\n <NavList.Item>\n <NavList.Link href=\"#account\">\n <UserIcon />\n <span>{t(\"person\")}</span>\n </NavList.Link>\n </NavList.Item>\n </NavList.Root>\n </Sidebar.Nav>\n </Sidebar.Footer>\n </Sidebar.Root>\n );\n}\n";
1568
+ //#endregion
1569
+ //#region src/sidebar/sidebar.specimen.tsx
1570
+ /**
1571
+ * Catalogue page for the sidebar.
1572
+ *
1573
+ * @remarks
1574
+ * The first three scenes render an operations console: in full in a box as wide as a sidebar, in
1575
+ * an app shell whose navigation closes to icons, and in the same shell at a phone's width. The
1576
+ * kit's `Screen` gives each shell a window of a fixed height and contains the phone's sheet.
1577
+ * `scenesOf` generates the looks from the workspace example in an `xs` room, the width of a
1578
+ * sidebar. The sizes scene renders the sizes example, because the search field takes the size
1579
+ * through the sidebar. The rail scene renders without a room, because a rail is as wide as its
1580
+ * icons. The filter scene types a query that matches no page into the example's own field, so
1581
+ * the empty message renders. The rooms, the boxes and the typing never appear in the examples.
1582
+ * The words are keys under `sidebar` in `locales/en/specimen/sidebar.json`.
1583
+ */
1584
+ /**
1585
+ * Renders a sidebar and types a query into its search field after it mounts.
1586
+ *
1587
+ * @remarks
1588
+ * The staging sets the field's value through the input element's own setter and dispatches an
1589
+ * `input` event, so the example's change handler filters the pages the way it does under a
1590
+ * keyboard.
1591
+ */
1592
+ function Typed(t0) {
1593
+ const $ = c(6);
1594
+ const { children } = t0;
1595
+ const { t } = useWords("sidebar");
1596
+ const [box, setBox] = useState(null);
1597
+ let t1;
1598
+ let t2;
1599
+ if ($[0] !== box || $[1] !== t) {
1600
+ t1 = () => {
1601
+ const input = box?.querySelector("input");
1602
+ if (input === void 0 || input === null) return;
1603
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(input, t("query"));
1604
+ input.dispatchEvent(new Event("input", { bubbles: true }));
1605
+ };
1606
+ t2 = [box, t];
1607
+ $[0] = box;
1608
+ $[1] = t;
1609
+ $[2] = t1;
1610
+ $[3] = t2;
1611
+ } else {
1612
+ t1 = $[2];
1613
+ t2 = $[3];
1614
+ }
1615
+ useEffect(t1, t2);
1616
+ let t3;
1617
+ if ($[4] !== children) {
1618
+ t3 = /* @__PURE__ */ jsx("div", {
1619
+ ref: setBox,
1620
+ children
1621
+ });
1622
+ $[4] = children;
1623
+ $[5] = t3;
1624
+ } else t3 = $[5];
1625
+ return t3;
1626
+ }
1627
+ /**
1628
+ * Hand-written scene for the console sidebar in full.
1629
+ */
1630
+ const whole = {
1631
+ about: "sidebar.whole.about",
1632
+ draw: () => /* @__PURE__ */ jsx(Room, {
1633
+ size: "xs",
1634
+ children: /* @__PURE__ */ jsx(Sample, {
1635
+ place: "stretch",
1636
+ variant: "outline",
1637
+ children: /* @__PURE__ */ jsx(Console, {})
1638
+ })
1639
+ }),
1640
+ example: console_example_exports,
1641
+ title: "sidebar.whole.title"
1642
+ };
1643
+ /**
1644
+ * Hand-written scene for the sidebar in an app shell panel that closes to icons.
1645
+ */
1646
+ const shell = {
1647
+ about: "sidebar.shell.about",
1648
+ draw: () => /* @__PURE__ */ jsx(Screen, {
1649
+ size: "lg",
1650
+ children: /* @__PURE__ */ jsx(Shell, {})
1651
+ }),
1652
+ example: shell_example_exports,
1653
+ frame: "bleed",
1654
+ title: "sidebar.shell.title"
1655
+ };
1656
+ /**
1657
+ * Hand-written scene for the sidebar as a sheet with a bar of destinations at a phone's width.
1658
+ */
1659
+ const phone = {
1660
+ about: "sidebar.phone.about",
1661
+ draw: () => /* @__PURE__ */ jsx(Room, {
1662
+ size: "sm",
1663
+ children: /* @__PURE__ */ jsx(Screen, {
1664
+ size: "lg",
1665
+ children: /* @__PURE__ */ jsx(Phone, {})
1666
+ })
1667
+ }),
1668
+ example: phone_example_exports,
1669
+ title: "sidebar.phone.title"
1670
+ };
1671
+ /**
1672
+ * Hand-written scene for the three sizes.
1673
+ */
1674
+ const sizes = {
1675
+ about: "sidebar.size.about",
1676
+ axes: ["size"],
1677
+ draw: () => /* @__PURE__ */ jsx(Room, {
1678
+ size: "xs",
1679
+ children: /* @__PURE__ */ jsx(Sizes, {})
1680
+ }),
1681
+ example: sizes_example_exports,
1682
+ title: "sidebar.size.title"
1683
+ };
1684
+ /**
1685
+ * Hand-written scene for the sidebar collapsed to a rail.
1686
+ */
1687
+ const rail = {
1688
+ about: "sidebar.rail.about",
1689
+ draw: Rail,
1690
+ example: rail_example_exports,
1691
+ title: "sidebar.rail.title"
1692
+ };
1693
+ /**
1694
+ * Hand-written scene for one nav block with a heading over each list.
1695
+ */
1696
+ const headings = {
1697
+ about: "sidebar.headings.about",
1698
+ draw: () => /* @__PURE__ */ jsx(Room, {
1699
+ size: "xs",
1700
+ children: /* @__PURE__ */ jsx(Guides, {})
1701
+ }),
1702
+ example: guides_example_exports,
1703
+ title: "sidebar.headings.title"
1704
+ };
1705
+ /**
1706
+ * Hand-written scene for the search that matches no page.
1707
+ */
1708
+ const filtering = {
1709
+ about: "sidebar.filtering.about",
1710
+ draw: () => /* @__PURE__ */ jsx(Room, {
1711
+ size: "xs",
1712
+ children: /* @__PURE__ */ jsx(Typed, { children: /* @__PURE__ */ jsx(Filter, {}) })
1713
+ }),
1714
+ example: filter_example_exports,
1715
+ title: "sidebar.filtering.title"
1716
+ };
1717
+ var sidebar_specimen_default = specimen({
1718
+ about: "sidebar.about",
1719
+ id: "components/screen/sidebar",
1720
+ imports: "import { AppShell, Sidebar } from \"@stealthscale/component-screen\";",
1721
+ scenes: [
1722
+ whole,
1723
+ shell,
1724
+ phone,
1725
+ ...scenesOf(recipe, {
1726
+ draw: (props) => /* @__PURE__ */ jsx(Room, {
1727
+ size: "xs",
1728
+ children: /* @__PURE__ */ jsx(Workspace, { ...props })
1729
+ }),
1730
+ example: workspace_example_exports,
1731
+ namespace: "sidebar",
1732
+ order: ["variant"],
1733
+ skip: { size: "The sizes scene renders every size with its lists and fields at the same size." }
1734
+ }),
1735
+ sizes,
1736
+ rail,
1737
+ headings,
1738
+ filtering
1739
+ ],
1740
+ title: "sidebar.title"
1741
+ });
1742
+ //#endregion
1743
+ export { sidebar_specimen_default as default, filtering, headings, phone, rail, shell, sizes, whole };