@koobiq/react-components 0.8.0 → 0.9.0
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/Alert/Alert.js +5 -3
- package/dist/components/Alert/types.d.ts +0 -3
- package/dist/components/Backdrop/Backdrop.js +1 -1
- package/dist/components/Backdrop/types.d.ts +4 -1
- package/dist/components/Button/Button.js +7 -7
- package/dist/components/Button/types.d.ts +0 -4
- package/dist/components/ButtonToggleGroup/ButtonToggleGroup.js +6 -6
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/ButtonToggle.js +6 -6
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/types.d.ts +0 -1
- package/dist/components/ButtonToggleGroup/types.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.js +6 -6
- package/dist/components/Checkbox/types.d.ts +0 -5
- package/dist/components/Container/Container.js +2 -2
- package/dist/components/Container/types.d.ts +0 -2
- package/dist/components/DateInput/DateInput.js +15 -11
- package/dist/components/DateInput/types.d.ts +1 -3
- package/dist/components/DatePicker/types.d.ts +1 -2
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/types.d.ts +0 -1
- package/dist/components/Divider/Divider.js +5 -4
- package/dist/components/Divider/types.d.ts +0 -2
- package/dist/components/FieldComponents/FieldAddon/FieldAddon.js +4 -4
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.js +2 -2
- package/dist/components/FieldComponents/FieldError/FieldError.d.ts +4 -2
- package/dist/components/FieldComponents/FieldError/FieldError.js +6 -8
- package/dist/components/FieldComponents/FieldInput/FieldInput.js +3 -3
- package/dist/components/FieldComponents/FieldInputDate/FieldInputDate.js +2 -2
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.js +3 -3
- package/dist/components/FormControl/FormControl.js +2 -2
- package/dist/components/FormControlLabel/FormControlLabel.js +1 -8
- package/dist/components/IconButton/IconButton.js +4 -4
- package/dist/components/IconButton/types.d.ts +0 -3
- package/dist/components/Input/Input.d.ts +2 -3
- package/dist/components/Input/Input.js +11 -7
- package/dist/components/Input/Input.module.css.js +4 -0
- package/dist/components/Input/types.d.ts +1 -10
- package/dist/components/InputNumber/InputNumber.d.ts +2 -3
- package/dist/components/InputNumber/InputNumber.js +7 -7
- package/dist/components/InputNumber/types.d.ts +0 -9
- package/dist/components/Link/Link.js +3 -3
- package/dist/components/Link/types.d.ts +0 -5
- package/dist/components/List/components/ListOption/ListOption.js +5 -5
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/types.d.ts +1 -5
- package/dist/components/Popover/PopoverInner.js +2 -2
- package/dist/components/Popover/types.d.ts +0 -4
- package/dist/components/RadioGroup/RadioGroup.js +8 -11
- package/dist/components/RadioGroup/components/Radio/types.d.ts +0 -1
- package/dist/components/RadioGroup/types.d.ts +1 -8
- package/dist/components/SearchInput/SearchInput.d.ts +2 -3
- package/dist/components/SearchInput/SearchInput.js +13 -12
- package/dist/components/SearchInput/types.d.ts +1 -5
- package/dist/components/Select/Select.js +11 -14
- package/dist/components/Select/components/SelectOption/SelectOption.js +5 -5
- package/dist/components/Select/types.d.ts +4 -6
- package/dist/components/SidePanel/SidePanel.js +1 -1
- package/dist/components/SidePanel/types.d.ts +0 -5
- package/dist/components/Table/Table.js +4 -4
- package/dist/components/Table/components/TableRow/TableRow.js +5 -5
- package/dist/components/Table/types.d.ts +0 -2
- package/dist/components/TagGroup/components/Tag/Tag.js +6 -6
- package/dist/components/Textarea/Textarea.d.ts +1 -2
- package/dist/components/Textarea/Textarea.js +6 -6
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js +1 -1
- package/dist/components/Textarea/types.d.ts +1 -10
- package/dist/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/components/TimePicker/TimePicker.js +15 -11
- package/dist/components/TimePicker/types.d.ts +0 -2
- package/dist/components/Toggle/Toggle.js +3 -3
- package/dist/components/Toggle/types.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.js +9 -9
- package/dist/components/Tooltip/types.d.ts +0 -3
- package/dist/style.css +7 -0
- package/package.json +5 -5
|
@@ -12,7 +12,7 @@ const Alert = polymorphicForwardRef(
|
|
|
12
12
|
const {
|
|
13
13
|
status = "info",
|
|
14
14
|
as: Tag = "div",
|
|
15
|
-
hideIcon
|
|
15
|
+
hideIcon,
|
|
16
16
|
colored,
|
|
17
17
|
compact,
|
|
18
18
|
isColored: isColoredProp,
|
|
@@ -26,8 +26,8 @@ const Alert = polymorphicForwardRef(
|
|
|
26
26
|
children,
|
|
27
27
|
...other
|
|
28
28
|
} = props;
|
|
29
|
-
const isColored = isColoredProp ?? colored
|
|
30
|
-
const isCompact = isCompactProp ?? compact
|
|
29
|
+
const isColored = isColoredProp ?? colored;
|
|
30
|
+
const isCompact = isCompactProp ?? compact;
|
|
31
31
|
if (process.env.NODE_ENV !== "production" && "colored" in props) {
|
|
32
32
|
deprecate(
|
|
33
33
|
'Alert: the "colored" prop is deprecated. Use "isColored" prop to replace it.'
|
|
@@ -66,6 +66,8 @@ const Alert = polymorphicForwardRef(
|
|
|
66
66
|
Tag,
|
|
67
67
|
{
|
|
68
68
|
role: "alert",
|
|
69
|
+
"data-colored": isColored || void 0,
|
|
70
|
+
"data-compact": isCompact || void 0,
|
|
69
71
|
...other,
|
|
70
72
|
ref,
|
|
71
73
|
className: clsx(
|
|
@@ -24,19 +24,16 @@ export type AlertBaseProps = {
|
|
|
24
24
|
status?: AlertPropStatus;
|
|
25
25
|
/**
|
|
26
26
|
* If `true`, compact mode will be enabled in the alert.
|
|
27
|
-
* @default false
|
|
28
27
|
*/
|
|
29
28
|
isCompact?: boolean;
|
|
30
29
|
/**
|
|
31
30
|
* If `true`, background color will be enabled in the alert.
|
|
32
|
-
* @default false
|
|
33
31
|
*/
|
|
34
32
|
isColored?: boolean;
|
|
35
33
|
/** Additional CSS-classes. */
|
|
36
34
|
className?: string;
|
|
37
35
|
/**
|
|
38
36
|
* If `true`, the status icon will be hidden in the component.
|
|
39
|
-
* @default false
|
|
40
37
|
*/
|
|
41
38
|
hideIcon?: boolean;
|
|
42
39
|
/** Title content. */
|
|
@@ -18,7 +18,7 @@ const Backdrop = polymorphicForwardRef(
|
|
|
18
18
|
className,
|
|
19
19
|
...other
|
|
20
20
|
} = props;
|
|
21
|
-
const isOpen = isOpenProp ?? open
|
|
21
|
+
const isOpen = isOpenProp ?? open;
|
|
22
22
|
const domRef = useDOMRef(ref);
|
|
23
23
|
if (process.env.NODE_ENV !== "production" && "open" in props) {
|
|
24
24
|
deprecate(
|
|
@@ -16,7 +16,10 @@ export type BackdropBaseProps = {
|
|
|
16
16
|
children?: ReactNode;
|
|
17
17
|
/** Inline styles. */
|
|
18
18
|
style?: CSSProperties;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The duration of the transition, in milliseconds.
|
|
21
|
+
* @default 300
|
|
22
|
+
*/
|
|
20
23
|
duration?: number;
|
|
21
24
|
/** z-index. */
|
|
22
25
|
zIndex?: CSSProperties['zIndex'];
|
|
@@ -9,8 +9,8 @@ const Button = polymorphicForwardRef(
|
|
|
9
9
|
const {
|
|
10
10
|
as: Tag = "button",
|
|
11
11
|
variant = "contrast-filled",
|
|
12
|
-
onlyIcon
|
|
13
|
-
fullWidth
|
|
12
|
+
onlyIcon,
|
|
13
|
+
fullWidth,
|
|
14
14
|
isLoading: isLoadingProp,
|
|
15
15
|
isDisabled: isDisabledProp,
|
|
16
16
|
progress,
|
|
@@ -21,8 +21,8 @@ const Button = polymorphicForwardRef(
|
|
|
21
21
|
className,
|
|
22
22
|
...other
|
|
23
23
|
} = props;
|
|
24
|
-
const isLoading = isLoadingProp ?? progress
|
|
25
|
-
const isDisabled = isDisabledProp ?? disabled
|
|
24
|
+
const isLoading = isLoadingProp ?? progress;
|
|
25
|
+
const isDisabled = isDisabledProp ?? disabled;
|
|
26
26
|
if (process.env.NODE_ENV !== "production" && "progress" in props) {
|
|
27
27
|
deprecate(
|
|
28
28
|
'Button: the "progress" prop is deprecated. Use "isLoading" prop to replace it.'
|
|
@@ -60,9 +60,9 @@ const Button = polymorphicForwardRef(
|
|
|
60
60
|
isDisabled,
|
|
61
61
|
className: classNameFn,
|
|
62
62
|
"data-variant": variant,
|
|
63
|
-
"data-loading": isLoading,
|
|
64
|
-
"data-fullwidth": fullWidth,
|
|
65
|
-
"data-onlyicon": iconOnly,
|
|
63
|
+
"data-loading": isLoading || void 0,
|
|
64
|
+
"data-fullwidth": fullWidth || void 0,
|
|
65
|
+
"data-onlyicon": iconOnly || void 0,
|
|
66
66
|
...other,
|
|
67
67
|
ref,
|
|
68
68
|
children: [
|
|
@@ -6,14 +6,12 @@ export type ButtonPropVariant = (typeof buttonPropVariant)[number];
|
|
|
6
6
|
type ButtonDeprecatedProps = {
|
|
7
7
|
/**
|
|
8
8
|
* If `true`, the progress indicator is shown and the button becomes disabled.
|
|
9
|
-
* @default false
|
|
10
9
|
* @deprecated
|
|
11
10
|
* The "progress" prop is deprecated. Use "isLoading" prop to replace it.
|
|
12
11
|
*/
|
|
13
12
|
progress?: boolean;
|
|
14
13
|
/**
|
|
15
14
|
* If `true`, the component is disabled.
|
|
16
|
-
* @default false
|
|
17
15
|
* @deprecated
|
|
18
16
|
* The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
|
|
19
17
|
*/
|
|
@@ -29,7 +27,6 @@ export type ButtonBaseProps = ExtendableProps<{
|
|
|
29
27
|
variant?: ButtonPropVariant;
|
|
30
28
|
/**
|
|
31
29
|
* If `true`, only the icon is shown, and the button has same sides.
|
|
32
|
-
* @default false
|
|
33
30
|
*/
|
|
34
31
|
onlyIcon?: boolean;
|
|
35
32
|
/** Additional CSS-classes. */
|
|
@@ -38,7 +35,6 @@ export type ButtonBaseProps = ExtendableProps<{
|
|
|
38
35
|
style?: CSSProperties;
|
|
39
36
|
/**
|
|
40
37
|
* If `true`, the button will take up the full width of its container.
|
|
41
|
-
* @default false
|
|
42
38
|
*/
|
|
43
39
|
fullWidth?: boolean;
|
|
44
40
|
/** Icon placed before the children. */
|
|
@@ -12,9 +12,9 @@ import { getSelectedToggleButton, getToggleButtonStyle } from "./utils.js";
|
|
|
12
12
|
const MAX_ITEMS = 5;
|
|
13
13
|
const ButtonToggleGroup = forwardRef((props, ref) => {
|
|
14
14
|
const {
|
|
15
|
-
fullWidth
|
|
16
|
-
isDisabled
|
|
17
|
-
hasEqualItemSize
|
|
15
|
+
fullWidth,
|
|
16
|
+
isDisabled,
|
|
17
|
+
hasEqualItemSize,
|
|
18
18
|
style,
|
|
19
19
|
className,
|
|
20
20
|
slotProps,
|
|
@@ -81,9 +81,9 @@ const ButtonToggleGroup = forwardRef((props, ref) => {
|
|
|
81
81
|
hasEqualItemSize && s.hasEqualItemSize,
|
|
82
82
|
className
|
|
83
83
|
),
|
|
84
|
-
"data-fullwidth": fullWidth,
|
|
85
|
-
"data-animated": isAnimated,
|
|
86
|
-
"data-equal-item-size": hasEqualItemSize,
|
|
84
|
+
"data-fullwidth": fullWidth || void 0,
|
|
85
|
+
"data-animated": isAnimated || void 0,
|
|
86
|
+
"data-equal-item-size": hasEqualItemSize || void 0,
|
|
87
87
|
ref: domRef,
|
|
88
88
|
style
|
|
89
89
|
},
|
|
@@ -11,7 +11,7 @@ const textNormalMedium = utilClasses.typography["text-normal-medium"];
|
|
|
11
11
|
const ButtonToggle = forwardRef(
|
|
12
12
|
(props, ref) => {
|
|
13
13
|
const {
|
|
14
|
-
isDisabled: isDisabledProp
|
|
14
|
+
isDisabled: isDisabledProp,
|
|
15
15
|
children,
|
|
16
16
|
id,
|
|
17
17
|
icon,
|
|
@@ -53,11 +53,11 @@ const ButtonToggle = forwardRef(
|
|
|
53
53
|
isFocusVisible && s.focusVisible,
|
|
54
54
|
className
|
|
55
55
|
),
|
|
56
|
-
"data-hovered": isHovered,
|
|
57
|
-
"data-pressed": isPressed,
|
|
58
|
-
"data-selected": isSelected,
|
|
59
|
-
"data-disabled": isDisabled,
|
|
60
|
-
"data-focus-visible": isFocusVisible,
|
|
56
|
+
"data-hovered": isHovered || void 0,
|
|
57
|
+
"data-pressed": isPressed || void 0,
|
|
58
|
+
"data-selected": isSelected || void 0,
|
|
59
|
+
"data-disabled": isDisabled || void 0,
|
|
60
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
61
61
|
ref: rootRef
|
|
62
62
|
},
|
|
63
63
|
controlProps,
|
|
@@ -5,19 +5,16 @@ export type ButtonToggleGroupKey = string | number;
|
|
|
5
5
|
export type ButtonToggleGroupBaseProps = {
|
|
6
6
|
/**
|
|
7
7
|
* Whether all items are disabled.
|
|
8
|
-
* @default false
|
|
9
8
|
*/
|
|
10
9
|
isDisabled?: boolean;
|
|
11
10
|
/**
|
|
12
11
|
* If `true`, the button will take up the full width of its container.
|
|
13
|
-
* @default false
|
|
14
12
|
*/
|
|
15
13
|
fullWidth?: boolean;
|
|
16
14
|
/** The contents of the collection. */
|
|
17
15
|
children?: Array<ReactElement<ButtonToggleProps>>;
|
|
18
16
|
/**
|
|
19
17
|
* If `true`, each item's width will be equal.
|
|
20
|
-
* @default false
|
|
21
18
|
*/
|
|
22
19
|
hasEqualItemSize?: boolean;
|
|
23
20
|
/** The currently selected key in the collection (controlled). */
|
|
@@ -31,13 +31,13 @@ const Checkbox = forwardRef(
|
|
|
31
31
|
slotProps,
|
|
32
32
|
...other
|
|
33
33
|
} = props;
|
|
34
|
-
const isDisabled = isDisabledProp ?? disabled
|
|
35
|
-
const isInvalid = isInvalidProp ?? error
|
|
34
|
+
const isDisabled = isDisabledProp ?? disabled;
|
|
35
|
+
const isInvalid = isInvalidProp ?? error;
|
|
36
36
|
const isSelected = isSelectedProp ?? checked;
|
|
37
37
|
const defaultSelected = defaultSelectedProp ?? defaultChecked;
|
|
38
|
-
const isReadOnly = isReadOnlyProp ?? readonly
|
|
39
|
-
const isRequired = isRequiredProp ?? required
|
|
40
|
-
const isIndeterminate = isIndeterminateProp ?? indeterminate
|
|
38
|
+
const isReadOnly = isReadOnlyProp ?? readonly;
|
|
39
|
+
const isRequired = isRequiredProp ?? required;
|
|
40
|
+
const isIndeterminate = isIndeterminateProp ?? indeterminate;
|
|
41
41
|
const commonProps = {
|
|
42
42
|
isIndeterminate,
|
|
43
43
|
isDisabled,
|
|
@@ -108,7 +108,7 @@ const Checkbox = forwardRef(
|
|
|
108
108
|
Checkbox$1,
|
|
109
109
|
{
|
|
110
110
|
"data-size": size,
|
|
111
|
-
"data-indeterminate": isIndeterminate,
|
|
111
|
+
"data-indeterminate": isIndeterminate || void 0,
|
|
112
112
|
"data-label-placement": labelPlacement,
|
|
113
113
|
...commonProps,
|
|
114
114
|
ref,
|
|
@@ -9,14 +9,12 @@ export type CheckboxPropOnChange = (selected: boolean) => void;
|
|
|
9
9
|
type CheckboxDeprecatedProps = {
|
|
10
10
|
/**
|
|
11
11
|
* If `true`, the component is disabled.
|
|
12
|
-
* @default false
|
|
13
12
|
* @deprecated
|
|
14
13
|
* The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
|
|
15
14
|
*/
|
|
16
15
|
disabled?: boolean;
|
|
17
16
|
/**
|
|
18
17
|
* If `true`, the component will indicate an error.
|
|
19
|
-
* @default false
|
|
20
18
|
* @deprecated
|
|
21
19
|
* The "error" prop is deprecated. Use "isInvalid" prop to replace it.
|
|
22
20
|
*/
|
|
@@ -29,21 +27,18 @@ type CheckboxDeprecatedProps = {
|
|
|
29
27
|
checked?: boolean;
|
|
30
28
|
/**
|
|
31
29
|
* It prevents the user from changing the value of the checkbox.
|
|
32
|
-
* @default false
|
|
33
30
|
* @deprecated
|
|
34
31
|
* The "readonly" prop is deprecated. Use "isReadonly" prop to replace it.
|
|
35
32
|
*/
|
|
36
33
|
readonly?: boolean;
|
|
37
34
|
/**
|
|
38
35
|
* If `true`, the input element is required.
|
|
39
|
-
* @default false
|
|
40
36
|
* @deprecated
|
|
41
37
|
* The "required" prop is deprecated. Use "isRequired" prop to replace it.
|
|
42
38
|
*/
|
|
43
39
|
required?: boolean;
|
|
44
40
|
/**
|
|
45
41
|
* If `true`, the component appears indeterminate.
|
|
46
|
-
* @default false
|
|
47
42
|
* @deprecated
|
|
48
43
|
* The "indeterminate" prop is deprecated. Use "isIndeterminate" prop to replace it.
|
|
49
44
|
*/
|
|
@@ -20,7 +20,7 @@ const Container = polymorphicForwardRef(
|
|
|
20
20
|
style: styleProp,
|
|
21
21
|
...other
|
|
22
22
|
} = props;
|
|
23
|
-
const isFixed = isFixedProp ?? fixed
|
|
23
|
+
const isFixed = isFixedProp ?? fixed;
|
|
24
24
|
if (process.env.NODE_ENV !== "production" && "fixed" in props) {
|
|
25
25
|
deprecate(
|
|
26
26
|
'Container: the "fixed" prop is deprecated. Use "isFixed" prop to replace it.'
|
|
@@ -39,7 +39,7 @@ const Container = polymorphicForwardRef(
|
|
|
39
39
|
return /* @__PURE__ */ jsx(
|
|
40
40
|
Tag,
|
|
41
41
|
{
|
|
42
|
-
"data-fixed": isFixed,
|
|
42
|
+
"data-fixed": isFixed || void 0,
|
|
43
43
|
"data-margins": margins,
|
|
44
44
|
"data-position": position,
|
|
45
45
|
className: clsx(s.base, className),
|
|
@@ -8,7 +8,6 @@ export type ContainerPositionProp = (typeof containerPositionProp)[number];
|
|
|
8
8
|
type ContainerDeprecatedProps = {
|
|
9
9
|
/**
|
|
10
10
|
* If `true`, doesn't set the max-inline-size of the container.
|
|
11
|
-
* @default false
|
|
12
11
|
* @deprecated
|
|
13
12
|
* The "fixed" prop is deprecated. Use "isFixed" prop to replace it.
|
|
14
13
|
*/
|
|
@@ -29,7 +28,6 @@ export type ContainerBaseProps = {
|
|
|
29
28
|
margins?: ContainerMarginsProp | ResponsiveValue<ContainerMarginsProp>;
|
|
30
29
|
/**
|
|
31
30
|
* If `true`, doesn't set the max-inline-size of the container.
|
|
32
|
-
* @default false
|
|
33
31
|
*/
|
|
34
32
|
isFixed?: boolean;
|
|
35
33
|
/** The content of the component. */
|
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { createCalendar } from "@internationalized/date";
|
|
5
5
|
import { useLocale, useDOMRef, mergeProps, clsx } from "@koobiq/react-core";
|
|
6
|
-
import { useDateFieldState, removeDataAttributes, useDateField } from "@koobiq/react-primitives";
|
|
6
|
+
import { useDateFieldState, removeDataAttributes, useDateField, FieldErrorContext } from "@koobiq/react-primitives";
|
|
7
7
|
import s from "./DateInput.module.css.js";
|
|
8
8
|
import { FieldInputDate } from "../FieldComponents/FieldInputDate/FieldInputDate.js";
|
|
9
9
|
import { DateSegment } from "../DateSegment/DateSegment.js";
|
|
@@ -14,13 +14,13 @@ import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldCon
|
|
|
14
14
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
15
15
|
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
16
16
|
function DateInputRender(props, ref) {
|
|
17
|
-
const { errorMessage } = props;
|
|
18
17
|
const { locale } = useLocale();
|
|
19
18
|
const {
|
|
20
19
|
variant = "filled",
|
|
21
20
|
slotProps,
|
|
22
21
|
caption,
|
|
23
22
|
startAddon,
|
|
23
|
+
errorMessage,
|
|
24
24
|
endAddon,
|
|
25
25
|
isLabelHidden,
|
|
26
26
|
labelPlacement,
|
|
@@ -43,9 +43,11 @@ function DateInputRender(props, ref) {
|
|
|
43
43
|
fieldProps,
|
|
44
44
|
descriptionProps,
|
|
45
45
|
errorMessageProps,
|
|
46
|
+
inputProps,
|
|
46
47
|
...validation
|
|
47
48
|
} = useDateField({ ...removeDataAttributes(props) }, state, domRef);
|
|
48
|
-
const {
|
|
49
|
+
const { isRequired, isDisabled } = state;
|
|
50
|
+
const { isInvalid } = validation;
|
|
49
51
|
const rootProps = mergeProps(
|
|
50
52
|
{
|
|
51
53
|
style,
|
|
@@ -54,10 +56,10 @@ function DateInputRender(props, ref) {
|
|
|
54
56
|
labelAlign,
|
|
55
57
|
"data-testid": testId,
|
|
56
58
|
"data-variant": variant,
|
|
57
|
-
"data-invalid": isInvalid,
|
|
58
|
-
"data-disabled": isDisabled,
|
|
59
|
-
"data-required": isRequired,
|
|
60
|
-
"data-readonly": isReadOnly,
|
|
59
|
+
"data-invalid": isInvalid || void 0,
|
|
60
|
+
"data-disabled": isDisabled || void 0,
|
|
61
|
+
"data-required": isRequired || void 0,
|
|
62
|
+
"data-readonly": isReadOnly || void 0,
|
|
61
63
|
className: clsx(s.base, className)
|
|
62
64
|
},
|
|
63
65
|
slotProps?.root
|
|
@@ -80,8 +82,7 @@ function DateInputRender(props, ref) {
|
|
|
80
82
|
const captionProps = mergeProps({ children: caption }, slotProps?.caption, descriptionProps);
|
|
81
83
|
const errorProps = mergeProps(
|
|
82
84
|
{
|
|
83
|
-
|
|
84
|
-
children: typeof errorMessage === "function" ? errorMessage({ ...validation }) : errorMessage
|
|
85
|
+
children: errorMessage
|
|
85
86
|
},
|
|
86
87
|
slotProps?.errorMessage,
|
|
87
88
|
errorMessageProps
|
|
@@ -99,9 +100,12 @@ function DateInputRender(props, ref) {
|
|
|
99
100
|
return /* @__PURE__ */ jsxs(FormControl, { ...rootProps, children: [
|
|
100
101
|
/* @__PURE__ */ jsx(FormControlLabel, { ...labelProps }),
|
|
101
102
|
/* @__PURE__ */ jsxs(Field, { children: [
|
|
102
|
-
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsxs(FieldInputDate, { ...controlProps, children: [
|
|
104
|
+
state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegment, { segment, state }, i)),
|
|
105
|
+
/* @__PURE__ */ jsx("input", { ...inputProps })
|
|
106
|
+
] }) }),
|
|
103
107
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
104
|
-
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
108
|
+
/* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FieldError, { ...errorProps }) })
|
|
105
109
|
] })
|
|
106
110
|
] });
|
|
107
111
|
}
|
|
@@ -25,7 +25,6 @@ export type DateInputProps<T extends DateValue> = {
|
|
|
25
25
|
variant?: DateInputPropVariant;
|
|
26
26
|
/**
|
|
27
27
|
* If true, the input will take up the full width of its container.
|
|
28
|
-
* @default false
|
|
29
28
|
*/
|
|
30
29
|
fullWidth?: boolean;
|
|
31
30
|
/** The props used for each slot inside. */
|
|
@@ -41,7 +40,6 @@ export type DateInputProps<T extends DateValue> = {
|
|
|
41
40
|
ref?: Ref<HTMLDivElement>;
|
|
42
41
|
/**
|
|
43
42
|
* If `true`, the label is hidden. Be sure to add aria-label to the input element.
|
|
44
|
-
* @default false
|
|
45
43
|
*/
|
|
46
44
|
isLabelHidden?: boolean;
|
|
47
45
|
/**
|
|
@@ -58,6 +56,6 @@ export type DateInputProps<T extends DateValue> = {
|
|
|
58
56
|
startAddon?: ReactNode;
|
|
59
57
|
/** Addon placed after the children. */
|
|
60
58
|
endAddon?: ReactNode;
|
|
61
|
-
} & Omit<AriaDateFieldProps<T>, 'description' | '
|
|
59
|
+
} & Omit<AriaDateFieldProps<T>, 'description' | 'validationState'>;
|
|
62
60
|
export type DateInputComponent = <T extends DateValue>(props: DateInputProps<T>) => ReactElement | null;
|
|
63
61
|
export type DateInputRef = ComponentRef<'div'>;
|
|
@@ -7,7 +7,6 @@ import type { PopoverProps } from '../Popover';
|
|
|
7
7
|
export type DatePickerProps<T extends DateValue> = {
|
|
8
8
|
/**
|
|
9
9
|
* If true, the input will take up the full width of its container.
|
|
10
|
-
* @default false
|
|
11
10
|
*/
|
|
12
11
|
fullWidth?: boolean;
|
|
13
12
|
/** The helper text content. */
|
|
@@ -41,6 +40,6 @@ export type DatePickerProps<T extends DateValue> = {
|
|
|
41
40
|
popover?: PopoverProps;
|
|
42
41
|
calendar?: CalendarProps<T>;
|
|
43
42
|
};
|
|
44
|
-
} & Omit<AriaDatePickerProps<T>, 'description' | '
|
|
43
|
+
} & Omit<AriaDatePickerProps<T>, 'description' | 'validationState'>;
|
|
45
44
|
export type DatePickerComponent = <T extends DateValue>(props: DatePickerProps<T>) => ReactElement | null;
|
|
46
45
|
export type DatePickerRef = DateInputRef;
|
|
@@ -19,7 +19,7 @@ const DialogComponent = forwardRef(
|
|
|
19
19
|
const rootProps = mergeProps(
|
|
20
20
|
{
|
|
21
21
|
className: clsx(s.base, utilClasses.typography["text-normal"]),
|
|
22
|
-
"data-close-button": showCloseButton,
|
|
22
|
+
"data-close-button": showCloseButton || void 0,
|
|
23
23
|
"data-top-overflow": topOverflow,
|
|
24
24
|
"data-bottom-overflow": bottomOverflow
|
|
25
25
|
},
|
|
@@ -8,8 +8,8 @@ const Divider = polymorphicForwardRef(
|
|
|
8
8
|
const {
|
|
9
9
|
as: Tag = "div",
|
|
10
10
|
orientation = "horizontal",
|
|
11
|
-
disablePaddings
|
|
12
|
-
flexItem
|
|
11
|
+
disablePaddings,
|
|
12
|
+
flexItem,
|
|
13
13
|
display,
|
|
14
14
|
className,
|
|
15
15
|
...other
|
|
@@ -23,9 +23,10 @@ const Divider = polymorphicForwardRef(
|
|
|
23
23
|
return /* @__PURE__ */ jsx(
|
|
24
24
|
Tag,
|
|
25
25
|
{
|
|
26
|
-
"data-
|
|
26
|
+
"data-display": display,
|
|
27
27
|
"data-orientation": orientation,
|
|
28
|
-
"data-
|
|
28
|
+
"data-flex-item": flexItem || void 0,
|
|
29
|
+
"data-disable-paddings": disablePaddings || void 0,
|
|
29
30
|
...separatorProps,
|
|
30
31
|
className: clsx(
|
|
31
32
|
s.base,
|
|
@@ -11,12 +11,10 @@ export type DividerBaseProps = ExtendableProps<{
|
|
|
11
11
|
* Indicates if the divider is a child of a flex container.
|
|
12
12
|
* Mainly used for vertical layout.
|
|
13
13
|
* Used when the block does not have a fixed height.
|
|
14
|
-
* @default false
|
|
15
14
|
*/
|
|
16
15
|
flexItem?: boolean;
|
|
17
16
|
/**
|
|
18
17
|
* If `true`, it disables the default paddings.
|
|
19
|
-
* @default false
|
|
20
18
|
*/
|
|
21
19
|
disablePaddings?: boolean;
|
|
22
20
|
}, Omit<SeparatorProps, 'elementType'>>;
|
|
@@ -5,8 +5,8 @@ import s from "./FieldAddon.module.css.js";
|
|
|
5
5
|
const FieldAddon = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
placement = "start",
|
|
8
|
-
isInvalid
|
|
9
|
-
isDisabled
|
|
8
|
+
isInvalid,
|
|
9
|
+
isDisabled,
|
|
10
10
|
className,
|
|
11
11
|
children,
|
|
12
12
|
...other
|
|
@@ -21,8 +21,8 @@ const FieldAddon = forwardRef(
|
|
|
21
21
|
className
|
|
22
22
|
),
|
|
23
23
|
"data-placement": placement,
|
|
24
|
-
"data-invalid": isInvalid,
|
|
25
|
-
"data-disabled": isDisabled,
|
|
24
|
+
"data-invalid": isInvalid || void 0,
|
|
25
|
+
"data-disabled": isDisabled || void 0,
|
|
26
26
|
"data-testid": `field-addon-${placement}`,
|
|
27
27
|
...other,
|
|
28
28
|
ref,
|
|
@@ -7,8 +7,8 @@ import { FieldContentGroupContext } from "./FieldContentGroupContext.js";
|
|
|
7
7
|
import { FieldAddon } from "../FieldAddon/FieldAddon.js";
|
|
8
8
|
const FieldContentGroup = forwardRef(function FieldContentGroup2({
|
|
9
9
|
variant = "filled",
|
|
10
|
-
isInvalid
|
|
11
|
-
isDisabled
|
|
10
|
+
isInvalid,
|
|
11
|
+
isDisabled,
|
|
12
12
|
children,
|
|
13
13
|
className,
|
|
14
14
|
startAddon,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ValidationResult } from '@koobiq/react-core';
|
|
1
3
|
import { type TextProps, type TextRef } from '@koobiq/react-primitives';
|
|
2
|
-
export type FieldErrorProps = TextProps & {
|
|
3
|
-
|
|
4
|
+
export type FieldErrorProps = Omit<TextProps, 'children'> & {
|
|
5
|
+
children?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
4
6
|
};
|
|
5
7
|
export type FieldErrorRef = TextRef;
|
|
6
8
|
export declare const FieldError: import("react").ForwardRefExoticComponent<Omit<FieldErrorProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { FieldError as FieldError$1 } from "@koobiq/react-primitives";
|
|
5
5
|
import s from "./FieldError.module.css.js";
|
|
6
6
|
const FieldError = forwardRef(
|
|
7
|
-
({
|
|
8
|
-
|
|
7
|
+
({ className, ...other }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
+
FieldError$1,
|
|
9
9
|
{
|
|
10
10
|
className: clsx(s.base, className),
|
|
11
|
-
slot: "errorMessage",
|
|
12
11
|
...other,
|
|
13
|
-
ref
|
|
14
|
-
children
|
|
12
|
+
ref
|
|
15
13
|
}
|
|
16
|
-
)
|
|
14
|
+
)
|
|
17
15
|
);
|
|
18
16
|
FieldError.displayName = "FieldError";
|
|
19
17
|
export {
|
|
@@ -4,10 +4,10 @@ import { Input, Textarea } from "@koobiq/react-primitives";
|
|
|
4
4
|
import s from "./FieldInput.module.css.js";
|
|
5
5
|
const FieldInput = polymorphicForwardRef(
|
|
6
6
|
({
|
|
7
|
-
isInvalid = false,
|
|
8
|
-
as = "input",
|
|
9
|
-
isDisabled = false,
|
|
10
7
|
variant = "filled",
|
|
8
|
+
as = "input",
|
|
9
|
+
isInvalid,
|
|
10
|
+
isDisabled,
|
|
11
11
|
className,
|
|
12
12
|
...other
|
|
13
13
|
}, ref) => {
|
|
@@ -4,9 +4,9 @@ import { clsx } from "@koobiq/react-core";
|
|
|
4
4
|
import s from "./FieldInputDate.module.css.js";
|
|
5
5
|
const FieldInputDate = forwardRef(
|
|
6
6
|
({
|
|
7
|
-
isInvalid = false,
|
|
8
|
-
isDisabled = false,
|
|
9
7
|
variant = "filled",
|
|
8
|
+
isInvalid,
|
|
9
|
+
isDisabled,
|
|
10
10
|
children,
|
|
11
11
|
className,
|
|
12
12
|
...other
|
|
@@ -5,10 +5,10 @@ import s from "./FieldSelect.module.css.js";
|
|
|
5
5
|
import { isPrimitiveNode } from "./utils.js";
|
|
6
6
|
const FieldSelect = polymorphicForwardRef(
|
|
7
7
|
({
|
|
8
|
-
as = "div",
|
|
9
|
-
isInvalid = false,
|
|
10
|
-
isDisabled = false,
|
|
11
8
|
variant = "filled",
|
|
9
|
+
as = "div",
|
|
10
|
+
isInvalid,
|
|
11
|
+
isDisabled,
|
|
12
12
|
placeholder,
|
|
13
13
|
children,
|
|
14
14
|
className,
|
|
@@ -5,8 +5,8 @@ const FormControl = polymorphicForwardRef(
|
|
|
5
5
|
({
|
|
6
6
|
labelPlacement = "top",
|
|
7
7
|
labelAlign = "start",
|
|
8
|
-
fullWidth = false,
|
|
9
8
|
as: Tag = "div",
|
|
9
|
+
fullWidth,
|
|
10
10
|
className,
|
|
11
11
|
...other
|
|
12
12
|
}, ref) => /* @__PURE__ */ jsx(
|
|
@@ -19,9 +19,9 @@ const FormControl = polymorphicForwardRef(
|
|
|
19
19
|
s[labelPlacement],
|
|
20
20
|
fullWidth && s.fullWidth
|
|
21
21
|
),
|
|
22
|
-
"data-fullwidth": fullWidth,
|
|
23
22
|
"data-label-align": labelAlign,
|
|
24
23
|
"data-label-placement": labelPlacement,
|
|
24
|
+
"data-fullwidth": fullWidth || void 0,
|
|
25
25
|
...other,
|
|
26
26
|
ref
|
|
27
27
|
}
|
|
@@ -3,14 +3,7 @@ import { polymorphicForwardRef, isNotNil, clsx } from "@koobiq/react-core";
|
|
|
3
3
|
import { Label } from "@koobiq/react-primitives";
|
|
4
4
|
import s from "./FormControlLabel.module.css.js";
|
|
5
5
|
const FormControlLabel = polymorphicForwardRef(
|
|
6
|
-
({
|
|
7
|
-
children,
|
|
8
|
-
className,
|
|
9
|
-
isHidden = false,
|
|
10
|
-
isRequired = false,
|
|
11
|
-
as = "label",
|
|
12
|
-
...other
|
|
13
|
-
}, ref) => isNotNil(children) ? /* @__PURE__ */ jsxs(
|
|
6
|
+
({ children, className, isHidden, isRequired, as = "label", ...other }, ref) => isNotNil(children) ? /* @__PURE__ */ jsxs(
|
|
14
7
|
Label,
|
|
15
8
|
{
|
|
16
9
|
as,
|