@canonical/summon-application 0.47.0 → 0.49.0-experimental.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 (217) hide show
  1. package/README.md +35 -4
  2. package/dist/esm/application/react/index.js +28 -1
  3. package/dist/esm/application/react/index.js.map +1 -1
  4. package/dist/esm/application/react/templates/README.md.ejs +5 -0
  5. package/dist/esm/application/react/templates/src/domains/catalog/ProductCard.tsx.ejs +2 -2
  6. package/dist/esm/application/react/templates/src/domains/dashboard/InstancesPage.tsx.ejs +1 -1
  7. package/dist/esm/application/react/templates/src/domains/dashboard/OverviewPage.tsx.ejs +6 -6
  8. package/dist/esm/application/react/templates/src/i18n/ar.ts.ejs +1 -0
  9. package/dist/esm/application/react/templates/src/i18n/config.ts +2 -2
  10. package/dist/esm/application/react/templates/src/i18n/en.ts.ejs +1 -0
  11. package/dist/esm/application/react/templates/src/i18n/fr.ts.ejs +1 -0
  12. package/dist/esm/application/react/templates/src/i18n/negotiation.test.ts +5 -5
  13. package/dist/esm/application/react/templates/src/lib/LocaleSelector/LocaleSelector.test.tsx +10 -0
  14. package/dist/esm/application/react/templates/src/lib/LocaleSelector/LocaleSelector.tsx.ejs +35 -21
  15. package/dist/esm/application/react/templates/src/lib/ThemeSelector/ServerThemeContext.ts +13 -0
  16. package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.ssr.test.tsx.ejs +45 -0
  17. package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.test.tsx.ejs +67 -0
  18. package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.tsx.ejs +60 -26
  19. package/dist/esm/application/react/templates/src/lib/ThemeSelector/index.ts.ejs +4 -0
  20. package/dist/esm/application/react/templates/src/lib/TopBar/TopBar.test.tsx.ejs +7 -10
  21. package/dist/esm/application/react/templates/src/lib/TopBar/styles.css +8 -3
  22. package/dist/esm/application/react/templates/src/server/entry.tsx.ejs +23 -14
  23. package/dist/esm/application/react/templates/src/server/handlePreferenceForm.test.ts.ejs +63 -0
  24. package/dist/esm/application/react/templates/src/server/handlePreferenceForm.ts.ejs +158 -0
  25. package/dist/esm/application/react/templates/src/server/preferenceFormMiddleware.ts +42 -0
  26. package/dist/esm/application/react/templates/src/server/preview.bun.ts +5 -0
  27. package/dist/esm/application/react/templates/src/server/preview.express.ts +4 -0
  28. package/dist/esm/application/react/templates/src/server/resolveReturnTo.ts +18 -0
  29. package/dist/esm/application/react/templates/src/server/server.bun.ts.ejs +5 -0
  30. package/dist/esm/application/react/templates/src/server/server.express.ts.ejs +4 -0
  31. package/dist/esm/application/react/templates/test/e2e/servers.e2e.ts.ejs +56 -0
  32. package/dist/esm/application/react/templates/vitest.config.ts +4 -0
  33. package/dist/esm/application/svelte/index.js +337 -0
  34. package/dist/esm/application/svelte/index.js.map +1 -0
  35. package/dist/esm/application/svelte/templates/.storybook/main.ts +3 -0
  36. package/dist/esm/application/svelte/templates/.storybook/preview.ts.ejs +21 -0
  37. package/dist/esm/application/svelte/templates/README.md.ejs +168 -0
  38. package/dist/esm/application/svelte/templates/biome.json.ejs +12 -0
  39. package/dist/esm/application/svelte/templates/gitignore.ejs +7 -0
  40. package/dist/esm/application/svelte/templates/package.json.ejs +76 -0
  41. package/dist/esm/application/svelte/templates/scripts/copy-icons.js +10 -0
  42. package/dist/esm/application/svelte/templates/src/app.d.ts.ejs +14 -0
  43. package/dist/esm/application/svelte/templates/src/app.html.ejs +19 -0
  44. package/dist/esm/application/svelte/templates/src/domains/account/AccountPage.svelte.ejs +18 -0
  45. package/dist/esm/application/svelte/templates/src/domains/account/LoginPage.svelte.ejs +32 -0
  46. package/dist/esm/application/svelte/templates/src/domains/account/getAuthRedirect.test.ts +18 -0
  47. package/dist/esm/application/svelte/templates/src/domains/account/getAuthRedirect.ts +18 -0
  48. package/dist/esm/application/svelte/templates/src/domains/account/guardAccount.ts +15 -0
  49. package/dist/esm/application/svelte/templates/src/domains/catalog/CatalogPage.svelte.ejs +35 -0
  50. package/dist/esm/application/svelte/templates/src/domains/catalog/ProductCard.svelte.ejs +51 -0
  51. package/dist/esm/application/svelte/templates/src/domains/catalog/ProductList.stories.svelte.ejs +110 -0
  52. package/dist/esm/application/svelte/templates/src/domains/catalog/ProductList.svelte.ejs +41 -0
  53. package/dist/esm/application/svelte/templates/src/domains/catalog/constants.ts +2 -0
  54. package/dist/esm/application/svelte/templates/src/domains/catalog/data.test.ts +19 -0
  55. package/dist/esm/application/svelte/templates/src/domains/catalog/data.ts +75 -0
  56. package/dist/esm/application/svelte/templates/src/domains/catalog/loadCatalog.ts +7 -0
  57. package/dist/esm/application/svelte/templates/src/domains/catalog/types.ts +25 -0
  58. package/dist/esm/application/svelte/templates/src/domains/contact/ContactPage.svelte.ejs +86 -0
  59. package/dist/esm/application/svelte/templates/src/domains/contact/types.ts.ejs +19 -0
  60. package/dist/esm/application/svelte/templates/src/domains/contact/validateContact.test.ts.ejs +31 -0
  61. package/dist/esm/application/svelte/templates/src/domains/contact/validateContact.ts.ejs +28 -0
  62. package/dist/esm/application/svelte/templates/src/domains/dashboard/DashboardBreadcrumbs.svelte.ejs +29 -0
  63. package/dist/esm/application/svelte/templates/src/domains/dashboard/DashboardLayout.svelte.ejs +35 -0
  64. package/dist/esm/application/svelte/templates/src/domains/dashboard/InstancesPage.svelte.ejs +245 -0
  65. package/dist/esm/application/svelte/templates/src/domains/dashboard/OverviewPage.svelte.ejs +180 -0
  66. package/dist/esm/application/svelte/templates/src/domains/dashboard/SettingsPage.svelte.ejs +103 -0
  67. package/dist/esm/application/svelte/templates/src/domains/dashboard/constants.ts.ejs +253 -0
  68. package/dist/esm/application/svelte/templates/src/domains/dashboard/createDashboardNavigation.ts.ejs +103 -0
  69. package/dist/esm/application/svelte/templates/src/domains/dashboard/createInstance.test.ts +22 -0
  70. package/dist/esm/application/svelte/templates/src/domains/dashboard/createInstance.ts +28 -0
  71. package/dist/esm/application/svelte/templates/src/domains/dashboard/projectBreadcrumbs.test.ts +78 -0
  72. package/dist/esm/application/svelte/templates/src/domains/dashboard/projectBreadcrumbs.ts +47 -0
  73. package/dist/esm/application/svelte/templates/src/domains/dashboard/selectRelativeTime.test.ts +19 -0
  74. package/dist/esm/application/svelte/templates/src/domains/dashboard/selectRelativeTime.ts +24 -0
  75. package/dist/esm/application/svelte/templates/src/domains/dashboard/styles.css +98 -0
  76. package/dist/esm/application/svelte/templates/src/domains/dashboard/types.ts.ejs +61 -0
  77. package/dist/esm/application/svelte/templates/src/domains/marketing/GuidePage.svelte.ejs +29 -0
  78. package/dist/esm/application/svelte/templates/src/domains/marketing/HomePage.svelte.ejs +47 -0
  79. package/dist/esm/application/svelte/templates/src/domains/marketing/isGuideSlug.ts +8 -0
  80. package/dist/esm/application/svelte/templates/src/formatDocumentTitle.ts.ejs +9 -0
  81. package/dist/esm/application/svelte/templates/src/hooks.server.ts.ejs +51 -0
  82. package/dist/esm/application/svelte/templates/src/i18n/ar.ts.ejs +174 -0
  83. package/dist/esm/application/svelte/templates/src/i18n/catalogs.ts +14 -0
  84. package/dist/esm/application/svelte/templates/src/i18n/config.ts +19 -0
  85. package/dist/esm/application/svelte/templates/src/i18n/en.ts.ejs +173 -0
  86. package/dist/esm/application/svelte/templates/src/i18n/fr.ts.ejs +171 -0
  87. package/dist/esm/application/svelte/templates/src/i18n/index.ts +45 -0
  88. package/dist/esm/application/svelte/templates/src/i18n/negotiation.test.ts +92 -0
  89. package/dist/esm/application/svelte/templates/src/layouts/ErrorPage.svelte.ejs +40 -0
  90. package/dist/esm/application/svelte/templates/src/layouts/PublicLayout.svelte +18 -0
  91. package/dist/esm/application/svelte/templates/src/layouts/RootLayout.svelte.ejs +43 -0
  92. package/dist/esm/application/svelte/templates/src/layouts/TopBarLayout.svelte +28 -0
  93. package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/ApplicationShell.stories.svelte +87 -0
  94. package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/ApplicationShell.svelte.ejs +60 -0
  95. package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/index.ts +2 -0
  96. package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/styles.css +43 -0
  97. package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/types.ts +23 -0
  98. package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/CanonicalLogo.svelte.ejs +27 -0
  99. package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/index.ts +2 -0
  100. package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/styles.css +31 -0
  101. package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/types.ts +15 -0
  102. package/dist/esm/application/svelte/templates/src/lib/CodeMessage/CodeMessage.svelte +18 -0
  103. package/dist/esm/application/svelte/templates/src/lib/CodeMessage/index.ts +2 -0
  104. package/dist/esm/application/svelte/templates/src/lib/CodeMessage/types.ts +14 -0
  105. package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/ExampleComponent.stories.svelte +15 -0
  106. package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/ExampleComponent.svelte +17 -0
  107. package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/index.ts +2 -0
  108. package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/styles.css +17 -0
  109. package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/types.ts +10 -0
  110. package/dist/esm/application/svelte/templates/src/lib/Icon/Icon.svelte +16 -0
  111. package/dist/esm/application/svelte/templates/src/lib/Icon/index.ts +2 -0
  112. package/dist/esm/application/svelte/templates/src/lib/Icon/types.ts +10 -0
  113. package/dist/esm/application/svelte/templates/src/lib/LazyComponent/LazyComponent.stories.svelte +19 -0
  114. package/dist/esm/application/svelte/templates/src/lib/LazyComponent/LazyComponent.svelte.ejs +29 -0
  115. package/dist/esm/application/svelte/templates/src/lib/LazyComponent/createDelayedData.ts.ejs +24 -0
  116. package/dist/esm/application/svelte/templates/src/lib/LazyComponent/index.ts +2 -0
  117. package/dist/esm/application/svelte/templates/src/lib/LazyComponent/types.ts.ejs +19 -0
  118. package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/LocaleSelector.svelte.ejs +50 -0
  119. package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/index.ts +2 -0
  120. package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/types.ts +7 -0
  121. package/dist/esm/application/svelte/templates/src/lib/Navigation/Navigation.svelte.ejs +42 -0
  122. package/dist/esm/application/svelte/templates/src/lib/Navigation/index.ts +2 -0
  123. package/dist/esm/application/svelte/templates/src/lib/Navigation/types.ts +14 -0
  124. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/ThemeSelector.svelte.ejs +38 -0
  125. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/constants.ts +8 -0
  126. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/index.ts +5 -0
  127. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/readTheme.test.ts +13 -0
  128. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/readTheme.ts +15 -0
  129. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/setTheme.ts +27 -0
  130. package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/types.ts +18 -0
  131. package/dist/esm/application/svelte/templates/src/lib/TopBar/TopBar.stories.svelte.ejs +24 -0
  132. package/dist/esm/application/svelte/templates/src/lib/TopBar/TopBar.svelte.ejs +32 -0
  133. package/dist/esm/application/svelte/templates/src/lib/TopBar/index.ts +2 -0
  134. package/dist/esm/application/svelte/templates/src/lib/TopBar/styles.css +54 -0
  135. package/dist/esm/application/svelte/templates/src/lib/TopBar/types.ts +15 -0
  136. package/dist/esm/application/svelte/templates/src/lib/index.ts.ejs +16 -0
  137. package/dist/esm/application/svelte/templates/src/params/guide.ts +5 -0
  138. package/dist/esm/application/svelte/templates/src/resolveReturnTo.test.ts +27 -0
  139. package/dist/esm/application/svelte/templates/src/resolveReturnTo.ts +13 -0
  140. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+layout.svelte +8 -0
  141. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.server.ts +6 -0
  142. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.svelte +8 -0
  143. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.ts +6 -0
  144. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/account/+page.svelte +5 -0
  145. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/account/+page.ts +4 -0
  146. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/catalog/+page.svelte +8 -0
  147. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/catalog/+page.ts +4 -0
  148. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/contact/+page.server.ts +25 -0
  149. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/contact/+page.svelte.ejs +30 -0
  150. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/guides/[slug=guide]/+page.svelte +6 -0
  151. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/login/+page.svelte +6 -0
  152. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/+layout.svelte +9 -0
  153. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/+layout.svelte +9 -0
  154. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/+page.svelte +5 -0
  155. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/instances/+page.server.ts.ejs +28 -0
  156. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/instances/+page.svelte.ejs +19 -0
  157. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/settings/+page.server.ts +9 -0
  158. package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/settings/+page.svelte +5 -0
  159. package/dist/esm/application/svelte/templates/src/routes/+error.svelte +6 -0
  160. package/dist/esm/application/svelte/templates/src/routes/+layout.server.ts.ejs +8 -0
  161. package/dist/esm/application/svelte/templates/src/routes/+layout.svelte.ejs +21 -0
  162. package/dist/esm/application/svelte/templates/src/routes/+layout.ts.ejs +30 -0
  163. package/dist/esm/application/svelte/templates/src/routes/home/+page.ts +4 -0
  164. package/dist/esm/application/svelte/templates/src/routes/home/+server.ts +3 -0
  165. package/dist/esm/application/svelte/templates/src/routes/icons/[icon]/+server.ts +37 -0
  166. package/dist/esm/application/svelte/templates/src/routes/language/+server.ts +30 -0
  167. package/dist/esm/application/svelte/templates/src/routes/preferences/+server.ts +32 -0
  168. package/dist/esm/application/svelte/templates/src/routes/sitemap.xml/+server.ts.ejs +47 -0
  169. package/dist/esm/application/svelte/templates/src/storybook/I18nDecorator.svelte +28 -0
  170. package/dist/esm/application/svelte/templates/src/storybook/decorators.ts +12 -0
  171. package/dist/esm/application/svelte/templates/src/styles/app.css +38 -0
  172. package/dist/esm/application/svelte/templates/src/styles/index.css.ejs +25 -0
  173. package/dist/esm/application/svelte/templates/src/styles/standins/Card.css +198 -0
  174. package/dist/esm/application/svelte/templates/src/styles/standins/Icon.css +32 -0
  175. package/dist/esm/application/svelte/templates/src/styles/standins/InlineCode.css +30 -0
  176. package/dist/esm/application/svelte/templates/src/styles/standins/SidePanel.css +462 -0
  177. package/dist/esm/application/svelte/templates/src/styles/standins/Tile.css +108 -0
  178. package/dist/esm/application/svelte/templates/src/styles/standins/Timeline.css +171 -0
  179. package/dist/esm/application/svelte/templates/src/styles/standins.css.ejs +17 -0
  180. package/dist/esm/application/svelte/templates/svelte.config.js.ejs +17 -0
  181. package/dist/esm/application/svelte/templates/test/app.test.js.ejs +758 -0
  182. package/dist/esm/application/svelte/templates/test/spa.test.js.ejs +224 -0
  183. package/dist/esm/application/svelte/templates/tsconfig.json +15 -0
  184. package/dist/esm/application/svelte/templates/vite.config.ts +4 -0
  185. package/dist/esm/application/svelte/templates/vitest.config.ts +10 -0
  186. package/dist/esm/application/svelte/textHelpers.js +20 -0
  187. package/dist/esm/application/svelte/textHelpers.js.map +1 -0
  188. package/dist/esm/domain/index.js +39 -5
  189. package/dist/esm/domain/index.js.map +1 -1
  190. package/dist/esm/domain/templates/Page.svelte.ejs +2 -0
  191. package/dist/esm/index.js +2 -0
  192. package/dist/esm/index.js.map +1 -1
  193. package/dist/esm/page/index.js +44 -7
  194. package/dist/esm/page/index.js.map +1 -1
  195. package/dist/esm/page/templates/Page.svelte.ejs +2 -0
  196. package/dist/esm/shared/versions.js +10 -8
  197. package/dist/esm/shared/versions.js.map +1 -1
  198. package/dist/esm/wrapper/index.js +38 -5
  199. package/dist/esm/wrapper/index.js.map +1 -1
  200. package/dist/esm/wrapper/templates/Layout.svelte.ejs +5 -0
  201. package/dist/types/application/react/index.d.ts.map +1 -1
  202. package/dist/types/application/svelte/index.d.ts +12 -0
  203. package/dist/types/application/svelte/index.d.ts.map +1 -0
  204. package/dist/types/application/svelte/textHelpers.d.ts +21 -0
  205. package/dist/types/application/svelte/textHelpers.d.ts.map +1 -0
  206. package/dist/types/domain/index.d.ts +2 -1
  207. package/dist/types/domain/index.d.ts.map +1 -1
  208. package/dist/types/index.d.ts +1 -0
  209. package/dist/types/index.d.ts.map +1 -1
  210. package/dist/types/page/index.d.ts +1 -0
  211. package/dist/types/page/index.d.ts.map +1 -1
  212. package/dist/types/shared/versions.d.ts +11 -9
  213. package/dist/types/shared/versions.d.ts.map +1 -1
  214. package/dist/types/wrapper/index.d.ts +2 -1
  215. package/dist/types/wrapper/index.d.ts.map +1 -1
  216. package/package.json +8 -8
  217. package/dist/esm/application/react/templates/src/lib/ThemeSelector/index.ts +0 -1
@@ -0,0 +1,87 @@
1
+ <script lang="ts" module>
2
+ import { createHelpItem } from "@canonical/svelte-ds-app";
3
+ import { defineMeta } from "@storybook/addon-svelte-csf";
4
+ import { expect, within } from "storybook/test";
5
+ import Component from "./ApplicationShell.svelte";
6
+
7
+ const { Story } = defineMeta({
8
+ title: "common/ApplicationShell",
9
+ component: Component,
10
+ parameters: { layout: "fullscreen" },
11
+ args: {
12
+ label: "Dashboard",
13
+ currentUrl: "/",
14
+ root: {
15
+ key: "root",
16
+ items: [
17
+ {
18
+ key: "pages",
19
+ items: [
20
+ { url: "/", label: "Overview", icon: "switcher-dashboard" },
21
+ {
22
+ url: "/dashboard/instances",
23
+ label: "Instances",
24
+ icon: "containers",
25
+ },
26
+ {
27
+ url: "/dashboard/settings",
28
+ label: "Settings",
29
+ icon: "settings",
30
+ },
31
+ ],
32
+ },
33
+ {
34
+ key: "networking",
35
+ label: "Networking",
36
+ items: [
37
+ {
38
+ key: "networks",
39
+ label: "Networks",
40
+ icon: "connected",
41
+ disabled: true,
42
+ },
43
+ ],
44
+ },
45
+ {
46
+ key: "help-group",
47
+ items: [createHelpItem("https://ubuntu.com/legal")],
48
+ },
49
+ ],
50
+ },
51
+ footerRoot: {
52
+ key: "footer",
53
+ items: [
54
+ { url: "/guides/router-core", label: "Router guide", icon: "book" },
55
+ ],
56
+ },
57
+ },
58
+ });
59
+ </script>
60
+
61
+ {#snippet template(args: import("./types.js").ApplicationShellProps)}
62
+ <div style="block-size: 100dvh; display: grid;">
63
+ <Component {...args}><h1>Page content</h1></Component>
64
+ </div>
65
+ {/snippet}
66
+
67
+ <!-- The application layout with the side navigation following the page: the
68
+ item for the current URL is marked as the current page. -->
69
+ <Story
70
+ name="Default"
71
+ {template}
72
+ play={async ({ canvasElement, args }) => {
73
+ const canvas = within(canvasElement);
74
+ const navigation = canvas.getByRole("navigation", { name: args.label });
75
+
76
+ await expect(
77
+ within(navigation).getByRole("link", { name: "Overview" }),
78
+ ).toHaveAttribute("aria-current", "page");
79
+ await expect(canvas.getByRole("main")).toHaveAttribute(
80
+ "id",
81
+ "main-content",
82
+ );
83
+ }}
84
+ />
85
+
86
+ <!-- Without footer rows, the side navigation shows no footer. -->
87
+ <Story name="WithoutFooter" {template} args={{ footerRoot: undefined }} />
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import { ApplicationLayout, SideNavigation } from "@canonical/svelte-ds-app";
3
+ <% if (intl) { -%>
4
+ import { createAppTranslator, getLocaleSource } from "../../i18n/index.js";
5
+ <% } -%>
6
+ import CanonicalLogo from "../CanonicalLogo/index.js";
7
+ import type { ApplicationShellProps } from "./types.js";
8
+ import "./styles.css";
9
+
10
+ const componentCssClassName = "ds application-shell";
11
+
12
+ let {
13
+ root,
14
+ footerRoot,
15
+ label,
16
+ currentUrl,
17
+ children,
18
+ class: className,
19
+ ...rest
20
+ }: ApplicationShellProps = $props();
21
+ <% if (intl) { -%>
22
+
23
+ const locale = getLocaleSource();
24
+ const t = $derived(createAppTranslator($locale));
25
+ <% } -%>
26
+ </script>
27
+
28
+ <div {...rest} class={[componentCssClassName, "surface", className]}>
29
+ <ApplicationLayout>
30
+ {#snippet navigation()}
31
+ <SideNavigation aria-label={label} applicationName=<%- attr("app.name", name) %> {currentUrl} {footerRoot} messages={{
32
+ skipToContent: () => <%- str("shell.skipToContent", "Skip to main content") %>,
33
+ collapseNavigation: () => <%- str("shell.collapseNavigation", "Collapse navigation") %>,
34
+ expandNavigation: () => <%- str("shell.expandNavigation", "Expand navigation") %>,
35
+ collapse: () => <%- str("shell.collapse", "Collapse") %>,
36
+ expand: () => <%- str("shell.expand", "Expand") %>,
37
+ openMenu: () => <%- str("shell.openMenu", "Menu") %>,
38
+ closeMenu: () => <%- str("shell.closeMenu", "Close menu") %>,
39
+ }} {root}>
40
+ {#snippet brand()}<CanonicalLogo {currentUrl} />{/snippet}
41
+ </SideNavigation>
42
+ {/snippet}
43
+ <main class="main" id="main-content">{@render children?.()}</main>
44
+ </ApplicationLayout>
45
+ </div>
46
+
47
+ <!-- @component
48
+ An application's frame: the design system's `ApplicationLayout`, with its
49
+ `SideNavigation` in the navigation slot and the page in `<main>`.
50
+
51
+ The side navigation follows the page: `currentUrl` marks the active item.
52
+ `<main id="main-content">` is the side navigation's skip-link target. Its plain
53
+ links route through SvelteKit, so it needs no `link` snippet.
54
+
55
+ The shell is a `.surface`: the design system's components read their colours
56
+ from the surface channels it sets, and the side panels and modals opened inside
57
+ it paint from them.
58
+
59
+ `import { ApplicationShell } from "$lib";`
60
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./ApplicationShell.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,43 @@
1
+ @layer app {
2
+ /* The shell fills the area its parent gives it. The application layout
3
+ inside is block-size: 100%, so the side navigation spans that height and
4
+ the page scrolls inside <main> rather than the document. */
5
+ .ds.application-shell {
6
+ min-block-size: 0;
7
+
8
+ & .main {
9
+ box-sizing: border-box;
10
+ block-size: 100%;
11
+ overflow: auto;
12
+ padding-block: var(--container-gap-loose);
13
+ padding-inline-end: var(--grid-margin);
14
+ }
15
+
16
+ /* A side panel opened in the shell is fixed to the viewport and spans its
17
+ full height by default. When the shell sits under other chrome, such
18
+ as a top bar, the page sets --application-shell-overlay-inset-block-start
19
+ so the panel starts below it and that chrome stays usable. */
20
+ & .ds.side-panel {
21
+ inset-block-start: var(--application-shell-overlay-inset-block-start, 0);
22
+ }
23
+
24
+ /* Below the side navigation's small breakpoint (620px) the navigation
25
+ stops being a rail and becomes a bar that opens a full-screen menu,
26
+ so the layout stacks it above the page instead of beside it. */
27
+ @media (width < 620px) {
28
+ & > .ds.application-layout {
29
+ grid-template-columns: 1fr;
30
+ grid-template-rows: auto 1fr;
31
+ }
32
+
33
+ & .main {
34
+ padding-inline-start: var(--grid-margin);
35
+ }
36
+
37
+ /* On a phone the panel takes the whole screen. */
38
+ & .ds.side-panel {
39
+ inset-block-start: 0;
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,23 @@
1
+ import type { FooterRoot, NavRoot } from "@canonical/svelte-ds-app";
2
+ import type { Snippet } from "svelte";
3
+ import type { SvelteHTMLElements } from "svelte/elements";
4
+
5
+ /**
6
+ * Props for `ApplicationShell`: the side navigation's data, the page it is on
7
+ * and the page content, plus the native props of the root `<div>`, which
8
+ * reach the element unchanged.
9
+ */
10
+ type BaseProps = SvelteHTMLElements["div"];
11
+
12
+ export interface ApplicationShellProps extends BaseProps {
13
+ /** The side navigation's tree: groups of items, each item with a `url`. */
14
+ root: NavRoot;
15
+ /** The side navigation's footer rows. Omit it to hide the footer. */
16
+ footerRoot?: FooterRoot;
17
+ /** The accessible name of the side navigation's landmark. */
18
+ label: string;
19
+ /** The current page's pathname; its item is marked as the current page. */
20
+ currentUrl: string;
21
+ /** The page, rendered in the shell's `<main>`. */
22
+ children?: Snippet;
23
+ }
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ <% if (intl) { -%>
3
+ import { createAppTranslator, getLocaleSource } from "../../i18n/index.js";
4
+ <% } -%>
5
+ import type { CanonicalLogoProps } from "./types.js";
6
+ import "./styles.css";
7
+
8
+ const componentCssClassName = "ds canonical-logo";
9
+ const href = "/dashboard";
10
+
11
+ let { currentUrl, class: className, ...rest }: CanonicalLogoProps = $props();
12
+ <% if (intl) { -%>
13
+
14
+ const locale = getLocaleSource();
15
+ const t = $derived(createAppTranslator($locale));
16
+ <% } -%>
17
+ </script>
18
+
19
+ <a {...rest} aria-label=<%- attr("dashboard.nav.home", "Dashboard overview") %> class={[componentCssClassName, className]} aria-current={currentUrl === href ? "page" : undefined} {href}><svg aria-hidden="true" class="mark" focusable="false" viewBox="0 0 60.45 57.87"><circle cx="9.66" cy="27.41" r="8.12" /><circle cx="43.48" cy="9.61" r="8.12" /><path d="M7.34,38.71A26.67,26.67,0,0,0,32.58,55.55a11.47,11.47,0,0,1-2.49-7Q29,48.4,28,48.19A19.62,19.62,0,0,1,14.55,37.83,11.49,11.49,0,0,1,7.34,38.71Z" /><circle cx="41.65" cy="48.35" r="8.12" /><path d="M48.9,39.31a11.58,11.58,0,0,1,4,6.25,26.64,26.64,0,0,0,1.36-31.63,11.47,11.47,0,0,1-4.7,5.54A19.73,19.73,0,0,1,48.9,39.31Z" /><path d="M9.68,15.85a11.44,11.44,0,0,1,2.4.25,11.72,11.72,0,0,1,3.77,1.54,19.73,19.73,0,0,1,16-8.56,12.15,12.15,0,0,1,.22-1.9h0a11.75,11.75,0,0,1,2.34-4.89A26.9,26.9,0,0,0,8.82,15.88C9.11,15.86,9.39,15.85,9.68,15.85Z" /></svg></a>
20
+
21
+ <!-- @component
22
+ The brand of the dashboard's side navigation: the brand-orange rectangle with
23
+ the circle-of-friends mark, linking to the dashboard's overview. The mark is
24
+ inline SVG, so it renders on the server and needs no asset route.
25
+
26
+ `import { CanonicalLogo } from "$lib";`
27
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./CanonicalLogo.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,31 @@
1
+ /* The side navigation's brand slot: a brand-orange rectangle sized by the side
2
+ * navigation's logo tokens, with the circle-of-friends mark on the baseline
3
+ * grid. The rectangle overshoots a grid line by `--logo-overflow` and cancels
4
+ * it with its bottom margin, so the header stays a whole number of baseline
5
+ * units tall. */
6
+
7
+ @layer app {
8
+ .ds.canonical-logo {
9
+ --mark-size: 4; /* the mark's side, in baseline units */
10
+ --mark-margin-top: 5; /* the gap above the mark, in baseline units */
11
+ --logo-overflow: 0.25rem;
12
+
13
+ display: flex;
14
+ align-items: flex-start;
15
+ justify-content: center;
16
+ block-size: var(--sidenav-logo-block-size);
17
+ inline-size: var(--sidenav-logo-inline-size);
18
+ margin-block-end: calc(var(--space-baseline) - var(--logo-overflow));
19
+ background: var(--color-background-logo);
20
+
21
+ & > .mark {
22
+ display: block;
23
+ inline-size: calc(var(--space-baseline) * var(--mark-size));
24
+ block-size: calc(var(--space-baseline) * var(--mark-size));
25
+ margin-block-start: calc(var(--space-baseline) * var(--mark-margin-top));
26
+ /* The mark is part of the brand asset: white on the brand rectangle in
27
+ every theme, so it is not a themable value. */
28
+ fill: white;
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,15 @@
1
+ import type { SvelteHTMLElements } from "svelte/elements";
2
+
3
+ /**
4
+ * Props for `CanonicalLogo`. The logo owns its link target, its accessible
5
+ * name and its mark, so it takes the page it is on and the native props of
6
+ * its root `<a>`, which reach the element unchanged.
7
+ */
8
+ export interface CanonicalLogoProps
9
+ extends Omit<
10
+ SvelteHTMLElements["a"],
11
+ "aria-label" | "children" | "href" | "aria-current"
12
+ > {
13
+ /** The current page's pathname; on the overview the logo is the current page. */
14
+ currentUrl: string;
15
+ }
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { CodeMessageProps } from "./types.js";
3
+
4
+ let { message, ...rest }: CodeMessageProps = $props();
5
+
6
+ // Splitting on backticks leaves prose at even indexes and code at odd ones.
7
+ const parts = $derived(message.split("`"));
8
+ </script>
9
+
10
+ <p {...rest}>{#each parts as part, index}{#if index % 2 === 1}<code class="ds inline-code code">{part}</code>{:else}{part}{/if}{/each}</p>
11
+
12
+ <!-- @component
13
+ A translated paragraph that names code. The message marks code names with
14
+ backticks, as Markdown does, and each one renders with the markup of React's
15
+ `InlineCode`, which `@canonical/svelte-ds-global` does not ship yet.
16
+
17
+ `import { CodeMessage } from "$lib";`
18
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./CodeMessage.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,14 @@
1
+ import type { SvelteHTMLElements } from "svelte/elements";
2
+
3
+ /**
4
+ * Props for `CodeMessage`: the message, plus the native props of the root
5
+ * `<p>`, which reach the element unchanged.
6
+ */
7
+ export interface CodeMessageProps
8
+ extends Omit<SvelteHTMLElements["p"], "children"> {
9
+ /**
10
+ * A translated message, with code names between backticks, e.g.
11
+ * "`LazyComponent` awaits a delayed fetch".
12
+ */
13
+ message: string;
14
+ }
@@ -0,0 +1,15 @@
1
+ <script lang="ts" module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import Component from "./ExampleComponent.svelte";
4
+
5
+ const { Story } = defineMeta({
6
+ title: "ExampleComponent",
7
+ component: Component,
8
+ });
9
+ </script>
10
+
11
+ <Story name="Default">
12
+ {#snippet template(args)}
13
+ <Component {...args}><span>Hello world!</span></Component>
14
+ {/snippet}
15
+ </Story>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import type { ExampleComponentProps } from "./types.js";
3
+ import "./styles.css";
4
+
5
+ const componentCssClassName = "ds example-component";
6
+
7
+ let { class: className, children, ...rest }: ExampleComponentProps = $props();
8
+ </script>
9
+
10
+ <div class={[componentCssClassName, className]} {...rest}>{@render children?.()}</div>
11
+
12
+ <!-- @component
13
+ A plain component scaffolded alongside the app: the starting point for your own
14
+ components.
15
+
16
+ `import { ExampleComponent } from "$lib";`
17
+ -->
@@ -0,0 +1,2 @@
1
+ export { default as ExampleComponent } from "./ExampleComponent.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,17 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.9 */
2
+
3
+ /* This application's own CSS, in `app`. Left unlayered it would beat every
4
+ * rule the design system ships, because unlayered CSS outranks any layer —
5
+ * by accident rather than by intent. `app` sorts above the design system's
6
+ * own layers only while the entry imports `#styles/index.css`, and with it
7
+ * `@canonical/styles`' order statement, before anything that pulls this file
8
+ * in; that is what canonical/pragma-web#1122 puts in the generated entry, and
9
+ * this file lands after it. Keep that import first. */
10
+
11
+ @layer app {
12
+ /*
13
+ .ds.example-component {
14
+
15
+ }
16
+ */
17
+ }
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from "svelte";
2
+ import type { SvelteHTMLElements } from "svelte/elements";
3
+
4
+ /** Props for `ExampleComponent`: its content, plus the native props of the root `<div>`. */
5
+ type BaseProps = SvelteHTMLElements["div"];
6
+
7
+ export interface ExampleComponentProps extends BaseProps {
8
+ /** Child content. */
9
+ children?: Snippet;
10
+ }
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { IconProps } from "./types.js";
3
+
4
+ const componentCssClassName = "ds icon";
5
+
6
+ let { name, class: className, ...rest }: IconProps = $props();
7
+ </script>
8
+
9
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class={[componentCssClassName, className]} aria-hidden="true" {...rest}><use href={`/icons/${name}.svg#${name}`}></use></svg>
10
+
11
+ <!-- @component
12
+ A design-system glyph from the `/icons` sprite route, with the markup of React's
13
+ `Icon`. A stand-in until `@canonical/svelte-ds-global` ships an Icon.
14
+
15
+ `import { Icon } from "$lib";`
16
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./Icon.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,10 @@
1
+ import type { SvelteHTMLElements } from "svelte/elements";
2
+
3
+ /**
4
+ * Props for `Icon`: the glyph's name in `@canonical/ds-assets`, plus the native
5
+ * props of the root `<svg>`.
6
+ */
7
+ export interface IconProps extends Omit<SvelteHTMLElements["svg"], "children"> {
8
+ /** The icon's name, served at `/icons/<name>.svg`. */
9
+ name: string;
10
+ }
@@ -0,0 +1,19 @@
1
+ <script lang="ts" module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import createDelayedData from "./createDelayedData.js";
4
+ import Component from "./LazyComponent.svelte";
5
+
6
+ const { Story } = defineMeta({
7
+ title: "LazyComponent",
8
+ component: Component,
9
+ });
10
+ </script>
11
+
12
+ <!-- The story renders the pending fallback first, as the homepage does while the server streams. -->
13
+ <Story name="Default">
14
+ {#snippet template()}
15
+ <Component data={createDelayedData()}>
16
+ {#snippet pending()}<p>Loading…</p>{/snippet}
17
+ </Component>
18
+ {/snippet}
19
+ </Story>
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ <% if (intl) { -%>
3
+ import { createAppTranslator, getLocaleSource } from "../../i18n/index.js";
4
+ <% } -%>
5
+ import type { LazyComponentProps } from "./types.js";
6
+
7
+ let { data, pending }: LazyComponentProps = $props();
8
+ <% if (intl) { -%>
9
+
10
+ const locale = getLocaleSource();
11
+ const t = $derived(createAppTranslator($locale));
12
+ <% } -%>
13
+ </script>
14
+
15
+ <% if (intl) { -%>
16
+ {#await data}{@render pending?.()}{:then messageKey}<p>{t(messageKey)}</p>{/await}
17
+ <% } else { -%>
18
+ {#await data}{@render pending?.()}{:then text}<p>{text}</p>{/await}
19
+ <% } -%>
20
+
21
+ <!-- @component
22
+ Demonstrates streaming SSR with a promise.
23
+
24
+ A page's `load` returns a promise without awaiting it. SvelteKit renders the
25
+ page with `pending` in place, streams the resolved value in the same response,
26
+ and swaps the content in once it arrives, without a second request.
27
+
28
+ `import { LazyComponent } from "$lib";`
29
+ -->
@@ -0,0 +1,24 @@
1
+ <% if (intl) { -%>
2
+ import type { MessageKey } from "../../i18n/index.js";
3
+
4
+ /**
5
+ * Synthetic data source: resolves after `delayMs` to simulate a slow fetch. It
6
+ * resolves to a catalog key, so the streamed text renders in the active
7
+ * locale. Replace it with a real data source in your own routes.
8
+ */
9
+ export default function createDelayedData(delayMs = 1000): Promise<MessageKey> {
10
+ return new Promise((resolve) => {
11
+ setTimeout(() => resolve("home.streamed"), delayMs);
12
+ });
13
+ }
14
+ <% } else { -%>
15
+ /**
16
+ * Synthetic data source: resolves after `delayMs` to simulate a slow fetch.
17
+ * Replace it with a real data source in your own routes.
18
+ */
19
+ export default function createDelayedData(delayMs = 1000): Promise<string> {
20
+ return new Promise((resolve) => {
21
+ setTimeout(() => resolve("Streamed in after a delay"), delayMs);
22
+ });
23
+ }
24
+ <% } -%>
@@ -0,0 +1,2 @@
1
+ export { default } from "./LazyComponent.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from "svelte";
2
+ <% if (intl) { -%>
3
+ import type { MessageKey } from "../../i18n/index.js";
4
+ <% } -%>
5
+
6
+ /** Props for `LazyComponent`. */
7
+ export interface LazyComponentProps {
8
+ /**
9
+ <% if (intl) { -%>
10
+ * The pending fetch: it resolves to the catalog key of the text to show.
11
+ <% } else { -%>
12
+ * The pending fetch: it resolves to the text to show.
13
+ <% } -%>
14
+ * A page's `load` returns it without awaiting it, so SvelteKit streams it.
15
+ */
16
+ data: Promise<<%= intl ? "MessageKey" : "string" %>>;
17
+ /** Rendered while `data` is pending. */
18
+ pending?: Snippet;
19
+ }
@@ -0,0 +1,50 @@
1
+ <script lang="ts">
2
+ import { Button } from "@canonical/svelte-ds-global";
3
+ <% if (forms) { -%>
4
+ import { SelectInput } from "@canonical/svelte-ds-global-form";
5
+ <% } -%>
6
+ import {
7
+ createAppTranslator,
8
+ getLocaleSource,
9
+ i18nConfig,
10
+ } from "../../i18n/index.js";
11
+ import type { LocaleSelectorProps } from "./types.js";
12
+
13
+ let { ...rest }: LocaleSelectorProps = $props();
14
+
15
+ const locale = getLocaleSource();
16
+ const t = $derived(createAppTranslator($locale));
17
+
18
+ /**
19
+ * Resolve a locale tag to its endonym — the language's name in itself
20
+ * ("English", "français", "العربية") — so every reader can find their own
21
+ * language regardless of the page's current locale.
22
+ */
23
+ function endonymOf(tag: string): string {
24
+ return new Intl.DisplayNames([tag], { type: "language" }).of(tag) ?? tag;
25
+ }
26
+
27
+ const options = i18nConfig.locales.map((tag) => ({
28
+ value: tag,
29
+ label: endonymOf(tag),
30
+ lang: tag,
31
+ }));
32
+
33
+ function handleChange(event: Event & { currentTarget: HTMLSelectElement }) {
34
+ locale.set(event.currentTarget.value);
35
+ }
36
+ </script>
37
+
38
+ <form {...rest} method="post" action="/language"><% if (forms) { %><SelectInput aria-label={t("locale.label")} name="locale" onchange={handleChange} {options} value={$locale} /><% } else { %><select aria-label={t("locale.label")} name="locale" onchange={handleChange} value={$locale}>{#each options as option (option.value)}<option lang={option.lang} value={option.value}>{option.label}</option>{/each}</select><% } %><noscript><Button importance="secondary" type="submit">{t("preferences.apply")}</Button></noscript></form>
39
+
40
+ <!-- @component
41
+ The language picker, driving the locale source the root layout provides. With
42
+ JavaScript, a change re-translates every subscribed component, writes the
43
+ `locale` cookie and flips `<html lang dir>`. Without JavaScript, the form
44
+ posts to `/language`, which stores the cookie and sends the reader back; its Apply button is in `<noscript>`.
45
+
46
+ Each option carries a `lang` attribute so assistive technology pronounces the
47
+ endonym in its own language.
48
+
49
+ `import { LocaleSelector } from "$lib";`
50
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./LocaleSelector.svelte";
2
+ export type * from "./types.js";
@@ -0,0 +1,7 @@
1
+ import type { SvelteHTMLElements } from "svelte/elements";
2
+
3
+ /** Props for `LocaleSelector`: the native props of the root `<form>`. */
4
+ export type LocaleSelectorProps = Omit<
5
+ SvelteHTMLElements["form"],
6
+ "children" | "method" | "action"
7
+ >;
@@ -0,0 +1,42 @@
1
+ <script lang="ts">
2
+ <% if (intl) { -%>
3
+ import { createAppTranslator, getLocaleSource } from "../../i18n/index.js";
4
+ <% } -%>
5
+ <% if (intl) { -%>
6
+ import LocaleSelector from "../LocaleSelector/index.js";
7
+ <% } -%>
8
+ import ThemeSelector from "../ThemeSelector/index.js";
9
+ import type { NavigationProps } from "./types.js";
10
+
11
+ let { currentUrl, theme, ...rest }: NavigationProps = $props();
12
+ <% if (intl) { -%>
13
+
14
+ const locale = getLocaleSource();
15
+ const t = $derived(createAppTranslator($locale));
16
+ <% } -%>
17
+ const links = $derived([
18
+ { href: "/", path: "/", label: <%- str("nav.home", "Home") %> },
19
+ {
20
+ href: "/guides/router-core",
21
+ path: "/guides/router-core",
22
+ label: <%- str("nav.guide", "Guide") %>,
23
+ },
24
+ { href: "/catalog", path: "/catalog", label: <%- str("nav.catalog", "Catalog") %> },
25
+ <% if (forms) { -%>
26
+ { href: "/contact", path: "/contact", label: <%- str("nav.contact", "Contact") %> },
27
+ <% } -%>
28
+ <% if (appShell) { -%>
29
+ { href: "/dashboard", path: "/dashboard", label: <%- str("nav.dashboard", "Dashboard") %> },
30
+ <% } -%>
31
+ { href: "/account?auth=1", path: "/account", label: <%- str("nav.signIn", "Demo sign-in") %> },
32
+ ]);
33
+ </script>
34
+
35
+ <nav aria-label=<%- attr("nav.label", "Main") %> {...rest}>{#each links as link (link.href)}<a aria-current={link.path === currentUrl ? "page" : undefined} href={link.href}>{link.label}</a>{/each}<ThemeSelector preference={theme} /><% if (intl) { %><LocaleSelector /><% } %></nav>
36
+
37
+ <!-- @component
38
+ The demo navigation: one link per area of the scaffold, then the theme<% if (intl) { %> and
39
+ language<% } %> selector<% if (intl) { %>s<% } %>. The link for the current page is marked `aria-current`.
40
+
41
+ `import { Navigation } from "$lib";`
42
+ -->
@@ -0,0 +1,2 @@
1
+ export { default } from "./Navigation.svelte";
2
+ export type * from "./types.js";