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
package/Status/index.js CHANGED
@@ -16,8 +16,10 @@ const Status = ({
16
16
  showIndicator = true,
17
17
  tag: Component = "span",
18
18
  children,
19
- type
19
+ type,
20
+ "data-testid": testId
20
21
  }) => (/*#__PURE__*/React__default.default.createElement(Component, {
22
+ "data-testid": testId,
21
23
  className: clsx__default.default(styles__default.default.root, {
22
24
  [styles__default.default[`root_${type}`]]: Boolean(type)
23
25
  }, className)
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { TestIdProps } from "../helpers/testId";
2
3
  export type StatusTag = "span" | "div";
3
4
  export declare enum STATUS_TYPE {
4
5
  SUCCESS = "success",
@@ -6,7 +7,7 @@ export declare enum STATUS_TYPE {
6
7
  INFO = "info",
7
8
  WARNING = "warning"
8
9
  }
9
- export type StatusProps = {
10
+ export type StatusProps = TestIdProps & {
10
11
  className?: string;
11
12
  indicator?: ReactNode;
12
13
  showIndicator?: boolean;
package/TextArea/index.js CHANGED
@@ -53,7 +53,6 @@ const TextArea = _a => {
53
53
  hasError: hasError
54
54
  }, /*#__PURE__*/React__default.default.createElement(TextareaAutosize__default.default, Object.assign({
55
55
  ref: inputRef,
56
- "data-testid": "textarea",
57
56
  disabled: disabled,
58
57
  minRows: minRows,
59
58
  maxRows: maxRows,
@@ -29,7 +29,8 @@ const TimeSelect = ({
29
29
  zIndex,
30
30
  hasError,
31
31
  hint,
32
- "aria-label": ariaLabel
32
+ "aria-label": ariaLabel,
33
+ "data-testid": testId
33
34
  }) => {
34
35
  const baseOptions = React.useMemo(() => helpers.generateSuggest(interval).map(item => ({
35
36
  value: item.time,
@@ -45,6 +46,7 @@ const TimeSelect = ({
45
46
  }), [baseOptions, currentDate, selectedDate, allowedTimeRange, interval]);
46
47
  return /*#__PURE__*/React__default.default.createElement(index$1.Select, {
47
48
  "aria-label": ariaLabel,
49
+ "data-testid": testId,
48
50
  className: className,
49
51
  customInputRoot: customInputRoot,
50
52
  fontSize: fontSize,
package/Tooltip/index.js CHANGED
@@ -18,7 +18,8 @@ const Tooltip = ({
18
18
  withTail = false,
19
19
  placement = "bottom",
20
20
  strategy = "absolute",
21
- className
21
+ className,
22
+ "data-testid": testId
22
23
  }) => {
23
24
  const [isOpen, setIsOpen] = React.useState(false);
24
25
  const arrowRef = React.useRef(null);
@@ -66,6 +67,7 @@ const Tooltip = ({
66
67
  ref: refs.setFloating
67
68
  }, getFloatingProps(), {
68
69
  className: clsx__default.default(styles__default.default.tooltip, className),
70
+ "data-testid": testId,
69
71
  style: Object.assign(Object.assign({}, floatingStyles), {
70
72
  zIndex
71
73
  })
@@ -1,6 +1,7 @@
1
1
  import type { Placement, Strategy } from "@floating-ui/react";
2
2
  import type { ReactNode } from "react";
3
- export type TooltipProps = {
3
+ import type { PopupTestIdProps } from "../helpers/testId";
4
+ export type TooltipProps = PopupTestIdProps & {
4
5
  content: ReactNode;
5
6
  zIndex?: number;
6
7
  placement?: Placement;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { FormFieldProps } from "./index.props";
3
- export declare const FormField: ({ label, hint, children, hasError, hintId, htmlFor, labelId, required, className, ref, }: FormFieldProps) => React.JSX.Element;
3
+ export declare const FormField: ({ label, hint, children, hasError, hintId, htmlFor, labelId, required, className, ref, "data-testid": testId, }: FormFieldProps) => React.JSX.Element;
@@ -21,10 +21,12 @@ const FormField = ({
21
21
  labelId,
22
22
  required,
23
23
  className,
24
- ref
24
+ ref,
25
+ "data-testid": testId
25
26
  }) => (/*#__PURE__*/React__default.default.createElement("div", {
26
27
  className: clsx__default.default(styles__default.default.container, className),
27
- ref: ref
28
+ ref: ref,
29
+ "data-testid": testId
28
30
  }, label && (/*#__PURE__*/React__default.default.createElement(index.Typography, {
29
31
  className: clsx__default.default(styles__default.default.label, {
30
32
  [styles__default.default.label_required]: Boolean(required)
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { PropsWithChildren } from "react";
3
- export type FormFieldProps = PropsWithChildren<{
3
+ import type { TestIdProps } from "../../helpers/testId";
4
+ export type FormFieldProps = PropsWithChildren<TestIdProps & {
4
5
  className?: string;
5
6
  hasError?: boolean;
6
7
  hint?: ReactNode;
@@ -11,7 +11,8 @@ const Accordion = ({
11
11
  children,
12
12
  className,
13
13
  tabIndex,
14
- defaultOpen = false
14
+ defaultOpen = false,
15
+ "data-testid": testId
15
16
  }) => {
16
17
  const [isOpen, setIsOpen] = useState(defaultOpen);
17
18
  const contentRef = useRef(null);
@@ -35,7 +36,8 @@ const Accordion = ({
35
36
  return () => observer.disconnect();
36
37
  }, [isOpen]);
37
38
  return /*#__PURE__*/React.createElement("div", {
38
- className: clsx(styles.root, className)
39
+ className: clsx(styles.root, className),
40
+ "data-testid": testId
39
41
  }, /*#__PURE__*/React.createElement("div", {
40
42
  className: styles.header
41
43
  }, /*#__PURE__*/React.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;
@@ -84,7 +84,6 @@ const Avatar = /*#__PURE__*/memo(props => {
84
84
  })
85
85
  }, onClick && roleProps), /*#__PURE__*/React.createElement("img", Object.assign({
86
86
  ref: ref,
87
- "data-testid": "avatar",
88
87
  alt: alt,
89
88
  src: src,
90
89
  className: clsx(styles.avatar, {
@@ -94,8 +93,7 @@ const Avatar = /*#__PURE__*/memo(props => {
94
93
  }
95
94
  if (hasInitials) {
96
95
  return /*#__PURE__*/React.createElement("span", Object.assign({
97
- ref: ref,
98
- "data-testid": "avatar"
96
+ ref: ref
99
97
  }, roleProps, {
100
98
  className: clsx(styles["avatar-initials"], {
101
99
  [styles["avatar-bordered"]]: Boolean(bordered),
@@ -106,8 +104,7 @@ const Avatar = /*#__PURE__*/memo(props => {
106
104
  }, initials.trim().slice(0, 2)));
107
105
  }
108
106
  return /*#__PURE__*/React.createElement("span", Object.assign({
109
- ref: ref,
110
- "data-testid": "avatar"
107
+ ref: ref
111
108
  }, roleProps, {
112
109
  className: clsx(styles["avatar-stub"], {
113
110
  [styles["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
  }
@@ -24,8 +24,7 @@ const Badge = _a => {
24
24
  className: clsx(styles.root, {
25
25
  [styles[`root_direction_${direction}`]]: Boolean(direction),
26
26
  [styles["root_invisible"]]: Boolean(invisible)
27
- }, className),
28
- "data-testid": "badge"
27
+ }, className)
29
28
  }, displayValue)));
30
29
  };
31
30
 
@@ -30,7 +30,6 @@ const Button = _a => {
30
30
  [styles[`variant_${variant}_disabled`]]: Boolean(disabled)
31
31
  }, className),
32
32
  disabled: disabled,
33
- "data-testid": "button",
34
33
  type: type || "button"
35
34
  }, props), icon && /*#__PURE__*/React.createElement("span", {
36
35
  className: styles.icon
@@ -16,9 +16,11 @@ const Checkbox = ({
16
16
  variant = "primary",
17
17
  className,
18
18
  disabled,
19
- hasError
19
+ hasError,
20
+ "data-testid": testId
20
21
  }) => (/*#__PURE__*/React.createElement("div", {
21
- className: styles.root
22
+ className: styles.root,
23
+ "data-testid": testId
22
24
  }, /*#__PURE__*/React.createElement("label", {
23
25
  className: styles.label,
24
26
  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/esm/Chip/index.js CHANGED
@@ -11,13 +11,11 @@ const Chip = _a => {
11
11
  onClick,
12
12
  onClickIcon,
13
13
  size = "m",
14
- testID = "chip",
15
14
  variant = "primary"
16
15
  } = _a,
17
- props = __rest(_a, ["children", "iconEnd", "isActive", "onClick", "onClickIcon", "size", "testID", "variant"]);
16
+ props = __rest(_a, ["children", "iconEnd", "isActive", "onClick", "onClickIcon", "size", "variant"]);
18
17
  return /*#__PURE__*/React.createElement("span", Object.assign({
19
- className: styles.chip,
20
- "data-testid": testID
18
+ className: styles.chip
21
19
  }, props), /*#__PURE__*/React.createElement("span", {
22
20
  className: clsx(styles.inner, styles[`inner_variant_${variant}`], {
23
21
  [styles["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;
@@ -23,7 +23,8 @@ const ColorPicker = ({
23
23
  placement = "bottom-start",
24
24
  zIndex,
25
25
  labels: labelsProp,
26
- children
26
+ children,
27
+ "data-testid": testId
27
28
  }) => {
28
29
  var _a, _b;
29
30
  const [isOpen, setOpen] = useState(false);
@@ -77,7 +78,8 @@ const ColorPicker = ({
77
78
  }));
78
79
  return /*#__PURE__*/React.createElement("span", {
79
80
  ref: rootRef,
80
- className: styles.root
81
+ className: styles.root,
82
+ "data-testid": testId
81
83
  }, /*#__PURE__*/React.createElement(Dropdown, {
82
84
  trigger: ["click"],
83
85
  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`. */
@@ -12,7 +12,8 @@ const Counter = ({
12
12
  fullWidth,
13
13
  onChange,
14
14
  disabled,
15
- className
15
+ className,
16
+ "data-testid": testId
16
17
  }) => {
17
18
  const minusDisabled = disabled || value <= min;
18
19
  const plusDisabled = disabled || value >= max;
@@ -25,7 +26,8 @@ const Counter = ({
25
26
  return /*#__PURE__*/React.createElement("div", {
26
27
  className: clsx(styles.root, {
27
28
  [styles["root_fullWidth"]]: Boolean(fullWidth)
28
- }, className)
29
+ }, className),
30
+ "data-testid": testId
29
31
  }, /*#__PURE__*/React.createElement("div", {
30
32
  className: clsx(styles.control, {
31
33
  [styles["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;
@@ -20,11 +20,13 @@ const Datepicker = _a => {
20
20
  size = "m",
21
21
  startPlaceholder,
22
22
  onChangeDate,
23
- onChangeRange
23
+ onChangeRange,
24
+ "data-testid": testId
24
25
  } = _a,
25
- calendarProps = __rest(_a, ["className", "disabled", "endPlaceholder", "hasError", "hint", "label", "placeholder", "required", "selectedDate", "selectedRange", "selectionMode", "size", "startPlaceholder", "onChangeDate", "onChangeRange"]);
26
+ calendarProps = __rest(_a, ["className", "disabled", "endPlaceholder", "hasError", "hint", "label", "placeholder", "required", "selectedDate", "selectedRange", "selectionMode", "size", "startPlaceholder", "onChangeDate", "onChangeRange", "data-testid"]);
26
27
  return /*#__PURE__*/React.createElement("div", {
27
- className: clsx(styles.root, className)
28
+ className: clsx(styles.root, className),
29
+ "data-testid": testId
28
30
  }, /*#__PURE__*/React.createElement(DatePicker, Object.assign({}, calendarProps, {
29
31
  disabled: disabled,
30
32
  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;
@@ -2,8 +2,11 @@ import React from 'react';
2
2
  import clsx from 'clsx';
3
3
  import styles from './DotsLoader.module.css';
4
4
 
5
- const DotsLoader = () => (/*#__PURE__*/React.createElement("div", {
6
- className: styles.wrapper
5
+ const DotsLoader = ({
6
+ "data-testid": testId
7
+ }) => (/*#__PURE__*/React.createElement("div", {
8
+ className: styles.wrapper,
9
+ "data-testid": testId
7
10
  }, /*#__PURE__*/React.createElement("div", {
8
11
  className: clsx({
9
12
  [styles.dot]: true,
@@ -1 +1,2 @@
1
- export type DotsLoaderProps = Record<string, never>;
1
+ import type { TestIdProps } from "../helpers/testId";
2
+ export type DotsLoaderProps = TestIdProps;
@@ -6,6 +6,7 @@ import styles from './Dropdown.module.css';
6
6
 
7
7
  const Dropdown = ({
8
8
  children,
9
+ "data-testid": testId,
9
10
  zIndex,
10
11
  fontSize,
11
12
  disabled,
@@ -87,7 +88,7 @@ const Dropdown = ({
87
88
  onClick: () => setOpen(false)
88
89
  }, /*#__PURE__*/React.createElement("div", Object.assign({
89
90
  ref: refs.setFloating,
90
- "data-testid": "popper-container",
91
+ "data-testid": testId,
91
92
  className: clsx(styles["popper-container"], styles[`placement-${finalPlacement}`]),
92
93
  style: Object.assign(Object.assign({}, floatingStyles), {
93
94
  zIndex,
@@ -97,7 +98,6 @@ const Dropdown = ({
97
98
  role: "menu",
98
99
  tabIndex: 0
99
100
  }, getFloatingProps()), /*#__PURE__*/React.createElement("div", {
100
- "data-testid": "overlay-container",
101
101
  className: styles["overlay-container"],
102
102
  onClick: onClickOverlay
103
103
  }, 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/esm/Grid/index.js CHANGED
@@ -8,9 +8,11 @@ const Grid = ({
8
8
  gridRowGap = "6",
9
9
  gridColumnGap = "4",
10
10
  gridItemMinWidth = "var(--component-grid-item-min-width)",
11
- className
11
+ className,
12
+ "data-testid": testId
12
13
  }) => (/*#__PURE__*/React.createElement("div", {
13
14
  className: clsx(styles.root, className),
15
+ "data-testid": testId,
14
16
  style: {
15
17
  rowGap: `var(--space-${gridRowGap})`,
16
18
  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;
@@ -23,9 +23,9 @@ const InputRadio = /*#__PURE__*/memo(_a => {
23
23
  style,
24
24
  text,
25
25
  value,
26
- testid
26
+ "data-testid": testId
27
27
  } = _a,
28
- rest = __rest(_a, ["checked", "children", "className", "containerClassName", "disabled", "error", "id", "name", "note", "onBlur", "onFocus", "onChange", "onClick", "onMouseEnter", "style", "text", "value", "testid"]);
28
+ rest = __rest(_a, ["checked", "children", "className", "containerClassName", "disabled", "error", "id", "name", "note", "onBlur", "onFocus", "onChange", "onClick", "onMouseEnter", "style", "text", "value", "data-testid"]);
29
29
  return (
30
30
  /*#__PURE__*/
31
31
  // Keyboard activation of the nested radio dispatches a click that bubbles to the label.
@@ -36,7 +36,7 @@ const InputRadio = /*#__PURE__*/memo(_a => {
36
36
  style: style,
37
37
  onClick: onClick,
38
38
  onMouseEnter: onMouseEnter,
39
- "data-testid": testid
39
+ "data-testid": testId
40
40
  }, /*#__PURE__*/React.createElement("div", {
41
41
  className: clsx(styles.container, {
42
42
  [styles["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
  }>;
@@ -25,7 +25,6 @@ const MenuItem = _a => {
25
25
  ref: ref,
26
26
  role: "menuitem",
27
27
  tabIndex: disabled ? -1 : 0,
28
- "data-testid": "menuitem",
29
28
  "aria-disabled": disabled || undefined,
30
29
  className: clsx(styles.item, {
31
30
  [styles["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;
@@ -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/esm/Menu/index.js CHANGED
@@ -8,7 +8,8 @@ const Menu = ({
8
8
  className,
9
9
  onClick,
10
10
  children,
11
- ref
11
+ ref,
12
+ "data-testid": testId
12
13
  }) => {
13
14
  const renderChild = useMemo(() => Children.map(children, child => {
14
15
  if (! /*#__PURE__*/isValidElement(child)) return child;
@@ -28,7 +29,8 @@ const Menu = ({
28
29
  return /*#__PURE__*/React.createElement("ul", {
29
30
  ref: ref,
30
31
  className: clsx(styles.menu, className),
31
- role: "menu"
32
+ role: "menu",
33
+ "data-testid": testId
32
34
  }, renderChild);
33
35
  };
34
36
 
@@ -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;
@@ -23,7 +23,8 @@ const ModalRoot = ({
23
23
  onClose,
24
24
  title,
25
25
  withinParent = false,
26
- fillParent = false
26
+ fillParent = false,
27
+ "data-testid": testId
27
28
  }) => {
28
29
  const [dialog, setDialog] = useState(null);
29
30
  const [container, setContainer] = useState(null);
@@ -91,6 +92,7 @@ const ModalRoot = ({
91
92
  ref: setDialog,
92
93
  role: "dialog",
93
94
  "aria-modal": "true",
95
+ "data-testid": testId,
94
96
  tabIndex: -1,
95
97
  "aria-labelledby": titleCount > 0 ? titleId : undefined
96
98
  }, /*#__PURE__*/React.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
  /**
@@ -32,7 +32,8 @@ const MultiSelect = ({
32
32
  value = [],
33
33
  type,
34
34
  onChange,
35
- "aria-label": ariaLabel
35
+ "aria-label": ariaLabel,
36
+ "data-testid": testId
36
37
  }) => {
37
38
  const [isOpen, setIsOpen] = useState(false);
38
39
  const id = useId();
@@ -72,6 +73,7 @@ const MultiSelect = ({
72
73
  })
73
74
  }))), [preparedGroups]);
74
75
  return /*#__PURE__*/React.createElement(FormField, {
76
+ "data-testid": testId,
75
77
  className: clsx(styles["form-field"], {
76
78
  [styles["full-width"]]: Boolean(fullWidth)
77
79
  }, className),
@@ -14,7 +14,7 @@ const Radio = ({
14
14
  onMouseEnter,
15
15
  className,
16
16
  disabled = false,
17
- testId
17
+ "data-testid": testId
18
18
  }) => (/*#__PURE__*/React.createElement(InputRadio, {
19
19
  id: id,
20
20
  value: value,
@@ -28,7 +28,7 @@ const Radio = ({
28
28
  name: name,
29
29
  className: className,
30
30
  disabled: disabled,
31
- testid: testId
31
+ "data-testid": testId
32
32
  }));
33
33
 
34
34
  export { Radio };
@@ -32,7 +32,7 @@ const RadioGroup = /*#__PURE__*/memo(({
32
32
  return /*#__PURE__*/React.createElement(Radio, {
33
33
  key: optionVal,
34
34
  id: id,
35
- testId: id,
35
+ "data-testid": id,
36
36
  value: optionVal,
37
37
  text: text,
38
38
  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
  };