@nikala-ui/folio 0.14.0 → 0.15.0

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 (107) hide show
  1. package/README.md +16 -0
  2. package/dist/cli/commands/init.js +21 -2
  3. package/dist/client/app.jsx +6 -3
  4. package/dist/client/components/docs-layout-shell.d.ts +1 -0
  5. package/dist/client/components/docs-layout-shell.jsx +1 -1
  6. package/dist/client/components/docs-page-content.jsx +9 -5
  7. package/dist/client/navigation/page-navigation.js +10 -27
  8. package/dist/client/public/algolia-logo.svg +15 -0
  9. package/dist/client/public/favicon.ico +0 -0
  10. package/dist/client/public/logo.svg +11 -0
  11. package/dist/client/routing/use-docs-router.d.ts +1 -0
  12. package/dist/client/routing/use-docs-router.js +12 -3
  13. package/dist/client/style.css +139 -55
  14. package/dist/components/ui/api-table.jsx +6 -4
  15. package/dist/components/ui/code-block.jsx +6 -4
  16. package/dist/components/ui/command.jsx +9 -5
  17. package/dist/components/ui/list.jsx +3 -1
  18. package/dist/components/ui/logo.d.ts +4 -1
  19. package/dist/components/ui/logo.jsx +8 -22
  20. package/dist/components/ui/package-manager-tabs.jsx +4 -2
  21. package/dist/components/ui/pager.jsx +4 -2
  22. package/dist/components/ui/section-heading.jsx +1 -1
  23. package/dist/components/ui/sidebar.jsx +6 -3
  24. package/dist/components/ui/spinner.jsx +3 -1
  25. package/dist/components/ui/theme-toggle.jsx +14 -12
  26. package/dist/config.d.ts +1 -0
  27. package/dist/config.js +84 -29
  28. package/dist/core/content-scanner.d.ts +2 -1
  29. package/dist/core/content-scanner.js +2 -9
  30. package/dist/core/plugin/index.d.ts +2 -0
  31. package/dist/core/plugin/index.js +1 -0
  32. package/dist/core/plugin/lifecycle-error.d.ts +19 -0
  33. package/dist/core/plugin/lifecycle-error.js +28 -0
  34. package/dist/core/plugin/lifecycle-snapshot.d.ts +1 -0
  35. package/dist/core/plugin/lifecycle-snapshot.js +156 -0
  36. package/dist/core/plugin/lifecycle.d.ts +34 -0
  37. package/dist/core/plugin/lifecycle.js +170 -0
  38. package/dist/core/route-tree.d.ts +3 -2
  39. package/dist/core/route-tree.js +40 -10
  40. package/dist/index.d.ts +5 -3
  41. package/dist/index.js +3 -3
  42. package/dist/plugin.d.ts +60 -0
  43. package/dist/plugin.js +51 -0
  44. package/dist/plugins/i18n/components/site-language-switcher.d.ts +10 -0
  45. package/dist/plugins/i18n/components/site-language-switcher.jsx +39 -0
  46. package/dist/plugins/i18n/constants.d.ts +1 -0
  47. package/dist/plugins/i18n/constants.js +1 -0
  48. package/dist/plugins/i18n/index.d.ts +11 -0
  49. package/dist/plugins/i18n/index.js +89 -0
  50. package/dist/plugins/i18n/navigation.d.ts +5 -0
  51. package/dist/plugins/i18n/navigation.js +33 -0
  52. package/dist/plugins/i18n/runtime.d.ts +19 -0
  53. package/dist/plugins/i18n/runtime.jsx +65 -0
  54. package/dist/plugins/i18n/site-locale.d.ts +12 -0
  55. package/dist/plugins/i18n/site-locale.js +119 -0
  56. package/dist/server/index.d.ts +4 -1
  57. package/dist/server/index.js +69 -33
  58. package/dist/server/module-serialization.d.ts +6 -0
  59. package/dist/server/module-serialization.js +26 -0
  60. package/dist/server/plugin/components.d.ts +7 -0
  61. package/dist/server/plugin/components.js +82 -0
  62. package/dist/server/plugin/constants.d.ts +17 -0
  63. package/dist/server/plugin/constants.js +21 -0
  64. package/dist/server/{plugin.d.ts → plugin/index.d.ts} +3 -1
  65. package/dist/server/plugin/index.js +166 -0
  66. package/dist/server/plugin/lifecycle.d.ts +32 -0
  67. package/dist/server/plugin/lifecycle.js +110 -0
  68. package/dist/server/plugin/styles.d.ts +3 -0
  69. package/dist/server/plugin/styles.js +22 -0
  70. package/dist/server/plugin/virtual-modules.d.ts +11 -0
  71. package/dist/server/plugin/virtual-modules.js +88 -0
  72. package/dist/server/seo.d.ts +4 -0
  73. package/dist/server/seo.js +87 -0
  74. package/dist/themes/default/content/breadcrumbs.jsx +5 -2
  75. package/dist/themes/default/content/table-of-contents.jsx +3 -1
  76. package/dist/themes/default/layout.jsx +39 -12
  77. package/dist/themes/default/navbar.jsx +14 -7
  78. package/dist/themes/default/navigation/mobile-table-of-contents.jsx +3 -1
  79. package/dist/themes/default/navigation/sidebar-tree.d.ts +2 -0
  80. package/dist/themes/default/navigation/sidebar-tree.jsx +11 -2
  81. package/dist/themes/default/overlays/search-dialog.jsx +14 -3
  82. package/dist/themes/default/sidebar.jsx +7 -5
  83. package/dist/themes/types.d.ts +5 -0
  84. package/dist/types.d.ts +36 -0
  85. package/dist/utils/format-title.d.ts +1 -0
  86. package/dist/utils/format-title.js +11 -0
  87. package/dist/vendor/docs-src/components/ui/api-table.tsx +6 -4
  88. package/dist/vendor/docs-src/components/ui/code-block.tsx +6 -4
  89. package/dist/vendor/docs-src/components/ui/command.tsx +9 -5
  90. package/dist/vendor/docs-src/components/ui/list.tsx +4 -2
  91. package/dist/vendor/docs-src/components/ui/logo.tsx +19 -48
  92. package/dist/vendor/docs-src/components/ui/package-manager-tabs.tsx +4 -2
  93. package/dist/vendor/docs-src/components/ui/pager.tsx +4 -2
  94. package/dist/vendor/docs-src/components/ui/section-heading.tsx +5 -1
  95. package/dist/vendor/docs-src/components/ui/sidebar.tsx +7 -4
  96. package/dist/vendor/docs-src/components/ui/spinner.tsx +3 -1
  97. package/dist/vendor/docs-src/components/ui/theme-toggle.tsx +15 -13
  98. package/dist/vendor/docs-src/plugins/i18n/components/site-language-switcher.tsx +56 -0
  99. package/dist/vendor/docs-src/plugins/i18n/constants.ts +1 -0
  100. package/dist/vendor/docs-src/plugins/i18n/index.ts +110 -0
  101. package/dist/vendor/docs-src/plugins/i18n/navigation.ts +49 -0
  102. package/dist/vendor/docs-src/plugins/i18n/runtime.tsx +91 -0
  103. package/dist/vendor/docs-src/plugins/i18n/site-locale.ts +140 -0
  104. package/dist/version.d.ts +1 -1
  105. package/dist/version.js +1 -1
  106. package/package.json +11 -4
  107. package/dist/server/plugin.js +0 -521
@@ -15,6 +15,7 @@ import {
15
15
  TableCell,
16
16
  } from "@/components/ui/table";
17
17
  import { cn } from "@/lib/cn";
18
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
18
19
 
19
20
  export interface ApiTableItem {
20
21
  /** Property, attribute, or method name */
@@ -45,6 +46,7 @@ export interface ApiTableProps extends JSX.HTMLAttributes<HTMLDivElement> {
45
46
  * Clean, structured API reference table component composed from Table and Badge primitives.
46
47
  */
47
48
  export const ApiTable: Component<ApiTableProps> = (props) => {
49
+ const siteLocale = useSiteLocale();
48
50
  const [local, rest] = splitProps(props, [
49
51
  "title",
50
52
  "description",
@@ -70,10 +72,10 @@ export const ApiTable: Component<ApiTableProps> = (props) => {
70
72
  <Table class="text-xs">
71
73
  <TableHeader class="bg-muted/40 font-mono text-[11px] uppercase tracking-wider text-muted-foreground select-none">
72
74
  <TableRow class="hover:bg-transparent">
73
- <TableHead class="h-9 px-4 font-semibold">Prop</TableHead>
74
- <TableHead class="h-9 px-4 font-semibold">Type</TableHead>
75
- <TableHead class="h-9 px-4 font-semibold">Default</TableHead>
76
- <TableHead class="h-9 px-4 font-semibold">Description</TableHead>
75
+ <TableHead class="h-9 px-4 font-semibold">{siteLocale.t("apiTable.property")}</TableHead>
76
+ <TableHead class="h-9 px-4 font-semibold">{siteLocale.t("apiTable.type")}</TableHead>
77
+ <TableHead class="h-9 px-4 font-semibold">{siteLocale.t("apiTable.default")}</TableHead>
78
+ <TableHead class="h-9 px-4 font-semibold">{siteLocale.t("apiTable.description")}</TableHead>
77
79
  </TableRow>
78
80
  </TableHeader>
79
81
  <TableBody class="font-mono text-xs">
@@ -14,6 +14,7 @@ import { Badge } from "@/components/ui/badge";
14
14
  import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
15
15
  import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
16
16
  import { createClipboard } from "@/hooks/create-clipboard";
17
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
17
18
  import { cn } from "@/lib/cn";
18
19
 
19
20
  export type CodeBlockPackageManager = "bunx" | "npx" | "pnpm" | "yarn";
@@ -151,6 +152,7 @@ function escapeHtml(str: string): string {
151
152
  }
152
153
 
153
154
  export const CodeBlock: ParentComponent<CodeBlockProps> = (props) => {
155
+ const siteLocale = useSiteLocale();
154
156
  const [local, rest] = splitProps(props, [
155
157
  "id",
156
158
  "code",
@@ -288,7 +290,7 @@ export const CodeBlock: ParentComponent<CodeBlockProps> = (props) => {
288
290
  variant="ghost"
289
291
  size="icon"
290
292
  onClick={handleCopy}
291
- aria-label={clipboard.copied() ? "Copied code" : "Copy code"}
293
+ aria-label={clipboard.copied() ? siteLocale.t("code.copied") : siteLocale.t("code.copy")}
292
294
  class="size-6 p-0 rounded-xs text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer"
293
295
  >
294
296
  <Show when={clipboard.copied()} fallback={<Copy class="size-3.5" />}>
@@ -296,7 +298,7 @@ export const CodeBlock: ParentComponent<CodeBlockProps> = (props) => {
296
298
  </Show>
297
299
  </TooltipTrigger>
298
300
  <TooltipContent class="text-[10px] py-1 px-2">
299
- {clipboard.copied() ? "Copied!" : "Copy code"}
301
+ {clipboard.copied() ? siteLocale.t("actions.copied") : siteLocale.t("code.copy")}
300
302
  </TooltipContent>
301
303
  </Tooltip>
302
304
  </Show>
@@ -312,7 +314,7 @@ export const CodeBlock: ParentComponent<CodeBlockProps> = (props) => {
312
314
  variant="outline"
313
315
  size="icon"
314
316
  onClick={handleCopy}
315
- aria-label={clipboard.copied() ? "Copied code" : "Copy code"}
317
+ aria-label={clipboard.copied() ? siteLocale.t("code.copied") : siteLocale.t("code.copy")}
316
318
  class="size-7 rounded-md border-border/80 bg-background/90 text-muted-foreground backdrop-blur-xs hover:bg-muted hover:text-foreground cursor-pointer shadow-2xs"
317
319
  >
318
320
  <Show when={clipboard.copied()} fallback={<Copy class="size-3.5" />}>
@@ -320,7 +322,7 @@ export const CodeBlock: ParentComponent<CodeBlockProps> = (props) => {
320
322
  </Show>
321
323
  </TooltipTrigger>
322
324
  <TooltipContent class="text-[10px] py-1 px-2">
323
- {clipboard.copied() ? "Copied!" : "Copy code"}
325
+ {clipboard.copied() ? siteLocale.t("actions.copied") : siteLocale.t("code.copy")}
324
326
  </TooltipContent>
325
327
  </Tooltip>
326
328
  </div>
@@ -13,6 +13,7 @@ import { createKeybindings } from "@/hooks/create-keybindings";
13
13
  import { Dialog } from "@kobalte/core/dialog";
14
14
  import { Search, ArrowUp, ArrowDown, CornerDownLeft } from "lucide-solid";
15
15
  import { cn } from "@/lib/cn";
16
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
16
17
  import { Kbd, KbdGroup } from "../ui/kbd";
17
18
  import { InputGroup, InputGroupInput, InputGroupAddon } from "../ui/input-group";
18
19
  import { List, ListGroup, ListHeader, ListItem, type ListItemProps } from "../ui/list";
@@ -193,6 +194,7 @@ export interface CommandInputProps
193
194
  export const CommandInput: Component<CommandInputProps> = (props) => {
194
195
  const [local, rest] = splitProps(props, ["class", "value", "onInput"]);
195
196
  const { search, setSearch } = useCommand();
197
+ const siteLocale = useSiteLocale();
196
198
 
197
199
  return (
198
200
  <InputGroup class="border-0 border-b border-border rounded-none bg-transparent px-3 py-1 shadow-none focus-within:ring-0 focus-within:border-border">
@@ -208,7 +210,7 @@ export const CommandInput: Component<CommandInputProps> = (props) => {
208
210
  local.onInput(e);
209
211
  }
210
212
  }}
211
- placeholder="Type a command or search..."
213
+ placeholder={siteLocale.t("search.commandPlaceholder")}
212
214
  class="h-11 text-base sm:text-sm font-medium"
213
215
  {...rest}
214
216
  />
@@ -242,6 +244,7 @@ export interface CommandEmptyProps extends JSX.HTMLAttributes<HTMLDivElement> {
242
244
  export const CommandEmpty: Component<CommandEmptyProps> = (props) => {
243
245
  const [local, rest] = splitProps(props, ["class", "children"]);
244
246
  const { search } = useCommand();
247
+ const siteLocale = useSiteLocale();
245
248
 
246
249
  return (
247
250
  <Show when={search().trim().length > 0}>
@@ -252,7 +255,7 @@ export const CommandEmpty: Component<CommandEmptyProps> = (props) => {
252
255
  )}
253
256
  {...rest}
254
257
  >
255
- {local.children || `No results found for "${search()}".`}
258
+ {local.children || siteLocale.t("search.noResults", { query: search() })}
256
259
  </div>
257
260
  </Show>
258
261
  );
@@ -347,6 +350,7 @@ export interface CommandFooterProps extends JSX.HTMLAttributes<HTMLDivElement> {
347
350
 
348
351
  export const CommandFooter: Component<CommandFooterProps> = (props) => {
349
352
  const [local, rest] = splitProps(props, ["class", "children"]);
353
+ const siteLocale = useSiteLocale();
350
354
 
351
355
  return (
352
356
  <div
@@ -362,17 +366,17 @@ export const CommandFooter: Component<CommandFooterProps> = (props) => {
362
366
  <Kbd size="sm"><ArrowUp class="w-2.5 h-2.5" /></Kbd>
363
367
  <Kbd size="sm"><ArrowDown class="w-2.5 h-2.5" /></Kbd>
364
368
  </KbdGroup>
365
- <span>Navigate</span>
369
+ <span>{siteLocale.t("command.navigate")}</span>
366
370
  </span>
367
371
 
368
372
  <span class="flex items-center gap-1">
369
373
  <Kbd size="sm"><CornerDownLeft class="w-2.5 h-2.5" /></Kbd>
370
- <span>Select</span>
374
+ <span>{siteLocale.t("command.select")}</span>
371
375
  </span>
372
376
 
373
377
  <span class="flex items-center gap-1">
374
378
  <Kbd size="sm">Esc</Kbd>
375
- <span>Close</span>
379
+ <span>{siteLocale.t("command.close")}</span>
376
380
  </span>
377
381
  </div>
378
382
 
@@ -9,6 +9,7 @@ import { Dynamic } from "solid-js/web";
9
9
  import { cva, type VariantProps } from "class-variance-authority";
10
10
  import { ChevronRight } from "lucide-solid";
11
11
  import { cn } from "@/lib/cn";
12
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
12
13
 
13
14
  /* --- List Container --- */
14
15
  export interface ListProps extends JSX.HTMLAttributes<HTMLDivElement> {
@@ -128,6 +129,7 @@ export const ListItem: Component<ListItemProps> = (props) => {
128
129
  "class",
129
130
  "children",
130
131
  ]);
132
+ const siteLocale = useSiteLocale();
131
133
 
132
134
  const content = () => (
133
135
  <>
@@ -136,7 +138,7 @@ export const ListItem: Component<ListItemProps> = (props) => {
136
138
  <Show when={local.avatar}>
137
139
  <img
138
140
  src={local.avatar}
139
- alt={local.title || "Avatar"}
141
+ alt={local.title || siteLocale.t("image.avatar")}
140
142
  class="w-10 h-10 rounded-lg object-cover shrink-0 border border-border"
141
143
  />
142
144
  </Show>
@@ -219,4 +221,4 @@ export const ListItem: Component<ListItemProps> = (props) => {
219
221
  </a>
220
222
  </Show>
221
223
  );
222
- };
224
+ };
@@ -6,63 +6,34 @@ export interface LogoProps extends JSX.SvgSVGAttributes<SVGSVGElement> {
6
6
  }
7
7
 
8
8
  /**
9
- * Official Nikala UI Logo Component with dynamic contrast stroke and accent fill.
9
+ * Folio mark with a theme-aware accent fill.
10
+ *
11
+ * The paths intentionally use currentColor so the mark follows the
12
+ * consuming project's primary theme token instead of a fixed brand color.
10
13
  */
11
14
  export const Logo: Component<LogoProps> = (props) => {
12
15
  const [local, rest] = splitProps(props, ["class"]);
13
16
 
14
17
  return (
15
18
  <svg
16
- viewBox="0 0 223 223"
19
+ viewBox="0 0 111 134"
17
20
  fill="none"
18
21
  xmlns="http://www.w3.org/2000/svg"
19
- class={cn("h-7 w-7 shrink-0 select-none", local.class)}
22
+ class={cn("h-7 w-auto shrink-0 select-none text-primary", local.class)}
20
23
  {...rest}
21
24
  >
22
- <g clip-path="url(#nikala-logo-clip0)">
23
- {/* Background Box with Dynamic Theme Accent */}
24
- <path
25
- d="M0 10C0 4.47716 4.47715 0 10 0H213C218.523 0 223 4.47715 223 10V213C223 218.523 218.523 223 213 223H10C4.47716 223 0 218.523 0 213V10Z"
26
- fill="currentColor"
27
- class="text-primary"
28
- />
29
- <g clip-path="url(#nikala-logo-clip1)">
30
- {/* Paintbrush Vector Paths Adapting to --primary-foreground */}
31
- <path
32
- d="M304.406 364.173C303.147 366.03 301.738 366.903 299.847 368.109C299.093 368.594 298.339 369.08 297.563 369.58C296.746 370.096 295.929 370.613 295.087 371.145C294.245 371.684 293.402 372.224 292.56 372.764C290.346 374.183 288.127 375.594 285.907 377.003C283.642 378.443 281.381 379.891 279.119 381.338C274.684 384.175 270.243 387.003 265.799 389.826C263.196 387.86 261.543 385.492 259.734 382.813C257.432 379.465 255.089 376.207 252.52 373.055C249.122 368.864 246.081 364.457 243.017 360.02C240.337 356.141 237.507 352.385 234.645 348.639C233.944 347.722 233.244 346.804 232.544 345.886C232.19 345.421 231.836 344.956 231.471 344.477C228.856 341.031 226.35 337.519 223.876 333.97C222.068 331.395 220.171 328.922 218.188 326.48C214.782 322.267 211.726 317.844 208.65 313.389C205.969 309.51 203.14 305.755 200.277 302.009C199.577 301.091 198.877 300.173 198.177 299.255C197.823 298.79 197.468 298.326 197.103 297.847C194.79 294.798 192.553 291.706 190.364 288.567C188.267 285.56 186.094 282.644 183.786 279.794C179.935 275.035 176.476 270.016 173.005 264.978C176.445 262.305 179.941 259.802 183.612 257.457C184.099 257.143 184.587 256.829 185.089 256.505C186.679 255.481 188.271 254.461 189.863 253.441C190.975 252.726 192.086 252.011 193.197 251.296C196.106 249.425 199.016 247.557 201.927 245.689C204.903 243.779 207.878 241.866 210.853 239.953C216.678 236.208 222.505 232.466 228.333 228.726C230.86 230.623 232.252 232.791 233.788 235.512C234.053 235.974 234.319 236.435 234.592 236.911C236.235 239.797 237.775 242.723 239.261 245.694C241.392 249.953 243.79 254.007 246.245 258.083C248.04 261.081 249.715 264.098 251.272 267.229C253.667 272.041 256.413 276.612 259.173 281.219C261.596 285.264 263.845 289.394 266.071 293.549C266.617 294.566 267.163 295.584 267.709 296.601C267.986 297.115 268.262 297.63 268.547 298.161C270.366 301.528 272.256 304.843 274.208 308.135C276.068 311.27 277.812 314.435 279.438 317.698C281.864 322.542 284.628 327.154 287.41 331.798C289.839 335.853 292.092 339.995 294.328 344.159C294.597 344.658 294.866 345.158 295.143 345.673C295.7 346.71 296.256 347.748 296.81 348.786C298.15 351.28 299.518 353.74 300.998 356.154C301.259 356.583 301.519 357.012 301.788 357.454C302.503 358.619 303.23 359.775 303.958 360.931C304.8 362.85 304.8 362.85 304.406 364.173Z"
33
- fill="var(--primary-foreground, #ffffff)"
34
- />
35
- <path
36
- d="M147.908 159.434C143.029 162.624 138.255 165.222 132.524 166.53C131.568 166.759 131.568 166.759 130.593 166.992C117.641 169.419 104.681 165.652 93.8424 158.557C84.6301 151.709 78.5873 142.443 75.2903 131.528C75.0234 130.675 75.0234 130.675 74.7511 129.804C72.9741 122.986 73.9008 115.665 74.4194 108.713C75.7267 91.1539 72.9686 78.0313 62.8484 63.365C61.808 61.5353 61.808 61.5353 62.2756 59.3756C74.2777 52.1095 87.8993 50.9005 101.359 53.9904C102.212 54.1829 103.066 54.3753 103.945 54.5736C110.197 56.0433 115.833 57.7788 121.484 60.8918C121.926 61.1331 122.368 61.3745 122.823 61.6232C141.727 72.123 158.382 89.1592 164.804 110.159C170.072 129.189 164.608 147.982 147.908 159.434Z"
37
- fill="var(--primary-foreground, #ffffff)"
38
- />
39
- <path
40
- d="M224.945 222.724C223.467 224.948 221.157 226.154 218.937 227.554C218.142 228.066 218.142 228.067 217.331 228.589C215.58 229.716 213.822 230.833 212.065 231.95C210.849 232.73 209.634 233.51 208.418 234.291C205.22 236.344 202.016 238.389 198.811 240.432C195.542 242.519 192.277 244.613 189.012 246.706C182.605 250.813 176.192 254.911 169.776 259.003C163.425 254.055 159.038 246.461 154.501 239.887C151.859 236.063 149.162 232.301 146.129 228.777C140.59 220.962 138.709 211.47 139.907 202.042C141.806 192.774 145.937 185.415 153.125 179.281C153.821 178.654 154.516 178.028 155.232 177.382C161.199 173.349 167.362 171.636 174.492 171.096C175.187 171.029 175.187 171.029 175.896 170.961C185.36 171.183 194.837 174.7 201.562 181.385C202.406 182.334 203.235 183.298 204.044 184.277C204.596 184.933 204.596 184.933 205.159 185.602C207.879 189.006 209.907 192.696 211.94 196.538C212.966 198.458 213.996 200.376 215.027 202.293C215.301 202.803 215.574 203.312 215.856 203.837C218.216 208.207 220.709 212.489 223.254 216.754C225.579 220.827 225.579 220.827 224.945 222.724Z"
41
- fill="var(--primary-foreground, #ffffff)"
42
- />
43
- <path
44
- d="M346.445 469.84C341.579 473.016 337.792 473.996 331.992 473.069C323.666 471.041 319.697 464.544 315.142 457.786C314.41 456.773 313.671 455.764 312.923 454.762C312.555 454.269 312.187 453.775 311.808 453.267C310.744 451.858 309.676 450.454 308.605 449.052C304.588 443.792 300.674 438.482 296.873 433.064C294.268 429.365 291.554 425.754 288.807 422.16C288.108 421.244 287.41 420.328 286.711 419.412C286.181 418.717 286.181 418.717 285.639 418.007C283.312 414.94 281.064 411.828 278.863 408.669C275.954 404.511 272.86 400.557 269.591 396.676C270.596 393.987 272.077 392.99 274.463 391.469C275.568 390.758 275.568 390.758 276.694 390.032C277.891 389.276 277.891 389.276 279.111 388.505C279.926 387.983 280.74 387.461 281.58 386.923C283.742 385.538 285.909 384.16 288.077 382.784C290.29 381.378 292.498 379.965 294.707 378.552C299.039 375.782 303.376 373.02 307.716 370.264C310.189 371.73 310.549 372.854 311.779 375.43C313.714 379.343 315.815 383.09 318.072 386.826C320.626 391.064 322.954 395.349 325.158 399.782C326.672 402.673 328.329 405.458 330.013 408.252C332.566 412.491 334.894 416.776 337.098 421.209C338.613 424.099 340.27 426.884 341.953 429.678C344.974 434.704 347.722 439.785 350.305 445.052C350.628 445.646 350.95 446.239 351.282 446.851C355.467 454.895 353.749 464.19 346.445 469.84Z"
45
- fill="var(--primary-foreground, #ffffff)"
46
- />
47
- <path
48
- d="M175.175 164.461C174.611 164.495 174.047 164.529 173.466 164.565C161.822 165.517 151.451 170.117 143.632 178.98C141.188 182.058 138.963 185.278 136.798 188.557C134.916 187.16 133.636 185.817 132.364 183.853C132.04 183.352 131.717 182.852 131.383 182.336C131.053 181.817 130.724 181.297 130.384 180.762C130.043 180.241 129.703 179.719 129.351 179.182C129.031 178.682 128.711 178.182 128.381 177.668C128.089 177.211 127.796 176.755 127.495 176.285C126.898 175.109 126.898 175.109 127.21 173.669C127.885 173.594 127.885 173.594 128.573 173.517C144.325 171.353 156.368 162.585 166.151 150.449C168.977 152.315 170.506 155.002 172.283 157.806C172.597 158.285 172.911 158.765 173.234 159.26C175.527 162.839 175.527 162.839 175.175 164.461Z"
49
- fill="var(--primary-foreground, #ffffff)"
50
- />
51
- </g>
52
- </g>
53
- <defs>
54
- <clipPath id="nikala-logo-clip0">
55
- <rect width="223" height="223" rx="10" fill="white" />
56
- </clipPath>
57
- <clipPath id="nikala-logo-clip1">
58
- <rect
59
- width="377.121"
60
- height="377.121"
61
- fill="white"
62
- transform="translate(431.932 116.81) rotate(102.218)"
63
- />
64
- </clipPath>
65
- </defs>
25
+ <path
26
+ d="M36.1777 0.00543119C36.9886 0.00499311 37.7994 0.00455503 38.6349 0.00410368C41.2808 0.00617229 43.9262 0.0294108 46.572 0.0530386C48.42 0.0586414 50.268 0.0629083 52.1161 0.0659018C56.9543 0.0772964 61.7923 0.106717 66.6305 0.140014C71.5778 0.170831 76.5251 0.184432 81.4724 0.199523C91.1607 0.231592 100.849 0.282723 110.537 0.346007C110.61 3.53599 110.654 6.72575 110.693 9.91632C110.725 11.2608 110.725 11.2608 110.757 12.6324C110.828 20.4476 109.466 26.0515 104.537 32.346C98.5344 38.2899 92.6817 40.5932 84.2432 40.6014C83.527 40.605 82.8108 40.6086 82.0729 40.6124C80.5233 40.6192 78.9737 40.6218 77.4242 40.6204C74.9635 40.6194 72.503 40.6324 70.0426 40.6494C63.0485 40.6955 56.0544 40.7202 49.06 40.7269C44.7747 40.7319 40.4898 40.7563 36.2046 40.7922C34.5801 40.8019 32.9555 40.8044 31.331 40.799C19.2921 40.7614 9.61779 41.743 0.536854 50.346C0.448685 46.7003 0.396074 43.0549 0.349354 39.4085C0.324217 38.3869 0.29908 37.3653 0.273182 36.3128C0.173253 25.8869 2.62732 17.3394 9.53685 9.34601C17.2641 2.66649 26.0794 -0.141013 36.1777 0.00543119Z"
27
+ fill="currentColor"
28
+ />
29
+ <path
30
+ d="M22.0491 48.169C22.9608 48.1562 23.8728 48.1434 24.8118 48.1301C26.2884 48.119 26.2884 48.119 27.7947 48.1077C28.8123 48.0997 29.83 48.0916 30.8784 48.0833C33.0354 48.0694 35.1924 48.0587 37.3494 48.0509C40.6285 48.0337 43.9065 47.9898 47.1853 47.9456C49.2843 47.9355 51.3833 47.927 53.4822 47.9202C54.4544 47.9027 55.4266 47.8852 56.4283 47.8672C63.3556 47.889 69.7844 49.012 75.1263 53.7582C79.2822 58.4605 81.032 62.8674 80.8533 69.1585C80.0862 74.4616 77.9359 78.9471 74.1619 82.721C73.2957 83.2573 72.4295 83.7935 71.5369 84.346C70.7322 84.8676 69.9275 85.3892 69.0984 85.9266C64.0178 87.9514 59.3464 87.7288 53.9275 87.682C51.6228 87.6945 49.3182 87.7075 47.0135 87.721C43.4017 87.7249 39.7902 87.721 36.1785 87.7064C32.6778 87.6978 29.1782 87.7196 25.6775 87.7445C24.6105 87.7311 23.5435 87.7178 22.4442 87.704C13.6607 87.7897 7.75397 90.5347 0.536912 95.346C0.386963 91.1144 0.278963 86.8842 0.207322 82.6507C0.177416 81.2152 0.136674 79.7799 0.0842755 78.345C-0.242774 69.1492 0.0895104 61.5914 6.53691 54.346C11.3525 50.524 15.8247 48.2455 22.0491 48.169Z"
31
+ fill="currentColor"
32
+ />
33
+ <path
34
+ d="M20.8612 95.2484C21.8892 95.2516 22.9173 95.2548 23.9764 95.2581C25.5842 95.2707 25.5842 95.2707 27.2245 95.2835C28.3079 95.288 29.3912 95.2926 30.5077 95.2972C33.1842 95.309 35.8606 95.3255 38.537 95.346C38.6543 99.0124 38.7246 102.678 38.787 106.346C38.8205 107.376 38.854 108.406 38.8885 109.467C38.9806 116.694 38.1397 122.373 33.1595 127.865C28.2702 132.292 23.1029 133.85 16.5526 133.662C10.763 132.754 6.1827 128.721 2.53699 124.346C0.114874 119.156 -0.478718 113.766 1.15417 108.268C3.56015 102.689 7.36624 99.4145 12.537 96.346C15.5962 95.3263 17.6612 95.2307 20.8612 95.2484Z"
35
+ fill="currentColor"
36
+ />
66
37
  </svg>
67
38
  );
68
- };
39
+ };
@@ -12,6 +12,7 @@ import { Button } from "@/components/ui/button";
12
12
  import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
13
13
  import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
14
14
  import { createClipboard } from "@/hooks/create-clipboard";
15
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
15
16
  import { cn } from "@/lib/cn";
16
17
 
17
18
  export type DefaultPackageManager = "bun" | "pnpm" | "npm" | "yarn" | "bunx" | "npx" | "deno";
@@ -160,6 +161,7 @@ export const PackageManagerTabs: ParentComponent<PackageManagerTabsProps> = (pro
160
161
  });
161
162
 
162
163
  const clipboard = createClipboard();
164
+ const siteLocale = useSiteLocale();
163
165
  const copyable = () => local.copyable ?? true;
164
166
 
165
167
  const handleCopy = async () => {
@@ -206,7 +208,7 @@ export const PackageManagerTabs: ParentComponent<PackageManagerTabsProps> = (pro
206
208
  variant="ghost"
207
209
  size="icon"
208
210
  onClick={handleCopy}
209
- aria-label={clipboard.copied() ? "Copied command" : "Copy command"}
211
+ aria-label={clipboard.copied() ? siteLocale.t("code.copied") : siteLocale.t("code.copy")}
210
212
  class="size-6 p-0 rounded-xs text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer"
211
213
  >
212
214
  <Show when={clipboard.copied()} fallback={<Copy class="size-3.5" />}>
@@ -214,7 +216,7 @@ export const PackageManagerTabs: ParentComponent<PackageManagerTabsProps> = (pro
214
216
  </Show>
215
217
  </TooltipTrigger>
216
218
  <TooltipContent class="text-[10px] py-1 px-2">
217
- {clipboard.copied() ? "Copied!" : "Copy command"}
219
+ {clipboard.copied() ? siteLocale.t("actions.copied") : siteLocale.t("code.copy")}
218
220
  </TooltipContent>
219
221
  </Tooltip>
220
222
  </Show>
@@ -7,6 +7,7 @@ import {
7
7
  CardDescription,
8
8
  } from "@/components/ui/card";
9
9
  import { cn } from "@/lib/cn";
10
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
10
11
 
11
12
  export interface PagerItem {
12
13
  title: string;
@@ -25,6 +26,7 @@ export interface PagerLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorEleme
25
26
  */
26
27
  export const PagerLink: Component<PagerLinkProps> = (props) => {
27
28
  const [local, rest] = splitProps(props, ["title", "href", "type", "class"]);
29
+ const siteLocale = useSiteLocale();
28
30
 
29
31
  const isNext = () => local.type === "next";
30
32
 
@@ -43,10 +45,10 @@ export const PagerLink: Component<PagerLinkProps> = (props) => {
43
45
  <CardDescription class="flex items-center gap-1 text-xs font-medium text-muted-foreground">
44
46
  <Show when={!isNext()}>
45
47
  <ChevronLeft class="size-3.5 transition-transform group-hover:-translate-x-0.5" />
46
- <span>Previous</span>
48
+ <span>{siteLocale.t("pagination.previous")}</span>
47
49
  </Show>
48
50
  <Show when={isNext()}>
49
- <span>Next</span>
51
+ <span>{siteLocale.t("pagination.next")}</span>
50
52
  <ChevronRight class="size-3.5 transition-transform group-hover:translate-x-0.5" />
51
53
  </Show>
52
54
  </CardDescription>
@@ -69,7 +69,11 @@ export const SectionHeading: Component<SectionHeadingProps> = (props) => {
69
69
 
70
70
  return (
71
71
  <div class={cn("space-y-2", local.class)} {...rest}>
72
- <div class={cn("flex items-center justify-between gap-2", v() === "section" && "w-full")}>
72
+ <div class={cn(
73
+ "flex justify-between gap-2",
74
+ v() === "page" ? "flex-col items-start sm:flex-row sm:items-center" : "items-center",
75
+ v() === "section" && "w-full",
76
+ )}>
73
77
  <div class="flex min-w-0 items-center gap-2">
74
78
  <Show when={v() === "page"}>
75
79
  <h1 class={headingVariants({ variant: v() })}>
@@ -19,6 +19,7 @@ import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip
19
19
  import { Skeleton } from "@/components/ui/skeleton";
20
20
  import { Separator } from "@/components/ui/separator";
21
21
  import { cn } from "@/lib/cn";
22
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
22
23
 
23
24
  /* --- Constants --- */
24
25
  const SIDEBAR_COOKIE_NAME = "nikala_sidebar_state";
@@ -245,11 +246,12 @@ export interface SidebarTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButton
245
246
  export const SidebarTrigger: Component<SidebarTriggerProps> = (props) => {
246
247
  const [local, rest] = splitProps(props, ["class", "onClick"]);
247
248
  const { toggleSidebar, side, isMobile, openMobile, setOpenMobile } = useSidebar();
249
+ const siteLocale = useSiteLocale();
248
250
 
249
251
  return (
250
252
  <button
251
253
  type="button"
252
- aria-label="Toggle Sidebar"
254
+ aria-label={siteLocale.t("navigation.sidebar")}
253
255
  onClick={(e) => {
254
256
  if (typeof local.onClick === "function") local.onClick(e);
255
257
  if (isMobile()) setOpenMobile(!openMobile());
@@ -264,7 +266,7 @@ export const SidebarTrigger: Component<SidebarTriggerProps> = (props) => {
264
266
  <Show when={side() === "right"} fallback={<PanelLeft class="size-4" />}>
265
267
  <PanelRight class="size-4" />
266
268
  </Show>
267
- <span class="sr-only">Toggle Sidebar</span>
269
+ <span class="sr-only">{siteLocale.t("navigation.sidebar")}</span>
268
270
  </button>
269
271
  );
270
272
  };
@@ -277,15 +279,16 @@ export interface SidebarRailProps extends JSX.ButtonHTMLAttributes<HTMLButtonEle
277
279
  export const SidebarRail: Component<SidebarRailProps> = (props) => {
278
280
  const [local, rest] = splitProps(props, ["class"]);
279
281
  const { toggleSidebar } = useSidebar();
282
+ const siteLocale = useSiteLocale();
280
283
 
281
284
  return (
282
285
  <button
283
286
  type="button"
284
287
  data-sidebar="rail"
285
- aria-label="Toggle Sidebar Rail"
288
+ aria-label={siteLocale.t("navigation.toggleSidebarRail")}
286
289
  tabIndex={-1}
287
290
  onClick={toggleSidebar}
288
- title="Toggle Sidebar"
291
+ title={siteLocale.t("navigation.sidebar")}
289
292
  class={cn(
290
293
  "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex cursor-w-resize",
291
294
  local.class
@@ -1,6 +1,7 @@
1
1
  import { splitProps, type Component, type JSX } from "solid-js";
2
2
  import { cva, type VariantProps } from "class-variance-authority";
3
3
  import { cn } from "@/lib/cn";
4
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
4
5
 
5
6
  export const spinnerVariants = cva(
6
7
  "inline-block animate-spin rounded-lg border-2 border-current border-r-transparent text-primary",
@@ -29,11 +30,12 @@ export interface SpinnerProps
29
30
  /** A compact, accessible loading indicator for async UI states. */
30
31
  export const Spinner: Component<SpinnerProps> = (props) => {
31
32
  const [local, rest] = splitProps(props, ["size", "label", "class"]);
33
+ const siteLocale = useSiteLocale();
32
34
 
33
35
  return (
34
36
  <span
35
37
  role="status"
36
- aria-label={local.label || "Loading"}
38
+ aria-label={local.label || siteLocale.t("status.loadingLabel")}
37
39
  class={cn(spinnerVariants({ size: local.size }), local.class)}
38
40
  {...rest}
39
41
  />
@@ -21,6 +21,7 @@ import {
21
21
  DropdownMenuSeparator,
22
22
  } from "./dropdown-menu";
23
23
  import { cn } from "@/lib/cn";
24
+ import { useSiteLocale } from "../../plugins/i18n/runtime.jsx";
24
25
 
25
26
  export interface ThemeToggleProps
26
27
  extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
@@ -56,6 +57,7 @@ const RADIUS_OPTIONS: { value: Radius; label: string }[] = [
56
57
  * Interactive UI theme switcher supporting button, mini (dropdown), and max (customizer panel) modes with View Transition animations.
57
58
  */
58
59
  export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
60
+ const siteLocale = useSiteLocale();
59
61
  const [local, rest] = splitProps(props, ["mode", "effect", "variant", "size", "class"]);
60
62
  const { theme, setTheme, accent, setAccent, radius, setRadius } = useTheme();
61
63
 
@@ -94,7 +96,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
94
96
  size={local.size || "icon"}
95
97
  onClick={handleToggleClick}
96
98
  class={cn("relative cursor-pointer", local.class)}
97
- aria-label="Toggle theme"
99
+ aria-label={siteLocale.t("theme.toggle")}
98
100
  {...rest}
99
101
  >
100
102
  <Show
@@ -103,7 +105,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
103
105
  >
104
106
  <Moon class="h-4 w-4 text-foreground transition-transform" />
105
107
  </Show>
106
- <span class="sr-only">Toggle theme</span>
108
+ <span class="sr-only">{siteLocale.t("theme.toggle")}</span>
107
109
  </Button>
108
110
  }
109
111
  >
@@ -122,7 +124,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
122
124
  >
123
125
  <Moon class="h-4 w-4 text-foreground transition-transform" />
124
126
  </Show>
125
- <span class="sr-only">Toggle theme</span>
127
+ <span class="sr-only">{siteLocale.t("theme.toggle")}</span>
126
128
  </DropdownMenuTrigger>
127
129
 
128
130
  <Show
@@ -132,17 +134,17 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
132
134
  <DropdownMenuContent>
133
135
  <DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("light", e)}>
134
136
  <Sun class="mr-2 h-4 w-4 text-muted-foreground" />
135
- Light
137
+ {siteLocale.t("theme.light")}
136
138
  </DropdownMenuItem>
137
139
 
138
140
  <DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("dark", e)}>
139
141
  <Moon class="mr-2 h-4 w-4 text-muted-foreground" />
140
- Dark
142
+ {siteLocale.t("theme.dark")}
141
143
  </DropdownMenuItem>
142
144
 
143
145
  <DropdownMenuItem onClick={(e: MouseEvent) => changeThemeWithEffect("system", e)}>
144
146
  <Monitor class="mr-2 h-4 w-4 text-muted-foreground" />
145
- System
147
+ {siteLocale.t("theme.system")}
146
148
  </DropdownMenuItem>
147
149
  </DropdownMenuContent>
148
150
  }
@@ -152,7 +154,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
152
154
  <div class="p-2 space-y-2">
153
155
  <DropdownMenuGroup>
154
156
  <DropdownMenuLabel class="px-0 pt-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
155
- Theme Mode
157
+ {siteLocale.t("theme.mode")}
156
158
  </DropdownMenuLabel>
157
159
  <div class="grid grid-cols-3 gap-1 my-1.5">
158
160
  <Button
@@ -161,7 +163,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
161
163
  onClick={(e: MouseEvent) => changeThemeWithEffect("light", e)}
162
164
  class="h-8 text-xs cursor-pointer"
163
165
  >
164
- Light
166
+ {siteLocale.t("theme.light")}
165
167
  </Button>
166
168
  <Button
167
169
  variant={theme() === "dark" ? "default" : "outline"}
@@ -169,7 +171,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
169
171
  onClick={(e: MouseEvent) => changeThemeWithEffect("dark", e)}
170
172
  class="h-8 text-xs cursor-pointer"
171
173
  >
172
- Dark
174
+ {siteLocale.t("theme.dark")}
173
175
  </Button>
174
176
  <Button
175
177
  variant={theme() === "system" ? "default" : "outline"}
@@ -177,7 +179,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
177
179
  onClick={(e: MouseEvent) => changeThemeWithEffect("system", e)}
178
180
  class="h-8 text-xs cursor-pointer"
179
181
  >
180
- System
182
+ {siteLocale.t("theme.system")}
181
183
  </Button>
182
184
  </div>
183
185
  </DropdownMenuGroup>
@@ -186,7 +188,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
186
188
 
187
189
  <DropdownMenuGroup>
188
190
  <DropdownMenuLabel class="px-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
189
- Brand Accent Color
191
+ {siteLocale.t("theme.brandAccentColor")}
190
192
  </DropdownMenuLabel>
191
193
  <div class="flex flex-wrap gap-1.5 my-1.5">
192
194
  <For each={ACCENT_OPTIONS}>
@@ -212,7 +214,7 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
212
214
 
213
215
  <DropdownMenuGroup>
214
216
  <DropdownMenuLabel class="px-0 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
215
- Border Radius
217
+ {siteLocale.t("theme.borderRadius")}
216
218
  </DropdownMenuLabel>
217
219
  <div class="grid grid-cols-5 gap-1 my-1.5">
218
220
  <For each={RADIUS_OPTIONS}>
@@ -235,4 +237,4 @@ export const ThemeToggle: Component<ThemeToggleProps> = (props) => {
235
237
  </DropdownMenu>
236
238
  </Show>
237
239
  );
238
- };
240
+ };
@@ -0,0 +1,56 @@
1
+ import { For, Show, type Component } from "solid-js";
2
+ import { Languages, ChevronDown } from "lucide-solid";
3
+ import { Button } from "@/components/ui/button";
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
5
+ import { cn } from "@/lib/cn";
6
+ import { useSiteLocale } from "../runtime.jsx";
7
+ import type { PageData } from "../../../types.js";
8
+ import { findLocalizedPage } from "../navigation.js";
9
+
10
+ interface SiteLanguageSwitcherProps {
11
+ currentPage?: PageData;
12
+ pages?: readonly PageData[];
13
+ onNavigate?: (url: string) => void;
14
+ class?: string;
15
+ }
16
+
17
+ export const DocsSiteLanguageSwitcher: Component<SiteLanguageSwitcherProps> = (props) => {
18
+ const siteLocale = useSiteLocale();
19
+ const targetPage = (locale: string) => {
20
+ if (!props.currentPage || !props.pages) return undefined;
21
+ return findLocalizedPage(props.pages, props.currentPage, locale);
22
+ };
23
+ const selectLocale = (locale: string) => {
24
+ const page = targetPage(locale);
25
+ if (!page) return;
26
+ siteLocale.setLocale(locale);
27
+ if (typeof window !== "undefined" && window.location.pathname !== page.url) props.onNavigate?.(page.url);
28
+ };
29
+
30
+ return (
31
+ <Show when={siteLocale.locales().length > 1}>
32
+ <DropdownMenu placement="bottom-end">
33
+ <DropdownMenuTrigger
34
+ as={Button}
35
+ variant="ghost"
36
+ size="sm"
37
+ class={cn("shrink-0 gap-1", props.class)}
38
+ aria-label={siteLocale.t("navigation.chooseLanguage")}
39
+ >
40
+ <Languages class="size-3.5" />
41
+ <span class="hidden sm:inline">{siteLocale.locale()}</span>
42
+ <ChevronDown class="size-3.5" />
43
+ </DropdownMenuTrigger>
44
+ <DropdownMenuContent>
45
+ <For each={siteLocale.locales()}>
46
+ {(locale) => (
47
+ <DropdownMenuItem disabled={!targetPage(locale)} onClick={() => selectLocale(locale)}>
48
+ {locale.toUpperCase()}
49
+ </DropdownMenuItem>
50
+ )}
51
+ </For>
52
+ </DropdownMenuContent>
53
+ </DropdownMenu>
54
+ </Show>
55
+ );
56
+ };
@@ -0,0 +1 @@
1
+ export const SITE_LOCALE_STORAGE_KEY = "folio-site-locale";