@koobiq/react-components 0.0.1-beta.22 → 0.0.1-beta.24
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 +2 -2
- package/dist/components/Backdrop/Backdrop.js +1 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/ButtonToggleGroup/types.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +20 -11
- package/dist/components/Checkbox/Checkbox.js +82 -18
- package/dist/components/Checkbox/Checkbox.module.css.js +6 -6
- package/dist/components/Checkbox/types.d.ts +105 -6
- package/dist/components/Container/Container.js +12 -1
- package/dist/components/Container/types.d.ts +13 -2
- package/dist/components/Divider/Divider.js +3 -0
- package/dist/components/IconButton/IconButton.js +2 -2
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +17 -11
- package/dist/style.css +27 -15
- package/package.json +5 -5
|
@@ -30,12 +30,12 @@ const Alert = polymorphicForwardRef(
|
|
|
30
30
|
const isCompact = isCompactProp || compact;
|
|
31
31
|
if (process.env.NODE_ENV !== "production" && colored) {
|
|
32
32
|
deprecate(
|
|
33
|
-
'The "colored" prop is deprecated. Use "isColored" prop to replace it.'
|
|
33
|
+
'Alert. The "colored" prop is deprecated. Use "isColored" prop to replace it.'
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
if (process.env.NODE_ENV !== "production" && compact) {
|
|
37
37
|
deprecate(
|
|
38
|
-
'The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
|
|
38
|
+
'Alert. The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
const stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
@@ -22,7 +22,7 @@ const Backdrop = polymorphicForwardRef(
|
|
|
22
22
|
const domRef = useDOMRef(ref);
|
|
23
23
|
if (process.env.NODE_ENV !== "production" && open) {
|
|
24
24
|
deprecate(
|
|
25
|
-
'The "open" prop is deprecated. Use "isOpen" prop to replace it.'
|
|
25
|
+
'Backdrop. The "open" prop is deprecated. Use "isOpen" prop to replace it.'
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
const style = {
|
|
@@ -24,12 +24,12 @@ const Button = polymorphicForwardRef(
|
|
|
24
24
|
const isDisabled = isDisabledProp || disabled;
|
|
25
25
|
if (process.env.NODE_ENV !== "production" && progress) {
|
|
26
26
|
deprecate(
|
|
27
|
-
'The "progress" prop is deprecated. Use "isLoading" prop to replace it.'
|
|
27
|
+
'Button. The "progress" prop is deprecated. Use "isLoading" prop to replace it.'
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
if (process.env.NODE_ENV !== "production" && disabled) {
|
|
31
31
|
deprecate(
|
|
32
|
-
'The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
32
|
+
'Button. The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
const iconOnly = (!children || onlyIcon) && (startIcon || endIcon);
|
|
@@ -25,7 +25,7 @@ export type ButtonToggleGroupBaseProps = {
|
|
|
25
25
|
/** The initial selected key in the collection (uncontrolled). */
|
|
26
26
|
defaultSelectedKey?: ButtonToggleGroupKey;
|
|
27
27
|
/** Handler that is called when the selection changes. */
|
|
28
|
-
onSelectionChange?: (
|
|
28
|
+
onSelectionChange?: (key: ButtonToggleGroupKey) => void;
|
|
29
29
|
/** Unique identifier for testing purposes. */
|
|
30
30
|
'data-testid'?: string | number;
|
|
31
31
|
/** The props used for each slot inside. */
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
export declare const Checkbox: import("react").ForwardRefExoticComponent<
|
|
2
|
-
|
|
3
|
-
checked?: boolean;
|
|
4
|
-
readonly?: boolean;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
indeterminate?: boolean;
|
|
8
|
-
defaultChecked?: boolean;
|
|
9
|
-
onChange?: (checked: boolean) => void;
|
|
10
|
-
} & {
|
|
1
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<{
|
|
2
|
+
children?: import("react").ReactNode;
|
|
11
3
|
className?: string;
|
|
4
|
+
style?: import("react").CSSProperties;
|
|
12
5
|
size?: import("./types").CheckboxPropSize;
|
|
13
|
-
'data-testid'?: string | number;
|
|
14
6
|
labelPlacement?: import("./types").CheckboxPropLabelPlacement;
|
|
7
|
+
isInvalid?: boolean;
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
isReadOnly?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
isRequired?: boolean;
|
|
12
|
+
isIndeterminate?: boolean;
|
|
13
|
+
defaultSelected?: boolean;
|
|
14
|
+
onChange?: import("./types").CheckboxPropOnChange;
|
|
15
15
|
slotProps?: {
|
|
16
16
|
box?: import("react").ComponentPropsWithRef<"span">;
|
|
17
17
|
label?: import("react").ComponentPropsWithRef<"span">;
|
|
18
18
|
};
|
|
19
|
+
'data-testid'?: string | number;
|
|
20
|
+
} & {
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
error?: boolean;
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
indeterminate?: boolean;
|
|
27
|
+
defaultChecked?: boolean;
|
|
19
28
|
} & import("react").RefAttributes<HTMLLabelElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { deprecate } from "@koobiq/logger";
|
|
5
|
+
import { isNotNil, mergeProps, clsx } from "@koobiq/react-core";
|
|
5
6
|
import { IconCheckS16, IconMinusS16 } from "@koobiq/react-icons";
|
|
6
7
|
import { Checkbox as Checkbox$1 } from "@koobiq/react-primitives";
|
|
7
8
|
import s from "./Checkbox.module.css.js";
|
|
@@ -11,45 +12,108 @@ const Checkbox = forwardRef(
|
|
|
11
12
|
const {
|
|
12
13
|
size = "normal",
|
|
13
14
|
labelPlacement = "end",
|
|
15
|
+
disabled,
|
|
16
|
+
isDisabled: isDisabledProp,
|
|
17
|
+
checked,
|
|
18
|
+
isSelected: isSelectedProp,
|
|
19
|
+
error,
|
|
20
|
+
isInvalid: isInvalidProp,
|
|
21
|
+
defaultChecked,
|
|
22
|
+
defaultSelected: defaultSelectedProp,
|
|
23
|
+
readonly,
|
|
24
|
+
isReadOnly: isReadOnlyProp,
|
|
25
|
+
required,
|
|
26
|
+
isRequired: isRequiredProp,
|
|
27
|
+
indeterminate,
|
|
28
|
+
isIndeterminate: isIndeterminateProp,
|
|
14
29
|
children,
|
|
15
30
|
className,
|
|
16
31
|
slotProps,
|
|
17
|
-
indeterminate,
|
|
18
32
|
...other
|
|
19
33
|
} = props;
|
|
34
|
+
const isDisabled = isDisabledProp || disabled;
|
|
35
|
+
const isSelected = isSelectedProp ?? checked;
|
|
36
|
+
const isInvalid = isInvalidProp || error;
|
|
37
|
+
const defaultSelected = defaultSelectedProp ?? defaultChecked;
|
|
38
|
+
const isReadOnly = isReadOnlyProp || readonly;
|
|
39
|
+
const isRequired = isRequiredProp || required;
|
|
40
|
+
const isIndeterminate = isIndeterminateProp || indeterminate;
|
|
20
41
|
const commonProps = {
|
|
21
|
-
|
|
42
|
+
isIndeterminate,
|
|
43
|
+
isDisabled,
|
|
44
|
+
isSelected,
|
|
45
|
+
isInvalid,
|
|
46
|
+
isRequired,
|
|
47
|
+
isReadOnly,
|
|
48
|
+
defaultSelected,
|
|
22
49
|
className: ({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
50
|
+
isInvalid: isInvalid2,
|
|
51
|
+
isSelected: isSelected2,
|
|
52
|
+
isHovered,
|
|
53
|
+
isDisabled: isDisabled2,
|
|
54
|
+
isFocusVisible,
|
|
55
|
+
isIndeterminate: isIndeterminate2
|
|
29
56
|
}) => clsx(
|
|
30
57
|
s.base,
|
|
31
58
|
s[size],
|
|
32
|
-
error && s.error,
|
|
33
59
|
s[labelPlacement],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
isInvalid2 && s.invalid,
|
|
61
|
+
isHovered && s.hovered,
|
|
62
|
+
isDisabled2 && s.disabled,
|
|
63
|
+
isSelected2 && s.selected,
|
|
64
|
+
isFocusVisible && s.focusVisible,
|
|
65
|
+
isIndeterminate2 && s.indeterminate,
|
|
39
66
|
className
|
|
40
67
|
),
|
|
41
68
|
...other
|
|
42
69
|
};
|
|
70
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(disabled)) {
|
|
71
|
+
deprecate(
|
|
72
|
+
'Checkbox. The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(checked)) {
|
|
76
|
+
deprecate(
|
|
77
|
+
'Checkbox. The "checked" prop is deprecated. Use "isSelected" prop to replace it.'
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(error)) {
|
|
81
|
+
deprecate(
|
|
82
|
+
'Checkbox. The "error" prop is deprecated. Use "isInvalid" prop to replace it.'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(defaultChecked)) {
|
|
86
|
+
deprecate(
|
|
87
|
+
'Checkbox. The "defaultChecked" prop is deprecated. Use "defaultSelected" prop to replace it.'
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(readonly)) {
|
|
91
|
+
deprecate(
|
|
92
|
+
'Checkbox. The "readonly" prop is deprecated. Use "isReadOnly" prop to replace it.'
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(required)) {
|
|
96
|
+
deprecate(
|
|
97
|
+
'Checkbox. The "required" prop is deprecated. Use "isRequired" prop to replace it.'
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (process.env.NODE_ENV !== "production" && isNotNil(indeterminate)) {
|
|
101
|
+
deprecate(
|
|
102
|
+
'Checkbox. The "indeterminate" prop is deprecated. Use "isIndeterminate" prop to replace it.'
|
|
103
|
+
);
|
|
104
|
+
}
|
|
43
105
|
const boxProps = mergeProps({ className: s.checkbox }, slotProps?.box);
|
|
44
106
|
const labelProps = slotProps?.label;
|
|
45
107
|
return /* @__PURE__ */ jsx(
|
|
46
108
|
Checkbox$1,
|
|
47
109
|
{
|
|
48
|
-
"data-
|
|
110
|
+
"data-size": size,
|
|
111
|
+
"data-indeterminate": isIndeterminate,
|
|
112
|
+
"data-label-placement": labelPlacement,
|
|
49
113
|
...commonProps,
|
|
50
114
|
ref,
|
|
51
|
-
children: ({
|
|
52
|
-
const activeIndex =
|
|
115
|
+
children: ({ isSelected: isSelected2, isIndeterminate: isIndeterminate2 }) => {
|
|
116
|
+
const activeIndex = isIndeterminate2 ? 1 : Number(Boolean(isSelected2)) - 1;
|
|
53
117
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
118
|
/* @__PURE__ */ jsx("span", { ...boxProps, children: /* @__PURE__ */ jsx(
|
|
55
119
|
AnimatedIcon,
|
|
@@ -3,8 +3,8 @@ const checkbox = "kbq-checkbox-checkbox-dbb3d9";
|
|
|
3
3
|
const normal = "kbq-checkbox-normal-646719";
|
|
4
4
|
const big = "kbq-checkbox-big-d7d5f1";
|
|
5
5
|
const hovered = "kbq-checkbox-hovered-a8a95e";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const selected = "kbq-checkbox-selected-ba10f0";
|
|
7
|
+
const invalid = "kbq-checkbox-invalid-253c35";
|
|
8
8
|
const focusVisible = "kbq-checkbox-focusVisible-c41061";
|
|
9
9
|
const indeterminate = "kbq-checkbox-indeterminate-efed4f";
|
|
10
10
|
const disabled = "kbq-checkbox-disabled-e359aa";
|
|
@@ -16,8 +16,8 @@ const s = {
|
|
|
16
16
|
normal,
|
|
17
17
|
big,
|
|
18
18
|
hovered,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
selected,
|
|
20
|
+
invalid,
|
|
21
21
|
focusVisible,
|
|
22
22
|
indeterminate,
|
|
23
23
|
disabled,
|
|
@@ -28,14 +28,14 @@ export {
|
|
|
28
28
|
base,
|
|
29
29
|
big,
|
|
30
30
|
checkbox,
|
|
31
|
-
checked,
|
|
32
31
|
s as default,
|
|
33
32
|
disabled,
|
|
34
33
|
end,
|
|
35
|
-
error,
|
|
36
34
|
focusVisible,
|
|
37
35
|
hovered,
|
|
38
36
|
indeterminate,
|
|
37
|
+
invalid,
|
|
39
38
|
normal,
|
|
39
|
+
selected,
|
|
40
40
|
start
|
|
41
41
|
};
|
|
@@ -1,27 +1,126 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import type { UseCheckboxProps } from '@koobiq/react-primitives';
|
|
1
|
+
import type { ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
|
|
3
2
|
export declare const checkboxPropSize: readonly ["normal", "big"];
|
|
4
3
|
export type CheckboxPropSize = (typeof checkboxPropSize)[number];
|
|
5
4
|
export declare const checkboxPropLabelPlacement: readonly ["start", "end"];
|
|
6
5
|
export type CheckboxPropLabelPlacement = (typeof checkboxPropLabelPlacement)[number];
|
|
7
|
-
export type
|
|
6
|
+
export type CheckboxPropOnChange = (selected: boolean) => void;
|
|
7
|
+
type CheckboxDeprecatedProps = {
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated
|
|
10
|
+
* The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
|
|
11
|
+
*
|
|
12
|
+
* If `true`, the component is disabled.
|
|
13
|
+
* @default false
|
|
14
|
+
* */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
* The "error" prop is deprecated. Use "isInvalid" prop to replace it.
|
|
19
|
+
*
|
|
20
|
+
* If `true`, the component will indicate an error.
|
|
21
|
+
* @default false
|
|
22
|
+
* */
|
|
23
|
+
error?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
* The "checked" prop is deprecated. Use "isSelected" prop to replace it.
|
|
27
|
+
*
|
|
28
|
+
* If `true`, the component is checked.
|
|
29
|
+
* @default false
|
|
30
|
+
* */
|
|
31
|
+
checked?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
* The "readonly" prop is deprecated. Use "isReadonly" prop to replace it.
|
|
35
|
+
*
|
|
36
|
+
* It prevents the user from changing the value of the checkbox.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
readonly?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
* The "required" prop is deprecated. Use "isRequired" prop to replace it.
|
|
43
|
+
*
|
|
44
|
+
* If `true`, the input element is required.
|
|
45
|
+
* @default false
|
|
46
|
+
* */
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
* The "indeterminate" prop is deprecated. Use "isIndeterminate" prop to replace it.
|
|
51
|
+
*
|
|
52
|
+
* If `true`, the component appears indeterminate.
|
|
53
|
+
* @default false
|
|
54
|
+
* */
|
|
55
|
+
indeterminate?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated
|
|
58
|
+
* The "defaultChecked" prop is deprecated. Use "defaultSelected" prop to replace it.
|
|
59
|
+
*
|
|
60
|
+
* The default checked state. Use when the component is not controlled.
|
|
61
|
+
* @default false
|
|
62
|
+
* */
|
|
63
|
+
defaultChecked?: boolean;
|
|
64
|
+
};
|
|
65
|
+
export type CheckboxProps = {
|
|
66
|
+
/** The content of the component. */
|
|
67
|
+
children?: ReactNode;
|
|
8
68
|
/** Additional CSS-classes. */
|
|
9
69
|
className?: string;
|
|
70
|
+
/** Inline styles. */
|
|
71
|
+
style?: CSSProperties;
|
|
10
72
|
/**
|
|
11
73
|
* Size.
|
|
12
74
|
* @default normal
|
|
13
75
|
* */
|
|
14
76
|
size?: CheckboxPropSize;
|
|
15
|
-
/** Unique identifier for testing purposes. */
|
|
16
|
-
'data-testid'?: string | number;
|
|
17
77
|
/**
|
|
18
78
|
* The position of the label.
|
|
19
79
|
* @default end
|
|
20
80
|
* */
|
|
21
81
|
labelPlacement?: CheckboxPropLabelPlacement;
|
|
82
|
+
/**
|
|
83
|
+
* If `true`, the component will indicate an error.
|
|
84
|
+
* @default false
|
|
85
|
+
* */
|
|
86
|
+
isInvalid?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* If `true`, the component is checked.
|
|
89
|
+
* @default false
|
|
90
|
+
* */
|
|
91
|
+
isSelected?: boolean;
|
|
92
|
+
/** It prevents the user from changing the value of the checkbox.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
isReadOnly?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* If `true`, the component is disabled.
|
|
98
|
+
* @default false
|
|
99
|
+
* */
|
|
100
|
+
isDisabled?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* If `true`, the input element is required.
|
|
103
|
+
* @default false
|
|
104
|
+
* */
|
|
105
|
+
isRequired?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* If `true`, the component appears indeterminate.
|
|
108
|
+
* @default false
|
|
109
|
+
* */
|
|
110
|
+
isIndeterminate?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The default checked state. Use when the component is not controlled.
|
|
113
|
+
* @default false
|
|
114
|
+
* */
|
|
115
|
+
defaultSelected?: boolean;
|
|
116
|
+
/** Callback fired when the state is changed. */
|
|
117
|
+
onChange?: CheckboxPropOnChange;
|
|
22
118
|
/** The props used for each slot inside. */
|
|
23
119
|
slotProps?: {
|
|
24
120
|
box?: ComponentPropsWithRef<'span'>;
|
|
25
121
|
label?: ComponentPropsWithRef<'span'>;
|
|
26
122
|
};
|
|
27
|
-
|
|
123
|
+
/** Unique identifier for testing purposes. */
|
|
124
|
+
'data-testid'?: string | number;
|
|
125
|
+
} & CheckboxDeprecatedProps;
|
|
126
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { deprecate } from "@koobiq/logger";
|
|
3
4
|
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
4
5
|
import s from "./Container.module.css.js";
|
|
5
6
|
import { normalizeMargins, normalizeMaxInlineSize, normalizePosition } from "./utils.js";
|
|
@@ -12,25 +13,35 @@ const Container = polymorphicForwardRef(
|
|
|
12
13
|
margins: marginsProp = 0,
|
|
13
14
|
position: positionProp = "center",
|
|
14
15
|
fixed = false,
|
|
16
|
+
isFixed: isFixedProp = false,
|
|
15
17
|
children,
|
|
16
18
|
className,
|
|
17
19
|
maxInlineSize: maxInlineSizeProp,
|
|
18
20
|
style: styleProp,
|
|
19
21
|
...other
|
|
20
22
|
} = props;
|
|
23
|
+
const isFixed = isFixedProp || fixed;
|
|
24
|
+
if (process.env.NODE_ENV !== "production" && fixed) {
|
|
25
|
+
deprecate(
|
|
26
|
+
'Container. The "fixed" prop is deprecated. Use "isFixed" prop to replace it.'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
21
29
|
const breakpoints = useMatchedBreakpoints();
|
|
22
30
|
const maxInlineSize = getResponsiveValue(maxInlineSizeProp, breakpoints);
|
|
23
31
|
const position = getResponsiveValue(positionProp, breakpoints);
|
|
24
32
|
const margins = getResponsiveValue(marginsProp, breakpoints);
|
|
25
33
|
const style = {
|
|
26
34
|
...styleProp,
|
|
27
|
-
"--container-max-inline-size":
|
|
35
|
+
"--container-max-inline-size": isFixed ? void 0 : normalizeMaxInlineSize(maxInlineSize),
|
|
28
36
|
"--container-position": normalizePosition(position),
|
|
29
37
|
"--container-margins": normalizeMargins(margins)
|
|
30
38
|
};
|
|
31
39
|
return /* @__PURE__ */ jsx(
|
|
32
40
|
Tag,
|
|
33
41
|
{
|
|
42
|
+
"data-fixed": isFixed,
|
|
43
|
+
"data-margins": margins,
|
|
44
|
+
"data-position": position,
|
|
34
45
|
className: clsx(s.base, className),
|
|
35
46
|
style,
|
|
36
47
|
...other,
|
|
@@ -5,6 +5,16 @@ export type ContainerMarginsProp = (typeof containerMarginsProp)[number];
|
|
|
5
5
|
export type ContainerMaxInlineSizeProp = CSSProperties['maxInlineSize'];
|
|
6
6
|
export declare const containerPositionProp: readonly ["start", "center", "end"];
|
|
7
7
|
export type ContainerPositionProp = (typeof containerPositionProp)[number];
|
|
8
|
+
type ContainerDeprecatedProps = {
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
* The "fixed" prop is deprecated. Use "isFixed" prop to replace it.
|
|
12
|
+
*
|
|
13
|
+
* If `true`, doesn't set the max-inline-size of the container.
|
|
14
|
+
* @default false
|
|
15
|
+
* */
|
|
16
|
+
fixed?: boolean;
|
|
17
|
+
};
|
|
8
18
|
export type ContainerBaseProps = {
|
|
9
19
|
/**
|
|
10
20
|
* Container position.
|
|
@@ -22,11 +32,12 @@ export type ContainerBaseProps = {
|
|
|
22
32
|
* If `true`, doesn't set the max-inline-size of the container.
|
|
23
33
|
* @default false
|
|
24
34
|
* */
|
|
25
|
-
|
|
35
|
+
isFixed?: boolean;
|
|
26
36
|
/** The content of the component. */
|
|
27
37
|
children?: ReactNode;
|
|
28
38
|
/** Additional CSS-classes. */
|
|
29
39
|
className?: string;
|
|
30
40
|
/** Inline styles. */
|
|
31
41
|
style?: CSSProperties;
|
|
32
|
-
};
|
|
42
|
+
} & ContainerDeprecatedProps;
|
|
43
|
+
export {};
|
|
@@ -21,12 +21,12 @@ const IconButton = polymorphicForwardRef(
|
|
|
21
21
|
const isDisabled = isDisabledProp || disabled;
|
|
22
22
|
if (process.env.NODE_ENV !== "production" && compact) {
|
|
23
23
|
deprecate(
|
|
24
|
-
'The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
|
|
24
|
+
'IconButton. The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
if (process.env.NODE_ENV !== "production" && disabled) {
|
|
28
28
|
deprecate(
|
|
29
|
-
'The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
29
|
+
'IconButton. The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
const classNameFn = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-types/checkbox").AriaToggleProps, "onChange" | "isDisabled" | "
|
|
1
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-types/checkbox").AriaToggleProps, "onChange" | "isDisabled" | "isInvalid" | "isSelected" | "isReadOnly" | "isRequired" | "defaultSelected">, "defaultChecked" | "onChange" | "disabled" | "checked" | "required" | "error"> & {
|
|
2
2
|
error?: boolean;
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
disabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useRef } from "react";
|
|
4
|
-
import { useDOMRef, useMultiRef, useBoolean,
|
|
4
|
+
import { useDOMRef, useMultiRef, useBoolean, mergeProps, clsx, FocusableProvider } from "@koobiq/react-core";
|
|
5
5
|
import { useTooltipTriggerState, useTooltipTrigger, useOverlayPosition, useTooltip, Overlay } from "@koobiq/react-primitives";
|
|
6
6
|
import { Transition } from "react-transition-group";
|
|
7
7
|
import { utilClasses } from "../../styles/utility.js";
|
|
@@ -40,7 +40,7 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
40
40
|
const domRef = useDOMRef(ref);
|
|
41
41
|
const controlRef = useRef(null);
|
|
42
42
|
const controlRefCallback = useMultiRef([controlRef]);
|
|
43
|
-
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
43
|
+
const { triggerProps, tooltipProps: tooltipTriggerProps } = useTooltipTrigger(
|
|
44
44
|
{
|
|
45
45
|
delay,
|
|
46
46
|
closeDelay,
|
|
@@ -66,7 +66,20 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
66
66
|
onClose: () => state.close(true),
|
|
67
67
|
targetRef: anchorRef || controlRef
|
|
68
68
|
});
|
|
69
|
-
const { tooltipProps:
|
|
69
|
+
const { tooltipProps: tooltipCommonProps } = useTooltip(overlayProps, state);
|
|
70
|
+
const tooltipProps = mergeProps(
|
|
71
|
+
{
|
|
72
|
+
className: clsx(
|
|
73
|
+
s.base,
|
|
74
|
+
s[variant],
|
|
75
|
+
utilClasses.typography["text-normal"]
|
|
76
|
+
),
|
|
77
|
+
ref: domRef
|
|
78
|
+
},
|
|
79
|
+
other,
|
|
80
|
+
tooltipCommonProps,
|
|
81
|
+
tooltipTriggerProps
|
|
82
|
+
);
|
|
70
83
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
84
|
/* @__PURE__ */ jsx(FocusableProvider, { ...triggerProps, ref: controlRef, children: control?.({
|
|
72
85
|
ref: controlRefCallback,
|
|
@@ -85,18 +98,11 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
85
98
|
children: (transition) => /* @__PURE__ */ jsx(Overlay, { portalContainer, children: /* @__PURE__ */ jsxs(
|
|
86
99
|
"div",
|
|
87
100
|
{
|
|
88
|
-
...
|
|
101
|
+
...tooltipProps,
|
|
89
102
|
"data-arrow": showArrow,
|
|
90
103
|
"data-variant": variant,
|
|
91
104
|
"data-placement": placement,
|
|
92
105
|
"data-transition": transition,
|
|
93
|
-
className: clsx(
|
|
94
|
-
s.base,
|
|
95
|
-
s[variant],
|
|
96
|
-
utilClasses.typography["text-normal"]
|
|
97
|
-
),
|
|
98
|
-
...other,
|
|
99
|
-
ref: domRef,
|
|
100
106
|
children: [
|
|
101
107
|
showArrow && /* @__PURE__ */ jsx(
|
|
102
108
|
"div",
|
package/dist/style.css
CHANGED
|
@@ -1360,7 +1360,7 @@
|
|
|
1360
1360
|
|
|
1361
1361
|
.kbq-utility-list-item-862731:where([data-disabled="true"]), .kbq-utility-list-item-862731:where([aria-disabled="true"]) {
|
|
1362
1362
|
--list-item-bg-color: ;
|
|
1363
|
-
cursor:
|
|
1363
|
+
cursor: not-allowed;
|
|
1364
1364
|
opacity: .3;
|
|
1365
1365
|
}
|
|
1366
1366
|
|
|
@@ -1494,34 +1494,34 @@
|
|
|
1494
1494
|
--checkbox-border-color: var(--kbq-line-contrast-fade);
|
|
1495
1495
|
}
|
|
1496
1496
|
|
|
1497
|
-
.kbq-checkbox-
|
|
1497
|
+
.kbq-checkbox-selected-ba10f0 {
|
|
1498
1498
|
--checkbox-icon-color: var(--kbq-white-default);
|
|
1499
1499
|
--checkbox-bg-color: var(--kbq-background-theme);
|
|
1500
1500
|
--checkbox-border-color: var(--kbq-background-theme);
|
|
1501
1501
|
}
|
|
1502
1502
|
|
|
1503
|
-
.kbq-checkbox-
|
|
1503
|
+
.kbq-checkbox-selected-ba10f0:where(.kbq-checkbox-hovered-a8a95e) {
|
|
1504
1504
|
--checkbox-icon-color: var(--kbq-white-default);
|
|
1505
1505
|
--checkbox-bg-color: var(--kbq-states-background-theme-hover);
|
|
1506
1506
|
--checkbox-border-color: var(--kbq-states-background-theme-hover);
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
|
-
.kbq-checkbox-
|
|
1509
|
+
.kbq-checkbox-invalid-253c35 {
|
|
1510
1510
|
--checkbox-border-color: var(--kbq-line-error);
|
|
1511
1511
|
}
|
|
1512
1512
|
|
|
1513
|
-
.kbq-checkbox-
|
|
1513
|
+
.kbq-checkbox-invalid-253c35:where(.kbq-checkbox-hovered-a8a95e) {
|
|
1514
1514
|
--checkbox-border-color: var(--kbq-line-error);
|
|
1515
1515
|
--checkbox-bg-color: var(--kbq-states-background-error-fade-hover);
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
-
.kbq-checkbox-
|
|
1518
|
+
.kbq-checkbox-invalid-253c35:where(.kbq-checkbox-selected-ba10f0) {
|
|
1519
1519
|
--checkbox-icon-color: var(--kbq-white-default);
|
|
1520
1520
|
--checkbox-border-color: var(--kbq-background-error);
|
|
1521
1521
|
--checkbox-bg-color: var(--kbq-background-error);
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
|
-
.kbq-checkbox-
|
|
1524
|
+
.kbq-checkbox-invalid-253c35:where(.kbq-checkbox-selected-ba10f0.kbq-checkbox-hovered-a8a95e) {
|
|
1525
1525
|
--checkbox-icon-color: var(--kbq-white-default);
|
|
1526
1526
|
--checkbox-border-color: var(--kbq-states-background-error-hover);
|
|
1527
1527
|
--checkbox-bg-color: var(--kbq-states-background-error-hover);
|
|
@@ -1532,7 +1532,7 @@
|
|
|
1532
1532
|
--checkbox-outline-color: var(--kbq-states-line-focus-theme);
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
1535
|
-
.kbq-checkbox-focusVisible-c41061:where(.kbq-checkbox-
|
|
1535
|
+
.kbq-checkbox-focusVisible-c41061:where(.kbq-checkbox-invalid-253c35) {
|
|
1536
1536
|
--checkbox-border-color: transparent;
|
|
1537
1537
|
--checkbox-outline-color: var(--kbq-states-line-focus-error);
|
|
1538
1538
|
}
|
|
@@ -1556,7 +1556,7 @@
|
|
|
1556
1556
|
cursor: not-allowed;
|
|
1557
1557
|
}
|
|
1558
1558
|
|
|
1559
|
-
.kbq-checkbox-
|
|
1559
|
+
.kbq-checkbox-selected-ba10f0:where(.kbq-checkbox-disabled-e359aa) {
|
|
1560
1560
|
--checkbox-icon-color: var(--kbq-states-icon-disabled);
|
|
1561
1561
|
}
|
|
1562
1562
|
|
|
@@ -2562,21 +2562,33 @@
|
|
|
2562
2562
|
--skeleton-inline-size: ;
|
|
2563
2563
|
--skeleton-block-size: ;
|
|
2564
2564
|
--skeleton-loader-width: 100px;
|
|
2565
|
-
--skeleton-bg-color: var(--kbq-background
|
|
2566
|
-
--skeleton-wave-color: var(--kbq-
|
|
2565
|
+
--skeleton-bg-color: var(--kbq-skeleton-background);
|
|
2566
|
+
--skeleton-wave-color: var(--kbq-skeleton-animation-wave-center);
|
|
2567
2567
|
--skeleton-border-radius: var(--kbq-size-xxs);
|
|
2568
2568
|
visibility: initial;
|
|
2569
2569
|
border-radius: var(--skeleton-border-radius);
|
|
2570
2570
|
background-color: var(--skeleton-bg-color);
|
|
2571
|
-
background-image: linear-gradient(to right, var(--skeleton-
|
|
2571
|
+
background-image: linear-gradient(to right, var(--kbq-skeleton-animation-wave-start) 0%, var(--skeleton-wave-color) calc(var(--skeleton-loader-width) / 2), var(--kbq-skeleton-animation-wave-end) var(--skeleton-loader-width));
|
|
2572
2572
|
inline-size: var(--skeleton-inline-size);
|
|
2573
2573
|
block-size: var(--skeleton-block-size);
|
|
2574
2574
|
background-repeat: no-repeat;
|
|
2575
2575
|
background-attachment: fixed;
|
|
2576
|
-
animation:
|
|
2576
|
+
animation: 1.5s linear infinite kbq-skeletonblock-skeleton-wave-3094a0;
|
|
2577
2577
|
display: flex;
|
|
2578
2578
|
}
|
|
2579
2579
|
|
|
2580
|
+
@media (min-width: 768px) {
|
|
2581
|
+
.kbq-skeletonblock-e98401 {
|
|
2582
|
+
animation-duration: 2s;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
@media (min-width: 1280px) {
|
|
2587
|
+
.kbq-skeletonblock-e98401 {
|
|
2588
|
+
animation-duration: 2.5s;
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2580
2592
|
.kbq-skeletonblock-hasChildren-88ab53 {
|
|
2581
2593
|
max-inline-size: fit-content;
|
|
2582
2594
|
}
|
|
@@ -2587,11 +2599,11 @@
|
|
|
2587
2599
|
|
|
2588
2600
|
@keyframes kbq-skeletonblock-skeleton-wave-3094a0 {
|
|
2589
2601
|
0% {
|
|
2590
|
-
background-position: calc(-1 * var(--skeleton-loader-width))
|
|
2602
|
+
background-position: calc(-1 * var(--skeleton-loader-width)) 0%;
|
|
2591
2603
|
}
|
|
2592
2604
|
|
|
2593
2605
|
100% {
|
|
2594
|
-
background-position: 100vw;
|
|
2606
|
+
background-position: 100vw 0;
|
|
2595
2607
|
}
|
|
2596
2608
|
}
|
|
2597
2609
|
.kbq-skeletontypography-776dae {
|
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.24",
|
|
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-
|
|
32
|
-
"@koobiq/react-
|
|
33
|
-
"@koobiq/react-
|
|
30
|
+
"@koobiq/logger": "0.0.1-beta.24",
|
|
31
|
+
"@koobiq/react-icons": "0.0.1-beta.24",
|
|
32
|
+
"@koobiq/react-primitives": "0.0.1-beta.24",
|
|
33
|
+
"@koobiq/react-core": "0.0.1-beta.24"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@koobiq/design-tokens": "^3.11.2",
|