@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.
Files changed (166) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.js +1 -1
  4. package/dist/alert.cjs +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.js +1 -1
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts +37 -306
  10. package/dist/blocks/sidebar.d.ts.map +1 -1
  11. package/dist/blocks/sidebar.js +392 -489
  12. package/dist/breadcrumb.cjs +1 -1
  13. package/dist/breadcrumb.js +1 -1
  14. package/dist/button.cjs +1 -1
  15. package/dist/button.js +1 -1
  16. package/dist/calendar.cjs +1 -1
  17. package/dist/calendar.d.ts +4 -1
  18. package/dist/calendar.d.ts.map +1 -1
  19. package/dist/calendar.js +33 -33
  20. package/dist/centred-layout.cjs +1 -1
  21. package/dist/centred-layout.d.ts +5 -18
  22. package/dist/centred-layout.d.ts.map +1 -1
  23. package/dist/centred-layout.js +21 -23
  24. package/dist/checkbox.cjs +1 -1
  25. package/dist/checkbox.d.ts.map +1 -1
  26. package/dist/checkbox.js +19 -19
  27. package/dist/combobox.cjs +1 -1
  28. package/dist/combobox.d.ts +75 -67
  29. package/dist/combobox.d.ts.map +1 -1
  30. package/dist/combobox.js +241 -194
  31. package/dist/command.cjs +1 -1
  32. package/dist/command.js +1 -1
  33. package/dist/context-menu.cjs +1 -1
  34. package/dist/context-menu.js +1 -1
  35. package/dist/date-picker.cjs +1 -1
  36. package/dist/date-picker.js +1 -1
  37. package/dist/dialog.cjs +1 -1
  38. package/dist/dialog.js +1 -1
  39. package/dist/dropdown-menu.cjs +1 -1
  40. package/dist/dropdown-menu.js +1 -1
  41. package/dist/field.cjs +1 -1
  42. package/dist/field.d.ts +3 -0
  43. package/dist/field.d.ts.map +1 -1
  44. package/dist/field.js +5 -4
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.js +361 -366
  47. package/dist/input-group.cjs +1 -1
  48. package/dist/input-group.d.ts +5 -0
  49. package/dist/input-group.d.ts.map +1 -1
  50. package/dist/input-group.js +47 -39
  51. package/dist/input-otp.cjs +1 -1
  52. package/dist/input-otp.d.ts +6 -0
  53. package/dist/input-otp.d.ts.map +1 -1
  54. package/dist/input-otp.js +79 -76
  55. package/dist/input-password.cjs +1 -1
  56. package/dist/input-password.d.ts +4 -0
  57. package/dist/input-password.d.ts.map +1 -1
  58. package/dist/input-password.js +32 -31
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.d.ts +4 -0
  61. package/dist/input.d.ts.map +1 -1
  62. package/dist/input.js +26 -24
  63. package/dist/link.cjs +1 -1
  64. package/dist/link.js +1 -1
  65. package/dist/logo.cjs +1 -1
  66. package/dist/logo.d.ts +6 -4
  67. package/dist/logo.d.ts.map +1 -1
  68. package/dist/logo.js +17 -20
  69. package/dist/menubar.cjs +1 -1
  70. package/dist/menubar.d.ts +3 -0
  71. package/dist/menubar.d.ts.map +1 -1
  72. package/dist/menubar.js +31 -30
  73. package/dist/navigation-menu.cjs +1 -1
  74. package/dist/navigation-menu.d.ts +6 -54
  75. package/dist/navigation-menu.d.ts.map +1 -1
  76. package/dist/navigation-menu.js +73 -84
  77. package/dist/pagination.cjs +1 -1
  78. package/dist/pagination.d.ts +8 -10
  79. package/dist/pagination.d.ts.map +1 -1
  80. package/dist/pagination.js +78 -86
  81. package/dist/radio-group.cjs +1 -1
  82. package/dist/radio-group.d.ts +10 -23
  83. package/dist/radio-group.d.ts.map +1 -1
  84. package/dist/radio-group.js +47 -55
  85. package/dist/resizable.cjs +1 -1
  86. package/dist/resizable.d.ts +19 -28
  87. package/dist/resizable.d.ts.map +1 -1
  88. package/dist/resizable.js +24 -40
  89. package/dist/select.cjs +1 -1
  90. package/dist/select.d.ts +3 -1
  91. package/dist/select.d.ts.map +1 -1
  92. package/dist/select.js +57 -56
  93. package/dist/separator.cjs +1 -1
  94. package/dist/separator.d.ts +4 -4
  95. package/dist/separator.d.ts.map +1 -1
  96. package/dist/separator.js +19 -21
  97. package/dist/sheet.cjs +1 -1
  98. package/dist/sheet.d.ts +5 -10
  99. package/dist/sheet.d.ts.map +1 -1
  100. package/dist/sheet.js +24 -26
  101. package/dist/sonner.cjs +1 -1
  102. package/dist/sonner.d.ts +17 -20
  103. package/dist/sonner.d.ts.map +1 -1
  104. package/dist/sonner.js +42 -45
  105. package/dist/switch.cjs +1 -1
  106. package/dist/switch.d.ts +2 -12
  107. package/dist/switch.d.ts.map +1 -1
  108. package/dist/switch.js +37 -41
  109. package/dist/table.cjs +1 -1
  110. package/dist/table.d.ts +16 -12
  111. package/dist/table.d.ts.map +1 -1
  112. package/dist/table.js +56 -58
  113. package/dist/tabs.d.ts +27 -3
  114. package/dist/tabs.d.ts.map +1 -1
  115. package/dist/textarea.cjs +1 -1
  116. package/dist/textarea.d.ts +4 -0
  117. package/dist/textarea.d.ts.map +1 -1
  118. package/dist/textarea.js +19 -18
  119. package/dist/toggle-group.cjs +1 -1
  120. package/dist/toggle-group.d.ts +57 -7
  121. package/dist/toggle-group.d.ts.map +1 -1
  122. package/dist/toggle-group.js +60 -67
  123. package/dist/toggle.cjs +1 -1
  124. package/dist/toggle.d.ts +12 -26
  125. package/dist/toggle.d.ts.map +1 -1
  126. package/dist/toggle.js +18 -22
  127. package/package.json +2 -2
  128. package/src/blocks/data-table.tsx +1 -1
  129. package/src/blocks/sidebar.tsx +157 -532
  130. package/src/components/accordion.tsx +1 -1
  131. package/src/components/alert.tsx +1 -1
  132. package/src/components/breadcrumb.tsx +1 -1
  133. package/src/components/button.tsx +1 -1
  134. package/src/components/calendar.tsx +6 -4
  135. package/src/components/centred-layout.tsx +11 -24
  136. package/src/components/checkbox.tsx +5 -6
  137. package/src/components/combobox.tsx +481 -301
  138. package/src/components/command.tsx +1 -1
  139. package/src/components/context-menu.tsx +1 -1
  140. package/src/components/date-picker.tsx +1 -1
  141. package/src/components/dialog.tsx +1 -1
  142. package/src/components/dropdown-menu.tsx +1 -1
  143. package/src/components/field.tsx +2 -0
  144. package/src/components/input-group.tsx +14 -2
  145. package/src/components/input-otp.tsx +17 -2
  146. package/src/components/input-password.tsx +7 -2
  147. package/src/components/input.tsx +11 -3
  148. package/src/components/link.tsx +1 -1
  149. package/src/components/logo.tsx +10 -8
  150. package/src/components/menubar.tsx +3 -1
  151. package/src/components/navigation-menu.tsx +37 -99
  152. package/src/components/pagination.tsx +13 -19
  153. package/src/components/radio-group.tsx +28 -38
  154. package/src/components/resizable.tsx +5 -43
  155. package/src/components/select.tsx +8 -3
  156. package/src/components/separator.tsx +5 -5
  157. package/src/components/sheet.tsx +6 -11
  158. package/src/components/sonner.tsx +24 -27
  159. package/src/components/switch.figma.tsx +7 -11
  160. package/src/components/switch.tsx +9 -19
  161. package/src/components/table.tsx +23 -18
  162. package/src/components/tabs.tsx +27 -3
  163. package/src/components/textarea.tsx +12 -5
  164. package/src/components/toggle-group.tsx +115 -86
  165. package/src/components/toggle.figma.tsx +13 -19
  166. 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 "lucide-react";
5
+ import { ChevronDownIcon } from "@brightlocal/icons";
6
6
 
7
7
  import { cn } from "@brightlocal/ui-components/lib/utils";
8
8
 
@@ -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 "lucide-react";
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 "lucide-react";
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 "lucide-react";
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 "lucide-react";
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
- function CalendarDayButton({
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 enum CentredLayoutBreakpoint {
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 = CentredLayoutBreakpoint.XL,
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
- [CentredLayoutBreakpoint.XL]: "max-w-7xl",
85
- [CentredLayoutBreakpoint.LG]: "max-w-5xl",
86
- [CentredLayoutBreakpoint.MD]: "max-w-3xl",
87
- [CentredLayoutBreakpoint.SM]: "max-w-2xl",
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 "lucide-react";
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-destructive/40 dark:border-destructive/60",
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
- Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, "disabled">,
42
- VariantProps<typeof checkboxVariants> {
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) */