@dmsi/wedgekit-react 0.0.140 → 0.0.142

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 (240) hide show
  1. package/dist/{chunk-4OS6APPF.js → chunk-4LXG6QNT.js} +2 -1
  2. package/dist/{chunk-KS4RDR6P.js → chunk-4NCDT5ZY.js} +21 -8
  3. package/dist/{chunk-R5TLUWDD.js → chunk-4T3DRGLF.js} +32 -30
  4. package/dist/{chunk-QZGUMB7T.js → chunk-4VTOTNKJ.js} +3 -0
  5. package/dist/{chunk-Y4HUYAI5.js → chunk-56Y5DDG3.js} +5 -2
  6. package/dist/{chunk-D2YP2BTN.js → chunk-5GOJRLQO.js} +10 -4
  7. package/dist/{chunk-J6LETUNM.js → chunk-AZ7LVLOK.js} +5 -2
  8. package/dist/{chunk-TTO4PL7Y.js → chunk-BATIOCXB.js} +7 -4
  9. package/dist/{chunk-CG2NIXZE.js → chunk-C4JGTH6G.js} +7 -3
  10. package/dist/{chunk-O4M2GISS.js → chunk-CYZL57LH.js} +5 -2
  11. package/dist/{chunk-6HIALT5L.js → chunk-E7D24OHM.js} +14 -5
  12. package/dist/{chunk-3ZUSYRI7.js → chunk-EPQLWHCL.js} +2 -2
  13. package/dist/{chunk-AY7ELVQY.js → chunk-EUXB3XKL.js} +5 -2
  14. package/dist/{chunk-6DONKNDT.js → chunk-EWGHVZL5.js} +2 -0
  15. package/dist/{chunk-VH3EJNVE.js → chunk-FFU6FB3K.js} +6 -3
  16. package/dist/{chunk-H6LXXGX6.js → chunk-FKMKHLQH.js} +6 -3
  17. package/dist/{chunk-4F6VQXKY.js → chunk-GG5JOFS6.js} +2 -1
  18. package/dist/{chunk-XCIBYDVK.js → chunk-GXSXCEAA.js} +25 -14
  19. package/dist/{chunk-VG4EPHJA.js → chunk-HVI3CL7Y.js} +6 -3
  20. package/dist/{chunk-AOELEEUS.js → chunk-I6GEUF6Y.js} +6 -3
  21. package/dist/{chunk-Z36QJ7ZF.js → chunk-J4E6Q5TM.js} +12 -9
  22. package/dist/{chunk-S5K22XTH.js → chunk-JWCT72WR.js} +5 -2
  23. package/dist/{chunk-QNQ5K7NW.js → chunk-LM5MKBPM.js} +8 -3
  24. package/dist/{chunk-EO3JJWFW.js → chunk-N6JVLYEE.js} +6 -3
  25. package/dist/{chunk-IGQVA7SC.js → chunk-NKUETCDA.js} +5 -2
  26. package/dist/{chunk-PCCJ7L3N.js → chunk-NMVSRA5Y.js} +12 -4
  27. package/dist/{chunk-X62XGQY7.js → chunk-NW2C4DL4.js} +18 -15
  28. package/dist/{chunk-OB3URVCR.js → chunk-PMBEIP24.js} +5 -1
  29. package/dist/{chunk-6UI5GABI.js → chunk-R7ELP5C5.js} +8 -5
  30. package/dist/{chunk-FWPJ73IK.js → chunk-SYEJVSE4.js} +3 -1
  31. package/dist/{chunk-WT5XXW6G.js → chunk-WFQEE2OO.js} +9 -4
  32. package/dist/{chunk-QTD7K43M.js → chunk-WSS2DFTP.js} +8 -6
  33. package/dist/{chunk-37TJJQL3.js → chunk-YR7JUKYO.js} +3 -0
  34. package/dist/{chunk-4JLU7TAC.js → chunk-ZFOANBWG.js} +3 -1
  35. package/dist/{chunk-P242H6OU.js → chunk-ZGFQN47L.js} +5 -2
  36. package/dist/components/AccessChangerTabItem.cjs +10 -4
  37. package/dist/components/AccessChangerTabItem.js +2 -2
  38. package/dist/components/Accordion.cjs +23 -11
  39. package/dist/components/Accordion.js +5 -5
  40. package/dist/components/Breadcrumbs.cjs +19 -8
  41. package/dist/components/Breadcrumbs.js +10 -5
  42. package/dist/components/Button.cjs +6 -3
  43. package/dist/components/Button.js +1 -1
  44. package/dist/components/CalendarRange.cjs +16 -5
  45. package/dist/components/CalendarRange.js +2 -2
  46. package/dist/components/Caption.cjs +18 -6
  47. package/dist/components/Caption.js +2 -2
  48. package/dist/components/Card.cjs +2 -1
  49. package/dist/components/Card.js +1 -1
  50. package/dist/components/Checkbox.cjs +18 -7
  51. package/dist/components/Checkbox.js +3 -3
  52. package/dist/components/ContentTab.cjs +22 -16
  53. package/dist/components/ContentTab.js +2 -2
  54. package/dist/components/ContentTabs.cjs +27 -18
  55. package/dist/components/ContentTabs.js +7 -4
  56. package/dist/components/DataGridCell.cjs +73 -39
  57. package/dist/components/DataGridCell.js +8 -8
  58. package/dist/components/DateInput.cjs +55 -35
  59. package/dist/components/DateInput.js +8 -4
  60. package/dist/components/DateRangeInput.cjs +55 -35
  61. package/dist/components/DateRangeInput.js +8 -4
  62. package/dist/components/Display.cjs +5 -2
  63. package/dist/components/Display.js +1 -1
  64. package/dist/components/FilterGroup.cjs +85 -44
  65. package/dist/components/FilterGroup.js +20 -10
  66. package/dist/components/FullViewportBox.cjs +3 -1
  67. package/dist/components/FullViewportBox.js +3 -1
  68. package/dist/components/Grid.cjs +3 -1
  69. package/dist/components/Grid.js +3 -1
  70. package/dist/components/Heading.cjs +5 -2
  71. package/dist/components/Heading.js +1 -1
  72. package/dist/components/HorizontalDivider.cjs +2 -2
  73. package/dist/components/HorizontalDivider.js +1 -1
  74. package/dist/components/Icon.cjs +5 -2
  75. package/dist/components/Icon.js +1 -1
  76. package/dist/components/Input.cjs +40 -32
  77. package/dist/components/Input.js +3 -3
  78. package/dist/components/InputGroup.cjs +11 -4
  79. package/dist/components/InputGroup.js +7 -3
  80. package/dist/components/Label.cjs +5 -2
  81. package/dist/components/Label.js +1 -1
  82. package/dist/components/Link.cjs +6 -3
  83. package/dist/components/Link.js +1 -1
  84. package/dist/components/List.cjs +3 -2
  85. package/dist/components/List.js +3 -2
  86. package/dist/components/LoadingScrim.cjs +4 -2
  87. package/dist/components/LoadingScrim.js +3 -2
  88. package/dist/components/MainBar.cjs +2 -0
  89. package/dist/components/MainBar.js +2 -0
  90. package/dist/components/Menu.cjs +3 -0
  91. package/dist/components/Menu.js +1 -1
  92. package/dist/components/MenuOption.cjs +19 -7
  93. package/dist/components/MenuOption.js +4 -4
  94. package/dist/components/MobileDataGrid.cjs +42 -18
  95. package/dist/components/MobileDataGrid.js +18 -11
  96. package/dist/components/Modal.cjs +38 -12
  97. package/dist/components/Modal.js +8 -8
  98. package/dist/components/ModalButtons.cjs +16 -6
  99. package/dist/components/ModalButtons.js +3 -3
  100. package/dist/components/ModalContent.cjs +3 -1
  101. package/dist/components/ModalContent.js +1 -1
  102. package/dist/components/ModalHeader.cjs +21 -9
  103. package/dist/components/ModalHeader.js +4 -4
  104. package/dist/components/ModalScrim.cjs +3 -1
  105. package/dist/components/ModalScrim.js +1 -1
  106. package/dist/components/NavigationTab.cjs +14 -5
  107. package/dist/components/NavigationTab.js +3 -3
  108. package/dist/components/NavigationTabs.cjs +17 -6
  109. package/dist/components/NavigationTabs.js +6 -4
  110. package/dist/components/NestedMenu.cjs +23 -9
  111. package/dist/components/NestedMenu.js +8 -6
  112. package/dist/components/Notification.cjs +32 -13
  113. package/dist/components/Notification.js +9 -5
  114. package/dist/components/OptionPill.cjs +21 -7
  115. package/dist/components/OptionPill.js +4 -4
  116. package/dist/components/PDFViewer.cjs +73 -29
  117. package/dist/components/PDFViewer.js +26 -20
  118. package/dist/components/Paragraph.cjs +6 -3
  119. package/dist/components/Paragraph.js +1 -1
  120. package/dist/components/Password.cjs +50 -37
  121. package/dist/components/Password.js +13 -8
  122. package/dist/components/PaymentOnAccountModal.cjs +135 -69
  123. package/dist/components/PaymentOnAccountModal.js +21 -21
  124. package/dist/components/ProjectBar.cjs +3 -1
  125. package/dist/components/ProjectBar.js +3 -1
  126. package/dist/components/Radio.cjs +12 -6
  127. package/dist/components/Radio.js +2 -2
  128. package/dist/components/Search.cjs +44 -32
  129. package/dist/components/Search.js +4 -4
  130. package/dist/components/Select.cjs +43 -32
  131. package/dist/components/Select.js +4 -4
  132. package/dist/components/SelectPaymentMethod.cjs +67 -29
  133. package/dist/components/SelectPaymentMethod.js +12 -12
  134. package/dist/components/SideMenu.cjs +3 -1
  135. package/dist/components/SideMenu.js +3 -1
  136. package/dist/components/SideMenuGroup.cjs +19 -8
  137. package/dist/components/SideMenuGroup.js +6 -4
  138. package/dist/components/SideMenuItem.cjs +15 -6
  139. package/dist/components/SideMenuItem.js +5 -2
  140. package/dist/components/Spinner.cjs +2 -1
  141. package/dist/components/Spinner.js +1 -1
  142. package/dist/components/Stack.cjs +6 -3
  143. package/dist/components/Stack.js +1 -1
  144. package/dist/components/StatusPill.cjs +12 -6
  145. package/dist/components/StatusPill.js +8 -5
  146. package/dist/components/Stepper.cjs +54 -38
  147. package/dist/components/Stepper.js +12 -7
  148. package/dist/components/Subheader.cjs +5 -2
  149. package/dist/components/Subheader.js +1 -1
  150. package/dist/components/Swatch.cjs +22 -10
  151. package/dist/components/Swatch.js +4 -4
  152. package/dist/components/Textarea.cjs +4 -1
  153. package/dist/components/Textarea.js +4 -1
  154. package/dist/components/Theme.cjs +2 -0
  155. package/dist/components/Theme.js +1 -1
  156. package/dist/components/Time.cjs +52 -36
  157. package/dist/components/Time.js +10 -5
  158. package/dist/components/Toast.cjs +29 -12
  159. package/dist/components/Toast.js +11 -6
  160. package/dist/components/Tooltip.cjs +3 -0
  161. package/dist/components/Tooltip.js +1 -1
  162. package/dist/components/TopBar.cjs +11 -4
  163. package/dist/components/TopBar.js +11 -4
  164. package/dist/components/Upload.cjs +30 -15
  165. package/dist/components/Upload.js +16 -10
  166. package/dist/components/index.cjs +221 -84
  167. package/dist/components/index.js +80 -38
  168. package/dist/index.css +24 -4
  169. package/package.json +1 -1
  170. package/src/components/Accordion.tsx +5 -2
  171. package/src/components/Breadcrumbs.tsx +9 -2
  172. package/src/components/Button.tsx +4 -1
  173. package/src/components/CalendarRange.tsx +9 -0
  174. package/src/components/Caption.tsx +11 -1
  175. package/src/components/Card.tsx +3 -2
  176. package/src/components/Checkbox.tsx +5 -0
  177. package/src/components/ContentTab.tsx +14 -12
  178. package/src/components/ContentTabs.tsx +6 -2
  179. package/src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx +4 -1
  180. package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +7 -0
  181. package/src/components/DataGrid/PinnedColumns.tsx +8 -1
  182. package/src/components/DataGrid/TableBody/LoadingCell.tsx +7 -3
  183. package/src/components/DataGrid/TableBody/TableBodyRow.tsx +7 -1
  184. package/src/components/DataGrid/TableBody/index.tsx +7 -1
  185. package/src/components/DataGrid/index.tsx +18 -2
  186. package/src/components/DataGrid/types.ts +1 -0
  187. package/src/components/DataGridCell.tsx +12 -0
  188. package/src/components/DateInput.tsx +4 -0
  189. package/src/components/DateRangeInput.tsx +4 -0
  190. package/src/components/Display.tsx +3 -0
  191. package/src/components/FilterGroup.tsx +10 -0
  192. package/src/components/FullViewportBox.tsx +3 -0
  193. package/src/components/Grid.tsx +3 -0
  194. package/src/components/Heading.tsx +3 -0
  195. package/src/components/HorizontalDivider.tsx +2 -2
  196. package/src/components/Icon.tsx +3 -0
  197. package/src/components/Input.tsx +32 -36
  198. package/src/components/InputGroup.tsx +6 -2
  199. package/src/components/Label.tsx +3 -0
  200. package/src/components/Link.tsx +3 -0
  201. package/src/components/List.tsx +3 -1
  202. package/src/components/LoadingScrim.tsx +2 -1
  203. package/src/components/MainBar.tsx +3 -0
  204. package/src/components/Menu.tsx +3 -0
  205. package/src/components/MenuOption.tsx +4 -0
  206. package/src/components/MobileDataGrid.tsx +12 -3
  207. package/src/components/Modal.tsx +7 -0
  208. package/src/components/ModalButtons.tsx +5 -0
  209. package/src/components/ModalContent.tsx +3 -0
  210. package/src/components/ModalHeader.tsx +5 -1
  211. package/src/components/ModalScrim.tsx +3 -0
  212. package/src/components/NavigationTab.tsx +3 -0
  213. package/src/components/NavigationTabs.tsx +7 -3
  214. package/src/components/NestedMenu.tsx +5 -2
  215. package/src/components/Notification.tsx +4 -0
  216. package/src/components/OptionPill.tsx +5 -0
  217. package/src/components/PDFViewer.tsx +16 -8
  218. package/src/components/Paragraph.tsx +3 -0
  219. package/src/components/Password.tsx +7 -2
  220. package/src/components/PaymentOnAccountModal.tsx +6 -2
  221. package/src/components/ProjectBar.tsx +3 -0
  222. package/src/components/Radio.tsx +4 -1
  223. package/src/components/Search.tsx +5 -0
  224. package/src/components/Select.tsx +4 -0
  225. package/src/components/SelectPaymentMethod.tsx +17 -3
  226. package/src/components/SideMenu.tsx +3 -0
  227. package/src/components/SideMenuGroup.tsx +4 -1
  228. package/src/components/SideMenuItem.tsx +4 -0
  229. package/src/components/Spinner.tsx +3 -1
  230. package/src/components/Stack.tsx +3 -0
  231. package/src/components/StatusPill.tsx +4 -1
  232. package/src/components/Stepper.tsx +6 -1
  233. package/src/components/Subheader.tsx +3 -0
  234. package/src/components/Textarea.tsx +4 -1
  235. package/src/components/Theme.tsx +3 -0
  236. package/src/components/Time.tsx +7 -1
  237. package/src/components/Toast.tsx +8 -3
  238. package/src/components/Tooltip.tsx +4 -0
  239. package/src/components/TopBar.tsx +7 -2
  240. package/src/components/Upload.tsx +10 -4
@@ -26,6 +26,7 @@ export interface CalendarRangeProps {
26
26
  */
27
27
  disableRange?: boolean;
28
28
  id?: string;
29
+ testid?: string;
29
30
  }
30
31
 
31
32
  /**
@@ -55,6 +56,7 @@ interface DateCellProps {
55
56
  /** True if range selection is disabled in single mode */
56
57
  isRangeDisabled?: boolean;
57
58
  id?: string;
59
+ testid?: string;
58
60
  }
59
61
 
60
62
  function DateCell({
@@ -72,12 +74,14 @@ function DateCell({
72
74
  cellPadding = "",
73
75
  isRangeDisabled = false,
74
76
  id,
77
+ testid,
75
78
  ...props
76
79
  }: DateCellProps & { cellPadding?: string }) {
77
80
  return (
78
81
  <span
79
82
  {...props}
80
83
  id={id}
84
+ data-testid={testid}
81
85
  className={clsx(
82
86
  "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
83
87
  typography.caption,
@@ -142,6 +146,7 @@ export function CalendarRange({
142
146
  cardStyle = false,
143
147
  disableRange = false,
144
148
  id,
149
+ testid,
145
150
  }: CalendarRangeProps) {
146
151
  const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
147
152
  // Parse from/to props
@@ -275,6 +280,7 @@ export function CalendarRange({
275
280
  return (
276
281
  <div
277
282
  id={id}
283
+ data-testid={testid}
278
284
  className={clsx(
279
285
  "relative bg-background-grouped-primary-normal rounded-base w-fit",
280
286
  layoutPaddding,
@@ -313,6 +319,7 @@ export function CalendarRange({
313
319
  {idx === 0 ? (
314
320
  <button
315
321
  id={id ? `${id}-prev-month-button` : undefined}
322
+ data-testid={testid ? `${testid}-prev-month-button` : undefined}
316
323
  type="button"
317
324
  className={clsx(
318
325
  "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
@@ -339,6 +346,7 @@ export function CalendarRange({
339
346
  {(mode === "double" ? idx === 1 : true) ? (
340
347
  <button
341
348
  id={id ? `${id}-next-month-button` : undefined}
349
+ data-testid={testid ? `${testid}-next-month-button` : undefined}
342
350
  type="button"
343
351
  className={clsx(
344
352
  "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
@@ -419,6 +427,7 @@ export function CalendarRange({
419
427
  <DateCell
420
428
  key={i}
421
429
  id={id ? `${id}-date-${date.toString()}` : undefined}
430
+ testid={testid ? `${testid}-date-${date.toString()}` : undefined}
422
431
  date={date}
423
432
  isInMonth={!!isInMonth}
424
433
  isToday={!!isToday}
@@ -12,6 +12,7 @@ type CaptionProps = {
12
12
  as?: Tags;
13
13
  style?: Style["style"];
14
14
  id?: string;
15
+ testid?: string;
15
16
  } & AsProps<Tags> &
16
17
  TextAttributes &
17
18
  TypographyProps;
@@ -24,14 +25,16 @@ export const Caption = ({
24
25
  color,
25
26
  align,
26
27
  id,
28
+ testid,
27
29
  ...props
28
30
  }: CaptionProps) => {
29
31
  const Element = as;
30
32
 
31
33
  return (
32
- <div id={id} className="flex gap-1">
34
+ <div id={id} data-testid={testid} className="flex gap-1">
33
35
  <WhichIcon
34
36
  id={id}
37
+ testid={testid}
35
38
  style={style}
36
39
  size={16}
37
40
  className="mt-[3px] desktop:mt-0"
@@ -39,6 +42,7 @@ export const Caption = ({
39
42
 
40
43
  <Element
41
44
  id={id ? `${id}-text` : undefined}
45
+ data-testid={testid ? `${testid}-text` : undefined}
42
46
  className={clsx(
43
47
  typography.caption.replace("text-text-primary-normal", ""),
44
48
  (style === "default" || style === "info") &&
@@ -67,17 +71,20 @@ const WhichIcon = ({
67
71
  size,
68
72
  className,
69
73
  id,
74
+ testid,
70
75
  }: {
71
76
  style: Style["style"];
72
77
  size: IconSize;
73
78
  className?: string;
74
79
  id?: string;
80
+ testid?: string;
75
81
  }) => {
76
82
  if (style === "success") {
77
83
  return (
78
84
  <span className="text-icon-success-normal contents">
79
85
  <Icon
80
86
  id={id ? `${id}-icon` : undefined}
87
+ testid={testid ? `${testid}-icon` : undefined}
81
88
  className={className}
82
89
  name="check_circle"
83
90
  size={size}
@@ -91,6 +98,7 @@ const WhichIcon = ({
91
98
  <span className="text-icon-warning-normal contents">
92
99
  <Icon
93
100
  id={id ? `${id}-icon` : undefined}
101
+ testid={testid ? `${testid}-icon` : undefined}
94
102
  className={className}
95
103
  name="warning"
96
104
  size={size}
@@ -104,6 +112,7 @@ const WhichIcon = ({
104
112
  <span className="text-icon-critical-normal contents">
105
113
  <Icon
106
114
  id={id ? `${id}-icon` : undefined}
115
+ testid={testid ? `${testid}-icon` : undefined}
107
116
  className={className}
108
117
  name="info"
109
118
  size={size}
@@ -117,6 +126,7 @@ const WhichIcon = ({
117
126
  <span className="text-icon-primary-normal contents">
118
127
  <Icon
119
128
  id={id ? `${id}-icon` : undefined}
129
+ testid={testid ? `${testid}-icon` : undefined}
120
130
  className={className}
121
131
  name="info"
122
132
  size={size}
@@ -1,11 +1,12 @@
1
1
  import clsx from "clsx";
2
2
  import { HTMLProps } from "react";
3
3
 
4
- export function Card(props: HTMLProps<HTMLDivElement> & { selected?: boolean; }) {
5
- const { children, selected, ...rest } = props;
4
+ export function Card(props: HTMLProps<HTMLDivElement> & { selected?: boolean; testid?: string; }) {
5
+ const { children, selected, testid, ...rest } = props;
6
6
  return (
7
7
  <div
8
8
  {...rest}
9
+ data-testid={testid}
9
10
  className={clsx(
10
11
  "rounded-sm p-desktop-layout-padding",
11
12
  selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
@@ -15,6 +15,7 @@ interface CheckboxProps
15
15
  indeterminate?: boolean;
16
16
  paragraphClassName?: string;
17
17
  id?: string;
18
+ testid?: string;
18
19
  }
19
20
 
20
21
  export const Checkbox = ({
@@ -27,6 +28,7 @@ export const Checkbox = ({
27
28
  indeterminate,
28
29
  paragraphClassName,
29
30
  id,
31
+ testid,
30
32
  ...props
31
33
  }: CheckboxProps) => {
32
34
  const selected = indeterminate || checked;
@@ -81,6 +83,7 @@ export const Checkbox = ({
81
83
  return (
82
84
  <label
83
85
  id={id}
86
+ data-testid={testid}
84
87
  htmlFor={id ? `${id}-input` : undefined}
85
88
  className={clsx(
86
89
  "flex items-center",
@@ -92,6 +95,7 @@ export const Checkbox = ({
92
95
  <div className="relative">
93
96
  <input
94
97
  id={id ? `${id}-input` : undefined}
98
+ data-testid={testid ? `${testid}-input` : undefined}
95
99
  type="checkbox"
96
100
  className="sr-only peer"
97
101
  disabled={disabled}
@@ -174,6 +178,7 @@ export const Checkbox = ({
174
178
  {label && (
175
179
  <Paragraph
176
180
  id={id ? `${id}-label` : undefined}
181
+ testid={testid ? `${testid}-label` : undefined}
177
182
  as="span"
178
183
  padded
179
184
  className={clsx(
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import clsx from "clsx";
4
- import React, { ComponentPropsWithRef, useCallback, useState } from "react";
4
+ import React, { ComponentPropsWithRef, useCallback } from "react";
5
5
  import { Button } from "./Button";
6
6
 
7
7
  export type ContentTabProps = {
@@ -11,6 +11,7 @@ export type ContentTabProps = {
11
11
  className?: string;
12
12
  fullWidth?: boolean;
13
13
  id?: string;
14
+ testid?: string;
14
15
  } & Omit<ComponentPropsWithRef<"button">, "id">;
15
16
 
16
17
  export const ContentTab = ({
@@ -22,10 +23,9 @@ export const ContentTab = ({
22
23
  ref,
23
24
  fullWidth,
24
25
  id,
26
+ testid,
25
27
  ...props
26
28
  }: ContentTabProps) => {
27
- const [active, setActive] = useState(false);
28
-
29
29
  const handleClick = useCallback(
30
30
  (e: React.MouseEvent<HTMLButtonElement>) => {
31
31
  if (!disabled) {
@@ -36,33 +36,34 @@ export const ContentTab = ({
36
36
  );
37
37
 
38
38
  const computedClassName = clsx(
39
- "absolute left-0 right-0 bottom-0 transition-colors duration-200 ease-in-out hover:bg-border-action-hover z-10",
40
- "rounded-px",
39
+ "absolute left-0 right-0 bottom-0 transition-colors duration-200 ease-in-out z-10",
40
+ "rounded-px ",
41
41
  "h-0.5",
42
- active && "bg-text-action-primary-active",
43
- !active && !disabled && "bg-text-action-primary-normal",
44
- !active && disabled && "bg-text-action-primary-disabled",
42
+ !disabled && "bg-text-action-primary-normal peer-hover:bg-border-action-hover peer-active:bg-border-action-active",
43
+ disabled && "bg-text-action-primary-disabled",
45
44
 
46
45
  className,
47
46
  );
48
47
 
49
48
  return (
50
- <div id={id} className={clsx(
49
+ <div id={id} data-testid={testid} className={clsx(
51
50
  "relative",
52
51
  fullWidth && "flex-1"
53
52
  )}>
54
53
  <Button
55
54
  id={id ? `${id}-button` : undefined}
55
+ testid={testid ? `${testid}-button` : undefined}
56
56
  block={fullWidth}
57
57
  ref={ref}
58
58
  variant="tertiary"
59
59
  disabled={disabled}
60
- onMouseDown={() => setActive(true)}
61
- onMouseLeave={() => setActive(false)}
62
- onMouseUp={() => setActive(false)}
63
60
  onClick={handleClick}
64
61
  role="tab"
65
62
  aria-selected={selected}
63
+ className={clsx(
64
+ "peer",
65
+ !selected && "!text-text-secondary-normal hover:!text-text-action-primary-hover active:!text-text-action-primary-active"
66
+ )}
66
67
  {...props}
67
68
  >
68
69
  {label}
@@ -70,6 +71,7 @@ export const ContentTab = ({
70
71
  {selected && (
71
72
  <div
72
73
  id={id ? `${id}-indicator` : undefined}
74
+ data-testid={testid ? `${testid}-indicator` : undefined}
73
75
  className={computedClassName}
74
76
  >
75
77
  {" "}
@@ -18,13 +18,14 @@ export type ContentTabsProps = {
18
18
  onTabChange?: (tabId: string) => void;
19
19
  fullWidthTabs?: boolean;
20
20
  id?: string;
21
+ testid?: string;
21
22
  selectedTab?: SelectedTab | null;
22
23
  };
23
24
 
24
25
  const afterClasses =
25
26
  "after:absolute after:bottom-0 after:left-0 after:w-full after:h-0.5 after:bg-border-primary-normal z-0";
26
27
 
27
- export const ContentTabs = ({ tabs, onTabChange, fullWidthTabs, id, selectedTab }: ContentTabsProps) => {
28
+ export const ContentTabs = ({ tabs, onTabChange, fullWidthTabs, id, testid, selectedTab }: ContentTabsProps) => {
28
29
  const [selectedTabId, setSelectedTabId] = useState<string>(tabs[0]?.id || "");
29
30
  const [focusedTabIndex, setFocusedTabIndex] = useState<number>(0);
30
31
  const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);
@@ -65,10 +66,11 @@ export const ContentTabs = ({ tabs, onTabChange, fullWidthTabs, id, selectedTab
65
66
  const selectedContent = tabs.find((tab) => tab.id === selectedTabId)?.content;
66
67
 
67
68
  return (
68
- <div id={id}>
69
+ <div id={id} data-testid={testid}>
69
70
  <div className="overflow-x-auto pb-2">
70
71
  <div
71
72
  id={id ? `${id}-tablist` : undefined}
73
+ data-testid={testid ? `${testid}-tablist` : undefined}
72
74
  role="tablist"
73
75
  aria-orientation="horizontal"
74
76
  className={clsx("flex relative", afterClasses)}
@@ -81,6 +83,7 @@ export const ContentTabs = ({ tabs, onTabChange, fullWidthTabs, id, selectedTab
81
83
  fullWidth={fullWidthTabs}
82
84
  key={tab.id}
83
85
  id={id ? `${id}-tab-${tab.id}` : undefined}
86
+ testid={testid ? `${testid}-tab-${tab.id}` : undefined}
84
87
  label={tab.label}
85
88
  selected={isSelected}
86
89
  onClick={() => handleTabClick(tab.id, index)}
@@ -106,6 +109,7 @@ export const ContentTabs = ({ tabs, onTabChange, fullWidthTabs, id, selectedTab
106
109
  {selectedContent && (
107
110
  <div
108
111
  id={(id ? `${id}-` : "") + `panel-${selectedTabId}`}
112
+ data-testid={(testid ? `${testid}-` : "") + `panel-${selectedTabId}`}
109
113
  className="mt-2"
110
114
  role="tabpanel"
111
115
  aria-labelledby={`tab-${selectedTabId}`}
@@ -4,10 +4,12 @@ import { Checkbox, MenuOption } from "../..";
4
4
 
5
5
  export function ColumnSelectorMenuOption<T>({
6
6
  id,
7
+ testid,
7
8
  column,
8
9
  toggleColumnVisibility,
9
10
  }: {
10
11
  id?: string;
12
+ testid?: string;
11
13
  column: Column<T, unknown>;
12
14
  toggleColumnVisibility: (id: string, isVisible: boolean) => void;
13
15
  }) {
@@ -17,9 +19,10 @@ export function ColumnSelectorMenuOption<T>({
17
19
  ? column.columnDef.header
18
20
  : null;
19
21
  return (
20
- <MenuOption id={id} selected={isVisible} defaultChecked={isVisible}>
22
+ <MenuOption id={id} testid={testid} selected={isVisible} defaultChecked={isVisible}>
21
23
  <Checkbox
22
24
  id={id ? `${id}-checkbox` : undefined}
25
+ testid={testid ? `${testid}-checkbox` : undefined}
23
26
  label={label ?? "Unknown"}
24
27
  checked={isVisible}
25
28
  onChange={(e) => {
@@ -5,11 +5,13 @@ import { ColumnSelectorMenuOption } from "./ColumnSelectorMenuOption";
5
5
 
6
6
  export function ColumnSelectorHeaderCell<T>({
7
7
  id,
8
+ testid,
8
9
  table,
9
10
  toggleColumnVisibility,
10
11
  resetColumnVisibility,
11
12
  }: {
12
13
  id?: string;
14
+ testid?: string;
13
15
  table: Table<T>;
14
16
  toggleColumnVisibility: (id: string, isVisible: boolean) => void;
15
17
  resetColumnVisibility: () => void;
@@ -20,6 +22,7 @@ export function ColumnSelectorHeaderCell<T>({
20
22
  return (
21
23
  <DataGridCell
22
24
  id={id}
25
+ testid={testid}
23
26
  width="48"
24
27
  type="header"
25
28
  color="text-secondary-normal"
@@ -27,6 +30,7 @@ export function ColumnSelectorHeaderCell<T>({
27
30
  >
28
31
  <Button
29
32
  id={id ? `${id}-button` : undefined}
33
+ testid={testid ? `${testid}-button` : undefined}
30
34
  onClick={() => setShow((prev) => !prev)}
31
35
  variant="navigation"
32
36
  iconOnly
@@ -34,6 +38,7 @@ export function ColumnSelectorHeaderCell<T>({
34
38
  ></Button>
35
39
  <Menu
36
40
  id={id ? `${id}-menu` : undefined}
41
+ testid={testid ? `${testid}-menu` : undefined}
37
42
  positionTo={ref}
38
43
  position="bottom-right"
39
44
  show={show}
@@ -41,6 +46,7 @@ export function ColumnSelectorHeaderCell<T>({
41
46
  >
42
47
  <Button
43
48
  id={id ? `${id}-reset-button` : undefined}
49
+ testid={testid ? `${testid}-reset-button` : undefined}
44
50
  variant="tertiary"
45
51
  onClick={() => {
46
52
  resetColumnVisibility();
@@ -55,6 +61,7 @@ export function ColumnSelectorHeaderCell<T>({
55
61
  .map((column) => (
56
62
  <ColumnSelectorMenuOption
57
63
  id={id ? `${id}-option-${column.id}` : undefined}
64
+ testid={testid ? `${testid}-option-${column.id}` : undefined}
58
65
  key={column.id}
59
66
  column={column}
60
67
  toggleColumnVisibility={toggleColumnVisibility}
@@ -18,6 +18,7 @@ interface PinnedColumnsProps<TData extends RowData> {
18
18
  allSelectedAcrossPages?: boolean;
19
19
  someSelectedAcrossPages?: boolean;
20
20
  toggleSelectAllAcrossPages?: () => void;
21
+ testid?: string;
21
22
  }
22
23
 
23
24
  export function PinnedColumns<TData>({
@@ -27,6 +28,7 @@ export function PinnedColumns<TData>({
27
28
  allSelectedAcrossPages,
28
29
  someSelectedAcrossPages,
29
30
  toggleSelectAllAcrossPages,
31
+ testid,
30
32
  ...props
31
33
  }: PinnedColumnsProps<TData>) {
32
34
  const headerGroups =
@@ -34,6 +36,8 @@ export function PinnedColumns<TData>({
34
36
  ? table.getLeftHeaderGroups()
35
37
  : table.getRightHeaderGroups();
36
38
 
39
+ const pinnedTestId = testid ? `${pinDirection}-pinned-${testid}` : undefined;
40
+
37
41
  return (
38
42
  headerGroups[0]?.headers.length > 0 && (
39
43
  <table
@@ -41,11 +45,12 @@ export function PinnedColumns<TData>({
41
45
  "flex flex-col min-h-min sticky z-20",
42
46
  pinDirection === "left" ? "left-0" : "right-0",
43
47
  )}
48
+ data-testid={pinnedTestId}
44
49
  >
45
50
  <thead className="sticky top-0 z-20 grid">
46
51
  {headerGroups.map((headerGroup) => {
47
52
  return (
48
- <tr key={headerGroup.id} className="flex w-full">
53
+ <tr key={headerGroup.id} data-testid={pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : undefined} className="flex w-full">
49
54
  {headerGroup.headers.map((header) => {
50
55
  if (!header) {
51
56
  return;
@@ -59,6 +64,7 @@ export function PinnedColumns<TData>({
59
64
  <DataCellHeader
60
65
  locked
61
66
  key={header.id}
67
+ testid={pinnedTestId ? `${pinnedTestId}-header-${header.id}` : undefined}
62
68
  header={header}
63
69
  center={centerHeader}
64
70
  width={customHeaderWidth}
@@ -134,6 +140,7 @@ export function PinnedColumns<TData>({
134
140
  </thead>
135
141
 
136
142
  <TableBody
143
+ testid={pinnedTestId}
137
144
  {...props}
138
145
  table={table}
139
146
  locked={true}
@@ -3,16 +3,18 @@ import { Checkbox, DataGridCell, Input } from "../..";
3
3
 
4
4
  export function LoadingCell<T extends RowData>({
5
5
  id,
6
+ testid,
6
7
  column,
7
8
  }: {
8
9
  id?: string;
10
+ testid?: string;
9
11
  column: ColumnDef<T>;
10
12
  }) {
11
13
  const key = `loading-${column.id}`;
12
14
  if (column.cell === "checkbox") {
13
15
  return (
14
- <DataGridCell id={id ? `${id}-${key}` : undefined} key={key}>
15
- <Checkbox id={id ? `${id}-${key}-checkbox` : undefined} disabled />
16
+ <DataGridCell id={id ? `${id}-${key}` : undefined} testid={testid ? `${testid}-${key}` : undefined} key={key}>
17
+ <Checkbox id={id ? `${id}-${key}-checkbox` : undefined} testid={testid ? `${testid}-${key}-checkbox` : undefined} disabled />
16
18
  </DataGridCell>
17
19
  );
18
20
  }
@@ -20,11 +22,13 @@ export function LoadingCell<T extends RowData>({
20
22
  return (
21
23
  <DataGridCell
22
24
  id={id ? `${id}-${key}` : undefined}
25
+ testid={testid ? `${testid}-${key}` : undefined}
23
26
  key={key}
24
27
  component="input"
25
28
  >
26
29
  <Input
27
30
  id={id ? `${id}-${key}-input` : undefined}
31
+ testid={testid ? `${testid}-${key}-input` : undefined}
28
32
  align="left"
29
33
  disabled
30
34
  wrapperClassName="!rounded-none !border-0"
@@ -33,7 +37,7 @@ export function LoadingCell<T extends RowData>({
33
37
  );
34
38
  }
35
39
  return (
36
- <DataGridCell id={id ? `${id}-${key}` : undefined} key={key}>
40
+ <DataGridCell id={id ? `${id}-${key}` : undefined} testid={testid ? `${testid}-${key}` : undefined} key={key}>
37
41
  <div className="bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6"></div>
38
42
  </DataGridCell>
39
43
  );
@@ -6,6 +6,7 @@ import { DataGridCell, DragAlongCell, Paragraph, Tooltip } from "../..";
6
6
 
7
7
  interface TableBodyRowProps<T> {
8
8
  id?: string;
9
+ testid?: string;
9
10
  columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
10
11
  row: Row<T>;
11
12
  rowVirtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>;
@@ -20,6 +21,7 @@ interface TableBodyRowProps<T> {
20
21
 
21
22
  export function TableBodyRow<T>({
22
23
  id,
24
+ testid,
23
25
  columnVirtualizer,
24
26
  row,
25
27
  // rowVirtualizer,
@@ -64,6 +66,8 @@ export function TableBodyRow<T>({
64
66
  ? "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal"
65
67
  : "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
66
68
  )}
69
+ id={id ? `${id}-row-${row.id}` : undefined}
70
+ data-testid={testid ? `${testid}-row-${row.id}` : undefined}
67
71
  style={{
68
72
  display: "flex",
69
73
  position: "absolute",
@@ -95,7 +99,8 @@ export function TableBodyRow<T>({
95
99
  ) : (
96
100
  <CellElement
97
101
  key={cell.id}
98
- id={id ? `${id}-cell-${cell.id}` : undefined}
102
+ id={id ? `${id}-row-${row.id}-cell-${cell.id}` : undefined}
103
+ testid={testid ? `${testid}-row-${row.id}-cell-${cell.id}` : undefined}
99
104
  cell={cell}
100
105
  className={clsx({
101
106
  "justify-end": typeof cellValue === "number",
@@ -104,6 +109,7 @@ export function TableBodyRow<T>({
104
109
  >
105
110
  <Tooltip
106
111
  id={id ? `${id}-tooltip-${cell.id}` : undefined}
112
+ testid={testid ? `${testid}-tooltip-${cell.id}` : undefined}
107
113
  showOnTruncation
108
114
  message={cellValue as string}
109
115
  position="bottom"
@@ -8,6 +8,7 @@ import { LoadingCell } from "./LoadingCell";
8
8
 
9
9
  interface TableBodyProps<TData extends RowData> {
10
10
  id?: string;
11
+ testid?: string;
11
12
  columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
12
13
  table: Table<TData>;
13
14
  tableContainerRef: React.RefObject<HTMLDivElement | null>;
@@ -23,6 +24,7 @@ interface TableBodyProps<TData extends RowData> {
23
24
  }
24
25
  export function TableBody<T>({
25
26
  id,
27
+ testid,
26
28
  columnVirtualizer,
27
29
  table,
28
30
  tableContainerRef,
@@ -81,11 +83,13 @@ export function TableBody<T>({
81
83
  zIndex: 10,
82
84
  }}
83
85
  className="even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal"
86
+ data-testid={testid ? `${testid}-filter-row` : undefined}
84
87
  >
85
88
  {headerGroups.flatMap((x) =>
86
89
  x.headers.map((header) => (
87
90
  <CellElement
88
91
  id={id ? `${id}-filter-cell-${header.id}` : undefined}
92
+ testid={testid ? `${testid}-filter-cell-${header.id}` : undefined}
89
93
  noPadding
90
94
  key={header.id}
91
95
  cell={header}
@@ -101,6 +105,7 @@ export function TableBody<T>({
101
105
  }) ?? (
102
106
  <Search
103
107
  id={id ? `${id}-filter-search-${header.id}` : undefined}
108
+ testid={testid ? `${testid}-filter-search-${header.id}` : undefined}
104
109
  removeRoundness
105
110
  onChange={(e) =>
106
111
  header.column.setFilterValue(e.target.value)
@@ -122,6 +127,7 @@ export function TableBody<T>({
122
127
  return (
123
128
  <TableBodyRow
124
129
  id={id}
130
+ testid={testid}
125
131
  columnVirtualizer={columnVirtualizer}
126
132
  key={row.id}
127
133
  row={row}
@@ -150,7 +156,7 @@ export function TableBody<T>({
150
156
  className="odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
151
157
  >
152
158
  {table.getAllLeafColumns().map((column) => (
153
- <LoadingCell id={id} key={column.id} column={column.columnDef} />
159
+ <LoadingCell id={id} testid={testid} key={column.id} column={column.columnDef} />
154
160
  ))}
155
161
  </tr>
156
162
  )}