torch-glare 2.1.0 → 2.1.2
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/apps/lib/components/Badge.tsx +34 -137
- package/apps/lib/components/BadgeField.tsx +4 -4
- package/apps/lib/components/DataViews/ARCHITECTURE.md +439 -0
- package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +416 -0
- package/apps/lib/components/DataViews/DataViewsHeader.tsx +126 -0
- package/apps/lib/components/DataViews/DataViewsLayout.tsx +300 -0
- package/apps/lib/components/DataViews/FilterPanel.tsx +324 -0
- package/apps/lib/components/DataViews/InboxView.tsx +514 -0
- package/apps/lib/components/DataViews/KanbanView.tsx +242 -0
- package/apps/lib/components/DataViews/PanelControls.tsx +80 -0
- package/apps/lib/components/DataViews/SettingsPanel.tsx +285 -0
- package/apps/lib/components/DataViews/TableView.tsx +232 -0
- package/apps/lib/components/DataViews/TreeView.tsx +363 -0
- package/apps/lib/components/DataViews/badgeAdapter.ts +45 -0
- package/apps/lib/components/DataViews/fieldRenderers.tsx +334 -0
- package/apps/lib/components/DataViews/filters/DateRangePopover.tsx +113 -0
- package/apps/lib/components/DataViews/filters/PresetChips.tsx +45 -0
- package/apps/lib/components/DataViews/filters/RangeSliderWithInputs.tsx +154 -0
- package/apps/lib/components/DataViews/index.ts +30 -0
- package/apps/lib/components/DataViews/tree/TreeDrawer.tsx +54 -0
- package/apps/lib/components/DataViews/tree/TreeSidebar.tsx +77 -0
- package/apps/lib/components/DataViews/types.ts +177 -0
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +387 -0
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +80 -0
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +235 -0
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +60 -0
- package/apps/lib/components/TreeFolder/icons.tsx +63 -0
- package/apps/lib/components/TreeFolder/index.ts +17 -0
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +114 -0
- package/apps/lib/components/TreeFolder/types.ts +68 -0
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +261 -0
- package/apps/lib/hooks/useDataViewsState.ts +169 -0
- package/apps/lib/hooks/useIsMobile.ts +21 -0
- package/apps/lib/utils/dataViews/columnUtils.ts +130 -0
- package/apps/lib/utils/dataViews/fieldUtils.ts +198 -0
- package/apps/lib/utils/dataViews/nestedDataUtils.tsx +364 -0
- package/apps/lib/utils/dataViews/pathUtils.ts +132 -0
- package/apps/lib/utils/dataViews/rangeUtils.ts +225 -0
- package/apps/lib/utils/dataViews/treeUtils.ts +403 -0
- package/dist/bin/index.js +3 -3
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +29 -6
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +22 -2
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/copyComponentsRecursively.d.ts.map +1 -1
- package/dist/src/shared/copyComponentsRecursively.js +8 -1
- package/dist/src/shared/copyComponentsRecursively.js.map +1 -1
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.d.ts +18 -4
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.d.ts.map +1 -1
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js +110 -40
- package/dist/src/shared/getDependenciesAndInstallNestedComponents.js.map +1 -1
- package/docs/components/badge-field.md +21 -21
- package/docs/components/badge.md +156 -483
- package/docs/components/form-stepper.md +244 -0
- package/docs/components/stepper.md +215 -0
- package/docs/components/timeline.md +248 -0
- package/docs/reference/components.md +8 -7
- package/docs/reference/types.md +34 -26
- package/docs/tutorials/theming-basics.md +30 -27
- package/package.json +1 -1
- /package/docs/components/{labeled-checkbox.md → labeled-check-box.md} +0 -0
- /package/docs/components/{tree-dropdown.md → tree-drop-down.md} +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Timeline
|
|
3
|
+
description: Vertical or horizontal timeline for activity logs, audit trails, and history. Composed of indicator, separator, content, heading, and description parts with five semantic variants.
|
|
4
|
+
component: true
|
|
5
|
+
group: Data Display
|
|
6
|
+
keywords: [timeline, activity, history, audit, log, events, vertical, horizontal]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Timeline
|
|
10
|
+
|
|
11
|
+
A composable timeline for activity logs, change history, audit trails, and event sequences. Each item has an indicator, a connecting separator, and a content block. The indicator supports five variants — `default`, `active`, `completed`, `error`, `warning` — each with built-in icons and color tokens.
|
|
12
|
+
|
|
13
|
+
The component is composed of `Timeline`, `TimelineItem`, `TimelineIndicator`, `TimelineSeparator`, `TimelineConnector`, `TimelineContent`, `TimelineHeading`, and `TimelineDescription`. Unlike [`Stepper`](./stepper.md), Timeline doesn't track an `activeStep` — each item's variant is set explicitly.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx torch-glare@latest add Timeline
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Imports
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import {
|
|
25
|
+
Timeline,
|
|
26
|
+
TimelineItem,
|
|
27
|
+
TimelineIndicator,
|
|
28
|
+
TimelineSeparator,
|
|
29
|
+
TimelineConnector,
|
|
30
|
+
TimelineContent,
|
|
31
|
+
TimelineHeading,
|
|
32
|
+
TimelineDescription,
|
|
33
|
+
} from '@/components/Timeline'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Basic Usage
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import {
|
|
40
|
+
Timeline,
|
|
41
|
+
TimelineItem,
|
|
42
|
+
TimelineIndicator,
|
|
43
|
+
TimelineSeparator,
|
|
44
|
+
TimelineConnector,
|
|
45
|
+
TimelineContent,
|
|
46
|
+
TimelineHeading,
|
|
47
|
+
TimelineDescription,
|
|
48
|
+
} from '@/components/Timeline'
|
|
49
|
+
|
|
50
|
+
export function BasicTimeline() {
|
|
51
|
+
return (
|
|
52
|
+
<Timeline>
|
|
53
|
+
<TimelineItem>
|
|
54
|
+
<TimelineConnector>
|
|
55
|
+
<TimelineIndicator variant="completed" />
|
|
56
|
+
<TimelineSeparator />
|
|
57
|
+
</TimelineConnector>
|
|
58
|
+
<TimelineContent>
|
|
59
|
+
<TimelineHeading>Account created</TimelineHeading>
|
|
60
|
+
<TimelineDescription>March 5, 2026 · 9:14 AM</TimelineDescription>
|
|
61
|
+
</TimelineContent>
|
|
62
|
+
</TimelineItem>
|
|
63
|
+
|
|
64
|
+
<TimelineItem>
|
|
65
|
+
<TimelineConnector>
|
|
66
|
+
<TimelineIndicator variant="active" />
|
|
67
|
+
<TimelineSeparator active />
|
|
68
|
+
</TimelineConnector>
|
|
69
|
+
<TimelineContent>
|
|
70
|
+
<TimelineHeading>Email verified</TimelineHeading>
|
|
71
|
+
<TimelineDescription>March 5, 2026 · 9:32 AM</TimelineDescription>
|
|
72
|
+
</TimelineContent>
|
|
73
|
+
</TimelineItem>
|
|
74
|
+
|
|
75
|
+
<TimelineItem>
|
|
76
|
+
<TimelineConnector>
|
|
77
|
+
<TimelineIndicator variant="default" />
|
|
78
|
+
</TimelineConnector>
|
|
79
|
+
<TimelineContent>
|
|
80
|
+
<TimelineHeading>Profile setup</TimelineHeading>
|
|
81
|
+
<TimelineDescription>Pending</TimelineDescription>
|
|
82
|
+
</TimelineContent>
|
|
83
|
+
</TimelineItem>
|
|
84
|
+
</Timeline>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The last `TimelineItem` should typically omit `TimelineSeparator` so the line ends at the final indicator. `TimelineContent` auto-removes its bottom padding on the last item via `group-last/item:pb-0`.
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
|
|
93
|
+
### Indicator variants
|
|
94
|
+
|
|
95
|
+
`completed` renders a check icon, `error` renders a close icon, `warning` renders an alert icon. `default` and `active` render a `6×6` filled dot. Pass `icon` or `children` to override.
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<TimelineIndicator variant="default" />
|
|
99
|
+
<TimelineIndicator variant="active" />
|
|
100
|
+
<TimelineIndicator variant="completed" />
|
|
101
|
+
<TimelineIndicator variant="error" />
|
|
102
|
+
<TimelineIndicator variant="warning" />
|
|
103
|
+
<TimelineIndicator variant="active" icon={<i className="ri-flashlight-line" />} />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Sizes
|
|
107
|
+
|
|
108
|
+
Indicators support `S` (`22px`), `M` (`28px`, default), and `L` (`34px`).
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<TimelineIndicator size="S" variant="completed" />
|
|
112
|
+
<TimelineIndicator size="M" variant="completed" />
|
|
113
|
+
<TimelineIndicator size="L" variant="completed" />
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Horizontal orientation
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
<Timeline orientation="horizontal">
|
|
120
|
+
<TimelineItem>
|
|
121
|
+
<TimelineConnector orientation="horizontal">
|
|
122
|
+
<TimelineIndicator variant="completed" />
|
|
123
|
+
<TimelineSeparator orientation="horizontal" active />
|
|
124
|
+
</TimelineConnector>
|
|
125
|
+
<TimelineContent>
|
|
126
|
+
<TimelineHeading>Submitted</TimelineHeading>
|
|
127
|
+
<TimelineDescription>2:14 PM</TimelineDescription>
|
|
128
|
+
</TimelineContent>
|
|
129
|
+
</TimelineItem>
|
|
130
|
+
|
|
131
|
+
<TimelineItem>
|
|
132
|
+
<TimelineConnector orientation="horizontal">
|
|
133
|
+
<TimelineIndicator variant="active" />
|
|
134
|
+
</TimelineConnector>
|
|
135
|
+
<TimelineContent>
|
|
136
|
+
<TimelineHeading>Reviewing</TimelineHeading>
|
|
137
|
+
<TimelineDescription>Now</TimelineDescription>
|
|
138
|
+
</TimelineContent>
|
|
139
|
+
</TimelineItem>
|
|
140
|
+
</Timeline>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Pass `orientation="horizontal"` on `Timeline`, `TimelineItem`, `TimelineConnector`, and `TimelineSeparator` — the orientation isn't propagated through context.
|
|
144
|
+
|
|
145
|
+
### Activity log
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const events = [
|
|
149
|
+
{ id: 1, variant: 'completed', heading: 'Order placed', when: 'Mar 5 · 9:14 AM' },
|
|
150
|
+
{ id: 2, variant: 'completed', heading: 'Payment received', when: 'Mar 5 · 9:15 AM' },
|
|
151
|
+
{ id: 3, variant: 'active', heading: 'Preparing order', when: 'Mar 5 · 10:02 AM' },
|
|
152
|
+
{ id: 4, variant: 'default', heading: 'Shipped', when: 'Pending' },
|
|
153
|
+
{ id: 5, variant: 'default', heading: 'Delivered', when: 'Pending' },
|
|
154
|
+
] as const
|
|
155
|
+
|
|
156
|
+
export function OrderTimeline() {
|
|
157
|
+
return (
|
|
158
|
+
<Timeline>
|
|
159
|
+
{events.map((e, i) => (
|
|
160
|
+
<TimelineItem key={e.id}>
|
|
161
|
+
<TimelineConnector>
|
|
162
|
+
<TimelineIndicator variant={e.variant} />
|
|
163
|
+
{i < events.length - 1 && (
|
|
164
|
+
<TimelineSeparator active={e.variant === 'completed' || e.variant === 'active'} />
|
|
165
|
+
)}
|
|
166
|
+
</TimelineConnector>
|
|
167
|
+
<TimelineContent>
|
|
168
|
+
<TimelineHeading>{e.heading}</TimelineHeading>
|
|
169
|
+
<TimelineDescription>{e.when}</TimelineDescription>
|
|
170
|
+
</TimelineContent>
|
|
171
|
+
</TimelineItem>
|
|
172
|
+
))}
|
|
173
|
+
</Timeline>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## API Reference
|
|
179
|
+
|
|
180
|
+
### Timeline
|
|
181
|
+
|
|
182
|
+
| Prop | Type | Default | Description |
|
|
183
|
+
| ------------- | ------------------------------- | ------------ | ---------------------------------------- |
|
|
184
|
+
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction. |
|
|
185
|
+
| `theme` | `'dark' \| 'light' \| 'default'` | — | Theme override applied via `data-theme`. |
|
|
186
|
+
|
|
187
|
+
### TimelineItem
|
|
188
|
+
|
|
189
|
+
| Prop | Type | Default | Description |
|
|
190
|
+
| ------------- | ---------------------------- | ------------ | ---------------------------------------------- |
|
|
191
|
+
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` | Should match the parent `Timeline`. |
|
|
192
|
+
|
|
193
|
+
### TimelineIndicator
|
|
194
|
+
|
|
195
|
+
| Prop | Type | Default | Description |
|
|
196
|
+
| --------- | --------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
|
197
|
+
| `variant` | `'default' \| 'active' \| 'completed' \| 'error' \| 'warning'` | `'default'` | Visual state. Drives both color tokens and the auto-rendered icon. |
|
|
198
|
+
| `size` | `'S' \| 'M' \| 'L'` | `'M'` | Indicator diameter (`22 / 28 / 34px`). |
|
|
199
|
+
| `icon` | `ReactNode` | — | Custom icon — overrides the variant's default. |
|
|
200
|
+
| `children`| `ReactNode` | — | Custom content — used when `icon` is not set. |
|
|
201
|
+
|
|
202
|
+
### TimelineSeparator
|
|
203
|
+
|
|
204
|
+
| Prop | Type | Default | Description |
|
|
205
|
+
| ------------- | ---------------------------- | ------------ | ---------------------------------------------------------- |
|
|
206
|
+
| `orientation` | `'vertical' \| 'horizontal'` | `'vertical'` | Line direction. |
|
|
207
|
+
| `active` | `boolean` | `false` | Render the line in focus blue (use after completed steps). |
|
|
208
|
+
|
|
209
|
+
### TimelineConnector
|
|
210
|
+
|
|
211
|
+
Wraps the indicator and separator. Pass `orientation` to switch between column (vertical) and row (horizontal) layout.
|
|
212
|
+
|
|
213
|
+
### TimelineContent / TimelineHeading / TimelineDescription
|
|
214
|
+
|
|
215
|
+
Forward `HTMLAttributes<HTMLDivElement>`. `TimelineContent` removes its bottom padding on the last item; `TimelineHeading` uses `typography-body-medium-medium`; `TimelineDescription` uses `typography-body-small-regular` with secondary text color.
|
|
216
|
+
|
|
217
|
+
## Styling
|
|
218
|
+
|
|
219
|
+
- Indicators use the standard state token set: `state-information-primary`, `state-success-primary`, `state-negative-primary`, `state-warning-primary`.
|
|
220
|
+
- Separator: `1px` neutral line by default, focus-blue when `active`.
|
|
221
|
+
- Vertical content: `pb-6 pt-[2px]` — gives breathing room between items.
|
|
222
|
+
- Horizontal content: aligned under the indicator with `gap-3`.
|
|
223
|
+
|
|
224
|
+
## TypeScript Types
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
import type { VariantProps } from 'class-variance-authority'
|
|
228
|
+
import type { timelineStyles, indicatorStyles, separatorStyles } from '@/components/Timeline'
|
|
229
|
+
|
|
230
|
+
type TimelineVariants = VariantProps<typeof timelineStyles>
|
|
231
|
+
type IndicatorVariants = VariantProps<typeof indicatorStyles>
|
|
232
|
+
// { variant?: 'default' | 'active' | 'completed' | 'error' | 'warning'; size?: 'S' | 'M' | 'L' }
|
|
233
|
+
type SeparatorVariants = VariantProps<typeof separatorStyles>
|
|
234
|
+
// { orientation?: 'vertical' | 'horizontal'; active?: boolean }
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Accessibility
|
|
238
|
+
|
|
239
|
+
- Use `<ol>` semantics when the order matters (audit logs, order tracking) — wrap `Timeline` in `<ol>` and each `TimelineItem` in `<li>`.
|
|
240
|
+
- Variants like `error` and `warning` should be paired with text in `TimelineDescription` — color is never the sole signal.
|
|
241
|
+
- Decorative icons inside indicators don't need labels; the heading carries the meaning.
|
|
242
|
+
|
|
243
|
+
## Best Practices
|
|
244
|
+
|
|
245
|
+
1. Reach for Timeline when items are events at points in time. Reach for Stepper when items are tasks the user has to complete.
|
|
246
|
+
2. Always omit `TimelineSeparator` on the last item so the line doesn't dangle.
|
|
247
|
+
3. Use `active` on the separator after a `completed` indicator to color the connecting segment blue — it visually links progress.
|
|
248
|
+
4. Cap visible items at 5–7 in vertical mode; collapse the rest behind a "show earlier" affordance for long histories.
|
|
@@ -257,17 +257,18 @@ Grouped action buttons.
|
|
|
257
257
|
Small status or label indicator.
|
|
258
258
|
|
|
259
259
|
- **File**: [badge.md](../components/badge.md)
|
|
260
|
-
- **Props**: `
|
|
261
|
-
- **
|
|
262
|
-
- **
|
|
260
|
+
- **Props**: `badgeStyle`, `color`, `size`, `label`, `badgeIcon`, `showIcon`, `isClosable`, `onClose`, `theme`
|
|
261
|
+
- **Styles**: `subtle` (default), `solid`
|
|
262
|
+
- **Colors**: 10 — `gray`, `slate`, `red`, `orange`, `yellow`, `green`, `ocean`, `blue`, `purple`, `rose`
|
|
263
|
+
- **Use Cases**: Status indicators, labels, removable tags/chips
|
|
263
264
|
|
|
264
265
|
### BadgeField
|
|
265
|
-
|
|
266
|
+
Tag input that renders selected items as Badges.
|
|
266
267
|
|
|
267
268
|
- **File**: [badge-field.md](../components/badge-field.md)
|
|
268
|
-
- **Props**: `
|
|
269
|
-
- **Features**:
|
|
270
|
-
- **Use Cases**:
|
|
269
|
+
- **Props**: `tags`, `size`, `variant`, `label`, `onChange`
|
|
270
|
+
- **Features**: Multi-select with search, keyboard navigation, removable chips
|
|
271
|
+
- **Use Cases**: Tag pickers, multi-select fields
|
|
271
272
|
|
|
272
273
|
### CountBadge
|
|
273
274
|
Badge displaying a count.
|
package/docs/reference/types.md
CHANGED
|
@@ -381,42 +381,50 @@ interface TreeSubLayoutProps {
|
|
|
381
381
|
|
|
382
382
|
### Badge Types
|
|
383
383
|
|
|
384
|
-
####
|
|
384
|
+
#### BadgeStyle
|
|
385
385
|
|
|
386
386
|
```typescript
|
|
387
|
-
type
|
|
388
|
-
| "PrimeStyle"
|
|
389
|
-
| "SecondStyle"
|
|
390
|
-
| "ContStyle"
|
|
391
|
-
| "BorderStyle";
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
#### BadgeProps
|
|
395
|
-
|
|
396
|
-
```typescript
|
|
397
|
-
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
398
|
-
variant?: BadgeVariant;
|
|
399
|
-
theme?: Themes;
|
|
400
|
-
children: React.ReactNode;
|
|
401
|
-
}
|
|
387
|
+
type BadgeStyle = "subtle" | "solid";
|
|
402
388
|
```
|
|
403
389
|
|
|
404
390
|
#### BadgeColor
|
|
405
391
|
|
|
406
392
|
```typescript
|
|
407
393
|
type BadgeColor =
|
|
408
|
-
| "
|
|
409
|
-
| "
|
|
410
|
-
| "cocktail-green"
|
|
411
|
-
| "yellow"
|
|
412
|
-
| "red-orange"
|
|
394
|
+
| "gray"
|
|
395
|
+
| "slate"
|
|
413
396
|
| "red"
|
|
414
|
-
| "
|
|
415
|
-
| "
|
|
416
|
-
| "
|
|
397
|
+
| "orange"
|
|
398
|
+
| "yellow"
|
|
399
|
+
| "green"
|
|
400
|
+
| "ocean"
|
|
417
401
|
| "blue"
|
|
418
|
-
| "
|
|
419
|
-
| "
|
|
402
|
+
| "purple"
|
|
403
|
+
| "rose";
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
#### BadgeSize
|
|
407
|
+
|
|
408
|
+
```typescript
|
|
409
|
+
type BadgeSize = "XS" | "S" | "M";
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### BadgeProps
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
interface BadgeProps
|
|
416
|
+
extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
417
|
+
label?: string;
|
|
418
|
+
badgeStyle?: BadgeStyle; // default: "subtle"
|
|
419
|
+
color?: BadgeColor; // default: "gray"
|
|
420
|
+
size?: BadgeSize; // default: "S"
|
|
421
|
+
showIcon?: boolean; // default: true
|
|
422
|
+
badgeIcon?: React.ReactNode;
|
|
423
|
+
isClosable?: boolean;
|
|
424
|
+
onClose?: () => void;
|
|
425
|
+
theme?: Themes;
|
|
426
|
+
className?: string;
|
|
427
|
+
}
|
|
420
428
|
```
|
|
421
429
|
|
|
422
430
|
### Avatar Types
|
|
@@ -354,46 +354,49 @@ function BorderColorExamples() {
|
|
|
354
354
|
|
|
355
355
|
## Step 6: Badge Color System
|
|
356
356
|
|
|
357
|
-
TORCH Glare provides
|
|
357
|
+
TORCH Glare provides 10 badge colors, each with `subtle` and `solid` background tokens:
|
|
358
358
|
|
|
359
359
|
```tsx
|
|
360
|
+
import { Badge } from '@/components/Badge';
|
|
361
|
+
|
|
360
362
|
function BadgeColors() {
|
|
361
363
|
const colors = [
|
|
362
|
-
'
|
|
363
|
-
'
|
|
364
|
-
'cocktail-green',
|
|
365
|
-
'yellow',
|
|
366
|
-
'red-orange',
|
|
364
|
+
'gray',
|
|
365
|
+
'slate',
|
|
367
366
|
'red',
|
|
368
|
-
'
|
|
369
|
-
'
|
|
370
|
-
'
|
|
367
|
+
'orange',
|
|
368
|
+
'yellow',
|
|
369
|
+
'green',
|
|
370
|
+
'ocean',
|
|
371
371
|
'blue',
|
|
372
|
-
'
|
|
373
|
-
'
|
|
374
|
-
];
|
|
372
|
+
'purple',
|
|
373
|
+
'rose',
|
|
374
|
+
] as const;
|
|
375
375
|
|
|
376
376
|
return (
|
|
377
|
-
<div className="flex flex-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
key={color}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
>
|
|
389
|
-
{color}
|
|
390
|
-
</span>
|
|
391
|
-
))}
|
|
377
|
+
<div className="flex flex-col gap-3">
|
|
378
|
+
<div className="flex flex-wrap gap-2">
|
|
379
|
+
{colors.map((color) => (
|
|
380
|
+
<Badge key={color} color={color} badgeStyle="subtle" label={color} />
|
|
381
|
+
))}
|
|
382
|
+
</div>
|
|
383
|
+
<div className="flex flex-wrap gap-2">
|
|
384
|
+
{colors.map((color) => (
|
|
385
|
+
<Badge key={color} color={color} badgeStyle="solid" label={color} />
|
|
386
|
+
))}
|
|
387
|
+
</div>
|
|
392
388
|
</div>
|
|
393
389
|
);
|
|
394
390
|
}
|
|
395
391
|
```
|
|
396
392
|
|
|
393
|
+
The underlying CSS variables follow this pattern:
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
--background-presentation-badge-{color}-subtle
|
|
397
|
+
--background-presentation-badge-{color}-solid
|
|
398
|
+
```
|
|
399
|
+
|
|
397
400
|
---
|
|
398
401
|
|
|
399
402
|
## Step 7: Create a Complete Themed Component
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|