torch-glare 2.0.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.
@@ -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**: `variant`, `size`, `theme`
261
- - **Variants**: 12 color variants (green, blue, red, purple, etc.)
262
- - **Use Cases**: Status indicators, labels, tags
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
- Badge with label field.
266
+ Tag input that renders selected items as Badges.
266
267
 
267
268
  - **File**: [badge-field.md](../components/badge-field.md)
268
- - **Props**: `label`, `value`, `variant`
269
- - **Features**: Label + badge combination
270
- - **Use Cases**: Status fields, labeled indicators
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.
@@ -381,42 +381,50 @@ interface TreeSubLayoutProps {
381
381
 
382
382
  ### Badge Types
383
383
 
384
- #### BadgeVariant
384
+ #### BadgeStyle
385
385
 
386
386
  ```typescript
387
- type BadgeVariant =
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
- | "green"
409
- | "green-light"
410
- | "cocktail-green"
411
- | "yellow"
412
- | "red-orange"
394
+ | "gray"
395
+ | "slate"
413
396
  | "red"
414
- | "rose"
415
- | "purple"
416
- | "blue-purple"
397
+ | "orange"
398
+ | "yellow"
399
+ | "green"
400
+ | "ocean"
417
401
  | "blue"
418
- | "navy"
419
- | "gray";
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 12 badge color variants:
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
- 'green',
363
- 'green-light',
364
- 'cocktail-green',
365
- 'yellow',
366
- 'red-orange',
364
+ 'gray',
365
+ 'slate',
367
366
  'red',
368
- 'rose',
369
- 'purple',
370
- 'blue-purple',
367
+ 'orange',
368
+ 'yellow',
369
+ 'green',
370
+ 'ocean',
371
371
  'blue',
372
- 'navy',
373
- 'gray',
374
- ];
372
+ 'purple',
373
+ 'rose',
374
+ ] as const;
375
375
 
376
376
  return (
377
- <div className="flex flex-wrap gap-2">
378
- {colors.map((color) => (
379
- <span
380
- key={color}
381
- className={`
382
- px-3 py-1 rounded
383
- bg-background-presentation-badge-${color}
384
- text-content-presentation-badge-${color}
385
- border border-border-presentation-badge-${color}
386
- typography-labels-small-semibold
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.0.0",
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
+ }