@brightweblabs/ui 1.4.4 → 1.4.5
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 +2 -2
- package/src/components/alert-dialog.tsx +1 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/button-variants.ts +6 -5
- package/src/components/chart.tsx +1 -1
- package/src/components/kpi-breakdown-bar.tsx +2 -2
- package/src/components/phone-input.tsx +1 -1
- package/src/components/stat-tile.tsx +3 -3
- package/src/components/table-pagination.tsx +9 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightweblabs/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.5",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
7
7
|
"files": [
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"recharts": "^2.15.4",
|
|
77
77
|
"sonner": "^2.0.7",
|
|
78
78
|
"tailwind-merge": "^3.6.0",
|
|
79
|
-
"@brightweblabs/theme": "0.7.
|
|
79
|
+
"@brightweblabs/theme": "0.7.3"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"lucide-react": "^1.8.0",
|
|
@@ -84,7 +84,7 @@ function AlertDialogTitle({
|
|
|
84
84
|
return (
|
|
85
85
|
<AlertDialogPrimitive.Title
|
|
86
86
|
data-slot="alert-dialog-title"
|
|
87
|
-
className={cn("text-
|
|
87
|
+
className={cn("text-heading-4 text-foreground", className)}
|
|
88
88
|
{...props}
|
|
89
89
|
/>
|
|
90
90
|
)
|
|
@@ -69,7 +69,7 @@ function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">)
|
|
|
69
69
|
<div
|
|
70
70
|
data-slot="avatar-group-count"
|
|
71
71
|
className={cn(
|
|
72
|
-
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-body text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
72
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-data text-[length:var(--text-body)] leading-[var(--type-leading-normal)] text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
73
73
|
className,
|
|
74
74
|
)}
|
|
75
75
|
{...props}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
2
|
|
|
3
3
|
const buttonVariants = cva(
|
|
4
|
-
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-control)] text-body !font-
|
|
4
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-control)] text-body text-[length:var(--text-ui-action)] !font-extrabold transition-[color,background-color,border-color,box-shadow,transform,filter,text-decoration-color] motion-reduce:transition-none outline-none disabled:pointer-events-none disabled:opacity-50 focus-visible:border-current focus-visible:ring-[3px] focus-visible:ring-current aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[var(--toolbar-icon-size)]",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
default:
|
|
8
|
+
default:
|
|
9
|
+
"border border-transparent bg-[color:var(--surface-button-brand)] text-[color:var(--foreground-button-brand)] hover:brightness-[1.05]",
|
|
9
10
|
accent:
|
|
10
11
|
"relative isolate h-auto overflow-hidden !rounded-none px-0 py-0 font-display !font-bold text-body leading-[var(--type-leading-160)] text-foreground [padding:var(--space-button-y)_var(--space-button-x)] hover:text-foreground focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-current focus-visible:ring-offset-2",
|
|
11
12
|
accentLink:
|
|
@@ -13,17 +14,17 @@ const buttonVariants = cva(
|
|
|
13
14
|
destructive:
|
|
14
15
|
"bg-destructive text-destructive-foreground hover:brightness-[1.05]",
|
|
15
16
|
brand:
|
|
16
|
-
"bg-[color:var(--surface-button-brand)] !text-[color:var(--foreground-button-brand)]
|
|
17
|
+
"border border-transparent bg-[color:var(--surface-button-brand)] !text-[color:var(--foreground-button-brand)] hover:brightness-[1.05]",
|
|
17
18
|
soft:
|
|
18
19
|
"border border-[color:var(--border)] bg-[color:var(--surface-button-soft)] text-foreground hover:border-[color:var(--border-button-soft-hover)] hover:bg-[color:var(--surface-button-soft-hover)]",
|
|
19
20
|
outline:
|
|
20
|
-
"border
|
|
21
|
+
"border border-[color:var(--hairline-strong)] bg-[color:var(--elevate-1)] text-foreground hover:border-[color:var(--border-strong)] hover:bg-[color:var(--surface-hover)] hover:text-foreground",
|
|
21
22
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
22
23
|
ghost: "hover:bg-[color:var(--surface-button-soft-hover)] hover:text-foreground",
|
|
23
24
|
link: "text-foreground underline-offset-4 transition-colors hover:text-primary hover:underline",
|
|
24
25
|
},
|
|
25
26
|
size: {
|
|
26
|
-
default: "h-9 px-
|
|
27
|
+
default: "h-9 px-3 py-2",
|
|
27
28
|
xs: "h-6 gap-1 rounded-[var(--radius-control)] px-2 text-meta has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
28
29
|
sm: "h-8 gap-1.5 rounded-[var(--radius-control)] px-3 has-[>svg]:px-2.5",
|
|
29
30
|
lg: "h-10 rounded-[var(--radius-control)] px-6 has-[>svg]:px-4",
|
package/src/components/chart.tsx
CHANGED
|
@@ -259,7 +259,7 @@ function ChartTooltipContent({
|
|
|
259
259
|
</span>
|
|
260
260
|
</div>
|
|
261
261
|
{item.value && (
|
|
262
|
-
<span className="
|
|
262
|
+
<span className="text-data font-semibold text-foreground">
|
|
263
263
|
{item.value.toLocaleString()}
|
|
264
264
|
</span>
|
|
265
265
|
)}
|
|
@@ -44,7 +44,7 @@ export function KpiBreakdownBar({ items, toneTokens, className }: KpiBreakdownBa
|
|
|
44
44
|
<span className="flex items-center gap-2">
|
|
45
45
|
<span className="size-2 rounded-[var(--radius-swatch)]" style={tokenStyle(token)} />
|
|
46
46
|
<span>{item.label}</span>
|
|
47
|
-
<span className="font-bold
|
|
47
|
+
<span className="text-data font-bold">{item.value}</span>
|
|
48
48
|
</span>
|
|
49
49
|
</TooltipContent>
|
|
50
50
|
</Tooltip>
|
|
@@ -61,7 +61,7 @@ export function KpiBreakdownBar({ items, toneTokens, className }: KpiBreakdownBa
|
|
|
61
61
|
<span className="size-1.5 shrink-0 rounded-[var(--radius-swatch)]" style={token ? tokenStyle(token) : undefined} />
|
|
62
62
|
<span className="truncate">{item.label}</span>
|
|
63
63
|
</span>
|
|
64
|
-
<span className="
|
|
64
|
+
<span className="text-data font-bold text-foreground">{item.value}</span>
|
|
65
65
|
</div>
|
|
66
66
|
);
|
|
67
67
|
})}
|
|
@@ -171,7 +171,7 @@ export function PhoneInput({ value, onChange, defaultCountry = "pt", disabled =
|
|
|
171
171
|
)}
|
|
172
172
|
>
|
|
173
173
|
<span className="text-body leading-none">{flagEmoji(candidate.iso2)}</span>
|
|
174
|
-
<span className="flex-1 truncate text-
|
|
174
|
+
<span className="flex-1 truncate text-meta text-foreground">{candidate.name}</span>
|
|
175
175
|
<span className="shrink-0 text-micro text-foreground-muted-accessible">+{candidate.dialCode}</span>
|
|
176
176
|
</button>
|
|
177
177
|
))}
|
|
@@ -20,9 +20,9 @@ export type StatValueProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const statValueSizeClasses: Record<NonNullable<StatValueProps["size"]>, string> = {
|
|
23
|
-
normal: "text-
|
|
24
|
-
large: "text-
|
|
25
|
-
display: "text-
|
|
23
|
+
normal: "text-kpi",
|
|
24
|
+
large: "text-kpi-lg",
|
|
25
|
+
display: "text-kpi",
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export function StatValue({ size = "normal", className, ...props }: StatValueProps) {
|
|
@@ -17,6 +17,12 @@ export type TablePaginationProps = {
|
|
|
17
17
|
pageLabel?: (page: number, totalPages: number) => string;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
function dataNumerals(value: string) {
|
|
21
|
+
return value.split(/(\d+(?:[.,]\d+)*)/).map((part, index) =>
|
|
22
|
+
/^\d/.test(part) ? <span key={`${part}-${index}`} className="text-data">{part}</span> : part,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
export function TablePagination({
|
|
21
27
|
page,
|
|
22
28
|
totalPages,
|
|
@@ -40,9 +46,9 @@ export function TablePagination({
|
|
|
40
46
|
<div className={cn("flex min-w-0 flex-col gap-2 border-t border-[color:var(--border)] px-4 py-2 md:flex-row md:items-center md:justify-between", className)}>
|
|
41
47
|
{summary ? (
|
|
42
48
|
<p className="min-w-0 truncate text-meta text-muted-foreground leading-tight text-[color:var(--muted-foreground)]">
|
|
43
|
-
<span className="font-semibold text-[color:var(--foreground)]">{pageLabel(safePage, safeTotalPages)}</span>
|
|
49
|
+
<span className="font-semibold text-[color:var(--foreground)]">{dataNumerals(pageLabel(safePage, safeTotalPages))}</span>
|
|
44
50
|
<span className="px-1.5 text-[color:var(--border)]">·</span>
|
|
45
|
-
{summary}
|
|
51
|
+
{dataNumerals(summary)}
|
|
46
52
|
</p>
|
|
47
53
|
) : null}
|
|
48
54
|
<Pagination className="mx-0 w-auto min-w-0 shrink-0 justify-start md:ml-auto md:justify-end">
|
|
@@ -73,7 +79,7 @@ export function TablePagination({
|
|
|
73
79
|
changePage(item);
|
|
74
80
|
}}
|
|
75
81
|
className={cn(
|
|
76
|
-
"size-8 rounded-full text-
|
|
82
|
+
"size-8 rounded-full text-data-sm font-semibold",
|
|
77
83
|
item === safePage
|
|
78
84
|
? "border-[color:var(--border-pagination-active)] bg-[color:var(--surface-pagination-active)] text-[color:var(--foreground)]"
|
|
79
85
|
: "text-[color:var(--muted-foreground)] hover:bg-[color:var(--muted)] hover:text-[color:var(--foreground)]",
|