@causw/core 0.0.6 → 0.0.9
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/index.d.mts +206 -1
- package/dist/index.d.ts +206 -1
- package/dist/index.js +672 -0
- package/dist/index.mjs +658 -0
- package/package.json +21 -5
- package/src/styles/global.css +125 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,207 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
1
4
|
|
|
2
|
-
|
|
5
|
+
type Typography = 'caption-sm' | 'caption-sm-point' | 'caption-md' | 'caption-md-point' | 'body2-sm' | 'body2-sm-point' | 'body2-md' | 'body2-md-point' | 'body-sm' | 'body-sm-point' | 'body-md' | 'body-md-point' | 'subtitle-sm' | 'subtitle-sm-point' | 'subtitle-md' | 'subtitle-md-point' | 'title-sm' | 'title-md' | 'head-sm' | 'head-md' | 'fixed-12' | 'fixed-14' | 'fixed-15' | 'fixed-16' | 'fixed-18' | 'fixed-20' | 'fixed-24';
|
|
6
|
+
type TextColor = 'gray-50' | 'gray-100' | 'gray-200' | 'gray-300' | 'gray-400' | 'gray-500' | 'gray-600' | 'gray-700' | 'gray-800' | 'gray-900' | 'blue-50' | 'blue-500' | 'blue-700' | 'red-100' | 'red-400' | 'white' | 'black';
|
|
7
|
+
type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Polymorphic component props (includes ref)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* type ButtonProps<E extends React.ElementType = 'button'> =
|
|
15
|
+
* PolymorphicProps<E, { variant?: 'primary' | 'secondary' }>;
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
type PolymorphicProps<E extends React.ElementType = 'div', Props = object> = Props & {
|
|
19
|
+
as?: E;
|
|
20
|
+
} & Omit<React.ComponentProps<E>, keyof Props | 'as'>;
|
|
21
|
+
/**
|
|
22
|
+
* Polymorphic component props without ref
|
|
23
|
+
*/
|
|
24
|
+
type PolymorphicPropsWithoutRef<E extends React.ElementType = 'div', Props = object> = Props & {
|
|
25
|
+
as?: E;
|
|
26
|
+
} & Omit<React.ComponentPropsWithoutRef<E>, keyof Props | 'as'>;
|
|
27
|
+
|
|
28
|
+
/** Text element types that can be used with as prop */
|
|
29
|
+
type TextElement = 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'label' | 'a';
|
|
30
|
+
/** Base text styling props - reusable for other components */
|
|
31
|
+
interface TextStyleProps {
|
|
32
|
+
/** Typography preset - format: {variant}-{size}[-point] */
|
|
33
|
+
typography?: Typography;
|
|
34
|
+
/** Text color */
|
|
35
|
+
textColor?: TextColor;
|
|
36
|
+
/** Text alignment */
|
|
37
|
+
align?: TextAlign;
|
|
38
|
+
}
|
|
39
|
+
/** Full Text component props with polymorphic support */
|
|
40
|
+
type TextProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
41
|
+
declare const Text: {
|
|
42
|
+
<E extends TextElement = "span">({ typography, textColor, align, as, children, className, ...props }: TextProps<E>): React.DetailedReactHTMLElement<{
|
|
43
|
+
className: string;
|
|
44
|
+
} & Omit<TextProps<E>, "as" | "typography" | "textColor" | "align" | "className" | "children">, HTMLSpanElement>;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
error?: boolean;
|
|
52
|
+
}
|
|
53
|
+
type FieldLabelProps<E extends TextElement = 'label'> = PolymorphicProps<E, TextStyleProps>;
|
|
54
|
+
interface FieldDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
interface FieldErrorDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
declare const Field: {
|
|
63
|
+
({ children, disabled, error, className, ...props }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
displayName: string;
|
|
65
|
+
} & {
|
|
66
|
+
Label: {
|
|
67
|
+
<E extends TextElement = "label">({ children, className, typography, textColor, ...labelProps }: FieldLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
68
|
+
displayName: string;
|
|
69
|
+
};
|
|
70
|
+
Description: {
|
|
71
|
+
({ children, className, ...props }: FieldDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
74
|
+
ErrorDescription: {
|
|
75
|
+
({ children, className, ...props }: FieldErrorDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type TextInputVariant = 'default' | 'underline';
|
|
81
|
+
interface TextInputProps extends React.ComponentProps<'input'>, TextStyleProps {
|
|
82
|
+
/** Input variant style */
|
|
83
|
+
variant?: TextInputVariant;
|
|
84
|
+
/** Icon to display on the left side of input */
|
|
85
|
+
leftIcon?: React.ReactNode;
|
|
86
|
+
/** Icon to display on the right side of input */
|
|
87
|
+
rightIcon?: React.ReactNode;
|
|
88
|
+
/** Error state (overrides Field context) */
|
|
89
|
+
error?: boolean;
|
|
90
|
+
}
|
|
91
|
+
declare const TextInput: {
|
|
92
|
+
({ id: idProp, disabled: disabledProp, error: errorProp, className, leftIcon, rightIcon, variant, typography, textColor, ...props }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
93
|
+
displayName: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
interface PrimitiveProps {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the element should be rendered as a child of a slot.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface TextAreaProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
105
|
+
children: React.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
interface TextAreaInputProps extends React.ComponentProps<'textarea'> {
|
|
108
|
+
/** Whether to allow vertical resizing @default true */
|
|
109
|
+
resize?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface TextAreaFooterProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
}
|
|
114
|
+
declare const TextArea: {
|
|
115
|
+
({ className, children, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
|
|
116
|
+
displayName: string;
|
|
117
|
+
} & {
|
|
118
|
+
Input: {
|
|
119
|
+
({ resize, disabled: disabledProp, className, ...props }: TextAreaInputProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
displayName: string;
|
|
121
|
+
};
|
|
122
|
+
Footer: {
|
|
123
|
+
({ className, children, ...props }: TextAreaFooterProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
interface RadioGroupContextValue {
|
|
129
|
+
name: string;
|
|
130
|
+
value?: string;
|
|
131
|
+
onChange?: (value: string) => void;
|
|
132
|
+
}
|
|
133
|
+
declare const useRadioGroupContext: () => RadioGroupContextValue | null;
|
|
134
|
+
interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
135
|
+
name: string;
|
|
136
|
+
value?: string;
|
|
137
|
+
defaultValue?: string;
|
|
138
|
+
onValueChange?: (value: string) => void;
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare const RadioGroup: {
|
|
142
|
+
({ name, value, defaultValue, onValueChange, className, children, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
143
|
+
displayName: string;
|
|
144
|
+
};
|
|
145
|
+
interface RadioProps extends Omit<React.ComponentProps<'input'>, 'type'> {
|
|
146
|
+
value: string;
|
|
147
|
+
children: React.ReactNode;
|
|
148
|
+
}
|
|
149
|
+
declare const Radio: {
|
|
150
|
+
({ value, children, className, checked: checkedProp, onChange, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
displayName: string;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Combines class names with Tailwind CSS conflict resolution
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* mergeStyles('px-2 py-1', 'px-4') // => 'py-1 px-4'
|
|
159
|
+
* mergeStyles('text-red-500', condition && 'text-blue-500')
|
|
160
|
+
*/
|
|
161
|
+
declare function mergeStyles(...inputs: ClassValue[]): string;
|
|
162
|
+
|
|
163
|
+
interface ToggleRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'> {
|
|
164
|
+
checked?: boolean;
|
|
165
|
+
defaultChecked?: boolean;
|
|
166
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
children?: React.ReactNode;
|
|
169
|
+
}
|
|
170
|
+
type ToggleLabelProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
171
|
+
declare const Toggle: {
|
|
172
|
+
({ checked: checkedProp, defaultChecked, onCheckedChange, disabled, children, className, ...props }: ToggleRootProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
displayName: string;
|
|
174
|
+
} & {
|
|
175
|
+
Switch: {
|
|
176
|
+
(): react_jsx_runtime.JSX.Element;
|
|
177
|
+
displayName: string;
|
|
178
|
+
};
|
|
179
|
+
Label: {
|
|
180
|
+
<E extends TextElement = "span">({ children, typography, textColor, ...props }: ToggleLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
181
|
+
displayName: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
interface CheckboxRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'> {
|
|
186
|
+
checked?: boolean;
|
|
187
|
+
defaultChecked?: boolean;
|
|
188
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
children?: React.ReactNode;
|
|
191
|
+
}
|
|
192
|
+
type CheckboxLabelProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
193
|
+
declare const Checkbox: {
|
|
194
|
+
({ checked: checkedProp, defaultChecked, onCheckedChange, disabled, children, className, ...props }: CheckboxRootProps): react_jsx_runtime.JSX.Element;
|
|
195
|
+
displayName: string;
|
|
196
|
+
} & {
|
|
197
|
+
Indicator: {
|
|
198
|
+
(): react_jsx_runtime.JSX.Element;
|
|
199
|
+
displayName: string;
|
|
200
|
+
};
|
|
201
|
+
Label: {
|
|
202
|
+
<E extends TextElement = "span">({ children, typography, textColor, ...props }: CheckboxLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
203
|
+
displayName: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export { Checkbox, type CheckboxLabelProps, type CheckboxRootProps, Field, type FieldDescriptionProps, type FieldErrorDescriptionProps, type FieldLabelProps, type FieldProps, type PolymorphicProps, type PolymorphicPropsWithoutRef, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Text, TextArea, type TextAreaFooterProps, type TextAreaInputProps, type TextAreaProps, type TextColor, TextInput, type TextInputProps, type TextInputVariant, type TextProps, type TextStyleProps, Toggle, type ToggleLabelProps, type ToggleRootProps, type Typography, mergeStyles, useRadioGroupContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,207 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
1
4
|
|
|
2
|
-
|
|
5
|
+
type Typography = 'caption-sm' | 'caption-sm-point' | 'caption-md' | 'caption-md-point' | 'body2-sm' | 'body2-sm-point' | 'body2-md' | 'body2-md-point' | 'body-sm' | 'body-sm-point' | 'body-md' | 'body-md-point' | 'subtitle-sm' | 'subtitle-sm-point' | 'subtitle-md' | 'subtitle-md-point' | 'title-sm' | 'title-md' | 'head-sm' | 'head-md' | 'fixed-12' | 'fixed-14' | 'fixed-15' | 'fixed-16' | 'fixed-18' | 'fixed-20' | 'fixed-24';
|
|
6
|
+
type TextColor = 'gray-50' | 'gray-100' | 'gray-200' | 'gray-300' | 'gray-400' | 'gray-500' | 'gray-600' | 'gray-700' | 'gray-800' | 'gray-900' | 'blue-50' | 'blue-500' | 'blue-700' | 'red-100' | 'red-400' | 'white' | 'black';
|
|
7
|
+
type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Polymorphic component props (includes ref)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* type ButtonProps<E extends React.ElementType = 'button'> =
|
|
15
|
+
* PolymorphicProps<E, { variant?: 'primary' | 'secondary' }>;
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
type PolymorphicProps<E extends React.ElementType = 'div', Props = object> = Props & {
|
|
19
|
+
as?: E;
|
|
20
|
+
} & Omit<React.ComponentProps<E>, keyof Props | 'as'>;
|
|
21
|
+
/**
|
|
22
|
+
* Polymorphic component props without ref
|
|
23
|
+
*/
|
|
24
|
+
type PolymorphicPropsWithoutRef<E extends React.ElementType = 'div', Props = object> = Props & {
|
|
25
|
+
as?: E;
|
|
26
|
+
} & Omit<React.ComponentPropsWithoutRef<E>, keyof Props | 'as'>;
|
|
27
|
+
|
|
28
|
+
/** Text element types that can be used with as prop */
|
|
29
|
+
type TextElement = 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'label' | 'a';
|
|
30
|
+
/** Base text styling props - reusable for other components */
|
|
31
|
+
interface TextStyleProps {
|
|
32
|
+
/** Typography preset - format: {variant}-{size}[-point] */
|
|
33
|
+
typography?: Typography;
|
|
34
|
+
/** Text color */
|
|
35
|
+
textColor?: TextColor;
|
|
36
|
+
/** Text alignment */
|
|
37
|
+
align?: TextAlign;
|
|
38
|
+
}
|
|
39
|
+
/** Full Text component props with polymorphic support */
|
|
40
|
+
type TextProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
41
|
+
declare const Text: {
|
|
42
|
+
<E extends TextElement = "span">({ typography, textColor, align, as, children, className, ...props }: TextProps<E>): React.DetailedReactHTMLElement<{
|
|
43
|
+
className: string;
|
|
44
|
+
} & Omit<TextProps<E>, "as" | "typography" | "textColor" | "align" | "className" | "children">, HTMLSpanElement>;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
error?: boolean;
|
|
52
|
+
}
|
|
53
|
+
type FieldLabelProps<E extends TextElement = 'label'> = PolymorphicProps<E, TextStyleProps>;
|
|
54
|
+
interface FieldDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
interface FieldErrorDescriptionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
declare const Field: {
|
|
63
|
+
({ children, disabled, error, className, ...props }: FieldProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
displayName: string;
|
|
65
|
+
} & {
|
|
66
|
+
Label: {
|
|
67
|
+
<E extends TextElement = "label">({ children, className, typography, textColor, ...labelProps }: FieldLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
68
|
+
displayName: string;
|
|
69
|
+
};
|
|
70
|
+
Description: {
|
|
71
|
+
({ children, className, ...props }: FieldDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
74
|
+
ErrorDescription: {
|
|
75
|
+
({ children, className, ...props }: FieldErrorDescriptionProps): react_jsx_runtime.JSX.Element | null;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type TextInputVariant = 'default' | 'underline';
|
|
81
|
+
interface TextInputProps extends React.ComponentProps<'input'>, TextStyleProps {
|
|
82
|
+
/** Input variant style */
|
|
83
|
+
variant?: TextInputVariant;
|
|
84
|
+
/** Icon to display on the left side of input */
|
|
85
|
+
leftIcon?: React.ReactNode;
|
|
86
|
+
/** Icon to display on the right side of input */
|
|
87
|
+
rightIcon?: React.ReactNode;
|
|
88
|
+
/** Error state (overrides Field context) */
|
|
89
|
+
error?: boolean;
|
|
90
|
+
}
|
|
91
|
+
declare const TextInput: {
|
|
92
|
+
({ id: idProp, disabled: disabledProp, error: errorProp, className, leftIcon, rightIcon, variant, typography, textColor, ...props }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
93
|
+
displayName: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
interface PrimitiveProps {
|
|
97
|
+
/**
|
|
98
|
+
* Whether the element should be rendered as a child of a slot.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
asChild?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface TextAreaProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
105
|
+
children: React.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
interface TextAreaInputProps extends React.ComponentProps<'textarea'> {
|
|
108
|
+
/** Whether to allow vertical resizing @default true */
|
|
109
|
+
resize?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface TextAreaFooterProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
}
|
|
114
|
+
declare const TextArea: {
|
|
115
|
+
({ className, children, ...props }: TextAreaProps): react_jsx_runtime.JSX.Element;
|
|
116
|
+
displayName: string;
|
|
117
|
+
} & {
|
|
118
|
+
Input: {
|
|
119
|
+
({ resize, disabled: disabledProp, className, ...props }: TextAreaInputProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
displayName: string;
|
|
121
|
+
};
|
|
122
|
+
Footer: {
|
|
123
|
+
({ className, children, ...props }: TextAreaFooterProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
interface RadioGroupContextValue {
|
|
129
|
+
name: string;
|
|
130
|
+
value?: string;
|
|
131
|
+
onChange?: (value: string) => void;
|
|
132
|
+
}
|
|
133
|
+
declare const useRadioGroupContext: () => RadioGroupContextValue | null;
|
|
134
|
+
interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement>, PrimitiveProps {
|
|
135
|
+
name: string;
|
|
136
|
+
value?: string;
|
|
137
|
+
defaultValue?: string;
|
|
138
|
+
onValueChange?: (value: string) => void;
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
declare const RadioGroup: {
|
|
142
|
+
({ name, value, defaultValue, onValueChange, className, children, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
143
|
+
displayName: string;
|
|
144
|
+
};
|
|
145
|
+
interface RadioProps extends Omit<React.ComponentProps<'input'>, 'type'> {
|
|
146
|
+
value: string;
|
|
147
|
+
children: React.ReactNode;
|
|
148
|
+
}
|
|
149
|
+
declare const Radio: {
|
|
150
|
+
({ value, children, className, checked: checkedProp, onChange, ...props }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
displayName: string;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Combines class names with Tailwind CSS conflict resolution
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* mergeStyles('px-2 py-1', 'px-4') // => 'py-1 px-4'
|
|
159
|
+
* mergeStyles('text-red-500', condition && 'text-blue-500')
|
|
160
|
+
*/
|
|
161
|
+
declare function mergeStyles(...inputs: ClassValue[]): string;
|
|
162
|
+
|
|
163
|
+
interface ToggleRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'> {
|
|
164
|
+
checked?: boolean;
|
|
165
|
+
defaultChecked?: boolean;
|
|
166
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
children?: React.ReactNode;
|
|
169
|
+
}
|
|
170
|
+
type ToggleLabelProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
171
|
+
declare const Toggle: {
|
|
172
|
+
({ checked: checkedProp, defaultChecked, onCheckedChange, disabled, children, className, ...props }: ToggleRootProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
displayName: string;
|
|
174
|
+
} & {
|
|
175
|
+
Switch: {
|
|
176
|
+
(): react_jsx_runtime.JSX.Element;
|
|
177
|
+
displayName: string;
|
|
178
|
+
};
|
|
179
|
+
Label: {
|
|
180
|
+
<E extends TextElement = "span">({ children, typography, textColor, ...props }: ToggleLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
181
|
+
displayName: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
interface CheckboxRootProps extends Omit<React.ComponentProps<'label'>, 'onChange'> {
|
|
186
|
+
checked?: boolean;
|
|
187
|
+
defaultChecked?: boolean;
|
|
188
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
children?: React.ReactNode;
|
|
191
|
+
}
|
|
192
|
+
type CheckboxLabelProps<E extends TextElement = 'span'> = PolymorphicProps<E, TextStyleProps>;
|
|
193
|
+
declare const Checkbox: {
|
|
194
|
+
({ checked: checkedProp, defaultChecked, onCheckedChange, disabled, children, className, ...props }: CheckboxRootProps): react_jsx_runtime.JSX.Element;
|
|
195
|
+
displayName: string;
|
|
196
|
+
} & {
|
|
197
|
+
Indicator: {
|
|
198
|
+
(): react_jsx_runtime.JSX.Element;
|
|
199
|
+
displayName: string;
|
|
200
|
+
};
|
|
201
|
+
Label: {
|
|
202
|
+
<E extends TextElement = "span">({ children, typography, textColor, ...props }: CheckboxLabelProps<E>): react_jsx_runtime.JSX.Element;
|
|
203
|
+
displayName: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export { Checkbox, type CheckboxLabelProps, type CheckboxRootProps, Field, type FieldDescriptionProps, type FieldErrorDescriptionProps, type FieldLabelProps, type FieldProps, type PolymorphicProps, type PolymorphicPropsWithoutRef, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Text, TextArea, type TextAreaFooterProps, type TextAreaInputProps, type TextAreaProps, type TextColor, TextInput, type TextInputProps, type TextInputVariant, type TextProps, type TextStyleProps, Toggle, type ToggleLabelProps, type ToggleRootProps, type Typography, mergeStyles, useRadioGroupContext };
|