@brightlocal/ui-components 0.4.1 → 0.5.0
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/README.md +2 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert.cjs +1 -1
- package/dist/alert.js +64 -64
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +38 -38
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +23 -23
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +34 -34
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +58 -57
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +19 -40
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +1 -1
- package/dist/chart.cjs +2 -2
- package/dist/chart.d.ts +3 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +21 -21
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +39 -42
- package/dist/command.cjs +1 -1
- package/dist/command.js +35 -35
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +7 -7
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +22 -22
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +40 -45
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +38 -30
- package/dist/header.d.ts.map +1 -1
- package/dist/header.js +1 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +334 -319
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +18 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +10 -10
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +6 -6
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +16 -16
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +1 -8
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +23 -11
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +12 -12
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +15 -15
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +3 -3
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +46 -50
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +19 -19
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +7 -8
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +28 -28
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +10 -12
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +9 -9
- package/dist/typography.cjs +1 -0
- package/dist/typography.d.ts +176 -0
- package/dist/typography.d.ts.map +1 -0
- package/dist/typography.js +331 -0
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +10 -10
- package/src/blocks/sidebar.tsx +13 -13
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert.tsx +10 -10
- package/src/components/breadcrumb.tsx +3 -3
- package/src/components/button.tsx +7 -7
- package/src/components/calendar.tsx +4 -22
- package/src/components/centred-layout.tsx +1 -1
- package/src/components/chart.tsx +5 -5
- package/src/components/checkbox.tsx +3 -3
- package/src/components/combobox.tsx +4 -8
- package/src/components/command.tsx +5 -5
- package/src/components/context-menu.tsx +2 -2
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +3 -3
- package/src/components/dropdown-menu.tsx +6 -11
- package/src/components/field.tsx +27 -19
- package/src/components/header.tsx +1 -4
- package/src/components/input-chip.tsx +1 -4
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +3 -3
- package/src/components/input-password.tsx +2 -10
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/link.tsx +1 -5
- package/src/components/logo.tsx +11 -5
- package/src/components/menubar.tsx +2 -2
- package/src/components/pagination.tsx +4 -8
- package/src/components/radio-group.tsx +2 -2
- package/src/components/select.tsx +8 -12
- package/src/components/sheet.tsx +5 -5
- package/src/components/sonner.tsx +4 -5
- package/src/components/switch.tsx +1 -1
- package/src/components/tabs.tsx +0 -2
- package/src/components/toggle.tsx +1 -1
- package/src/components/typography.tsx +678 -0
- package/src/index.ts +1 -0
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
Row,
|
|
28
28
|
} from "@tanstack/react-table";
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
ArrowDown,
|
|
31
|
+
ArrowUp,
|
|
32
|
+
ArrowUpDown,
|
|
33
|
+
Ellipsis,
|
|
34
|
+
Search,
|
|
35
35
|
} from "@brightlocal/icons";
|
|
36
36
|
|
|
37
37
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -700,11 +700,11 @@ function DataTableColumnHeader<TData, TValue>({
|
|
|
700
700
|
className="flex size-3 items-center justify-center"
|
|
701
701
|
>
|
|
702
702
|
{sortState === "desc" ? (
|
|
703
|
-
<
|
|
703
|
+
<ArrowDown size={12} />
|
|
704
704
|
) : sortState === "asc" ? (
|
|
705
|
-
<
|
|
705
|
+
<ArrowUp size={12} />
|
|
706
706
|
) : (
|
|
707
|
-
<
|
|
707
|
+
<ArrowUpDown size={12} />
|
|
708
708
|
)}
|
|
709
709
|
</span>
|
|
710
710
|
</Button>
|
|
@@ -749,7 +749,7 @@ function DataTableRowActions<TData>({
|
|
|
749
749
|
trackingLabel={trackingLabel}
|
|
750
750
|
variant="ghost"
|
|
751
751
|
>
|
|
752
|
-
<
|
|
752
|
+
<Ellipsis />
|
|
753
753
|
</Button>
|
|
754
754
|
</DropdownMenuTrigger>
|
|
755
755
|
<DropdownMenuContent align="end" dataHook={`${dataHook}-menu`}>
|
|
@@ -967,7 +967,7 @@ function DataTableSearch<TData>({
|
|
|
967
967
|
onChange={(event) => handleFilterChange(event.target.value)}
|
|
968
968
|
/>
|
|
969
969
|
<InputGroupAddon className="pr-3">
|
|
970
|
-
<
|
|
970
|
+
<Search />
|
|
971
971
|
</InputGroupAddon>
|
|
972
972
|
</InputGroup>
|
|
973
973
|
</div>
|
package/src/blocks/sidebar.tsx
CHANGED
|
@@ -510,7 +510,7 @@ const SidebarRail = React.forwardRef<HTMLButtonElement, SidebarRailProps>(
|
|
|
510
510
|
ref={ref}
|
|
511
511
|
aria-label="Toggle Sidebar"
|
|
512
512
|
className={cn(
|
|
513
|
-
"hover:after:bg-sidebar-border absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-
|
|
513
|
+
"hover:after:bg-sidebar-border absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
|
|
514
514
|
"cursor-w-resize",
|
|
515
515
|
"[[data-state=collapsed]_&]:cursor-e-resize",
|
|
516
516
|
"group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
@@ -711,7 +711,7 @@ const SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(
|
|
|
711
711
|
SidebarGroup.displayName = "SidebarGroup";
|
|
712
712
|
|
|
713
713
|
const sidebarGroupLabelVariants = cva(
|
|
714
|
-
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:
|
|
714
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
715
715
|
{
|
|
716
716
|
variants: {
|
|
717
717
|
size: {
|
|
@@ -739,8 +739,8 @@ const sidebarGroupLabelVariants = cva(
|
|
|
739
739
|
*/
|
|
740
740
|
interface SidebarGroupLabelProps
|
|
741
741
|
extends
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
React.ComponentProps<"div">,
|
|
743
|
+
VariantProps<typeof sidebarGroupLabelVariants> {
|
|
744
744
|
/** Data hook for automated testing */
|
|
745
745
|
dataHook?: string;
|
|
746
746
|
/**
|
|
@@ -867,7 +867,7 @@ const SidebarGroupAction = React.forwardRef<
|
|
|
867
867
|
<Comp
|
|
868
868
|
ref={ref}
|
|
869
869
|
className={cn(
|
|
870
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:
|
|
870
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:shrink-0",
|
|
871
871
|
// Increases the hit area of the button on mobile.
|
|
872
872
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
873
873
|
"group-data-[collapsible=icon]:hidden",
|
|
@@ -975,7 +975,7 @@ const SidebarCollapseIcon = React.forwardRef<
|
|
|
975
975
|
const iconProps = {
|
|
976
976
|
ref,
|
|
977
977
|
className: cn(
|
|
978
|
-
"
|
|
978
|
+
"shrink-0 transition-transform",
|
|
979
979
|
isActive && type === SidebarCollapseIconType.CARET && "rotate-90",
|
|
980
980
|
className
|
|
981
981
|
),
|
|
@@ -1043,8 +1043,8 @@ const sidebarMenuButtonVariants = cva(
|
|
|
1043
1043
|
*/
|
|
1044
1044
|
interface SidebarMenuButtonProps
|
|
1045
1045
|
extends
|
|
1046
|
-
|
|
1047
|
-
|
|
1046
|
+
React.ComponentProps<"button">,
|
|
1047
|
+
VariantProps<typeof sidebarMenuButtonVariants> {
|
|
1048
1048
|
/** Data hook for automated testing */
|
|
1049
1049
|
dataHook?: string;
|
|
1050
1050
|
/**
|
|
@@ -1160,7 +1160,7 @@ const SidebarMenuAction = React.forwardRef<
|
|
|
1160
1160
|
<Comp
|
|
1161
1161
|
ref={ref}
|
|
1162
1162
|
className={cn(
|
|
1163
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:
|
|
1163
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none focus-visible:ring-2 [&>svg]:shrink-0",
|
|
1164
1164
|
// Increases the hit area of the button on mobile.
|
|
1165
1165
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
1166
1166
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
@@ -1170,7 +1170,7 @@ const SidebarMenuAction = React.forwardRef<
|
|
|
1170
1170
|
"peer-data-[size=tree]/menu-button:top-1.5",
|
|
1171
1171
|
"group-data-[collapsible=icon]:hidden",
|
|
1172
1172
|
showOnHover &&
|
|
1173
|
-
|
|
1173
|
+
"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
|
|
1174
1174
|
className
|
|
1175
1175
|
)}
|
|
1176
1176
|
data-slot="sidebar-menu-action"
|
|
@@ -1282,8 +1282,8 @@ const sidebarMenuSubVariants = cva(
|
|
|
1282
1282
|
*/
|
|
1283
1283
|
interface SidebarMenuSubProps
|
|
1284
1284
|
extends
|
|
1285
|
-
|
|
1286
|
-
|
|
1285
|
+
React.ComponentProps<"ul">,
|
|
1286
|
+
VariantProps<typeof sidebarMenuSubVariants> {
|
|
1287
1287
|
/** Data hook for automated testing */
|
|
1288
1288
|
dataHook?: string;
|
|
1289
1289
|
/**
|
|
@@ -1372,7 +1372,7 @@ const SidebarMenuSubButton = React.forwardRef<
|
|
|
1372
1372
|
<Comp
|
|
1373
1373
|
ref={ref}
|
|
1374
1374
|
className={cn(
|
|
1375
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:
|
|
1375
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",
|
|
1376
1376
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
1377
1377
|
size === SidebarMenuSubButtonSize.SM && "text-xs",
|
|
1378
1378
|
size === SidebarMenuSubButtonSize.MD && "text-sm",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
-
import {
|
|
5
|
+
import { ChevronDown } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
|
@@ -185,7 +185,7 @@ const AccordionTrigger = React.forwardRef<
|
|
|
185
185
|
{...props}
|
|
186
186
|
>
|
|
187
187
|
{children}
|
|
188
|
-
<
|
|
188
|
+
<ChevronDown className="text-muted-foreground pointer-events-none shrink-0 translate-y-0.5 transition-transform duration-200" />
|
|
189
189
|
</AccordionPrimitive.Trigger>
|
|
190
190
|
</AccordionPrimitive.Header>
|
|
191
191
|
));
|
package/src/components/alert.tsx
CHANGED
|
@@ -5,19 +5,19 @@ import { CircleCheck, Info, CircleX, TriangleAlert } from "@brightlocal/icons";
|
|
|
5
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
|
|
7
7
|
const alertVariants = cva(
|
|
8
|
-
"relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start
|
|
8
|
+
"relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default:
|
|
13
|
-
"bg-neutral-100 text-neutral-900
|
|
13
|
+
"bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100",
|
|
14
14
|
success:
|
|
15
|
-
"bg-green-200 text-green-900
|
|
16
|
-
info: "bg-cyan-200 text-cyan-900
|
|
15
|
+
"bg-green-200 text-green-900 dark:bg-green-950 dark:text-green-200",
|
|
16
|
+
info: "bg-cyan-200 text-cyan-900 dark:bg-cyan-900 dark:text-cyan-200",
|
|
17
17
|
destructive:
|
|
18
|
-
"bg-red-300 text-red-950
|
|
18
|
+
"bg-red-300 text-red-950 dark:bg-red-950 dark:text-red-300",
|
|
19
19
|
warning:
|
|
20
|
-
"bg-orange-200 text-amber-900
|
|
20
|
+
"bg-orange-200 text-amber-900 dark:bg-amber-900 dark:text-orange-200",
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
defaultVariants: {
|
|
@@ -118,7 +118,7 @@ function AlertSuccess({
|
|
|
118
118
|
data-tracking-label={trackingLabel}
|
|
119
119
|
variant="success"
|
|
120
120
|
>
|
|
121
|
-
<CircleCheck />
|
|
121
|
+
<CircleCheck className="shrink-0 translate-y-0.5 text-green-900 dark:text-green-200" />
|
|
122
122
|
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
123
123
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
124
124
|
<AlertDescription>{description}</AlertDescription>
|
|
@@ -145,7 +145,7 @@ function AlertInfo({
|
|
|
145
145
|
data-tracking-label={trackingLabel}
|
|
146
146
|
variant="info"
|
|
147
147
|
>
|
|
148
|
-
<Info />
|
|
148
|
+
<Info className="shrink-0 translate-y-0.5 text-cyan-900 dark:text-cyan-200" />
|
|
149
149
|
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
150
150
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
151
151
|
<AlertDescription>{description}</AlertDescription>
|
|
@@ -172,7 +172,7 @@ function AlertDestructive({
|
|
|
172
172
|
data-tracking-label={trackingLabel}
|
|
173
173
|
variant="destructive"
|
|
174
174
|
>
|
|
175
|
-
<CircleX />
|
|
175
|
+
<CircleX className="shrink-0 translate-y-0.5 text-red-950 dark:text-red-300" />
|
|
176
176
|
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
177
177
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
178
178
|
<AlertDescription>{description}</AlertDescription>
|
|
@@ -199,7 +199,7 @@ function AlertWarning({
|
|
|
199
199
|
data-tracking-label={trackingLabel}
|
|
200
200
|
variant="warning"
|
|
201
201
|
>
|
|
202
|
-
<TriangleAlert />
|
|
202
|
+
<TriangleAlert className="shrink-0 translate-y-0.5 text-amber-900 dark:text-orange-200" />
|
|
203
203
|
<div className="flex min-w-0 flex-1 flex-col gap-1">
|
|
204
204
|
{title && <AlertTitle>{title}</AlertTitle>}
|
|
205
205
|
<AlertDescription>{description}</AlertDescription>
|
|
@@ -141,12 +141,12 @@ const BreadcrumbSeparator = React.forwardRef<
|
|
|
141
141
|
<li
|
|
142
142
|
ref={ref}
|
|
143
143
|
aria-hidden="true"
|
|
144
|
-
className={
|
|
144
|
+
className={className}
|
|
145
145
|
data-slot="breadcrumb-separator"
|
|
146
146
|
role="presentation"
|
|
147
147
|
{...props}
|
|
148
148
|
>
|
|
149
|
-
{children ?? <ChevronRight />}
|
|
149
|
+
{children ?? <ChevronRight size={14} />}
|
|
150
150
|
</li>
|
|
151
151
|
));
|
|
152
152
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
@@ -167,7 +167,7 @@ const BreadcrumbEllipsis = React.forwardRef<
|
|
|
167
167
|
role="presentation"
|
|
168
168
|
{...props}
|
|
169
169
|
>
|
|
170
|
-
<MoreHorizontal
|
|
170
|
+
<MoreHorizontal />
|
|
171
171
|
<span className="sr-only">More</span>
|
|
172
172
|
</span>
|
|
173
173
|
));
|
|
@@ -39,7 +39,7 @@ const ButtonVariants = cva(
|
|
|
39
39
|
"justify-center",
|
|
40
40
|
"gap-2",
|
|
41
41
|
"whitespace-nowrap",
|
|
42
|
-
"transition-[color,background-color,border-color,box-shadow]",
|
|
42
|
+
"transition-[color,background-color,border-color,box-shadow,opacity]",
|
|
43
43
|
"duration-150",
|
|
44
44
|
"ease-in-out",
|
|
45
45
|
"cursor-pointer",
|
|
@@ -48,6 +48,7 @@ const ButtonVariants = cva(
|
|
|
48
48
|
"disabled:opacity-50",
|
|
49
49
|
"aria-disabled:opacity-50",
|
|
50
50
|
"[&_svg]:pointer-events-none",
|
|
51
|
+
"[&_svg]:shrink-0",
|
|
51
52
|
"shrink-0",
|
|
52
53
|
"outline-none",
|
|
53
54
|
"aria-invalid:ring-destructive/20",
|
|
@@ -108,8 +109,8 @@ const ButtonVariants = cva(
|
|
|
108
109
|
],
|
|
109
110
|
},
|
|
110
111
|
size: {
|
|
111
|
-
default: "px-4 py-2 h-9 text-sm
|
|
112
|
-
sm: "py-2 px-3 h-8 text-xs
|
|
112
|
+
default: "px-4 py-2 h-9 text-sm",
|
|
113
|
+
sm: "py-2 px-3 h-8 text-xs",
|
|
113
114
|
lg: "py-2 px-8 h-10 text-sm [&_svg:not([class*='size-'])]:size-5",
|
|
114
115
|
},
|
|
115
116
|
state: {
|
|
@@ -178,8 +179,6 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
178
179
|
// Determine actual disabled state
|
|
179
180
|
const isDisabled = disabled || loading;
|
|
180
181
|
|
|
181
|
-
// Determine content to display
|
|
182
|
-
const displayChildren = children;
|
|
183
182
|
let isSingleIconOnly = iconOnly;
|
|
184
183
|
if (
|
|
185
184
|
!isSingleIconOnly &&
|
|
@@ -191,6 +190,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
191
190
|
}>;
|
|
192
191
|
isSingleIconOnly = onlyChild.props?.children == null;
|
|
193
192
|
}
|
|
193
|
+
|
|
194
194
|
const showLoadingSpinner = loading && !asChild;
|
|
195
195
|
|
|
196
196
|
// Compute visual state class via CVA
|
|
@@ -201,7 +201,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
201
201
|
// Ensure we always have an accessible label
|
|
202
202
|
const effectiveAriaLabel =
|
|
203
203
|
ariaLabel ??
|
|
204
|
-
(loading ? `Loading: ${
|
|
204
|
+
(loading ? `Loading: ${children || "Please wait"}` : undefined);
|
|
205
205
|
|
|
206
206
|
// When asChild is used, render a simplified version that only forwards props
|
|
207
207
|
if (asChild) {
|
|
@@ -262,7 +262,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
262
262
|
<Loader2 className="animate-spin" size={BUTTON_SPINNER_SIZE} />
|
|
263
263
|
</div>
|
|
264
264
|
)}
|
|
265
|
-
{
|
|
265
|
+
{children}
|
|
266
266
|
</Comp>
|
|
267
267
|
);
|
|
268
268
|
}
|
|
@@ -130,7 +130,7 @@ function Calendar({
|
|
|
130
130
|
caption_label: cn(
|
|
131
131
|
"text-sm font-sans leading-5 text-foreground select-none",
|
|
132
132
|
captionLayout === "dropdown" ? "font-normal" : "font-medium",
|
|
133
|
-
"[&>svg]:text-muted-foreground
|
|
133
|
+
"[&>svg]:text-muted-foreground",
|
|
134
134
|
"flex h-[34px] items-center gap-1 rounded-md pl-2 pr-1",
|
|
135
135
|
defaultClassNames.caption_label
|
|
136
136
|
),
|
|
@@ -203,30 +203,12 @@ function Calendar({
|
|
|
203
203
|
...iconProps
|
|
204
204
|
}) => {
|
|
205
205
|
if (orientation === "left") {
|
|
206
|
-
return
|
|
207
|
-
<ChevronLeft
|
|
208
|
-
className={chevronClassName}
|
|
209
|
-
size={16}
|
|
210
|
-
{...iconProps}
|
|
211
|
-
/>
|
|
212
|
-
);
|
|
206
|
+
return <ChevronLeft className={chevronClassName} {...iconProps} />;
|
|
213
207
|
}
|
|
214
208
|
if (orientation === "right") {
|
|
215
|
-
return
|
|
216
|
-
<ChevronRight
|
|
217
|
-
className={chevronClassName}
|
|
218
|
-
size={16}
|
|
219
|
-
{...iconProps}
|
|
220
|
-
/>
|
|
221
|
-
);
|
|
209
|
+
return <ChevronRight className={chevronClassName} {...iconProps} />;
|
|
222
210
|
}
|
|
223
|
-
return
|
|
224
|
-
<ChevronDown
|
|
225
|
-
className={chevronClassName}
|
|
226
|
-
size={16}
|
|
227
|
-
{...iconProps}
|
|
228
|
-
/>
|
|
229
|
-
);
|
|
211
|
+
return <ChevronDown className={chevronClassName} {...iconProps} />;
|
|
230
212
|
},
|
|
231
213
|
DayButton: CalendarDayButton,
|
|
232
214
|
...components,
|
|
@@ -63,7 +63,7 @@ const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
|
|
|
63
63
|
ref={ref}
|
|
64
64
|
className={cn(
|
|
65
65
|
// Base styles with section-padding tokens (responsive: 16px mobile, 24px desktop) and gap-4 for header/content spacing
|
|
66
|
-
"bg-background flex min-h-screen w-full flex-col items-center justify-center gap-4
|
|
66
|
+
"bg-background p-section flex min-h-screen w-full flex-col items-center justify-center gap-4",
|
|
67
67
|
className
|
|
68
68
|
)}
|
|
69
69
|
data-hook={dataHook}
|
package/src/components/chart.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
|
11
11
|
export interface ChartConfig {
|
|
12
12
|
[key: string]: {
|
|
13
13
|
label?: React.ReactNode;
|
|
14
|
-
icon?: React.ComponentType
|
|
14
|
+
icon?: React.ComponentType<{ size?: number }>;
|
|
15
15
|
} & (
|
|
16
16
|
| { color?: string; theme?: never }
|
|
17
17
|
| { color?: never; theme: Record<string, string> }
|
|
@@ -309,7 +309,7 @@ function ChartTooltipContent({
|
|
|
309
309
|
<div
|
|
310
310
|
key={item.dataKey}
|
|
311
311
|
className={cn(
|
|
312
|
-
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2
|
|
312
|
+
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2",
|
|
313
313
|
indicator === "dot" && "items-center"
|
|
314
314
|
)}
|
|
315
315
|
>
|
|
@@ -318,7 +318,7 @@ function ChartTooltipContent({
|
|
|
318
318
|
) : (
|
|
319
319
|
<>
|
|
320
320
|
{itemConfig?.icon && !hideIndicator ? (
|
|
321
|
-
<itemConfig.icon />
|
|
321
|
+
<itemConfig.icon size={10} />
|
|
322
322
|
) : (
|
|
323
323
|
!hideIndicator && (
|
|
324
324
|
<div
|
|
@@ -450,11 +450,11 @@ function ChartLegendContent({
|
|
|
450
450
|
<div
|
|
451
451
|
key={item.value}
|
|
452
452
|
className={cn(
|
|
453
|
-
"[&>svg]:text-muted-foreground flex items-center gap-1.5
|
|
453
|
+
"[&>svg]:text-muted-foreground flex items-center gap-1.5"
|
|
454
454
|
)}
|
|
455
455
|
>
|
|
456
456
|
{itemConfig?.icon && !hideIcon ? (
|
|
457
|
-
<itemConfig.icon />
|
|
457
|
+
<itemConfig.icon size={12} />
|
|
458
458
|
) : (
|
|
459
459
|
<div
|
|
460
460
|
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import {
|
|
4
|
+
import { Check } from "@brightlocal/icons";
|
|
5
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
8
8
|
const checkboxVariants = cva(
|
|
9
9
|
[
|
|
10
10
|
// Layout & Size
|
|
11
|
-
"size-
|
|
11
|
+
"size-[18px] shrink-0 self-start mt-0.5",
|
|
12
12
|
// Appearance
|
|
13
13
|
"bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors outline-none",
|
|
14
14
|
// Checked State
|
|
@@ -83,7 +83,7 @@ const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(
|
|
|
83
83
|
className="flex items-center justify-center text-current transition-none"
|
|
84
84
|
data-slot="checkbox-indicator"
|
|
85
85
|
>
|
|
86
|
-
<
|
|
86
|
+
<Check />
|
|
87
87
|
</CheckboxPrimitive.Indicator>
|
|
88
88
|
</CheckboxPrimitive.Root>
|
|
89
89
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { ChevronsUpDown, Check } from "@brightlocal/icons";
|
|
5
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -189,7 +189,6 @@ const comboboxTriggerVariants = cva(
|
|
|
189
189
|
|
|
190
190
|
// Icon styles
|
|
191
191
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
192
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
193
192
|
],
|
|
194
193
|
{
|
|
195
194
|
variants: {
|
|
@@ -259,10 +258,9 @@ const ComboboxTrigger = React.forwardRef<
|
|
|
259
258
|
{...props}
|
|
260
259
|
>
|
|
261
260
|
{children}
|
|
262
|
-
<
|
|
261
|
+
<ChevronsUpDown
|
|
263
262
|
aria-hidden="true"
|
|
264
263
|
className="text-muted-foreground ml-auto shrink-0"
|
|
265
|
-
size={16}
|
|
266
264
|
/>
|
|
267
265
|
</button>
|
|
268
266
|
</PopoverTrigger>
|
|
@@ -338,8 +336,7 @@ function ComboboxContent({
|
|
|
338
336
|
<Command
|
|
339
337
|
className={cn(
|
|
340
338
|
"border-0 shadow-none",
|
|
341
|
-
hideList &&
|
|
342
|
-
"[&_[data-slot='command-input-wrapper']]:border-b-0"
|
|
339
|
+
hideList && "[&_[data-slot='command-input-wrapper']]:border-b-0"
|
|
343
340
|
)}
|
|
344
341
|
data-slot="combobox-command"
|
|
345
342
|
dataHook={dataHook || "combobox-command"}
|
|
@@ -537,10 +534,9 @@ const ComboboxItem = React.forwardRef<
|
|
|
537
534
|
>
|
|
538
535
|
{renderContent()}
|
|
539
536
|
{isSelected && (
|
|
540
|
-
<
|
|
537
|
+
<Check
|
|
541
538
|
aria-hidden="true"
|
|
542
539
|
className="text-muted-foreground shrink-0"
|
|
543
|
-
size={16}
|
|
544
540
|
/>
|
|
545
541
|
)}
|
|
546
542
|
</CommandItem>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
-
import {
|
|
5
|
+
import { Check, Search, X } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { Button } from "@brightlocal/ui-components/button";
|
|
8
8
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -127,7 +127,7 @@ const CommandInput = React.forwardRef<
|
|
|
127
127
|
data-hook={dataHook}
|
|
128
128
|
data-slot="command-input-wrapper"
|
|
129
129
|
>
|
|
130
|
-
<
|
|
130
|
+
<Search className="shrink-0 opacity-50" />
|
|
131
131
|
<CommandPrimitive.Input
|
|
132
132
|
ref={inputRef}
|
|
133
133
|
className={cn(
|
|
@@ -149,7 +149,7 @@ const CommandInput = React.forwardRef<
|
|
|
149
149
|
variant="ghost"
|
|
150
150
|
onClick={handleClear}
|
|
151
151
|
>
|
|
152
|
-
<
|
|
152
|
+
<X />
|
|
153
153
|
</Button>
|
|
154
154
|
)}
|
|
155
155
|
</div>
|
|
@@ -326,7 +326,7 @@ const CommandItem = React.forwardRef<
|
|
|
326
326
|
<CommandPrimitive.Item
|
|
327
327
|
ref={ref}
|
|
328
328
|
className={cn(
|
|
329
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground
|
|
329
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
330
330
|
className
|
|
331
331
|
)}
|
|
332
332
|
data-hook={dataHook}
|
|
@@ -337,7 +337,7 @@ const CommandItem = React.forwardRef<
|
|
|
337
337
|
{...props}
|
|
338
338
|
>
|
|
339
339
|
{children}
|
|
340
|
-
{selected && <
|
|
340
|
+
{selected && <Check className="text-foreground ml-auto" />}
|
|
341
341
|
</CommandPrimitive.Item>
|
|
342
342
|
)
|
|
343
343
|
);
|
|
@@ -175,7 +175,7 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
175
175
|
{...props}
|
|
176
176
|
>
|
|
177
177
|
{children}
|
|
178
|
-
<ChevronRight className="ml-auto"
|
|
178
|
+
<ChevronRight className="ml-auto" />
|
|
179
179
|
</ContextMenuPrimitive.SubTrigger>
|
|
180
180
|
)
|
|
181
181
|
);
|
|
@@ -341,7 +341,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
341
341
|
>
|
|
342
342
|
<span className="absolute left-2 flex size-3.5 items-center justify-center">
|
|
343
343
|
<ContextMenuPrimitive.ItemIndicator>
|
|
344
|
-
<Check
|
|
344
|
+
<Check />
|
|
345
345
|
</ContextMenuPrimitive.ItemIndicator>
|
|
346
346
|
</span>
|
|
347
347
|
{children}
|
|
@@ -296,7 +296,7 @@ const DatePickerTrigger = React.forwardRef<
|
|
|
296
296
|
>
|
|
297
297
|
<CalendarIcon
|
|
298
298
|
className={cn(
|
|
299
|
-
"text-muted-foreground pointer-events-none absolute top-1/2 left-3
|
|
299
|
+
"text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2",
|
|
300
300
|
disabled && "opacity-50"
|
|
301
301
|
)}
|
|
302
302
|
data-slot="calendar-icon"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
-
import {
|
|
5
|
+
import { X } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
|
@@ -130,8 +130,8 @@ const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps>(
|
|
|
130
130
|
{...props}
|
|
131
131
|
>
|
|
132
132
|
{children}
|
|
133
|
-
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0
|
|
134
|
-
<
|
|
133
|
+
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0">
|
|
134
|
+
<X />
|
|
135
135
|
<span className="sr-only">Close</span>
|
|
136
136
|
</DialogPrimitive.Close>
|
|
137
137
|
</DialogPrimitive.Content>
|
|
@@ -203,8 +203,6 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
203
203
|
"data-[inset]:pl-8",
|
|
204
204
|
// Icon styling
|
|
205
205
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
206
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
207
|
-
"[&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
208
206
|
],
|
|
209
207
|
className
|
|
210
208
|
)}
|
|
@@ -268,8 +266,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
268
266
|
"focus:bg-accent focus:text-accent-foreground",
|
|
269
267
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
270
268
|
// Icon styling
|
|
271
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
272
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
269
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
273
270
|
],
|
|
274
271
|
className
|
|
275
272
|
)}
|
|
@@ -281,7 +278,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
281
278
|
>
|
|
282
279
|
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
283
280
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
284
|
-
<Check
|
|
281
|
+
<Check />
|
|
285
282
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
286
283
|
</span>
|
|
287
284
|
{children}
|
|
@@ -341,8 +338,7 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
341
338
|
"focus:bg-accent focus:text-accent-foreground",
|
|
342
339
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
343
340
|
// Icon styling
|
|
344
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
345
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
341
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
346
342
|
],
|
|
347
343
|
className
|
|
348
344
|
)}
|
|
@@ -502,8 +498,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
502
498
|
"data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
503
499
|
"data-[inset]:pl-8",
|
|
504
500
|
// Icon styling
|
|
505
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
506
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
501
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
507
502
|
],
|
|
508
503
|
className
|
|
509
504
|
)}
|
|
@@ -515,7 +510,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
515
510
|
{...props}
|
|
516
511
|
>
|
|
517
512
|
{children}
|
|
518
|
-
<ChevronRight className="ml-auto"
|
|
513
|
+
<ChevronRight className="ml-auto" />
|
|
519
514
|
</DropdownMenuPrimitive.SubTrigger>
|
|
520
515
|
);
|
|
521
516
|
}
|
|
@@ -647,7 +642,7 @@ const DropdownMenuTriggerAvatar = React.forwardRef<
|
|
|
647
642
|
</span>
|
|
648
643
|
)}
|
|
649
644
|
</div>
|
|
650
|
-
<ChevronsUpDown className="text-muted-foreground opacity-50"
|
|
645
|
+
<ChevronsUpDown className="text-muted-foreground opacity-50" />
|
|
651
646
|
</DropdownMenuPrimitive.Trigger>
|
|
652
647
|
);
|
|
653
648
|
}
|