@koobiq/react-components 0.0.1-beta.30 → 0.0.1-beta.32
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/dist/components/FieldComponents/FieldAddon/FieldAddon.d.ts +1 -1
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.js +7 -2
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.module.css.js +3 -3
- package/dist/components/FieldComponents/FieldControl/FieldControl.d.ts +2 -1
- package/dist/components/FieldComponents/FieldError/FieldError.d.ts +1 -1
- package/dist/components/FieldComponents/FieldError/FieldError.js +1 -1
- package/dist/components/FieldComponents/FieldInput/FieldInput.d.ts +2 -2
- package/dist/components/FieldComponents/FieldInput/FieldInput.js +4 -4
- package/dist/components/FieldComponents/FieldInput/FieldInput.module.css.js +3 -3
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.d.ts +2 -2
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.js +29 -5
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroupContext.d.ts +3 -3
- package/dist/components/FieldComponents/FieldLabel/FieldLabel.d.ts +2 -2
- package/dist/components/FieldComponents/FieldLabel/FieldLabel.js +3 -3
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.d.ts +5 -4
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.js +5 -5
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.module.css.js +4 -4
- package/dist/components/Input/Input.d.ts +32 -12
- package/dist/components/Input/Input.js +58 -13
- package/dist/components/Input/types.d.ts +68 -11
- package/dist/components/InputNumber/InputNumber.d.ts +27 -11
- package/dist/components/InputNumber/InputNumber.js +75 -25
- package/dist/components/InputNumber/components/InputNumberCounterControls.js +2 -2
- package/dist/components/InputNumber/types.d.ts +54 -9
- package/dist/components/Provider/Provider.d.ts +1 -1
- package/dist/components/Provider/Provider.js +8 -4
- package/dist/components/Provider/types.d.ts +3 -1
- package/dist/components/Select/Select.js +87 -64
- package/dist/components/Select/types.d.ts +50 -8
- package/dist/components/Textarea/Textarea.d.ts +16 -8
- package/dist/components/Textarea/Textarea.js +46 -2
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.d.ts +4 -4
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js +15 -12
- package/dist/components/Textarea/types.d.ts +59 -9
- package/dist/components/Textarea/utils/useTextareaAutosize.d.ts +1 -1
- package/dist/components/Textarea/utils/useTextareaAutosize.js +2 -2
- package/dist/style.css +6 -4
- package/package.json +5 -5
|
@@ -5,6 +5,47 @@ import type { ListPropItems, ListPropChildren, ListPropDisabledKeys } from '../L
|
|
|
5
5
|
import type { PopoverProps } from '../Popover';
|
|
6
6
|
export type SelectKey = string | number;
|
|
7
7
|
export type SelectPropOnSelectionChange = (selected: SelectKey) => void;
|
|
8
|
+
type SelectDeprecatedProps = {
|
|
9
|
+
/**
|
|
10
|
+
* If `true`, the component is disabled.
|
|
11
|
+
* @default false
|
|
12
|
+
*
|
|
13
|
+
* @deprecated
|
|
14
|
+
* The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* If `true`, the input will indicate an error.
|
|
19
|
+
* @default false
|
|
20
|
+
*
|
|
21
|
+
* @deprecated
|
|
22
|
+
* The "error" prop is deprecated. Use "isInvalid" prop to replace it.
|
|
23
|
+
*/
|
|
24
|
+
error?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, the label is displayed as required and the input element is required.
|
|
27
|
+
* @default false
|
|
28
|
+
*
|
|
29
|
+
* @deprecated
|
|
30
|
+
* The "required" prop is deprecated. Use "isRequired" prop to replace it.
|
|
31
|
+
*/
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the open state of the menu.
|
|
35
|
+
*
|
|
36
|
+
* @deprecated
|
|
37
|
+
* The "open" prop is deprecated. Use "isOpen" prop to replace it.
|
|
38
|
+
*/
|
|
39
|
+
open?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* If `true`, the label is hidden. Be sure to add aria-label to the input element.
|
|
42
|
+
* @default false
|
|
43
|
+
*
|
|
44
|
+
* @deprecated
|
|
45
|
+
* The "hiddenLabel" prop is deprecated. Use "isLabelHidden" prop to replace it.
|
|
46
|
+
*/
|
|
47
|
+
hiddenLabel?: boolean;
|
|
48
|
+
};
|
|
8
49
|
export type SelectProps<T extends object> = {
|
|
9
50
|
/** Additional CSS-classes. */
|
|
10
51
|
className?: string;
|
|
@@ -26,16 +67,16 @@ export type SelectProps<T extends object> = {
|
|
|
26
67
|
* If `true`, the input will indicate an error.
|
|
27
68
|
* @default false
|
|
28
69
|
*/
|
|
29
|
-
|
|
70
|
+
isInvalid?: boolean;
|
|
30
71
|
/** Message for the error state */
|
|
31
|
-
errorMessage?:
|
|
72
|
+
errorMessage?: ReactNode;
|
|
32
73
|
/**
|
|
33
74
|
* If `true`, the label is hidden. Be sure to add aria-label to the input element.
|
|
34
75
|
* @default false
|
|
35
76
|
*/
|
|
36
|
-
|
|
77
|
+
isLabelHidden?: boolean;
|
|
37
78
|
/** The helper text content. */
|
|
38
|
-
caption?:
|
|
79
|
+
caption?: ReactNode;
|
|
39
80
|
/**
|
|
40
81
|
* If true, the input will take up the full width of its container.
|
|
41
82
|
* @default false
|
|
@@ -45,12 +86,12 @@ export type SelectProps<T extends object> = {
|
|
|
45
86
|
* If `true`, the component is disabled.
|
|
46
87
|
* @default false
|
|
47
88
|
*/
|
|
48
|
-
|
|
89
|
+
isDisabled?: boolean;
|
|
49
90
|
/**
|
|
50
91
|
* If `true`, the label is displayed as required and the input element is required.
|
|
51
92
|
* @default false
|
|
52
93
|
*/
|
|
53
|
-
|
|
94
|
+
isRequired?: boolean;
|
|
54
95
|
/** Unique identifier for testing purposes. */
|
|
55
96
|
'data-testid'?: string | number;
|
|
56
97
|
/** Ref to the control */
|
|
@@ -64,7 +105,7 @@ export type SelectProps<T extends object> = {
|
|
|
64
105
|
/** Handler that is called when the selection changes. */
|
|
65
106
|
onSelectionChange?: SelectPropOnSelectionChange;
|
|
66
107
|
/** Sets the open state of the menu. */
|
|
67
|
-
|
|
108
|
+
isOpen?: boolean;
|
|
68
109
|
/** Sets the default open state of the menu. */
|
|
69
110
|
defaultOpen?: boolean;
|
|
70
111
|
/** Method that is called when the open state of the menu changes. */
|
|
@@ -82,6 +123,7 @@ export type SelectProps<T extends object> = {
|
|
|
82
123
|
group?: FieldInputGroupProps;
|
|
83
124
|
errorMessage?: FieldErrorProps;
|
|
84
125
|
};
|
|
85
|
-
};
|
|
126
|
+
} & SelectDeprecatedProps;
|
|
86
127
|
export type SelectComponentProp = <T extends object>(props: SelectProps<T>) => ReactElement | null;
|
|
87
128
|
export type SelectRef = ComponentRef<'button'>;
|
|
129
|
+
export {};
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<
|
|
1
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<{
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
error?: boolean;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
hiddenLabel?: boolean;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
} & Omit<import("@koobiq/react-primitives").TextFieldProps<HTMLTextAreaElement>, "children" | "style" | "className" | "validationBehavior" | "validate" | "description" | "inputElementType">, "caption" | "label" | "className" | "cols" | "rows" | "isDisabled" | "variant" | "slotProps" | "fullWidth" | "data-testid" | "isInvalid" | "isReadOnly" | "isRequired" | "errorMessage" | "isLabelHidden" | "expand"> & {
|
|
2
8
|
label?: import("react").ReactNode;
|
|
3
9
|
className?: string;
|
|
4
10
|
variant?: import("./types").TextareaPropVariant;
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
isInvalid?: boolean;
|
|
12
|
+
isReadOnly?: boolean;
|
|
13
|
+
errorMessage?: import("react").ReactNode;
|
|
7
14
|
fullWidth?: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
caption?:
|
|
11
|
-
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isLabelHidden?: boolean;
|
|
17
|
+
caption?: import("react").ReactNode;
|
|
18
|
+
isRequired?: boolean;
|
|
12
19
|
rows?: number;
|
|
13
20
|
cols?: number;
|
|
14
21
|
expand?: import("./types").TextareaPropExpand;
|
|
22
|
+
'data-testid'?: string | number;
|
|
15
23
|
slotProps?: {
|
|
16
24
|
label?: import("../FieldComponents").FieldLabelProps;
|
|
17
25
|
caption?: import("../FieldComponents").FieldCaptionProps;
|
|
18
|
-
textarea?: import("../FieldComponents").FieldInputProps
|
|
26
|
+
textarea?: import("../FieldComponents").FieldInputProps<"textarea">;
|
|
19
27
|
errorMessage?: import("../FieldComponents").FieldErrorProps;
|
|
20
28
|
};
|
|
21
29
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
+
import { deprecate } from "@koobiq/logger";
|
|
4
5
|
import { mergeProps } from "@koobiq/react-core";
|
|
5
6
|
import { TextField } from "@koobiq/react-primitives";
|
|
6
7
|
import { TextareaContextConsumer } from "./components/TextareaContextConsumer/TextareaContextConsumer.js";
|
|
@@ -9,7 +10,16 @@ const Textarea = forwardRef((props, ref) => {
|
|
|
9
10
|
const {
|
|
10
11
|
variant = "filled",
|
|
11
12
|
fullWidth = false,
|
|
12
|
-
hiddenLabel
|
|
13
|
+
hiddenLabel,
|
|
14
|
+
isLabelHidden: isLabelHiddenProp,
|
|
15
|
+
disabled,
|
|
16
|
+
isDisabled: isDisabledProp,
|
|
17
|
+
error,
|
|
18
|
+
isInvalid: isInvalidProp,
|
|
19
|
+
required,
|
|
20
|
+
isRequired: isRequiredProp,
|
|
21
|
+
readonly,
|
|
22
|
+
isReadOnly: isReadOnlyProp,
|
|
13
23
|
rows,
|
|
14
24
|
cols,
|
|
15
25
|
expand,
|
|
@@ -19,10 +29,44 @@ const Textarea = forwardRef((props, ref) => {
|
|
|
19
29
|
label,
|
|
20
30
|
...other
|
|
21
31
|
} = props;
|
|
32
|
+
const isDisabled = isDisabledProp ?? disabled ?? false;
|
|
33
|
+
const isRequired = isRequiredProp ?? required ?? false;
|
|
34
|
+
const isReadOnly = isReadOnlyProp ?? readonly ?? false;
|
|
35
|
+
const isInvalid = isInvalidProp ?? error ?? false;
|
|
36
|
+
const isLabelHidden = isLabelHiddenProp ?? hiddenLabel ?? false;
|
|
37
|
+
if (process.env.NODE_ENV !== "production" && "disabled" in props) {
|
|
38
|
+
deprecate(
|
|
39
|
+
'Textarea: the "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (process.env.NODE_ENV !== "production" && "required" in props) {
|
|
43
|
+
deprecate(
|
|
44
|
+
'Textarea: the "required" prop is deprecated. Use "isRequired" prop to replace it.'
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
if (process.env.NODE_ENV !== "production" && "error" in props) {
|
|
48
|
+
deprecate(
|
|
49
|
+
'Textarea: the "error" prop is deprecated. Use "isInvalid" prop to replace it.'
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
if (process.env.NODE_ENV !== "production" && "readonly" in props) {
|
|
53
|
+
deprecate(
|
|
54
|
+
'Textarea: the "readonly" prop is deprecated. Use "isReadOnly" prop to replace it.'
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (process.env.NODE_ENV !== "production" && "hiddenLabel" in props) {
|
|
58
|
+
deprecate(
|
|
59
|
+
'Textarea: the "hiddenLabel" prop is deprecated. Use "isLabelHidden" prop to replace it.'
|
|
60
|
+
);
|
|
61
|
+
}
|
|
22
62
|
const rootProps = mergeProps(
|
|
23
63
|
{
|
|
24
64
|
label,
|
|
25
65
|
fullWidth,
|
|
66
|
+
isDisabled,
|
|
67
|
+
isRequired,
|
|
68
|
+
isReadOnly,
|
|
69
|
+
isInvalid,
|
|
26
70
|
errorMessage,
|
|
27
71
|
"data-variant": variant,
|
|
28
72
|
"data-fullwidth": fullWidth
|
|
@@ -40,7 +84,7 @@ const Textarea = forwardRef((props, ref) => {
|
|
|
40
84
|
variant,
|
|
41
85
|
caption,
|
|
42
86
|
slotProps,
|
|
43
|
-
|
|
87
|
+
isLabelHidden,
|
|
44
88
|
errorMessage,
|
|
45
89
|
ref
|
|
46
90
|
}
|
package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextareaProps } from '../../types';
|
|
2
2
|
export declare const TextareaContextConsumer: import("react").ForwardRefExoticComponent<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} & Pick<TextareaProps, "caption" | "label" | "cols" | "rows" | "variant" | "slotProps" | "errorMessage" | "
|
|
3
|
+
isRequired?: boolean;
|
|
4
|
+
isInvalid?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
} & Pick<TextareaProps, "caption" | "label" | "cols" | "rows" | "variant" | "slotProps" | "errorMessage" | "isLabelHidden" | "expand"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js
CHANGED
|
@@ -13,14 +13,14 @@ const TextareaContextConsumer = forwardRef((props, ref) => {
|
|
|
13
13
|
rows,
|
|
14
14
|
cols,
|
|
15
15
|
label,
|
|
16
|
-
|
|
16
|
+
isInvalid,
|
|
17
17
|
expand,
|
|
18
18
|
caption,
|
|
19
19
|
variant,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
isDisabled,
|
|
21
|
+
isRequired,
|
|
22
22
|
slotProps,
|
|
23
|
-
|
|
23
|
+
isLabelHidden,
|
|
24
24
|
errorMessage
|
|
25
25
|
} = props;
|
|
26
26
|
const { value } = useTextareaContext();
|
|
@@ -28,28 +28,31 @@ const TextareaContextConsumer = forwardRef((props, ref) => {
|
|
|
28
28
|
useTextareaAutosize(domRef, value, expand === "auto-size");
|
|
29
29
|
const textareaProps = mergeProps(
|
|
30
30
|
{
|
|
31
|
-
|
|
31
|
+
isInvalid,
|
|
32
32
|
rows,
|
|
33
33
|
cols,
|
|
34
34
|
variant,
|
|
35
35
|
value,
|
|
36
|
-
|
|
36
|
+
isDisabled,
|
|
37
37
|
...expand && { className: s[expand] },
|
|
38
38
|
ref: domRef
|
|
39
39
|
},
|
|
40
40
|
slotProps?.textarea
|
|
41
41
|
);
|
|
42
|
-
const captionProps = slotProps?.caption;
|
|
43
|
-
const errorProps = mergeProps(
|
|
42
|
+
const captionProps = mergeProps({ children: caption }, slotProps?.caption);
|
|
43
|
+
const errorProps = mergeProps(
|
|
44
|
+
{ isInvalid, children: errorMessage },
|
|
45
|
+
slotProps?.errorMessage
|
|
46
|
+
);
|
|
44
47
|
const labelProps = mergeProps(
|
|
45
|
-
{
|
|
48
|
+
{ isHidden: isLabelHidden, children: label, isRequired },
|
|
46
49
|
slotProps?.label
|
|
47
50
|
);
|
|
48
51
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
-
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps
|
|
52
|
+
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
50
53
|
/* @__PURE__ */ jsx(FieldInput, { as: "textarea", ...textareaProps }),
|
|
51
|
-
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps
|
|
52
|
-
/* @__PURE__ */ jsx(FieldError, { ...errorProps
|
|
54
|
+
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
55
|
+
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
53
56
|
] });
|
|
54
57
|
});
|
|
55
58
|
TextareaContextConsumer.displayName = "TextareaContextConsumer";
|
|
@@ -1,11 +1,53 @@
|
|
|
1
1
|
import type { ComponentRef, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TextFieldProps } from '@koobiq/react-primitives';
|
|
4
4
|
import type { FieldCaptionProps, FieldErrorProps, FieldInputProps, FieldLabelProps } from '../FieldComponents';
|
|
5
5
|
export declare const textareaPropVariant: readonly ["filled", "transparent"];
|
|
6
6
|
export type TextareaPropVariant = (typeof textareaPropVariant)[number];
|
|
7
7
|
export declare const textareaPropExpand: readonly ["auto-size", "vertical-resize"];
|
|
8
8
|
export type TextareaPropExpand = (typeof textareaPropExpand)[number];
|
|
9
|
+
type TextareaDeprecatedProps = {
|
|
10
|
+
/**
|
|
11
|
+
* If `true`, the component is disabled.
|
|
12
|
+
* @default false
|
|
13
|
+
*
|
|
14
|
+
* @deprecated
|
|
15
|
+
* The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If `true`, the input will indicate an error.
|
|
20
|
+
* @default false
|
|
21
|
+
*
|
|
22
|
+
* @deprecated
|
|
23
|
+
* The "error" prop is deprecated. Use "isInvalid" prop to replace it.
|
|
24
|
+
*/
|
|
25
|
+
error?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* If `true`, the label is displayed as required and the input element is required.
|
|
28
|
+
* @default false
|
|
29
|
+
*
|
|
30
|
+
* @deprecated
|
|
31
|
+
* The "required" prop is deprecated. Use "isRequired" prop to replace it.
|
|
32
|
+
*/
|
|
33
|
+
required?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, the label is hidden. Be sure to add aria-label to the input element.
|
|
36
|
+
* @default false
|
|
37
|
+
*
|
|
38
|
+
* @deprecated
|
|
39
|
+
* The "hiddenLabel" prop is deprecated. Use "isLabelHidden" prop to replace it.
|
|
40
|
+
*/
|
|
41
|
+
hiddenLabel?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, the input can be selected but not changed by the user.
|
|
44
|
+
* @default false
|
|
45
|
+
*
|
|
46
|
+
* @deprecated
|
|
47
|
+
* The "readonly" prop is deprecated. Use "isReadOnly" prop to replace it.
|
|
48
|
+
*/
|
|
49
|
+
readonly?: boolean;
|
|
50
|
+
};
|
|
9
51
|
export type TextareaProps = ExtendableProps<{
|
|
10
52
|
/** The content to display as the label. */
|
|
11
53
|
label?: ReactNode;
|
|
@@ -20,9 +62,14 @@ export type TextareaProps = ExtendableProps<{
|
|
|
20
62
|
* If `true`, the input will indicate an error.
|
|
21
63
|
* @default false
|
|
22
64
|
*/
|
|
23
|
-
|
|
65
|
+
isInvalid?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* If `true`, the input can be selected but not changed by the user.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
isReadOnly?: boolean;
|
|
24
71
|
/** Message for the error state */
|
|
25
|
-
errorMessage?:
|
|
72
|
+
errorMessage?: ReactNode;
|
|
26
73
|
/**
|
|
27
74
|
* If true, the input will take up the full width of its container.
|
|
28
75
|
* @default false
|
|
@@ -32,19 +79,19 @@ export type TextareaProps = ExtendableProps<{
|
|
|
32
79
|
* If `true`, the component is disabled.
|
|
33
80
|
* @default false
|
|
34
81
|
*/
|
|
35
|
-
|
|
82
|
+
isDisabled?: boolean;
|
|
36
83
|
/**
|
|
37
84
|
* If `true`, the label is hidden. Be sure to add aria-label to the input element.
|
|
38
85
|
* @default false
|
|
39
86
|
*/
|
|
40
|
-
|
|
87
|
+
isLabelHidden?: boolean;
|
|
41
88
|
/** The helper text content. */
|
|
42
|
-
caption?:
|
|
89
|
+
caption?: ReactNode;
|
|
43
90
|
/**
|
|
44
91
|
* If `true`, the label is displayed as required and the input element is required.
|
|
45
92
|
* @default false
|
|
46
93
|
*/
|
|
47
|
-
|
|
94
|
+
isRequired?: boolean;
|
|
48
95
|
/** The rows property specifies the visible height of a text area, in lines. */
|
|
49
96
|
rows?: number;
|
|
50
97
|
/** The cols property specifies the visible width of a text area. */
|
|
@@ -56,12 +103,15 @@ export type TextareaProps = ExtendableProps<{
|
|
|
56
103
|
* `verticalResize` — the ability to stretch the field vertically.
|
|
57
104
|
*/
|
|
58
105
|
expand?: TextareaPropExpand;
|
|
106
|
+
/** Unique identifier for testing purposes. */
|
|
107
|
+
'data-testid'?: string | number;
|
|
59
108
|
/** The props used for each slot inside. */
|
|
60
109
|
slotProps?: {
|
|
61
110
|
label?: FieldLabelProps;
|
|
62
111
|
caption?: FieldCaptionProps;
|
|
63
|
-
textarea?: FieldInputProps
|
|
112
|
+
textarea?: FieldInputProps<'textarea'>;
|
|
64
113
|
errorMessage?: FieldErrorProps;
|
|
65
114
|
};
|
|
66
|
-
}, Omit<
|
|
115
|
+
}, TextareaDeprecatedProps & Omit<TextFieldProps<HTMLTextAreaElement>, 'description' | 'validationBehavior' | 'validate' | 'children' | 'style' | 'className' | 'inputElementType'>>;
|
|
67
116
|
export type TextareaRef = ComponentRef<'textarea'>;
|
|
117
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type MutableRefObject } from 'react';
|
|
2
|
-
export declare function useTextareaAutosize(ref: MutableRefObject<HTMLTextAreaElement | null>, value: string | readonly string[] | number | undefined,
|
|
2
|
+
export declare function useTextareaAutosize(ref: MutableRefObject<HTMLTextAreaElement | null>, value: string | readonly string[] | number | undefined, isActive?: boolean): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
function useTextareaAutosize(ref, value,
|
|
2
|
+
function useTextareaAutosize(ref, value, isActive) {
|
|
3
3
|
useEffect(() => {
|
|
4
|
-
if (!
|
|
4
|
+
if (!isActive) return;
|
|
5
5
|
if (ref.current) {
|
|
6
6
|
const textareaEl = ref.current;
|
|
7
7
|
textareaEl.style.blockSize = "0px";
|
package/dist/style.css
CHANGED
|
@@ -1998,7 +1998,7 @@
|
|
|
1998
1998
|
inset-inline-end: 0;
|
|
1999
1999
|
}
|
|
2000
2000
|
|
|
2001
|
-
.kbq-fieldaddon-
|
|
2001
|
+
.kbq-fieldaddon-invalid-08b1fe {
|
|
2002
2002
|
color: var(--kbq-icon-error);
|
|
2003
2003
|
}
|
|
2004
2004
|
.kbq-fieldinput-77b90b {
|
|
@@ -2068,7 +2068,7 @@
|
|
|
2068
2068
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
2069
2069
|
}
|
|
2070
2070
|
|
|
2071
|
-
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-
|
|
2071
|
+
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2072
2072
|
--field-input-color: var(--kbq-foreground-error);
|
|
2073
2073
|
--field-input-border-color: var(--kbq-line-error);
|
|
2074
2074
|
--field-input-outline-color: var(--kbq-states-line-focus-error);
|
|
@@ -2076,7 +2076,7 @@
|
|
|
2076
2076
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
2077
2077
|
}
|
|
2078
2078
|
|
|
2079
|
-
.kbq-fieldinput-transparent-ed7263:where(.kbq-fieldinput-
|
|
2079
|
+
.kbq-fieldinput-transparent-ed7263:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2080
2080
|
--field-input-color: var(--kbq-foreground-error);
|
|
2081
2081
|
--field-input-border-color: transparent;
|
|
2082
2082
|
--field-input-outline-color: transparent;
|
|
@@ -2109,6 +2109,7 @@
|
|
|
2109
2109
|
letter-spacing: var(--kbq-typography-text-compact-letter-spacing);
|
|
2110
2110
|
text-underline-offset: calc(( var(--kbq-typography-text-compact-line-height) - var(--kbq-typography-text-compact-font-size)) / 2);
|
|
2111
2111
|
color: var(--kbq-foreground-contrast-secondary);
|
|
2112
|
+
margin: 0;
|
|
2112
2113
|
transition: color var(--kbq-transition-default);
|
|
2113
2114
|
margin-block-start: var(--kbq-size-xxs);
|
|
2114
2115
|
}
|
|
@@ -2124,6 +2125,7 @@
|
|
|
2124
2125
|
letter-spacing: var(--kbq-typography-text-compact-letter-spacing);
|
|
2125
2126
|
text-underline-offset: calc(( var(--kbq-typography-text-compact-line-height) - var(--kbq-typography-text-compact-font-size)) / 2);
|
|
2126
2127
|
color: var(--kbq-foreground-error);
|
|
2128
|
+
margin: 0;
|
|
2127
2129
|
transition: color var(--kbq-transition-default);
|
|
2128
2130
|
margin-block-start: var(--kbq-size-xxs);
|
|
2129
2131
|
}
|
|
@@ -3104,7 +3106,7 @@
|
|
|
3104
3106
|
overflow: hidden;
|
|
3105
3107
|
}
|
|
3106
3108
|
|
|
3107
|
-
.kbq-fieldselect-
|
|
3109
|
+
.kbq-fieldselect-invalid-db8152 {
|
|
3108
3110
|
--field-input-color: var(--kbq-foreground-error);
|
|
3109
3111
|
--field-input-border-color: var(--kbq-line-error);
|
|
3110
3112
|
--field-input-outline-color: var(--kbq-states-line-focus-error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.32",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@koobiq/design-tokens": "^3.12.1",
|
|
28
28
|
"@types/react-transition-group": "^4.4.12",
|
|
29
29
|
"react-transition-group": "^4.4.5",
|
|
30
|
-
"@koobiq/logger": "0.0.1-beta.
|
|
31
|
-
"@koobiq/react-core": "0.0.1-beta.
|
|
32
|
-
"@koobiq/react-primitives": "0.0.1-beta.
|
|
33
|
-
"@koobiq/react-icons": "0.0.1-beta.
|
|
30
|
+
"@koobiq/logger": "0.0.1-beta.32",
|
|
31
|
+
"@koobiq/react-core": "0.0.1-beta.32",
|
|
32
|
+
"@koobiq/react-primitives": "0.0.1-beta.32",
|
|
33
|
+
"@koobiq/react-icons": "0.0.1-beta.32"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@koobiq/design-tokens": "^3.11.2",
|