colibri-ui 0.8.98 → 0.8.99

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 (113) hide show
  1. package/Accordion/index.js +4 -2
  2. package/Accordion/index.props.d.ts +2 -1
  3. package/Avatar/index.js +2 -5
  4. package/Avatar/index.props.d.ts +2 -1
  5. package/Badge/Control/index.props.d.ts +2 -1
  6. package/Badge/index.js +1 -2
  7. package/Button/index.js +0 -1
  8. package/Checkbox/index.js +4 -2
  9. package/Checkbox/index.props.d.ts +2 -1
  10. package/Chip/index.js +2 -4
  11. package/Chip/index.props.d.ts +2 -2
  12. package/ColorPicker/ColorPicker.d.ts +1 -1
  13. package/ColorPicker/ColorPicker.js +4 -2
  14. package/ColorPicker/index.props.d.ts +2 -1
  15. package/Counter/index.js +4 -2
  16. package/Counter/index.props.d.ts +2 -1
  17. package/Datepicker/index.d.ts +1 -1
  18. package/Datepicker/index.js +5 -3
  19. package/Datepicker/index.props.d.ts +2 -1
  20. package/DotsLoader/index.js +5 -2
  21. package/DotsLoader/index.props.d.ts +2 -1
  22. package/Dropdown/index.js +2 -2
  23. package/Dropdown/index.props.d.ts +2 -1
  24. package/Grid/index.js +3 -1
  25. package/Grid/index.props.d.ts +2 -1
  26. package/InputRadio/index.js +3 -3
  27. package/InputRadio/index.props.d.ts +2 -2
  28. package/Menu/components/MenuItem/index.js +0 -1
  29. package/Menu/components/MenuItem/index.props.d.ts +2 -1
  30. package/Menu/index.d.ts +1 -1
  31. package/Menu/index.js +4 -2
  32. package/Menu/index.props.d.ts +2 -1
  33. package/Modal/index.js +3 -1
  34. package/Modal/index.props.d.ts +2 -1
  35. package/MultiSelect/index.js +3 -1
  36. package/RadioGroup/Radio.js +2 -2
  37. package/RadioGroup/index.js +1 -1
  38. package/RadioGroup/index.props.d.ts +1 -1
  39. package/Select/index.d.ts +1 -1
  40. package/Select/index.js +4 -3
  41. package/Separator/index.js +6 -4
  42. package/Separator/index.props.d.ts +2 -1
  43. package/Skeleton/index.js +6 -2
  44. package/Skeleton/index.props.d.ts +3 -2
  45. package/Status/index.d.ts +1 -1
  46. package/Status/index.js +3 -1
  47. package/Status/index.props.d.ts +2 -1
  48. package/TextArea/index.js +0 -1
  49. package/TimeSelect/index.js +3 -1
  50. package/Tooltip/index.js +3 -1
  51. package/Tooltip/index.props.d.ts +2 -1
  52. package/base/FormField/index.d.ts +1 -1
  53. package/base/FormField/index.js +4 -2
  54. package/base/FormField/index.props.d.ts +2 -1
  55. package/esm/Accordion/index.js +4 -2
  56. package/esm/Accordion/index.props.d.ts +2 -1
  57. package/esm/Avatar/index.js +2 -5
  58. package/esm/Avatar/index.props.d.ts +2 -1
  59. package/esm/Badge/Control/index.props.d.ts +2 -1
  60. package/esm/Badge/index.js +1 -2
  61. package/esm/Button/index.js +0 -1
  62. package/esm/Checkbox/index.js +4 -2
  63. package/esm/Checkbox/index.props.d.ts +2 -1
  64. package/esm/Chip/index.js +2 -4
  65. package/esm/Chip/index.props.d.ts +2 -2
  66. package/esm/ColorPicker/ColorPicker.d.ts +1 -1
  67. package/esm/ColorPicker/ColorPicker.js +4 -2
  68. package/esm/ColorPicker/index.props.d.ts +2 -1
  69. package/esm/Counter/index.js +4 -2
  70. package/esm/Counter/index.props.d.ts +2 -1
  71. package/esm/Datepicker/index.d.ts +1 -1
  72. package/esm/Datepicker/index.js +5 -3
  73. package/esm/Datepicker/index.props.d.ts +2 -1
  74. package/esm/DotsLoader/index.js +5 -2
  75. package/esm/DotsLoader/index.props.d.ts +2 -1
  76. package/esm/Dropdown/index.js +2 -2
  77. package/esm/Dropdown/index.props.d.ts +2 -1
  78. package/esm/Grid/index.js +3 -1
  79. package/esm/Grid/index.props.d.ts +2 -1
  80. package/esm/InputRadio/index.js +3 -3
  81. package/esm/InputRadio/index.props.d.ts +2 -2
  82. package/esm/Menu/components/MenuItem/index.js +0 -1
  83. package/esm/Menu/components/MenuItem/index.props.d.ts +2 -1
  84. package/esm/Menu/index.d.ts +1 -1
  85. package/esm/Menu/index.js +4 -2
  86. package/esm/Menu/index.props.d.ts +2 -1
  87. package/esm/Modal/index.js +3 -1
  88. package/esm/Modal/index.props.d.ts +2 -1
  89. package/esm/MultiSelect/index.js +3 -1
  90. package/esm/RadioGroup/Radio.js +2 -2
  91. package/esm/RadioGroup/index.js +1 -1
  92. package/esm/RadioGroup/index.props.d.ts +1 -1
  93. package/esm/Select/index.d.ts +1 -1
  94. package/esm/Select/index.js +4 -3
  95. package/esm/Separator/index.js +6 -4
  96. package/esm/Separator/index.props.d.ts +2 -1
  97. package/esm/Skeleton/index.js +6 -2
  98. package/esm/Skeleton/index.props.d.ts +3 -2
  99. package/esm/Status/index.d.ts +1 -1
  100. package/esm/Status/index.js +3 -1
  101. package/esm/Status/index.props.d.ts +2 -1
  102. package/esm/TextArea/index.js +0 -1
  103. package/esm/TimeSelect/index.js +3 -1
  104. package/esm/Tooltip/index.js +3 -1
  105. package/esm/Tooltip/index.props.d.ts +2 -1
  106. package/esm/base/FormField/index.d.ts +1 -1
  107. package/esm/base/FormField/index.js +4 -2
  108. package/esm/base/FormField/index.props.d.ts +2 -1
  109. package/esm/helpers/testId.d.ts +18 -0
  110. package/esm/index.d.ts +1 -0
  111. package/helpers/testId.d.ts +18 -0
  112. package/index.d.ts +1 -0
  113. package/package.json +1 -1
@@ -19,7 +19,8 @@ const Accordion = ({
19
19
  children,
20
20
  className,
21
21
  tabIndex,
22
- defaultOpen = false
22
+ defaultOpen = false,
23
+ "data-testid": testId
23
24
  }) => {
24
25
  const [isOpen, setIsOpen] = React.useState(defaultOpen);
25
26
  const contentRef = React.useRef(null);
@@ -43,7 +44,8 @@ const Accordion = ({
43
44
  return () => observer.disconnect();
44
45
  }, [isOpen]);
45
46
  return /*#__PURE__*/React__default.default.createElement("div", {
46
- className: clsx__default.default(styles__default.default.root, className)
47
+ className: clsx__default.default(styles__default.default.root, className),
48
+ "data-testid": testId
47
49
  }, /*#__PURE__*/React__default.default.createElement("div", {
48
50
  className: styles__default.default.header
49
51
  }, /*#__PURE__*/React__default.default.createElement("button", {
@@ -1,5 +1,6 @@
1
1
  import type { PropsWithChildren, ReactNode } from "react";
2
- export type AccordionProps = PropsWithChildren<{
2
+ import type { TestIdProps } from "../helpers/testId";
3
+ export type AccordionProps = PropsWithChildren<TestIdProps & {
3
4
  title: ReactNode;
4
5
  className?: string;
5
6
  boldTitle?: boolean;
package/Avatar/index.js CHANGED
@@ -92,7 +92,6 @@ const Avatar = /*#__PURE__*/React.memo(props => {
92
92
  })
93
93
  }, onClick && roleProps), /*#__PURE__*/React__default.default.createElement("img", Object.assign({
94
94
  ref: ref,
95
- "data-testid": "avatar",
96
95
  alt: alt,
97
96
  src: src,
98
97
  className: clsx__default.default(styles__default.default.avatar, {
@@ -102,8 +101,7 @@ const Avatar = /*#__PURE__*/React.memo(props => {
102
101
  }
103
102
  if (hasInitials) {
104
103
  return /*#__PURE__*/React__default.default.createElement("span", Object.assign({
105
- ref: ref,
106
- "data-testid": "avatar"
104
+ ref: ref
107
105
  }, roleProps, {
108
106
  className: clsx__default.default(styles__default.default["avatar-initials"], {
109
107
  [styles__default.default["avatar-bordered"]]: Boolean(bordered),
@@ -114,8 +112,7 @@ const Avatar = /*#__PURE__*/React.memo(props => {
114
112
  }, initials.trim().slice(0, 2)));
115
113
  }
116
114
  return /*#__PURE__*/React__default.default.createElement("span", Object.assign({
117
- ref: ref,
118
- "data-testid": "avatar"
115
+ ref: ref
119
116
  }, roleProps, {
120
117
  className: clsx__default.default(styles__default.default["avatar-stub"], {
121
118
  [styles__default.default["avatar-bordered"]]: Boolean(bordered),
@@ -1,9 +1,10 @@
1
1
  import type { AvatarSize } from "./constants";
2
+ import type { TestIdProps } from "../helpers/testId";
2
3
  export declare enum AccountType {
3
4
  Person = "person",
4
5
  Organization = "org"
5
6
  }
6
- export type AvatarProps = {
7
+ export type AvatarProps = TestIdProps & {
7
8
  accountType?: AccountType;
8
9
  alt?: string;
9
10
  size?: AvatarSize;
@@ -1,3 +1,4 @@
1
- export interface ControlProps {
1
+ import type { TestIdProps } from "../../helpers/testId";
2
+ export interface ControlProps extends TestIdProps {
2
3
  className?: string;
3
4
  }
package/Badge/index.js CHANGED
@@ -32,8 +32,7 @@ const Badge = _a => {
32
32
  className: clsx__default.default(styles__default.default.root, {
33
33
  [styles__default.default[`root_direction_${direction}`]]: Boolean(direction),
34
34
  [styles__default.default["root_invisible"]]: Boolean(invisible)
35
- }, className),
36
- "data-testid": "badge"
35
+ }, className)
37
36
  }, displayValue)));
38
37
  };
39
38
 
package/Button/index.js CHANGED
@@ -38,7 +38,6 @@ const Button = _a => {
38
38
  [styles__default.default[`variant_${variant}_disabled`]]: Boolean(disabled)
39
39
  }, className),
40
40
  disabled: disabled,
41
- "data-testid": "button",
42
41
  type: type || "button"
43
42
  }, props), icon && /*#__PURE__*/React__default.default.createElement("span", {
44
43
  className: styles__default.default.icon
package/Checkbox/index.js CHANGED
@@ -24,9 +24,11 @@ const Checkbox = ({
24
24
  variant = "primary",
25
25
  className,
26
26
  disabled,
27
- hasError
27
+ hasError,
28
+ "data-testid": testId
28
29
  }) => (/*#__PURE__*/React__default.default.createElement("div", {
29
- className: styles__default.default.root
30
+ className: styles__default.default.root,
31
+ "data-testid": testId
30
32
  }, /*#__PURE__*/React__default.default.createElement("label", {
31
33
  className: styles__default.default.label,
32
34
  htmlFor: id
@@ -1,5 +1,6 @@
1
1
  import type { FocusEvent, ChangeEvent, ReactNode } from "react";
2
- export interface CheckboxProps {
2
+ import type { TestIdProps } from "../helpers/testId";
3
+ export interface CheckboxProps extends TestIdProps {
3
4
  checked?: boolean;
4
5
  className?: string;
5
6
  disabled?: boolean;
package/Chip/index.js CHANGED
@@ -19,13 +19,11 @@ const Chip = _a => {
19
19
  onClick,
20
20
  onClickIcon,
21
21
  size = "m",
22
- testID = "chip",
23
22
  variant = "primary"
24
23
  } = _a,
25
- props = tslib.__rest(_a, ["children", "iconEnd", "isActive", "onClick", "onClickIcon", "size", "testID", "variant"]);
24
+ props = tslib.__rest(_a, ["children", "iconEnd", "isActive", "onClick", "onClickIcon", "size", "variant"]);
26
25
  return /*#__PURE__*/React__default.default.createElement("span", Object.assign({
27
- className: styles__default.default.chip,
28
- "data-testid": testID
26
+ className: styles__default.default.chip
29
27
  }, props), /*#__PURE__*/React__default.default.createElement("span", {
30
28
  className: clsx__default.default(styles__default.default.inner, styles__default.default[`inner_variant_${variant}`], {
31
29
  [styles__default.default["inner_active"]]: iconEnd || isActive,
@@ -1,9 +1,9 @@
1
+ import type { TestIdProps } from "../helpers/testId";
1
2
  export type ChipSize = "s" | "m" | "l";
2
3
  export type ChipVariant = "primary" | "secondary" | "outline" | "pseudo" | "alert" | "success" | "clear";
3
- export type ChipProps = {
4
+ export type ChipProps = TestIdProps & {
4
5
  size?: ChipSize;
5
6
  variant?: ChipVariant;
6
- testID?: string;
7
7
  isActive?: boolean;
8
8
  iconEnd?: React.ReactNode;
9
9
  onClick?: () => void;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { ColorPickerProps } from "./index.props";
3
- export declare const ColorPicker: ({ value, onChange, presets, columns, disabled, placement, zIndex, labels: labelsProp, children, }: ColorPickerProps) => React.JSX.Element;
3
+ export declare const ColorPicker: ({ value, onChange, presets, columns, disabled, placement, zIndex, labels: labelsProp, children, "data-testid": testId, }: ColorPickerProps) => React.JSX.Element;
@@ -31,7 +31,8 @@ const ColorPicker = ({
31
31
  placement = "bottom-start",
32
32
  zIndex,
33
33
  labels: labelsProp,
34
- children
34
+ children,
35
+ "data-testid": testId
35
36
  }) => {
36
37
  var _a, _b;
37
38
  const [isOpen, setOpen] = React.useState(false);
@@ -85,7 +86,8 @@ const ColorPicker = ({
85
86
  }));
86
87
  return /*#__PURE__*/React__default.default.createElement("span", {
87
88
  ref: rootRef,
88
- className: styles__default.default.root
89
+ className: styles__default.default.root,
90
+ "data-testid": testId
89
91
  }, /*#__PURE__*/React__default.default.createElement(index$1.Dropdown, {
90
92
  trigger: ["click"],
91
93
  visible: isOpen,
@@ -1,5 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
2
  import type { Placement } from "@floating-ui/react";
3
+ import type { TestIdProps } from "../helpers/testId";
3
4
  export interface ColorPickerPreset {
4
5
  /** HEX color, for example `#d81b60`. */
5
6
  value: string;
@@ -24,7 +25,7 @@ export interface ColorPickerLabels {
24
25
  cancel: string;
25
26
  save: string;
26
27
  }
27
- export interface ColorPickerProps {
28
+ export interface ColorPickerProps extends TestIdProps {
28
29
  /** Current color in HEX. A color missing from `presets` is shown as an extra swatch. */
29
30
  value?: string;
30
31
  /** Called with the chosen color as lowercase `#rrggbb`. */
package/Counter/index.js CHANGED
@@ -20,7 +20,8 @@ const Counter = ({
20
20
  fullWidth,
21
21
  onChange,
22
22
  disabled,
23
- className
23
+ className,
24
+ "data-testid": testId
24
25
  }) => {
25
26
  const minusDisabled = disabled || value <= min;
26
27
  const plusDisabled = disabled || value >= max;
@@ -33,7 +34,8 @@ const Counter = ({
33
34
  return /*#__PURE__*/React__default.default.createElement("div", {
34
35
  className: clsx__default.default(styles__default.default.root, {
35
36
  [styles__default.default["root_fullWidth"]]: Boolean(fullWidth)
36
- }, className)
37
+ }, className),
38
+ "data-testid": testId
37
39
  }, /*#__PURE__*/React__default.default.createElement("div", {
38
40
  className: clsx__default.default(styles__default.default.control, {
39
41
  [styles__default.default["control_fullWidth"]]: Boolean(fullWidth)
@@ -1,4 +1,5 @@
1
- export type CounterProps = {
1
+ import type { TestIdProps } from "../helpers/testId";
2
+ export type CounterProps = TestIdProps & {
2
3
  value: number;
3
4
  max: number;
4
5
  min: number;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { Props } from "./index.props";
3
- export declare const Datepicker: ({ className, disabled, endPlaceholder, hasError, hint, label, placeholder, required, selectedDate, selectedRange, selectionMode, size, startPlaceholder, onChangeDate, onChangeRange, ...calendarProps }: Props) => React.JSX.Element;
3
+ export declare const Datepicker: ({ className, disabled, endPlaceholder, hasError, hint, label, placeholder, required, selectedDate, selectedRange, selectionMode, size, startPlaceholder, onChangeDate, onChangeRange, "data-testid": testId, ...calendarProps }: Props) => React.JSX.Element;
@@ -28,11 +28,13 @@ const Datepicker = _a => {
28
28
  size = "m",
29
29
  startPlaceholder,
30
30
  onChangeDate,
31
- onChangeRange
31
+ onChangeRange,
32
+ "data-testid": testId
32
33
  } = _a,
33
- calendarProps = tslib.__rest(_a, ["className", "disabled", "endPlaceholder", "hasError", "hint", "label", "placeholder", "required", "selectedDate", "selectedRange", "selectionMode", "size", "startPlaceholder", "onChangeDate", "onChangeRange"]);
34
+ calendarProps = tslib.__rest(_a, ["className", "disabled", "endPlaceholder", "hasError", "hint", "label", "placeholder", "required", "selectedDate", "selectedRange", "selectionMode", "size", "startPlaceholder", "onChangeDate", "onChangeRange", "data-testid"]);
34
35
  return /*#__PURE__*/React__default.default.createElement("div", {
35
- className: clsx__default.default(styles__default.default.root, className)
36
+ className: clsx__default.default(styles__default.default.root, className),
37
+ "data-testid": testId
36
38
  }, /*#__PURE__*/React__default.default.createElement(index.DatePicker, Object.assign({}, calendarProps, {
37
39
  disabled: disabled,
38
40
  endPlaceholder: endPlaceholder,
@@ -1,10 +1,11 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { CalendarCommonProps } from "../Calendar";
3
+ import type { TestIdProps } from "../helpers/testId";
3
4
  export type DatepickerSize = "s" | "m" | "l";
4
5
  export type DatepickerSelectionMode = "single" | "range";
5
6
  export type DatepickerRangeValue = [string, string];
6
7
  export type DatepickerCalendarProps = Omit<CalendarCommonProps, "className" | "size">;
7
- export type Props = DatepickerCalendarProps & {
8
+ export type Props = DatepickerCalendarProps & TestIdProps & {
8
9
  className?: string;
9
10
  disabled?: boolean;
10
11
  endPlaceholder?: string;
@@ -10,8 +10,11 @@ var React__default = /*#__PURE__*/_interopDefault(React);
10
10
  var clsx__default = /*#__PURE__*/_interopDefault(clsx);
11
11
  var styles__default = /*#__PURE__*/_interopDefault(styles);
12
12
 
13
- const DotsLoader = () => (/*#__PURE__*/React__default.default.createElement("div", {
14
- className: styles__default.default.wrapper
13
+ const DotsLoader = ({
14
+ "data-testid": testId
15
+ }) => (/*#__PURE__*/React__default.default.createElement("div", {
16
+ className: styles__default.default.wrapper,
17
+ "data-testid": testId
15
18
  }, /*#__PURE__*/React__default.default.createElement("div", {
16
19
  className: clsx__default.default({
17
20
  [styles__default.default.dot]: true,
@@ -1 +1,2 @@
1
- export type DotsLoaderProps = Record<string, never>;
1
+ import type { TestIdProps } from "../helpers/testId";
2
+ export type DotsLoaderProps = TestIdProps;
package/Dropdown/index.js CHANGED
@@ -14,6 +14,7 @@ var styles__default = /*#__PURE__*/_interopDefault(styles);
14
14
 
15
15
  const Dropdown = ({
16
16
  children,
17
+ "data-testid": testId,
17
18
  zIndex,
18
19
  fontSize,
19
20
  disabled,
@@ -95,7 +96,7 @@ const Dropdown = ({
95
96
  onClick: () => setOpen(false)
96
97
  }, /*#__PURE__*/React__default.default.createElement("div", Object.assign({
97
98
  ref: refs.setFloating,
98
- "data-testid": "popper-container",
99
+ "data-testid": testId,
99
100
  className: clsx__default.default(styles__default.default["popper-container"], styles__default.default[`placement-${finalPlacement}`]),
100
101
  style: Object.assign(Object.assign({}, floatingStyles), {
101
102
  zIndex,
@@ -105,7 +106,6 @@ const Dropdown = ({
105
106
  role: "menu",
106
107
  tabIndex: 0
107
108
  }, getFloatingProps()), /*#__PURE__*/React__default.default.createElement("div", {
108
- "data-testid": "overlay-container",
109
109
  className: styles__default.default["overlay-container"],
110
110
  onClick: onClickOverlay
111
111
  }, overlay))))));
@@ -1,7 +1,8 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { Placement, Strategy } from "@floating-ui/react";
3
+ import type { PopupTestIdProps } from "../helpers/testId";
3
4
  export type Trigger = "click" | "hover" | "focus";
4
- export type DropdownProps = {
5
+ export type DropdownProps = PopupTestIdProps & {
5
6
  defaultVisible?: boolean;
6
7
  disabled?: boolean;
7
8
  flip?: boolean;
package/Grid/index.js CHANGED
@@ -16,9 +16,11 @@ const Grid = ({
16
16
  gridRowGap = "6",
17
17
  gridColumnGap = "4",
18
18
  gridItemMinWidth = "var(--component-grid-item-min-width)",
19
- className
19
+ className,
20
+ "data-testid": testId
20
21
  }) => (/*#__PURE__*/React__default.default.createElement("div", {
21
22
  className: clsx__default.default(styles__default.default.root, className),
23
+ "data-testid": testId,
22
24
  style: {
23
25
  rowGap: `var(--space-${gridRowGap})`,
24
26
  columnGap: `var(--space-${gridColumnGap})`,
@@ -1,5 +1,6 @@
1
+ import type { TestIdProps } from "../helpers/testId";
1
2
  export type Space = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "8" | "10" | "12" | "16" | "20" | "24" | "32";
2
- export type GridProps = {
3
+ export type GridProps = TestIdProps & {
3
4
  className?: string;
4
5
  gridRowGap?: Space;
5
6
  gridColumnGap?: Space;
@@ -31,9 +31,9 @@ const InputRadio = /*#__PURE__*/React.memo(_a => {
31
31
  style,
32
32
  text,
33
33
  value,
34
- testid
34
+ "data-testid": testId
35
35
  } = _a,
36
- rest = tslib.__rest(_a, ["checked", "children", "className", "containerClassName", "disabled", "error", "id", "name", "note", "onBlur", "onFocus", "onChange", "onClick", "onMouseEnter", "style", "text", "value", "testid"]);
36
+ rest = tslib.__rest(_a, ["checked", "children", "className", "containerClassName", "disabled", "error", "id", "name", "note", "onBlur", "onFocus", "onChange", "onClick", "onMouseEnter", "style", "text", "value", "data-testid"]);
37
37
  return (
38
38
  /*#__PURE__*/
39
39
  // Keyboard activation of the nested radio dispatches a click that bubbles to the label.
@@ -44,7 +44,7 @@ const InputRadio = /*#__PURE__*/React.memo(_a => {
44
44
  style: style,
45
45
  onClick: onClick,
46
46
  onMouseEnter: onMouseEnter,
47
- "data-testid": testid
47
+ "data-testid": testId
48
48
  }, /*#__PURE__*/React__default.default.createElement("div", {
49
49
  className: clsx__default.default(styles__default.default.container, {
50
50
  [styles__default.default["container_disabled"]]: Boolean(disabled),
@@ -1,5 +1,6 @@
1
1
  import type { ChangeEvent, CSSProperties, FocusEvent, PropsWithChildren } from "react";
2
- export type InputRadioProps = PropsWithChildren<{
2
+ import type { TestIdProps } from "../helpers/testId";
3
+ export type InputRadioProps = PropsWithChildren<TestIdProps & {
3
4
  checked?: boolean;
4
5
  className?: string;
5
6
  containerClassName?: string;
@@ -16,5 +17,4 @@ export type InputRadioProps = PropsWithChildren<{
16
17
  style?: CSSProperties;
17
18
  text?: string;
18
19
  value: string | number;
19
- testid?: string;
20
20
  }>;
@@ -33,7 +33,6 @@ const MenuItem = _a => {
33
33
  ref: ref,
34
34
  role: "menuitem",
35
35
  tabIndex: disabled ? -1 : 0,
36
- "data-testid": "menuitem",
37
36
  "aria-disabled": disabled || undefined,
38
37
  className: clsx__default.default(styles__default.default.item, {
39
38
  [styles__default.default["item_disabled"]]: Boolean(disabled),
@@ -1,6 +1,7 @@
1
1
  import type { KeyboardEvent, MouseEvent } from "react";
2
2
  import type { MenuVariant } from "../../index.props";
3
- export interface MenuItemProps {
3
+ import type { TestIdProps } from "../../../helpers/testId";
4
+ export interface MenuItemProps extends TestIdProps {
4
5
  className?: string;
5
6
  isSelected?: boolean;
6
7
  onClick?: (event: MouseEvent<Element> | KeyboardEvent<Element>) => void;
package/Menu/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { Props } from "./index.props";
3
- export declare const Menu: ({ selected, variant, className, onClick, children, ref, }: Props) => React.JSX.Element;
3
+ export declare const Menu: ({ selected, variant, className, onClick, children, ref, "data-testid": testId, }: Props) => React.JSX.Element;
package/Menu/index.js CHANGED
@@ -16,7 +16,8 @@ const Menu = ({
16
16
  className,
17
17
  onClick,
18
18
  children,
19
- ref
19
+ ref,
20
+ "data-testid": testId
20
21
  }) => {
21
22
  const renderChild = React.useMemo(() => React.Children.map(children, child => {
22
23
  if (! /*#__PURE__*/React.isValidElement(child)) return child;
@@ -36,7 +37,8 @@ const Menu = ({
36
37
  return /*#__PURE__*/React__default.default.createElement("ul", {
37
38
  ref: ref,
38
39
  className: clsx__default.default(styles__default.default.menu, className),
39
- role: "menu"
40
+ role: "menu",
41
+ "data-testid": testId
40
42
  }, renderChild);
41
43
  };
42
44
 
@@ -1,7 +1,8 @@
1
1
  import type { ReactElement, KeyboardEvent, MouseEvent } from "react";
2
2
  import type { MenuItemProps } from "./components/MenuItem/index.props";
3
+ import type { TestIdProps } from "../helpers/testId";
3
4
  export type MenuVariant = "primary";
4
- export type Props = {
5
+ export type Props = TestIdProps & {
5
6
  selected?: string[];
6
7
  variant?: MenuVariant;
7
8
  className?: string;
package/Modal/index.js CHANGED
@@ -31,7 +31,8 @@ const ModalRoot = ({
31
31
  onClose,
32
32
  title,
33
33
  withinParent = false,
34
- fillParent = false
34
+ fillParent = false,
35
+ "data-testid": testId
35
36
  }) => {
36
37
  const [dialog, setDialog] = React.useState(null);
37
38
  const [container, setContainer] = React.useState(null);
@@ -99,6 +100,7 @@ const ModalRoot = ({
99
100
  ref: setDialog,
100
101
  role: "dialog",
101
102
  "aria-modal": "true",
103
+ "data-testid": testId,
102
104
  tabIndex: -1,
103
105
  "aria-labelledby": titleCount > 0 ? titleId : undefined
104
106
  }, /*#__PURE__*/React__default.default.createElement("div", {
@@ -1,5 +1,6 @@
1
1
  import type { HTMLAttributes } from "react";
2
- export type ModalProps = {
2
+ import type { TestIdProps } from "../helpers/testId";
3
+ export type ModalProps = TestIdProps & {
3
4
  className?: string;
4
5
  onClose?: () => void;
5
6
  /**
@@ -40,7 +40,8 @@ const MultiSelect = ({
40
40
  value = [],
41
41
  type,
42
42
  onChange,
43
- "aria-label": ariaLabel
43
+ "aria-label": ariaLabel,
44
+ "data-testid": testId
44
45
  }) => {
45
46
  const [isOpen, setIsOpen] = React.useState(false);
46
47
  const id = React.useId();
@@ -80,6 +81,7 @@ const MultiSelect = ({
80
81
  })
81
82
  }))), [preparedGroups]);
82
83
  return /*#__PURE__*/React__default.default.createElement(index$1.FormField, {
84
+ "data-testid": testId,
83
85
  className: clsx__default.default(styles__default.default["form-field"], {
84
86
  [styles__default.default["full-width"]]: Boolean(fullWidth)
85
87
  }, className),
@@ -20,7 +20,7 @@ const Radio = ({
20
20
  onMouseEnter,
21
21
  className,
22
22
  disabled = false,
23
- testId
23
+ "data-testid": testId
24
24
  }) => (/*#__PURE__*/React__default.default.createElement(index.InputRadio, {
25
25
  id: id,
26
26
  value: value,
@@ -34,7 +34,7 @@ const Radio = ({
34
34
  name: name,
35
35
  className: className,
36
36
  disabled: disabled,
37
- testid: testId
37
+ "data-testid": testId
38
38
  }));
39
39
 
40
40
  exports.Radio = Radio;
@@ -40,7 +40,7 @@ const RadioGroup = /*#__PURE__*/React.memo(({
40
40
  return /*#__PURE__*/React__default.default.createElement(Radio.Radio, {
41
41
  key: optionVal,
42
42
  id: id,
43
- testId: id,
43
+ "data-testid": id,
44
44
  value: optionVal,
45
45
  text: text,
46
46
  note: note,
@@ -34,5 +34,5 @@ export type RadioProps = {
34
34
  onMouseEnter?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
35
35
  className: string;
36
36
  disabled?: boolean;
37
- testId?: string;
37
+ "data-testid"?: string;
38
38
  };
package/Select/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { JSX } from "react";
2
2
  import type { SelectProps } from "./index.props";
3
- export declare const Select: <T extends string>({ options, value, name, zIndex, fontSize, label, hint, hasError, required, placeholder, disabled, size, fullWidth, customInputRoot, className, onChange, "aria-label": ariaLabel, }: SelectProps<T>) => JSX.Element;
3
+ export declare const Select: <T extends string>({ options, value, name, zIndex, fontSize, label, hint, hasError, required, placeholder, disabled, size, fullWidth, customInputRoot, className, onChange, "aria-label": ariaLabel, "data-testid": testId, }: SelectProps<T>) => JSX.Element;
package/Select/index.js CHANGED
@@ -32,7 +32,8 @@ const Select = ({
32
32
  customInputRoot,
33
33
  className,
34
34
  onChange,
35
- "aria-label": ariaLabel
35
+ "aria-label": ariaLabel,
36
+ "data-testid": testId
36
37
  }) => {
37
38
  const [isOpen, setIsOpen] = React.useState(false);
38
39
  const id = React.useId();
@@ -56,6 +57,7 @@ const Select = ({
56
57
  }) => selected)) === null || _a === void 0 ? void 0 : _a.label;
57
58
  }, [preparedOptions]);
58
59
  return /*#__PURE__*/React__default.default.createElement(index.FormField, {
60
+ "data-testid": testId,
59
61
  className: clsx__default.default(styles__default.default["form-field"], {
60
62
  [styles__default.default["full-width"]]: Boolean(fullWidth)
61
63
  }, className),
@@ -104,8 +106,7 @@ const Select = ({
104
106
  disabled: Boolean(disabled)
105
107
  }, /*#__PURE__*/React__default.default.createElement("div", {
106
108
  id: valueId,
107
- className: styles__default.default["base-input"],
108
- "data-testid": "base-input"
109
+ className: styles__default.default["base-input"]
109
110
  }, preparedLabel !== null && preparedLabel !== void 0 ? preparedLabel : (/*#__PURE__*/React__default.default.createElement("span", {
110
111
  className: styles__default.default.placeholder
111
112
  }, placeholder))), /*#__PURE__*/React__default.default.createElement("input", {
@@ -11,9 +11,11 @@ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
11
11
  var styles__default = /*#__PURE__*/_interopDefault(styles);
12
12
 
13
13
  const Separator = ({
14
- className
15
- }) => (/*#__PURE__*/React__default.default.createElement("div", {
16
- className: clsx__default.default(styles__default.default.root, className)
17
- }));
14
+ className,
15
+ "data-testid": testId
16
+ }) => /*#__PURE__*/React__default.default.createElement("div", {
17
+ className: clsx__default.default(styles__default.default.root, className),
18
+ "data-testid": testId
19
+ });
18
20
 
19
21
  exports.Separator = Separator;
@@ -1,3 +1,4 @@
1
- export type SeparatorProps = {
1
+ import type { TestIdProps } from "../helpers/testId";
2
+ export type SeparatorProps = TestIdProps & {
2
3
  className?: string;
3
4
  };
package/Skeleton/index.js CHANGED
@@ -15,9 +15,11 @@ const SkeletonRect = ({
15
15
  className,
16
16
  width,
17
17
  height,
18
- radius = "sm"
18
+ radius = "sm",
19
+ "data-testid": testId
19
20
  }) => (/*#__PURE__*/React__default.default.createElement("div", {
20
21
  className: clsx__default.default(styles__default.default.rect, className),
22
+ "data-testid": testId,
21
23
  style: {
22
24
  width: toRemLength(width),
23
25
  height: toRemLength(height),
@@ -27,9 +29,11 @@ const SkeletonRect = ({
27
29
  const SkeletonText = ({
28
30
  className,
29
31
  width,
30
- size
32
+ size,
33
+ "data-testid": testId
31
34
  }) => (/*#__PURE__*/React__default.default.createElement("div", {
32
35
  className: clsx__default.default(styles__default.default.text, className),
36
+ "data-testid": testId,
33
37
  style: {
34
38
  width: toRemLength(width),
35
39
  height: toRemLength(size)
@@ -1,9 +1,10 @@
1
- export type TextProps = {
1
+ import type { TestIdProps } from "../helpers/testId";
2
+ export type TextProps = TestIdProps & {
2
3
  className?: string;
3
4
  width?: number | string;
4
5
  size?: number | string;
5
6
  };
6
- export type RectProps = {
7
+ export type RectProps = TestIdProps & {
7
8
  className?: string;
8
9
  width?: number | string;
9
10
  height?: number | string;
package/Status/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { PropsWithChildren } from "react";
3
3
  import type { StatusProps } from "./index.props";
4
- export declare const Status: ({ className, indicator, showIndicator, tag: Component, children, type, }: PropsWithChildren<StatusProps>) => React.JSX.Element;
4
+ export declare const Status: ({ className, indicator, showIndicator, tag: Component, children, type, "data-testid": testId, }: PropsWithChildren<StatusProps>) => React.JSX.Element;