@koobiq/react-components 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DateInput/DateInput.js +4 -3
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.d.ts +2 -0
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.js +82 -0
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroup.module.css.js +26 -0
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroupContext.d.ts +9 -0
- package/dist/components/FieldComponents/FieldContentGroup/FieldContentGroupContext.js +7 -0
- package/dist/components/FieldComponents/FieldContentGroup/index.d.ts +3 -0
- package/dist/components/FieldComponents/FieldContentGroup/types.d.ts +29 -0
- package/dist/components/FieldComponents/FieldInput/FieldInput.d.ts +2 -2
- package/dist/components/FieldComponents/FieldInputDate/FieldInputDate.d.ts +2 -2
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.d.ts +4 -13
- package/dist/components/FieldComponents/FieldSelect/FieldSelect.js +10 -6
- package/dist/components/FieldComponents/FieldSelect/index.d.ts +1 -0
- package/dist/components/FieldComponents/FieldSelect/types.d.ts +11 -0
- package/dist/components/FieldComponents/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/InputNumber/InputNumber.d.ts +1 -1
- package/dist/components/InputNumber/InputNumber.js +3 -2
- package/dist/components/InputNumber/components/InputNumberCounterControls.js +1 -1
- package/dist/components/List/components/ListItemText/ListItemText.js +2 -1
- package/dist/components/List/components/ListOption/ListOption.js +12 -13
- package/dist/components/Select/Select.js +4 -4
- package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js +7 -1
- package/dist/components/TimePicker/TimePicker.js +4 -3
- package/dist/style.css +93 -82
- package/package.json +5 -5
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.d.ts +0 -17
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.js +0 -65
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroup.module.css.js +0 -14
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroupContext.d.ts +0 -9
- package/dist/components/FieldComponents/FieldInputGroup/FieldInputGroupContext.js +0 -7
- package/dist/components/FieldComponents/FieldInputGroup/index.d.ts +0 -2
|
@@ -9,7 +9,7 @@ import { FieldInputDate } from "../FieldComponents/FieldInputDate/FieldInputDate
|
|
|
9
9
|
import { DateSegment } from "../DateSegment/DateSegment.js";
|
|
10
10
|
import { FieldControl } from "../FieldComponents/FieldControl/FieldControl.js";
|
|
11
11
|
import { FieldLabel } from "../FieldComponents/FieldLabel/FieldLabel.js";
|
|
12
|
-
import {
|
|
12
|
+
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
13
13
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
14
14
|
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
15
15
|
function DateInputRender(props, ref) {
|
|
@@ -68,7 +68,8 @@ function DateInputRender(props, ref) {
|
|
|
68
68
|
endAddon,
|
|
69
69
|
isInvalid,
|
|
70
70
|
isDisabled,
|
|
71
|
-
startAddon
|
|
71
|
+
startAddon,
|
|
72
|
+
variant
|
|
72
73
|
},
|
|
73
74
|
slotProps?.group
|
|
74
75
|
);
|
|
@@ -93,7 +94,7 @@ function DateInputRender(props, ref) {
|
|
|
93
94
|
);
|
|
94
95
|
return /* @__PURE__ */ jsxs(FieldControl, { ...rootProps, children: [
|
|
95
96
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
96
|
-
/* @__PURE__ */ jsx(
|
|
97
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldInputDate, { ...controlProps, children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegment, { segment, state }, i)) }) }),
|
|
97
98
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
98
99
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
99
100
|
] });
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { isNotNil, clsx } from "@koobiq/react-core";
|
|
4
|
+
import { useInputContext, Group } from "@koobiq/react-primitives";
|
|
5
|
+
import s from "./FieldContentGroup.module.css.js";
|
|
6
|
+
import { FieldContentGroupContext } from "./FieldContentGroupContext.js";
|
|
7
|
+
import { FieldAddon } from "../FieldAddon/FieldAddon.js";
|
|
8
|
+
const FieldContentGroup = forwardRef(
|
|
9
|
+
({
|
|
10
|
+
variant = "filled",
|
|
11
|
+
isInvalid = false,
|
|
12
|
+
isDisabled = false,
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
startAddon,
|
|
16
|
+
endAddon,
|
|
17
|
+
slotProps,
|
|
18
|
+
...other
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const { value } = useInputContext();
|
|
21
|
+
const hasStartAddon = !!startAddon;
|
|
22
|
+
const hasEndAddon = !!endAddon;
|
|
23
|
+
const hasValue = isNotNil(value);
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Group,
|
|
26
|
+
{
|
|
27
|
+
className: clsx(
|
|
28
|
+
s.base,
|
|
29
|
+
s[variant],
|
|
30
|
+
isInvalid && s.invalid,
|
|
31
|
+
isDisabled && s.disabled,
|
|
32
|
+
hasStartAddon && s.hasStartAddon,
|
|
33
|
+
hasEndAddon && s.hasEndAddon,
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
isInvalid,
|
|
37
|
+
isDisabled,
|
|
38
|
+
...other,
|
|
39
|
+
ref,
|
|
40
|
+
children: ({ isHovered, isFocusWithin, isDisabled: isDisabled2, isInvalid: isInvalid2 }) => /* @__PURE__ */ jsxs(
|
|
41
|
+
FieldContentGroupContext.Provider,
|
|
42
|
+
{
|
|
43
|
+
value: {
|
|
44
|
+
hasValue,
|
|
45
|
+
isHovered,
|
|
46
|
+
isInvalid: isInvalid2,
|
|
47
|
+
isDisabled: isDisabled2,
|
|
48
|
+
isFocusWithin
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
FieldAddon,
|
|
53
|
+
{
|
|
54
|
+
placement: "start",
|
|
55
|
+
isInvalid: isInvalid2,
|
|
56
|
+
isDisabled: isDisabled2,
|
|
57
|
+
...slotProps?.startAddon,
|
|
58
|
+
children: startAddon
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
children,
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
FieldAddon,
|
|
64
|
+
{
|
|
65
|
+
placement: "end",
|
|
66
|
+
isInvalid: isInvalid2,
|
|
67
|
+
isDisabled: isDisabled2,
|
|
68
|
+
...slotProps?.endAddon,
|
|
69
|
+
children: endAddon
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
FieldContentGroup.displayName = "FieldContentGroup";
|
|
80
|
+
export {
|
|
81
|
+
FieldContentGroup
|
|
82
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const base = "kbq-fieldcontentgroup-d85be3";
|
|
2
|
+
const hasStartAddon = "kbq-fieldcontentgroup-hasStartAddon-62fb80";
|
|
3
|
+
const hasEndAddon = "kbq-fieldcontentgroup-hasEndAddon-e8c20a";
|
|
4
|
+
const transparent = "kbq-fieldcontentgroup-transparent-ac42b6";
|
|
5
|
+
const filled = "kbq-fieldcontentgroup-filled-37bb93";
|
|
6
|
+
const invalid = "kbq-fieldcontentgroup-invalid-e4973b";
|
|
7
|
+
const disabled = "kbq-fieldcontentgroup-disabled-54827b";
|
|
8
|
+
const s = {
|
|
9
|
+
base,
|
|
10
|
+
hasStartAddon,
|
|
11
|
+
hasEndAddon,
|
|
12
|
+
transparent,
|
|
13
|
+
filled,
|
|
14
|
+
invalid,
|
|
15
|
+
disabled
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
base,
|
|
19
|
+
s as default,
|
|
20
|
+
disabled,
|
|
21
|
+
filled,
|
|
22
|
+
hasEndAddon,
|
|
23
|
+
hasStartAddon,
|
|
24
|
+
invalid,
|
|
25
|
+
transparent
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FieldContentGroupContextProps = {
|
|
2
|
+
isDisabled?: boolean;
|
|
3
|
+
hasValue?: boolean;
|
|
4
|
+
isHovered?: boolean;
|
|
5
|
+
isFocusWithin?: boolean;
|
|
6
|
+
isInvalid?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const FieldContentGroupContext: import("react").Context<FieldContentGroupContextProps>;
|
|
9
|
+
export declare const useFieldInputGroup: () => FieldContentGroupContextProps;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
+
import type { FieldAddonProps } from '../FieldAddon';
|
|
4
|
+
export declare const fieldInputGroupPropVariant: readonly ["filled", "transparent"];
|
|
5
|
+
export type FieldInputGroupPropVariant = (typeof fieldInputGroupPropVariant)[number];
|
|
6
|
+
export type FieldInputGroupProps = ExtendableComponentPropsWithRef<{
|
|
7
|
+
/** The content of the component. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Addon placed before the children. */
|
|
10
|
+
startAddon?: ReactNode;
|
|
11
|
+
/** Addon placed after the children. */
|
|
12
|
+
endAddon?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The variant to use.
|
|
15
|
+
* @default 'filled'
|
|
16
|
+
*/
|
|
17
|
+
variant?: FieldInputGroupPropVariant;
|
|
18
|
+
/** Whether the input is disabled. */
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
/** Additional CSS-classes. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Whether the input value is invalid. */
|
|
23
|
+
isInvalid?: boolean;
|
|
24
|
+
/** The props used for each slot inside. */
|
|
25
|
+
slotProps?: {
|
|
26
|
+
startAddon?: FieldAddonProps;
|
|
27
|
+
endAddon?: FieldAddonProps;
|
|
28
|
+
};
|
|
29
|
+
}, 'div'>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FieldInputGroupPropVariant } from '../FieldContentGroup';
|
|
3
3
|
export type FieldInputBaseProps = {
|
|
4
4
|
isInvalid?: boolean;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
'data-testid'?: string;
|
|
8
8
|
as?: 'input' | 'textarea';
|
|
9
|
-
variant?:
|
|
9
|
+
variant?: FieldInputGroupPropVariant;
|
|
10
10
|
};
|
|
11
11
|
export declare const FieldInput: import("@koobiq/react-core").PolyForwardComponent<"input", FieldInputBaseProps, "input" | "textarea">;
|
|
12
12
|
export type FieldInputProps<As extends 'input' | 'textarea' = 'input'> = ComponentPropsWithRef<typeof FieldInput<As>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ReactNode, type Ref } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FieldInputGroupPropVariant } from '../FieldContentGroup';
|
|
3
3
|
export type FieldInputDateProps = {
|
|
4
4
|
isInvalid?: boolean;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
|
-
variant?: InputPropVariant;
|
|
7
6
|
className?: string;
|
|
8
7
|
children?: ReactNode;
|
|
9
8
|
'data-testid'?: string;
|
|
10
9
|
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
variant?: FieldInputGroupPropVariant;
|
|
11
11
|
};
|
|
12
12
|
export declare const FieldInputDate: import("react").ForwardRefExoticComponent<Omit<FieldInputDateProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
isDisabled?: boolean;
|
|
6
|
-
className?: string;
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
'data-testid'?: string;
|
|
9
|
-
variant?: InputPropVariant;
|
|
10
|
-
placeholder?: string | number;
|
|
11
|
-
ref?: Ref<HTMLButtonElement>;
|
|
12
|
-
};
|
|
13
|
-
export declare const FieldSelect: import("react").ForwardRefExoticComponent<Omit<FieldSelectProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { FieldSelectBaseProps } from './index';
|
|
3
|
+
export declare const FieldSelect: import("@koobiq/react-core").PolyForwardComponent<"button", FieldSelectBaseProps, ElementType>;
|
|
4
|
+
export type FieldSelectProps<As extends ElementType = 'button'> = ComponentPropsWithRef<typeof FieldSelect<As>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { clsx, isNotNil } from "@koobiq/react-core";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { polymorphicForwardRef, clsx, isString, isNumber, isNotNil } from "@koobiq/react-core";
|
|
4
3
|
import { Button } from "@koobiq/react-primitives";
|
|
5
4
|
import s from "./FieldSelect.module.css.js";
|
|
6
|
-
const FieldSelect =
|
|
5
|
+
const FieldSelect = polymorphicForwardRef(
|
|
7
6
|
({
|
|
7
|
+
as = "button",
|
|
8
8
|
isInvalid = false,
|
|
9
9
|
isDisabled = false,
|
|
10
10
|
variant = "filled",
|
|
@@ -12,10 +12,11 @@ const FieldSelect = forwardRef(
|
|
|
12
12
|
children,
|
|
13
13
|
className,
|
|
14
14
|
...other
|
|
15
|
-
}, ref) => /* @__PURE__ */
|
|
15
|
+
}, ref) => /* @__PURE__ */ jsxs(
|
|
16
16
|
Button,
|
|
17
17
|
{
|
|
18
18
|
...other,
|
|
19
|
+
as,
|
|
19
20
|
isDisabled,
|
|
20
21
|
"data-slot": "select-value",
|
|
21
22
|
className: clsx(
|
|
@@ -27,7 +28,10 @@ const FieldSelect = forwardRef(
|
|
|
27
28
|
className
|
|
28
29
|
),
|
|
29
30
|
ref,
|
|
30
|
-
children:
|
|
31
|
+
children: [
|
|
32
|
+
isString(children) || isNumber(children) ? /* @__PURE__ */ jsx("span", { className: s.content, children }) : children,
|
|
33
|
+
!isNotNil(children) && /* @__PURE__ */ jsx("span", { className: s.content, children: placeholder })
|
|
34
|
+
]
|
|
31
35
|
}
|
|
32
36
|
)
|
|
33
37
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FieldInputGroupPropVariant } from '../FieldContentGroup';
|
|
3
|
+
export type FieldSelectBaseProps = {
|
|
4
|
+
isInvalid?: boolean;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
placeholder?: string | number;
|
|
10
|
+
variant?: FieldInputGroupPropVariant;
|
|
11
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextField } from '@koobiq/react-primitives';
|
|
2
2
|
import { type FieldLabelProps, type FieldInputGroupProps, type FieldCaptionProps, type FieldErrorProps, type FieldInputProps, type FieldControlProps } from '../FieldComponents';
|
|
3
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").TextFieldProps<HTMLInputElement>, "children" | "validationBehavior" | "validate" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "slotProps" | "fullWidth" | "data-testid" | "
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").TextFieldProps<HTMLInputElement>, "children" | "validationBehavior" | "validate" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "slotProps" | "fullWidth" | "data-testid" | "startAddon" | "endAddon" | "errorMessage" | "isLabelHidden" | keyof {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
error?: boolean;
|
|
6
6
|
required?: boolean;
|
|
@@ -6,7 +6,7 @@ import { useDOMRef, mergeProps } from "@koobiq/react-core";
|
|
|
6
6
|
import { TextField } from "@koobiq/react-primitives";
|
|
7
7
|
import { FieldControl } from "../FieldComponents/FieldControl/FieldControl.js";
|
|
8
8
|
import { FieldLabel } from "../FieldComponents/FieldLabel/FieldLabel.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
10
10
|
import { FieldInput } from "../FieldComponents/FieldInput/FieldInput.js";
|
|
11
11
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
12
12
|
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
@@ -95,6 +95,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
95
95
|
const groupProps = mergeProps(
|
|
96
96
|
{
|
|
97
97
|
endAddon,
|
|
98
|
+
variant,
|
|
98
99
|
isInvalid: isInvalid2,
|
|
99
100
|
isDisabled: isDisabled2,
|
|
100
101
|
startAddon
|
|
@@ -105,7 +106,7 @@ const Input = forwardRef((props, ref) => {
|
|
|
105
106
|
const errorProps = mergeProps({ isInvalid: isInvalid2, children: errorMessage }, slotProps?.errorMessage);
|
|
106
107
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
108
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldInput, { ...inputProps }) }),
|
|
109
110
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
110
111
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
111
112
|
] });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NumberField } from '@koobiq/react-primitives';
|
|
2
2
|
import { type FieldControlProps, type FieldLabelProps, type FieldCaptionProps, type FieldErrorProps, type FieldInputGroupProps, type FieldInputProps } from '../FieldComponents';
|
|
3
|
-
export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").NumberFieldProps, "children" | "validationState" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "slotProps" | "fullWidth" | "data-testid" | "
|
|
3
|
+
export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<Omit<import("@koobiq/react-primitives").NumberFieldProps, "children" | "validationState" | "description" | "inputElementType">, "caption" | "style" | "className" | "variant" | "slotProps" | "fullWidth" | "data-testid" | "startAddon" | "endAddon" | "errorMessage" | "isLabelHidden" | keyof {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
error?: boolean;
|
|
6
6
|
required?: boolean;
|
|
@@ -7,7 +7,7 @@ import { NumberField } from "@koobiq/react-primitives";
|
|
|
7
7
|
import { InputNumberCounterControls } from "./components/InputNumberCounterControls.js";
|
|
8
8
|
import { FieldControl } from "../FieldComponents/FieldControl/FieldControl.js";
|
|
9
9
|
import { FieldLabel } from "../FieldComponents/FieldLabel/FieldLabel.js";
|
|
10
|
-
import {
|
|
10
|
+
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
11
11
|
import { FieldInput } from "../FieldComponents/FieldInput/FieldInput.js";
|
|
12
12
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
13
13
|
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
@@ -103,6 +103,7 @@ const InputNumber = forwardRef(
|
|
|
103
103
|
/* @__PURE__ */ jsx(InputNumberCounterControls, {})
|
|
104
104
|
] }),
|
|
105
105
|
isInvalid: isInvalid2,
|
|
106
|
+
variant,
|
|
106
107
|
startAddon,
|
|
107
108
|
isDisabled: isDisabled2
|
|
108
109
|
},
|
|
@@ -110,7 +111,7 @@ const InputNumber = forwardRef(
|
|
|
110
111
|
);
|
|
111
112
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
113
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldInput, { ...inputProps }) }),
|
|
114
115
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
115
116
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
116
117
|
] });
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx } from "@koobiq/react-core";
|
|
3
3
|
import { IconChevronUpS16, IconChevronDownS16 } from "@koobiq/react-icons";
|
|
4
4
|
import s from "./InputNumberCounterControls.module.css.js";
|
|
5
|
-
import { useFieldInputGroup } from "../../FieldComponents/
|
|
5
|
+
import { useFieldInputGroup } from "../../FieldComponents/FieldContentGroup/FieldContentGroupContext.js";
|
|
6
6
|
import { IconButton } from "../../IconButton/IconButton.js";
|
|
7
7
|
const InputNumberCounterControls = () => {
|
|
8
8
|
const { isInvalid } = useFieldInputGroup();
|
|
@@ -6,11 +6,12 @@ import s from "./ListItemText.module.css.js";
|
|
|
6
6
|
import { Typography } from "../../../Typography/Typography.js";
|
|
7
7
|
const ListItemText = forwardRef(
|
|
8
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 }),
|
|
9
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", align: "start", ellipsis: true, ...slotProps?.text, children }),
|
|
10
10
|
isNotNil(caption) && /* @__PURE__ */ jsx(
|
|
11
11
|
Typography,
|
|
12
12
|
{
|
|
13
13
|
as: "span",
|
|
14
|
+
align: "start",
|
|
14
15
|
color: "contrast-secondary",
|
|
15
16
|
className: s.caption,
|
|
16
17
|
variant: "text-compact",
|
|
@@ -9,14 +9,13 @@ const { listItem } = utilClasses;
|
|
|
9
9
|
function ListOption({ item, state }) {
|
|
10
10
|
const { href, className, style } = item.props;
|
|
11
11
|
const ref = useRef(null);
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} =
|
|
18
|
-
const {
|
|
19
|
-
const { isPressed: pressed, pressProps } = usePress({ isDisabled: disabled });
|
|
12
|
+
const { optionProps, isSelected, isDisabled, isFocusVisible } = useOption(
|
|
13
|
+
{ key: item.key },
|
|
14
|
+
state,
|
|
15
|
+
ref
|
|
16
|
+
);
|
|
17
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
18
|
+
const { isPressed, pressProps } = usePress({ isDisabled });
|
|
20
19
|
const Tag = href ? "a" : "li";
|
|
21
20
|
return /* @__PURE__ */ jsx(
|
|
22
21
|
Tag,
|
|
@@ -25,11 +24,11 @@ function ListOption({ item, state }) {
|
|
|
25
24
|
className: clsx(listItem, textVariant["text-normal"], className),
|
|
26
25
|
style,
|
|
27
26
|
ref,
|
|
28
|
-
"data-hovered":
|
|
29
|
-
"data-pressed":
|
|
30
|
-
"data-disabled":
|
|
31
|
-
"data-selected":
|
|
32
|
-
"data-focus-visible":
|
|
27
|
+
"data-hovered": isHovered,
|
|
28
|
+
"data-pressed": isPressed,
|
|
29
|
+
"data-disabled": isDisabled,
|
|
30
|
+
"data-selected": isSelected,
|
|
31
|
+
"data-focus-visible": isFocusVisible,
|
|
33
32
|
children: item.rendered
|
|
34
33
|
}
|
|
35
34
|
);
|
|
@@ -10,7 +10,7 @@ import { FieldSelect } from "../FieldComponents/FieldSelect/FieldSelect.js";
|
|
|
10
10
|
import { ListInner } from "../List/List.js";
|
|
11
11
|
import { FieldControl } from "../FieldComponents/FieldControl/FieldControl.js";
|
|
12
12
|
import { FieldLabel } from "../FieldComponents/FieldLabel/FieldLabel.js";
|
|
13
|
-
import {
|
|
13
|
+
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
14
14
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
15
15
|
import { FieldError } from "../FieldComponents/FieldError/FieldError.js";
|
|
16
16
|
import { Item } from "../Collections/Item.js";
|
|
@@ -122,8 +122,8 @@ function SelectRender(props, ref) {
|
|
|
122
122
|
const groupProps = mergeProps(
|
|
123
123
|
{
|
|
124
124
|
slotProps: {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
endAddon: { className: s.addon },
|
|
126
|
+
startAddon: { className: s.addon }
|
|
127
127
|
},
|
|
128
128
|
startAddon,
|
|
129
129
|
endAddon: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -187,7 +187,7 @@ function SelectRender(props, ref) {
|
|
|
187
187
|
isDisabled
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
190
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldSelect, { ...controlProps, children: renderValue(state?.selectedItem) }) }),
|
|
191
191
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
192
192
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
193
193
|
] }),
|
package/dist/components/Textarea/components/TextareaContextConsumer/TextareaContextConsumer.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useTextareaContext } from "@koobiq/react-primitives";
|
|
|
5
5
|
import s from "../../Textarea.module.css.js";
|
|
6
6
|
import { useTextareaAutosize } from "../../utils/useTextareaAutosize.js";
|
|
7
7
|
import { FieldLabel } from "../../../FieldComponents/FieldLabel/FieldLabel.js";
|
|
8
|
+
import { FieldContentGroup } from "../../../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
8
9
|
import { FieldInput } from "../../../FieldComponents/FieldInput/FieldInput.js";
|
|
9
10
|
import { FieldCaption } from "../../../FieldComponents/FieldCaption/FieldCaption.js";
|
|
10
11
|
import { FieldError } from "../../../FieldComponents/FieldError/FieldError.js";
|
|
@@ -44,13 +45,18 @@ const TextareaContextConsumer = forwardRef((props, ref) => {
|
|
|
44
45
|
{ isInvalid, children: errorMessage },
|
|
45
46
|
slotProps?.errorMessage
|
|
46
47
|
);
|
|
48
|
+
const groupProps = {
|
|
49
|
+
variant,
|
|
50
|
+
isInvalid,
|
|
51
|
+
isDisabled
|
|
52
|
+
};
|
|
47
53
|
const labelProps = mergeProps(
|
|
48
54
|
{ isHidden: isLabelHidden, children: label, isRequired },
|
|
49
55
|
slotProps?.label
|
|
50
56
|
);
|
|
51
57
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
58
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
53
|
-
/* @__PURE__ */ jsx(FieldInput, { as: "textarea", ...textareaProps }),
|
|
59
|
+
/* @__PURE__ */ jsx(FieldContentGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FieldInput, { as: "textarea", ...textareaProps }) }),
|
|
54
60
|
/* @__PURE__ */ jsx(FieldCaption, { ...captionProps }),
|
|
55
61
|
/* @__PURE__ */ jsx(FieldError, { ...errorProps })
|
|
56
62
|
] });
|
|
@@ -6,7 +6,7 @@ import { useTimeFieldState, removeDataAttributes, useTimeField } from "@koobiq/r
|
|
|
6
6
|
import s from "./TimePicker.module.css.js";
|
|
7
7
|
import { FieldControl } from "../FieldComponents/FieldControl/FieldControl.js";
|
|
8
8
|
import { FieldLabel } from "../FieldComponents/FieldLabel/FieldLabel.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FieldContentGroup } from "../FieldComponents/FieldContentGroup/FieldContentGroup.js";
|
|
10
10
|
import { FieldInputDate } from "../FieldComponents/FieldInputDate/FieldInputDate.js";
|
|
11
11
|
import { DateSegment } from "../DateSegment/DateSegment.js";
|
|
12
12
|
import { FieldCaption } from "../FieldComponents/FieldCaption/FieldCaption.js";
|
|
@@ -61,6 +61,7 @@ function TimePickerRender(props, ref) {
|
|
|
61
61
|
startAddon,
|
|
62
62
|
/* @__PURE__ */ jsx(IconClock16, {})
|
|
63
63
|
] }),
|
|
64
|
+
variant,
|
|
64
65
|
isInvalid,
|
|
65
66
|
isDisabled,
|
|
66
67
|
endAddon
|
|
@@ -94,10 +95,10 @@ function TimePickerRender(props, ref) {
|
|
|
94
95
|
return /* @__PURE__ */ jsxs(FieldControl, { ...rootProps, children: [
|
|
95
96
|
/* @__PURE__ */ jsx(FieldLabel, { ...labelProps }),
|
|
96
97
|
/* @__PURE__ */ jsx(
|
|
97
|
-
|
|
98
|
+
FieldContentGroup,
|
|
98
99
|
{
|
|
99
100
|
...groupProps,
|
|
100
|
-
slotProps: {
|
|
101
|
+
slotProps: { startAddon: { className: s.startAddon } },
|
|
101
102
|
children: /* @__PURE__ */ jsx(FieldInputDate, { ...controlProps, children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegment, { segment, state }, i)) })
|
|
102
103
|
}
|
|
103
104
|
),
|
package/dist/style.css
CHANGED
|
@@ -1905,6 +1905,7 @@
|
|
|
1905
1905
|
--badge-color: var(--kbq-foreground-contrast);
|
|
1906
1906
|
}
|
|
1907
1907
|
.kbq-fieldcontrol-ef127a {
|
|
1908
|
+
--field-control-size-height: 32px;
|
|
1908
1909
|
--field-input-padding-inline-start: var(--kbq-size-m);
|
|
1909
1910
|
--field-input-padding-inline-end: var(--kbq-size-m);
|
|
1910
1911
|
--field-input-padding-block-start: var(--kbq-size-xs);
|
|
@@ -1962,28 +1963,85 @@
|
|
|
1962
1963
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
1963
1964
|
position: relative;
|
|
1964
1965
|
}
|
|
1965
|
-
.kbq-
|
|
1966
|
+
.kbq-fieldcontentgroup-d85be3 {
|
|
1967
|
+
--field-content-border-color: ;
|
|
1968
|
+
--field-content-outline-width: 2px;
|
|
1969
|
+
--field-content-outline-color: transparent;
|
|
1970
|
+
--field-content-border-radius: var(--kbq-size-s);
|
|
1971
|
+
--field-content-border-width: var(--kbq-size-border-width);
|
|
1966
1972
|
--field-input-padding-inline-start: var(--field-control-start-addon-inline-size, var(--kbq-size-m));
|
|
1967
1973
|
--field-input-padding-inline-end: var(--field-control-end-addon-inline-size, var(--kbq-size-m));
|
|
1968
1974
|
--field-input-padding-block-start: var(--kbq-size-xs);
|
|
1969
1975
|
--field-input-padding-block-end: var(--kbq-size-xs);
|
|
1976
|
+
border-radius: var(--field-content-border-radius);
|
|
1970
1977
|
inline-size: 100%;
|
|
1971
1978
|
display: flex;
|
|
1972
1979
|
position: relative;
|
|
1973
1980
|
}
|
|
1974
1981
|
|
|
1975
|
-
.kbq-
|
|
1982
|
+
.kbq-fieldcontentgroup-d85be3:before {
|
|
1983
|
+
content: "";
|
|
1984
|
+
pointer-events: none;
|
|
1985
|
+
border-radius: inherit;
|
|
1986
|
+
z-index: var(--kbq-layer-absolute);
|
|
1987
|
+
transition: border-color var(--kbq-transition-default);
|
|
1988
|
+
border: var(--field-content-border-width) solid var(--field-content-border-color, transparent);
|
|
1989
|
+
position: absolute;
|
|
1990
|
+
inset: 0;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
.kbq-fieldcontentgroup-d85be3:after {
|
|
1994
|
+
content: "";
|
|
1995
|
+
pointer-events: none;
|
|
1996
|
+
border-radius: inherit;
|
|
1997
|
+
z-index: var(--kbq-layer-absolute);
|
|
1998
|
+
transition: outline-color var(--kbq-transition-default);
|
|
1999
|
+
outline-offset: calc(-1 * var(--field-content-outline-width) / 2);
|
|
2000
|
+
outline: var(--field-content-outline-width) solid var(--field-content-outline-color);
|
|
2001
|
+
position: absolute;
|
|
2002
|
+
inset: 0;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
.kbq-fieldcontentgroup-hasStartAddon-62fb80 {
|
|
1976
2006
|
--field-control-start-addon-inline-size: 36px;
|
|
1977
2007
|
}
|
|
1978
2008
|
|
|
1979
|
-
.kbq-
|
|
2009
|
+
.kbq-fieldcontentgroup-hasEndAddon-e8c20a {
|
|
1980
2010
|
--field-control-end-addon-inline-size: 36px;
|
|
1981
2011
|
}
|
|
2012
|
+
|
|
2013
|
+
.kbq-fieldcontentgroup-transparent-ac42b6 {
|
|
2014
|
+
--field-content-border-color: transparent;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
.kbq-fieldcontentgroup-filled-37bb93 {
|
|
2018
|
+
--field-content-border-color: var(--kbq-line-contrast-fade);
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
.kbq-fieldcontentgroup-filled-37bb93:focus-within {
|
|
2022
|
+
--field-content-outline-color: var(--kbq-states-line-focus-theme);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-invalid-e4973b) {
|
|
2026
|
+
--field-content-border-color: var(--kbq-line-error);
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-invalid-e4973b):focus-within {
|
|
2030
|
+
--field-content-outline-color: var(--field-content-border-color);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
.kbq-fieldcontentgroup-transparent-ac42b6:where(.kbq-fieldcontentgroup-invalid-e4973b) {
|
|
2034
|
+
--field-content-border-color: transparent;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-disabled-54827b) {
|
|
2038
|
+
--field-content-border-color: var(--kbq-states-line-disabled);
|
|
2039
|
+
}
|
|
1982
2040
|
.kbq-fieldaddon-3388d3 {
|
|
1983
2041
|
--field-addon-color: var(--kbq-icon-contrast-fade);
|
|
1984
2042
|
z-index: 1;
|
|
1985
|
-
block-size: 100%;
|
|
1986
2043
|
color: var(--field-addon-color);
|
|
2044
|
+
block-size: var(--field-control-size-height);
|
|
1987
2045
|
transition: color var(--kbq-transition-default);
|
|
1988
2046
|
justify-content: center;
|
|
1989
2047
|
align-items: center;
|
|
@@ -2010,10 +2068,15 @@
|
|
|
2010
2068
|
.kbq-fieldinput-77b90b {
|
|
2011
2069
|
--field-input-color: ;
|
|
2012
2070
|
--field-input-bg-color: ;
|
|
2013
|
-
--field-input-border-color: ;
|
|
2014
|
-
--field-input-outline-color: ;
|
|
2015
2071
|
--field-input-placeholder-color: ;
|
|
2016
|
-
|
|
2072
|
+
box-sizing: border-box;
|
|
2073
|
+
border-radius: inherit;
|
|
2074
|
+
inline-size: 100%;
|
|
2075
|
+
color: var(--field-input-color);
|
|
2076
|
+
background: var(--field-input-bg-color);
|
|
2077
|
+
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
2078
|
+
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
2079
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
2017
2080
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
2018
2081
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
2019
2082
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -2023,17 +2086,8 @@
|
|
|
2023
2086
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
2024
2087
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
2025
2088
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
background: var(--field-input-bg-color);
|
|
2029
|
-
inline-size: 100%;
|
|
2030
|
-
color: var(--field-input-color);
|
|
2031
|
-
outline: var(--field-input-outline-width) solid transparent;
|
|
2032
|
-
outline-offset: -1px;
|
|
2033
|
-
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
2034
|
-
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
2035
|
-
border: 1px solid var(--field-input-border-color);
|
|
2036
|
-
transition: color var(--kbq-transition-default), outline-color var(--kbq-transition-default), background-color var(--kbq-transition-default), border-color var(--kbq-transition-default);
|
|
2089
|
+
border: none;
|
|
2090
|
+
outline: none;
|
|
2037
2091
|
}
|
|
2038
2092
|
|
|
2039
2093
|
.kbq-fieldinput-77b90b:-webkit-autofill {
|
|
@@ -2045,47 +2099,35 @@
|
|
|
2045
2099
|
color: var(--field-input-placeholder-color);
|
|
2046
2100
|
}
|
|
2047
2101
|
|
|
2048
|
-
.kbq-fieldinput-77b90b:focus {
|
|
2049
|
-
outline-color: var(--field-input-outline-color);
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
2102
|
.kbq-fieldinput-77b90b:where(input) {
|
|
2053
|
-
block-size: var(--
|
|
2103
|
+
block-size: var(--field-control-size-height);
|
|
2054
2104
|
}
|
|
2055
2105
|
|
|
2056
2106
|
.kbq-fieldinput-77b90b:where(textarea) {
|
|
2057
|
-
min-block-size: var(--
|
|
2107
|
+
min-block-size: var(--field-control-size-height);
|
|
2058
2108
|
resize: none;
|
|
2059
2109
|
}
|
|
2060
2110
|
|
|
2061
2111
|
.kbq-fieldinput-transparent-ed7263 {
|
|
2062
2112
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
2063
|
-
--field-input-border-color: transparent;
|
|
2064
|
-
--field-input-outline-color: transparent;
|
|
2065
2113
|
--field-input-bg-color: transparent;
|
|
2066
2114
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
2067
2115
|
}
|
|
2068
2116
|
|
|
2069
2117
|
.kbq-fieldinput-filled-abb632 {
|
|
2070
2118
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
2071
|
-
--field-input-border-color: var(--kbq-line-contrast-fade);
|
|
2072
|
-
--field-input-outline-color: var(--kbq-states-line-focus-theme);
|
|
2073
2119
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
2074
2120
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
2075
2121
|
}
|
|
2076
2122
|
|
|
2077
2123
|
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2078
2124
|
--field-input-color: var(--kbq-foreground-error);
|
|
2079
|
-
--field-input-border-color: var(--kbq-line-error);
|
|
2080
|
-
--field-input-outline-color: var(--kbq-states-line-focus-error);
|
|
2081
2125
|
--field-input-bg-color: var(--kbq-states-background-error-less);
|
|
2082
2126
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
2083
2127
|
}
|
|
2084
2128
|
|
|
2085
2129
|
.kbq-fieldinput-transparent-ed7263:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2086
2130
|
--field-input-color: var(--kbq-foreground-error);
|
|
2087
|
-
--field-input-border-color: transparent;
|
|
2088
|
-
--field-input-outline-color: transparent;
|
|
2089
2131
|
--field-input-bg-color: transparent;
|
|
2090
2132
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
2091
2133
|
}
|
|
@@ -2096,7 +2138,6 @@
|
|
|
2096
2138
|
|
|
2097
2139
|
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-disabled-59285a) {
|
|
2098
2140
|
--field-input-color: var(--kbq-states-foreground-disabled);
|
|
2099
|
-
--field-input-border-color: var(--kbq-states-line-disabled);
|
|
2100
2141
|
--field-input-bg-color: var(--kbq-states-background-disabled);
|
|
2101
2142
|
}
|
|
2102
2143
|
|
|
@@ -3084,38 +3125,20 @@
|
|
|
3084
3125
|
transform: translateY(-8px);
|
|
3085
3126
|
}
|
|
3086
3127
|
.kbq-fieldselect-0f0f5e {
|
|
3087
|
-
--field-input-outline-width: var(--kbq-size-3xs);
|
|
3088
3128
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
3089
|
-
--field-input-border-color: var(--kbq-line-contrast-fade);
|
|
3090
|
-
--field-input-outline-color: var(--kbq-states-line-focus-theme);
|
|
3091
3129
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3092
3130
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3131
|
+
gap: var(--kbq-size-s);
|
|
3093
3132
|
cursor: pointer;
|
|
3094
|
-
outline-offset: -1px;
|
|
3095
3133
|
box-sizing: border-box;
|
|
3096
|
-
border-radius:
|
|
3097
|
-
block-size: 32px;
|
|
3134
|
+
border-radius: inherit;
|
|
3098
3135
|
inline-size: 100%;
|
|
3099
3136
|
color: var(--field-input-color);
|
|
3100
3137
|
background: var(--field-input-bg-color);
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
3138
|
+
min-block-size: var(--field-control-size-height);
|
|
3139
|
+
padding-block: 0;
|
|
3104
3140
|
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
3105
|
-
transition: color var(--kbq-transition-default),
|
|
3106
|
-
align-items: center;
|
|
3107
|
-
display: flex;
|
|
3108
|
-
}
|
|
3109
|
-
|
|
3110
|
-
.kbq-fieldselect-0f0f5e:focus {
|
|
3111
|
-
outline-color: var(--field-input-outline-color);
|
|
3112
|
-
}
|
|
3113
|
-
|
|
3114
|
-
.kbq-fieldselect-content-c36142 {
|
|
3115
|
-
white-space: nowrap;
|
|
3116
|
-
align-items: center;
|
|
3117
|
-
gap: var(--kbq-size-s);
|
|
3118
|
-
text-overflow: ellipsis;
|
|
3141
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
3119
3142
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
3120
3143
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
3121
3144
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -3125,21 +3148,27 @@
|
|
|
3125
3148
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
3126
3149
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
3127
3150
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
3151
|
+
border: none;
|
|
3152
|
+
outline: none;
|
|
3153
|
+
align-items: center;
|
|
3128
3154
|
display: flex;
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
.kbq-fieldselect-content-c36142 {
|
|
3158
|
+
text-align: start;
|
|
3159
|
+
white-space: nowrap;
|
|
3160
|
+
text-overflow: ellipsis;
|
|
3129
3161
|
overflow: hidden;
|
|
3130
3162
|
}
|
|
3131
3163
|
|
|
3132
3164
|
.kbq-fieldselect-invalid-db8152 {
|
|
3133
3165
|
--field-input-color: var(--kbq-foreground-error);
|
|
3134
|
-
--field-input-border-color: var(--kbq-line-error);
|
|
3135
|
-
--field-input-outline-color: var(--kbq-states-line-focus-error);
|
|
3136
3166
|
--field-input-bg-color: var(--kbq-states-background-error-less);
|
|
3137
3167
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
3138
3168
|
}
|
|
3139
3169
|
|
|
3140
3170
|
.kbq-fieldselect-disabled-f0efd4 {
|
|
3141
3171
|
--field-input-color: var(--kbq-states-foreground-disabled);
|
|
3142
|
-
--field-input-border-color: var(--kbq-states-line-disabled);
|
|
3143
3172
|
--field-input-bg-color: var(--kbq-states-background-disabled);
|
|
3144
3173
|
cursor: not-allowed;
|
|
3145
3174
|
}
|
|
@@ -3356,7 +3385,7 @@
|
|
|
3356
3385
|
overflow: hidden;
|
|
3357
3386
|
}
|
|
3358
3387
|
.kbq-taggroup-20136b {
|
|
3359
|
-
gap: var(--kbq-size-
|
|
3388
|
+
gap: var(--kbq-size-xxs);
|
|
3360
3389
|
flex-wrap: wrap;
|
|
3361
3390
|
display: flex;
|
|
3362
3391
|
}
|
|
@@ -3382,6 +3411,7 @@
|
|
|
3382
3411
|
padding-inline: var(--kbq-size-xxs);
|
|
3383
3412
|
min-inline-size: var(--kbq-size-xxl);
|
|
3384
3413
|
background-color: var(--tag-bg-color);
|
|
3414
|
+
outline-offset: calc(-1 * var(--tag-outline-width) / 2);
|
|
3385
3415
|
outline: var(--tag-outline-width) solid var(--tag-outline-color);
|
|
3386
3416
|
transition: outline-color var(--kbq-transition-default), background-color var(--kbq-transition-default), color var(--kbq-transition-default);
|
|
3387
3417
|
border: none;
|
|
@@ -3782,24 +3812,19 @@
|
|
|
3782
3812
|
min-inline-size: 150px;
|
|
3783
3813
|
}
|
|
3784
3814
|
.kbq-fieldinputdate-a54331 {
|
|
3785
|
-
--field-input-outline-width: var(--kbq-size-3xs);
|
|
3786
3815
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
3787
|
-
--field-input-border-color: var(--kbq-line-contrast-fade);
|
|
3788
|
-
--field-input-outline-color: var(--kbq-states-line-focus-theme);
|
|
3789
3816
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3790
3817
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3791
3818
|
cursor: pointer;
|
|
3792
|
-
outline-offset: -1px;
|
|
3793
3819
|
box-sizing: border-box;
|
|
3794
3820
|
inline-size: 100%;
|
|
3795
|
-
block-size: var(--
|
|
3796
|
-
border-radius:
|
|
3821
|
+
block-size: var(--field-control-size-height);
|
|
3822
|
+
border-radius: inherit;
|
|
3797
3823
|
color: var(--field-input-color);
|
|
3798
3824
|
background: var(--field-input-bg-color);
|
|
3799
|
-
border: 1px solid var(--field-input-border-color);
|
|
3800
|
-
outline: var(--field-input-outline-width) solid transparent;
|
|
3801
3825
|
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
3802
3826
|
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
3827
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
3803
3828
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
3804
3829
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
3805
3830
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -3809,43 +3834,30 @@
|
|
|
3809
3834
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
3810
3835
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
3811
3836
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
3812
|
-
transition: color var(--kbq-transition-default), outline-color var(--kbq-transition-default), background-color var(--kbq-transition-default), border-color var(--kbq-transition-default);
|
|
3813
3837
|
align-items: center;
|
|
3814
3838
|
display: flex;
|
|
3815
3839
|
}
|
|
3816
3840
|
|
|
3817
|
-
.kbq-fieldinputdate-a54331:focus-within {
|
|
3818
|
-
outline-color: var(--field-input-outline-color);
|
|
3819
|
-
}
|
|
3820
|
-
|
|
3821
3841
|
.kbq-fieldinputdate-transparent-04d912 {
|
|
3822
3842
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
3823
|
-
--field-input-border-color: transparent;
|
|
3824
|
-
--field-input-outline-color: transparent;
|
|
3825
3843
|
--field-input-bg-color: transparent;
|
|
3826
3844
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3827
3845
|
}
|
|
3828
3846
|
|
|
3829
3847
|
.kbq-fieldinputdate-filled-02db7d {
|
|
3830
3848
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
3831
|
-
--field-input-border-color: var(--kbq-line-contrast-fade);
|
|
3832
|
-
--field-input-outline-color: var(--kbq-states-line-focus-theme);
|
|
3833
3849
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3834
3850
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3835
3851
|
}
|
|
3836
3852
|
|
|
3837
3853
|
.kbq-fieldinputdate-filled-02db7d:where(.kbq-fieldinputdate-invalid-d764c6) {
|
|
3838
3854
|
--field-input-color: var(--kbq-foreground-error);
|
|
3839
|
-
--field-input-border-color: var(--kbq-line-error);
|
|
3840
|
-
--field-input-outline-color: var(--kbq-states-line-focus-error);
|
|
3841
3855
|
--field-input-bg-color: var(--kbq-states-background-error-less);
|
|
3842
3856
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
3843
3857
|
}
|
|
3844
3858
|
|
|
3845
3859
|
.kbq-fieldinputdate-transparent-04d912:where(.kbq-fieldinputdate-invalid-d764c6) {
|
|
3846
3860
|
--field-input-color: var(--kbq-foreground-error);
|
|
3847
|
-
--field-input-border-color: transparent;
|
|
3848
|
-
--field-input-outline-color: transparent;
|
|
3849
3861
|
--field-input-bg-color: transparent;
|
|
3850
3862
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
3851
3863
|
}
|
|
@@ -3856,7 +3868,6 @@
|
|
|
3856
3868
|
|
|
3857
3869
|
.kbq-fieldinputdate-filled-02db7d:where(.kbq-fieldinputdate-disabled-692832) {
|
|
3858
3870
|
--field-input-color: var(--kbq-states-foreground-disabled);
|
|
3859
|
-
--field-input-border-color: var(--kbq-states-line-disabled);
|
|
3860
3871
|
--field-input-bg-color: var(--kbq-states-background-disabled);
|
|
3861
3872
|
}
|
|
3862
3873
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@koobiq/design-tokens": "^3.14.0",
|
|
29
29
|
"@types/react-transition-group": "^4.4.12",
|
|
30
30
|
"react-transition-group": "^4.4.5",
|
|
31
|
-
"@koobiq/
|
|
32
|
-
"@koobiq/react-icons": "0.
|
|
33
|
-
"@koobiq/react-
|
|
34
|
-
"@koobiq/
|
|
31
|
+
"@koobiq/react-core": "0.2.0",
|
|
32
|
+
"@koobiq/react-icons": "0.2.0",
|
|
33
|
+
"@koobiq/react-primitives": "0.2.0",
|
|
34
|
+
"@koobiq/logger": "0.2.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@koobiq/design-tokens": "^3.14.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type ExtendableComponentPropsWithRef } from '@koobiq/react-core';
|
|
3
|
-
import { type FieldAddonProps } from '../FieldAddon';
|
|
4
|
-
export type FieldInputGroupProps = ExtendableComponentPropsWithRef<{
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
startAddon?: ReactNode;
|
|
7
|
-
endAddon?: ReactNode;
|
|
8
|
-
isDisabled?: boolean;
|
|
9
|
-
className?: string;
|
|
10
|
-
isInvalid?: boolean;
|
|
11
|
-
/** The props used for each slot inside. */
|
|
12
|
-
slotProps?: {
|
|
13
|
-
start?: FieldAddonProps;
|
|
14
|
-
end?: FieldAddonProps;
|
|
15
|
-
};
|
|
16
|
-
}, 'div'>;
|
|
17
|
-
export declare const FieldInputGroup: import("react").ForwardRefExoticComponent<Omit<FieldInputGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { isNotNil, clsx } from "@koobiq/react-core";
|
|
4
|
-
import { useInputContext, Group } from "@koobiq/react-primitives";
|
|
5
|
-
import s from "./FieldInputGroup.module.css.js";
|
|
6
|
-
import { FieldInputGroupContext } from "./FieldInputGroupContext.js";
|
|
7
|
-
import { FieldAddon } from "../FieldAddon/FieldAddon.js";
|
|
8
|
-
const FieldInputGroup = forwardRef(({ children, className, startAddon, endAddon, slotProps, ...other }, ref) => {
|
|
9
|
-
const { value } = useInputContext();
|
|
10
|
-
const hasStartAddon = !!startAddon;
|
|
11
|
-
const hasEndAddon = !!endAddon;
|
|
12
|
-
const hasValue = isNotNil(value);
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
Group,
|
|
15
|
-
{
|
|
16
|
-
className: clsx(
|
|
17
|
-
s.base,
|
|
18
|
-
hasStartAddon && s.hasStartAddon,
|
|
19
|
-
hasEndAddon && s.hasEndAddon,
|
|
20
|
-
className
|
|
21
|
-
),
|
|
22
|
-
...other,
|
|
23
|
-
ref,
|
|
24
|
-
children: ({ isHovered, isFocusWithin, isDisabled, isInvalid }) => /* @__PURE__ */ jsxs(
|
|
25
|
-
FieldInputGroupContext.Provider,
|
|
26
|
-
{
|
|
27
|
-
value: {
|
|
28
|
-
isDisabled,
|
|
29
|
-
isHovered,
|
|
30
|
-
hasValue,
|
|
31
|
-
isFocusWithin,
|
|
32
|
-
isInvalid
|
|
33
|
-
},
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ jsx(
|
|
36
|
-
FieldAddon,
|
|
37
|
-
{
|
|
38
|
-
placement: "start",
|
|
39
|
-
isInvalid,
|
|
40
|
-
isDisabled,
|
|
41
|
-
...slotProps?.start,
|
|
42
|
-
children: startAddon
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
children,
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
FieldAddon,
|
|
48
|
-
{
|
|
49
|
-
placement: "end",
|
|
50
|
-
isInvalid,
|
|
51
|
-
isDisabled,
|
|
52
|
-
...slotProps?.end,
|
|
53
|
-
children: endAddon
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
FieldInputGroup.displayName = "FieldInputGroup";
|
|
63
|
-
export {
|
|
64
|
-
FieldInputGroup
|
|
65
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const base = "kbq-fieldinputgroup-5d33da";
|
|
2
|
-
const hasStartAddon = "kbq-fieldinputgroup-hasStartAddon-5f5b14";
|
|
3
|
-
const hasEndAddon = "kbq-fieldinputgroup-hasEndAddon-7781d1";
|
|
4
|
-
const s = {
|
|
5
|
-
base,
|
|
6
|
-
hasStartAddon,
|
|
7
|
-
hasEndAddon
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
base,
|
|
11
|
-
s as default,
|
|
12
|
-
hasEndAddon,
|
|
13
|
-
hasStartAddon
|
|
14
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type FieldInputGroupContextProps = {
|
|
2
|
-
isDisabled?: boolean;
|
|
3
|
-
hasValue?: boolean;
|
|
4
|
-
isHovered?: boolean;
|
|
5
|
-
isFocusWithin?: boolean;
|
|
6
|
-
isInvalid?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const FieldInputGroupContext: import("react").Context<FieldInputGroupContextProps>;
|
|
9
|
-
export declare const useFieldInputGroup: () => FieldInputGroupContextProps;
|