@brightlocal/ui-components 2.3.0 → 2.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/dist/textarea.js CHANGED
@@ -9,7 +9,7 @@ const b = c([
9
9
  "border border-input bg-background rounded-md",
10
10
  "outline-none transition-[border-color,background-color,box-shadow]",
11
11
  // Typography
12
- "text-sm leading-normal font-sans",
12
+ "text-base leading-normal font-sans",
13
13
  "text-foreground",
14
14
  // Spacing
15
15
  "px-3 py-2",
@@ -21,23 +21,23 @@ const b = c([
21
21
  // Pseudo-elements
22
22
  "placeholder:text-muted-foreground"
23
23
  ]), f = l.forwardRef(
24
- ({ className: a, dataHook: o, error: t, trackingEl: i, trackingLabel: d, ...r }, s) => {
25
- const e = t || r["aria-invalid"] === !0 || r["aria-invalid"] === "true";
24
+ ({ className: a, dataHook: o, error: t, trackingEl: i, trackingLabel: d, ...e }, s) => {
25
+ const r = t || e["aria-invalid"] === !0 || e["aria-invalid"] === "true";
26
26
  return /* @__PURE__ */ n(
27
27
  "textarea",
28
28
  {
29
29
  ref: s,
30
- "aria-invalid": e ? "true" : void 0,
30
+ "aria-invalid": r ? "true" : void 0,
31
31
  className: u(
32
32
  b(),
33
- e && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
33
+ r && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
34
34
  a
35
35
  ),
36
36
  "data-hook": o,
37
37
  "data-slot": "textarea",
38
38
  "data-tracking-el": i,
39
39
  "data-tracking-label": d,
40
- ...r
40
+ ...e
41
41
  }
42
42
  );
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -42,14 +42,32 @@
42
42
  "import": "./dist/lib/utils.js",
43
43
  "require": "./dist/lib/utils.cjs"
44
44
  },
45
- "./blocks/*": {
45
+ "./data-table": {
46
46
  "source": {
47
- "types": "./src/blocks/*.tsx",
48
- "import": "./src/blocks/*.tsx"
47
+ "types": "./src/blocks/data-table.tsx",
48
+ "import": "./src/blocks/data-table.tsx"
49
49
  },
50
- "types": "./dist/blocks/*.d.ts",
51
- "import": "./dist/blocks/*.js",
52
- "require": "./dist/blocks/*.cjs"
50
+ "types": "./dist/blocks/data-table.d.ts",
51
+ "import": "./dist/blocks/data-table.js",
52
+ "require": "./dist/blocks/data-table.cjs"
53
+ },
54
+ "./input-list": {
55
+ "source": {
56
+ "types": "./src/blocks/input-list.tsx",
57
+ "import": "./src/blocks/input-list.tsx"
58
+ },
59
+ "types": "./dist/blocks/input-list.d.ts",
60
+ "import": "./dist/blocks/input-list.js",
61
+ "require": "./dist/blocks/input-list.cjs"
62
+ },
63
+ "./sidebar": {
64
+ "source": {
65
+ "types": "./src/blocks/sidebar.tsx",
66
+ "import": "./src/blocks/sidebar.tsx"
67
+ },
68
+ "types": "./dist/blocks/sidebar.d.ts",
69
+ "import": "./dist/blocks/sidebar.js",
70
+ "require": "./dist/blocks/sidebar.cjs"
53
71
  },
54
72
  "./tailwind.css": {
55
73
  "default": "./tailwind.css"
@@ -81,8 +99,14 @@
81
99
  "lib/*": [
82
100
  "dist/lib/*"
83
101
  ],
84
- "blocks/*": [
85
- "dist/blocks/*"
102
+ "data-table": [
103
+ "dist/blocks/data-table"
104
+ ],
105
+ "input-list": [
106
+ "dist/blocks/input-list"
107
+ ],
108
+ "sidebar": [
109
+ "dist/blocks/sidebar"
86
110
  ],
87
111
  "*": [
88
112
  "dist/*"
@@ -162,7 +186,7 @@
162
186
  "sonner": "^2.0.7",
163
187
  "tailwind-merge": "^3.4.0",
164
188
  "vaul": "^1.1.2",
165
- "@brightlocal/icons": "2.1.0"
189
+ "@brightlocal/icons": "2.1.1"
166
190
  },
167
191
  "size-limit": [
168
192
  {
@@ -447,7 +447,7 @@ export function DataTable<TData>({
447
447
  return (
448
448
  <div
449
449
  aria-busy={isLoading || undefined}
450
- className={cn(className)}
450
+ className={cn("border-border rounded-md border", className)}
451
451
  data-hook={dataHook}
452
452
  data-slot="data-table-view"
453
453
  data-tracking-el={trackingEl}
@@ -675,7 +675,7 @@ export function VirtualizedDataTable<TData>({
675
675
  <div
676
676
  ref={scrollContainerRef}
677
677
  aria-busy={isLoading || undefined}
678
- className={cn("overflow-auto", className)}
678
+ className={cn("border-border overflow-auto rounded-md border", className)}
679
679
  data-hook={dataHook}
680
680
  data-slot="data-table-view"
681
681
  data-tracking-el={trackingEl}
@@ -322,7 +322,7 @@ const comboboxTriggerVariants = cva([
322
322
  "dark:bg-white/5 dark:border-white/15",
323
323
 
324
324
  // Typography
325
- "text-sm font-normal font-sans text-foreground",
325
+ "text-base font-normal font-sans text-foreground",
326
326
 
327
327
  // Placeholder state
328
328
  "data-[placeholder=true]:text-muted-foreground",
@@ -460,7 +460,7 @@ function ComboboxValue({
460
460
  return (
461
461
  <span
462
462
  className={cn(
463
- "text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",
463
+ "text-foreground overflow-hidden text-base leading-normal font-medium text-ellipsis whitespace-nowrap",
464
464
  className
465
465
  )}
466
466
  data-slot="combobox-value"
@@ -131,7 +131,7 @@ const CommandInput = React.forwardRef<
131
131
  <CommandPrimitive.Input
132
132
  ref={inputRef}
133
133
  className={cn(
134
- "placeholder:text-muted-foreground flex w-full bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
134
+ "placeholder:text-muted-foreground flex w-full bg-transparent text-base outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
135
135
  className
136
136
  )}
137
137
  data-slot="command-input"
@@ -218,7 +218,7 @@ const inputStyles = [
218
218
  "bg-transparent",
219
219
  "border-0 outline-none",
220
220
  // Typography
221
- "text-sm font-sans",
221
+ "text-base font-sans",
222
222
  "text-foreground",
223
223
  // Placeholder
224
224
  "placeholder:text-muted-foreground",
@@ -137,7 +137,7 @@ function InputOTPSlot({ index, className, ...props }: InputOTPSlotProps) {
137
137
  // Base styles
138
138
  "relative flex h-9 w-9 items-center justify-center",
139
139
  "border-input bg-background border-y border-r",
140
- "text-foreground text-sm font-normal transition-[border-color,box-shadow] outline-none",
140
+ "text-foreground text-base font-normal transition-[border-color,box-shadow] outline-none",
141
141
  "first:rounded-l-md first:border-l last:rounded-r-md",
142
142
  // Focus state
143
143
  "data-[active=true]:border-ring data-[active=true]:z-10",
@@ -16,7 +16,7 @@ export const inputVariants = cva(
16
16
  "border border-input bg-background rounded-sm",
17
17
  "outline-none transition-[border-color,box-shadow,background-color]",
18
18
  // Typography
19
- "text-sm font-sans",
19
+ "text-base font-sans",
20
20
  "text-foreground",
21
21
  "overflow-hidden text-ellipsis",
22
22
  // States - Focus
@@ -27,8 +27,7 @@ export const inputVariants = cva(
27
27
  // Pseudo-elements
28
28
  "placeholder:text-muted-foreground",
29
29
  "placeholder:overflow-hidden placeholder:text-ellipsis",
30
- // Text input alignment - uses design token for text/sm line-height (20px)
31
- "items-center px-3 pb-[1px] leading-5",
30
+ "items-center px-3",
32
31
  // Hide default browser icons for date/time inputs
33
32
  "[&::-webkit-calendar-picker-indicator]:hidden",
34
33
  ],
@@ -1,12 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { cn } from "@brightlocal/ui-components/lib/utils";
3
3
 
4
- /* -------------------------------------------------------------------------------------------------
5
- * Internal context — lets SplitLayoutContentLeft know if a header is present
6
- * -----------------------------------------------------------------------------------------------*/
7
-
8
- const SplitLayoutContext = React.createContext(false);
9
-
10
4
  /* -------------------------------------------------------------------------------------------------
11
5
  * SplitLayout Root
12
6
  * -----------------------------------------------------------------------------------------------*/
@@ -37,8 +31,10 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
37
31
  * and shows only the left section on smaller screens (hiding the right/marketing section).
38
32
  * This pattern is commonly used for authentication pages where the form is prioritized on mobile.
39
33
  *
40
- * Uses a composition pattern with SplitLayoutHeader, SplitLayoutContentLeft,
41
- * and SplitLayoutContentRight sub-components.
34
+ * Uses CSS Grid for slot positioning — sub-components self-place into the correct
35
+ * grid area via their own classes, so SplitLayout renders {children} without
36
+ * inspecting them. This enables composition through any wrapping: Fragments,
37
+ * router Outlets, memoized components, or conditional renders.
42
38
  *
43
39
  * @example
44
40
  * // Basic usage
@@ -65,6 +61,15 @@ interface SplitLayoutProps extends React.ComponentProps<"div"> {
65
61
  * </SplitLayoutContentRight>
66
62
  * </SplitLayout>
67
63
  *
64
+ * @example
65
+ * // With router Outlet — slots project up through any wrapping
66
+ * <SplitLayout dataHook="auth-layout">
67
+ * <SplitLayoutHeader>
68
+ * <Header dataHook="my-header"><Logo dataHook="my-logo" /></Header>
69
+ * </SplitLayoutHeader>
70
+ * <Outlet />
71
+ * </SplitLayout>
72
+ *
68
73
  * Layout specifications:
69
74
  * - Mobile/Tablet: Stacked layout, only left section visible, content centered
70
75
  * - Desktop (≥1024px): Side-by-side, content centered within each section
@@ -86,42 +91,11 @@ const SplitLayout = React.forwardRef<HTMLDivElement, SplitLayoutProps>(
86
91
  },
87
92
  ref
88
93
  ) => {
89
- const headerChildren: React.ReactNode[] = [];
90
- const leftChildren: React.ReactNode[] = [];
91
- const rightChildren: React.ReactNode[] = [];
92
-
93
- const collectChild = (child: React.ReactNode): void => {
94
- if (!React.isValidElement(child)) return;
95
- if (child.type === React.Fragment) {
96
- React.Children.forEach(
97
- (child.props as { children: React.ReactNode }).children,
98
- collectChild
99
- );
100
- return;
101
- }
102
- if (child.type === SplitLayoutHeader) {
103
- headerChildren.push(child);
104
- } else if (child.type === SplitLayoutContentRight) {
105
- rightChildren.push(child);
106
- } else {
107
- leftChildren.push(child);
108
- }
109
- };
110
- React.Children.forEach(children, collectChild);
111
-
112
- // Support legacy left/right props as fallback
113
- const hasLegacyProps = left != null || right != null;
114
- const hasCompositionChildren =
115
- leftChildren.length > 0 || rightChildren.length > 0;
116
- const useLegacy = hasLegacyProps && !hasCompositionChildren;
117
-
118
- const hasHeader = headerChildren.length > 0;
119
-
120
94
  return (
121
95
  <div
122
96
  ref={ref}
123
97
  className={cn(
124
- "flex min-h-screen w-full flex-col lg:flex-row",
98
+ "group/split-layout bg-background grid min-h-screen w-full grid-cols-1 grid-rows-[auto_1fr] lg:has-[[data-slot=split-layout-right]]:grid-cols-2",
125
99
  className
126
100
  )}
127
101
  data-hook={dataHook}
@@ -130,22 +104,9 @@ const SplitLayout = React.forwardRef<HTMLDivElement, SplitLayoutProps>(
130
104
  data-tracking-label={trackingLabel}
131
105
  {...props}
132
106
  >
133
- {/* Left column: header + left content stacked vertically */}
134
- <div
135
- className="bg-background flex flex-1 flex-col"
136
- data-slot="split-layout-body"
137
- >
138
- <SplitLayoutContext.Provider value={hasHeader}>
139
- {headerChildren}
140
- {useLegacy
141
- ? left && <SplitLayoutContentLeft>{left}</SplitLayoutContentLeft>
142
- : leftChildren}
143
- </SplitLayoutContext.Provider>
144
- </div>
145
- {/* Right column: extends full height with bg-card */}
146
- {useLegacy
147
- ? right && <SplitLayoutContentRight>{right}</SplitLayoutContentRight>
148
- : rightChildren}
107
+ {children}
108
+ {left && <SplitLayoutContentLeft>{left}</SplitLayoutContentLeft>}
109
+ {right && <SplitLayoutContentRight>{right}</SplitLayoutContentRight>}
149
110
  </div>
150
111
  );
151
112
  }
@@ -168,6 +129,7 @@ interface SplitLayoutHeaderProps extends React.ComponentProps<"div"> {
168
129
  * SplitLayoutHeader component for rendering header content at the top of SplitLayout.
169
130
  * Content is centered on mobile/tablet, left-aligned from lg breakpoint onwards.
170
131
  * Uses section padding tokens for responsive horizontal and vertical padding (16px mobile, 24px desktop).
132
+ * Self-positions in the first column, first row of the grid.
171
133
  */
172
134
  const SplitLayoutHeader = React.forwardRef<
173
135
  HTMLDivElement,
@@ -177,7 +139,7 @@ const SplitLayoutHeader = React.forwardRef<
177
139
  <div
178
140
  ref={ref}
179
141
  className={cn(
180
- "px-section-sm pt-section-sm flex w-full items-center justify-center lg:justify-start",
142
+ "px-section-sm pt-section-sm col-start-1 row-start-1 flex w-full items-center justify-center lg:justify-start",
181
143
  className
182
144
  )}
183
145
  data-slot="split-layout-header"
@@ -202,20 +164,19 @@ interface SplitLayoutContentLeftProps extends React.ComponentProps<"div"> {
202
164
  * SplitLayoutContentLeft - Left/primary section within a SplitLayout.
203
165
  *
204
166
  * Always visible. When a SplitLayoutHeader is present, top padding is
205
- * automatically reduced to avoid excessive spacing below the header.
167
+ * automatically reduced via CSS :has() to avoid excessive spacing below the header.
168
+ * Self-positions in the first column, second row of the grid.
206
169
  */
207
170
  const SplitLayoutContentLeft = React.forwardRef<
208
171
  HTMLDivElement,
209
172
  SplitLayoutContentLeftProps
210
173
  >(({ className, children, ...props }, ref) => {
211
- const hasHeader = React.useContext(SplitLayoutContext);
212
-
213
174
  return (
214
175
  <div
215
176
  ref={ref}
216
177
  className={cn(
217
- "p-section-sm flex flex-1 items-center justify-center overflow-auto",
218
- hasHeader && "pt-2",
178
+ "p-section-sm col-start-1 row-start-2 flex min-h-0 items-center justify-center overflow-auto",
179
+ "group-has-[[data-slot=split-layout-header]]/split-layout:pt-2",
219
180
  className
220
181
  )}
221
182
  data-slot="split-layout-left"
@@ -247,6 +208,7 @@ interface SplitLayoutContentRightProps extends React.ComponentProps<"div"> {
247
208
  *
248
209
  * Hidden on mobile/tablet (<1024px), visible on desktop (≥1024px).
249
210
  * Uses bg-card background color.
211
+ * Self-positions in the second column, spanning all rows of the grid.
250
212
  *
251
213
  * Set `flush` to remove padding for full-bleed content (e.g. images).
252
214
  */
@@ -258,10 +220,10 @@ const SplitLayoutContentRight = React.forwardRef<
258
220
  <div
259
221
  ref={ref}
260
222
  className={cn(
261
- "bg-card hidden",
223
+ "bg-card hidden lg:col-start-2 lg:row-span-full lg:row-start-1",
262
224
  flush
263
- ? "relative h-screen overflow-hidden lg:block lg:w-1/2 lg:shrink-0"
264
- : "p-section-sm flex-1 items-center justify-center overflow-auto lg:flex",
225
+ ? "relative overflow-hidden lg:block"
226
+ : "p-section-sm min-h-0 items-center justify-center overflow-auto lg:flex",
265
227
  className
266
228
  )}
267
229
  data-slot="split-layout-right"
@@ -5,6 +5,10 @@ import { cva, type VariantProps } from "class-variance-authority";
5
5
 
6
6
  import { cn } from "@brightlocal/ui-components/lib/utils";
7
7
 
8
+ /* -------------------------------------------------------------------------------------------------
9
+ * CVA Variants
10
+ * -----------------------------------------------------------------------------------------------*/
11
+
8
12
  const tableCellVariants = cva(
9
13
  "align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",
10
14
  {
@@ -17,6 +21,7 @@ const tableCellVariants = cva(
17
21
  align: {
18
22
  left: "text-left",
19
23
  right: "text-right",
24
+ center: "text-center",
20
25
  },
21
26
  },
22
27
  defaultVariants: {
@@ -27,12 +32,13 @@ const tableCellVariants = cva(
27
32
  );
28
33
 
29
34
  const tableHeadVariants = cva(
30
- "h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
35
+ "h-10 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
31
36
  {
32
37
  variants: {
33
38
  align: {
34
39
  left: "text-left",
35
40
  right: "text-right",
41
+ center: "text-center",
36
42
  },
37
43
  },
38
44
  defaultVariants: {
@@ -41,6 +47,10 @@ const tableHeadVariants = cva(
41
47
  }
42
48
  );
43
49
 
50
+ /* -------------------------------------------------------------------------------------------------
51
+ * Table
52
+ * -----------------------------------------------------------------------------------------------*/
53
+
44
54
  interface TableProps extends React.ComponentProps<"table"> {
45
55
  /**
46
56
  * Data hook for automated testing (REQUIRED)
@@ -57,26 +67,32 @@ interface TableProps extends React.ComponentProps<"table"> {
57
67
  }
58
68
 
59
69
  const Table = React.forwardRef<HTMLTableElement, TableProps>(
60
- ({ className, dataHook, trackingEl, trackingLabel, ...props }, ref) => (
61
- <div
62
- className="relative w-full overflow-x-auto"
63
- data-slot="table-container"
64
- >
65
- <table
66
- ref={ref}
67
- className={cn("w-full caption-bottom text-sm", className)}
68
- data-hook={dataHook}
69
- data-slot="table"
70
- data-tracking-el={trackingEl}
71
- data-tracking-label={trackingLabel}
72
- {...props}
73
- />
74
- </div>
75
- )
70
+ ({ className, dataHook, trackingEl, trackingLabel, ...props }, ref) => {
71
+ return (
72
+ <div
73
+ className="relative w-full overflow-x-auto"
74
+ data-slot="table-container"
75
+ >
76
+ <table
77
+ ref={ref}
78
+ className={cn("w-full caption-bottom text-sm", className)}
79
+ data-hook={dataHook}
80
+ data-slot="table"
81
+ data-tracking-el={trackingEl}
82
+ data-tracking-label={trackingLabel}
83
+ {...props}
84
+ />
85
+ </div>
86
+ );
87
+ }
76
88
  );
77
89
 
78
90
  Table.displayName = "Table";
79
91
 
92
+ /* -------------------------------------------------------------------------------------------------
93
+ * TableHeader
94
+ * -----------------------------------------------------------------------------------------------*/
95
+
80
96
  interface TableHeaderProps extends React.ComponentProps<"thead"> {
81
97
  /**
82
98
  * Data hook for automated testing
@@ -88,7 +104,7 @@ const TableHeader = React.forwardRef<HTMLTableSectionElement, TableHeaderProps>(
88
104
  ({ className, dataHook, ...props }, ref) => (
89
105
  <thead
90
106
  ref={ref}
91
- className={cn("[&_tr]:border-b", className)}
107
+ className={cn(className)}
92
108
  data-hook={dataHook}
93
109
  data-slot="table-header"
94
110
  {...props}
@@ -98,6 +114,10 @@ const TableHeader = React.forwardRef<HTMLTableSectionElement, TableHeaderProps>(
98
114
 
99
115
  TableHeader.displayName = "TableHeader";
100
116
 
117
+ /* -------------------------------------------------------------------------------------------------
118
+ * TableBody
119
+ * -----------------------------------------------------------------------------------------------*/
120
+
101
121
  interface TableBodyProps extends React.ComponentProps<"tbody"> {
102
122
  /**
103
123
  * Data hook for automated testing
@@ -109,7 +129,7 @@ const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(
109
129
  ({ className, dataHook, ...props }, ref) => (
110
130
  <tbody
111
131
  ref={ref}
112
- className={cn("[&_tr:last-child]:border-0", className)}
132
+ className={cn(className)}
113
133
  data-hook={dataHook}
114
134
  data-slot="table-body"
115
135
  {...props}
@@ -119,6 +139,10 @@ const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(
119
139
 
120
140
  TableBody.displayName = "TableBody";
121
141
 
142
+ /* -------------------------------------------------------------------------------------------------
143
+ * TableFooter
144
+ * -----------------------------------------------------------------------------------------------*/
145
+
122
146
  interface TableFooterProps extends React.ComponentProps<"tfoot"> {
123
147
  /**
124
148
  * Data hook for automated testing
@@ -130,7 +154,7 @@ const TableFooter = React.forwardRef<HTMLTableSectionElement, TableFooterProps>(
130
154
  ({ className, dataHook, ...props }, ref) => (
131
155
  <tfoot
132
156
  ref={ref}
133
- className={cn("bg-muted/50 border-t [&>tr]:last:border-b-0", className)}
157
+ className={cn("bg-muted/50", className)}
134
158
  data-hook={dataHook}
135
159
  data-slot="table-footer"
136
160
  {...props}
@@ -140,6 +164,10 @@ const TableFooter = React.forwardRef<HTMLTableSectionElement, TableFooterProps>(
140
164
 
141
165
  TableFooter.displayName = "TableFooter";
142
166
 
167
+ /* -------------------------------------------------------------------------------------------------
168
+ * TableRow
169
+ * -----------------------------------------------------------------------------------------------*/
170
+
143
171
  interface TableRowProps extends React.ComponentProps<"tr"> {
144
172
  /**
145
173
  * Data hook for automated testing
@@ -152,7 +180,7 @@ const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
152
180
  <tr
153
181
  ref={ref}
154
182
  className={cn(
155
- "data-[state=selected]:bg-muted border-b transition-colors duration-150 ease-in-out",
183
+ "data-[state=selected]:bg-muted transition-colors duration-150 ease-in-out",
156
184
  className
157
185
  )}
158
186
  data-hook={dataHook}
@@ -164,6 +192,10 @@ const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
164
192
 
165
193
  TableRow.displayName = "TableRow";
166
194
 
195
+ /* -------------------------------------------------------------------------------------------------
196
+ * TableHead
197
+ * -----------------------------------------------------------------------------------------------*/
198
+
167
199
  interface TableHeadProps
168
200
  extends
169
201
  Omit<React.ComponentProps<"th">, "align">,
@@ -177,19 +209,23 @@ interface TableHeadProps
177
209
  */
178
210
  minWidth?: string;
179
211
  /**
180
- * Text alignment for the header cell
212
+ * Text alignment for the header cell.
181
213
  * @default "left"
182
214
  */
183
- align?: "left" | "right";
215
+ align?: "left" | "right" | "center";
184
216
  }
185
217
 
186
218
  const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
187
- ({ className, dataHook, align, minWidth, style, ...props }, ref) => (
219
+ (
220
+ { className, dataHook, align, minWidth, style, scope = "col", ...props },
221
+ ref
222
+ ) => (
188
223
  <th
189
224
  ref={ref}
190
225
  className={cn(tableHeadVariants({ align }), className)}
191
226
  data-hook={dataHook}
192
227
  data-slot="table-head"
228
+ scope={scope}
193
229
  style={{ minWidth, ...style }}
194
230
  {...props}
195
231
  />
@@ -198,6 +234,10 @@ const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
198
234
 
199
235
  TableHead.displayName = "TableHead";
200
236
 
237
+ /* -------------------------------------------------------------------------------------------------
238
+ * TableCell
239
+ * -----------------------------------------------------------------------------------------------*/
240
+
201
241
  interface TableCellProps
202
242
  extends
203
243
  Omit<React.ComponentProps<"td">, "align">,
@@ -216,10 +256,10 @@ interface TableCellProps
216
256
  */
217
257
  size?: "default" | "md" | "lg";
218
258
  /**
219
- * Text alignment for the cell
259
+ * Text alignment for the cell.
220
260
  * @default "left"
221
261
  */
222
- align?: "left" | "right";
262
+ align?: "left" | "right" | "center";
223
263
  }
224
264
 
225
265
  const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(
@@ -237,6 +277,10 @@ const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(
237
277
 
238
278
  TableCell.displayName = "TableCell";
239
279
 
280
+ /* -------------------------------------------------------------------------------------------------
281
+ * TableCaption
282
+ * -----------------------------------------------------------------------------------------------*/
283
+
240
284
  interface TableCaptionProps extends React.ComponentProps<"caption"> {
241
285
  /**
242
286
  * Data hook for automated testing
@@ -250,7 +294,7 @@ const TableCaption = React.forwardRef<
250
294
  >(({ className, dataHook, ...props }, ref) => (
251
295
  <caption
252
296
  ref={ref}
253
- className={cn("text-muted-foreground mt-4 text-sm", className)}
297
+ className={cn("text-muted-foreground mt-4 text-center text-sm", className)}
254
298
  data-hook={dataHook}
255
299
  data-slot="table-caption"
256
300
  {...props}
@@ -259,6 +303,10 @@ const TableCaption = React.forwardRef<
259
303
 
260
304
  TableCaption.displayName = "TableCaption";
261
305
 
306
+ /* -------------------------------------------------------------------------------------------------
307
+ * Exports
308
+ * -----------------------------------------------------------------------------------------------*/
309
+
262
310
  export {
263
311
  Table,
264
312
  TableHeader,
@@ -10,7 +10,7 @@ const textareaVariants = cva([
10
10
  "border border-input bg-background rounded-md",
11
11
  "outline-none transition-[border-color,background-color,box-shadow]",
12
12
  // Typography
13
- "text-sm leading-normal font-sans",
13
+ "text-base leading-normal font-sans",
14
14
  "text-foreground",
15
15
  // Spacing
16
16
  "px-3 py-2",