@kalink-ui/seedly 0.31.0 → 0.32.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/components/form-field/form-field-item.tsx +8 -1
- package/src/components/select/index.ts +1 -0
- package/src/components/select/select.css.ts +3 -0
- package/src/components/select/select.tsx +5 -1
- package/src/components/text-field/index.ts +1 -0
- package/src/components/text-field/text-field.tsx +6 -1
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.css.ts +2 -0
- package/src/components/textarea/textarea.tsx +3 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { PolymorphicComponentProps } from '@kalink-ui/dibbly';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
4
5
|
import { ElementType, useId } from 'react';
|
|
5
6
|
|
|
6
7
|
import { useFormFieldContext } from './form-field-context';
|
|
@@ -20,7 +21,13 @@ export function FormFieldItem<TUse extends ElementType = 'div'>(
|
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<FormFieldItemContextProvider value={{ id }}>
|
|
23
|
-
<Comp
|
|
24
|
+
<Comp
|
|
25
|
+
className={clsx(
|
|
26
|
+
formFieldStyle({ error: !!errors, disabled }),
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...rest}
|
|
30
|
+
>
|
|
24
31
|
{children}
|
|
25
32
|
</Comp>
|
|
26
33
|
</FormFieldItemContextProvider>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Value } from '@radix-ui/react-select';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
2
3
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
3
4
|
|
|
4
5
|
import {
|
|
@@ -14,6 +15,7 @@ import { InputAppearanceVariants } from '../input';
|
|
|
14
15
|
import { SelectContent } from './select-content';
|
|
15
16
|
import { SelectRoot } from './select-root';
|
|
16
17
|
import { SelectTrigger } from './select-trigger';
|
|
18
|
+
import { selectStyle } from './select.css';
|
|
17
19
|
|
|
18
20
|
export type SelectProps = ComponentPropsWithoutRef<typeof SelectRoot> &
|
|
19
21
|
Pick<ComponentPropsWithoutRef<typeof Value>, 'placeholder'> &
|
|
@@ -29,6 +31,7 @@ export type SelectProps = ComponentPropsWithoutRef<typeof SelectRoot> &
|
|
|
29
31
|
hideLabel?: boolean;
|
|
30
32
|
errors: string;
|
|
31
33
|
hideErrorMessage?: boolean;
|
|
34
|
+
className?: string;
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
export function Select({
|
|
@@ -47,6 +50,7 @@ export function Select({
|
|
|
47
50
|
required,
|
|
48
51
|
size = 'md',
|
|
49
52
|
ref,
|
|
53
|
+
className,
|
|
50
54
|
...props
|
|
51
55
|
}: SelectProps) {
|
|
52
56
|
return (
|
|
@@ -58,7 +62,7 @@ export function Select({
|
|
|
58
62
|
disabled={disabled}
|
|
59
63
|
hideLabel={hideLabel}
|
|
60
64
|
>
|
|
61
|
-
<FormFieldItem>
|
|
65
|
+
<FormFieldItem className={clsx(selectStyle, className)}>
|
|
62
66
|
<FormFieldLabel required={required} disabled={disabled} size={size}>
|
|
63
67
|
{label}
|
|
64
68
|
</FormFieldLabel>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
6
|
FormField,
|
|
5
7
|
FormFieldControl,
|
|
@@ -10,6 +12,8 @@ import {
|
|
|
10
12
|
} from '../form-field';
|
|
11
13
|
import { Input, InputProps } from '../input';
|
|
12
14
|
|
|
15
|
+
import { textFieldStyle } from './text-field.css';
|
|
16
|
+
|
|
13
17
|
export type TextFieldProps = InputProps & {
|
|
14
18
|
name: string;
|
|
15
19
|
label: string;
|
|
@@ -30,6 +34,7 @@ export function TextField({
|
|
|
30
34
|
required,
|
|
31
35
|
hideErrorMessage = false,
|
|
32
36
|
size = 'md',
|
|
37
|
+
className,
|
|
33
38
|
...rest
|
|
34
39
|
}: TextFieldProps) {
|
|
35
40
|
return (
|
|
@@ -41,7 +46,7 @@ export function TextField({
|
|
|
41
46
|
disabled={disabled}
|
|
42
47
|
hideLabel={hideLabel}
|
|
43
48
|
>
|
|
44
|
-
<FormFieldItem>
|
|
49
|
+
<FormFieldItem className={clsx(textFieldStyle, className)}>
|
|
45
50
|
<FormFieldLabel required={required} disabled={disabled} size={size}>
|
|
46
51
|
{label}
|
|
47
52
|
</FormFieldLabel>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { clsx } from 'clsx';
|
|
3
4
|
import { TextareaHTMLAttributes } from 'react';
|
|
4
5
|
|
|
5
6
|
import {
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
import { InputProps } from '../input';
|
|
14
15
|
|
|
15
16
|
import { TextareaInput } from './textarea-input';
|
|
17
|
+
import { textareaStyle } from './textarea.css';
|
|
16
18
|
|
|
17
19
|
export type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> &
|
|
18
20
|
InputProps & {
|
|
@@ -46,7 +48,7 @@ export function Textarea({
|
|
|
46
48
|
disabled={disabled}
|
|
47
49
|
hideLabel={hideLabel}
|
|
48
50
|
>
|
|
49
|
-
<FormFieldItem>
|
|
51
|
+
<FormFieldItem className={clsx(textareaStyle, className)}>
|
|
50
52
|
<FormFieldLabel disabled={disabled} required={required} size={size}>
|
|
51
53
|
{label}
|
|
52
54
|
</FormFieldLabel>
|