@kalink-ui/seedly 0.30.1 → 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 +14 -0
- package/package.json +3 -3
- package/src/components/form-field/form-field-item.tsx +8 -1
- package/src/components/form-field/form-field.css.ts +18 -8
- package/src/components/form-field/index.ts +1 -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
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @kalink-ui/seedly
|
|
2
2
|
|
|
3
|
+
## 0.32.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 40a1dbe: Add proper styling solution for form field component
|
|
8
|
+
|
|
9
|
+
## 0.31.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0afb723: feat(seedly/form-field): switch to theme contract and export vars
|
|
14
|
+
- Replace createGlobalTheme with createThemeContract + assignVars for FormField.
|
|
15
|
+
- Export formFieldVars from the FormField module's index for external theming.
|
|
16
|
+
|
|
3
17
|
## 0.30.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalink-ui/seedly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "A set of components for building UIs with React and TypeScript",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"vite": "^6.3.5",
|
|
44
44
|
"vite-tsconfig-paths": "^5.1.4",
|
|
45
45
|
"vitest": "^3.2.3",
|
|
46
|
-
"@kalink-ui/
|
|
47
|
-
"@kalink-ui/
|
|
46
|
+
"@kalink-ui/eslint-config": "0.10.0",
|
|
47
|
+
"@kalink-ui/typescript-config": "0.4.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@vanilla-extract/css": "^1.17.1",
|
|
@@ -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,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assignVars, createThemeContract, style } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
3
|
|
|
4
4
|
import { sys, typography } from '../../styles';
|
|
5
5
|
import { components } from '../../styles/layers.css';
|
|
6
6
|
|
|
7
|
-
export const formFieldVars =
|
|
8
|
-
'@layer': components,
|
|
9
|
-
|
|
7
|
+
export const formFieldVars = createThemeContract({
|
|
10
8
|
spacing: {
|
|
11
|
-
vertical:
|
|
9
|
+
vertical: null,
|
|
12
10
|
},
|
|
13
11
|
|
|
14
12
|
color: {
|
|
15
|
-
foreground:
|
|
16
|
-
background:
|
|
17
|
-
outline:
|
|
13
|
+
foreground: null,
|
|
14
|
+
background: null,
|
|
15
|
+
outline: null,
|
|
18
16
|
},
|
|
19
17
|
});
|
|
20
18
|
|
|
@@ -31,6 +29,18 @@ export const formFieldStyle = recipe({
|
|
|
31
29
|
|
|
32
30
|
color: formFieldVars.color.foreground,
|
|
33
31
|
|
|
32
|
+
vars: {
|
|
33
|
+
...assignVars(formFieldVars.color, {
|
|
34
|
+
foreground: sys.color.foreground,
|
|
35
|
+
background: sys.color.background,
|
|
36
|
+
outline: sys.color.foreground,
|
|
37
|
+
}),
|
|
38
|
+
|
|
39
|
+
...assignVars(formFieldVars.spacing, {
|
|
40
|
+
vertical: sys.spacing[2],
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
|
|
34
44
|
selectors: {
|
|
35
45
|
'&:disabled, &:has(:disabled)': {
|
|
36
46
|
cursor: 'not-allowed',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useFormFieldContext } from './form-field-context';
|
|
2
2
|
export { useFormFieldItemContext } from './form-field-item-context';
|
|
3
|
-
export { formFieldStyle } from './form-field.css';
|
|
3
|
+
export { formFieldStyle, formFieldVars } from './form-field.css';
|
|
4
4
|
export { FormFieldControl } from './form-field-control';
|
|
5
5
|
export { FormFieldDescription } from './form-field-description';
|
|
6
6
|
export { FormFieldError } from './form-field-error';
|
|
@@ -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>
|