solid-tom-ui 1.0.11 → 1.0.14
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 +246 -246
- package/dist/README.md +246 -246
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/chat-bubble/chatBubble.js.map +1 -1
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/collapse/collapse.js.map +1 -1
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context-menu.store.js.map +1 -1
- package/dist/components/divider/divider.js.map +1 -1
- package/dist/components/dropdown/dropdown.js.map +1 -1
- package/dist/components/dropdown/dropdown.store.js.map +1 -1
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/hover-3d-image/hover-3d-image.js.map +1 -1
- package/dist/components/image-preview/image-preview.js.map +1 -1
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.utils.js.map +1 -1
- package/dist/components/input/variants/input-color.js.map +1 -1
- package/dist/components/input/variants/input-date.js.map +1 -1
- package/dist/components/input/variants/input-number.d.ts.map +1 -1
- package/dist/components/input/variants/input-number.js +1 -1
- package/dist/components/input/variants/input-number.js.map +1 -1
- package/dist/components/input/variants/input-otp.js.map +1 -1
- package/dist/components/input/variants/input-password.js.map +1 -1
- package/dist/components/input/variants/input-radio.js.map +1 -1
- package/dist/components/input/variants/input-range.js.map +1 -1
- package/dist/components/input/variants/input-text.d.ts.map +1 -1
- package/dist/components/input/variants/input-text.js +1 -1
- package/dist/components/input/variants/input-text.js.map +1 -1
- package/dist/components/input/variants/input-textarea.js.map +1 -1
- package/dist/components/loading/loading.js.map +1 -1
- package/dist/components/mansory/mansory.js.map +1 -1
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/modal/modal.js.map +1 -1
- package/dist/components/modal/modalContext.js.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/qr-code/qr-code.js.map +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select-zone/select-zone.js.map +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/splitter/splitter.js.map +1 -1
- package/dist/components/steps/steps.js.map +1 -1
- package/dist/components/swap/swap.js.map +1 -1
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/tab/tab.js.map +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/timeline/timeline.js.map +1 -1
- package/dist/components/toast/icons/ErrorIcon.js.map +1 -1
- package/dist/components/toast/icons/IconCircle.js.map +1 -1
- package/dist/components/toast/icons/InfoIcon.js.map +1 -1
- package/dist/components/toast/icons/LoaderIcon.js.map +1 -1
- package/dist/components/toast/icons/SuccessIcon.js.map +1 -1
- package/dist/components/toast/icons/WarningIcon.js.map +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toast/toast.store.js.map +1 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tour/tour.js.map +1 -1
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/components/z-index/z-index.context.js.map +1 -1
- package/dist/components/z-index/z-index.js.map +1 -1
- package/dist/components/z-index/z-index.store.js.map +1 -1
- package/dist/components/z-index/z-index.types.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/skill/avatar.skill.md.txt +255 -255
- package/dist/skill/badge.skill.md.txt +223 -223
- package/dist/skill/breadcrumb.skill.md.txt +177 -177
- package/dist/skill/button.skill.md.txt +198 -198
- package/dist/skill/carousel.skill.md.txt +406 -406
- package/dist/skill/chat-bubble.skill.md.txt +342 -342
- package/dist/skill/checkbox.skill.md.txt +326 -326
- package/dist/skill/code-preview.skill.md.txt +240 -240
- package/dist/skill/collapse.skill.md.txt +329 -329
- package/dist/skill/context-menu.skill.md.txt +233 -233
- package/dist/skill/diff.skill.md.txt +244 -244
- package/dist/skill/divider.skill.md.txt +151 -151
- package/dist/skill/doc.skill.md.txt +191 -191
- package/dist/skill/drawer.skill.md.txt +157 -157
- package/dist/skill/dropdown.skill.md.txt +198 -198
- package/dist/skill/float-button.skill.md.txt +315 -315
- package/dist/skill/hover-3d-image.skill.md.txt +120 -120
- package/dist/skill/iframe.skill.md.txt +114 -114
- package/dist/skill/image-preview.skill.md.txt +162 -162
- package/dist/skill/indicator.skill.md.txt +60 -60
- package/dist/skill/input.skill.md.txt +489 -489
- package/dist/skill/loading.skill.md.txt +127 -127
- package/dist/skill/menu.skill.md.txt +476 -476
- package/dist/skill/modal.skill.md.txt +359 -359
- package/dist/skill/pagination.skill.md.txt +405 -405
- package/dist/skill/progress-bar.skill.md.txt +207 -207
- package/dist/skill/qr-code.skill.md.txt +136 -136
- package/dist/skill/rating.skill.md.txt +167 -167
- package/dist/skill/select-zone.skill.md.txt +93 -93
- package/dist/skill/select.skill.md.txt +663 -663
- package/dist/skill/skeleton.skill.md.txt +192 -192
- package/dist/skill/slider.skill.md.txt +404 -404
- package/dist/skill/splitter.skill.md.txt +411 -411
- package/dist/skill/steps.skill.md.txt +264 -264
- package/dist/skill/swap.skill.md.txt +139 -139
- package/dist/skill/switch.skill.md.txt +191 -191
- package/dist/skill/tab.skill.md.txt +484 -484
- package/dist/skill/table.example.header.md.txt +666 -666
- package/dist/skill/table.skill.md.txt +1407 -1407
- package/dist/skill/text-rotate.skill.md.txt +186 -186
- package/dist/skill/timeline.skill.md.txt +247 -247
- package/dist/skill/toast.skill.md.txt +531 -531
- package/dist/skill/tooltip.skill.md.txt +222 -222
- package/dist/skill/tour.skill.md.txt +156 -156
- package/dist/skill/upload.skill.md.txt +358 -358
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/element-tracker.js.map +1 -1
- package/dist/utils/helper.js.map +1 -1
- package/dist/utils/hoc.js.map +1 -1
- package/package.json +132 -133
|
@@ -1,177 +1,177 @@
|
|
|
1
|
-
## COMPONENT IDENTITY
|
|
2
|
-
- **Import**: `import { Breadcrumb } from 'solid-tom-ui';`
|
|
3
|
-
- **Export**: `Breadcrumb` (named export)
|
|
4
|
-
- **Framework**: SolidJS
|
|
5
|
-
- **Purpose**: Navigation trail showing hierarchy of current page location
|
|
6
|
-
|
|
7
|
-
## TYPE SIGNATURE
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { Breadcrumb } from 'solid-tom-ui';
|
|
11
|
-
|
|
12
|
-
type BreadcrumbProps = {
|
|
13
|
-
items: SolidComponent[]; // REQUIRED: array of items (string | JSXElement | () => JSX)
|
|
14
|
-
separate?: SolidComponent; // Custom separator between items (default: CSS chevron arrow)
|
|
15
|
-
class?: Partial<Record<'root' | 'item', string>>; // Scoped custom classes
|
|
16
|
-
onItemClick?: (e: MouseEvent) => void; // Click handler for any item
|
|
17
|
-
};
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## KEY RULES
|
|
21
|
-
- `items` is the **only required prop**
|
|
22
|
-
- Items are rendered in order: `items[0]` → separator → `items[1]` → ... → `items[n-1]`
|
|
23
|
-
- Separator is inserted **between** items, **not after the last** item
|
|
24
|
-
- Each item can be a plain string or any JSXElement (supports icons, links, styled content)
|
|
25
|
-
- `onItemClick` fires for **every** item clicked — use the event target to identify which item
|
|
26
|
-
|
|
27
|
-
## USAGE PATTERNS
|
|
28
|
-
|
|
29
|
-
### Minimal — plain text items
|
|
30
|
-
```tsx
|
|
31
|
-
<Breadcrumb items={['Home', 'Products', 'Electronics', 'Laptops']} />
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Custom separator
|
|
35
|
-
```tsx
|
|
36
|
-
// Text separator
|
|
37
|
-
<Breadcrumb
|
|
38
|
-
items={['Home', 'Settings', 'Profile']}
|
|
39
|
-
separate={<span class="mx-2 text-gray-400">/</span>}
|
|
40
|
-
/>
|
|
41
|
-
|
|
42
|
-
// Icon separator
|
|
43
|
-
<Breadcrumb
|
|
44
|
-
items={['Home', 'Settings', 'Profile']}
|
|
45
|
-
separate={<DynamicIcon name="chevron-right" size={14} class="mx-1 text-gray-400" />}
|
|
46
|
-
/>
|
|
47
|
-
|
|
48
|
-
// Dash separator
|
|
49
|
-
<Breadcrumb
|
|
50
|
-
items={['Section 1', 'Section 2', 'Section 3']}
|
|
51
|
-
separate={<div class="mx-2">-</div>}
|
|
52
|
-
/>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### With icons in items
|
|
56
|
-
```tsx
|
|
57
|
-
import { DynamicIcon } from 'solid-tom-ui';
|
|
58
|
-
|
|
59
|
-
<Breadcrumb
|
|
60
|
-
items={[
|
|
61
|
-
<div class="flex items-center gap-2">
|
|
62
|
-
<DynamicIcon name="home" size={16} />
|
|
63
|
-
Home
|
|
64
|
-
</div>,
|
|
65
|
-
<div class="flex items-center gap-2">
|
|
66
|
-
<DynamicIcon name="folder" size={16} />
|
|
67
|
-
Documents
|
|
68
|
-
</div>,
|
|
69
|
-
<div class="flex items-center gap-2">
|
|
70
|
-
<DynamicIcon name="file" size={16} />
|
|
71
|
-
report.pdf
|
|
72
|
-
</div>,
|
|
73
|
-
]}
|
|
74
|
-
/>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### With click handler
|
|
78
|
-
```tsx
|
|
79
|
-
const [activePath, setActivePath] = createSignal<string[]>(['Home', 'Products']);
|
|
80
|
-
|
|
81
|
-
<Breadcrumb
|
|
82
|
-
items={activePath()}
|
|
83
|
-
onItemClick={(e) => {
|
|
84
|
-
const clickedText = (e.target as HTMLElement).textContent;
|
|
85
|
-
console.log('Clicked breadcrumb item:', clickedText);
|
|
86
|
-
// Handle navigation here
|
|
87
|
-
}}
|
|
88
|
-
/>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Custom CSS classes
|
|
92
|
-
```tsx
|
|
93
|
-
<Breadcrumb
|
|
94
|
-
items={['Home', 'Library', 'Data']}
|
|
95
|
-
class={{
|
|
96
|
-
root: 'bg-gray-100 rounded-lg px-4 py-2',
|
|
97
|
-
item: 'text-blue-600 hover:text-blue-800 font-medium',
|
|
98
|
-
}}
|
|
99
|
-
/>
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Clickable items as anchor tags
|
|
103
|
-
```tsx
|
|
104
|
-
<Breadcrumb
|
|
105
|
-
items={[
|
|
106
|
-
<a href="/" class="hover:underline">Home</a>,
|
|
107
|
-
<a href="/products" class="hover:underline">Products</a>,
|
|
108
|
-
<span class="text-gray-500">Current Page</span>,
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## DECISION RULES
|
|
114
|
-
|
|
115
|
-
**When to use a custom separator:**
|
|
116
|
-
- Default: use the built-in CSS chevron (no `separate` prop needed)
|
|
117
|
-
- Brand-specific style: pass a custom icon or character via `separate`
|
|
118
|
-
- Minimal/flat UI: use `<span class="mx-2">/</span>`
|
|
119
|
-
|
|
120
|
-
**Item content strategy:**
|
|
121
|
-
- Plain navigation labels → plain strings
|
|
122
|
-
- Route with icon → JSXElement with icon + label
|
|
123
|
-
- Clickable items → wrap in `<a>` tags inside the JSX items, OR use `onItemClick`
|
|
124
|
-
- Last item (current page) → typically rendered non-clickable / different style
|
|
125
|
-
|
|
126
|
-
**When NOT to use Breadcrumb:**
|
|
127
|
-
- If hierarchy depth is always 1 level → use a back button instead
|
|
128
|
-
- If items are dynamic and represent tabs or steps → use a stepper or tabs component
|
|
129
|
-
|
|
130
|
-
## COMMON PATTERNS IN APPS
|
|
131
|
-
|
|
132
|
-
### Dynamic breadcrumb from route
|
|
133
|
-
```tsx
|
|
134
|
-
const routes = () => [
|
|
135
|
-
{ label: 'Home', href: '/' },
|
|
136
|
-
{ label: 'Products', href: '/products' },
|
|
137
|
-
{ label: currentProduct().name, href: null },
|
|
138
|
-
];
|
|
139
|
-
|
|
140
|
-
<Breadcrumb
|
|
141
|
-
items={routes().map(r =>
|
|
142
|
-
r.href
|
|
143
|
-
? <a href={r.href} class="hover:underline">{r.label}</a>
|
|
144
|
-
: <span>{r.label}</span>
|
|
145
|
-
)}
|
|
146
|
-
/>
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### File path navigator
|
|
150
|
-
```tsx
|
|
151
|
-
const pathParts = () => currentPath().split('/').filter(Boolean);
|
|
152
|
-
|
|
153
|
-
<Breadcrumb
|
|
154
|
-
items={['Root', ...pathParts()]}
|
|
155
|
-
separate={<span class="mx-1 text-gray-400">/</span>}
|
|
156
|
-
onItemClick={(e) => navigateToSegment(e)}
|
|
157
|
-
/>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## ANTI-PATTERNS
|
|
161
|
-
```tsx
|
|
162
|
-
// ❌ Empty items array — renders nothing useful
|
|
163
|
-
<Breadcrumb items={[]} />
|
|
164
|
-
|
|
165
|
-
// ❌ Passing a separator that includes the chevron logic itself when default works fine
|
|
166
|
-
<Breadcrumb items={items} separate={<span>›</span>} /> // redundant if default style fits
|
|
167
|
-
|
|
168
|
-
// ✅ Use default separator when it fits the design system
|
|
169
|
-
<Breadcrumb items={items} />
|
|
170
|
-
```
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## Component Conventions
|
|
174
|
-
|
|
175
|
-
> **CSS encoding**: internal CSS classes use short encoded names (e.g. `bc01`, `bc02`) per project convention.
|
|
176
|
-
|
|
177
|
-
> **Unique IDs**: if this component needs to generate HTML `id` attributes, always use `createUniqueId()` from `solid-js` — never `Math.random()` or `Date.now()`.
|
|
1
|
+
## COMPONENT IDENTITY
|
|
2
|
+
- **Import**: `import { Breadcrumb } from 'solid-tom-ui';`
|
|
3
|
+
- **Export**: `Breadcrumb` (named export)
|
|
4
|
+
- **Framework**: SolidJS
|
|
5
|
+
- **Purpose**: Navigation trail showing hierarchy of current page location
|
|
6
|
+
|
|
7
|
+
## TYPE SIGNATURE
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Breadcrumb } from 'solid-tom-ui';
|
|
11
|
+
|
|
12
|
+
type BreadcrumbProps = {
|
|
13
|
+
items: SolidComponent[]; // REQUIRED: array of items (string | JSXElement | () => JSX)
|
|
14
|
+
separate?: SolidComponent; // Custom separator between items (default: CSS chevron arrow)
|
|
15
|
+
class?: Partial<Record<'root' | 'item', string>>; // Scoped custom classes
|
|
16
|
+
onItemClick?: (e: MouseEvent) => void; // Click handler for any item
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## KEY RULES
|
|
21
|
+
- `items` is the **only required prop**
|
|
22
|
+
- Items are rendered in order: `items[0]` → separator → `items[1]` → ... → `items[n-1]`
|
|
23
|
+
- Separator is inserted **between** items, **not after the last** item
|
|
24
|
+
- Each item can be a plain string or any JSXElement (supports icons, links, styled content)
|
|
25
|
+
- `onItemClick` fires for **every** item clicked — use the event target to identify which item
|
|
26
|
+
|
|
27
|
+
## USAGE PATTERNS
|
|
28
|
+
|
|
29
|
+
### Minimal — plain text items
|
|
30
|
+
```tsx
|
|
31
|
+
<Breadcrumb items={['Home', 'Products', 'Electronics', 'Laptops']} />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Custom separator
|
|
35
|
+
```tsx
|
|
36
|
+
// Text separator
|
|
37
|
+
<Breadcrumb
|
|
38
|
+
items={['Home', 'Settings', 'Profile']}
|
|
39
|
+
separate={<span class="mx-2 text-gray-400">/</span>}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
// Icon separator
|
|
43
|
+
<Breadcrumb
|
|
44
|
+
items={['Home', 'Settings', 'Profile']}
|
|
45
|
+
separate={<DynamicIcon name="chevron-right" size={14} class="mx-1 text-gray-400" />}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
// Dash separator
|
|
49
|
+
<Breadcrumb
|
|
50
|
+
items={['Section 1', 'Section 2', 'Section 3']}
|
|
51
|
+
separate={<div class="mx-2">-</div>}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### With icons in items
|
|
56
|
+
```tsx
|
|
57
|
+
import { DynamicIcon } from 'solid-tom-ui';
|
|
58
|
+
|
|
59
|
+
<Breadcrumb
|
|
60
|
+
items={[
|
|
61
|
+
<div class="flex items-center gap-2">
|
|
62
|
+
<DynamicIcon name="home" size={16} />
|
|
63
|
+
Home
|
|
64
|
+
</div>,
|
|
65
|
+
<div class="flex items-center gap-2">
|
|
66
|
+
<DynamicIcon name="folder" size={16} />
|
|
67
|
+
Documents
|
|
68
|
+
</div>,
|
|
69
|
+
<div class="flex items-center gap-2">
|
|
70
|
+
<DynamicIcon name="file" size={16} />
|
|
71
|
+
report.pdf
|
|
72
|
+
</div>,
|
|
73
|
+
]}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### With click handler
|
|
78
|
+
```tsx
|
|
79
|
+
const [activePath, setActivePath] = createSignal<string[]>(['Home', 'Products']);
|
|
80
|
+
|
|
81
|
+
<Breadcrumb
|
|
82
|
+
items={activePath()}
|
|
83
|
+
onItemClick={(e) => {
|
|
84
|
+
const clickedText = (e.target as HTMLElement).textContent;
|
|
85
|
+
console.log('Clicked breadcrumb item:', clickedText);
|
|
86
|
+
// Handle navigation here
|
|
87
|
+
}}
|
|
88
|
+
/>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Custom CSS classes
|
|
92
|
+
```tsx
|
|
93
|
+
<Breadcrumb
|
|
94
|
+
items={['Home', 'Library', 'Data']}
|
|
95
|
+
class={{
|
|
96
|
+
root: 'bg-gray-100 rounded-lg px-4 py-2',
|
|
97
|
+
item: 'text-blue-600 hover:text-blue-800 font-medium',
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Clickable items as anchor tags
|
|
103
|
+
```tsx
|
|
104
|
+
<Breadcrumb
|
|
105
|
+
items={[
|
|
106
|
+
<a href="/" class="hover:underline">Home</a>,
|
|
107
|
+
<a href="/products" class="hover:underline">Products</a>,
|
|
108
|
+
<span class="text-gray-500">Current Page</span>,
|
|
109
|
+
]}
|
|
110
|
+
/>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## DECISION RULES
|
|
114
|
+
|
|
115
|
+
**When to use a custom separator:**
|
|
116
|
+
- Default: use the built-in CSS chevron (no `separate` prop needed)
|
|
117
|
+
- Brand-specific style: pass a custom icon or character via `separate`
|
|
118
|
+
- Minimal/flat UI: use `<span class="mx-2">/</span>`
|
|
119
|
+
|
|
120
|
+
**Item content strategy:**
|
|
121
|
+
- Plain navigation labels → plain strings
|
|
122
|
+
- Route with icon → JSXElement with icon + label
|
|
123
|
+
- Clickable items → wrap in `<a>` tags inside the JSX items, OR use `onItemClick`
|
|
124
|
+
- Last item (current page) → typically rendered non-clickable / different style
|
|
125
|
+
|
|
126
|
+
**When NOT to use Breadcrumb:**
|
|
127
|
+
- If hierarchy depth is always 1 level → use a back button instead
|
|
128
|
+
- If items are dynamic and represent tabs or steps → use a stepper or tabs component
|
|
129
|
+
|
|
130
|
+
## COMMON PATTERNS IN APPS
|
|
131
|
+
|
|
132
|
+
### Dynamic breadcrumb from route
|
|
133
|
+
```tsx
|
|
134
|
+
const routes = () => [
|
|
135
|
+
{ label: 'Home', href: '/' },
|
|
136
|
+
{ label: 'Products', href: '/products' },
|
|
137
|
+
{ label: currentProduct().name, href: null },
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
<Breadcrumb
|
|
141
|
+
items={routes().map(r =>
|
|
142
|
+
r.href
|
|
143
|
+
? <a href={r.href} class="hover:underline">{r.label}</a>
|
|
144
|
+
: <span>{r.label}</span>
|
|
145
|
+
)}
|
|
146
|
+
/>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### File path navigator
|
|
150
|
+
```tsx
|
|
151
|
+
const pathParts = () => currentPath().split('/').filter(Boolean);
|
|
152
|
+
|
|
153
|
+
<Breadcrumb
|
|
154
|
+
items={['Root', ...pathParts()]}
|
|
155
|
+
separate={<span class="mx-1 text-gray-400">/</span>}
|
|
156
|
+
onItemClick={(e) => navigateToSegment(e)}
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## ANTI-PATTERNS
|
|
161
|
+
```tsx
|
|
162
|
+
// ❌ Empty items array — renders nothing useful
|
|
163
|
+
<Breadcrumb items={[]} />
|
|
164
|
+
|
|
165
|
+
// ❌ Passing a separator that includes the chevron logic itself when default works fine
|
|
166
|
+
<Breadcrumb items={items} separate={<span>›</span>} /> // redundant if default style fits
|
|
167
|
+
|
|
168
|
+
// ✅ Use default separator when it fits the design system
|
|
169
|
+
<Breadcrumb items={items} />
|
|
170
|
+
```
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Component Conventions
|
|
174
|
+
|
|
175
|
+
> **CSS encoding**: internal CSS classes use short encoded names (e.g. `bc01`, `bc02`) per project convention.
|
|
176
|
+
|
|
177
|
+
> **Unique IDs**: if this component needs to generate HTML `id` attributes, always use `createUniqueId()` from `solid-js` — never `Math.random()` or `Date.now()`.
|