@koobiq/react-components 0.1.1 → 0.1.2
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/index.d.ts +1 -1
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/InputNumber/InputNumber.js +3 -2
- package/dist/components/InputNumber/components/InputNumberCounterControls.js +1 -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 +88 -78
- 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'>;
|
|
@@ -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
|
] });
|
|
@@ -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();
|
|
@@ -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
|
@@ -1962,23 +1962,80 @@
|
|
|
1962
1962
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
1963
1963
|
position: relative;
|
|
1964
1964
|
}
|
|
1965
|
-
.kbq-
|
|
1965
|
+
.kbq-fieldcontentgroup-d85be3 {
|
|
1966
|
+
--field-content-border-color: ;
|
|
1967
|
+
--field-content-outline-width: 2px;
|
|
1968
|
+
--field-content-outline-color: transparent;
|
|
1969
|
+
--field-content-border-radius: var(--kbq-size-s);
|
|
1970
|
+
--field-content-border-width: var(--kbq-size-border-width);
|
|
1966
1971
|
--field-input-padding-inline-start: var(--field-control-start-addon-inline-size, var(--kbq-size-m));
|
|
1967
1972
|
--field-input-padding-inline-end: var(--field-control-end-addon-inline-size, var(--kbq-size-m));
|
|
1968
1973
|
--field-input-padding-block-start: var(--kbq-size-xs);
|
|
1969
1974
|
--field-input-padding-block-end: var(--kbq-size-xs);
|
|
1975
|
+
border-radius: var(--field-content-border-radius);
|
|
1970
1976
|
inline-size: 100%;
|
|
1971
1977
|
display: flex;
|
|
1972
1978
|
position: relative;
|
|
1973
1979
|
}
|
|
1974
1980
|
|
|
1975
|
-
.kbq-
|
|
1981
|
+
.kbq-fieldcontentgroup-d85be3:before {
|
|
1982
|
+
content: "";
|
|
1983
|
+
pointer-events: none;
|
|
1984
|
+
border-radius: inherit;
|
|
1985
|
+
z-index: var(--kbq-layer-absolute);
|
|
1986
|
+
transition: border-color var(--kbq-transition-default);
|
|
1987
|
+
border: var(--field-content-border-width) solid var(--field-content-border-color, transparent);
|
|
1988
|
+
position: absolute;
|
|
1989
|
+
inset: 0;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
.kbq-fieldcontentgroup-d85be3:after {
|
|
1993
|
+
content: "";
|
|
1994
|
+
pointer-events: none;
|
|
1995
|
+
border-radius: inherit;
|
|
1996
|
+
z-index: var(--kbq-layer-absolute);
|
|
1997
|
+
transition: outline-color var(--kbq-transition-default);
|
|
1998
|
+
outline-offset: calc(-1 * var(--field-content-outline-width) / 2);
|
|
1999
|
+
outline: var(--field-content-outline-width) solid var(--field-content-outline-color);
|
|
2000
|
+
position: absolute;
|
|
2001
|
+
inset: 0;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
.kbq-fieldcontentgroup-hasStartAddon-62fb80 {
|
|
1976
2005
|
--field-control-start-addon-inline-size: 36px;
|
|
1977
2006
|
}
|
|
1978
2007
|
|
|
1979
|
-
.kbq-
|
|
2008
|
+
.kbq-fieldcontentgroup-hasEndAddon-e8c20a {
|
|
1980
2009
|
--field-control-end-addon-inline-size: 36px;
|
|
1981
2010
|
}
|
|
2011
|
+
|
|
2012
|
+
.kbq-fieldcontentgroup-transparent-ac42b6 {
|
|
2013
|
+
--field-content-border-color: transparent;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
.kbq-fieldcontentgroup-filled-37bb93 {
|
|
2017
|
+
--field-content-border-color: var(--kbq-line-contrast-fade);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
.kbq-fieldcontentgroup-filled-37bb93:focus-within {
|
|
2021
|
+
--field-content-outline-color: var(--kbq-states-line-focus-theme);
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-invalid-e4973b) {
|
|
2025
|
+
--field-content-border-color: var(--kbq-line-error);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-invalid-e4973b):focus-within {
|
|
2029
|
+
--field-content-outline-color: var(--field-content-border-color);
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
.kbq-fieldcontentgroup-transparent-ac42b6:where(.kbq-fieldcontentgroup-invalid-e4973b) {
|
|
2033
|
+
--field-content-border-color: transparent;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
.kbq-fieldcontentgroup-filled-37bb93:where(.kbq-fieldcontentgroup-disabled-54827b) {
|
|
2037
|
+
--field-content-border-color: var(--kbq-states-line-disabled);
|
|
2038
|
+
}
|
|
1982
2039
|
.kbq-fieldaddon-3388d3 {
|
|
1983
2040
|
--field-addon-color: var(--kbq-icon-contrast-fade);
|
|
1984
2041
|
z-index: 1;
|
|
@@ -2010,10 +2067,15 @@
|
|
|
2010
2067
|
.kbq-fieldinput-77b90b {
|
|
2011
2068
|
--field-input-color: ;
|
|
2012
2069
|
--field-input-bg-color: ;
|
|
2013
|
-
--field-input-border-color: ;
|
|
2014
|
-
--field-input-outline-color: ;
|
|
2015
2070
|
--field-input-placeholder-color: ;
|
|
2016
|
-
|
|
2071
|
+
box-sizing: border-box;
|
|
2072
|
+
border-radius: inherit;
|
|
2073
|
+
inline-size: 100%;
|
|
2074
|
+
color: var(--field-input-color);
|
|
2075
|
+
background: var(--field-input-bg-color);
|
|
2076
|
+
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
2077
|
+
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
2078
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
2017
2079
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
2018
2080
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
2019
2081
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -2023,17 +2085,8 @@
|
|
|
2023
2085
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
2024
2086
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
2025
2087
|
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);
|
|
2088
|
+
border: none;
|
|
2089
|
+
outline: none;
|
|
2037
2090
|
}
|
|
2038
2091
|
|
|
2039
2092
|
.kbq-fieldinput-77b90b:-webkit-autofill {
|
|
@@ -2045,10 +2098,6 @@
|
|
|
2045
2098
|
color: var(--field-input-placeholder-color);
|
|
2046
2099
|
}
|
|
2047
2100
|
|
|
2048
|
-
.kbq-fieldinput-77b90b:focus {
|
|
2049
|
-
outline-color: var(--field-input-outline-color);
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
2101
|
.kbq-fieldinput-77b90b:where(input) {
|
|
2053
2102
|
block-size: var(--kbq-size-3xl);
|
|
2054
2103
|
}
|
|
@@ -2060,32 +2109,24 @@
|
|
|
2060
2109
|
|
|
2061
2110
|
.kbq-fieldinput-transparent-ed7263 {
|
|
2062
2111
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
2063
|
-
--field-input-border-color: transparent;
|
|
2064
|
-
--field-input-outline-color: transparent;
|
|
2065
2112
|
--field-input-bg-color: transparent;
|
|
2066
2113
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
2067
2114
|
}
|
|
2068
2115
|
|
|
2069
2116
|
.kbq-fieldinput-filled-abb632 {
|
|
2070
2117
|
--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
2118
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
2074
2119
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
2075
2120
|
}
|
|
2076
2121
|
|
|
2077
2122
|
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2078
2123
|
--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
2124
|
--field-input-bg-color: var(--kbq-states-background-error-less);
|
|
2082
2125
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
2083
2126
|
}
|
|
2084
2127
|
|
|
2085
2128
|
.kbq-fieldinput-transparent-ed7263:where(.kbq-fieldinput-invalid-2af82b) {
|
|
2086
2129
|
--field-input-color: var(--kbq-foreground-error);
|
|
2087
|
-
--field-input-border-color: transparent;
|
|
2088
|
-
--field-input-outline-color: transparent;
|
|
2089
2130
|
--field-input-bg-color: transparent;
|
|
2090
2131
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
2091
2132
|
}
|
|
@@ -2096,7 +2137,6 @@
|
|
|
2096
2137
|
|
|
2097
2138
|
.kbq-fieldinput-filled-abb632:where(.kbq-fieldinput-disabled-59285a) {
|
|
2098
2139
|
--field-input-color: var(--kbq-states-foreground-disabled);
|
|
2099
|
-
--field-input-border-color: var(--kbq-states-line-disabled);
|
|
2100
2140
|
--field-input-bg-color: var(--kbq-states-background-disabled);
|
|
2101
2141
|
}
|
|
2102
2142
|
|
|
@@ -3084,38 +3124,19 @@
|
|
|
3084
3124
|
transform: translateY(-8px);
|
|
3085
3125
|
}
|
|
3086
3126
|
.kbq-fieldselect-0f0f5e {
|
|
3087
|
-
--field-input-outline-width: var(--kbq-size-3xs);
|
|
3088
3127
|
--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
3128
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3092
3129
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3093
3130
|
cursor: pointer;
|
|
3094
|
-
outline-offset: -1px;
|
|
3095
3131
|
box-sizing: border-box;
|
|
3096
|
-
border-radius:
|
|
3097
|
-
block-size: 32px;
|
|
3132
|
+
border-radius: inherit;
|
|
3133
|
+
min-block-size: 32px;
|
|
3098
3134
|
inline-size: 100%;
|
|
3099
3135
|
color: var(--field-input-color);
|
|
3100
3136
|
background: var(--field-input-bg-color);
|
|
3101
|
-
|
|
3102
|
-
outline: var(--field-input-outline-width) solid transparent;
|
|
3103
|
-
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
3137
|
+
padding-block: 0;
|
|
3104
3138
|
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;
|
|
3139
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
3119
3140
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
3120
3141
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
3121
3142
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -3125,21 +3146,29 @@
|
|
|
3125
3146
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
3126
3147
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
3127
3148
|
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
3149
|
+
border: none;
|
|
3150
|
+
outline: none;
|
|
3151
|
+
align-items: center;
|
|
3152
|
+
display: flex;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
.kbq-fieldselect-content-c36142 {
|
|
3156
|
+
white-space: nowrap;
|
|
3157
|
+
align-items: center;
|
|
3158
|
+
gap: var(--kbq-size-s);
|
|
3159
|
+
text-overflow: ellipsis;
|
|
3128
3160
|
display: flex;
|
|
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
|
}
|
|
@@ -3782,24 +3811,19 @@
|
|
|
3782
3811
|
min-inline-size: 150px;
|
|
3783
3812
|
}
|
|
3784
3813
|
.kbq-fieldinputdate-a54331 {
|
|
3785
|
-
--field-input-outline-width: var(--kbq-size-3xs);
|
|
3786
3814
|
--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
3815
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3790
3816
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3791
3817
|
cursor: pointer;
|
|
3792
|
-
outline-offset: -1px;
|
|
3793
3818
|
box-sizing: border-box;
|
|
3794
3819
|
inline-size: 100%;
|
|
3795
3820
|
block-size: var(--kbq-size-3xl);
|
|
3796
|
-
border-radius:
|
|
3821
|
+
border-radius: inherit;
|
|
3797
3822
|
color: var(--field-input-color);
|
|
3798
3823
|
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
3824
|
padding-block: var(--field-input-padding-block-start) var(--field-input-padding-block-end);
|
|
3802
3825
|
padding-inline: var(--field-input-padding-inline-start) var(--field-input-padding-inline-end);
|
|
3826
|
+
transition: color var(--kbq-transition-default), background-color var(--kbq-transition-default);
|
|
3803
3827
|
font-size: var(--kbq-typography-text-normal-font-size);
|
|
3804
3828
|
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
3805
3829
|
line-height: var(--kbq-typography-text-normal-line-height);
|
|
@@ -3809,43 +3833,30 @@
|
|
|
3809
3833
|
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
3810
3834
|
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
3811
3835
|
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
3836
|
align-items: center;
|
|
3814
3837
|
display: flex;
|
|
3815
3838
|
}
|
|
3816
3839
|
|
|
3817
|
-
.kbq-fieldinputdate-a54331:focus-within {
|
|
3818
|
-
outline-color: var(--field-input-outline-color);
|
|
3819
|
-
}
|
|
3820
|
-
|
|
3821
3840
|
.kbq-fieldinputdate-transparent-04d912 {
|
|
3822
3841
|
--field-input-color: var(--kbq-foreground-contrast);
|
|
3823
|
-
--field-input-border-color: transparent;
|
|
3824
|
-
--field-input-outline-color: transparent;
|
|
3825
3842
|
--field-input-bg-color: transparent;
|
|
3826
3843
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3827
3844
|
}
|
|
3828
3845
|
|
|
3829
3846
|
.kbq-fieldinputdate-filled-02db7d {
|
|
3830
3847
|
--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
3848
|
--field-input-bg-color: var(--kbq-background-bg);
|
|
3834
3849
|
--field-input-placeholder-color: var(--kbq-foreground-contrast-tertiary);
|
|
3835
3850
|
}
|
|
3836
3851
|
|
|
3837
3852
|
.kbq-fieldinputdate-filled-02db7d:where(.kbq-fieldinputdate-invalid-d764c6) {
|
|
3838
3853
|
--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
3854
|
--field-input-bg-color: var(--kbq-states-background-error-less);
|
|
3842
3855
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
3843
3856
|
}
|
|
3844
3857
|
|
|
3845
3858
|
.kbq-fieldinputdate-transparent-04d912:where(.kbq-fieldinputdate-invalid-d764c6) {
|
|
3846
3859
|
--field-input-color: var(--kbq-foreground-error);
|
|
3847
|
-
--field-input-border-color: transparent;
|
|
3848
|
-
--field-input-outline-color: transparent;
|
|
3849
3860
|
--field-input-bg-color: transparent;
|
|
3850
3861
|
--field-input-placeholder-color: var(--kbq-foreground-error-tertiary);
|
|
3851
3862
|
}
|
|
@@ -3856,7 +3867,6 @@
|
|
|
3856
3867
|
|
|
3857
3868
|
.kbq-fieldinputdate-filled-02db7d:where(.kbq-fieldinputdate-disabled-692832) {
|
|
3858
3869
|
--field-input-color: var(--kbq-states-foreground-disabled);
|
|
3859
|
-
--field-input-border-color: var(--kbq-states-line-disabled);
|
|
3860
3870
|
--field-input-bg-color: var(--kbq-states-background-disabled);
|
|
3861
3871
|
}
|
|
3862
3872
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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/logger": "0.1.
|
|
32
|
-
"@koobiq/react-icons": "0.1.
|
|
33
|
-
"@koobiq/react-
|
|
34
|
-
"@koobiq/react-
|
|
31
|
+
"@koobiq/logger": "0.1.2",
|
|
32
|
+
"@koobiq/react-icons": "0.1.2",
|
|
33
|
+
"@koobiq/react-primitives": "0.1.2",
|
|
34
|
+
"@koobiq/react-core": "0.1.2"
|
|
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;
|