torch-glare 2.1.0 → 2.1.1
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 +2 -2
- package/apps/lib/components/Charts-dev.tsx +365 -0
- package/apps/lib/components/Command-dev.tsx +151 -0
- package/apps/lib/components/IosDatePicker-dev.tsx +341 -0
- package/dist/bin/index.js +0 -0
- package/docs/components/badge-field.md +21 -21
- package/docs/components/badge.md +156 -483
- 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 +6 -6
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "torch-glare",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "tsc -b",
|
|
20
|
-
"deploy": "npx tsc --build --force && npm publish --access public"
|
|
21
|
-
},
|
|
22
18
|
"dependencies": {
|
|
23
19
|
"commander": "^13.1.0",
|
|
24
20
|
"inquirer": "^9.2.15"
|
|
@@ -27,5 +23,9 @@
|
|
|
27
23
|
"@types/inquirer": "^9.0.7",
|
|
28
24
|
"@types/node": "^22.14.0",
|
|
29
25
|
"typescript": "^5.0.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -b",
|
|
29
|
+
"deploy": "npx tsc --build --force && npm publish --access public"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|