@koobiq/react-components 0.0.1-beta.23 → 0.0.1-beta.25
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/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/Collections/Cell.d.ts +28 -0
- package/dist/components/Collections/Cell.js +10 -0
- package/dist/components/Collections/Column.d.ts +28 -0
- package/dist/components/Collections/Column.js +10 -0
- package/dist/components/Collections/Row.d.ts +14 -0
- package/dist/components/Collections/Row.js +10 -0
- package/dist/components/Collections/TableBody.d.ts +6 -0
- package/dist/components/Collections/TableBody.js +10 -0
- package/dist/components/Collections/TableHeader.d.ts +6 -0
- package/dist/components/Collections/TableHeader.js +10 -0
- package/dist/components/Collections/index.d.ts +5 -0
- 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/Table/Table.d.ts +12 -0
- package/dist/components/Table/Table.js +104 -0
- package/dist/components/Table/Table.module.css.js +55 -0
- package/dist/components/Table/components/TableCell/TableCell.d.ts +7 -0
- package/dist/components/Table/components/TableCell/TableCell.js +39 -0
- package/dist/components/Table/components/TableCell/index.d.ts +1 -0
- package/dist/components/Table/components/TableCheckboxCell/TableCheckboxCell.d.ts +7 -0
- package/dist/components/Table/components/TableCheckboxCell/TableCheckboxCell.js +21 -0
- package/dist/components/Table/components/TableCheckboxCell/index.d.ts +1 -0
- package/dist/components/Table/components/TableColumnHeader/TableColumnHeader.d.ts +7 -0
- package/dist/components/Table/components/TableColumnHeader/TableColumnHeader.js +46 -0
- package/dist/components/Table/components/TableColumnHeader/index.d.ts +1 -0
- package/dist/components/Table/components/TableHeaderRow/TableHeaderRow.d.ts +9 -0
- package/dist/components/Table/components/TableHeaderRow/TableHeaderRow.js +16 -0
- package/dist/components/Table/components/TableHeaderRow/index.d.ts +1 -0
- package/dist/components/Table/components/TableRow/TableRow.d.ts +9 -0
- package/dist/components/Table/components/TableRow/TableRow.js +46 -0
- package/dist/components/Table/components/TableRow/index.d.ts +1 -0
- package/dist/components/Table/components/TableRowGroup/TableRowGroup.d.ts +6 -0
- package/dist/components/Table/components/TableRowGroup/TableRowGroup.js +17 -0
- package/dist/components/Table/components/TableRowGroup/index.d.ts +1 -0
- package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.d.ts +7 -0
- package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.js +22 -0
- package/dist/components/Table/components/TableSelectAllCell/index.d.ts +1 -0
- package/dist/components/Table/components/index.d.ts +7 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/types.d.ts +76 -0
- package/dist/components/Table/utils.d.ts +2 -0
- package/dist/components/Table/utils.js +8 -0
- package/dist/components/TagGroup/TagGroup.js +1 -0
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/style.css +203 -14
- 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);
|
|
@@ -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 {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { CellProps as AriaCellProps } from '@koobiq/react-primitives';
|
|
3
|
+
export declare const cellPropAlign: readonly ["left", "right", "center"];
|
|
4
|
+
export declare const cellPropVerticalAlign: readonly ["baseline", "top", "middle", "bottom", "sub", "text-top"];
|
|
5
|
+
export type CellPropAlign = (typeof cellPropAlign)[number];
|
|
6
|
+
export type CellPropVerticalAlign = (typeof cellPropVerticalAlign)[number];
|
|
7
|
+
export type CellProps = AriaCellProps & {
|
|
8
|
+
/** Additional CSS-classes. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Inline styles. */
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
/** Unique identifier for testing purposes. */
|
|
13
|
+
'data-testid'?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal alignment of the cell content.
|
|
16
|
+
* @default left
|
|
17
|
+
* */
|
|
18
|
+
align?: CellPropAlign;
|
|
19
|
+
/**
|
|
20
|
+
* Vertical alignment of the cell content.
|
|
21
|
+
* @default middle
|
|
22
|
+
* */
|
|
23
|
+
valign?: CellPropVerticalAlign;
|
|
24
|
+
};
|
|
25
|
+
export declare function Cell(_props: CellProps): null;
|
|
26
|
+
export declare namespace Cell {
|
|
27
|
+
var getCollectionNode: unknown;
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { ColumnProps as AriaColumnProps } from '@koobiq/react-primitives';
|
|
3
|
+
export declare const columnPropAlign: readonly ["left", "right", "center"];
|
|
4
|
+
export declare const columnPropVerticalAlign: readonly ["baseline", "top", "middle", "bottom", "sub", "text-top"];
|
|
5
|
+
export type ColumnPropAlign = (typeof columnPropAlign)[number];
|
|
6
|
+
export type ColumnPropVerticalAlign = (typeof columnPropVerticalAlign)[number];
|
|
7
|
+
export type ColumnProps<T> = Omit<AriaColumnProps<T>, 'allowsResizing' | 'allowsSorting' | 'width' | 'defaultWidth' | 'minWidth' | 'maxWidth'> & {
|
|
8
|
+
/** Additional CSS-classes. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Inline styles. */
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
/** Unique identifier for testing purposes. */
|
|
13
|
+
'data-testid'?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal alignment of the cell content.
|
|
16
|
+
* @default left
|
|
17
|
+
* */
|
|
18
|
+
align?: ColumnPropAlign;
|
|
19
|
+
/**
|
|
20
|
+
* Vertical alignment of the cell content.
|
|
21
|
+
* @default middle
|
|
22
|
+
* */
|
|
23
|
+
valign?: ColumnPropVerticalAlign;
|
|
24
|
+
};
|
|
25
|
+
export declare function Column<T>(_props: ColumnProps<T>): null;
|
|
26
|
+
export declare namespace Column {
|
|
27
|
+
var getCollectionNode: unknown;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { RowProps as AriaRowProps } from '@koobiq/react-primitives';
|
|
3
|
+
export type RowProps<T> = AriaRowProps<T> & {
|
|
4
|
+
/** Additional CSS-classes. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Inline styles. */
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
/** Unique identifier for testing purposes. */
|
|
9
|
+
'data-testid'?: string | number;
|
|
10
|
+
};
|
|
11
|
+
export declare function Row<T>(_props: RowProps<T>): null;
|
|
12
|
+
export declare namespace Row {
|
|
13
|
+
var getCollectionNode: unknown;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TableBodyProps as AriaTableBodyProps } from '@koobiq/react-primitives';
|
|
2
|
+
export type TableBodyProps<T> = AriaTableBodyProps<T>;
|
|
3
|
+
export declare function TableBody<T>(_props: TableBodyProps<T>): null;
|
|
4
|
+
export declare namespace TableBody {
|
|
5
|
+
var getCollectionNode: unknown;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TableBody as TableBody$1 } from "@koobiq/react-primitives";
|
|
3
|
+
const TableBodyInner = TableBody$1;
|
|
4
|
+
function TableBody(_props) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
TableBody.getCollectionNode = TableBodyInner.getCollectionNode;
|
|
8
|
+
export {
|
|
9
|
+
TableBody
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TableHeaderProps as AriaTableHeaderProps } from '@koobiq/react-primitives';
|
|
2
|
+
export type TableHeaderProps<T> = AriaTableHeaderProps<T>;
|
|
3
|
+
export declare function TableHeader<T>(_props: TableHeaderProps<T>): null;
|
|
4
|
+
export declare namespace TableHeader {
|
|
5
|
+
var getCollectionNode: unknown;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { TableHeader as TableHeader$1 } from "@koobiq/react-primitives";
|
|
3
|
+
const TableHeaderInner = TableHeader$1;
|
|
4
|
+
function TableHeader(_props) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
TableHeader.getCollectionNode = TableHeaderInner.getCollectionNode;
|
|
8
|
+
export {
|
|
9
|
+
TableHeader
|
|
10
|
+
};
|
|
@@ -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 = ({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Cell, Row, Column, TableBody, TableHeader } from '../Collections';
|
|
2
|
+
import type { TableComponentProp } from './types';
|
|
3
|
+
declare const TableComponent: TableComponentProp;
|
|
4
|
+
type CompoundedComponent = typeof TableComponent & {
|
|
5
|
+
Header: typeof TableHeader;
|
|
6
|
+
Body: typeof TableBody;
|
|
7
|
+
Column: typeof Column;
|
|
8
|
+
Row: typeof Row;
|
|
9
|
+
Cell: typeof Cell;
|
|
10
|
+
};
|
|
11
|
+
export declare const Table: CompoundedComponent;
|
|
12
|
+
export {};
|