@brightlocal/ui-components 0.4.0 → 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.
Files changed (150) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.js +2 -2
  4. package/dist/alert.cjs +1 -1
  5. package/dist/alert.js +64 -64
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.js +47 -47
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts.map +1 -1
  10. package/dist/blocks/sidebar.js +27 -26
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.js +34 -34
  13. package/dist/button.cjs +1 -1
  14. package/dist/button.d.ts.map +1 -1
  15. package/dist/button.js +58 -57
  16. package/dist/calendar.cjs +1 -1
  17. package/dist/calendar.d.ts.map +1 -1
  18. package/dist/calendar.js +19 -37
  19. package/dist/card.cjs +1 -1
  20. package/dist/card.d.ts +5 -0
  21. package/dist/card.d.ts.map +1 -1
  22. package/dist/card.js +49 -36
  23. package/dist/centred-layout.cjs +1 -1
  24. package/dist/centred-layout.d.ts +3 -8
  25. package/dist/centred-layout.d.ts.map +1 -1
  26. package/dist/centred-layout.js +33 -48
  27. package/dist/chart.cjs +2 -2
  28. package/dist/chart.d.ts +3 -1
  29. package/dist/chart.d.ts.map +1 -1
  30. package/dist/chart.js +21 -21
  31. package/dist/checkbox.cjs +1 -1
  32. package/dist/checkbox.js +9 -9
  33. package/dist/combobox.cjs +1 -1
  34. package/dist/combobox.d.ts +6 -1
  35. package/dist/combobox.d.ts.map +1 -1
  36. package/dist/combobox.js +126 -116
  37. package/dist/command.cjs +1 -1
  38. package/dist/command.js +35 -35
  39. package/dist/context-menu.cjs +1 -1
  40. package/dist/context-menu.js +3 -3
  41. package/dist/date-picker.cjs +1 -1
  42. package/dist/date-picker.js +7 -7
  43. package/dist/dialog.cjs +1 -1
  44. package/dist/dialog.js +22 -22
  45. package/dist/dropdown-menu.cjs +1 -1
  46. package/dist/dropdown-menu.d.ts.map +1 -1
  47. package/dist/dropdown-menu.js +47 -52
  48. package/dist/field.cjs +1 -1
  49. package/dist/field.d.ts.map +1 -1
  50. package/dist/field.js +50 -49
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +334 -319
  55. package/dist/input-chip.d.ts.map +1 -1
  56. package/dist/input-chip.js +18 -25
  57. package/dist/input-group.cjs +1 -1
  58. package/dist/input-group.js +10 -10
  59. package/dist/input-otp.cjs +1 -1
  60. package/dist/input-otp.js +6 -6
  61. package/dist/input-password.cjs +1 -1
  62. package/dist/input-password.d.ts.map +1 -1
  63. package/dist/input-password.js +56 -56
  64. package/dist/input.cjs +1 -1
  65. package/dist/input.js +9 -9
  66. package/dist/label.cjs +1 -1
  67. package/dist/label.js +1 -1
  68. package/dist/link.cjs +1 -1
  69. package/dist/link.d.ts.map +1 -1
  70. package/dist/link.js +1 -8
  71. package/dist/logo.cjs +1 -1
  72. package/dist/logo.d.ts.map +1 -1
  73. package/dist/logo.js +30 -17
  74. package/dist/menubar.cjs +1 -1
  75. package/dist/menubar.js +13 -13
  76. package/dist/navigation-menu.cjs +1 -1
  77. package/dist/navigation-menu.d.ts.map +1 -1
  78. package/dist/navigation-menu.js +2 -1
  79. package/dist/pagination.cjs +1 -1
  80. package/dist/pagination.d.ts.map +1 -1
  81. package/dist/pagination.js +28 -28
  82. package/dist/radio-group.cjs +1 -1
  83. package/dist/radio-group.js +3 -3
  84. package/dist/rating.cjs +1 -1
  85. package/dist/rating.js +8 -8
  86. package/dist/resizable.cjs +1 -1
  87. package/dist/resizable.d.ts +1 -1
  88. package/dist/resizable.js +1 -1
  89. package/dist/select.cjs +1 -1
  90. package/dist/select.d.ts +1 -1
  91. package/dist/select.d.ts.map +1 -1
  92. package/dist/select.js +40 -44
  93. package/dist/sheet.cjs +1 -1
  94. package/dist/sheet.d.ts +1 -1
  95. package/dist/sheet.d.ts.map +1 -1
  96. package/dist/sheet.js +19 -19
  97. package/dist/sonner.cjs +1 -1
  98. package/dist/sonner.js +1 -1
  99. package/dist/switch.cjs +1 -1
  100. package/dist/switch.js +28 -28
  101. package/dist/tabs.cjs +1 -1
  102. package/dist/tabs.d.ts.map +1 -1
  103. package/dist/tabs.js +10 -12
  104. package/dist/toggle.cjs +1 -1
  105. package/dist/toggle.js +9 -9
  106. package/dist/typography.cjs +1 -0
  107. package/dist/typography.d.ts +176 -0
  108. package/dist/typography.d.ts.map +1 -0
  109. package/dist/typography.js +331 -0
  110. package/package.json +2 -2
  111. package/src/blocks/data-table.tsx +10 -10
  112. package/src/blocks/sidebar.tsx +16 -15
  113. package/src/components/accordion.tsx +2 -2
  114. package/src/components/alert.tsx +10 -10
  115. package/src/components/breadcrumb.tsx +3 -3
  116. package/src/components/button.tsx +7 -7
  117. package/src/components/calendar.tsx +4 -19
  118. package/src/components/card.tsx +24 -1
  119. package/src/components/centred-layout.tsx +6 -29
  120. package/src/components/chart.tsx +5 -5
  121. package/src/components/checkbox.tsx +3 -3
  122. package/src/components/combobox.tsx +20 -8
  123. package/src/components/command.tsx +5 -5
  124. package/src/components/context-menu.tsx +3 -3
  125. package/src/components/date-picker.tsx +1 -1
  126. package/src/components/dialog.tsx +3 -3
  127. package/src/components/dropdown-menu.tsx +7 -12
  128. package/src/components/field.tsx +36 -33
  129. package/src/components/input-chip.tsx +1 -4
  130. package/src/components/input-group.tsx +1 -1
  131. package/src/components/input-otp.tsx +3 -3
  132. package/src/components/input-password.tsx +2 -10
  133. package/src/components/input.tsx +1 -1
  134. package/src/components/label.tsx +1 -1
  135. package/src/components/link.tsx +1 -5
  136. package/src/components/logo.tsx +16 -9
  137. package/src/components/menubar.tsx +3 -3
  138. package/src/components/navigation-menu.tsx +2 -1
  139. package/src/components/pagination.tsx +4 -8
  140. package/src/components/radio-group.tsx +2 -2
  141. package/src/components/rating.tsx +2 -2
  142. package/src/components/resizable.tsx +1 -1
  143. package/src/components/select.tsx +8 -12
  144. package/src/components/sheet.tsx +5 -5
  145. package/src/components/sonner.tsx +1 -1
  146. package/src/components/switch.tsx +1 -1
  147. package/src/components/tabs.tsx +0 -2
  148. package/src/components/toggle.tsx +1 -1
  149. package/src/components/typography.tsx +678 -0
  150. package/src/index.ts +1 -0
@@ -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 [&>svg]:size-4",
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,27 +203,12 @@ function Calendar({
203
203
  ...iconProps
204
204
  }) => {
205
205
  if (orientation === "left") {
206
- return (
207
- <ChevronLeft
208
- className={cn("size-4", chevronClassName)}
209
- {...iconProps}
210
- />
211
- );
206
+ return <ChevronLeft className={chevronClassName} {...iconProps} />;
212
207
  }
213
208
  if (orientation === "right") {
214
- return (
215
- <ChevronRight
216
- className={cn("size-4", chevronClassName)}
217
- {...iconProps}
218
- />
219
- );
209
+ return <ChevronRight className={chevronClassName} {...iconProps} />;
220
210
  }
221
- return (
222
- <ChevronDown
223
- className={cn("size-4", chevronClassName)}
224
- {...iconProps}
225
- />
226
- );
211
+ return <ChevronDown className={chevronClassName} {...iconProps} />;
227
212
  },
228
213
  DayButton: CalendarDayButton,
229
214
  ...components,
@@ -14,7 +14,15 @@ type CardVariant = "default" | "transparent" | "border" | "transparent-flush";
14
14
  const CardContext = React.createContext<{ flush: boolean }>({ flush: false });
15
15
 
16
16
  const cardVariants = cva(
17
- ["flex", "flex-col", "gap-8", "rounded-[14px]", "py-8", "transition-colors"],
17
+ [
18
+ "flex",
19
+ "flex-col",
20
+ "gap-8",
21
+ "rounded-xl",
22
+ "py-8",
23
+ "transition-colors",
24
+ "w-full",
25
+ ],
18
26
  {
19
27
  variants: {
20
28
  variant: {
@@ -61,6 +69,11 @@ type CardProps = React.ComponentProps<"div"> & {
61
69
  * Tracking label for analytics context
62
70
  */
63
71
  trackingLabel?: string;
72
+ /**
73
+ * Maximum width of the card (e.g., "420px", "600px", "100%")
74
+ * @default "400px"
75
+ */
76
+ maxWidth?: string | number;
64
77
  };
65
78
 
66
79
  /**
@@ -75,13 +88,22 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
75
88
  dataHook,
76
89
  trackingEl,
77
90
  trackingLabel,
91
+ maxWidth = "400px",
78
92
  children,
93
+ style,
79
94
  ...props
80
95
  },
81
96
  ref
82
97
  ) => {
83
98
  const flush = variant === "transparent-flush";
84
99
 
100
+ const maxWidthStyle =
101
+ maxWidth !== undefined
102
+ ? {
103
+ maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
104
+ }
105
+ : undefined;
106
+
85
107
  return (
86
108
  <CardContext.Provider value={{ flush }}>
87
109
  <div
@@ -91,6 +113,7 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
91
113
  data-slot="card"
92
114
  data-tracking-el={trackingEl || `card-${variant}`}
93
115
  data-tracking-label={trackingLabel}
116
+ style={{ ...maxWidthStyle, ...style }}
94
117
  {...props}
95
118
  >
96
119
  {children}
@@ -7,14 +7,13 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
7
7
  * -----------------------------------------------------------------------------------------------*/
8
8
 
9
9
  /**
10
- * CentredLayout provides a responsive centered container with max-width constraint.
10
+ * CentredLayout provides a full-page centered container.
11
11
  *
12
12
  * Spacing tokens used:
13
13
  * - Padding: section-padding-x/y tokens (responsive: 16px mobile, 24px desktop)
14
14
  * - Header to content gap: gap-4 (spacing.4 = 16px)
15
- * - Max width: max-w-7xl (1280px) by default
16
15
  *
17
- * The component centers content horizontally and vertically.
16
+ * The component takes full page width/height and centers content horizontally and vertically.
18
17
  *
19
18
  * @example
20
19
  * // Basic usage
@@ -49,50 +48,28 @@ interface CentredLayoutProps extends React.ComponentProps<"div"> {
49
48
  * Tracking label for analytics context
50
49
  */
51
50
  trackingLabel?: string;
52
- /**
53
- * Custom max-width value (overrides default 1280px)
54
- */
55
- maxWidth?: string | number;
56
51
  }
57
52
 
58
53
  /**
59
- * CentredLayout component for centering content with responsive max-width constraints.
54
+ * CentredLayout component for centering content with full page width/height.
60
55
  */
61
56
  const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
62
57
  (
63
- {
64
- className,
65
- maxWidth,
66
- children,
67
- dataHook,
68
- trackingEl,
69
- trackingLabel,
70
- ...props
71
- },
58
+ { className, children, dataHook, trackingEl, trackingLabel, ...props },
72
59
  ref
73
60
  ) => {
74
- // If custom maxWidth is provided, use inline style; otherwise use default max-w-7xl
75
- const maxWidthStyle =
76
- maxWidth !== undefined
77
- ? {
78
- maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
79
- }
80
- : undefined;
81
-
82
61
  return (
83
62
  <div
84
63
  ref={ref}
85
64
  className={cn(
86
65
  // Base styles with section-padding tokens (responsive: 16px mobile, 24px desktop) and gap-4 for header/content spacing
87
- "bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-section",
88
- !maxWidth && "max-w-7xl",
66
+ "bg-background p-section flex min-h-screen w-full flex-col items-center justify-center gap-4",
89
67
  className
90
68
  )}
91
69
  data-hook={dataHook}
92
70
  data-slot="centred-layout"
93
71
  data-tracking-el={trackingEl}
94
72
  data-tracking-label={trackingLabel}
95
- style={maxWidthStyle}
96
73
  {...props}
97
74
  >
98
75
  {children}
@@ -161,7 +138,7 @@ const CentredLayoutContent = React.forwardRef<
161
138
  <div
162
139
  ref={ref}
163
140
  className={cn(
164
- "flex flex-1 flex-col items-center justify-center",
141
+ "flex w-full flex-1 flex-col items-center justify-center",
165
142
  className
166
143
  )}
167
144
  data-slot="centred-layout-content"
@@ -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 [&>svg]:h-2.5 [&>svg]:w-2.5",
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 [&>svg]:h-3 [&>svg]:w-3"
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 { CheckIcon } from "@brightlocal/icons";
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-4 shrink-0 self-start mt-0.5",
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
- <CheckIcon className="size-3.5" />
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 { ChevronsUpDownIcon, CheckIcon, LoaderIcon } from "@brightlocal/icons";
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,9 +258,9 @@ const ComboboxTrigger = React.forwardRef<
259
258
  {...props}
260
259
  >
261
260
  {children}
262
- <ChevronsUpDownIcon
261
+ <ChevronsUpDown
263
262
  aria-hidden="true"
264
- className="text-muted-foreground ml-auto size-4 shrink-0"
263
+ className="text-muted-foreground ml-auto shrink-0"
265
264
  />
266
265
  </button>
267
266
  </PopoverTrigger>
@@ -311,6 +310,11 @@ export interface ComboboxContentProps {
311
310
  children: React.ReactNode;
312
311
  /** Alignment of the popover relative to trigger */
313
312
  align?: "start" | "center" | "end";
313
+ /**
314
+ * Hide the list area (and the input border). Useful for async search
315
+ * where you want to hide results until a minimum character count.
316
+ */
317
+ hideList?: boolean;
314
318
  }
315
319
 
316
320
  function ComboboxContent({
@@ -318,6 +322,7 @@ function ComboboxContent({
318
322
  className,
319
323
  children,
320
324
  align = "start",
325
+ hideList = false,
321
326
  }: ComboboxContentProps) {
322
327
  const { shouldFilter } = useComboboxContext();
323
328
 
@@ -326,9 +331,13 @@ function ComboboxContent({
326
331
  align={align}
327
332
  className={cn("w-[var(--radix-popover-trigger-width)] p-0", className)}
328
333
  data-slot="combobox-popover"
334
+ side="bottom"
329
335
  >
330
336
  <Command
331
- className="border-0 shadow-none"
337
+ className={cn(
338
+ "border-0 shadow-none",
339
+ hideList && "[&_[data-slot='command-input-wrapper']]:border-b-0"
340
+ )}
332
341
  data-slot="combobox-command"
333
342
  dataHook={dataHook || "combobox-command"}
334
343
  shouldFilter={shouldFilter}
@@ -525,9 +534,9 @@ const ComboboxItem = React.forwardRef<
525
534
  >
526
535
  {renderContent()}
527
536
  {isSelected && (
528
- <CheckIcon
537
+ <Check
529
538
  aria-hidden="true"
530
- className="text-muted-foreground size-4 shrink-0"
539
+ className="text-muted-foreground shrink-0"
531
540
  />
532
541
  )}
533
542
  </CommandItem>
@@ -576,7 +585,10 @@ function ComboboxLoading({ className, children }: ComboboxLoadingProps) {
576
585
  >
577
586
  {children || (
578
587
  <>
579
- <LoaderIcon aria-hidden="true" className="size-4 animate-spin" />
588
+ <div
589
+ aria-hidden="true"
590
+ className="size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"
591
+ />
580
592
  Loading...
581
593
  </>
582
594
  )}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from "react";
4
4
  import { Command as CommandPrimitive } from "cmdk";
5
- import { CheckIcon, SearchIcon, XIcon } from "@brightlocal/icons";
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
- <SearchIcon className="size-4 shrink-0 opacity-50" />
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
- <XIcon className="size-4" />
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 [&_svg:not([class*='text-'])]:text-muted-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 [&_svg:not([class*='size-'])]:size-4",
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 && <CheckIcon className="text-foreground ml-auto size-4" />}
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 size-4" />
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 className="size-4" />
344
+ <Check />
345
345
  </ContextMenuPrimitive.ItemIndicator>
346
346
  </span>
347
347
  {children}
@@ -395,7 +395,7 @@ const ContextMenuRadioItem = React.forwardRef<
395
395
  >
396
396
  <span className="absolute left-2 flex size-3.5 items-center justify-center">
397
397
  <ContextMenuPrimitive.ItemIndicator>
398
- <Circle className="size-2 fill-current" />
398
+ <Circle className="fill-current" size={8} />
399
399
  </ContextMenuPrimitive.ItemIndicator>
400
400
  </span>
401
401
  {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 size-4 -translate-y-1/2",
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 { XIcon } from "@brightlocal/icons";
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 [&_svg:not([class*='size-'])]:size-4">
134
- <XIcon />
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 className="size-4" />
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
  )}
@@ -354,7 +350,7 @@ const DropdownMenuRadioItem = React.forwardRef<
354
350
  >
355
351
  <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
356
352
  <DropdownMenuPrimitive.ItemIndicator>
357
- <Circle className="size-2 fill-current" />
353
+ <Circle className="fill-current" size={8} />
358
354
  </DropdownMenuPrimitive.ItemIndicator>
359
355
  </span>
360
356
  {children}
@@ -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 size-4" />
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 size-4 opacity-50" />
645
+ <ChevronsUpDown className="text-muted-foreground opacity-50" />
651
646
  </DropdownMenuPrimitive.Trigger>
652
647
  );
653
648
  }
@@ -64,39 +64,41 @@ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
64
64
  );
65
65
  }
66
66
 
67
- const fieldVariants = cva("group/field flex w-full gap-2", {
68
- variants: {
69
- orientation: {
70
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
71
- horizontal: [
72
- "grid grid-cols-[auto_1fr] items-center",
73
- "[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",
74
- "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
75
- ],
76
- responsive: [
77
- "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto",
78
- "@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2",
79
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
80
- ],
67
+ const fieldVariants = cva(
68
+ [
69
+ "group/field flex w-full gap-2",
70
+ // Label leading overrides: use leading-normal for wrap-capable labels (checkbox)
71
+ "has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal",
72
+ ],
73
+ {
74
+ variants: {
75
+ orientation: {
76
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
77
+ horizontal: [
78
+ "grid grid-cols-[auto_1fr] items-center gap-x-2",
79
+ "[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",
80
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
81
+ ],
82
+ responsive: [
83
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto",
84
+ "@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2",
85
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
86
+ ],
87
+ },
81
88
  },
82
- },
83
- defaultVariants: {
84
- orientation: "vertical",
85
- },
86
- });
89
+ defaultVariants: {
90
+ orientation: "vertical",
91
+ },
92
+ }
93
+ );
87
94
 
88
95
  /**
89
96
  * Props for the Field component
90
97
  */
91
98
  interface FieldProps
92
- extends React.ComponentProps<"div">,
93
- VariantProps<typeof fieldVariants> {}
99
+ extends React.ComponentProps<"div">, VariantProps<typeof fieldVariants> {}
94
100
 
95
- function Field({
96
- className,
97
- orientation = "vertical",
98
- ...props
99
- }: FieldProps) {
101
+ function Field({ className, orientation = "vertical", ...props }: FieldProps) {
100
102
  return (
101
103
  <div
102
104
  className={cn(fieldVariants({ orientation }), className)}
@@ -142,6 +144,7 @@ function FieldLabel({
142
144
  <Label
143
145
  className={cn(
144
146
  // Base label styles from primitives are inherited via Label component
147
+ // Reset to mb-0 when label wraps a field (card variant for radio/checkbox)
145
148
  "group/field-label peer/field-label w-fit",
146
149
  // Field-specific container styles
147
150
  "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
@@ -195,7 +198,10 @@ interface FieldErrorItem {
195
198
  /**
196
199
  * Props for the FieldError component
197
200
  */
198
- interface FieldErrorProps extends Omit<React.ComponentProps<"div">, "children"> {
201
+ interface FieldErrorProps extends Omit<
202
+ React.ComponentProps<"div">,
203
+ "children"
204
+ > {
199
205
  /**
200
206
  * Data hook for automated testing (REQUIRED)
201
207
  */
@@ -251,10 +257,7 @@ function FieldErrorIcon({
251
257
  return (
252
258
  <Icon
253
259
  aria-hidden="true"
254
- className={cn(
255
- "inline-block size-4 shrink-0 align-text-bottom",
256
- className
257
- )}
260
+ className={cn("inline-block shrink-0 align-text-bottom", className)}
258
261
  {...props}
259
262
  />
260
263
  );
@@ -297,8 +300,8 @@ function FieldError({
297
300
  ...props
298
301
  }: FieldErrorProps) {
299
302
  // Filter out undefined errors and those without messages
300
- const errorMessages = errors?.filter(
301
- (e): e is FieldErrorItem => Boolean(e?.message)
303
+ const errorMessages = errors?.filter((e): e is FieldErrorItem =>
304
+ Boolean(e?.message)
302
305
  );
303
306
 
304
307
  // If no children and no valid errors, don't render anything
@@ -504,10 +504,7 @@ function InputChipItems({
504
504
  }
505
505
 
506
506
  return (
507
- <div
508
- className={cn("contents", className)}
509
- data-slot="input-chip-items"
510
- >
507
+ <div className={cn("contents", className)} data-slot="input-chip-items">
511
508
  {value.map((item, index) => (
512
509
  <Chip
513
510
  key={`${item}-${index}`}
@@ -141,7 +141,7 @@ const inputGroupButtonVariants = cva(
141
141
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
142
142
  "disabled:pointer-events-none disabled:opacity-50",
143
143
  "text-muted-foreground hover:text-foreground",
144
- "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
144
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
145
145
  ],
146
146
  {
147
147
  variants: {