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.
- package/Accordion/index.js +4 -2
- package/Accordion/index.props.d.ts +2 -1
- package/Avatar/index.js +2 -5
- package/Avatar/index.props.d.ts +2 -1
- package/Badge/Control/index.props.d.ts +2 -1
- package/Badge/index.js +1 -2
- package/Button/index.js +0 -1
- package/Checkbox/index.js +4 -2
- package/Checkbox/index.props.d.ts +2 -1
- package/Chip/index.js +2 -4
- package/Chip/index.props.d.ts +2 -2
- package/ColorPicker/ColorPicker.d.ts +1 -1
- package/ColorPicker/ColorPicker.js +4 -2
- package/ColorPicker/index.props.d.ts +2 -1
- package/Counter/index.js +4 -2
- package/Counter/index.props.d.ts +2 -1
- package/Datepicker/index.d.ts +1 -1
- package/Datepicker/index.js +5 -3
- package/Datepicker/index.props.d.ts +2 -1
- package/DotsLoader/index.js +5 -2
- package/DotsLoader/index.props.d.ts +2 -1
- package/Dropdown/index.js +2 -2
- package/Dropdown/index.props.d.ts +2 -1
- package/Grid/index.js +3 -1
- package/Grid/index.props.d.ts +2 -1
- package/InputRadio/index.js +3 -3
- package/InputRadio/index.props.d.ts +2 -2
- package/Menu/components/MenuItem/index.js +0 -1
- package/Menu/components/MenuItem/index.props.d.ts +2 -1
- package/Menu/index.d.ts +1 -1
- package/Menu/index.js +4 -2
- package/Menu/index.props.d.ts +2 -1
- package/Modal/index.js +3 -1
- package/Modal/index.props.d.ts +2 -1
- package/MultiSelect/index.js +3 -1
- package/RadioGroup/Radio.js +2 -2
- package/RadioGroup/index.js +1 -1
- package/RadioGroup/index.props.d.ts +1 -1
- package/Select/index.d.ts +1 -1
- package/Select/index.js +4 -3
- package/Separator/index.js +6 -4
- package/Separator/index.props.d.ts +2 -1
- package/Skeleton/index.js +6 -2
- package/Skeleton/index.props.d.ts +3 -2
- package/Status/index.d.ts +1 -1
- package/Status/index.js +3 -1
- package/Status/index.props.d.ts +2 -1
- package/TextArea/index.js +0 -1
- package/TimeSelect/index.js +3 -1
- package/Tooltip/index.js +3 -1
- package/Tooltip/index.props.d.ts +2 -1
- package/base/FormField/index.d.ts +1 -1
- package/base/FormField/index.js +4 -2
- package/base/FormField/index.props.d.ts +2 -1
- package/esm/Accordion/index.js +4 -2
- package/esm/Accordion/index.props.d.ts +2 -1
- package/esm/Avatar/index.js +2 -5
- package/esm/Avatar/index.props.d.ts +2 -1
- package/esm/Badge/Control/index.props.d.ts +2 -1
- package/esm/Badge/index.js +1 -2
- package/esm/Button/index.js +0 -1
- package/esm/Checkbox/index.js +4 -2
- package/esm/Checkbox/index.props.d.ts +2 -1
- package/esm/Chip/index.js +2 -4
- package/esm/Chip/index.props.d.ts +2 -2
- package/esm/ColorPicker/ColorPicker.d.ts +1 -1
- package/esm/ColorPicker/ColorPicker.js +4 -2
- package/esm/ColorPicker/index.props.d.ts +2 -1
- package/esm/Counter/index.js +4 -2
- package/esm/Counter/index.props.d.ts +2 -1
- package/esm/Datepicker/index.d.ts +1 -1
- package/esm/Datepicker/index.js +5 -3
- package/esm/Datepicker/index.props.d.ts +2 -1
- package/esm/DotsLoader/index.js +5 -2
- package/esm/DotsLoader/index.props.d.ts +2 -1
- package/esm/Dropdown/index.js +2 -2
- package/esm/Dropdown/index.props.d.ts +2 -1
- package/esm/Grid/index.js +3 -1
- package/esm/Grid/index.props.d.ts +2 -1
- package/esm/InputRadio/index.js +3 -3
- package/esm/InputRadio/index.props.d.ts +2 -2
- package/esm/Menu/components/MenuItem/index.js +0 -1
- package/esm/Menu/components/MenuItem/index.props.d.ts +2 -1
- package/esm/Menu/index.d.ts +1 -1
- package/esm/Menu/index.js +4 -2
- package/esm/Menu/index.props.d.ts +2 -1
- package/esm/Modal/index.js +3 -1
- package/esm/Modal/index.props.d.ts +2 -1
- package/esm/MultiSelect/index.js +3 -1
- package/esm/RadioGroup/Radio.js +2 -2
- package/esm/RadioGroup/index.js +1 -1
- package/esm/RadioGroup/index.props.d.ts +1 -1
- package/esm/Select/index.d.ts +1 -1
- package/esm/Select/index.js +4 -3
- package/esm/Separator/index.js +6 -4
- package/esm/Separator/index.props.d.ts +2 -1
- package/esm/Skeleton/index.js +6 -2
- package/esm/Skeleton/index.props.d.ts +3 -2
- package/esm/Status/index.d.ts +1 -1
- package/esm/Status/index.js +3 -1
- package/esm/Status/index.props.d.ts +2 -1
- package/esm/TextArea/index.js +0 -1
- package/esm/TimeSelect/index.js +3 -1
- package/esm/Tooltip/index.js +3 -1
- package/esm/Tooltip/index.props.d.ts +2 -1
- package/esm/base/FormField/index.d.ts +1 -1
- package/esm/base/FormField/index.js +4 -2
- package/esm/base/FormField/index.props.d.ts +2 -1
- package/esm/helpers/testId.d.ts +18 -0
- package/esm/index.d.ts +1 -0
- package/helpers/testId.d.ts +18 -0
- package/index.d.ts +1 -0
- package/package.json +1 -1
package/esm/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/esm/Select/index.js
CHANGED
|
@@ -24,7 +24,8 @@ const Select = ({
|
|
|
24
24
|
customInputRoot,
|
|
25
25
|
className,
|
|
26
26
|
onChange,
|
|
27
|
-
"aria-label": ariaLabel
|
|
27
|
+
"aria-label": ariaLabel,
|
|
28
|
+
"data-testid": testId
|
|
28
29
|
}) => {
|
|
29
30
|
const [isOpen, setIsOpen] = useState(false);
|
|
30
31
|
const id = useId();
|
|
@@ -48,6 +49,7 @@ const Select = ({
|
|
|
48
49
|
}) => selected)) === null || _a === void 0 ? void 0 : _a.label;
|
|
49
50
|
}, [preparedOptions]);
|
|
50
51
|
return /*#__PURE__*/React.createElement(FormField, {
|
|
52
|
+
"data-testid": testId,
|
|
51
53
|
className: clsx(styles["form-field"], {
|
|
52
54
|
[styles["full-width"]]: Boolean(fullWidth)
|
|
53
55
|
}, className),
|
|
@@ -96,8 +98,7 @@ const Select = ({
|
|
|
96
98
|
disabled: Boolean(disabled)
|
|
97
99
|
}, /*#__PURE__*/React.createElement("div", {
|
|
98
100
|
id: valueId,
|
|
99
|
-
className: styles["base-input"]
|
|
100
|
-
"data-testid": "base-input"
|
|
101
|
+
className: styles["base-input"]
|
|
101
102
|
}, preparedLabel !== null && preparedLabel !== void 0 ? preparedLabel : (/*#__PURE__*/React.createElement("span", {
|
|
102
103
|
className: styles.placeholder
|
|
103
104
|
}, placeholder))), /*#__PURE__*/React.createElement("input", {
|
package/esm/Separator/index.js
CHANGED
|
@@ -3,9 +3,11 @@ import clsx from 'clsx';
|
|
|
3
3
|
import styles from './Separator.module.css';
|
|
4
4
|
|
|
5
5
|
const Separator = ({
|
|
6
|
-
className
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
className,
|
|
7
|
+
"data-testid": testId
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: clsx(styles.root, className),
|
|
10
|
+
"data-testid": testId
|
|
11
|
+
});
|
|
10
12
|
|
|
11
13
|
export { Separator };
|
package/esm/Skeleton/index.js
CHANGED
|
@@ -7,9 +7,11 @@ const SkeletonRect = ({
|
|
|
7
7
|
className,
|
|
8
8
|
width,
|
|
9
9
|
height,
|
|
10
|
-
radius = "sm"
|
|
10
|
+
radius = "sm",
|
|
11
|
+
"data-testid": testId
|
|
11
12
|
}) => (/*#__PURE__*/React.createElement("div", {
|
|
12
13
|
className: clsx(styles.rect, className),
|
|
14
|
+
"data-testid": testId,
|
|
13
15
|
style: {
|
|
14
16
|
width: toRemLength(width),
|
|
15
17
|
height: toRemLength(height),
|
|
@@ -19,9 +21,11 @@ const SkeletonRect = ({
|
|
|
19
21
|
const SkeletonText = ({
|
|
20
22
|
className,
|
|
21
23
|
width,
|
|
22
|
-
size
|
|
24
|
+
size,
|
|
25
|
+
"data-testid": testId
|
|
23
26
|
}) => (/*#__PURE__*/React.createElement("div", {
|
|
24
27
|
className: clsx(styles.text, className),
|
|
28
|
+
"data-testid": testId,
|
|
25
29
|
style: {
|
|
26
30
|
width: toRemLength(width),
|
|
27
31
|
height: toRemLength(size)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
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/esm/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;
|
package/esm/Status/index.js
CHANGED
|
@@ -8,8 +8,10 @@ const Status = ({
|
|
|
8
8
|
showIndicator = true,
|
|
9
9
|
tag: Component = "span",
|
|
10
10
|
children,
|
|
11
|
-
type
|
|
11
|
+
type,
|
|
12
|
+
"data-testid": testId
|
|
12
13
|
}) => (/*#__PURE__*/React.createElement(Component, {
|
|
14
|
+
"data-testid": testId,
|
|
13
15
|
className: clsx(styles.root, {
|
|
14
16
|
[styles[`root_${type}`]]: Boolean(type)
|
|
15
17
|
}, 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/esm/TextArea/index.js
CHANGED
package/esm/TimeSelect/index.js
CHANGED
|
@@ -23,7 +23,8 @@ const TimeSelect = ({
|
|
|
23
23
|
zIndex,
|
|
24
24
|
hasError,
|
|
25
25
|
hint,
|
|
26
|
-
"aria-label": ariaLabel
|
|
26
|
+
"aria-label": ariaLabel,
|
|
27
|
+
"data-testid": testId
|
|
27
28
|
}) => {
|
|
28
29
|
const baseOptions = useMemo(() => generateSuggest(interval).map(item => ({
|
|
29
30
|
value: item.time,
|
|
@@ -39,6 +40,7 @@ const TimeSelect = ({
|
|
|
39
40
|
}), [baseOptions, currentDate, selectedDate, allowedTimeRange, interval]);
|
|
40
41
|
return /*#__PURE__*/React.createElement(Select, {
|
|
41
42
|
"aria-label": ariaLabel,
|
|
43
|
+
"data-testid": testId,
|
|
42
44
|
className: className,
|
|
43
45
|
customInputRoot: customInputRoot,
|
|
44
46
|
fontSize: fontSize,
|
package/esm/Tooltip/index.js
CHANGED
|
@@ -10,7 +10,8 @@ const Tooltip = ({
|
|
|
10
10
|
withTail = false,
|
|
11
11
|
placement = "bottom",
|
|
12
12
|
strategy = "absolute",
|
|
13
|
-
className
|
|
13
|
+
className,
|
|
14
|
+
"data-testid": testId
|
|
14
15
|
}) => {
|
|
15
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
17
|
const arrowRef = useRef(null);
|
|
@@ -58,6 +59,7 @@ const Tooltip = ({
|
|
|
58
59
|
ref: refs.setFloating
|
|
59
60
|
}, getFloatingProps(), {
|
|
60
61
|
className: clsx(styles.tooltip, className),
|
|
62
|
+
"data-testid": testId,
|
|
61
63
|
style: Object.assign(Object.assign({}, floatingStyles), {
|
|
62
64
|
zIndex
|
|
63
65
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Placement, Strategy } from "@floating-ui/react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
|
|
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;
|
|
@@ -13,10 +13,12 @@ const FormField = ({
|
|
|
13
13
|
labelId,
|
|
14
14
|
required,
|
|
15
15
|
className,
|
|
16
|
-
ref
|
|
16
|
+
ref,
|
|
17
|
+
"data-testid": testId
|
|
17
18
|
}) => (/*#__PURE__*/React.createElement("div", {
|
|
18
19
|
className: clsx(styles.container, className),
|
|
19
|
-
ref: ref
|
|
20
|
+
ref: ref,
|
|
21
|
+
"data-testid": testId
|
|
20
22
|
}, label && (/*#__PURE__*/React.createElement(Typography, {
|
|
21
23
|
className: clsx(styles.label, {
|
|
22
24
|
[styles.label_required]: Boolean(required)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
|
-
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A test id a consumer gives a component; the component puts it on its own
|
|
3
|
+
* root element. Fields put it on the native control. Components set no test
|
|
4
|
+
* id of their own. A component without a root of its own takes
|
|
5
|
+
* `PopupTestIdProps` instead.
|
|
6
|
+
*/
|
|
7
|
+
export type TestIdProps = {
|
|
8
|
+
"data-testid"?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A test id of a popup (`Dropdown`, `Tooltip`): it names the floating panel,
|
|
12
|
+
* which is in the DOM only while open. The trigger is the consumer's own
|
|
13
|
+
* element and keeps its own `data-testid`; the component never writes one on
|
|
14
|
+
* it.
|
|
15
|
+
*/
|
|
16
|
+
export type PopupTestIdProps = {
|
|
17
|
+
"data-testid"?: string;
|
|
18
|
+
};
|
package/esm/index.d.ts
CHANGED
|
@@ -97,3 +97,4 @@ export type { TypographyFontWeight, TypographyProps, TypographyResponsiveSize, T
|
|
|
97
97
|
export { useMediaSizes } from "./hooks/useMediaSizes";
|
|
98
98
|
export { useScrollLock } from "./hooks/useScrollLock";
|
|
99
99
|
export * from "./Icons";
|
|
100
|
+
export type { PopupTestIdProps, TestIdProps } from "./helpers/testId";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A test id a consumer gives a component; the component puts it on its own
|
|
3
|
+
* root element. Fields put it on the native control. Components set no test
|
|
4
|
+
* id of their own. A component without a root of its own takes
|
|
5
|
+
* `PopupTestIdProps` instead.
|
|
6
|
+
*/
|
|
7
|
+
export type TestIdProps = {
|
|
8
|
+
"data-testid"?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A test id of a popup (`Dropdown`, `Tooltip`): it names the floating panel,
|
|
12
|
+
* which is in the DOM only while open. The trigger is the consumer's own
|
|
13
|
+
* element and keeps its own `data-testid`; the component never writes one on
|
|
14
|
+
* it.
|
|
15
|
+
*/
|
|
16
|
+
export type PopupTestIdProps = {
|
|
17
|
+
"data-testid"?: string;
|
|
18
|
+
};
|
package/index.d.ts
CHANGED
|
@@ -97,3 +97,4 @@ export type { TypographyFontWeight, TypographyProps, TypographyResponsiveSize, T
|
|
|
97
97
|
export { useMediaSizes } from "./hooks/useMediaSizes";
|
|
98
98
|
export { useScrollLock } from "./hooks/useScrollLock";
|
|
99
99
|
export * from "./Icons";
|
|
100
|
+
export type { PopupTestIdProps, TestIdProps } from "./helpers/testId";
|