@brightlocal/ui-components 0.1.3 → 0.2.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 +1 -1
- package/dist/alert.cjs +1 -1
- package/dist/alert.js +1 -1
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +37 -306
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +392 -489
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +4 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +33 -33
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +5 -18
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +21 -23
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +19 -19
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +75 -67
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +241 -194
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +3 -0
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +361 -366
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +5 -0
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +47 -39
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +6 -0
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +79 -76
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +4 -0
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +32 -31
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +4 -0
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +26 -24
- package/dist/link.cjs +1 -1
- package/dist/link.js +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -4
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +17 -20
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +31 -30
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +6 -54
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +73 -84
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +8 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +78 -86
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +10 -23
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +47 -55
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +19 -28
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +24 -40
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +3 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +57 -56
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +4 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +19 -21
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +5 -10
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +24 -26
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +17 -20
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +42 -45
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +2 -12
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +37 -41
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +16 -12
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +56 -58
- package/dist/tabs.d.ts +27 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +4 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +19 -18
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +57 -7
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +60 -67
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts +12 -26
- package/dist/toggle.d.ts.map +1 -1
- package/dist/toggle.js +18 -22
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +1 -1
- package/src/blocks/sidebar.tsx +157 -532
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.tsx +6 -4
- package/src/components/centred-layout.tsx +11 -24
- package/src/components/checkbox.tsx +5 -6
- package/src/components/combobox.tsx +481 -301
- package/src/components/command.tsx +1 -1
- package/src/components/context-menu.tsx +1 -1
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/field.tsx +2 -0
- package/src/components/input-group.tsx +14 -2
- package/src/components/input-otp.tsx +17 -2
- package/src/components/input-password.tsx +7 -2
- package/src/components/input.tsx +11 -3
- package/src/components/link.tsx +1 -1
- package/src/components/logo.tsx +10 -8
- package/src/components/menubar.tsx +3 -1
- package/src/components/navigation-menu.tsx +37 -99
- package/src/components/pagination.tsx +13 -19
- package/src/components/radio-group.tsx +28 -38
- package/src/components/resizable.tsx +5 -43
- package/src/components/select.tsx +8 -3
- package/src/components/separator.tsx +5 -5
- package/src/components/sheet.tsx +6 -11
- package/src/components/sonner.tsx +24 -27
- package/src/components/switch.figma.tsx +7 -11
- package/src/components/switch.tsx +9 -19
- package/src/components/table.tsx +23 -18
- package/src/components/tabs.tsx +27 -3
- package/src/components/textarea.tsx +12 -5
- package/src/components/toggle-group.tsx +115 -86
- package/src/components/toggle.figma.tsx +13 -19
- package/src/components/toggle.tsx +32 -48
|
@@ -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 { ChevronDownIcon } from "
|
|
5
|
+
import { ChevronDownIcon } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
package/src/components/alert.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { CircleCheck, Info, CircleX, TriangleAlert } from "
|
|
3
|
+
import { CircleCheck, Info, CircleX, TriangleAlert } from "@brightlocal/icons";
|
|
4
4
|
|
|
5
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from "
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from "@brightlocal/icons";
|
|
4
4
|
|
|
5
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Loader2 } from "
|
|
4
|
+
import { Loader2 } from "@brightlocal/icons";
|
|
5
5
|
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ChevronDown, ChevronLeft, ChevronRight } from "
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "@brightlocal/icons";
|
|
5
5
|
import {
|
|
6
6
|
DayButton,
|
|
7
7
|
DayPicker,
|
|
@@ -46,12 +46,12 @@ const navButtonStyles = cn(
|
|
|
46
46
|
* Custom day button component for the Calendar.
|
|
47
47
|
* Renders individual day cells with proper styling and selection states.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
const CalendarDayButton = ({
|
|
50
50
|
className,
|
|
51
51
|
day,
|
|
52
52
|
modifiers,
|
|
53
53
|
...props
|
|
54
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
54
|
+
}: React.ComponentProps<typeof DayButton>) => {
|
|
55
55
|
const defaultClassNames = getDefaultClassNames();
|
|
56
56
|
const ref = React.useRef<HTMLButtonElement>(null);
|
|
57
57
|
|
|
@@ -88,7 +88,9 @@ function CalendarDayButton({
|
|
|
88
88
|
{...props}
|
|
89
89
|
/>
|
|
90
90
|
);
|
|
91
|
-
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
CalendarDayButton.displayName = "CalendarDayButton";
|
|
92
94
|
|
|
93
95
|
/**
|
|
94
96
|
* Calendar component for date and range selection.
|
|
@@ -18,25 +18,12 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Breakpoint variants for CentredLayout
|
|
21
|
+
* - xl: Extra large breakpoint (1280px max-width)
|
|
22
|
+
* - lg: Large breakpoint (1024px max-width)
|
|
23
|
+
* - md: Medium breakpoint (768px max-width)
|
|
24
|
+
* - sm: Small breakpoint (640px max-width)
|
|
21
25
|
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* Extra large breakpoint (1280px max-width)
|
|
25
|
-
*/
|
|
26
|
-
XL = "xl",
|
|
27
|
-
/**
|
|
28
|
-
* Large breakpoint (1024px max-width)
|
|
29
|
-
*/
|
|
30
|
-
LG = "lg",
|
|
31
|
-
/**
|
|
32
|
-
* Medium breakpoint (768px max-width)
|
|
33
|
-
*/
|
|
34
|
-
MD = "md",
|
|
35
|
-
/**
|
|
36
|
-
* Small breakpoint (640px max-width)
|
|
37
|
-
*/
|
|
38
|
-
SM = "sm",
|
|
39
|
-
}
|
|
26
|
+
export type CentredLayoutBreakpoint = "xl" | "lg" | "md" | "sm";
|
|
40
27
|
|
|
41
28
|
interface CentredLayoutProps extends React.ComponentProps<"div"> {
|
|
42
29
|
/**
|
|
@@ -69,7 +56,7 @@ const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
|
|
|
69
56
|
(
|
|
70
57
|
{
|
|
71
58
|
className,
|
|
72
|
-
breakpoint =
|
|
59
|
+
breakpoint = "xl",
|
|
73
60
|
maxWidth,
|
|
74
61
|
children,
|
|
75
62
|
dataHook,
|
|
@@ -80,11 +67,11 @@ const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
|
|
|
80
67
|
ref
|
|
81
68
|
) => {
|
|
82
69
|
// Map breakpoints to Tailwind max-width utility classes
|
|
83
|
-
const breakpointMaxWidthClass = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
const breakpointMaxWidthClass: Record<CentredLayoutBreakpoint, string> = {
|
|
71
|
+
xl: "max-w-7xl",
|
|
72
|
+
lg: "max-w-5xl",
|
|
73
|
+
md: "max-w-3xl",
|
|
74
|
+
sm: "max-w-2xl",
|
|
88
75
|
};
|
|
89
76
|
|
|
90
77
|
// If custom maxWidth is provided, use inline style; otherwise use Tailwind class
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import { CheckIcon } from "
|
|
4
|
+
import { CheckIcon } from "@brightlocal/icons";
|
|
5
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
-
|
|
7
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
7
|
|
|
9
8
|
const checkboxVariants = cva(
|
|
@@ -23,8 +22,8 @@ const checkboxVariants = cva(
|
|
|
23
22
|
variants: {
|
|
24
23
|
error: {
|
|
25
24
|
true: [
|
|
26
|
-
// Error state - red border with 40% opacity
|
|
27
|
-
"border-
|
|
25
|
+
// Error state - red-600 border with 40% opacity (light) / red-400 with 60% opacity (dark)
|
|
26
|
+
"border-red-600/40 dark:border-red-400/60",
|
|
28
27
|
// Error focus state - solid red border with destructive shadow
|
|
29
28
|
"focus-visible:border-destructive focus-visible:shadow-destructive",
|
|
30
29
|
],
|
|
@@ -38,8 +37,8 @@ const checkboxVariants = cva(
|
|
|
38
37
|
|
|
39
38
|
export interface CheckboxProps
|
|
40
39
|
extends
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, "disabled">,
|
|
41
|
+
VariantProps<typeof checkboxVariants> {
|
|
43
42
|
/** Whether the checkbox is disabled */
|
|
44
43
|
disabled?: boolean;
|
|
45
44
|
/** Data hook for automated testing (REQUIRED) */
|