@dilipod/ui 0.2.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilipod/ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Dilipod Design System - Shared UI components and styles",
5
5
  "author": "Dilipod <hello@dilipod.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,11 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@phosphor-icons/react": "^2.1.7",
64
+ "@radix-ui/react-accordion": "^1.2.12",
64
65
  "@radix-ui/react-dialog": "^1.1.14",
66
+ "@radix-ui/react-label": "^2.1.8",
67
+ "@radix-ui/react-navigation-menu": "^1.2.14",
68
+ "@radix-ui/react-separator": "^1.1.8",
65
69
  "@radix-ui/react-slot": "^1.2.3",
66
70
  "class-variance-authority": "^0.7.1",
67
71
  "clsx": "^2.1.1",
@@ -40,19 +40,21 @@ export interface BadgeProps
40
40
 
41
41
  const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
42
42
  ({ className, variant, size, pulse, pulseColor: pulseColorProp, children, ...props }, ref) => {
43
- const pulseColorMap = {
44
- default: 'bg-gray-500',
45
- primary: 'bg-[var(--cyan)]',
46
- success: 'bg-green-500',
47
- warning: 'bg-amber-500',
48
- error: 'bg-red-500',
49
- outline: 'bg-gray-400',
43
+ // Get pulse color based on variant or explicit pulseColor prop
44
+ // Using explicit conditionals so Tailwind can detect the classes
45
+ const getPulseColorClass = () => {
46
+ const color = pulseColorProp || variant || 'default'
47
+ switch (color) {
48
+ case 'success': return 'bg-green-500'
49
+ case 'warning': return 'bg-amber-500'
50
+ case 'error': return 'bg-red-500'
51
+ case 'primary': return 'bg-[var(--cyan)]'
52
+ case 'outline': return 'bg-gray-400'
53
+ default: return 'bg-gray-500'
54
+ }
50
55
  }
51
56
 
52
- // Use custom pulseColor if provided, otherwise derive from variant
53
- const pulseColor = pulseColorProp
54
- ? pulseColorMap[pulseColorProp]
55
- : pulseColorMap[variant || 'default']
57
+ const pulseColorClass = getPulseColorClass()
56
58
 
57
59
  return (
58
60
  <span
@@ -65,13 +67,13 @@ const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
65
67
  <span
66
68
  className={cn(
67
69
  'absolute inline-flex h-full w-full animate-ping rounded-full opacity-75',
68
- pulseColor
70
+ pulseColorClass
69
71
  )}
70
72
  />
71
73
  <span
72
74
  className={cn(
73
75
  'relative inline-flex h-1.5 w-1.5 rounded-full',
74
- pulseColor
76
+ pulseColorClass
75
77
  )}
76
78
  />
77
79
  </span>