@delightui/components 0.1.105 → 0.1.107
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 +104 -1
- package/dist/cjs/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/cjs/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/cjs/components/molecules/Modal/index.d.ts +2 -0
- package/dist/cjs/components/molecules/index.d.ts +2 -0
- package/dist/cjs/library.css +19 -6
- package/dist/cjs/library.js +3 -3
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/molecules/Modal/DemoModal.d.ts +8 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.d.ts +41 -0
- package/dist/esm/components/molecules/Modal/ModalContext/ModalContext.types.d.ts +87 -0
- package/dist/esm/components/molecules/Modal/ModalContext/index.d.ts +3 -0
- package/dist/esm/components/molecules/Modal/ModalContext/useModal.d.ts +34 -0
- package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
- package/dist/esm/components/molecules/index.d.ts +2 -0
- package/dist/esm/library.css +19 -6
- package/dist/esm/library.js +3 -3
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +108 -2
- package/docs/README.md +264 -0
- package/docs/components/atoms/ActionImage.md +119 -0
- package/docs/components/atoms/Button.md +197 -0
- package/docs/components/atoms/Checkbox.md +299 -0
- package/docs/components/atoms/CheckboxItem.md +314 -0
- package/docs/components/atoms/Chip.md +380 -0
- package/docs/components/atoms/CustomToggle.md +270 -0
- package/docs/components/atoms/Icon.md +365 -0
- package/docs/components/atoms/IconButton.md +407 -0
- package/docs/components/atoms/Image.md +448 -0
- package/docs/components/atoms/Input.md +430 -0
- package/docs/components/atoms/ListItem.md +502 -0
- package/docs/components/atoms/Password.md +472 -0
- package/docs/components/atoms/RadioButton.md +614 -0
- package/docs/components/atoms/RadioButtonItem.md +588 -0
- package/docs/components/atoms/ResponsiveComponent.md +612 -0
- package/docs/components/atoms/SelectListItem.md +609 -0
- package/docs/components/atoms/Slider.md +605 -0
- package/docs/components/atoms/Spinner.md +605 -0
- package/docs/components/atoms/Text.md +463 -0
- package/docs/components/atoms/TextArea.md +670 -0
- package/docs/components/atoms/ToastNotification.md +668 -0
- package/docs/components/atoms/Toggle.md +737 -0
- package/docs/components/atoms/ToggleButton.md +751 -0
- package/docs/components/atoms/Tooltip.md +391 -0
- package/docs/components/molecules/Accordion.md +440 -0
- package/docs/components/molecules/AccordionGroup.md +547 -0
- package/docs/components/molecules/ActionCard.md +546 -0
- package/docs/components/molecules/Breadcrumb.md +403 -0
- package/docs/components/molecules/Breadcrumbs.md +485 -0
- package/docs/components/molecules/ButtonGroup.md +383 -0
- package/docs/components/molecules/Card.md +298 -0
- package/docs/components/molecules/ChipInput.md +646 -0
- package/docs/components/molecules/ContextMenu.md +768 -0
- package/docs/components/molecules/CustomTimeSelector.md +116 -0
- package/docs/components/molecules/DatePicker.md +516 -0
- package/docs/components/molecules/DateTimeSelector.md +166 -0
- package/docs/components/molecules/FormField.md +312 -0
- package/docs/components/molecules/Grid.md +577 -0
- package/docs/components/molecules/GridItem.md +834 -0
- package/docs/components/molecules/GridList.md +244 -0
- package/docs/components/molecules/List.md +485 -0
- package/docs/components/molecules/Modal.md +470 -0
- package/docs/components/molecules/ModalFooter.md +702 -0
- package/docs/components/molecules/ModalHeader.md +756 -0
- package/docs/components/molecules/ModalProvider.md +205 -0
- package/docs/components/molecules/Nav.md +530 -0
- package/docs/components/molecules/NavItem.md +572 -0
- package/docs/components/molecules/NavLink.md +499 -0
- package/docs/components/molecules/Option.md +521 -0
- package/docs/components/molecules/Pagination.md +592 -0
- package/docs/components/molecules/PaginationNumberField.md +722 -0
- package/docs/components/molecules/Popover.md +516 -0
- package/docs/components/molecules/ProgressBar.md +624 -0
- package/docs/components/molecules/RadioGroup.md +831 -0
- package/docs/components/molecules/RepeaterList.md +185 -0
- package/docs/components/molecules/Select.md +402 -0
- package/docs/components/molecules/SortableTrigger.md +82 -0
- package/docs/components/molecules/useModal.md +379 -0
- package/docs/components/organisms/Dropzone.md +346 -0
- package/docs/components/organisms/DropzoneClear.md +135 -0
- package/docs/components/organisms/DropzoneContent.md +216 -0
- package/docs/components/organisms/DropzoneFilename.md +191 -0
- package/docs/components/organisms/DropzoneSupportedFormats.md +184 -0
- package/docs/components/organisms/DropzoneTrigger.md +209 -0
- package/docs/components/organisms/Form.md +533 -0
- package/docs/components/organisms/SlideOutPanel.md +662 -0
- package/docs/components/organisms/TabContent.md +902 -0
- package/docs/components/organisms/TabItem.md +1091 -0
- package/docs/components/organisms/Table.md +611 -0
- package/docs/components/organisms/TableBody.md +679 -0
- package/docs/components/organisms/TableCell.md +482 -0
- package/docs/components/organisms/TableHeader.md +513 -0
- package/docs/components/organisms/TableHeaderCell.md +661 -0
- package/docs/components/organisms/TableRow.md +715 -0
- package/docs/components/organisms/Tabs.md +1330 -0
- package/docs/components/utils/ConditionalView.md +568 -0
- package/docs/components/utils/RenderStateView.md +726 -0
- package/docs/components/utils/WrapTextNodes.md +614 -0
- package/package.json +3 -2
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# Breadcrumbs
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
A navigation component that displays the current page's location within a hierarchical structure. Provides users with a clear path to understand their current position and navigate back to previous levels, enhancing website navigation and user experience.
|
|
6
|
+
|
|
7
|
+
## Aliases
|
|
8
|
+
|
|
9
|
+
- Breadcrumbs
|
|
10
|
+
- BreadcrumbTrail
|
|
11
|
+
- NavigationPath
|
|
12
|
+
- PathNavigation
|
|
13
|
+
- Breadcrumb Navigation
|
|
14
|
+
|
|
15
|
+
## Props Breakdown
|
|
16
|
+
|
|
17
|
+
**Extends:** Standalone interface (no HTML element inheritance)
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Required | Description |
|
|
20
|
+
|------|------|---------|----------|-------------|
|
|
21
|
+
| `children` | `ReactNode` | - | Yes | The breadcrumb items to be displayed |
|
|
22
|
+
| `divider` | `ReactNode` | - | No | The divider element to separate breadcrumb items. Can be a string, icon, or custom React node |
|
|
23
|
+
| `className` | `string` | - | No | Additional CSS class names |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
### Basic Usage
|
|
28
|
+
```tsx
|
|
29
|
+
import { Breadcrumbs, Breadcrumb, Text } from '@delightui/components';
|
|
30
|
+
|
|
31
|
+
function BasicExample() {
|
|
32
|
+
return (
|
|
33
|
+
<Breadcrumbs>
|
|
34
|
+
<Breadcrumb to="/home">
|
|
35
|
+
<Text type="BodyMedium">Home</Text>
|
|
36
|
+
</Breadcrumb>
|
|
37
|
+
<Breadcrumb to="/products">
|
|
38
|
+
<Text type="BodyMedium">Products</Text>
|
|
39
|
+
</Breadcrumb>
|
|
40
|
+
<Breadcrumb selected>
|
|
41
|
+
<Text type="BodyMedium">Product Details</Text>
|
|
42
|
+
</Breadcrumb>
|
|
43
|
+
</Breadcrumbs>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Custom Divider
|
|
49
|
+
```tsx
|
|
50
|
+
function CustomDividerExample() {
|
|
51
|
+
return (
|
|
52
|
+
<div className="divider-examples">
|
|
53
|
+
<Breadcrumbs divider="/">
|
|
54
|
+
<Breadcrumb to="/home">
|
|
55
|
+
<Text type="BodyMedium">Home</Text>
|
|
56
|
+
</Breadcrumb>
|
|
57
|
+
<Breadcrumb to="/docs">
|
|
58
|
+
<Text type="BodyMedium">Documentation</Text>
|
|
59
|
+
</Breadcrumb>
|
|
60
|
+
<Breadcrumb selected>
|
|
61
|
+
<Text type="BodyMedium">Components</Text>
|
|
62
|
+
</Breadcrumb>
|
|
63
|
+
</Breadcrumbs>
|
|
64
|
+
|
|
65
|
+
<Breadcrumbs divider={<Icon icon="ArrowForward" size="Small" />}>
|
|
66
|
+
<Breadcrumb to="/dashboard">
|
|
67
|
+
<Text type="BodyMedium">Dashboard</Text>
|
|
68
|
+
</Breadcrumb>
|
|
69
|
+
<Breadcrumb to="/analytics">
|
|
70
|
+
<Text type="BodyMedium">Analytics</Text>
|
|
71
|
+
</Breadcrumb>
|
|
72
|
+
<Breadcrumb selected>
|
|
73
|
+
<Text type="BodyMedium">Reports</Text>
|
|
74
|
+
</Breadcrumb>
|
|
75
|
+
</Breadcrumbs>
|
|
76
|
+
|
|
77
|
+
<Breadcrumbs divider="›">
|
|
78
|
+
<Breadcrumb to="/admin">
|
|
79
|
+
<Text type="BodyMedium">Admin</Text>
|
|
80
|
+
</Breadcrumb>
|
|
81
|
+
<Breadcrumb to="/users">
|
|
82
|
+
<Text type="BodyMedium">Users</Text>
|
|
83
|
+
</Breadcrumb>
|
|
84
|
+
<Breadcrumb selected>
|
|
85
|
+
<Text type="BodyMedium">User Management</Text>
|
|
86
|
+
</Breadcrumb>
|
|
87
|
+
</Breadcrumbs>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### E-commerce Navigation
|
|
94
|
+
```tsx
|
|
95
|
+
function EcommerceExample() {
|
|
96
|
+
return (
|
|
97
|
+
<Breadcrumbs divider="/" className="ecommerce-breadcrumbs">
|
|
98
|
+
<Breadcrumb to="/">
|
|
99
|
+
<Icon icon="Home" size="Small" />
|
|
100
|
+
<Text type="BodyMedium">Home</Text>
|
|
101
|
+
</Breadcrumb>
|
|
102
|
+
|
|
103
|
+
<Breadcrumb to="/electronics">
|
|
104
|
+
<Icon icon="Devices" size="Small" />
|
|
105
|
+
<Text type="BodyMedium">Electronics</Text>
|
|
106
|
+
</Breadcrumb>
|
|
107
|
+
|
|
108
|
+
<Breadcrumb to="/electronics/smartphones">
|
|
109
|
+
<Icon icon="Phone" size="Small" />
|
|
110
|
+
<Text type="BodyMedium">Smartphones</Text>
|
|
111
|
+
</Breadcrumb>
|
|
112
|
+
|
|
113
|
+
<Breadcrumb to="/electronics/smartphones/apple">
|
|
114
|
+
<Text type="BodyMedium">Apple</Text>
|
|
115
|
+
</Breadcrumb>
|
|
116
|
+
|
|
117
|
+
<Breadcrumb selected>
|
|
118
|
+
<Text type="BodyMedium">iPhone 15 Pro</Text>
|
|
119
|
+
<Chip size="Small" style="A">New</Chip>
|
|
120
|
+
</Breadcrumb>
|
|
121
|
+
</Breadcrumbs>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Admin Dashboard
|
|
127
|
+
```tsx
|
|
128
|
+
function AdminDashboardExample() {
|
|
129
|
+
return (
|
|
130
|
+
<Breadcrumbs
|
|
131
|
+
divider={<Icon icon="ChevronRight" size="Small" />}
|
|
132
|
+
className="admin-breadcrumbs"
|
|
133
|
+
>
|
|
134
|
+
<Breadcrumb to="/admin">
|
|
135
|
+
<Icon icon="Dashboard" size="Small" />
|
|
136
|
+
<Text type="Heading6">Dashboard</Text>
|
|
137
|
+
</Breadcrumb>
|
|
138
|
+
|
|
139
|
+
<Breadcrumb to="/admin/users">
|
|
140
|
+
<Icon icon="Users" size="Small" />
|
|
141
|
+
<Text type="BodyMedium">User Management</Text>
|
|
142
|
+
</Breadcrumb>
|
|
143
|
+
|
|
144
|
+
<Breadcrumb to="/admin/users/roles">
|
|
145
|
+
<Icon icon="Security" size="Small" />
|
|
146
|
+
<Text type="BodyMedium">Roles & Permissions</Text>
|
|
147
|
+
</Breadcrumb>
|
|
148
|
+
|
|
149
|
+
<Breadcrumb selected>
|
|
150
|
+
<Icon icon="Edit" size="Small" />
|
|
151
|
+
<Text type="BodyMedium">Edit Role</Text>
|
|
152
|
+
<Chip size="Small" style="B">Admin</Chip>
|
|
153
|
+
</Breadcrumb>
|
|
154
|
+
</Breadcrumbs>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### File System Navigation
|
|
160
|
+
```tsx
|
|
161
|
+
function FileSystemExample() {
|
|
162
|
+
const currentPath = '/Users/john/Documents/Projects/Website/src/components';
|
|
163
|
+
const pathParts = currentPath.split('/').filter(Boolean);
|
|
164
|
+
|
|
165
|
+
const BreadcrumbComponent = ({ part, index }) => {
|
|
166
|
+
const isLast = index === pathParts.length - 1;
|
|
167
|
+
const fullPath = '/' + pathParts.slice(0, index + 1).join('/');
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
<Breadcrumb
|
|
171
|
+
to={isLast ? undefined : fullPath}
|
|
172
|
+
selected={isLast}
|
|
173
|
+
>
|
|
174
|
+
<Icon icon="Folder" size="Small" />
|
|
175
|
+
<Text type="BodyMedium">{part}</Text>
|
|
176
|
+
{part === 'Projects' && (
|
|
177
|
+
<Chip size="Small" style="A">Active</Chip>
|
|
178
|
+
)}
|
|
179
|
+
</Breadcrumb>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<Breadcrumbs divider="/" className="file-system-breadcrumbs">
|
|
185
|
+
<Breadcrumb to="/">
|
|
186
|
+
<Icon icon="Computer" size="Small" />
|
|
187
|
+
<Text type="BodyMedium">Root</Text>
|
|
188
|
+
</Breadcrumb>
|
|
189
|
+
|
|
190
|
+
<List
|
|
191
|
+
data={pathParts.map((part, index) => ({ part, index }))}
|
|
192
|
+
component={BreadcrumbComponent}
|
|
193
|
+
keyExtractor={(item) => item.index}
|
|
194
|
+
/>
|
|
195
|
+
</Breadcrumbs>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Multi-level Category Navigation
|
|
201
|
+
```tsx
|
|
202
|
+
function CategoryNavigationExample() {
|
|
203
|
+
const categoryPath = [
|
|
204
|
+
{ label: 'All Categories', path: '/categories', icon: 'Category' },
|
|
205
|
+
{ label: 'Technology', path: '/categories/technology', icon: 'Computer' },
|
|
206
|
+
{ label: 'Web Development', path: '/categories/technology/web-dev', icon: 'Code' },
|
|
207
|
+
{ label: 'Frontend Frameworks', path: '/categories/technology/web-dev/frontend', icon: 'Web' },
|
|
208
|
+
{ label: 'React.js', selected: true, icon: 'Framework' }
|
|
209
|
+
];
|
|
210
|
+
|
|
211
|
+
const CategoryBreadcrumbComponent = ({ label, path, icon, selected, index }) => (
|
|
212
|
+
<Breadcrumb
|
|
213
|
+
to={path}
|
|
214
|
+
selected={selected}
|
|
215
|
+
navLinkType={index === 0 ? "Filled" : "Ghost"}
|
|
216
|
+
>
|
|
217
|
+
<Icon icon={icon} size="Small" />
|
|
218
|
+
<Text
|
|
219
|
+
type={index === 0 ? "Heading6" : "BodyMedium"}
|
|
220
|
+
className={`category-text level-${index}`}
|
|
221
|
+
>
|
|
222
|
+
{label}
|
|
223
|
+
</Text>
|
|
224
|
+
{selected && (
|
|
225
|
+
<Chip size="Small" style="A">Current</Chip>
|
|
226
|
+
)}
|
|
227
|
+
</Breadcrumb>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<Breadcrumbs
|
|
232
|
+
divider={<Text type="BodySmall">•</Text>}
|
|
233
|
+
className="category-breadcrumbs"
|
|
234
|
+
>
|
|
235
|
+
<List
|
|
236
|
+
data={categoryPath.map((category, index) => ({ ...category, index }))}
|
|
237
|
+
component={CategoryBreadcrumbComponent}
|
|
238
|
+
keyExtractor={(category) => category.path || category.label}
|
|
239
|
+
/>
|
|
240
|
+
</Breadcrumbs>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Blog Post Navigation
|
|
246
|
+
```tsx
|
|
247
|
+
function BlogNavigationExample() {
|
|
248
|
+
return (
|
|
249
|
+
<Breadcrumbs
|
|
250
|
+
divider={<Icon icon="ArrowForward" size="Small" />}
|
|
251
|
+
className="blog-breadcrumbs"
|
|
252
|
+
>
|
|
253
|
+
<Breadcrumb to="/blog">
|
|
254
|
+
<Icon icon="Article" size="Small" />
|
|
255
|
+
<Text type="BodyMedium">Blog</Text>
|
|
256
|
+
</Breadcrumb>
|
|
257
|
+
|
|
258
|
+
<Breadcrumb to="/blog/web-development">
|
|
259
|
+
<Text type="BodyMedium">Web Development</Text>
|
|
260
|
+
<Chip size="Small" style="B">124 posts</Chip>
|
|
261
|
+
</Breadcrumb>
|
|
262
|
+
|
|
263
|
+
<Breadcrumb to="/blog/web-development/react">
|
|
264
|
+
<Text type="BodyMedium">React</Text>
|
|
265
|
+
<Chip size="Small" style="B">45 posts</Chip>
|
|
266
|
+
</Breadcrumb>
|
|
267
|
+
|
|
268
|
+
<Breadcrumb selected>
|
|
269
|
+
<Text type="BodyMedium">Getting Started with React Hooks</Text>
|
|
270
|
+
<div className="post-meta">
|
|
271
|
+
<Chip size="Small" style="A">New</Chip>
|
|
272
|
+
<Text type="BodySmall">5 min read</Text>
|
|
273
|
+
</div>
|
|
274
|
+
</Breadcrumb>
|
|
275
|
+
</Breadcrumbs>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Project Management Navigation
|
|
281
|
+
```tsx
|
|
282
|
+
function ProjectManagementExample() {
|
|
283
|
+
return (
|
|
284
|
+
<Breadcrumbs
|
|
285
|
+
divider="→"
|
|
286
|
+
className="project-breadcrumbs"
|
|
287
|
+
>
|
|
288
|
+
<Breadcrumb to="/projects">
|
|
289
|
+
<Icon icon="Work" size="Small" />
|
|
290
|
+
<Text type="Heading6">Projects</Text>
|
|
291
|
+
</Breadcrumb>
|
|
292
|
+
|
|
293
|
+
<Breadcrumb to="/projects/website-redesign">
|
|
294
|
+
<div className="project-info">
|
|
295
|
+
<Text type="BodyMedium">Website Redesign</Text>
|
|
296
|
+
<div className="project-meta">
|
|
297
|
+
<Chip size="Small" style="B">In Progress</Chip>
|
|
298
|
+
<Text type="BodySmall">Due: Mar 15</Text>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
</Breadcrumb>
|
|
302
|
+
|
|
303
|
+
<Breadcrumb to="/projects/website-redesign/tasks">
|
|
304
|
+
<Icon icon="Task" size="Small" />
|
|
305
|
+
<Text type="BodyMedium">Tasks</Text>
|
|
306
|
+
<Chip size="Small" style="A">12 active</Chip>
|
|
307
|
+
</Breadcrumb>
|
|
308
|
+
|
|
309
|
+
<Breadcrumb selected>
|
|
310
|
+
<Icon icon="BugReport" size="Small" />
|
|
311
|
+
<Text type="BodyMedium">Bug Fixes</Text>
|
|
312
|
+
<Chip size="Small" style="C">3 open</Chip>
|
|
313
|
+
</Breadcrumb>
|
|
314
|
+
</Breadcrumbs>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Responsive Breadcrumbs
|
|
320
|
+
```tsx
|
|
321
|
+
function ResponsiveBreadcrumbsExample() {
|
|
322
|
+
const [collapsed, setCollapsed] = useState(true);
|
|
323
|
+
|
|
324
|
+
const allBreadcrumbs = [
|
|
325
|
+
{ label: 'Home', path: '/', icon: 'Home' },
|
|
326
|
+
{ label: 'Products', path: '/products', icon: 'Inventory' },
|
|
327
|
+
{ label: 'Electronics', path: '/products/electronics', icon: 'Devices' },
|
|
328
|
+
{ label: 'Computers', path: '/products/electronics/computers', icon: 'Computer' },
|
|
329
|
+
{ label: 'Laptops', path: '/products/electronics/computers/laptops', icon: 'Laptop' },
|
|
330
|
+
{ label: 'Gaming', path: '/products/electronics/computers/laptops/gaming', icon: 'Games' },
|
|
331
|
+
{ label: 'High Performance', selected: true, icon: 'Speed' }
|
|
332
|
+
];
|
|
333
|
+
|
|
334
|
+
const visibleBreadcrumbs = collapsed
|
|
335
|
+
? [allBreadcrumbs[0], ...allBreadcrumbs.slice(-2)]
|
|
336
|
+
: allBreadcrumbs;
|
|
337
|
+
|
|
338
|
+
return (
|
|
339
|
+
<div className="responsive-breadcrumbs-container">
|
|
340
|
+
<Breadcrumbs
|
|
341
|
+
divider="/"
|
|
342
|
+
className="responsive-breadcrumbs"
|
|
343
|
+
>
|
|
344
|
+
{collapsed && allBreadcrumbs.length > 3 && (
|
|
345
|
+
<>
|
|
346
|
+
<Breadcrumb to={allBreadcrumbs[0].path}>
|
|
347
|
+
<Icon icon={allBreadcrumbs[0].icon} size="Small" />
|
|
348
|
+
<Text type="BodyMedium">{allBreadcrumbs[0].label}</Text>
|
|
349
|
+
</Breadcrumb>
|
|
350
|
+
|
|
351
|
+
<Breadcrumb
|
|
352
|
+
onClick={() => setCollapsed(false)}
|
|
353
|
+
className="breadcrumb-ellipsis"
|
|
354
|
+
>
|
|
355
|
+
<Icon icon="MoreHorizontal" size="Small" />
|
|
356
|
+
<Text type="BodyMedium">...</Text>
|
|
357
|
+
</Breadcrumb>
|
|
358
|
+
</>
|
|
359
|
+
)}
|
|
360
|
+
|
|
361
|
+
<List
|
|
362
|
+
data={collapsed ? allBreadcrumbs.slice(-2) : allBreadcrumbs}
|
|
363
|
+
component={({ label, path, icon, selected }) => (
|
|
364
|
+
<Breadcrumb
|
|
365
|
+
to={selected ? undefined : path}
|
|
366
|
+
selected={selected}
|
|
367
|
+
>
|
|
368
|
+
<Icon icon={icon} size="Small" />
|
|
369
|
+
<Text type="BodyMedium">{label}</Text>
|
|
370
|
+
</Breadcrumb>
|
|
371
|
+
)}
|
|
372
|
+
keyExtractor={(item) => item.path || item.label}
|
|
373
|
+
/>
|
|
374
|
+
</Breadcrumbs>
|
|
375
|
+
|
|
376
|
+
{!collapsed && (
|
|
377
|
+
<Button
|
|
378
|
+
size="Small"
|
|
379
|
+
type="Ghost"
|
|
380
|
+
onClick={() => setCollapsed(true)}
|
|
381
|
+
className="collapse-button"
|
|
382
|
+
>
|
|
383
|
+
<Icon icon="ExpandLess" size="Small" />
|
|
384
|
+
<Text type="BodySmall">Collapse</Text>
|
|
385
|
+
</Button>
|
|
386
|
+
)}
|
|
387
|
+
</div>
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Interactive Breadcrumbs with Actions
|
|
393
|
+
```tsx
|
|
394
|
+
function InteractiveBreadcrumbsExample() {
|
|
395
|
+
const [bookmarked, setBookmarked] = useState(false);
|
|
396
|
+
const [showActions, setShowActions] = useState(false);
|
|
397
|
+
|
|
398
|
+
return (
|
|
399
|
+
<div className="interactive-breadcrumbs-container">
|
|
400
|
+
<Breadcrumbs
|
|
401
|
+
divider={<Icon icon="ChevronRight" size="Small" />}
|
|
402
|
+
className="interactive-breadcrumbs"
|
|
403
|
+
>
|
|
404
|
+
<Breadcrumb to="/workspace">
|
|
405
|
+
<Icon icon="Work" size="Small" />
|
|
406
|
+
<Text type="BodyMedium">Workspace</Text>
|
|
407
|
+
</Breadcrumb>
|
|
408
|
+
|
|
409
|
+
<Breadcrumb to="/workspace/projects">
|
|
410
|
+
<Icon icon="Folder" size="Small" />
|
|
411
|
+
<Text type="BodyMedium">Projects</Text>
|
|
412
|
+
</Breadcrumb>
|
|
413
|
+
|
|
414
|
+
<Breadcrumb
|
|
415
|
+
to="/workspace/projects/current"
|
|
416
|
+
onMouseEnter={() => setShowActions(true)}
|
|
417
|
+
onMouseLeave={() => setShowActions(false)}
|
|
418
|
+
>
|
|
419
|
+
<Icon icon="FolderOpen" size="Small" />
|
|
420
|
+
<Text type="BodyMedium">Current Project</Text>
|
|
421
|
+
{showActions && (
|
|
422
|
+
<div className="breadcrumb-actions">
|
|
423
|
+
<IconButton
|
|
424
|
+
icon={bookmarked ? "BookmarkFilled" : "Bookmark"}
|
|
425
|
+
size="Small"
|
|
426
|
+
onClick={() => setBookmarked(!bookmarked)}
|
|
427
|
+
/>
|
|
428
|
+
<IconButton icon="Share" size="Small" />
|
|
429
|
+
<IconButton icon="MoreVertical" size="Small" />
|
|
430
|
+
</div>
|
|
431
|
+
)}
|
|
432
|
+
</Breadcrumb>
|
|
433
|
+
|
|
434
|
+
<Breadcrumb selected>
|
|
435
|
+
<Icon icon="InsertDriveFile" size="Small" />
|
|
436
|
+
<Text type="BodyMedium">README.md</Text>
|
|
437
|
+
<div className="file-meta">
|
|
438
|
+
<Chip size="Small" style="B">Modified</Chip>
|
|
439
|
+
<Text type="BodySmall">2h ago</Text>
|
|
440
|
+
</div>
|
|
441
|
+
</Breadcrumb>
|
|
442
|
+
</Breadcrumbs>
|
|
443
|
+
</div>
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### Search Results Navigation
|
|
449
|
+
```tsx
|
|
450
|
+
function SearchResultsExample() {
|
|
451
|
+
const searchQuery = "react components";
|
|
452
|
+
|
|
453
|
+
return (
|
|
454
|
+
<Breadcrumbs
|
|
455
|
+
divider="•"
|
|
456
|
+
className="search-breadcrumbs"
|
|
457
|
+
>
|
|
458
|
+
<Breadcrumb to="/search">
|
|
459
|
+
<Icon icon="Search" size="Small" />
|
|
460
|
+
<Text type="BodyMedium">Search</Text>
|
|
461
|
+
</Breadcrumb>
|
|
462
|
+
|
|
463
|
+
<Breadcrumb to={`/search?q=${encodeURIComponent(searchQuery)}`}>
|
|
464
|
+
<Text type="BodyMedium">"{searchQuery}"</Text>
|
|
465
|
+
<Chip size="Small" style="A">1,247 results</Chip>
|
|
466
|
+
</Breadcrumb>
|
|
467
|
+
|
|
468
|
+
<Breadcrumb to={`/search?q=${encodeURIComponent(searchQuery)}&category=tutorials`}>
|
|
469
|
+
<Icon icon="School" size="Small" />
|
|
470
|
+
<Text type="BodyMedium">Tutorials</Text>
|
|
471
|
+
<Chip size="Small" style="B">89 items</Chip>
|
|
472
|
+
</Breadcrumb>
|
|
473
|
+
|
|
474
|
+
<Breadcrumb selected>
|
|
475
|
+
<Icon icon="Article" size="Small" />
|
|
476
|
+
<Text type="BodyMedium">Advanced React Patterns</Text>
|
|
477
|
+
<div className="result-meta">
|
|
478
|
+
<Icon icon="Star" size="Small" />
|
|
479
|
+
<Text type="BodySmall">4.8</Text>
|
|
480
|
+
</div>
|
|
481
|
+
</Breadcrumb>
|
|
482
|
+
</Breadcrumbs>
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
```
|