@rovula/ui 0.1.29 → 0.1.31

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.
@@ -37,51 +37,61 @@ const Table = React.forwardRef<
37
37
  */
38
38
  scrollableWrapper?: boolean;
39
39
  } & React.HTMLAttributes<HTMLTableElement>
40
- >(({ rootClassName, className, rootRef, bordered = false, scrollableWrapper = true, ...props }, ref) => {
41
- const scrollClassName = cn(
42
- "relative h-full w-full min-h-0 overflow-auto",
43
- "ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s",
44
- );
40
+ >(
41
+ (
42
+ {
43
+ rootClassName,
44
+ className,
45
+ rootRef,
46
+ bordered = false,
47
+ scrollableWrapper = true,
48
+ ...props
49
+ },
50
+ ref,
51
+ ) => {
52
+ const scrollClassName = cn(
53
+ "relative h-full w-full min-h-0 overflow-auto",
54
+ "ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s",
55
+ );
45
56
 
46
- const tableClassName = cn(
47
- "min-w-full caption-bottom border-separate border-spacing-0",
48
- className,
49
- );
57
+ const tableClassName = cn(
58
+ "min-w-full caption-bottom border-separate border-spacing-0",
59
+ className,
60
+ );
50
61
 
51
- const tableEl = (
52
- <table ref={ref} className={tableClassName} {...props} />
53
- );
62
+ const tableEl = <table ref={ref} className={tableClassName} {...props} />;
54
63
 
55
- if (!bordered && scrollableWrapper === false) {
56
- return (
57
- <table
58
- ref={ref}
59
- className={cn(tableClassName, rootClassName)}
60
- {...props}
61
- />
62
- );
63
- }
64
+ if (!bordered && scrollableWrapper === false) {
65
+ return (
66
+ <table
67
+ ref={ref}
68
+ className={cn(tableClassName, rootClassName)}
69
+ {...props}
70
+ />
71
+ );
72
+ }
73
+
74
+ if (bordered) {
75
+ return (
76
+ <div
77
+ className={cn(
78
+ "relative flex h-full w-full min-h-0 flex-col overflow-hidden rounded-md border border-table-c-border",
79
+ rootClassName,
80
+ )}
81
+ ref={rootRef}
82
+ >
83
+ <div className={scrollClassName}>{tableEl}</div>
84
+ </div>
85
+ );
86
+ }
64
87
 
65
- if (bordered) {
66
88
  return (
67
- <div
68
- className={cn(
69
- "relative flex h-full w-full min-h-0 flex-col overflow-hidden rounded-md border border-table-c-border",
70
- rootClassName,
71
- )}
72
- ref={rootRef}
73
- >
74
- <div className={scrollClassName}>{tableEl}</div>
89
+ <div className={cn(scrollClassName, rootClassName)} ref={rootRef}>
90
+ {tableEl}
75
91
  </div>
76
92
  );
77
- }
78
-
79
- return (
80
- <div className={cn(scrollClassName, rootClassName)} ref={rootRef}>
81
- {tableEl}
82
- </div>
83
- );
84
- });
93
+ },
94
+ );
85
95
  Table.displayName = "Table";
86
96
 
87
97
  // ---------------------------------------------------------------------------
@@ -99,7 +109,7 @@ const TableHeader = React.forwardRef<
99
109
  <thead
100
110
  ref={ref}
101
111
  className={cn(
102
- "[&_tr>th]:border-b [&_tr>th]:border-b-table-c-header-line",
112
+ "[&_tr>th]:box-border [&_tr>th]:border-b [&_tr>th]:border-b-table-c-header-line",
103
113
  className,
104
114
  )}
105
115
  {...props}
@@ -179,7 +189,7 @@ const TableRow = React.forwardRef<
179
189
  <tr
180
190
  ref={ref}
181
191
  className={cn(
182
- "transition-colors",
192
+ "transition-colors box-border",
183
193
  // Row separator — applied on cells because border-separate ignores tr borders
184
194
  divided && [
185
195
  "[&>td]:border-b [&>td]:border-b-table-c-row-line",
@@ -207,9 +217,10 @@ const TableHead = React.forwardRef<
207
217
  <th
208
218
  ref={ref}
209
219
  className={cn(
210
- "h-[44px] box-border py-3 px-3 text-left align-middle",
220
+ "box-border py-3 px-3 text-left align-middle",
211
221
  "typography-body2 text-text-contrast-max",
212
222
  "bg-table-c-header-bg",
223
+ "leading-[20px]",
213
224
  // Prefer min-width only so callers (e.g. DataTable exactWidth) can set
214
225
  // a different width via inline style without fighting a fixed `w-10`.
215
226
  "[&:has([role=checkbox])]:px-3 [&:has([role=checkbox])]:min-w-10",
@@ -230,8 +241,9 @@ const TableCell = React.forwardRef<
230
241
  <td
231
242
  ref={ref}
232
243
  className={cn(
233
- "h-[42px] box-border py-3 px-3 text-left align-middle",
244
+ "box-border py-3 px-3 text-left align-middle",
234
245
  "typography-body3 text-text-contrast-max",
246
+ "leading-[18px]", // content สูง 18
235
247
  // Inherit row background from <tr> so every cell paints the same fill
236
248
  // (some table layouts / browsers leave the last column visually “empty”).
237
249
  "bg-inherit",