@org-design-system/components 0.1.9 → 0.1.10
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/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/badge.tsx +27 -7
- package/dist/index.css +0 -30
package/src/components/badge.tsx
CHANGED
|
@@ -16,6 +16,7 @@ const badgeVariants = cva(
|
|
|
16
16
|
},
|
|
17
17
|
intent: {
|
|
18
18
|
primary: "",
|
|
19
|
+
accent: "", // Alias for primary to match Figma
|
|
19
20
|
success: "",
|
|
20
21
|
warning: "",
|
|
21
22
|
error: "",
|
|
@@ -23,17 +24,30 @@ const badgeVariants = cva(
|
|
|
23
24
|
neutral: "",
|
|
24
25
|
},
|
|
25
26
|
size: {
|
|
26
|
-
sm: "h-5 px-1 py-0.5 text-[10px] min-w-[20px]
|
|
27
|
-
md: "h-6 px-1.5 py-1 text-[12px] min-w-[24px]
|
|
28
|
-
lg: "h-6 px-1.5 py-1 text-[13px] min-w-[24px]
|
|
27
|
+
sm: "h-5 px-1 py-0.5 text-[10px] min-w-[20px]",
|
|
28
|
+
md: "h-6 px-1.5 py-1 text-[12px] min-w-[24px]",
|
|
29
|
+
lg: "h-6 px-1.5 py-1 text-[13px] min-w-[24px]",
|
|
30
|
+
},
|
|
31
|
+
radius: {
|
|
32
|
+
none: "rounded-none",
|
|
33
|
+
sm: "rounded-[4px]",
|
|
34
|
+
md: "rounded-[6px]",
|
|
35
|
+
lg: "rounded-[8px]",
|
|
36
|
+
xl: "rounded-[8px]",
|
|
37
|
+
full: "rounded-full",
|
|
29
38
|
},
|
|
30
39
|
},
|
|
31
40
|
compoundVariants: [
|
|
32
|
-
// Primary (
|
|
41
|
+
// Accent/Primary (Green in Figma)
|
|
33
42
|
{ variant: "solid", intent: "primary", className: "bg-[var(--color-surface-focus)] text-[var(--color-text-focus-subtle)]" },
|
|
34
43
|
{ variant: "soft", intent: "primary", className: "bg-[var(--color-surface-selected)] text-[var(--color-text-focus)]" },
|
|
35
44
|
{ variant: "surface", intent: "primary", className: "bg-[var(--color-surface-selected)] border-[var(--color-stroke-selected)] text-[var(--color-text-focus)]" },
|
|
36
45
|
{ variant: "outline", intent: "primary", className: "border-[var(--color-stroke-selected)] text-[var(--color-text-focus)]" },
|
|
46
|
+
|
|
47
|
+
{ variant: "solid", intent: "accent", className: "bg-[var(--color-green-9)] text-white" },
|
|
48
|
+
{ variant: "soft", intent: "accent", className: "bg-[var(--color-green-alpha-2)] text-[var(--color-green-11)]" },
|
|
49
|
+
{ variant: "surface", intent: "accent", className: "bg-[var(--color-green-alpha-2)] border-[var(--color-green-alpha-4)] text-[var(--color-green-11)]" },
|
|
50
|
+
{ variant: "outline", intent: "accent", className: "border-[var(--color-green-alpha-4)] text-[var(--color-green-11)]" },
|
|
37
51
|
// Success
|
|
38
52
|
{ variant: "solid", intent: "success", className: "bg-[var(--color-surface-success)] text-white" },
|
|
39
53
|
{ variant: "soft", intent: "success", className: "bg-[var(--color-green-alpha-2)] text-[var(--color-text-selected)]" },
|
|
@@ -64,13 +78,14 @@ const badgeVariants = cva(
|
|
|
64
78
|
variant: "soft",
|
|
65
79
|
intent: "neutral",
|
|
66
80
|
size: "md",
|
|
81
|
+
radius: "md",
|
|
67
82
|
},
|
|
68
83
|
}
|
|
69
84
|
)
|
|
70
85
|
|
|
71
86
|
interface BadgeProps
|
|
72
87
|
extends React.ComponentProps<"span">,
|
|
73
|
-
|
|
88
|
+
VariantProps<typeof badgeVariants> {
|
|
74
89
|
asChild?: boolean
|
|
75
90
|
}
|
|
76
91
|
|
|
@@ -78,6 +93,7 @@ function Badge({
|
|
|
78
93
|
className,
|
|
79
94
|
variant,
|
|
80
95
|
intent,
|
|
96
|
+
radius,
|
|
81
97
|
size,
|
|
82
98
|
asChild = false,
|
|
83
99
|
...props
|
|
@@ -87,10 +103,14 @@ function Badge({
|
|
|
87
103
|
return (
|
|
88
104
|
<Comp
|
|
89
105
|
data-slot="badge"
|
|
90
|
-
|
|
106
|
+
data-variant={variant}
|
|
107
|
+
data-intent={intent}
|
|
108
|
+
data-size={size}
|
|
109
|
+
data-radius={radius}
|
|
110
|
+
className={cn(badgeVariants({ variant, intent, size, radius }), className)}
|
|
91
111
|
{...props}
|
|
92
112
|
/>
|
|
93
113
|
)
|
|
94
114
|
}
|
|
95
115
|
|
|
96
|
-
export { Badge, badgeVariants }
|
|
116
|
+
export { Badge, badgeVariants }
|
package/dist/index.css
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@import "@org-design-system/styles/index.css";
|
|
3
|
-
@import "@org-design-system/styles/component.css";
|
|
4
|
-
|
|
5
|
-
@source "./components/**/*.tsx";
|
|
6
|
-
|
|
7
|
-
@theme {
|
|
8
|
-
/* Mapping for shadcn components that expect these variables */
|
|
9
|
-
--color-background: var(--color-surface-bg);
|
|
10
|
-
--color-foreground: var(--color-text-primary);
|
|
11
|
-
|
|
12
|
-
--color-primary: var(--color-green-9);
|
|
13
|
-
--color-primary-foreground: var(--color-gray-1);
|
|
14
|
-
|
|
15
|
-
--color-secondary: var(--color-gray-alpha-3);
|
|
16
|
-
--color-secondary-foreground: var(--color-text-primary);
|
|
17
|
-
|
|
18
|
-
--color-muted: var(--color-gray-alpha-2);
|
|
19
|
-
--color-muted-foreground: var(--color-text-secondary);
|
|
20
|
-
|
|
21
|
-
--color-accent: var(--color-green-alpha-2);
|
|
22
|
-
--color-accent-foreground: var(--color-text-focus);
|
|
23
|
-
|
|
24
|
-
--color-destructive: var(--color-red-9);
|
|
25
|
-
--color-destructive-foreground: var(--color-gray-1);
|
|
26
|
-
|
|
27
|
-
--color-border: var(--color-stroke-primary);
|
|
28
|
-
--color-input: var(--color-stroke-primary);
|
|
29
|
-
--color-ring: var(--color-surface-focus);
|
|
30
|
-
}
|