@dmsi/wedgekit-react 0.0.26 → 0.0.28

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 (217) hide show
  1. package/dist/{chunk-KDEPZ6I7.js → chunk-2S2Z3L56.js} +5 -1
  2. package/dist/{chunk-TU55CHXU.js → chunk-4JLU7TAC.js} +3 -1
  3. package/dist/{chunk-Z2LOGSGE.js → chunk-4N2PED4P.js} +15 -3
  4. package/dist/{chunk-U42SKNR6.js → chunk-57WRM337.js} +68 -30
  5. package/dist/{chunk-ZFGGZXB6.js → chunk-AY7ELVQY.js} +5 -2
  6. package/dist/{chunk-I2UVVKQI.js → chunk-CHTO7PW4.js} +3 -2
  7. package/dist/{chunk-WIDBAFBU.js → chunk-FWPJ73IK.js} +3 -1
  8. package/dist/{chunk-5TLFMKSR.js → chunk-INYI65WW.js} +15 -5
  9. package/dist/{chunk-TJ44JJCB.js → chunk-J6LETUNM.js} +5 -2
  10. package/dist/{chunk-T6HZARR7.js → chunk-MZJS2ZAU.js} +6 -3
  11. package/dist/{chunk-ZCBSLV7U.js → chunk-O4M2GISS.js} +5 -2
  12. package/dist/{chunk-OUTEIXV4.js → chunk-OUSNH76S.js} +11 -3
  13. package/dist/{chunk-YDREJNAS.js → chunk-PDDZ5PMY.js} +18 -4
  14. package/dist/{chunk-4RD5ZF2V.js → chunk-QBIEU25R.js} +10 -4
  15. package/dist/chunk-QUPHLL7D.js +61 -0
  16. package/dist/{chunk-OISE6NMA.js → chunk-QV2EFOYF.js} +17 -6
  17. package/dist/{chunk-YZQNTOIF.js → chunk-QZGUMB7T.js} +10 -5
  18. package/dist/{chunk-S7R37IUP.js → chunk-S5K22XTH.js} +5 -2
  19. package/dist/{chunk-GCPJH5R6.js → chunk-S5KPS4IQ.js} +22 -7
  20. package/dist/{chunk-VELXLFMJ.js → chunk-SAMX4YGM.js} +4 -1
  21. package/dist/{chunk-TWP6YSFO.js → chunk-SKHSGGO3.js} +14 -6
  22. package/dist/chunk-TVDFTRGL.js +57 -0
  23. package/dist/{chunk-N32PXOA5.js → chunk-UT7XCBZF.js} +9 -4
  24. package/dist/{chunk-L4UM372R.js → chunk-VC3R5EUH.js} +3 -0
  25. package/dist/{chunk-UIQ733QP.js → chunk-VG4EPHJA.js} +7 -3
  26. package/dist/components/Breadcrumbs.cjs +29 -9
  27. package/dist/components/Breadcrumbs.js +29 -9
  28. package/dist/components/Button.cjs +6 -3
  29. package/dist/components/Button.js +1 -1
  30. package/dist/components/CalendarRange.cjs +11 -3
  31. package/dist/components/CalendarRange.js +1 -1
  32. package/dist/components/Caption.cjs +53 -9
  33. package/dist/components/Caption.js +53 -9
  34. package/dist/components/Checkbox.cjs +15 -6
  35. package/dist/components/Checkbox.js +2 -2
  36. package/dist/components/ContentTab.cjs +20 -7
  37. package/dist/components/ContentTab.js +2 -2
  38. package/dist/components/ContentTabs.cjs +32 -18
  39. package/dist/components/ContentTabs.js +14 -13
  40. package/dist/components/DMSiLogo.cjs +22 -4
  41. package/dist/components/DMSiLogo.js +9 -5
  42. package/dist/components/DataGrid.cjs +374 -243
  43. package/dist/components/DataGrid.js +283 -226
  44. package/dist/components/DataGridCell.cjs +79 -21
  45. package/dist/components/DataGridCell.js +7 -7
  46. package/dist/components/DataTable.cjs +197 -139
  47. package/dist/components/DataTable.js +197 -139
  48. package/dist/components/DateInput.cjs +36 -10
  49. package/dist/components/DateInput.js +7 -3
  50. package/dist/components/DateRangeInput.cjs +36 -10
  51. package/dist/components/DateRangeInput.js +7 -3
  52. package/dist/components/DebugJson.cjs +21 -13
  53. package/dist/components/DebugJson.js +21 -13
  54. package/dist/components/Display.cjs +5 -2
  55. package/dist/components/Display.js +1 -1
  56. package/dist/components/EditingContext.cjs +4 -1
  57. package/dist/components/EditingContext.js +4 -1
  58. package/dist/components/FilterGroup.cjs +102 -32
  59. package/dist/components/FilterGroup.js +41 -17
  60. package/dist/components/FullViewportBox.cjs +10 -2
  61. package/dist/components/FullViewportBox.js +10 -2
  62. package/dist/components/Grid.cjs +3 -1
  63. package/dist/components/Grid.js +3 -1
  64. package/dist/components/Heading.cjs +5 -2
  65. package/dist/components/Heading.js +1 -1
  66. package/dist/components/HorizontalDivider.cjs +2 -2
  67. package/dist/components/HorizontalDivider.js +2 -2
  68. package/dist/components/Input.cjs +21 -7
  69. package/dist/components/Input.js +2 -2
  70. package/dist/components/InputGroup.cjs +13 -6
  71. package/dist/components/InputGroup.js +9 -5
  72. package/dist/components/Label.cjs +5 -2
  73. package/dist/components/Label.js +1 -1
  74. package/dist/components/List.cjs +3 -2
  75. package/dist/components/List.js +3 -2
  76. package/dist/components/LogoAgilityTopBar.cjs +22 -4
  77. package/dist/components/LogoAgilityTopBar.js +9 -5
  78. package/dist/components/LogoDMSiTopBar.cjs +22 -4
  79. package/dist/components/LogoDMSiTopBar.js +1 -1
  80. package/dist/components/LogoMillworkTopBar.cjs +22 -4
  81. package/dist/components/LogoMillworkTopBar.js +9 -5
  82. package/dist/components/MainBar.cjs +2 -0
  83. package/dist/components/MainBar.js +2 -0
  84. package/dist/components/Menu.cjs +3 -0
  85. package/dist/components/Menu.js +1 -1
  86. package/dist/components/MenuOption.cjs +28 -7
  87. package/dist/components/MenuOption.js +3 -3
  88. package/dist/components/MobileDataGrid.cjs +101 -46
  89. package/dist/components/MobileDataGrid.js +23 -11
  90. package/dist/components/Modal.cjs +96 -51
  91. package/dist/components/Modal.js +19 -7
  92. package/dist/components/ModalButtons.cjs +43 -26
  93. package/dist/components/ModalButtons.js +2 -2
  94. package/dist/components/ModalContent.cjs +3 -1
  95. package/dist/components/ModalContent.js +1 -1
  96. package/dist/components/ModalHeader.cjs +40 -25
  97. package/dist/components/ModalHeader.js +3 -3
  98. package/dist/components/ModalScrim.cjs +3 -1
  99. package/dist/components/ModalScrim.js +1 -1
  100. package/dist/components/NavigationTab.cjs +9 -3
  101. package/dist/components/NavigationTab.js +2 -2
  102. package/dist/components/NavigationTabs.cjs +15 -7
  103. package/dist/components/NavigationTabs.js +8 -6
  104. package/dist/components/NestedMenu.cjs +28 -7
  105. package/dist/components/NestedMenu.js +3 -3
  106. package/dist/components/Notification.cjs +84 -38
  107. package/dist/components/Notification.js +8 -4
  108. package/dist/components/OptionPill.cjs +24 -6
  109. package/dist/components/OptionPill.js +3 -3
  110. package/dist/components/Paragraph.cjs +7 -3
  111. package/dist/components/Paragraph.js +1 -1
  112. package/dist/components/Password.cjs +33 -11
  113. package/dist/components/Password.js +14 -6
  114. package/dist/components/ProjectBar.cjs +3 -1
  115. package/dist/components/ProjectBar.js +3 -1
  116. package/dist/components/Radio.cjs +13 -7
  117. package/dist/components/Radio.js +7 -5
  118. package/dist/components/Search.cjs +34 -12
  119. package/dist/components/Search.js +3 -3
  120. package/dist/components/Select.cjs +25 -7
  121. package/dist/components/Select.js +3 -3
  122. package/dist/components/SideMenu.cjs +6 -1
  123. package/dist/components/SideMenu.js +6 -1
  124. package/dist/components/SideMenuGroup.cjs +96 -49
  125. package/dist/components/SideMenuGroup.js +31 -19
  126. package/dist/components/SideMenuItem.cjs +99 -43
  127. package/dist/components/SideMenuItem.js +32 -12
  128. package/dist/components/Stack.cjs +91 -30
  129. package/dist/components/Stack.js +1 -1
  130. package/dist/components/StatusPill.cjs +13 -6
  131. package/dist/components/StatusPill.js +9 -5
  132. package/dist/components/Stepper.cjs +35 -17
  133. package/dist/components/Stepper.js +11 -10
  134. package/dist/components/Subheader.cjs +5 -2
  135. package/dist/components/Subheader.js +1 -1
  136. package/dist/components/Surface.cjs +5 -2
  137. package/dist/components/Surface.js +5 -2
  138. package/dist/components/Swatch.cjs +1544 -1308
  139. package/dist/components/Swatch.js +1469 -1275
  140. package/dist/components/Textarea.cjs +5 -2
  141. package/dist/components/Textarea.js +5 -2
  142. package/dist/components/Theme.cjs +3 -2
  143. package/dist/components/Theme.js +1 -1
  144. package/dist/components/Time.cjs +98 -40
  145. package/dist/components/Time.js +18 -6
  146. package/dist/components/Toast.cjs +38 -15
  147. package/dist/components/Toast.js +23 -10
  148. package/dist/components/Tooltip.cjs +5 -4
  149. package/dist/components/Tooltip.js +1 -1
  150. package/dist/components/TopBar.cjs +16 -8
  151. package/dist/components/TopBar.js +12 -5
  152. package/package.json +1 -1
  153. package/src/components/Breadcrumbs.tsx +24 -15
  154. package/src/components/Button.tsx +7 -3
  155. package/src/components/CalendarRange.tsx +9 -0
  156. package/src/components/Caption.tsx +36 -6
  157. package/src/components/Checkbox.tsx +7 -2
  158. package/src/components/ContentTab.tsx +13 -3
  159. package/src/components/ContentTabs.tsx +11 -8
  160. package/src/components/DMSiLogo.tsx +2 -1
  161. package/src/components/DataGrid.tsx +85 -23
  162. package/src/components/DataGridCell.tsx +15 -2
  163. package/src/components/DataTable.tsx +64 -14
  164. package/src/components/DateInput.tsx +5 -1
  165. package/src/components/DateRangeInput.tsx +5 -1
  166. package/src/components/DebugJson.tsx +7 -3
  167. package/src/components/Display.tsx +3 -0
  168. package/src/components/EditingContext.tsx +8 -6
  169. package/src/components/FilterGroup.tsx +23 -3
  170. package/src/components/FullViewportBox.tsx +6 -1
  171. package/src/components/Grid.tsx +3 -0
  172. package/src/components/Heading.tsx +3 -0
  173. package/src/components/HorizontalDivider.tsx +4 -2
  174. package/src/components/Input.tsx +19 -10
  175. package/src/components/InputGroup.tsx +8 -4
  176. package/src/components/Label.tsx +3 -0
  177. package/src/components/Link.tsx +1 -0
  178. package/src/components/List.tsx +7 -1
  179. package/src/components/LogoAgilityTopBar.tsx +2 -1
  180. package/src/components/LogoDMSiTopBar.tsx +2 -1
  181. package/src/components/LogoMillworkTopBar.tsx +2 -1
  182. package/src/components/MainBar.tsx +3 -0
  183. package/src/components/Menu.tsx +3 -0
  184. package/src/components/MenuOption.tsx +72 -58
  185. package/src/components/MobileDataGrid.tsx +15 -4
  186. package/src/components/Modal.tsx +10 -1
  187. package/src/components/ModalButtons.tsx +12 -1
  188. package/src/components/ModalContent.tsx +3 -0
  189. package/src/components/ModalHeader.tsx +16 -6
  190. package/src/components/ModalScrim.tsx +3 -0
  191. package/src/components/NavigationTab.tsx +6 -3
  192. package/src/components/NavigationTabs.tsx +5 -2
  193. package/src/components/Notification.tsx +4 -0
  194. package/src/components/OptionPill.tsx +9 -1
  195. package/src/components/Paragraph.tsx +3 -0
  196. package/src/components/Password.tsx +9 -3
  197. package/src/components/ProjectBar.tsx +3 -0
  198. package/src/components/Radio.tsx +3 -2
  199. package/src/components/Search.tsx +56 -41
  200. package/src/components/Select.tsx +6 -1
  201. package/src/components/SideMenu.tsx +7 -1
  202. package/src/components/SideMenuGroup.tsx +13 -2
  203. package/src/components/SideMenuItem.tsx +15 -2
  204. package/src/components/Stack.tsx +8 -3
  205. package/src/components/StatusPill.tsx +4 -2
  206. package/src/components/Stepper.tsx +5 -5
  207. package/src/components/Subheader.tsx +3 -0
  208. package/src/components/Surface.tsx +3 -0
  209. package/src/components/Swatch.tsx +415 -140
  210. package/src/components/Textarea.tsx +6 -3
  211. package/src/components/Theme.tsx +3 -1
  212. package/src/components/Time.tsx +21 -5
  213. package/src/components/Toast.tsx +29 -14
  214. package/src/components/Tooltip.tsx +46 -32
  215. package/src/components/TopBar.tsx +7 -3
  216. package/dist/chunk-DBYSGYST.js +0 -47
  217. package/dist/chunk-UK3WG7HQ.js +0 -48
@@ -9,18 +9,28 @@ type ModalButtonsProps = {
9
9
  onContinue?: () => void;
10
10
  sampleWidth?: boolean;
11
11
  customActions?: React.ReactNode;
12
+ id?: string;
12
13
  };
13
14
 
14
15
  export const ModalButtons = ({
15
16
  onClose,
16
17
  onContinue,
17
18
  customActions,
19
+ id,
18
20
  }: ModalButtonsProps) => {
19
21
  return (
20
- <div className={clsx("border-t border-neutral-300 flex justify-end", layoutPaddding, layoutGroupGap)}>
22
+ <div
23
+ id={id}
24
+ className={clsx(
25
+ "border-t border-neutral-300 flex justify-end",
26
+ layoutPaddding,
27
+ layoutGroupGap,
28
+ )}
29
+ >
21
30
  {customActions ?? (
22
31
  <>
23
32
  <Button
33
+ id={id ? `${id}-close-button` : undefined}
24
34
  variant="secondary"
25
35
  leftIcon={<Icon name="close" size={24} />}
26
36
  onClick={onClose}
@@ -30,6 +40,7 @@ export const ModalButtons = ({
30
40
  </Button>
31
41
 
32
42
  <Button
43
+ id={id ? `${id}-continue-button` : undefined}
33
44
  variant="primary"
34
45
  leftIcon={<Icon name="check" size={24} />}
35
46
  className="max-sm:w-full"
@@ -3,14 +3,17 @@ import { layoutPaddding } from "../classNames";
3
3
 
4
4
  export interface ModalContentProps {
5
5
  fixedHeightScrolling?: boolean;
6
+ id?: string;
6
7
  }
7
8
 
8
9
  export function ModalContent({
9
10
  fixedHeightScrolling,
10
11
  children,
12
+ id,
11
13
  }: React.PropsWithChildren<ModalContentProps>) {
12
14
  return (
13
15
  <div
16
+ id={id}
14
17
  className={clsx(
15
18
  "flex-grow desktop:flex-grow-0",
16
19
  layoutPaddding,
@@ -10,6 +10,7 @@ type ModalHeaderProps = {
10
10
  hideCloseIcon?: boolean;
11
11
  headerIcon?: React.ReactNode;
12
12
  onClose?: () => void;
13
+ id?: string;
13
14
  };
14
15
 
15
16
  export const ModalHeader = ({
@@ -17,20 +18,29 @@ export const ModalHeader = ({
17
18
  hideCloseIcon,
18
19
  headerIcon,
19
20
  onClose,
21
+ id,
20
22
  }: ModalHeaderProps) => {
21
23
  return (
22
- <div className={clsx(
23
- "flex justify-between items-center",
24
- layoutPaddding,
25
- layoutGroupGap
26
- )}>
24
+ <div
25
+ id={id}
26
+ className={clsx(
27
+ "flex justify-between items-center",
28
+ layoutPaddding,
29
+ layoutGroupGap,
30
+ )}
31
+ >
27
32
  <div className={clsx("flex items-center", layoutGroupGap)}>
28
33
  {headerIcon}
29
- {title && <Heading2 as="p">{title}</Heading2>}
34
+ {title && (
35
+ <Heading2 id={id ? `${id}-title` : undefined} as="p">
36
+ {title}
37
+ </Heading2>
38
+ )}
30
39
  </div>
31
40
 
32
41
  {!hideCloseIcon && (
33
42
  <Button
43
+ id={id ? `${id}-close-button` : undefined}
34
44
  iconOnly
35
45
  variant="tertiary"
36
46
  onClick={onClose}
@@ -7,6 +7,7 @@ type ModalScrimProps = PropsWithChildren<{
7
7
  size?: "small" | "medium" | "large" | "x-large";
8
8
  onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
9
9
  ref?: React.Ref<HTMLDivElement>;
10
+ id?: string;
10
11
  }>;
11
12
 
12
13
  export const ModalScrim = ({
@@ -15,9 +16,11 @@ export const ModalScrim = ({
15
16
  children,
16
17
  onClick,
17
18
  ref,
19
+ id,
18
20
  }: ModalScrimProps) => {
19
21
  return (
20
22
  <div
23
+ id={id}
21
24
  className={clsx(
22
25
  "overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center desktop:p-4 group bg-neutral-600/50 fixed opacity-0",
23
26
  !show && " pointer-events-none",
@@ -4,6 +4,7 @@ import { Icon } from "./Icon";
4
4
  import { CSSProperties } from "react";
5
5
 
6
6
  export type NavigationTabProps = {
7
+ id?: string;
7
8
  label?: string;
8
9
  onClick?: () => void;
9
10
  selected?: boolean;
@@ -14,6 +15,7 @@ export type NavigationTabProps = {
14
15
  };
15
16
 
16
17
  export const NavigationTab = ({
18
+ id,
17
19
  label,
18
20
  onClick,
19
21
  selected = false,
@@ -56,12 +58,13 @@ export const NavigationTab = ({
56
58
  );
57
59
 
58
60
  const tokenOverrides: CSSProperties = {
59
- '--color-text-on-action-primary-hover': 'var(--color-brand-500)',
60
- '--color-text-on-action-primary-active': 'var(--color-brand-300)'
61
- }
61
+ "--color-text-on-action-primary-hover": "var(--color-brand-500)",
62
+ "--color-text-on-action-primary-active": "var(--color-brand-300)",
63
+ };
62
64
 
63
65
  return (
64
66
  <Button
67
+ id={id}
65
68
  variant="tertiary-critical"
66
69
  colorClassName={textClassName}
67
70
  className={clsx(
@@ -5,19 +5,21 @@ import { NavigationTab } from "./NavigationTab";
5
5
  import { componentGap } from "../classNames";
6
6
 
7
7
  type Tab = {
8
- id: string;
8
+ id?: string;
9
9
  label: string;
10
10
  href?: string;
11
11
  content?: ReactNode;
12
12
  };
13
13
 
14
14
  export type NavigationTabsProps = {
15
+ id?: string;
15
16
  tabs: Tab[];
16
17
  onTabChange?: (tabId: string) => void;
17
18
  colorPrimitives?: "dmsi" | "agility";
18
19
  };
19
20
 
20
21
  export const NavigationTabs = ({
22
+ id,
21
23
  tabs,
22
24
  onTabChange,
23
25
  colorPrimitives = "dmsi",
@@ -33,7 +35,7 @@ export const NavigationTabs = ({
33
35
  const selectedTabHasHref = tabs.find((tab) => tab.id === selectedTab)?.href;
34
36
 
35
37
  return (
36
- <div>
38
+ <div id={id}>
37
39
  <div>
38
40
  <div
39
41
  className={clsx(
@@ -44,6 +46,7 @@ export const NavigationTabs = ({
44
46
  {tabs.map((tab) => (
45
47
  <NavigationTab
46
48
  key={tab.id}
49
+ id={id ? `${id}-tab-${tab.id}` : undefined}
47
50
  label={tab.label}
48
51
  selected={selectedTab === tab.id}
49
52
  onClick={() => handleTabClick(tab.id)}
@@ -11,6 +11,7 @@ import { Icon } from "./Icon";
11
11
  import { Stack } from "./Stack";
12
12
 
13
13
  export interface NotificationProps {
14
+ id?: string;
14
15
  variant?: "success" | "warning" | "error" | "info";
15
16
  title?: string;
16
17
  message?: string;
@@ -59,6 +60,7 @@ const variants = {
59
60
  };
60
61
 
61
62
  export const Notification = ({
63
+ id,
62
64
  variant = "success",
63
65
  title,
64
66
  message,
@@ -79,6 +81,7 @@ export const Notification = ({
79
81
 
80
82
  return (
81
83
  <div
84
+ id={id}
82
85
  className={clsx(
83
86
  "flex gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap justify-between items-center border-2 rounded-sm w-full p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding bg-white max-w-240",
84
87
  className,
@@ -108,6 +111,7 @@ export const Notification = ({
108
111
  </Stack>
109
112
 
110
113
  <Button
114
+ id={id ? `${id}-close-button` : undefined}
111
115
  iconOnly
112
116
  variant="tertiary"
113
117
  onClick={() => setVisible(false)}
@@ -12,6 +12,7 @@ import { Label } from "./Label";
12
12
  import { Icon } from "./Icon";
13
13
 
14
14
  type OptionPillProps = {
15
+ id?: string;
15
16
  selected?: boolean;
16
17
  onClick?: () => void;
17
18
  onRemove?: () => void;
@@ -20,6 +21,7 @@ type OptionPillProps = {
20
21
  };
21
22
 
22
23
  export const OptionPill = ({
24
+ id,
23
25
  selected = false,
24
26
  onClick,
25
27
  onRemove,
@@ -60,6 +62,7 @@ export const OptionPill = ({
60
62
 
61
63
  return (
62
64
  <div
65
+ id={id}
63
66
  onClick={handleOnClick}
64
67
  {...props}
65
68
  {...additionalAttributes}
@@ -74,12 +77,17 @@ export const OptionPill = ({
74
77
  textColor,
75
78
  )}
76
79
  >
77
- <Label padded className={componentPaddingYUsingComponentGap}>
80
+ <Label
81
+ id={id ? `${id}-label` : undefined}
82
+ padded
83
+ className={componentPaddingYUsingComponentGap}
84
+ >
78
85
  {children}
79
86
  </Label>
80
87
 
81
88
  {removable && (
82
89
  <Button
90
+ id={id ? `${id}-remove-button` : undefined}
83
91
  onClick={handleOnRemove}
84
92
  disabled={disabled}
85
93
  className={clsx(
@@ -6,6 +6,7 @@ type Tags = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
6
6
 
7
7
  type ParagraphProps = {
8
8
  as?: Tags;
9
+ id?: string;
9
10
  } & AsProps<Tags> &
10
11
  TextAttributes &
11
12
  TypographyProps;
@@ -19,12 +20,14 @@ export const Paragraph = ({
19
20
  addOverflow,
20
21
  children,
21
22
  as = "p",
23
+ id,
22
24
  ...props
23
25
  }: ParagraphProps) => {
24
26
  const Element = as;
25
27
 
26
28
  return (
27
29
  <Element
30
+ id={id}
28
31
  {...props}
29
32
  className={clsx(
30
33
  typography.paragraph,
@@ -5,28 +5,33 @@ import { InputBase, InputBaseProps } from "./Input";
5
5
  import { Icon } from "./Icon";
6
6
 
7
7
  export const Password = ({
8
+ id,
8
9
  ...props
9
- }: Omit<ComponentProps<"input">, "type" | "children"> & InputBaseProps) => {
10
+ }: Omit<ComponentProps<"input">, "type" | "children" | "id"> &
11
+ InputBaseProps) => {
10
12
  const [show, setShow] = useState(false);
11
13
 
12
14
  return (
13
15
  <InputBase
16
+ id={id}
14
17
  {...props}
15
18
  type={show ? "text" : "password"}
16
- after={<WhichIcon show={show} setShow={setShow} />}
19
+ after={<WhichIcon id={id} show={show} setShow={setShow} />}
17
20
  />
18
21
  );
19
22
  };
20
23
 
21
24
  type WhichIconProps = {
25
+ id?: string;
22
26
  show: boolean;
23
27
  setShow: (value: boolean) => void;
24
28
  };
25
29
 
26
- const WhichIcon = ({ show, setShow }: WhichIconProps) => {
30
+ const WhichIcon = ({ id, show, setShow }: WhichIconProps) => {
27
31
  if (show) {
28
32
  return (
29
33
  <Icon
34
+ id={id ? `${id}-toggle-visibility` : undefined}
30
35
  name="visibility_off"
31
36
  className="cursor-pointer"
32
37
  onClick={() => setShow(false)}
@@ -36,6 +41,7 @@ const WhichIcon = ({ show, setShow }: WhichIconProps) => {
36
41
 
37
42
  return (
38
43
  <Icon
44
+ id={id ? `${id}-toggle-visibility` : undefined}
39
45
  name="visibility"
40
46
  className="cursor-pointer"
41
47
  onClick={() => setShow(true)}
@@ -13,6 +13,7 @@ type ProjectBarProps = {
13
13
  right: ReactNode;
14
14
  mobileLeft: ReactNode;
15
15
  mobileRight: ReactNode;
16
+ id?: string;
16
17
  };
17
18
 
18
19
  export const ProjectBar = ({
@@ -20,6 +21,7 @@ export const ProjectBar = ({
20
21
  right,
21
22
  mobileLeft,
22
23
  mobileRight,
24
+ id,
23
25
  }: ComponentProps<"div"> & ProjectBarProps) => {
24
26
  const isMobile = useMatchesMobile();
25
27
 
@@ -47,6 +49,7 @@ export const ProjectBar = ({
47
49
 
48
50
  return (
49
51
  <div
52
+ id={id}
50
53
  style={{ ...tokenOverrides } as React.CSSProperties}
51
54
  className={clsx(
52
55
  "flex items-center justify-between",
@@ -23,9 +23,10 @@ export const Radio = ({
23
23
  disabled,
24
24
  checked,
25
25
  readOnly,
26
+ id,
26
27
  ...props
27
28
  }: RadioProps) => {
28
- const radioId = props.id;
29
+ const radioId = id;
29
30
 
30
31
  const paragraphColor: TextColorTokens = disabled
31
32
  ? "text-primary-disabled"
@@ -104,7 +105,7 @@ export const Radio = ({
104
105
  </div>
105
106
 
106
107
  {label && (
107
- <Paragraph padded color={paragraphColor}>
108
+ <Paragraph id={`${radioId}-label`} padded color={paragraphColor}>
108
109
  {label}
109
110
  </Paragraph>
110
111
  )}
@@ -10,7 +10,9 @@ import {
10
10
  import { Input, InputBaseProps } from "./Input";
11
11
 
12
12
  export interface SearchProps {
13
+ id?: string;
13
14
  renderMenu?: (props: {
15
+ id?: string;
14
16
  positionTo: RefObject<HTMLElement | null> | undefined;
15
17
  show: boolean;
16
18
  setShow: (value: boolean) => void;
@@ -22,17 +24,17 @@ export interface SearchProps {
22
24
  }
23
25
 
24
26
  export const Search = ({
27
+ id,
25
28
  label,
26
29
  error,
27
30
  children,
28
31
  readOnly,
29
32
  renderMenu,
30
33
  onClick,
31
- className,
32
34
  wrapperClassName,
33
35
  removeRoundness,
34
36
  ...props
35
- }: Omit<InputBaseProps, "after"> & SearchProps) => {
37
+ }: Omit<InputBaseProps, "after" | "id"> & SearchProps) => {
36
38
  const inputRef = useRef<HTMLInputElement>(null);
37
39
  const inputContainerRef = useRef(null);
38
40
  const preventFocusOnInitialRender = useRef(true);
@@ -53,57 +55,69 @@ export const Search = ({
53
55
  return (
54
56
  <>
55
57
  <Input
58
+ id={id}
56
59
  variant="search"
57
60
  inputContainerRef={inputContainerRef}
58
61
  ref={inputRef}
59
62
  label={label}
60
63
  wrapperClassName={wrapperClassName}
61
64
  onClick={(e) => {
62
- if (props.disabled || readOnly) {
63
- return;
64
- }
65
+ if (props.disabled || readOnly) {
66
+ return;
67
+ }
65
68
 
66
- if (clearing) {
67
- setClearing(false);
68
- return;
69
- }
69
+ if (clearing) {
70
+ setClearing(false);
71
+ return;
72
+ }
70
73
 
71
- onClick?.(e);
72
- setShow(!show)
74
+ onClick?.(e);
75
+ setShow(!show);
73
76
  }}
74
77
  onClear={() => {
75
- setClearing(true);
78
+ setClearing(true);
76
79
  }}
77
80
  onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
78
- setShow(true);
79
-
80
- if (['ArrowUp', 'ArrowDown'].includes(e.key)) {
81
- e.preventDefault();
82
-
83
- const menu = document.querySelector<HTMLElement>(`[data-menu="${searchMenuName}"]`);
84
- const selectedMenuOption = menu?.querySelector<HTMLElement>('[data-selected]');
85
-
86
- if (selectedMenuOption) {
87
- const allMenuOptions = Array.from(menu?.querySelectorAll<HTMLElement>('[role="menuitem"]') || []);
88
- const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
89
-
90
- let targetOption: HTMLElement | undefined;
91
-
92
- if (e.key === 'ArrowDown') {
93
- targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0]; // Wrap to first
94
- } else {
95
- targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1]; // Wrap to last
96
- }
97
-
98
- targetOption?.focus();
99
- } else {
100
- const toFocusMenuOption = e.key === 'ArrowDown'
101
- ? menu?.querySelector<HTMLElement>('[role="menuitem"]')
102
- : menu?.querySelector<HTMLElement>('[role="menuitem"]:last-child');
103
-
104
- toFocusMenuOption?.focus();
105
- }
81
+ setShow(true);
82
+
83
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
84
+ e.preventDefault();
85
+
86
+ const menu = document.querySelector<HTMLElement>(
87
+ `[data-menu="${searchMenuName}"]`,
88
+ );
89
+ const selectedMenuOption =
90
+ menu?.querySelector<HTMLElement>("[data-selected]");
91
+
92
+ if (selectedMenuOption) {
93
+ const allMenuOptions = Array.from(
94
+ menu?.querySelectorAll<HTMLElement>('[role="menuitem"]') || [],
95
+ );
96
+ const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
97
+
98
+ let targetOption: HTMLElement | undefined;
99
+
100
+ if (e.key === "ArrowDown") {
101
+ targetOption =
102
+ allMenuOptions[currentIndex + 1] || allMenuOptions[0]; // Wrap to first
103
+ } else {
104
+ targetOption =
105
+ allMenuOptions[currentIndex - 1] ||
106
+ allMenuOptions[allMenuOptions.length - 1]; // Wrap to last
107
+ }
108
+
109
+ targetOption?.focus();
110
+ } else {
111
+ const toFocusMenuOption =
112
+ e.key === "ArrowDown"
113
+ ? menu?.querySelector<HTMLElement>('[role="menuitem"]')
114
+ : menu?.querySelector<HTMLElement>(
115
+ '[role="menuitem"]:last-child',
116
+ );
117
+
118
+ toFocusMenuOption?.focus();
106
119
  }
120
+ }
107
121
  }}
108
122
  error={error}
109
123
  readOnly={readOnly}
@@ -114,12 +128,13 @@ export const Search = ({
114
128
 
115
129
  {renderMenu
116
130
  ? renderMenu({
131
+ id: `${id}-menu`,
117
132
  positionTo: inputContainerRef,
118
133
  show,
119
134
  setShow,
120
135
  topOffset: props.caption ? -16 : null,
121
136
  autoFocusOff: true,
122
- menuName: searchMenuName
137
+ menuName: searchMenuName,
123
138
  })
124
139
  : children}
125
140
  </>
@@ -5,7 +5,9 @@ import { Icon } from "./Icon";
5
5
  import clsx from "clsx";
6
6
 
7
7
  export interface SelectProps {
8
+ id?: string;
8
9
  renderMenu?: (props: {
10
+ id?: string;
9
11
  positionTo: RefObject<HTMLElement | null> | undefined;
10
12
  show: boolean;
11
13
  setShow: (value: boolean) => void;
@@ -15,6 +17,7 @@ export interface SelectProps {
15
17
  }
16
18
 
17
19
  export const Select = ({
20
+ id,
18
21
  label,
19
22
  error,
20
23
  children,
@@ -27,7 +30,7 @@ export const Select = ({
27
30
  displayValue,
28
31
  value,
29
32
  ...props
30
- }: Omit<InputBaseProps, "after"> & SelectProps) => {
33
+ }: Omit<InputBaseProps, "after" | "id"> & SelectProps) => {
31
34
  const inputRef = useRef<HTMLInputElement>(null);
32
35
  const inputContainerRef = useRef(null);
33
36
  const preventFocusOnInitialRender = useRef(true);
@@ -45,6 +48,7 @@ export const Select = ({
45
48
  return (
46
49
  <>
47
50
  <InputBase
51
+ id={id}
48
52
  inputContainerRef={inputContainerRef}
49
53
  ref={inputRef}
50
54
  label={label}
@@ -91,6 +95,7 @@ export const Select = ({
91
95
 
92
96
  {renderMenu
93
97
  ? renderMenu({
98
+ id: `${id}-menu`,
94
99
  positionTo: inputContainerRef,
95
100
  show,
96
101
  setShow,
@@ -3,11 +3,17 @@ import clsx from "clsx";
3
3
 
4
4
  type SideMenuProps = PropsWithChildren<{
5
5
  cardStyle?: boolean;
6
+ id?: string;
6
7
  }>;
7
8
 
8
- export const SideMenu = ({ children, cardStyle = false }: SideMenuProps) => {
9
+ export const SideMenu = ({
10
+ children,
11
+ cardStyle = false,
12
+ id,
13
+ }: SideMenuProps) => {
9
14
  return (
10
15
  <div
16
+ id={id}
11
17
  className={clsx(
12
18
  "flex flex-col",
13
19
  cardStyle &&
@@ -8,6 +8,7 @@ import { Stack } from "./Stack";
8
8
  import { Icon } from "./Icon";
9
9
 
10
10
  export type SideMenuGroupProps = PropsWithChildren<{
11
+ id?: string;
11
12
  label?: string;
12
13
  groupIndentLevel?: 1 | 2 | 3 | 4;
13
14
  collapsed?: boolean;
@@ -15,6 +16,7 @@ export type SideMenuGroupProps = PropsWithChildren<{
15
16
  }>;
16
17
 
17
18
  export const SideMenuGroup = ({
19
+ id,
18
20
  label,
19
21
  groupIndentLevel = 1,
20
22
  collapsed = false,
@@ -42,6 +44,7 @@ export const SideMenuGroup = ({
42
44
  return (
43
45
  <>
44
46
  <div
47
+ id={id}
45
48
  className={clsx(
46
49
  "group/sm-group flex rounded cursor-pointer",
47
50
  "bg-transparent",
@@ -53,7 +56,13 @@ export const SideMenuGroup = ({
53
56
  onClick={toggleCollapse}
54
57
  {...additionalAttr}
55
58
  >
56
- <Stack horizontal items="center" sizing="component" padding>
59
+ <Stack
60
+ id={id ? `${id}-stack` : undefined}
61
+ horizontal
62
+ items="center"
63
+ sizing="component"
64
+ padding
65
+ >
57
66
  {groupIndentLevel === 2 && <div className="pl-6" />}
58
67
  {groupIndentLevel === 3 && <div className="pl-13" />}
59
68
  {groupIndentLevel === 4 && <div className="pl-20" />}
@@ -70,7 +79,9 @@ export const SideMenuGroup = ({
70
79
  size={24}
71
80
  />
72
81
 
73
- <Label padded>{label}</Label>
82
+ <Label id={id ? `${id}-label` : undefined} padded>
83
+ {label}
84
+ </Label>
74
85
  </Stack>
75
86
  </div>
76
87
  {!internalCollapsed && children}