feat(svelte-ds-app): Port React core layouts#660
Conversation
|
should be updated to depend on #694 and implemented in global ds-app package instead |
d684792 to
ce01fc1
Compare
There was a problem hiding this comment.
Pull request overview
Ports the core apps-tier layout grammar from the React @canonical/react-ds-app package into @canonical/svelte-ds-app, including storybook composition docs and supporting story-only helpers.
Changes:
- Adds Svelte implementations of ApplicationLayout, ViewLayout, and ContentLayout (components, styles, types, anatomy YAML, and SPEC docs).
- Adds unit + SSR tests and Storybook stories/docs (including a “Composed” grammar example) for the new layouts.
- Updates
@canonical/svelte-ds-apppackage metadata to support Storybook-only#storybook/*imports and moves@canonical/ds-typestodependenciesfor exported type compatibility.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/svelte/ds-app/src/storybook/layouts/MockCard.svelte | Story-only card placeholder used in layout stories |
| packages/svelte/ds-app/src/storybook/layouts/LayoutSlot.svelte | Story-only slot marker placeholder for visualizing layout slots |
| packages/svelte/ds-app/src/storybook/layouts/LayoutFrame.svelte | Story-only frame providing a sized .surface container for fullscreen layout stories |
| packages/svelte/ds-app/src/storybook/layouts/Composed.stories.svelte | Story that composes ApplicationLayout → ViewLayout → ContentLayout |
| packages/svelte/ds-app/src/storybook/layouts/Composed.mdx | Docs page describing the composed layout grammar and embedding the story |
| packages/svelte/ds-app/src/lib/component/ViewLayout/ViewLayout.svelte.test.ts | Browser/unit tests for ViewLayout slot behavior, classes, and passthrough props |
| packages/svelte/ds-app/src/lib/component/ViewLayout/ViewLayout.svelte | ViewLayout Svelte component implementation |
| packages/svelte/ds-app/src/lib/component/ViewLayout/ViewLayout.stories.svelte | Storybook stories for ViewLayout |
| packages/svelte/ds-app/src/lib/component/ViewLayout/ViewLayout.ssr.test.ts | SSR coverage for ViewLayout |
| packages/svelte/ds-app/src/lib/component/ViewLayout/ViewLayout.anatomy.yaml | Anatomy DSL for ViewLayout |
| packages/svelte/ds-app/src/lib/component/ViewLayout/types.ts | Public props/types for ViewLayout |
| packages/svelte/ds-app/src/lib/component/ViewLayout/styles.css | ViewLayout grid styling (incl. :has() track collapse) |
| packages/svelte/ds-app/src/lib/component/ViewLayout/SPEC.md | Spec documentation for ViewLayout |
| packages/svelte/ds-app/src/lib/component/ViewLayout/index.ts | Public exports for ViewLayout |
| packages/svelte/ds-app/src/lib/component/index.ts | Re-exports new layout components from the component barrel |
| packages/svelte/ds-app/src/lib/component/ContentLayout/types.ts | Public props/types for ContentLayout (incl. exported grid preset type) |
| packages/svelte/ds-app/src/lib/component/ContentLayout/styles.css | ContentLayout supplemental styling (align-content) |
| packages/svelte/ds-app/src/lib/component/ContentLayout/SPEC.md | Spec documentation for ContentLayout |
| packages/svelte/ds-app/src/lib/component/ContentLayout/index.ts | Public exports for ContentLayout |
| packages/svelte/ds-app/src/lib/component/ContentLayout/ContentLayout.svelte.test.ts | Browser/unit tests for ContentLayout behavior and class composition |
| packages/svelte/ds-app/src/lib/component/ContentLayout/ContentLayout.svelte | ContentLayout Svelte component implementation |
| packages/svelte/ds-app/src/lib/component/ContentLayout/ContentLayout.stories.svelte | Storybook stories for ContentLayout |
| packages/svelte/ds-app/src/lib/component/ContentLayout/ContentLayout.ssr.test.ts | SSR coverage for ContentLayout |
| packages/svelte/ds-app/src/lib/component/ContentLayout/ContentLayout.anatomy.yaml | Anatomy DSL for ContentLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/types.ts | Public props/types for ApplicationLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/styles.css | ApplicationLayout grid styling (incl. :has() track collapse) |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/SPEC.md | Spec documentation for ApplicationLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/index.ts | Public exports for ApplicationLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/ApplicationLayout.svelte.test.ts | Browser/unit tests for ApplicationLayout slot behavior, classes, passthrough props |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/ApplicationLayout.svelte | ApplicationLayout Svelte component implementation |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/ApplicationLayout.stories.svelte | Storybook stories for ApplicationLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/ApplicationLayout.ssr.test.ts | SSR coverage for ApplicationLayout |
| packages/svelte/ds-app/src/lib/component/ApplicationLayout/ApplicationLayout.anatomy.yaml | Anatomy DSL for ApplicationLayout |
| packages/svelte/ds-app/package.json | Adds #storybook/* imports map and promotes @canonical/ds-types to dependencies |
| bun.lock | Lockfile update reflecting dependency move |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "@biomejs/biome": "2.4.9", | ||
| "@canonical/biome-config": "^0.28.0", | ||
| "@canonical/design-tokens": "^0.6.0", | ||
| "@canonical/ds-types": "^0.29.0-experimental.0", |
There was a problem hiding this comment.
This was moved to a non-dev dependency because ContentLayout aliases GridPreset as part of its public API.
Consumers of this package need ds-types to be available in node_modules in order for type-checks of ContentLayout calls to pass.
Done
Svelte port of #656 , implementing:
ApplicationLayout, the outermost shell of an application. Splits a navigation rail and an app's main content side-by-side.ViewLayout, a "sub-shell" for the main content area of an application, rendered inside anApplicationLayouttypically. Defines a main area and optional asideContentLayout, a content grid for the meat of an application (the main area fromViewLayout). The rest of the app consumesContentLayout's grid.Depends on #694 for creation of the ds-app Svelte package.
QA
PR readiness check
Feature 🎁,Breaking Change 💣,Bug 🐛,Documentation 📝,Maintenance 🔨.package.json:check,check:fix, andtest.buildto build the package for development or distribution,build:allto build all artifacts. See CONTRIBUTING.md for details.npm publish --access public(first-time publishing is not automated). Runbun run publish:statusfrom the repo root to verify. Then configure an OIDC trusted publisher for the package on npmjs.com (repocanonical/pragma, workflowtag.yml) and set publishing access to disallow tokens, so the automated release workflow can publish future versions.no visual changelabel to skip Chromatic.Screenshots