@splenddev/kreativ-ui 0.1.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/README.md +1365 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +571 -0
- package/dist/index.d.ts +571 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +2 -0
- package/package.json +66 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, ReactElement, HTMLAttributes, TextareaHTMLAttributes, RefObject, JSX, CSSProperties } from 'react';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
type Orientation = "horizontal" | "vertical";
|
|
7
|
+
type SizeValue = Size | (string & {});
|
|
8
|
+
type BaseVariant = "solid" | "outline" | "ghost" | "soft";
|
|
9
|
+
type Variant$1 = BaseVariant;
|
|
10
|
+
interface Styleable {
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
type BaseTransition = "none" | "fade" | "rotate" | "slide" | "scale";
|
|
14
|
+
type DeepPartial<T> = {
|
|
15
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Variant = BaseVariant | "destructive" | "success" | "warning" | "info" | "outline-brand" | "ghost-brand" | "link" | "solid-white" | "outline-white" | "outline-destructive" | "ghost-destructive" | "soft-destructive" | "outline-success" | "ghost-success" | "soft-success" | "outline-warning" | "ghost-warning" | "soft-warning" | "outline-info" | "ghost-info" | "soft-info" | "soft-brand" | "ghost-white";
|
|
19
|
+
type ButtonVariant = Variant;
|
|
20
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Styleable {
|
|
21
|
+
variant?: Variant;
|
|
22
|
+
size?: SizeValue;
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
leftIcon?: ReactNode;
|
|
25
|
+
rightIcon?: ReactNode;
|
|
26
|
+
fullWidth?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
|
|
31
|
+
type ColorToken = string;
|
|
32
|
+
interface ColorTokens {
|
|
33
|
+
brand: ColorToken;
|
|
34
|
+
brandHover: ColorToken;
|
|
35
|
+
brandFg: ColorToken;
|
|
36
|
+
surface: ColorToken;
|
|
37
|
+
surfaceRaised: ColorToken;
|
|
38
|
+
surfaceSunken: ColorToken;
|
|
39
|
+
border: ColorToken;
|
|
40
|
+
text: ColorToken;
|
|
41
|
+
textMuted: ColorToken;
|
|
42
|
+
danger: ColorToken;
|
|
43
|
+
dangerFg: ColorToken;
|
|
44
|
+
destructive: ColorToken;
|
|
45
|
+
destructiveFg: ColorToken;
|
|
46
|
+
destructiveHover: ColorToken;
|
|
47
|
+
success: ColorToken;
|
|
48
|
+
successFg: ColorToken;
|
|
49
|
+
successHover: ColorToken;
|
|
50
|
+
warning: ColorToken;
|
|
51
|
+
warningFg: ColorToken;
|
|
52
|
+
warningHover: ColorToken;
|
|
53
|
+
info: ColorToken;
|
|
54
|
+
infoFg: ColorToken;
|
|
55
|
+
infoHover: ColorToken;
|
|
56
|
+
}
|
|
57
|
+
interface ThemeTokens {
|
|
58
|
+
colors: ColorTokens;
|
|
59
|
+
radius: string;
|
|
60
|
+
font: string;
|
|
61
|
+
}
|
|
62
|
+
interface IntensityMap {
|
|
63
|
+
subtle: number;
|
|
64
|
+
default: number;
|
|
65
|
+
bold: number;
|
|
66
|
+
}
|
|
67
|
+
interface SizeToken {
|
|
68
|
+
height?: string;
|
|
69
|
+
paddingX?: string;
|
|
70
|
+
fontSize?: string;
|
|
71
|
+
gap?: string;
|
|
72
|
+
iconSize?: string;
|
|
73
|
+
radius?: string;
|
|
74
|
+
}
|
|
75
|
+
type SizeScale = Record<string, SizeToken>;
|
|
76
|
+
interface ComponentOverrides {
|
|
77
|
+
Button?: {
|
|
78
|
+
base?: string;
|
|
79
|
+
variants?: Partial<Record<string, string>>;
|
|
80
|
+
};
|
|
81
|
+
[componentName: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
interface Theme {
|
|
84
|
+
intensity: number;
|
|
85
|
+
light: ThemeTokens;
|
|
86
|
+
dark: ThemeTokens;
|
|
87
|
+
sizes: SizeScale;
|
|
88
|
+
components?: ComponentOverrides;
|
|
89
|
+
}
|
|
90
|
+
type ThemeOverride = {
|
|
91
|
+
light?: DeepPartial<ThemeTokens>;
|
|
92
|
+
dark?: DeepPartial<ThemeTokens>;
|
|
93
|
+
sizes?: Record<string, Partial<SizeToken>>;
|
|
94
|
+
components?: ComponentOverrides;
|
|
95
|
+
};
|
|
96
|
+
type ColorMode = "light" | "dark" | "system";
|
|
97
|
+
|
|
98
|
+
type ThemeTogglerDisplay = "buttons" | "cycle";
|
|
99
|
+
declare const THEME_TOGGLER_VARIANTS: ButtonVariant[];
|
|
100
|
+
type ThemeTogglerVariant = typeof THEME_TOGGLER_VARIANTS[number];
|
|
101
|
+
interface ThemeTogglerProps {
|
|
102
|
+
variant?: ThemeTogglerVariant;
|
|
103
|
+
activeVariant?: ThemeTogglerVariant;
|
|
104
|
+
size?: SizeValue;
|
|
105
|
+
iconOnly?: boolean;
|
|
106
|
+
allowSystem?: boolean;
|
|
107
|
+
orientation?: Orientation;
|
|
108
|
+
rounded?: boolean;
|
|
109
|
+
unstyled?: boolean;
|
|
110
|
+
labels?: {
|
|
111
|
+
light?: string;
|
|
112
|
+
dark?: string;
|
|
113
|
+
system?: string;
|
|
114
|
+
};
|
|
115
|
+
icons?: {
|
|
116
|
+
light?: React.ReactNode;
|
|
117
|
+
dark?: React.ReactNode;
|
|
118
|
+
system?: React.ReactNode;
|
|
119
|
+
};
|
|
120
|
+
className?: string;
|
|
121
|
+
transition?: {
|
|
122
|
+
type: BaseTransition;
|
|
123
|
+
duration?: number;
|
|
124
|
+
delay?: number;
|
|
125
|
+
easing?: string;
|
|
126
|
+
};
|
|
127
|
+
display?: ThemeTogglerDisplay;
|
|
128
|
+
buttonProps?: Partial<ButtonProps>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare function ThemeToggler({ variant, activeVariant, size, iconOnly, allowSystem, orientation, rounded, unstyled, labels, icons, className, buttonProps, display, transition, }: ThemeTogglerProps): react.JSX.Element;
|
|
132
|
+
|
|
133
|
+
type InputVariant = "outline" | "filled" | "ghost";
|
|
134
|
+
type InputSize = "sm" | "md" | "lg";
|
|
135
|
+
type InputKind = "text" | "email" | "tel" | "url" | "search" | "numeric" | "password-current" | "password-new" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
|
|
136
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, Styleable {
|
|
137
|
+
variant?: InputVariant;
|
|
138
|
+
inputClassName?: string;
|
|
139
|
+
inputSize?: InputSize;
|
|
140
|
+
error?: boolean;
|
|
141
|
+
success?: boolean;
|
|
142
|
+
rounded?: boolean;
|
|
143
|
+
startAdornment?: ReactNode;
|
|
144
|
+
endAdornment?: ReactNode;
|
|
145
|
+
fullWidth?: boolean;
|
|
146
|
+
hideKindIcon?: boolean;
|
|
147
|
+
isLoading?: boolean;
|
|
148
|
+
clearable?: boolean;
|
|
149
|
+
onClear?: () => void;
|
|
150
|
+
kind?: InputKind;
|
|
151
|
+
}
|
|
152
|
+
type InputKindDefaults = Record<InputKind, {
|
|
153
|
+
type?: string;
|
|
154
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
155
|
+
autoComplete?: string;
|
|
156
|
+
placeholder?: string;
|
|
157
|
+
pattern?: string;
|
|
158
|
+
min?: number;
|
|
159
|
+
max?: number;
|
|
160
|
+
step?: number;
|
|
161
|
+
}>;
|
|
162
|
+
|
|
163
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
164
|
+
|
|
165
|
+
declare const inputKindDefaults: InputKindDefaults;
|
|
166
|
+
|
|
167
|
+
interface FormFieldProps {
|
|
168
|
+
children: ReactNode;
|
|
169
|
+
id?: string;
|
|
170
|
+
error?: string;
|
|
171
|
+
required?: boolean;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare function FormField({ id: externalId, error, required, children, }: FormFieldProps): react.JSX.Element;
|
|
175
|
+
declare namespace FormField {
|
|
176
|
+
var Label: typeof FormFieldLabel;
|
|
177
|
+
var Control: typeof FormFieldControl;
|
|
178
|
+
var Description: typeof FormFieldDescription;
|
|
179
|
+
var Message: typeof FormFieldMessage;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare function FormFieldLabel({ children, className }: {
|
|
183
|
+
children: ReactNode;
|
|
184
|
+
className?: string;
|
|
185
|
+
}): react.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function FormFieldDescription({ children, }: {
|
|
188
|
+
children: React.ReactNode;
|
|
189
|
+
}): react.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare function FormFieldMessage({ children, }: {
|
|
192
|
+
children: React.ReactNode;
|
|
193
|
+
}): react.JSX.Element;
|
|
194
|
+
|
|
195
|
+
type FormFieldControlProps<T = Record<string, unknown>> = {
|
|
196
|
+
children: ReactElement<T>;
|
|
197
|
+
};
|
|
198
|
+
declare function FormFieldControl<T = Record<string, unknown>>({ children, }: FormFieldControlProps<T>): ReactElement<T, string | react.JSXElementConstructor<any>>;
|
|
199
|
+
|
|
200
|
+
interface SelectProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
201
|
+
className?: string;
|
|
202
|
+
rounded?: boolean;
|
|
203
|
+
error?: boolean;
|
|
204
|
+
success?: boolean;
|
|
205
|
+
value?: string;
|
|
206
|
+
placeholder?: string;
|
|
207
|
+
defaultValue?: string;
|
|
208
|
+
onValueChange?(value: string | undefined): void;
|
|
209
|
+
required?: boolean;
|
|
210
|
+
name?: string;
|
|
211
|
+
disabled?: boolean;
|
|
212
|
+
clearable?: boolean;
|
|
213
|
+
variant?: InputVariant;
|
|
214
|
+
size?: InputSize;
|
|
215
|
+
children: ReactNode;
|
|
216
|
+
}
|
|
217
|
+
interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
218
|
+
className?: string;
|
|
219
|
+
}
|
|
220
|
+
interface SelectContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
221
|
+
className?: string;
|
|
222
|
+
}
|
|
223
|
+
interface SelectItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
224
|
+
value: string;
|
|
225
|
+
disabled?: boolean;
|
|
226
|
+
children: ReactNode;
|
|
227
|
+
}
|
|
228
|
+
interface SelectValueProps {
|
|
229
|
+
placeholder?: string;
|
|
230
|
+
className?: string;
|
|
231
|
+
}
|
|
232
|
+
interface SelectGroupProps {
|
|
233
|
+
children: ReactNode;
|
|
234
|
+
className?: string;
|
|
235
|
+
}
|
|
236
|
+
interface SelectLabelProps {
|
|
237
|
+
children: ReactNode;
|
|
238
|
+
className?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare function SelectContent({ className, children, ...props }: SelectContentProps): react.JSX.Element | null;
|
|
242
|
+
|
|
243
|
+
declare function SelectItem({ value, disabled, children, className, ...props }: SelectItemProps): react.JSX.Element;
|
|
244
|
+
|
|
245
|
+
declare function SelectValue({ placeholder, className }: SelectValueProps): react.JSX.Element;
|
|
246
|
+
|
|
247
|
+
declare function SelectGroup({ children, className }: SelectGroupProps): react.JSX.Element;
|
|
248
|
+
|
|
249
|
+
declare function SelectLabel({ children, className }: SelectLabelProps): react.JSX.Element;
|
|
250
|
+
|
|
251
|
+
declare function Select({ value: valueProp, defaultValue, onValueChange, disabled, required, name, variant, size, className, placeholder, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, clearable, error, success, tabIndex, rounded, children, }: SelectProps): react.JSX.Element;
|
|
252
|
+
declare namespace Select {
|
|
253
|
+
var Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
254
|
+
var Content: typeof SelectContent;
|
|
255
|
+
var Item: typeof SelectItem;
|
|
256
|
+
var Value: typeof SelectValue;
|
|
257
|
+
var Group: typeof SelectGroup;
|
|
258
|
+
var Label: typeof SelectLabel;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
262
|
+
|
|
263
|
+
interface SelectItemMeta {
|
|
264
|
+
label: ReactNode;
|
|
265
|
+
disabled?: boolean;
|
|
266
|
+
}
|
|
267
|
+
interface SelectContextValue {
|
|
268
|
+
value?: string;
|
|
269
|
+
onValueChange: (value: string) => void;
|
|
270
|
+
disabled: boolean;
|
|
271
|
+
variant: InputVariant;
|
|
272
|
+
size: InputSize;
|
|
273
|
+
rounded?: boolean;
|
|
274
|
+
open: boolean;
|
|
275
|
+
setOpen: (open: boolean) => void;
|
|
276
|
+
triggerId: string;
|
|
277
|
+
triggerRef: React.RefObject<HTMLDivElement | null>;
|
|
278
|
+
contentId: string;
|
|
279
|
+
isInvalid: boolean;
|
|
280
|
+
isSuccess: boolean;
|
|
281
|
+
describedBy?: string;
|
|
282
|
+
required?: boolean;
|
|
283
|
+
selectedLabel?: React.ReactNode;
|
|
284
|
+
activeValue: string | undefined;
|
|
285
|
+
setActiveValue: (value: string | undefined) => void;
|
|
286
|
+
items: Map<string, SelectItemMeta>;
|
|
287
|
+
registerItem: (value: string, meta: SelectItemMeta) => () => void;
|
|
288
|
+
optionId: (value: string) => string;
|
|
289
|
+
placeholder?: string;
|
|
290
|
+
clearable: boolean;
|
|
291
|
+
onClear: () => void;
|
|
292
|
+
}
|
|
293
|
+
declare const SelectContext: react.Context<SelectContextValue | null>;
|
|
294
|
+
declare function useSelectContext(componentName: string): SelectContextValue;
|
|
295
|
+
declare const SelectGroupContext: react.Context<{
|
|
296
|
+
labelId: string;
|
|
297
|
+
setHasLabel: (id: string) => void;
|
|
298
|
+
} | null>;
|
|
299
|
+
|
|
300
|
+
type TextareaResize = "none" | "both" | "horizontal" | "vertical";
|
|
301
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> {
|
|
302
|
+
value?: string;
|
|
303
|
+
defaultValue?: string;
|
|
304
|
+
className?: string;
|
|
305
|
+
size?: InputSize;
|
|
306
|
+
fullWidth?: boolean;
|
|
307
|
+
resize?: TextareaResize;
|
|
308
|
+
variant?: InputVariant;
|
|
309
|
+
autoResize?: boolean;
|
|
310
|
+
minRows?: number;
|
|
311
|
+
maxRows?: number;
|
|
312
|
+
clearable?: boolean;
|
|
313
|
+
onClear?: () => void;
|
|
314
|
+
characterCounter?: boolean;
|
|
315
|
+
debounceDelay?: number;
|
|
316
|
+
trimOnBlur?: boolean;
|
|
317
|
+
error?: boolean;
|
|
318
|
+
success?: boolean;
|
|
319
|
+
onValidate?: (value: string) => boolean | string;
|
|
320
|
+
onValueChange?: (newValue: string) => void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
324
|
+
|
|
325
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable {
|
|
326
|
+
checked?: boolean;
|
|
327
|
+
defaultChecked?: boolean;
|
|
328
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
329
|
+
indeterminate?: boolean;
|
|
330
|
+
size?: InputSize;
|
|
331
|
+
error?: boolean;
|
|
332
|
+
success?: boolean;
|
|
333
|
+
disabled?: boolean;
|
|
334
|
+
label?: ReactNode;
|
|
335
|
+
description?: ReactNode;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
339
|
+
|
|
340
|
+
type RadioSize = "sm" | "md" | "lg";
|
|
341
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "onChange" | "name" | "value">, Styleable {
|
|
342
|
+
value: string;
|
|
343
|
+
disabled?: boolean;
|
|
344
|
+
label?: ReactNode;
|
|
345
|
+
description?: ReactNode;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
interface RadioGroupProps extends Styleable {
|
|
349
|
+
value?: string;
|
|
350
|
+
defaultValue?: string;
|
|
351
|
+
onValueChange?: (value: string) => void;
|
|
352
|
+
name?: string;
|
|
353
|
+
disabled?: boolean;
|
|
354
|
+
required?: boolean;
|
|
355
|
+
orientation?: "horizontal" | "vertical";
|
|
356
|
+
size?: RadioSize;
|
|
357
|
+
error?: boolean;
|
|
358
|
+
success?: boolean;
|
|
359
|
+
children: ReactNode;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
declare function RadioGroup({ value: valueProp, defaultValue, onValueChange, name: nameProp, disabled, required, orientation, size, error, success, className, children, }: RadioGroupProps): react.JSX.Element;
|
|
363
|
+
|
|
364
|
+
declare function Radio({ value, disabled: itemDisabled, label, description, className, ...props }: RadioProps): react.JSX.Element;
|
|
365
|
+
|
|
366
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable {
|
|
367
|
+
checked?: boolean;
|
|
368
|
+
defaultChecked?: boolean;
|
|
369
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
370
|
+
size?: InputSize;
|
|
371
|
+
error?: boolean;
|
|
372
|
+
success?: boolean;
|
|
373
|
+
required?: boolean;
|
|
374
|
+
disabled?: boolean;
|
|
375
|
+
label?: ReactNode;
|
|
376
|
+
description?: ReactNode;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
declare function Switch({ checked: checkedProp, defaultChecked, onCheckedChange, size, disabled, label, description, className, id: externalId, onChange: onChangeProp, ...props }: SwitchProps): react.JSX.Element;
|
|
380
|
+
|
|
381
|
+
interface ComboboxProps extends Styleable {
|
|
382
|
+
value?: string;
|
|
383
|
+
onValueChange?: (value: string | undefined) => void;
|
|
384
|
+
inputValue?: string;
|
|
385
|
+
defaultInputValue?: string;
|
|
386
|
+
onInputChange?: (input: string) => void;
|
|
387
|
+
disabled?: boolean;
|
|
388
|
+
required?: boolean;
|
|
389
|
+
error?: boolean;
|
|
390
|
+
success?: boolean;
|
|
391
|
+
rounded?: boolean;
|
|
392
|
+
name?: string;
|
|
393
|
+
variant?: InputVariant;
|
|
394
|
+
size?: InputSize;
|
|
395
|
+
placeholder?: string;
|
|
396
|
+
clearable?: boolean;
|
|
397
|
+
allowFreeText?: boolean;
|
|
398
|
+
children: ReactNode;
|
|
399
|
+
}
|
|
400
|
+
interface ComboboxItemProps {
|
|
401
|
+
value: string;
|
|
402
|
+
disabled?: boolean;
|
|
403
|
+
children: ReactNode;
|
|
404
|
+
className?: string;
|
|
405
|
+
}
|
|
406
|
+
interface ComboboxInputProps {
|
|
407
|
+
variant?: InputVariant;
|
|
408
|
+
size?: InputSize;
|
|
409
|
+
placeholder?: string;
|
|
410
|
+
clearable?: boolean;
|
|
411
|
+
allowFreeText?: boolean;
|
|
412
|
+
className?: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
declare function ComboboxItem({ value, disabled, children, className }: ComboboxItemProps): react.JSX.Element | null;
|
|
416
|
+
|
|
417
|
+
declare function ComboboxContent({ className, children, }: {
|
|
418
|
+
className?: string;
|
|
419
|
+
children: React.ReactNode;
|
|
420
|
+
}): react.JSX.Element | null;
|
|
421
|
+
|
|
422
|
+
interface ComboboxEmptyProps {
|
|
423
|
+
children?: React.ReactNode;
|
|
424
|
+
className?: string;
|
|
425
|
+
}
|
|
426
|
+
declare function ComboboxEmpty({ children }: ComboboxEmptyProps): react.JSX.Element | null;
|
|
427
|
+
|
|
428
|
+
interface ComboboxLoadingProps {
|
|
429
|
+
children?: React.ReactNode;
|
|
430
|
+
className?: string;
|
|
431
|
+
}
|
|
432
|
+
declare function ComboboxLoading({ children, className, }: ComboboxLoadingProps): react.JSX.Element;
|
|
433
|
+
|
|
434
|
+
declare function Combobox({ value, onValueChange, inputValue: inputValueProp, defaultInputValue, onInputChange, disabled, name, error, success, rounded, className, children, }: ComboboxProps): react.JSX.Element;
|
|
435
|
+
declare namespace Combobox {
|
|
436
|
+
var Input: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
437
|
+
var Item: typeof ComboboxItem;
|
|
438
|
+
var Content: typeof ComboboxContent;
|
|
439
|
+
var Empty: typeof ComboboxEmpty;
|
|
440
|
+
var Loading: typeof ComboboxLoading;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
declare const ComboboxInput: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
444
|
+
|
|
445
|
+
interface MultiSelectProps extends Styleable {
|
|
446
|
+
value?: string[];
|
|
447
|
+
defaultValue?: string[];
|
|
448
|
+
onValueChange?: (value: string[]) => void;
|
|
449
|
+
disabled?: boolean;
|
|
450
|
+
required?: boolean;
|
|
451
|
+
error?: boolean;
|
|
452
|
+
success?: boolean;
|
|
453
|
+
rounded?: boolean;
|
|
454
|
+
clearable?: boolean;
|
|
455
|
+
name?: string;
|
|
456
|
+
variant?: InputVariant;
|
|
457
|
+
size?: InputSize;
|
|
458
|
+
placeholder?: string;
|
|
459
|
+
maxVisibleChips?: number;
|
|
460
|
+
children: ReactNode;
|
|
461
|
+
}
|
|
462
|
+
interface MultiSelectItemProps {
|
|
463
|
+
value: string;
|
|
464
|
+
disabled?: boolean;
|
|
465
|
+
children: ReactNode;
|
|
466
|
+
className?: string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface MultiSelectContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
470
|
+
className?: string;
|
|
471
|
+
}
|
|
472
|
+
declare function MultiSelectContent({ className, children, ...props }: MultiSelectContentProps): react.JSX.Element | null;
|
|
473
|
+
|
|
474
|
+
declare function MultiSelectItem({ value, disabled, children, className }: MultiSelectItemProps): react.JSX.Element;
|
|
475
|
+
|
|
476
|
+
declare function MultiSelect({ value: valueProp, defaultValue, onValueChange, disabled, required, name, variant, size, placeholder, maxVisibleChips, className, children, error, success, rounded, clearable, }: MultiSelectProps): react.JSX.Element;
|
|
477
|
+
declare namespace MultiSelect {
|
|
478
|
+
var Trigger: react.ForwardRefExoticComponent<{
|
|
479
|
+
className?: string;
|
|
480
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
481
|
+
var Content: typeof MultiSelectContent;
|
|
482
|
+
var Item: typeof MultiSelectItem;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
declare const MultiSelectTrigger: react.ForwardRefExoticComponent<{
|
|
486
|
+
className?: string;
|
|
487
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
488
|
+
|
|
489
|
+
interface MultiSelectItemMeta {
|
|
490
|
+
label: React.ReactNode;
|
|
491
|
+
disabled?: boolean;
|
|
492
|
+
}
|
|
493
|
+
interface MultiSelectContextValue {
|
|
494
|
+
value: string[];
|
|
495
|
+
toggleValue: (v: string) => void;
|
|
496
|
+
removeValue: (v: string) => void;
|
|
497
|
+
disabled: boolean;
|
|
498
|
+
variant: InputVariant;
|
|
499
|
+
size: InputSize;
|
|
500
|
+
open: boolean;
|
|
501
|
+
setOpen: (open: boolean) => void;
|
|
502
|
+
triggerId: string;
|
|
503
|
+
contentId: string;
|
|
504
|
+
triggerRef: RefObject<HTMLDivElement | null>;
|
|
505
|
+
isInvalid: boolean;
|
|
506
|
+
isSuccess?: boolean;
|
|
507
|
+
describedBy?: string;
|
|
508
|
+
required?: boolean;
|
|
509
|
+
placeholder?: string;
|
|
510
|
+
maxVisibleChips?: number;
|
|
511
|
+
activeValue: string | undefined;
|
|
512
|
+
setActiveValue: (v: string | undefined) => void;
|
|
513
|
+
items: Map<string, MultiSelectItemMeta>;
|
|
514
|
+
registerItem: (value: string, meta: MultiSelectItemMeta) => () => void;
|
|
515
|
+
optionId: (value: string) => string;
|
|
516
|
+
onClear: () => void;
|
|
517
|
+
rounded?: boolean;
|
|
518
|
+
clearable?: boolean;
|
|
519
|
+
}
|
|
520
|
+
declare const MultiSelectContext: react.Context<MultiSelectContextValue | null>;
|
|
521
|
+
declare function useMultiSelectContext(componentName: string): MultiSelectContextValue;
|
|
522
|
+
|
|
523
|
+
interface UIProviderProps {
|
|
524
|
+
children: ReactNode;
|
|
525
|
+
theme?: ThemeOverride;
|
|
526
|
+
defaultMode?: ColorMode;
|
|
527
|
+
as?: keyof JSX.IntrinsicElements;
|
|
528
|
+
fallbackSize?: string;
|
|
529
|
+
}
|
|
530
|
+
declare function UIProvider({ children, theme: themeOverride, defaultMode, as, fallbackSize, }: UIProviderProps): JSX.Element;
|
|
531
|
+
|
|
532
|
+
interface ThemeContextValue {
|
|
533
|
+
theme: Theme;
|
|
534
|
+
mode: ColorMode;
|
|
535
|
+
resolvedMode: "light" | "dark";
|
|
536
|
+
setMode: (mode: ColorMode) => void;
|
|
537
|
+
fallbackSize: string;
|
|
538
|
+
}
|
|
539
|
+
declare const ThemeContext: react.Context<ThemeContextValue | null>;
|
|
540
|
+
|
|
541
|
+
declare const defaultSizes: SizeScale;
|
|
542
|
+
declare const defaultTheme: Theme;
|
|
543
|
+
declare function resolveTokens(tokens: ThemeTokens): ThemeTokens;
|
|
544
|
+
|
|
545
|
+
declare function tokensToCssVars(tokens: ThemeTokens, _intensity: number, mode: "light" | "dark"): Record<string, string>;
|
|
546
|
+
|
|
547
|
+
declare function useTheme(): ThemeContextValue;
|
|
548
|
+
|
|
549
|
+
declare const BREAKPOINTS: {
|
|
550
|
+
readonly sm: 640;
|
|
551
|
+
readonly md: 768;
|
|
552
|
+
readonly lg: 1024;
|
|
553
|
+
readonly xl: 1280;
|
|
554
|
+
readonly "2xl": 1536;
|
|
555
|
+
};
|
|
556
|
+
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
557
|
+
/** Returns whether the viewport is at or above the given breakpoint. */
|
|
558
|
+
declare function useBreakpoint(breakpoint: Breakpoint): boolean;
|
|
559
|
+
|
|
560
|
+
interface ResolvedSize {
|
|
561
|
+
style: CSSProperties;
|
|
562
|
+
iconSize?: string;
|
|
563
|
+
}
|
|
564
|
+
declare function useSizeStyle(size: string): ResolvedSize;
|
|
565
|
+
|
|
566
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
567
|
+
|
|
568
|
+
declare function rgbStringToHex(rgb: string): string | null;
|
|
569
|
+
declare function hexToRgbString(hex: string): string | null;
|
|
570
|
+
|
|
571
|
+
export { type BaseTransition, type BaseVariant, Button, type ButtonProps, Checkbox, type CheckboxProps, type ColorMode, type ColorToken, type ColorTokens, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type ComponentOverrides, type DeepPartial, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, type FormFieldProps, Input, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, type IntensityMap, MultiSelect, MultiSelectContent, MultiSelectContext, type MultiSelectContextValue, MultiSelectItem, type MultiSelectItemMeta, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type Orientation, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type ResolvedSize, Select, SelectContent, type SelectContentProps, SelectContext, type SelectContextValue, SelectGroup, SelectGroupContext, type SelectGroupProps, SelectItem, type SelectItemMeta, type SelectItemProps, type SelectLabelProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type Size, type SizeScale, type SizeToken, type SizeValue, type Styleable, Switch, type SwitchProps, THEME_TOGGLER_VARIANTS, Textarea, type TextareaProps, type TextareaResize, type Theme, ThemeContext, type ThemeContextValue, type ThemeOverride, ThemeToggler, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type ThemeTokens, UIProvider, type UIProviderProps, type Variant$1 as Variant, cn, defaultSizes, defaultTheme, hexToRgbString, inputKindDefaults, resolveTokens, rgbStringToHex, tokensToCssVars, useBreakpoint, useMultiSelectContext, useSelectContext, useSizeStyle, useTheme };
|