Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- main:
- heading "DBBreadcrumb" [level=1]
- link "Size"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- link "Separator"
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: ›
- link "Category"
- listitem: › Current Page
- navigation "breadcrumb":
- list:
- listitem:
- link "Home"
- listitem:
- text: /
- link "Category"
- listitem: / Current Page
3 changes: 3 additions & 0 deletions packages/components/scripts/post-build/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ export const getComponents = (): Component[] => [
{
name: 'brand'
},
{
name: 'breadcrumb'
},
{
name: 'input',
overwrites: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { DBBreadcrumb } from '../index';

export default function Breadcrumb() {
return (
<>
<h1>DBBreadcrumb Documentation Examples</h1>

<h2>1. Default Breadcrumb</h2>
<DBBreadcrumb>
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">Category</a>
</li>
<li aria-current="page">Current Page</li>
</DBBreadcrumb>

<h2>2. Long Breadcrumb Path</h2>
<DBBreadcrumb>
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">Category</a>
</li>
<li>
<a href="#">Subcategory</a>
</li>
<li>
<a href="#">Product Group</a>
</li>
<li aria-current="page">Current Product</li>
</DBBreadcrumb>

<h2>3. Single Item</h2>
<DBBreadcrumb>
<li aria-current="page">Current Page</li>
</DBBreadcrumb>
</>
);
}
35 changes: 35 additions & 0 deletions packages/components/src/components/breadcrumb/breadcrumb.lite.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {
useDefaultProps,
useMetadata,
useRef,
useStore
} from '@builder.io/mitosis';
import { cls } from '../../utils';
import type { DBBreadcrumbProps, DBBreadcrumbState } from './model';

useMetadata({});

useDefaultProps<DBBreadcrumbProps>({
size: 'small',
separator: 'chevron'
});

export default function DBBreadcrumb(props: DBBreadcrumbProps) {
const _ref = useRef<HTMLElement | any>(null);

const state = useStore<DBBreadcrumbState>({});

return (
<nav
ref={_ref}
id={props.id}
class={cls('db-breadcrumb', props.className)}
data-size={props.size}
data-separator={props.separator}
aria-label="breadcrumb">
<ol class="db-breadcrumb-list" role="list">
{props.children}
</ol>
</nav>
);
}
Loading
Loading