minka-ds 0.2.3 → 0.2.4
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 +1 -1
- package/src/components/ui/cell.tsx +37 -1
package/package.json
CHANGED
|
@@ -95,11 +95,47 @@ function ActionCell({ children, className }: ActionCellProps) {
|
|
|
95
95
|
)
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
// ── StatusCell ────────────────────────────────────────────────────────────────
|
|
99
|
+
// Dot + label status indicator. Use instead of badges for table status columns.
|
|
100
|
+
|
|
101
|
+
type StatusCellVariant = "success" | "warning" | "error" | "neutral"
|
|
102
|
+
|
|
103
|
+
interface StatusCellProps {
|
|
104
|
+
variant: StatusCellVariant
|
|
105
|
+
children: React.ReactNode
|
|
106
|
+
className?: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const STATUS_DOT: Record<StatusCellVariant, string> = {
|
|
110
|
+
success: "bg-[var(--primitive-green-500)]",
|
|
111
|
+
warning: "bg-[var(--primitive-yellow-300)]",
|
|
112
|
+
error: "bg-[var(--primitive-red-500)]",
|
|
113
|
+
neutral: "bg-[var(--color-text-disabled)]",
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const STATUS_TEXT: Record<StatusCellVariant, string> = {
|
|
117
|
+
success: "text-[var(--primitive-green-700)]",
|
|
118
|
+
warning: "text-[var(--color-text-default)]",
|
|
119
|
+
error: "text-[var(--color-text-default)]",
|
|
120
|
+
neutral: "text-[var(--color-text-disabled)]",
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function StatusCell({ variant, children, className }: StatusCellProps) {
|
|
124
|
+
return (
|
|
125
|
+
<span className={cn("inline-flex items-center gap-1.5 text-body-sm", STATUS_TEXT[variant], className)}>
|
|
126
|
+
<span className={cn("size-1.5 rounded-full shrink-0", STATUS_DOT[variant])} />
|
|
127
|
+
{children}
|
|
128
|
+
</span>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { TextStack, DataCell, AmountCell, BadgeCell, ActionCell, StatusCell }
|
|
99
133
|
export type {
|
|
100
134
|
TextStackProps,
|
|
101
135
|
DataCellProps,
|
|
102
136
|
AmountCellProps,
|
|
103
137
|
BadgeCellProps,
|
|
104
138
|
ActionCellProps,
|
|
139
|
+
StatusCellProps,
|
|
140
|
+
StatusCellVariant,
|
|
105
141
|
}
|