@canonical/summon-application 0.48.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.
- package/README.md +20 -26
- package/dist/esm/application/react/index.js +28 -1
- package/dist/esm/application/react/index.js.map +1 -1
- package/dist/esm/application/react/templates/README.md.ejs +5 -0
- package/dist/esm/application/react/templates/src/domains/catalog/ProductCard.tsx.ejs +2 -2
- package/dist/esm/application/react/templates/src/domains/dashboard/InstancesPage.tsx.ejs +1 -1
- package/dist/esm/application/react/templates/src/domains/dashboard/OverviewPage.tsx.ejs +6 -6
- package/dist/esm/application/react/templates/src/i18n/ar.ts.ejs +1 -0
- package/dist/esm/application/react/templates/src/i18n/config.ts +2 -2
- package/dist/esm/application/react/templates/src/i18n/en.ts.ejs +1 -0
- package/dist/esm/application/react/templates/src/i18n/fr.ts.ejs +1 -0
- package/dist/esm/application/react/templates/src/i18n/negotiation.test.ts +5 -5
- package/dist/esm/application/react/templates/src/lib/LocaleSelector/LocaleSelector.test.tsx +10 -0
- package/dist/esm/application/react/templates/src/lib/LocaleSelector/LocaleSelector.tsx.ejs +35 -21
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/ServerThemeContext.ts +13 -0
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.ssr.test.tsx.ejs +45 -0
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.test.tsx.ejs +67 -0
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.tsx.ejs +60 -26
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/index.ts.ejs +4 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/TopBar.test.tsx.ejs +7 -10
- package/dist/esm/application/react/templates/src/lib/TopBar/styles.css +8 -3
- package/dist/esm/application/react/templates/src/server/entry.tsx.ejs +23 -14
- package/dist/esm/application/react/templates/src/server/handlePreferenceForm.test.ts.ejs +63 -0
- package/dist/esm/application/react/templates/src/server/handlePreferenceForm.ts.ejs +158 -0
- package/dist/esm/application/react/templates/src/server/preferenceFormMiddleware.ts +42 -0
- package/dist/esm/application/react/templates/src/server/preview.bun.ts +5 -0
- package/dist/esm/application/react/templates/src/server/preview.express.ts +4 -0
- package/dist/esm/application/react/templates/src/server/resolveReturnTo.ts +18 -0
- package/dist/esm/application/react/templates/src/server/server.bun.ts.ejs +5 -0
- package/dist/esm/application/react/templates/src/server/server.express.ts.ejs +4 -0
- package/dist/esm/application/react/templates/test/e2e/servers.e2e.ts.ejs +56 -0
- package/dist/esm/application/react/templates/vitest.config.ts +4 -0
- package/dist/esm/application/svelte/index.js +226 -80
- package/dist/esm/application/svelte/index.js.map +1 -1
- package/dist/esm/application/svelte/templates/.storybook/{main.ts.ejs → main.ts} +1 -0
- package/dist/esm/application/svelte/templates/.storybook/preview.ts.ejs +20 -2
- package/dist/esm/application/svelte/templates/README.md.ejs +163 -40
- package/dist/esm/application/svelte/templates/biome.json.ejs +12 -0
- package/dist/esm/application/svelte/templates/gitignore.ejs +3 -4
- package/dist/esm/application/svelte/templates/package.json.ejs +54 -18
- package/dist/esm/application/svelte/templates/scripts/copy-icons.js +10 -0
- package/dist/esm/application/svelte/templates/src/app.d.ts.ejs +10 -2
- package/dist/esm/application/svelte/templates/src/app.html.ejs +9 -1
- package/dist/esm/application/svelte/templates/src/domains/account/AccountPage.svelte.ejs +18 -0
- package/dist/esm/application/svelte/templates/src/domains/account/LoginPage.svelte.ejs +32 -0
- package/dist/esm/application/svelte/templates/src/domains/account/getAuthRedirect.test.ts +18 -0
- package/dist/esm/application/svelte/templates/src/domains/account/getAuthRedirect.ts +18 -0
- package/dist/esm/application/svelte/templates/src/domains/account/guardAccount.ts +15 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/CatalogPage.svelte.ejs +35 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/ProductCard.svelte.ejs +51 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/ProductList.stories.svelte.ejs +110 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/ProductList.svelte.ejs +41 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/constants.ts +2 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/data.test.ts +19 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/data.ts +75 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/loadCatalog.ts +7 -0
- package/dist/esm/application/svelte/templates/src/domains/catalog/types.ts +25 -0
- package/dist/esm/application/svelte/templates/src/domains/contact/ContactPage.svelte.ejs +86 -0
- package/dist/esm/application/svelte/templates/src/domains/contact/types.ts.ejs +19 -0
- package/dist/esm/application/svelte/templates/src/domains/contact/validateContact.test.ts.ejs +31 -0
- package/dist/esm/application/svelte/templates/src/domains/contact/validateContact.ts.ejs +28 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/DashboardBreadcrumbs.svelte.ejs +29 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/DashboardLayout.svelte.ejs +35 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/InstancesPage.svelte.ejs +245 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/OverviewPage.svelte.ejs +180 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/SettingsPage.svelte.ejs +103 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/constants.ts.ejs +253 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/createDashboardNavigation.ts.ejs +103 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/createInstance.test.ts +22 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/createInstance.ts +28 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/projectBreadcrumbs.test.ts +78 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/projectBreadcrumbs.ts +47 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/selectRelativeTime.test.ts +19 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/selectRelativeTime.ts +24 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/styles.css +98 -0
- package/dist/esm/application/svelte/templates/src/domains/dashboard/types.ts.ejs +61 -0
- package/dist/esm/application/svelte/templates/src/domains/marketing/GuidePage.svelte.ejs +29 -0
- package/dist/esm/application/svelte/templates/src/domains/marketing/HomePage.svelte.ejs +47 -0
- package/dist/esm/application/svelte/templates/src/domains/marketing/isGuideSlug.ts +8 -0
- package/dist/esm/application/svelte/templates/src/formatDocumentTitle.ts.ejs +9 -0
- package/dist/esm/application/svelte/templates/src/hooks.server.ts.ejs +47 -9
- package/dist/esm/application/svelte/templates/src/i18n/ar.ts.ejs +174 -0
- package/dist/esm/application/svelte/templates/src/i18n/catalogs.ts +14 -0
- package/dist/esm/application/svelte/templates/src/i18n/config.ts +19 -0
- package/dist/esm/application/svelte/templates/src/i18n/en.ts.ejs +173 -0
- package/dist/esm/application/svelte/templates/src/i18n/fr.ts.ejs +171 -0
- package/dist/esm/application/svelte/templates/src/i18n/index.ts +45 -0
- package/dist/esm/application/svelte/templates/src/i18n/negotiation.test.ts +92 -0
- package/dist/esm/application/svelte/templates/src/layouts/ErrorPage.svelte.ejs +40 -0
- package/dist/esm/application/svelte/templates/src/layouts/PublicLayout.svelte +18 -0
- package/dist/esm/application/svelte/templates/src/layouts/RootLayout.svelte.ejs +43 -0
- package/dist/esm/application/svelte/templates/src/layouts/TopBarLayout.svelte +28 -0
- package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/ApplicationShell.stories.svelte +87 -0
- package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/ApplicationShell.svelte.ejs +60 -0
- package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/styles.css +43 -0
- package/dist/esm/application/svelte/templates/src/lib/ApplicationShell/types.ts +23 -0
- package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/CanonicalLogo.svelte.ejs +27 -0
- package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/styles.css +31 -0
- package/dist/esm/application/svelte/templates/src/lib/CanonicalLogo/types.ts +15 -0
- package/dist/esm/application/svelte/templates/src/lib/CodeMessage/CodeMessage.svelte +18 -0
- package/dist/esm/application/svelte/templates/src/lib/CodeMessage/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/CodeMessage/types.ts +14 -0
- package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/ExampleComponent.stories.svelte +15 -0
- package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/ExampleComponent.svelte +17 -0
- package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/styles.css +17 -0
- package/dist/esm/application/svelte/templates/src/lib/ExampleComponent/types.ts +10 -0
- package/dist/esm/application/svelte/templates/src/lib/Icon/Icon.svelte +16 -0
- package/dist/esm/application/svelte/templates/src/lib/Icon/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/Icon/types.ts +10 -0
- package/dist/esm/application/svelte/templates/src/lib/LazyComponent/LazyComponent.stories.svelte +19 -0
- package/dist/esm/application/svelte/templates/src/lib/LazyComponent/LazyComponent.svelte.ejs +29 -0
- package/dist/esm/application/svelte/templates/src/lib/LazyComponent/createDelayedData.ts.ejs +24 -0
- package/dist/esm/application/svelte/templates/src/lib/LazyComponent/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/LazyComponent/types.ts.ejs +19 -0
- package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/LocaleSelector.svelte.ejs +50 -0
- package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/LocaleSelector/types.ts +7 -0
- package/dist/esm/application/svelte/templates/src/lib/Navigation/Navigation.svelte.ejs +42 -0
- package/dist/esm/application/svelte/templates/src/lib/Navigation/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/Navigation/types.ts +14 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/ThemeSelector.svelte.ejs +38 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/constants.ts +8 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/index.ts +5 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/readTheme.test.ts +13 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/readTheme.ts +15 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/setTheme.ts +27 -0
- package/dist/esm/application/svelte/templates/src/lib/ThemeSelector/types.ts +18 -0
- package/dist/esm/application/svelte/templates/src/lib/TopBar/TopBar.stories.svelte.ejs +24 -0
- package/dist/esm/application/svelte/templates/src/lib/TopBar/TopBar.svelte.ejs +32 -0
- package/dist/esm/application/svelte/templates/src/lib/TopBar/index.ts +2 -0
- package/dist/esm/application/svelte/templates/src/lib/TopBar/styles.css +54 -0
- package/dist/esm/application/svelte/templates/src/lib/TopBar/types.ts +15 -0
- package/dist/esm/application/svelte/templates/src/lib/index.ts.ejs +16 -0
- package/dist/esm/application/svelte/templates/src/params/guide.ts +5 -0
- package/dist/esm/application/svelte/templates/src/resolveReturnTo.test.ts +27 -0
- package/dist/esm/application/svelte/templates/src/resolveReturnTo.ts +13 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+layout.svelte +8 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.server.ts +6 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.svelte +8 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/+page.ts +6 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/account/+page.svelte +5 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/account/+page.ts +4 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/catalog/+page.svelte +8 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/catalog/+page.ts +4 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/contact/+page.server.ts +25 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/contact/+page.svelte.ejs +30 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/guides/[slug=guide]/+page.svelte +6 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/(public)/login/+page.svelte +6 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/+layout.svelte +9 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/+layout.svelte +9 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/+page.svelte +5 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/instances/+page.server.ts.ejs +28 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/instances/+page.svelte.ejs +19 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/settings/+page.server.ts +9 -0
- package/dist/esm/application/svelte/templates/src/routes/(top-bar)/dashboard/settings/+page.svelte +5 -0
- package/dist/esm/application/svelte/templates/src/routes/+error.svelte +6 -0
- package/dist/esm/application/svelte/templates/src/routes/+layout.server.ts.ejs +7 -1
- package/dist/esm/application/svelte/templates/src/routes/+layout.svelte.ejs +18 -82
- package/dist/esm/application/svelte/templates/src/routes/+layout.ts.ejs +29 -0
- package/dist/esm/application/svelte/templates/src/routes/home/+page.ts +4 -0
- package/dist/esm/application/svelte/templates/src/routes/home/{+server.ts.ejs → +server.ts} +1 -0
- package/dist/esm/application/svelte/templates/src/routes/icons/[icon]/+server.ts +37 -0
- package/dist/esm/application/svelte/templates/src/routes/language/+server.ts +30 -0
- package/dist/esm/application/svelte/templates/src/routes/preferences/+server.ts +32 -0
- package/dist/esm/application/svelte/templates/src/routes/sitemap.xml/+server.ts.ejs +44 -4
- package/dist/esm/application/svelte/templates/src/storybook/I18nDecorator.svelte +28 -0
- package/dist/esm/application/svelte/templates/src/storybook/decorators.ts +12 -0
- package/dist/esm/application/svelte/templates/src/styles/app.css +38 -0
- package/dist/esm/application/svelte/templates/src/styles/index.css.ejs +25 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/Card.css +198 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/Icon.css +32 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/InlineCode.css +30 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/SidePanel.css +462 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/Tile.css +108 -0
- package/dist/esm/application/svelte/templates/src/styles/standins/Timeline.css +171 -0
- package/dist/esm/application/svelte/templates/src/styles/standins.css.ejs +17 -0
- package/dist/esm/application/svelte/templates/svelte.config.js.ejs +12 -2
- package/dist/esm/application/svelte/templates/test/app.test.js.ejs +739 -123
- package/dist/esm/application/svelte/templates/test/spa.test.js.ejs +224 -0
- package/dist/esm/application/svelte/templates/{tsconfig.json.ejs → tsconfig.json} +2 -2
- package/dist/esm/application/svelte/templates/{vite.config.ts.ejs → vite.config.ts} +1 -1
- package/dist/esm/application/svelte/templates/vitest.config.ts +10 -0
- package/dist/esm/application/svelte/textHelpers.js +20 -0
- package/dist/esm/application/svelte/textHelpers.js.map +1 -0
- package/dist/esm/shared/versions.js +10 -8
- package/dist/esm/shared/versions.js.map +1 -1
- package/dist/types/application/react/index.d.ts.map +1 -1
- package/dist/types/application/svelte/index.d.ts.map +1 -1
- package/dist/types/application/svelte/textHelpers.d.ts +21 -0
- package/dist/types/application/svelte/textHelpers.d.ts.map +1 -0
- package/dist/types/shared/versions.d.ts +11 -9
- package/dist/types/shared/versions.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/index.ts +0 -1
- package/dist/esm/application/svelte/templates/scripts/copy-icons.js.ejs +0 -9
- package/dist/esm/application/svelte/templates/src/lib/ContactExample.stories.svelte.ejs +0 -11
- package/dist/esm/application/svelte/templates/src/lib/ContactExample.svelte.ejs +0 -19
- package/dist/esm/application/svelte/templates/src/lib/DashboardNavigation.svelte.ejs +0 -17
- package/dist/esm/application/svelte/templates/src/lib/ProjectDanger.svelte.ejs +0 -18
- package/dist/esm/application/svelte/templates/src/lib/Welcome.stories.svelte.ejs +0 -5
- package/dist/esm/application/svelte/templates/src/lib/catalog.ts.ejs +0 -5
- package/dist/esm/application/svelte/templates/src/lib/contact.ts.ejs +0 -19
- package/dist/esm/application/svelte/templates/src/lib/i18n.ts.ejs +0 -351
- package/dist/esm/application/svelte/templates/src/lib/instances.ts.ejs +0 -16
- package/dist/esm/application/svelte/templates/src/lib/resolveReturnTo.ts.ejs +0 -11
- package/dist/esm/application/svelte/templates/src/lib/settings.ts.ejs +0 -28
- package/dist/esm/application/svelte/templates/src/routes/+error.svelte.ejs +0 -9
- package/dist/esm/application/svelte/templates/src/routes/+page.svelte.ejs +0 -9
- package/dist/esm/application/svelte/templates/src/routes/account/+page.server.ts.ejs +0 -13
- package/dist/esm/application/svelte/templates/src/routes/account/+page.svelte.ejs +0 -20
- package/dist/esm/application/svelte/templates/src/routes/catalog/+page.svelte.ejs +0 -12
- package/dist/esm/application/svelte/templates/src/routes/catalog/[id]/+page.server.ts.ejs +0 -8
- package/dist/esm/application/svelte/templates/src/routes/catalog/[id]/+page.svelte.ejs +0 -13
- package/dist/esm/application/svelte/templates/src/routes/catalog/[id]/+page.ts.ejs +0 -8
- package/dist/esm/application/svelte/templates/src/routes/contact/+page.server.ts.ejs +0 -11
- package/dist/esm/application/svelte/templates/src/routes/contact/+page.svelte.ejs +0 -85
- package/dist/esm/application/svelte/templates/src/routes/dashboard/+layout.svelte.ejs +0 -15
- package/dist/esm/application/svelte/templates/src/routes/dashboard/+page.server.ts.ejs +0 -5
- package/dist/esm/application/svelte/templates/src/routes/dashboard/+page.svelte.ejs +0 -33
- package/dist/esm/application/svelte/templates/src/routes/dashboard/instances/+page.server.ts.ejs +0 -23
- package/dist/esm/application/svelte/templates/src/routes/dashboard/instances/+page.svelte.ejs +0 -101
- package/dist/esm/application/svelte/templates/src/routes/dashboard/instances/remove/+page.server.ts.ejs +0 -19
- package/dist/esm/application/svelte/templates/src/routes/dashboard/instances/remove/+page.svelte.ejs +0 -11
- package/dist/esm/application/svelte/templates/src/routes/dashboard/settings/+page.server.ts.ejs +0 -13
- package/dist/esm/application/svelte/templates/src/routes/dashboard/settings/+page.svelte.ejs +0 -52
- package/dist/esm/application/svelte/templates/src/routes/dashboard/settings/confirm/+page.server.ts.ejs +0 -2
- package/dist/esm/application/svelte/templates/src/routes/dashboard/settings/confirm/+page.svelte.ejs +0 -13
- package/dist/esm/application/svelte/templates/src/routes/language/+server.ts.ejs +0 -12
- package/dist/esm/application/svelte/templates/src/routes/login/+page.server.ts.ejs +0 -8
- package/dist/esm/application/svelte/templates/src/routes/login/+page.svelte.ejs +0 -11
- package/dist/esm/application/svelte/templates/src/routes/preferences/+server.ts.ejs +0 -10
- package/dist/esm/application/svelte/templates/src/styles.css.ejs +0 -28
- package/dist/esm/application/svelte/templates/test/contact.browser.test.js.ejs +0 -279
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/* The stylesheet of `@canonical/react-ds-app`'s SidePanel, for markup that carries
|
|
2
|
+
* its classes until `@canonical/svelte-ds-app` ships a SidePanel. Delete this file,
|
|
3
|
+
* and its import in `standins.css`, when it does. */
|
|
4
|
+
|
|
5
|
+
/* common/Content/styles.css */
|
|
6
|
+
/* Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
|
|
7
|
+
|
|
8
|
+
@layer ds.components.apps {
|
|
9
|
+
.ds.side-panel-content {
|
|
10
|
+
/*
|
|
11
|
+
Natural height by default: the footer follows the content, so its actions
|
|
12
|
+
stay next to the text they refer to instead of being pushed to the bottom
|
|
13
|
+
edge of a short panel. Shrinks when the content is taller than the space
|
|
14
|
+
the header and footer leave — `overflow` below drops a flex item's
|
|
15
|
+
automatic minimum size to zero, so it can shrink below its content.
|
|
16
|
+
*/
|
|
17
|
+
flex: 0 1 auto;
|
|
18
|
+
|
|
19
|
+
/* Opt-in: take the space the header and footer leave, so a short panel fills. */
|
|
20
|
+
&.fill {
|
|
21
|
+
flex-grow: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
The scroll region, and the only one: the header and footer sit outside it
|
|
26
|
+
in the panel's flex column, so they stay visible without sticky
|
|
27
|
+
positioning.
|
|
28
|
+
*/
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
/* Don't hand the scroll to the page behind once the content bottoms out. */
|
|
31
|
+
overscroll-behavior: contain;
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
The scroll region's edges — 2px lines marking the boundaries the header
|
|
35
|
+
and footer meet the pane at, painted only while content is hidden past
|
|
36
|
+
that edge. CSS-first: the `@supports` block at the end of this sheet
|
|
37
|
+
animates these borders against the pane's own scroll progress in the
|
|
38
|
+
engines that ship scroll-driven animations — with or without
|
|
39
|
+
JavaScript. The engines without fall back to measurement:
|
|
40
|
+
`useScrollOverflow` publishes the two edge states as
|
|
41
|
+
`data-overflow-top` / `data-overflow-bottom` (see Content.tsx), and the
|
|
42
|
+
selectors below switch the border colours on them. Engines with neither
|
|
43
|
+
paint nothing: without a measurement there is nothing to say which
|
|
44
|
+
edges overflow, and a line that cannot tell the truth is worse than
|
|
45
|
+
none.
|
|
46
|
+
|
|
47
|
+
The borders are always reserved — animation or attributes switch their
|
|
48
|
+
colour, never their width — so the lines appearing or disappearing
|
|
49
|
+
never shifts the pane. And a scroll container's borders are part of its
|
|
50
|
+
box, not its content: they stay pinned at the edges while the pane
|
|
51
|
+
scrolls. A border spans the padding box, so with the pane's inline
|
|
52
|
+
padding the lines run edge to edge across the panel while the text
|
|
53
|
+
stays in its column. The colour is the panel's to own:
|
|
54
|
+
`--side-panel-color-border` is declared in the panel's `:root` block.
|
|
55
|
+
*/
|
|
56
|
+
border-block: var(--side-panel-overflow-line-thickness) solid transparent;
|
|
57
|
+
|
|
58
|
+
&[data-overflow-top] {
|
|
59
|
+
border-block-start-color: var(--side-panel-color-border);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&[data-overflow-bottom] {
|
|
63
|
+
border-block-end-color: var(--side-panel-color-border);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
Inline padding, not margin: the pane must span the full panel width, so
|
|
68
|
+
its scrollbar hugs the panel edge and the focus ring below reaches it,
|
|
69
|
+
while the padding keeps the text clear of both.
|
|
70
|
+
*/
|
|
71
|
+
padding-block: var(--side-panel-content-padding-block);
|
|
72
|
+
padding-inline: var(--side-panel-padding-inline);
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Focusable (Content.tsx sets `tabIndex`) so keyboard users can scroll it.
|
|
76
|
+
The panel clips its overflow, and the pane reaches the panel edges, so an
|
|
77
|
+
outset ring would be cut off: draw it inside the pane instead. The ring is
|
|
78
|
+
declared in full, because only a known width can be inset by exactly that
|
|
79
|
+
much — the user-agent ring's width varies by browser.
|
|
80
|
+
*/
|
|
81
|
+
&:focus-visible {
|
|
82
|
+
outline: var(--side-panel-focus-ring-width) solid
|
|
83
|
+
var(--side-panel-color-focus-ring);
|
|
84
|
+
outline-offset: calc(-1 * var(--side-panel-focus-ring-width));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
The primary mechanism, with or without JavaScript: in the engines that
|
|
90
|
+
ship scroll-driven animations the pane animates the same borders against
|
|
91
|
+
its OWN scroll progress — the engine does the measuring. Content.tsx
|
|
92
|
+
probes the same capability and stands the `useScrollOverflow` hook down
|
|
93
|
+
when it holds, so nothing is measured twice and no edge attributes
|
|
94
|
+
appear in the markup; in the engines this `@supports` test excludes, the
|
|
95
|
+
hook's attributes own the lines instead (selectors above). Engines with
|
|
96
|
+
neither mechanism paint nothing.
|
|
97
|
+
|
|
98
|
+
Each animation is narrowed to a single pixel of the scroll range by
|
|
99
|
+
`animation-range`, so the colour change reads as a switch, not a fade:
|
|
100
|
+
|
|
101
|
+
- `side-panel-line-top` runs across the FIRST pixel — before it the pane
|
|
102
|
+
sits at the top and nothing is hidden above, so the line stays
|
|
103
|
+
transparent; past it, content is hidden above and the line holds the
|
|
104
|
+
border colour (`both` fills the range's far side).
|
|
105
|
+
- `side-panel-line-bottom` runs across the LAST pixel — before it there
|
|
106
|
+
is still content below, so `both` fills the near side and the line
|
|
107
|
+
holds the border colour; across it the pane bottoms out and the line
|
|
108
|
+
turns transparent.
|
|
109
|
+
*/
|
|
110
|
+
@supports (animation-timeline: scroll()) {
|
|
111
|
+
.ds.side-panel-content {
|
|
112
|
+
animation:
|
|
113
|
+
side-panel-line-top linear both,
|
|
114
|
+
side-panel-line-bottom linear both;
|
|
115
|
+
animation-timeline: scroll(self block), scroll(self block);
|
|
116
|
+
animation-range:
|
|
117
|
+
0px 1px,
|
|
118
|
+
calc(100% - 1px) 100%;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes side-panel-line-top {
|
|
123
|
+
from {
|
|
124
|
+
border-block-start-color: transparent;
|
|
125
|
+
}
|
|
126
|
+
to {
|
|
127
|
+
border-block-start-color: var(--side-panel-color-border);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes side-panel-line-bottom {
|
|
132
|
+
from {
|
|
133
|
+
border-block-end-color: var(--side-panel-color-border);
|
|
134
|
+
}
|
|
135
|
+
to {
|
|
136
|
+
border-block-end-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* common/Footer/styles.css */
|
|
142
|
+
/* Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
|
|
143
|
+
|
|
144
|
+
@layer ds.components.apps {
|
|
145
|
+
.ds.side-panel-footer {
|
|
146
|
+
/*
|
|
147
|
+
Never shrinks. It stays visible because only the content pane scrolls —
|
|
148
|
+
the footer sits beside it in the panel's flex column, not over it.
|
|
149
|
+
*/
|
|
150
|
+
flex: none;
|
|
151
|
+
|
|
152
|
+
padding-inline: var(--side-panel-padding-inline);
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
Actions start at the inline-start edge, and the consumer renders the
|
|
156
|
+
primary action first: order in the markup is order on screen.
|
|
157
|
+
*/
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: flex-start;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: var(--side-panel-footer-gap);
|
|
162
|
+
flex-wrap: wrap;
|
|
163
|
+
|
|
164
|
+
padding-block: var(--side-panel-footer-padding-block);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* common/Header/styles.css */
|
|
169
|
+
/* Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
|
|
170
|
+
|
|
171
|
+
@layer ds.components.apps {
|
|
172
|
+
.ds.side-panel-header {
|
|
173
|
+
/*
|
|
174
|
+
Title type — heading-2 for now. The tier is provisional: to change it,
|
|
175
|
+
swap the tier in these five lines and nothing else.
|
|
176
|
+
|
|
177
|
+
Declared here, not on :root: a var() inside a custom property resolves
|
|
178
|
+
where it is declared, and the typography tokens are redefined per
|
|
179
|
+
context (.app, .site, .docs). On :root these would capture the
|
|
180
|
+
page-level tier; here they resolve inside the panel's own context.
|
|
181
|
+
*/
|
|
182
|
+
--side-panel-title-font-family: var(--typography-heading-2-font-family);
|
|
183
|
+
--side-panel-title-font-size: var(--typography-heading-2-font-size);
|
|
184
|
+
--side-panel-title-font-weight: var(--typography-heading-2-font-weight);
|
|
185
|
+
--side-panel-title-letter-spacing: var(
|
|
186
|
+
--typography-heading-2-letter-spacing
|
|
187
|
+
);
|
|
188
|
+
--side-panel-title-line-height: var(
|
|
189
|
+
--typography-heading-2-line-height-dimension
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
/*
|
|
193
|
+
Never shrinks. It stays visible because only the content pane scrolls —
|
|
194
|
+
the header sits beside it in the panel's flex column, not over it.
|
|
195
|
+
*/
|
|
196
|
+
flex: none;
|
|
197
|
+
|
|
198
|
+
display: flex;
|
|
199
|
+
/*
|
|
200
|
+
Baseline-aligned: the close button sits on the title's baseline. The
|
|
201
|
+
browser lines the two baselines up itself, so nothing here needs to know
|
|
202
|
+
where the typography engine puts the title's baseline or where Button's
|
|
203
|
+
density seat puts its own.
|
|
204
|
+
*/
|
|
205
|
+
align-items: baseline;
|
|
206
|
+
gap: var(--side-panel-header-gap);
|
|
207
|
+
|
|
208
|
+
padding-block: var(--side-panel-header-padding-block);
|
|
209
|
+
/*
|
|
210
|
+
Inline padding, not margin: nothing here needs the header's box itself
|
|
211
|
+
inset, and padding keeps it full panel width. The footer insets its
|
|
212
|
+
actions with padding the same way.
|
|
213
|
+
*/
|
|
214
|
+
padding-inline: var(--side-panel-padding-inline);
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
The title is heading text beside a control, not a control: its line box
|
|
218
|
+
is far taller than the density seat line, so the typography engine seats
|
|
219
|
+
it rather than the density seat. It carries `.p`, the engine's class hook
|
|
220
|
+
for an element that is not `p` or `h1`–`h6`; this rule feeds the engine
|
|
221
|
+
the title's type in place of the paragraph values `.p` brings.
|
|
222
|
+
*/
|
|
223
|
+
> .title {
|
|
224
|
+
flex: 1 1 auto;
|
|
225
|
+
--font-size: var(--side-panel-title-font-size);
|
|
226
|
+
--font-weight: var(--side-panel-title-font-weight);
|
|
227
|
+
--line-height: var(--side-panel-title-line-height);
|
|
228
|
+
/* No element-owned space below, even inside an `.editorial` ancestor. */
|
|
229
|
+
--space-after: 0;
|
|
230
|
+
font-family: var(--side-panel-title-font-family);
|
|
231
|
+
letter-spacing: var(--side-panel-title-letter-spacing);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
> .close {
|
|
235
|
+
flex: 0 0 auto;
|
|
236
|
+
/*
|
|
237
|
+
Button tightens padding-inline-start when it has an icon, which suits an
|
|
238
|
+
icon+label button but leaves an icon-only one lopsided (8px vs 16px).
|
|
239
|
+
Equalise both sides through Button's own custom-property API, as
|
|
240
|
+
Modal's header does.
|
|
241
|
+
*/
|
|
242
|
+
--button-padding-inline-start: var(--dimension-100);
|
|
243
|
+
--button-padding-inline-end: var(--dimension-100);
|
|
244
|
+
|
|
245
|
+
/*
|
|
246
|
+
An icon-only button has no text, so it has no baseline of its own and
|
|
247
|
+
the browser would make one up from the icon's box. A zero-width
|
|
248
|
+
character gives it a line of text in its seat line, so its baseline
|
|
249
|
+
lands where a label's would. The pseudo-element is a flex item like the
|
|
250
|
+
icon, so the gap is cancelled to keep the button's size.
|
|
251
|
+
|
|
252
|
+
Temporary: remove once icon-only buttons carry a seated baseline of
|
|
253
|
+
their own.
|
|
254
|
+
*/
|
|
255
|
+
&::before {
|
|
256
|
+
content: "\200b";
|
|
257
|
+
margin-inline-end: calc(-1 * var(--button-gap));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* styles.css */
|
|
264
|
+
/* Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
|
|
265
|
+
|
|
266
|
+
@layer ds.components.apps {
|
|
267
|
+
/**
|
|
268
|
+
* SidePanel styles
|
|
269
|
+
*
|
|
270
|
+
* A NON-MODAL <dialog>: the application behind stays interactive. None of the
|
|
271
|
+
* top-layer conveniences apply, which is why this file does work a modal
|
|
272
|
+
* wouldn't — it positions and stacks the panel itself, and never styles
|
|
273
|
+
* `::backdrop` (a backdrop is only painted for a modal dialog, and faking one
|
|
274
|
+
* would cover the application and swallow its clicks).
|
|
275
|
+
*/
|
|
276
|
+
|
|
277
|
+
/* Component properties — the documented override points. */
|
|
278
|
+
:root {
|
|
279
|
+
/*
|
|
280
|
+
design-tokens 0.8.1 ships no `size/*` token, so this is a literal.
|
|
281
|
+
The default panel width (465px).
|
|
282
|
+
TODO: replace with a token when one exists.
|
|
283
|
+
*/
|
|
284
|
+
--side-panel-inline-size: 465px;
|
|
285
|
+
/*
|
|
286
|
+
...and no `shadow/*` token either. The shadow is what separates the panel
|
|
287
|
+
from the live page, so unlike a modal we cannot drop it.
|
|
288
|
+
TODO: replace with a token when one exists.
|
|
289
|
+
*/
|
|
290
|
+
--side-panel-box-shadow: 0 0 32px 0 rgba(0, 0, 0, 0.2);
|
|
291
|
+
/*
|
|
292
|
+
A non-modal dialog is not in the top layer, so stacking is ours to manage.
|
|
293
|
+
Matches the demo's Drawer so the two never fight.
|
|
294
|
+
*/
|
|
295
|
+
--side-panel-z-index: 1000;
|
|
296
|
+
|
|
297
|
+
--side-panel-border-radius: var(--dimension-radius-medium);
|
|
298
|
+
/*
|
|
299
|
+
The colour of the scroll region's divider lines, kept muted.
|
|
300
|
+
*/
|
|
301
|
+
--side-panel-color-border: var(--color-border-muted);
|
|
302
|
+
/*
|
|
303
|
+
The edge lines marking the scroll region when the content pane
|
|
304
|
+
overflows. The design calls for 2px; design-tokens ships no stroke
|
|
305
|
+
token at that width (the scale jumps from 1px to 3px), so this is a
|
|
306
|
+
literal.
|
|
307
|
+
TODO: replace with a token when one exists.
|
|
308
|
+
*/
|
|
309
|
+
--side-panel-overflow-line-thickness: 2px;
|
|
310
|
+
/* One inline padding, read by the header, content and footer alike. */
|
|
311
|
+
--side-panel-padding-inline: var(--dimension-300);
|
|
312
|
+
/* Block padding of the two pinned regions, so the rhythm is tunable. */
|
|
313
|
+
--side-panel-header-padding-block: var(--dimension-200);
|
|
314
|
+
--side-panel-footer-padding-block: var(--dimension-200);
|
|
315
|
+
--side-panel-content-padding-block: var(--dimension-200);
|
|
316
|
+
/* Space between the header's title and close button. */
|
|
317
|
+
--side-panel-header-gap: var(--dimension-200);
|
|
318
|
+
/* Space between the footer's actions. */
|
|
319
|
+
--side-panel-footer-gap: var(--dimension-200);
|
|
320
|
+
/* Keyboard focus ring of the scrollable content pane, drawn inside it. */
|
|
321
|
+
--side-panel-focus-ring-width: var(--dimension-stroke-thickness-large);
|
|
322
|
+
--side-panel-color-focus-ring: var(--color-focus-ring);
|
|
323
|
+
--side-panel-transition-duration: var(--motion-duration-medium);
|
|
324
|
+
--side-panel-transition-easing-enter: var(--motion-easing-decelerate);
|
|
325
|
+
--side-panel-transition-easing-exit: var(--motion-easing-accelerate);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.ds.side-panel {
|
|
329
|
+
/*
|
|
330
|
+
Undo the user-agent dialog box. Each of these is set by the UA stylesheet,
|
|
331
|
+
so leaving one undeclared is not the same as it being absent: `position`
|
|
332
|
+
is `absolute`, `margin` is `auto` (which would centre the panel), both
|
|
333
|
+
max sizes are capped, and there is a ~3px border and 1em of padding.
|
|
334
|
+
*/
|
|
335
|
+
position: fixed;
|
|
336
|
+
inset-block: 0;
|
|
337
|
+
inset-inline-end: 0;
|
|
338
|
+
inset-inline-start: auto;
|
|
339
|
+
margin: 0;
|
|
340
|
+
/*
|
|
341
|
+
No padding of its own. The inline padding lives on the header, content and
|
|
342
|
+
footer instead, so the content pane spans the full panel width and its
|
|
343
|
+
scrollbar hugs the panel edge rather than sitting inside the padding.
|
|
344
|
+
*/
|
|
345
|
+
padding: 0;
|
|
346
|
+
border: none;
|
|
347
|
+
max-inline-size: none;
|
|
348
|
+
max-block-size: none;
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
The UA also sets `height: fit-content`, which beats `inset-block: 0` and
|
|
352
|
+
leaves the panel only as tall as its content. `auto` hands the height back
|
|
353
|
+
to the insets, so the panel spans the full viewport.
|
|
354
|
+
*/
|
|
355
|
+
block-size: auto;
|
|
356
|
+
|
|
357
|
+
/* Full height comes from `inset-block`, avoiding mobile viewport-unit games. */
|
|
358
|
+
inline-size: min(var(--side-panel-inline-size), 100vw);
|
|
359
|
+
z-index: var(--side-panel-z-index);
|
|
360
|
+
border-radius: var(--side-panel-border-radius);
|
|
361
|
+
box-shadow: var(--side-panel-box-shadow);
|
|
362
|
+
|
|
363
|
+
/*
|
|
364
|
+
The panel is focused when it opens so that reading starts inside it, but
|
|
365
|
+
it is a container rather than a control: a ring drawn for a pointer
|
|
366
|
+
click would read as a border, so pointer focus gets none. A keyboard
|
|
367
|
+
user must still see where focus landed, so `:focus-visible` draws the
|
|
368
|
+
panel's own ring — the same tokens as the content pane, and inset for
|
|
369
|
+
the same reason: the panel spans the viewport edges, so an outset ring
|
|
370
|
+
would be clipped. Its focusable children keep their own either way.
|
|
371
|
+
*/
|
|
372
|
+
&:focus:not(:focus-visible) {
|
|
373
|
+
outline: none;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
&:focus-visible {
|
|
377
|
+
outline: var(--side-panel-focus-ring-width) solid
|
|
378
|
+
var(--side-panel-color-focus-ring);
|
|
379
|
+
outline-offset: calc(-1 * var(--side-panel-focus-ring-width));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/*
|
|
383
|
+
The panel does not scroll; the content pane does. The panel is a
|
|
384
|
+
full-height flex column (`display: flex` itself is scoped to `[open]`
|
|
385
|
+
below — declaring it unconditionally would beat the user-agent's
|
|
386
|
+
`display: none` on a closed dialog). `flex-direction` sits here rather
|
|
387
|
+
than under `[open]`: it is inert while closed, and the base rule stays
|
|
388
|
+
the single place the stack direction is declared.
|
|
389
|
+
*/
|
|
390
|
+
flex-direction: column;
|
|
391
|
+
overflow: hidden;
|
|
392
|
+
|
|
393
|
+
/*
|
|
394
|
+
Two consequences worth knowing: the content pane is a scroll container,
|
|
395
|
+
so it clips its descendants, and the `transform` below makes the panel the
|
|
396
|
+
containing block for any `position: fixed` descendant. So an overlay that
|
|
397
|
+
escapes its box — ds-global's Popover and ContextualMenu position their
|
|
398
|
+
content with `position: fixed` — is both clipped and anchored to the
|
|
399
|
+
panel instead of the viewport. Documented in Provider.tsx; the fix belongs
|
|
400
|
+
upstream, in overlays that use the top layer rather than fixed
|
|
401
|
+
positioning.
|
|
402
|
+
*/
|
|
403
|
+
|
|
404
|
+
/*
|
|
405
|
+
Read the surface channels HERE rather than in :root. A custom property
|
|
406
|
+
substitutes where it is declared, and at :root the surface channels are
|
|
407
|
+
unset — so a :root intermediate would collapse to the fallback forever.
|
|
408
|
+
Popover/styles.css in ds-global documents the same trap.
|
|
409
|
+
*/
|
|
410
|
+
background-color: var(--surface-color-background, var(--color-background));
|
|
411
|
+
color: var(--surface-color-text, var(--color-text));
|
|
412
|
+
|
|
413
|
+
/* Closed state. `translate` is physical, so flip it when the panel docks left. */
|
|
414
|
+
--side-panel-translate-closed: 100%;
|
|
415
|
+
transform: translateX(var(--side-panel-translate-closed));
|
|
416
|
+
|
|
417
|
+
&:dir(rtl) {
|
|
418
|
+
--side-panel-translate-closed: -100%;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/*
|
|
422
|
+
`display` is transitioned discretely so the slide-out is seen before the
|
|
423
|
+
dialog is hidden. No `overlay` in the list: that property only applies to
|
|
424
|
+
top-layer elements, which a non-modal dialog is not.
|
|
425
|
+
*/
|
|
426
|
+
transition-property: transform, display;
|
|
427
|
+
transition-duration: var(--side-panel-transition-duration);
|
|
428
|
+
transition-timing-function: var(--side-panel-transition-easing-exit);
|
|
429
|
+
transition-behavior: allow-discrete;
|
|
430
|
+
|
|
431
|
+
/*
|
|
432
|
+
A closed <dialog> is `display: none` by user-agent rule. Declaring display
|
|
433
|
+
unconditionally would beat that and leave the panel permanently visible, so
|
|
434
|
+
the stack layout is scoped to the open state.
|
|
435
|
+
|
|
436
|
+
Header, content, footer, top to bottom. The header and footer are
|
|
437
|
+
`flex: none`; the content pane shrinks to fit and scrolls, so the two
|
|
438
|
+
pinned regions stay visible without sticky positioning.
|
|
439
|
+
*/
|
|
440
|
+
&[open] {
|
|
441
|
+
display: flex;
|
|
442
|
+
transform: translateX(0);
|
|
443
|
+
transition-timing-function: var(--side-panel-transition-easing-enter);
|
|
444
|
+
|
|
445
|
+
/* The frame the entry transition starts from. */
|
|
446
|
+
@starting-style {
|
|
447
|
+
transform: translateX(var(--side-panel-translate-closed));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* Respect a reduced-motion preference: appear, don't slide. */
|
|
452
|
+
@media (prefers-reduced-motion: reduce) {
|
|
453
|
+
transition-property: display;
|
|
454
|
+
|
|
455
|
+
&[open] {
|
|
456
|
+
@starting-style {
|
|
457
|
+
transform: translateX(0);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* The stylesheet of `@canonical/react-ds-global`'s Tile, for markup that carries
|
|
2
|
+
* its classes until `@canonical/svelte-ds-global` ships a Tile. Delete this file,
|
|
3
|
+
* and its import in `standins.css`, when it does. */
|
|
4
|
+
|
|
5
|
+
/* common/Content/styles.css */
|
|
6
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
7
|
+
|
|
8
|
+
@layer ds.components.global {
|
|
9
|
+
/**
|
|
10
|
+
* Tile.Content styles
|
|
11
|
+
* @implements ds:global.subcomponent.tile-content
|
|
12
|
+
*
|
|
13
|
+
* DSL anatomy mapping:
|
|
14
|
+
* - layout.type: stack, layout.direction: vertical -> flex column
|
|
15
|
+
* - spacing.padding.top: dimension/100, spacing.padding.bottom: dimension/200,
|
|
16
|
+
* spacing.internal.horizontal: dimension/200 -> top 100, bottom 200,
|
|
17
|
+
* sides 200. With a header above (padding-bottom 100), the two sections read
|
|
18
|
+
* as top 100 / sides 200 / bottom 200 with the sections meeting in between.
|
|
19
|
+
*/
|
|
20
|
+
:root {
|
|
21
|
+
--tile-content-padding-top: var(--dimension-100);
|
|
22
|
+
--tile-content-padding-bottom: var(--dimension-200);
|
|
23
|
+
--tile-content-padding-inline: var(--dimension-200);
|
|
24
|
+
--tile-content-gap: var(--dimension-100);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ds.tile-content {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--tile-content-gap);
|
|
31
|
+
|
|
32
|
+
padding-block-start: var(--tile-content-padding-top);
|
|
33
|
+
padding-block-end: var(--tile-content-padding-bottom);
|
|
34
|
+
padding-inline: var(--tile-content-padding-inline);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* common/Header/styles.css */
|
|
39
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
40
|
+
|
|
41
|
+
@layer ds.components.global {
|
|
42
|
+
/**
|
|
43
|
+
* Tile.Header styles
|
|
44
|
+
* @implements ds:global.subcomponent.tile-header
|
|
45
|
+
*
|
|
46
|
+
* DSL anatomy mapping:
|
|
47
|
+
* - layout.type: flow, layout.direction: horizontal -> flex row
|
|
48
|
+
* - layout.align: center -> align-items: center
|
|
49
|
+
* - spacing.internal.vertical: dimension/100, spacing.internal.horizontal:
|
|
50
|
+
* dimension/200 -> padding 100 (block) / 200 (inline). The header's block
|
|
51
|
+
* padding is 100 top and bottom; the content below adds its own top padding.
|
|
52
|
+
*/
|
|
53
|
+
:root {
|
|
54
|
+
--tile-header-padding-block: var(--dimension-100);
|
|
55
|
+
--tile-header-padding-inline: var(--dimension-200);
|
|
56
|
+
--tile-header-gap: var(--dimension-100);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ds.tile-header {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
|
|
64
|
+
padding-block: var(--tile-header-padding-block);
|
|
65
|
+
padding-inline: var(--tile-header-padding-inline);
|
|
66
|
+
gap: var(--tile-header-gap);
|
|
67
|
+
|
|
68
|
+
font-weight: var(--typography-weight-semibold, 600);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* styles.css */
|
|
73
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
74
|
+
|
|
75
|
+
@layer ds.components.global {
|
|
76
|
+
/**
|
|
77
|
+
* Tile styles
|
|
78
|
+
* @implements ds:global.component.tile
|
|
79
|
+
*
|
|
80
|
+
* The Tile always provides a surface: the component adds `.surface`, so the
|
|
81
|
+
* surface channel is established on this element (and steps when tiles/surfaces
|
|
82
|
+
* nest). It paints that background so it stands out on the page (dashboards,
|
|
83
|
+
* bento layouts). It shares the Card radius and has no border of its own. It is
|
|
84
|
+
* a static container — no cursor, hover, or focus affordance.
|
|
85
|
+
*
|
|
86
|
+
* DSL anatomy mapping:
|
|
87
|
+
* - layout.type: stack, layout.direction: vertical -> flex column
|
|
88
|
+
* - appearance.background: color/surface/tile -> the surface background channel
|
|
89
|
+
* - appearance.radius: radius/card -> shared card radius (--dimension-radius-medium)
|
|
90
|
+
*/
|
|
91
|
+
:root {
|
|
92
|
+
/* Shared with Card. --dimension-radius-medium is currently 0; intended 9. */
|
|
93
|
+
--tile-border-radius: var(--dimension-radius-medium);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ds.tile {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
|
|
100
|
+
/* Tile is a surface: it paints its own background (stands out on the page). */
|
|
101
|
+
background: var(--surface-color-background, var(--color-background));
|
|
102
|
+
|
|
103
|
+
border-radius: var(--tile-border-radius);
|
|
104
|
+
|
|
105
|
+
/* Clip section corners (e.g. full-bleed content) to the tile radius. */
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
}
|