diff --git a/apps/www/__registry__/index.js b/apps/www/__registry__/index.js index 02959d349..8002fce11 100644 --- a/apps/www/__registry__/index.js +++ b/apps/www/__registry__/index.js @@ -102,6 +102,66 @@ export const Index = { ), files: ["../src/lib/registry/default/example/badge-secondary.svelte"], }, + "breadcrumb-demo": { + name: "breadcrumb-demo", + type: "components:example", + registryDependencies: ["breadcrumb", "dropdown-menu"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-demo.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-demo.svelte"], + }, + "breadcrumb-dropdown": { + name: "breadcrumb-dropdown", + type: "components:example", + registryDependencies: ["breadcrumb", "dropdown-menu"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-dropdown.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-dropdown.svelte"], + }, + "breadcrumb-ellipsis": { + name: "breadcrumb-ellipsis", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-ellipsis.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-ellipsis.svelte"], + }, + "breadcrumb-link": { + name: "breadcrumb-link", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-link.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-link.svelte"], + }, + "breadcrumb-responsive": { + name: "breadcrumb-responsive", + type: "components:example", + registryDependencies: ["breadcrumb", "drawer", "dropdown-menu", "button"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-responsive.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-responsive.svelte"], + }, + "breadcrumb-separator": { + name: "breadcrumb-separator", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/default/example/breadcrumb-separator.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/default/example/breadcrumb-separator.svelte"], + }, "button-demo": { name: "button-demo", type: "components:example", @@ -1324,6 +1384,66 @@ export const Index = { ), files: ["../src/lib/registry/new-york/example/badge-secondary.svelte"], }, + "breadcrumb-demo": { + name: "breadcrumb-demo", + type: "components:example", + registryDependencies: ["breadcrumb", "dropdown-menu"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-demo.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-demo.svelte"], + }, + "breadcrumb-dropdown": { + name: "breadcrumb-dropdown", + type: "components:example", + registryDependencies: ["breadcrumb", "dropdown-menu"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-dropdown.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-dropdown.svelte"], + }, + "breadcrumb-ellipsis": { + name: "breadcrumb-ellipsis", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-ellipsis.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-ellipsis.svelte"], + }, + "breadcrumb-link": { + name: "breadcrumb-link", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-link.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-link.svelte"], + }, + "breadcrumb-responsive": { + name: "breadcrumb-responsive", + type: "components:example", + registryDependencies: ["breadcrumb", "drawer", "dropdown-menu", "button"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-responsive.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-responsive.svelte"], + }, + "breadcrumb-separator": { + name: "breadcrumb-separator", + type: "components:example", + registryDependencies: ["breadcrumb"], + component: () => + import("../src/lib/registry/new-york/example/breadcrumb-separator.svelte").then( + (m) => m.default + ), + files: ["../src/lib/registry/new-york/example/breadcrumb-separator.svelte"], + }, "button-demo": { name: "button-demo", type: "components:example", diff --git a/apps/www/package.json b/apps/www/package.json index 92876ea86..054723300 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -79,7 +79,7 @@ "@internationalized/date": "^3.5.2", "@unovis/svelte": "1.3.6-beta.1", "@unovis/ts": "1.3.6-beta.1", - "bits-ui": "0.19.3", + "bits-ui": "0.19.6", "clsx": "^2.1.0", "cmdk-sv": "^0.0.15", "d3-scale": "^4.0.2", diff --git a/apps/www/src/content/changelog.md b/apps/www/src/content/changelog.md index 0e71ff16f..673e05b5e 100644 --- a/apps/www/src/content/changelog.md +++ b/apps/www/src/content/changelog.md @@ -9,6 +9,16 @@ description: Latest updates and announcements. ## March 2024 +### New Component: Breadcrumb + +We've added a new component to the project, [Breadcrumb](/docs/components/breadcrumb). + + + +
+ + + ### New Component: Scroll Area We've added a new component to the project, [Scroll Area](/docs/components/scroll-area), which is built on top of the [Scroll Area](https://bits-ui.com/docs/components/scroll-area) component from Bits UI. diff --git a/apps/www/src/content/components/breadcrumb.md b/apps/www/src/content/components/breadcrumb.md new file mode 100644 index 000000000..12dba7a59 --- /dev/null +++ b/apps/www/src/content/components/breadcrumb.md @@ -0,0 +1,114 @@ +--- +title: Breadcrumb +description: Displays the path to the current resource using a hierarchy of links. +component: true +source: https://github.com/huntabyte/shadcn-svelte/tree/main/apps/www/src/lib/registry/default/ui/breadcrumb +--- + + + + + +
+ + + +## Installation + +```bash +npx shadcn-svelte@latest add breadcrumb +``` + + + +1. Copy and paste the component source files linked at the top of this page into your project. + + + +## Usage + +```svelte + + + + + + Home + + + + Components + + + + Breadcrumb + + + +``` + +## Examples + +### Custom separator + +Use a custom component in the `` of `` to create a custom separator. + + + +
+ + + +--- + +### Dropdown + +You can compose `` with a `` to create a dropdown in the breadcrumb. + + + +
+ + + +--- + +### Collapsed + +We provide a `` component to show a collapsed state when the breadcrumb is too long. + + + +
+ + + +--- + +### Link component + +To use a custom link component from your routing library, you can use the `asChild` prop on ``. + + + +
+ + + +--- + +### Responsive + +Here's an example of a responsive breadcrumb that composes `` with ``, ``, and ``. + +It displays a dropdown on desktop and a drawer on mobile. + + + +
+ + diff --git a/apps/www/src/lib/components/docs/charts/metric.svelte b/apps/www/src/lib/components/docs/charts/metric.svelte index 7cb45c52e..f34c42f2b 100644 --- a/apps/www/src/lib/components/docs/charts/metric.svelte +++ b/apps/www/src/lib/components/docs/charts/metric.svelte @@ -43,7 +43,7 @@ -