@koobiq/react-components 0.0.1-beta.2 → 0.0.1-beta.21
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/Alert/components/AlertIcon/utils.js +1 -1
- package/dist/components/Alert/intl.json.js +2 -6
- package/dist/components/Alert/types.d.ts +2 -1
- package/dist/components/AnimatedIcon/AnimatedIcon.d.ts +4 -0
- package/dist/components/AnimatedIcon/AnimatedIcon.js +50 -0
- package/dist/components/AnimatedIcon/AnimatedIcon.module.css.js +11 -0
- package/dist/components/AnimatedIcon/index.d.ts +2 -0
- package/dist/components/AnimatedIcon/types.d.ts +19 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.module.css.js +2 -2
- package/dist/components/Button/types.d.ts +4 -5
- package/dist/components/ButtonToggleGroup/ButtonToggleGroup.d.ts +2 -0
- package/dist/components/ButtonToggleGroup/ButtonToggleGroup.js +130 -0
- package/dist/components/ButtonToggleGroup/ButtonToggleGroup.module.css.js +17 -0
- package/dist/components/ButtonToggleGroup/ButtonToggleGroupContext.d.ts +7 -0
- package/dist/components/ButtonToggleGroup/ButtonToggleGroupContext.js +12 -0
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/ButtonToggle.d.ts +2 -0
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/ButtonToggle.js +90 -0
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/ButtonToggle.module.css.js +32 -0
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/index.d.ts +2 -0
- package/dist/components/ButtonToggleGroup/components/ButtonToggle/types.d.ts +27 -0
- package/dist/components/ButtonToggleGroup/components/index.d.ts +1 -0
- package/dist/components/ButtonToggleGroup/index.d.ts +3 -0
- package/dist/components/ButtonToggleGroup/reducer.d.ts +23 -0
- package/dist/components/ButtonToggleGroup/reducer.js +25 -0
- package/dist/components/ButtonToggleGroup/types.d.ts +38 -0
- package/dist/components/ButtonToggleGroup/utils.d.ts +3 -0
- package/dist/components/ButtonToggleGroup/utils.js +19 -0
- package/dist/components/Checkbox/Checkbox.js +18 -8
- package/dist/components/Collections/Divider.d.ts +19 -0
- package/dist/components/Collections/Divider.js +14 -0
- package/dist/components/Collections/Header.d.ts +20 -0
- package/dist/components/Collections/Header.js +16 -0
- package/dist/components/Collections/Item.d.ts +14 -0
- package/dist/components/Collections/Item.js +10 -0
- package/dist/components/{List/ListSection.d.ts → Collections/Section.d.ts} +6 -6
- package/dist/components/Collections/Section.js +10 -0
- package/dist/components/Collections/index.d.ts +4 -0
- package/dist/components/Container/Container.js +2 -1
- package/dist/components/Container/utils.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +9 -1
- package/dist/components/Dialog/Dialog.js +31 -17
- package/dist/components/Dialog/components/DialogBody.d.ts +13 -0
- package/dist/components/Dialog/components/{DialogContent.js → DialogBody.js} +9 -8
- package/dist/components/Dialog/components/DialogCloseButton.d.ts +14 -1
- package/dist/components/Dialog/components/DialogCloseButton.js +3 -6
- package/dist/components/Dialog/components/index.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +0 -1
- package/dist/components/Dialog/intl.json.js +2 -6
- package/dist/components/Divider/Divider.d.ts +4 -0
- package/dist/components/Divider/Divider.js +44 -0
- package/dist/components/Divider/Divider.module.css.js +29 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/types.d.ts +26 -0
- package/dist/components/Divider/types.js +6 -0
- package/dist/components/FieldComponents/FieldControl/FieldControl.d.ts +1 -1
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.d.ts +8 -2
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.js +32 -30
- package/dist/components/FieldComponents/FieldNumberControl/FieldNumberControl.d.ts +1 -1
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.d.ts +12 -0
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.js +37 -0
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.module.css.js +20 -0
- package/dist/components/FieldComponents/FieldSelect/index.d.ts +1 -0
- package/dist/components/FieldComponents/index.d.ts +1 -0
- package/dist/components/FlexBox/FlexBox.d.ts +4 -0
- package/dist/components/FlexBox/FlexBox.js +47 -0
- package/dist/components/FlexBox/index.d.ts +2 -0
- package/dist/components/FlexBox/types.d.ts +27 -0
- package/dist/components/Grid/Grid.d.ts +8 -2
- package/dist/components/Grid/Grid.js +5 -2
- package/dist/components/IconButton/types.d.ts +5 -4
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/Input/Input.js +11 -11
- package/dist/components/Input/types.d.ts +2 -1
- package/dist/components/Link/Link.js +13 -15
- package/dist/components/Link/types.d.ts +4 -4
- package/dist/components/List/List.d.ts +17 -3
- package/dist/components/List/List.js +32 -18
- package/dist/components/List/List.module.css.js +0 -3
- package/dist/components/List/components/ListItemText/ListItemText.js +26 -0
- package/dist/components/List/components/ListItemText/ListItemText.module.css.js +11 -0
- package/dist/components/List/components/ListOption/ListOption.d.ts +3 -2
- package/dist/components/List/components/ListOption/ListOption.js +11 -16
- package/dist/components/List/components/ListSection/ListSection.d.ts +3 -2
- package/dist/components/List/components/ListSection/ListSection.js +1 -4
- package/dist/components/List/index.d.ts +2 -2
- package/dist/components/List/types.d.ts +13 -2
- package/dist/components/Menu/Menu.d.ts +15 -0
- package/dist/components/Menu/Menu.js +68 -0
- package/dist/components/Menu/Menu.module.css.js +8 -0
- package/dist/components/Menu/components/MenuHeader/MenuHeader.d.ts +5 -0
- package/dist/components/Menu/components/MenuHeader/MenuHeader.js +9 -0
- package/dist/components/Menu/components/MenuHeader/index.d.ts +1 -0
- package/dist/components/Menu/components/MenuInner/MenuInner.d.ts +3 -0
- package/dist/components/Menu/components/MenuInner/MenuInner.js +45 -0
- package/dist/components/Menu/components/MenuInner/MenuInner.module.css.js +11 -0
- package/dist/components/Menu/components/MenuInner/index.d.ts +1 -0
- package/dist/components/Menu/components/MenuItem/MenuItem.d.ts +6 -0
- package/dist/components/Menu/components/MenuItem/MenuItem.js +36 -0
- package/dist/components/Menu/components/MenuItem/index.d.ts +1 -0
- package/dist/components/Menu/components/MenuSection/MenuSection.d.ts +6 -0
- package/dist/components/Menu/components/MenuSection/MenuSection.js +30 -0
- package/dist/components/Menu/components/MenuSection/MenuSection.module.css.js +11 -0
- package/dist/components/Menu/components/MenuSection/index.d.ts +1 -0
- package/dist/components/Menu/components/index.d.ts +1 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/Menu/types.d.ts +62 -0
- package/dist/components/Menu/types.js +4 -0
- package/dist/components/Modal/Modal.d.ts +9 -1
- package/dist/components/Modal/Modal.js +21 -16
- package/dist/components/Modal/index.d.ts +15 -2
- package/dist/components/Modal/index.js +9 -0
- package/dist/components/Modal/types.d.ts +7 -0
- package/dist/components/Popover/Popover.d.ts +12 -2
- package/dist/components/Popover/Popover.js +143 -128
- package/dist/components/Popover/Popover.module.css.js +3 -0
- package/dist/components/Popover/index.d.ts +15 -2
- package/dist/components/Popover/index.js +9 -0
- package/dist/components/Popover/types.d.ts +28 -4
- package/dist/components/Popover/types.js +9 -1
- package/dist/components/ProgressBar/ProgressBar.module.css.js +1 -2
- package/dist/components/ProgressSpinner/ProgressSpinner.module.css.js +1 -2
- package/dist/components/Provider/BreakpointsProvider.d.ts +2 -1
- package/dist/components/Provider/BreakpointsProvider.js +8 -1
- package/dist/components/Provider/Provider.d.ts +1 -1
- package/dist/components/Provider/Provider.js +9 -1
- package/dist/components/Provider/types.d.ts +5 -0
- package/dist/components/Provider/utils/useBreakpoints.d.ts +2 -1
- package/dist/components/Provider/utils/useBreakpoints.js +2 -2
- package/dist/components/RadioGroup/RadioContext.js +1 -0
- package/dist/components/RadioGroup/RadioGroup.js +2 -1
- package/dist/components/RadioGroup/components/Radio/Radio.js +3 -2
- package/dist/components/RadioGroup/components/Radio/Radio.module.css.js +3 -0
- package/dist/components/Select/Select.d.ts +11 -0
- package/dist/components/Select/Select.js +179 -0
- package/dist/components/Select/Select.module.css.js +20 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/types.d.ts +87 -0
- package/dist/components/SidePanel/SidePanel.d.ts +9 -1
- package/dist/components/SidePanel/SidePanel.js +24 -19
- package/dist/components/SidePanel/index.d.ts +15 -2
- package/dist/components/SidePanel/index.js +9 -0
- package/dist/components/SidePanel/types.d.ts +7 -0
- package/dist/components/SkeletonBlock/SkeletonBlock.module.css.js +0 -1
- package/dist/components/SkeletonTypography/utils.js +3 -0
- package/dist/components/TagGroup/Tag.d.ts +24 -0
- package/dist/components/TagGroup/Tag.js +10 -0
- package/dist/components/TagGroup/TagGroup.d.ts +2 -0
- package/dist/components/TagGroup/TagGroup.js +22 -0
- package/dist/components/TagGroup/TagGroup.module.css.js +8 -0
- package/dist/components/TagGroup/components/TagInner/TagInner.d.ts +11 -0
- package/dist/components/TagGroup/components/TagInner/TagInner.js +86 -0
- package/dist/components/TagGroup/components/TagInner/TagInner.module.css.js +30 -0
- package/dist/components/TagGroup/components/TagInner/index.d.ts +1 -0
- package/dist/components/TagGroup/components/TagInner/utils.d.ts +3 -0
- package/dist/components/TagGroup/components/TagInner/utils.js +9 -0
- package/dist/components/TagGroup/components/index.d.ts +1 -0
- package/dist/components/TagGroup/index.d.ts +3 -0
- package/dist/components/TagGroup/intl.json.js +7 -0
- package/dist/components/TagGroup/types.d.ts +37 -0
- package/dist/components/TagGroup/types.js +9 -0
- package/dist/components/Toggle/Toggle.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.js +9 -8
- package/dist/components/Tooltip/types.d.ts +9 -4
- package/dist/components/Typography/Typography.js +2 -2
- package/dist/components/Typography/Typography.module.css.js +2 -1
- package/dist/components/Typography/types.d.ts +7 -2
- package/dist/components/Typography/types.js +2 -1
- package/dist/components/index.d.ts +8 -0
- package/dist/components/layout/flex/flex.d.ts +15 -4
- package/dist/components/layout/flex/flex.js +6 -1
- package/dist/components/layout/flex/flex.module.css.js +78 -39
- package/dist/index.js +51 -23
- package/dist/style.css +862 -350
- package/dist/styles/utility.d.ts +2 -0
- package/dist/styles/utility.js +3 -2
- package/dist/styles/utility.module.css.js +5 -2
- package/dist/types.d.ts +1 -0
- package/package.json +11 -6
- package/dist/components/Dialog/DialogContext.d.ts +0 -9
- package/dist/components/Dialog/DialogContext.js +0 -12
- package/dist/components/Dialog/components/DialogContent.d.ts +0 -12
- package/dist/components/Input/components/FieldAddon/FieldAddon.d.ts +0 -10
- package/dist/components/Input/components/FieldAddon/index.d.ts +0 -1
- package/dist/components/Input/components/FieldCaption/FieldCaption.d.ts +0 -6
- package/dist/components/Input/components/FieldCaption/index.d.ts +0 -1
- package/dist/components/Input/components/FieldControl/FieldControl.d.ts +0 -9
- package/dist/components/Input/components/FieldControl/index.d.ts +0 -1
- package/dist/components/Input/components/FieldError/FieldError.d.ts +0 -7
- package/dist/components/Input/components/FieldError/index.d.ts +0 -1
- package/dist/components/Input/components/FieldInput/FieldInput.d.ts +0 -9
- package/dist/components/Input/components/FieldInput/index.d.ts +0 -1
- package/dist/components/Input/components/FieldInputGroup/FieldInputGroup.d.ts +0 -7
- package/dist/components/Input/components/FieldInputGroup/index.d.ts +0 -1
- package/dist/components/Input/components/FieldLabel/FieldLabel.d.ts +0 -9
- package/dist/components/Input/components/FieldLabel/index.d.ts +0 -1
- package/dist/components/Input/components/index.d.ts +0 -7
- package/dist/components/List/ListItem.d.ts +0 -11
- package/dist/components/List/ListItem.js +0 -11
- package/dist/components/List/ListSection.js +0 -11
- package/dist/components/List/components/ListOption/ListOption.module.css.js +0 -23
|
@@ -5,36 +5,38 @@ import { useInputContext, Group } from "@koobiq/react-primitives";
|
|
|
5
5
|
import s from "./FieldInputGroup.module.css.js";
|
|
6
6
|
import { FieldInputGroupContext } from "./FieldInputGroupContext.js";
|
|
7
7
|
import { FieldAddon } from "../FieldAddon/FieldAddon.js";
|
|
8
|
-
const FieldInputGroup = forwardRef(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
const FieldInputGroup = forwardRef(
|
|
9
|
+
({ children, className, startAddon, endAddon, error, slotProps, ...other }, ref) => {
|
|
10
|
+
const { value } = useInputContext();
|
|
11
|
+
const hasStartAddon = !!startAddon;
|
|
12
|
+
const hasEndAddon = !!endAddon;
|
|
13
|
+
const hasValue = isNotNil(value);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Group,
|
|
16
|
+
{
|
|
17
|
+
className: clsx(
|
|
18
|
+
s.base,
|
|
19
|
+
hasStartAddon && s.hasStartAddon,
|
|
20
|
+
hasEndAddon && s.hasEndAddon,
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...other,
|
|
24
|
+
ref,
|
|
25
|
+
children: ({ hovered, focusWithin, disabled }) => /* @__PURE__ */ jsxs(
|
|
26
|
+
FieldInputGroupContext.Provider,
|
|
27
|
+
{
|
|
28
|
+
value: { disabled, hovered, hasValue, focusWithin },
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(FieldAddon, { placement: "start", error, ...slotProps?.start, children: startAddon }),
|
|
31
|
+
children,
|
|
32
|
+
/* @__PURE__ */ jsx(FieldAddon, { placement: "end", error, ...slotProps?.end, children: endAddon })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
38
40
|
FieldInputGroup.displayName = "FieldInputGroup";
|
|
39
41
|
export {
|
|
40
42
|
FieldInputGroup
|
|
@@ -4,7 +4,7 @@ export type FieldNumberControlProps = NumberFieldProps & {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
6
|
export type FieldNumberControlRef = NumberFieldRef;
|
|
7
|
-
export declare const FieldNumberControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseNumberFieldProps, keyof import("
|
|
7
|
+
export declare const FieldNumberControl: import("react").ForwardRefExoticComponent<Omit<import("@koobiq/react-primitives").UseNumberFieldProps, keyof import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps>> & import("@koobiq/react-primitives").RenderProps<import("@koobiq/react-primitives").NumberFieldRenderProps> & {
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { InputPropVariant } from '../../Input';
|
|
3
|
+
export type FieldSelectProps = {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
variant?: InputPropVariant;
|
|
10
|
+
placeholder?: string | number;
|
|
11
|
+
};
|
|
12
|
+
export declare const FieldSelect: import("react").ForwardRefExoticComponent<FieldSelectProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { clsx, isNotNil } from "@koobiq/react-core";
|
|
4
|
+
import { Button } from "@koobiq/react-primitives";
|
|
5
|
+
import s from "./FieldSelect.module.css.js";
|
|
6
|
+
const FieldSelect = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
error = false,
|
|
9
|
+
disabled = false,
|
|
10
|
+
variant = "filled",
|
|
11
|
+
placeholder,
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
...other
|
|
15
|
+
}, ref) => /* @__PURE__ */ jsx(
|
|
16
|
+
Button,
|
|
17
|
+
{
|
|
18
|
+
...other,
|
|
19
|
+
disabled,
|
|
20
|
+
"data-slot": "select-value",
|
|
21
|
+
className: clsx(
|
|
22
|
+
s.base,
|
|
23
|
+
s[variant],
|
|
24
|
+
error && s.error,
|
|
25
|
+
disabled && s.disabled,
|
|
26
|
+
!isNotNil(children) && s.hasPlaceholder,
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
ref,
|
|
30
|
+
children: /* @__PURE__ */ jsx("span", { className: s.content, children: children ?? placeholder })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
FieldSelect.displayName = "FieldSelect";
|
|
35
|
+
export {
|
|
36
|
+
FieldSelect
|
|
37
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const base = "kbq-fieldselect-0f0f5e";
|
|
2
|
+
const content = "kbq-fieldselect-content-c36142";
|
|
3
|
+
const error = "kbq-fieldselect-error-0cac4a";
|
|
4
|
+
const disabled = "kbq-fieldselect-disabled-f0efd4";
|
|
5
|
+
const hasPlaceholder = "kbq-fieldselect-hasPlaceholder-7b7518";
|
|
6
|
+
const s = {
|
|
7
|
+
base,
|
|
8
|
+
content,
|
|
9
|
+
error,
|
|
10
|
+
disabled,
|
|
11
|
+
hasPlaceholder
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
base,
|
|
15
|
+
content,
|
|
16
|
+
s as default,
|
|
17
|
+
disabled,
|
|
18
|
+
error,
|
|
19
|
+
hasPlaceholder
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FieldSelect';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { FlexBoxBaseProps } from './index';
|
|
3
|
+
export declare const FlexBox: import("@koobiq/react-core").PolyForwardComponent<"div", FlexBoxBaseProps, ElementType>;
|
|
4
|
+
export type FlexBoxProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof FlexBox<As>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
4
|
+
import { useMatchedBreakpoints } from "../Provider/BreakpointsContext.js";
|
|
5
|
+
import { getResponsiveValue } from "../../utils/getResponsiveValue/getResponsiveValue.js";
|
|
6
|
+
import { flex } from "../layout/flex/flex.js";
|
|
7
|
+
const FlexBox = polymorphicForwardRef(
|
|
8
|
+
({
|
|
9
|
+
as: Tag = "div",
|
|
10
|
+
gap: gapProp,
|
|
11
|
+
wrap: wrapProp,
|
|
12
|
+
flex: flexProp,
|
|
13
|
+
colGap: colGapProp,
|
|
14
|
+
rowGap: rowGapProp,
|
|
15
|
+
direction: directionProp,
|
|
16
|
+
alignItems: alignItemsProp,
|
|
17
|
+
justifyContent: justifyContentProp,
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
...other
|
|
21
|
+
}, ref) => {
|
|
22
|
+
const breakpoints = useMatchedBreakpoints();
|
|
23
|
+
const flex$1 = getResponsiveValue(flexProp, breakpoints);
|
|
24
|
+
const gap = getResponsiveValue(gapProp, breakpoints);
|
|
25
|
+
const colGap = getResponsiveValue(colGapProp, breakpoints);
|
|
26
|
+
const rowGap = getResponsiveValue(rowGapProp, breakpoints);
|
|
27
|
+
const wrap = getResponsiveValue(wrapProp, breakpoints);
|
|
28
|
+
const alignItems = getResponsiveValue(alignItemsProp, breakpoints);
|
|
29
|
+
const direction = getResponsiveValue(directionProp, breakpoints);
|
|
30
|
+
const justifyContent = getResponsiveValue(justifyContentProp, breakpoints);
|
|
31
|
+
const flexCn = flex({
|
|
32
|
+
gap,
|
|
33
|
+
flex: flex$1,
|
|
34
|
+
wrap,
|
|
35
|
+
colGap,
|
|
36
|
+
rowGap,
|
|
37
|
+
direction,
|
|
38
|
+
alignItems,
|
|
39
|
+
justifyContent
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ jsx(Tag, { className: clsx(flexCn, className), ...other, ref, children });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
FlexBox.displayName = "FlexBox";
|
|
45
|
+
export {
|
|
46
|
+
FlexBox
|
|
47
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { ResponsiveValue } from '../../utils';
|
|
3
|
+
import type { FlexPropGap, FlexPropWrap, FlexPropFlex, FlexPropDirection, FlexPropAlignItems, FlexPropJustifyContent } from '../layout';
|
|
4
|
+
export type FlexBoxBaseProps = {
|
|
5
|
+
/** Defines the `display` property with `flex` or `inline-flex` value. */
|
|
6
|
+
flex?: FlexPropFlex | ResponsiveValue<FlexPropFlex>;
|
|
7
|
+
/** Defines the `flex-wrap` property. */
|
|
8
|
+
wrap?: FlexPropWrap | ResponsiveValue<FlexPropWrap>;
|
|
9
|
+
/** Defines the `flex-direction` property. */
|
|
10
|
+
direction?: FlexPropDirection | ResponsiveValue<FlexPropDirection>;
|
|
11
|
+
/** Defines the `gap` property. */
|
|
12
|
+
gap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
|
|
13
|
+
/** Defines the `column-gap` property. */
|
|
14
|
+
colGap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
|
|
15
|
+
/** Defines the `row-gap` property. */
|
|
16
|
+
rowGap?: FlexPropGap | ResponsiveValue<FlexPropGap>;
|
|
17
|
+
/** Defines the `justify-content` property. */
|
|
18
|
+
justifyContent?: FlexPropJustifyContent | ResponsiveValue<FlexPropJustifyContent>;
|
|
19
|
+
/** Defines the `align-items` property. */
|
|
20
|
+
alignItems?: FlexPropAlignItems | ResponsiveValue<FlexPropAlignItems>;
|
|
21
|
+
/** Additional CSS-classes. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** The content of the component. */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/** Inline styles. */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import { GridItem } from './components';
|
|
2
3
|
import type { GridBaseProps } from './types';
|
|
3
|
-
|
|
4
|
-
export type GridProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof
|
|
4
|
+
declare const GridComponent: import("@koobiq/react-core").PolyForwardComponent<"div", GridBaseProps, ElementType>;
|
|
5
|
+
export type GridProps<As extends ElementType = 'div'> = ComponentPropsWithRef<typeof GridComponent<As>>;
|
|
6
|
+
type CompoundedComponent = typeof GridComponent & {
|
|
7
|
+
Item: typeof GridItem;
|
|
8
|
+
};
|
|
9
|
+
export declare const Grid: CompoundedComponent;
|
|
10
|
+
export {};
|
|
@@ -3,9 +3,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
4
4
|
import s from "./Grid.module.css.js";
|
|
5
5
|
import { normalizeGap } from "./utils.js";
|
|
6
|
+
import { GridItem } from "./components/GridItem/GridItem.js";
|
|
6
7
|
import { useMatchedBreakpoints } from "../Provider/BreakpointsContext.js";
|
|
7
8
|
import { getResponsiveValue } from "../../utils/getResponsiveValue/getResponsiveValue.js";
|
|
8
|
-
const
|
|
9
|
+
const GridComponent = polymorphicForwardRef(
|
|
9
10
|
({
|
|
10
11
|
as: Tag = "div",
|
|
11
12
|
gap: gapProp,
|
|
@@ -46,7 +47,9 @@ const Grid = polymorphicForwardRef(
|
|
|
46
47
|
);
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
|
-
|
|
50
|
+
GridComponent.displayName = "Grid";
|
|
51
|
+
const Grid = GridComponent;
|
|
52
|
+
Grid.Item = GridItem;
|
|
50
53
|
export {
|
|
51
54
|
Grid
|
|
52
55
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
|
+
import type { HoverEvent, UseButtonProps } from '@koobiq/react-primitives';
|
|
3
4
|
export declare const iconButtonPropVariant: readonly ["theme", "theme-contrast", "fade-contrast", "error", "success", "warning"];
|
|
4
5
|
export type IconButtonPropVariant = (typeof iconButtonPropVariant)[number];
|
|
5
6
|
export declare const iconButtonPropSize: readonly ["l", "xl"];
|
|
6
7
|
export type IconButtonPropSize = (typeof iconButtonPropSize)[number];
|
|
7
|
-
export type IconButtonBaseProps = {
|
|
8
|
+
export type IconButtonBaseProps = ExtendableProps<{
|
|
8
9
|
/** The content of the component. */
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
/**
|
|
@@ -32,5 +33,5 @@ export type IconButtonBaseProps = {
|
|
|
32
33
|
/** Handler that is called when a hover interaction starts. */
|
|
33
34
|
onHoverStart?: (e: HoverEvent) => void;
|
|
34
35
|
/** Handler that is called when a hover interaction ends. */
|
|
35
|
-
|
|
36
|
-
}
|
|
36
|
+
onHoverEnd?: (e: HoverEvent) => void;
|
|
37
|
+
}, UseButtonProps>;
|
|
@@ -17,6 +17,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
17
17
|
label?: import("../FieldComponents").FieldLabelProps;
|
|
18
18
|
input?: import("../FieldComponents").FieldInputProps;
|
|
19
19
|
caption?: import("../FieldComponents").FieldCaptionProps;
|
|
20
|
+
group?: import("../FieldComponents").FieldInputGroupProps;
|
|
20
21
|
errorMessage?: import("../FieldComponents").FieldErrorProps;
|
|
21
22
|
};
|
|
22
23
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -21,7 +21,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
21
21
|
caption,
|
|
22
22
|
...other
|
|
23
23
|
} = props;
|
|
24
|
-
const
|
|
24
|
+
const inputRef = useDOMRef(ref);
|
|
25
25
|
const rootProps = mergeProps(
|
|
26
26
|
{
|
|
27
27
|
label,
|
|
@@ -42,23 +42,23 @@ const Input = forwardRef((props, ref) => {
|
|
|
42
42
|
error,
|
|
43
43
|
variant,
|
|
44
44
|
disabled,
|
|
45
|
-
ref:
|
|
45
|
+
ref: inputRef
|
|
46
46
|
},
|
|
47
47
|
slotProps?.input
|
|
48
48
|
);
|
|
49
|
+
const groupProps = mergeProps(
|
|
50
|
+
{
|
|
51
|
+
error,
|
|
52
|
+
endAddon,
|
|
53
|
+
startAddon
|
|
54
|
+
},
|
|
55
|
+
slotProps?.group
|
|
56
|
+
);
|
|
49
57
|
const captionProps = slotProps?.caption;
|
|
50
58
|
const errorProps = mergeProps({ error }, slotProps?.errorMessage);
|
|
51
59
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
60
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps, children: labelProps?.children || label }),
|
|
53
|
-
/* @__PURE__ */ jsx(
|
|
54
|
-
FieldInputGroup,
|
|
55
|
-
{
|
|
56
|
-
error,
|
|
57
|
-
endAddon,
|
|
58
|
-
startAddon,
|
|
59
|
-
children: /* @__PURE__ */ jsx(FieldInput, { ...inputProps })
|
|
60
|
-
}
|
|
61
|
-
),
|
|
61
|
+
/* @__PURE__ */ jsx(FieldInputGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldInput, { ...inputProps }) }),
|
|
62
62
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps, children: captionProps?.children || caption }),
|
|
63
63
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps, children: errorProps.children || errorMessage })
|
|
64
64
|
] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentRef, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
3
|
import type { UseTextFieldProps } from '@koobiq/react-primitives';
|
|
4
|
-
import type { FieldCaptionProps, FieldErrorProps, FieldInputProps, FieldLabelProps } from '../FieldComponents';
|
|
4
|
+
import type { FieldCaptionProps, FieldErrorProps, FieldInputProps, FieldLabelProps, FieldInputGroupProps } from '../FieldComponents';
|
|
5
5
|
export declare const inputPropVariant: readonly ["filled", "transparent"];
|
|
6
6
|
export type InputPropVariant = (typeof inputPropVariant)[number];
|
|
7
7
|
export type InputProps = ExtendableProps<{
|
|
@@ -56,6 +56,7 @@ export type InputProps = ExtendableProps<{
|
|
|
56
56
|
label?: FieldLabelProps;
|
|
57
57
|
input?: FieldInputProps;
|
|
58
58
|
caption?: FieldCaptionProps;
|
|
59
|
+
group?: FieldInputGroupProps;
|
|
59
60
|
errorMessage?: FieldErrorProps;
|
|
60
61
|
};
|
|
61
62
|
}, Omit<UseTextFieldProps, 'inputElementType'>>;
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { polymorphicForwardRef,
|
|
4
|
-
import {
|
|
3
|
+
import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
|
|
4
|
+
import { Link as Link$1 } from "@koobiq/react-primitives";
|
|
5
5
|
import s from "./Link.module.css.js";
|
|
6
6
|
const Link = polymorphicForwardRef((props, ref) => {
|
|
7
7
|
const {
|
|
8
8
|
variant = "text-normal",
|
|
9
9
|
visitable = false,
|
|
10
10
|
pseudo = false,
|
|
11
|
+
disabled,
|
|
11
12
|
as = "a",
|
|
12
13
|
startIcon,
|
|
13
14
|
endIcon,
|
|
14
15
|
children,
|
|
15
16
|
className,
|
|
16
|
-
|
|
17
|
+
...other
|
|
17
18
|
} = props;
|
|
18
|
-
const Tag = as;
|
|
19
|
-
const domRef = useDOMRef(ref);
|
|
20
|
-
const elementType = as !== "a" && as !== "button" ? `${as}` : void 0;
|
|
21
|
-
const { linkProps, hovered, pressed, focusVisible } = useLink(
|
|
22
|
-
{ ...props, elementType },
|
|
23
|
-
domRef
|
|
24
|
-
);
|
|
25
19
|
const hasIcon = Boolean(startIcon || endIcon);
|
|
20
|
+
const elementType = as !== "a" && as !== "button" ? `${as}` : void 0;
|
|
26
21
|
return /* @__PURE__ */ jsxs(
|
|
27
|
-
|
|
22
|
+
Link$1,
|
|
28
23
|
{
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
as,
|
|
25
|
+
disabled,
|
|
26
|
+
elementType,
|
|
27
|
+
...disabled && { tabIndex: -1 },
|
|
28
|
+
className: ({ hovered, pressed, focusVisible }) => clsx(
|
|
31
29
|
s.base,
|
|
32
30
|
s[variant],
|
|
33
31
|
pseudo && s.pseudo,
|
|
@@ -38,8 +36,8 @@ const Link = polymorphicForwardRef((props, ref) => {
|
|
|
38
36
|
focusVisible && s.focusVisible,
|
|
39
37
|
className
|
|
40
38
|
),
|
|
41
|
-
|
|
42
|
-
ref
|
|
39
|
+
...other,
|
|
40
|
+
ref,
|
|
43
41
|
children: [
|
|
44
42
|
startIcon,
|
|
45
43
|
children,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendableProps } from '@koobiq/react-core';
|
|
3
|
+
import type { UseLinkProps } from '@koobiq/react-primitives';
|
|
3
4
|
import type { TypographyPropVariant } from '../Typography';
|
|
4
5
|
export type LinkPropVariant = Extract<TypographyPropVariant, 'text-compact' | 'text-normal' | 'text-big' | 'inherit'>;
|
|
5
|
-
export type LinkBaseProps = {
|
|
6
|
+
export type LinkBaseProps = ExtendableProps<{
|
|
6
7
|
/** The content of the component. */
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
/** The variant of the component. */
|
|
@@ -21,5 +22,4 @@ export type LinkBaseProps = {
|
|
|
21
22
|
className?: string;
|
|
22
23
|
/** Inline styles */
|
|
23
24
|
style?: CSSProperties;
|
|
24
|
-
|
|
25
|
-
};
|
|
25
|
+
}, UseLinkProps>;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type ListState } from '@koobiq/react-primitives';
|
|
3
|
+
import { Item, Section } from '../Collections';
|
|
4
|
+
import { ListItemText } from './components';
|
|
5
|
+
import type { ListComponentProps, ListBaseProps } from './types';
|
|
6
|
+
export type ListInnerProps<T extends object> = {
|
|
7
|
+
state: ListState<T>;
|
|
8
|
+
listRef?: Ref<HTMLUListElement>;
|
|
9
|
+
} & Omit<ListBaseProps<T>, 'ref'>;
|
|
10
|
+
export declare function ListInner<T extends object>(props: ListInnerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const ListComponent: ListComponentProps;
|
|
12
|
+
type CompoundedComponent = typeof ListComponent & {
|
|
13
|
+
Item: typeof Item;
|
|
14
|
+
Section: typeof Section;
|
|
15
|
+
ItemText: typeof ListItemText;
|
|
16
|
+
};
|
|
17
|
+
export declare const List: CompoundedComponent;
|
|
18
|
+
export {};
|
|
@@ -2,40 +2,54 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { useDOMRef, mergeProps, clsx, isNotNil } from "@koobiq/react-core";
|
|
5
|
-
import {
|
|
5
|
+
import { useListBox, useListState } from "@koobiq/react-primitives";
|
|
6
|
+
import { utilClasses } from "../../styles/utility.js";
|
|
6
7
|
import s from "./List.module.css.js";
|
|
7
8
|
import { ListSection } from "./components/ListSection/ListSection.js";
|
|
9
|
+
import { Item } from "../Collections/Item.js";
|
|
10
|
+
import { Section } from "../Collections/Section.js";
|
|
11
|
+
import { ListItemText } from "./components/ListItemText/ListItemText.js";
|
|
8
12
|
import { Typography } from "../Typography/Typography.js";
|
|
9
13
|
import { ListOption } from "./components/ListOption/ListOption.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
+
const { list } = utilClasses;
|
|
15
|
+
function ListInner(props) {
|
|
16
|
+
const { label, className, style, slotProps, state, listRef } = props;
|
|
17
|
+
const domRef = useDOMRef(listRef);
|
|
14
18
|
const { listBoxProps, labelProps } = useListBox(props, state, domRef);
|
|
19
|
+
const titleProps = mergeProps(
|
|
20
|
+
{
|
|
21
|
+
className: s.label,
|
|
22
|
+
variant: "text-normal-strong"
|
|
23
|
+
},
|
|
24
|
+
slotProps?.label,
|
|
25
|
+
labelProps
|
|
26
|
+
);
|
|
15
27
|
const listProps = mergeProps(
|
|
16
28
|
{
|
|
17
|
-
|
|
18
|
-
ref: domRef
|
|
29
|
+
style,
|
|
30
|
+
ref: domRef,
|
|
31
|
+
className: clsx(list, className)
|
|
19
32
|
},
|
|
33
|
+
slotProps?.list,
|
|
20
34
|
listBoxProps
|
|
21
35
|
);
|
|
22
36
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
isNotNil(label) && /* @__PURE__ */ jsx(
|
|
24
|
-
Typography,
|
|
25
|
-
{
|
|
26
|
-
variant: "text-normal-strong",
|
|
27
|
-
className: s.label,
|
|
28
|
-
...labelProps,
|
|
29
|
-
children: label
|
|
30
|
-
}
|
|
31
|
-
),
|
|
37
|
+
isNotNil(label) && /* @__PURE__ */ jsx(Typography, { ...titleProps, children: label }),
|
|
32
38
|
/* @__PURE__ */ jsx("ul", { ...listProps, children: [...state.collection].map(
|
|
33
39
|
(item) => item.type === "section" ? /* @__PURE__ */ jsx(ListSection, { section: item, state }, item.key) : /* @__PURE__ */ jsx(ListOption, { item, state }, item.key)
|
|
34
40
|
) })
|
|
35
41
|
] });
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
function ListRender(props, ref) {
|
|
44
|
+
const state = useListState(props);
|
|
45
|
+
return /* @__PURE__ */ jsx(ListInner, { listRef: ref, ...props, state });
|
|
46
|
+
}
|
|
47
|
+
const ListComponent = forwardRef(ListRender);
|
|
48
|
+
const List = ListComponent;
|
|
49
|
+
List.Item = Item;
|
|
50
|
+
List.Section = Section;
|
|
51
|
+
List.ItemText = ListItemText;
|
|
38
52
|
export {
|
|
39
53
|
List,
|
|
40
|
-
|
|
54
|
+
ListInner
|
|
41
55
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { isNotNil, clsx } from "@koobiq/react-core";
|
|
5
|
+
import s from "./ListItemText.module.css.js";
|
|
6
|
+
import { Typography } from "../../../Typography/Typography.js";
|
|
7
|
+
const ListItemText = forwardRef(
|
|
8
|
+
({ className, children, caption, slotProps, ...other }, ref) => /* @__PURE__ */ jsxs("div", { className: clsx(s.base, className), ...other, ref, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", ...slotProps?.text, children }),
|
|
10
|
+
isNotNil(caption) && /* @__PURE__ */ jsx(
|
|
11
|
+
Typography,
|
|
12
|
+
{
|
|
13
|
+
as: "span",
|
|
14
|
+
color: "contrast-secondary",
|
|
15
|
+
className: s.caption,
|
|
16
|
+
variant: "text-compact",
|
|
17
|
+
...slotProps?.caption,
|
|
18
|
+
children: caption
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
] })
|
|
22
|
+
);
|
|
23
|
+
ListItemText.displayName = "ListItemText";
|
|
24
|
+
export {
|
|
25
|
+
ListItemText
|
|
26
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ListState, Node } from '@koobiq/react-primitives';
|
|
2
|
-
export
|
|
2
|
+
export type ListOptionProps<T> = {
|
|
3
3
|
item: Node<T>;
|
|
4
4
|
state: ListState<T>;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
|
+
export declare function ListOption<T>({ item, state }: ListOptionProps<T>): import("react/jsx-runtime").JSX.Element;
|