@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 CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 0.31.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalink-ui/seedly",
3
- "version": "0.31.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",
@@ -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 className={formFieldStyle({ error: !!errors, disabled })} {...rest}>
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>
@@ -3,3 +3,4 @@ export { Select } from './select';
3
3
  export { SelectItem } from './select-item';
4
4
  export { SelectRoot } from './select-root';
5
5
  export { SelectTrigger } from './select-trigger';
6
+ export { selectStyle } from './select.css';
@@ -0,0 +1,3 @@
1
+ import { style } from '@vanilla-extract/css';
2
+
3
+ export const selectStyle = style({});
@@ -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 +1,2 @@
1
1
  export { TextField } from './text-field';
2
+ export { textFieldStyle } from './text-field.css';
@@ -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 +1,2 @@
1
1
  export { Textarea } from './textarea';
2
+ export { textareaStyle } from './textarea.css';
@@ -2,6 +2,8 @@ import { style } from '@vanilla-extract/css';
2
2
 
3
3
  import { inputAppearance } from '../input';
4
4
 
5
+ export const textareaStyle = style({});
6
+
5
7
  export const textarea = style([
6
8
  inputAppearance(),
7
9
  {
@@ -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>