@splenddev/kreativ-ui 0.2.9 → 0.3.1
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 +143 -1511
- package/dist/index.cjs +21232 -3001
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +827 -990
- package/dist/index.d.ts +827 -990
- package/dist/index.js +21002 -2840
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +2 -2
- package/package.json +7 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,177 +1,31 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, CSSProperties, ReactElement, ComponentPropsWithoutRef, HTMLInputTypeAttribute, TextareaHTMLAttributes, InputHTMLAttributes, ElementType, LabelHTMLAttributes, JSX, RefObject } from 'react';
|
|
3
|
+
import { BaseProps, ColorProps, BaseColor, VariantProps, BaseVariant, DisabledProps, LoadingProps, FullWidthProps, TypographyProps, SizeValue, SizeProps, OrientationProps, Orientation, ThemeTogglerTransition, ClearableProps, UndoRedoProps, ValueProps, StateProps, TrimProps, FormFieldStatus, ValidateOn, EmbeddedProps, ValidateProps, Styleable as Styleable$1, StatusProps, ControlledProps, Size, ResponsiveValue, RecipeCollection, DeepPartial, DefaultRecipeCollection, ThemeOverride as ThemeOverride$1, Typography, SemanticTokens, DesignTokens, Theme } from '@splenddev/kreativ-core/types';
|
|
4
|
+
export * from '@splenddev/kreativ-core/types';
|
|
5
|
+
import * as _splenddev_kreativ_core from '@splenddev/kreativ-core';
|
|
6
|
+
import { KuiComponent, BaseProps as BaseProps$1, SizeProps as SizeProps$1, ValueProps as ValueProps$1, VariantProps as VariantProps$1, DisabledProps as DisabledProps$1, ClearableProps as ClearableProps$1, StateProps as StateProps$1, Styleable, FormFieldStatus as FormFieldStatus$1, ThemeOverride, ColorMode } from '@splenddev/kreativ-core';
|
|
7
|
+
export { ThemeContext, defineRecipe, defineSemanticToken, defineSemanticTokens, defineTheme, defineToken, defineTokens, defineTypography, resolveTypography } from '@splenddev/kreativ-core';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export * from '@splenddev/kreativ-core/hooks';
|
|
3
10
|
import { ClassValue } from 'clsx';
|
|
4
11
|
|
|
5
|
-
|
|
6
|
-
type Orientation = "horizontal" | "vertical";
|
|
7
|
-
type SizeValue = Size | (string & {});
|
|
8
|
-
type BaseVariant = "solid" | "outline" | "ghost" | "soft";
|
|
9
|
-
type BaseColor = "brand" | "destructive" | "success" | "warning" | "info" | "neutral" | "white";
|
|
10
|
-
type Variant = BaseVariant;
|
|
11
|
-
interface Styleable {
|
|
12
|
-
className?: string;
|
|
13
|
-
}
|
|
14
|
-
type BaseTransition = "none" | "fade" | "rotate" | "slide" | "scale";
|
|
15
|
-
type DeepPartial<T> = {
|
|
16
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
17
|
-
};
|
|
18
|
-
type CSSPropertiesWithVars = CSSProperties & {
|
|
19
|
-
[key: `--${string}`]: string | number | undefined;
|
|
20
|
-
};
|
|
21
|
-
type ReportedValidity = {
|
|
22
|
-
invalid: boolean;
|
|
23
|
-
message?: string;
|
|
24
|
-
};
|
|
25
|
-
interface BaseProps {
|
|
26
|
-
/**
|
|
27
|
-
* Additional CSS classes.
|
|
28
|
-
*/
|
|
29
|
-
className?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Inline styles.
|
|
32
|
-
*/
|
|
33
|
-
style?: CSSProperties;
|
|
34
|
-
/**
|
|
35
|
-
* Component content.
|
|
36
|
-
*/
|
|
12
|
+
interface AdornmentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
37
13
|
children?: ReactNode;
|
|
38
|
-
|
|
39
|
-
* Removes the component's default styling.
|
|
40
|
-
*/
|
|
41
|
-
unstyled?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface SizeProps {
|
|
44
|
-
/**
|
|
45
|
-
* Component size.
|
|
46
|
-
*/
|
|
47
|
-
size?: SizeValue;
|
|
48
|
-
}
|
|
49
|
-
interface ColorProps<Color extends string = string> {
|
|
50
|
-
/**
|
|
51
|
-
* Component color.
|
|
52
|
-
*/
|
|
53
|
-
color?: Color;
|
|
54
|
-
}
|
|
55
|
-
interface VariantProps<Variant extends string = string> {
|
|
56
|
-
/**
|
|
57
|
-
* Visual variant.
|
|
58
|
-
*/
|
|
59
|
-
variant?: Variant;
|
|
60
|
-
}
|
|
61
|
-
interface TypographyProps {
|
|
62
|
-
/**
|
|
63
|
-
* Defines the typography style to apply to the component.
|
|
64
|
-
* The value must match a typography style registered in the theme.
|
|
65
|
-
*/
|
|
66
|
-
typography?: string;
|
|
67
|
-
}
|
|
68
|
-
interface DisabledProps {
|
|
69
|
-
/**
|
|
70
|
-
* Disables the component.
|
|
71
|
-
*/
|
|
72
|
-
disabled?: boolean;
|
|
73
|
-
}
|
|
74
|
-
interface LoadingProps {
|
|
75
|
-
/**
|
|
76
|
-
* Displays a loading state and prevents interaction.
|
|
77
|
-
*/
|
|
78
|
-
isLoading?: boolean;
|
|
79
|
-
}
|
|
80
|
-
interface FullWidthProps {
|
|
81
|
-
/**
|
|
82
|
-
* Makes the component span the available width.
|
|
83
|
-
*/
|
|
84
|
-
fullWidth?: boolean;
|
|
85
|
-
}
|
|
86
|
-
interface ClearableProps {
|
|
87
|
-
/**
|
|
88
|
-
* Allows the current value to be cleared.
|
|
89
|
-
*/
|
|
90
|
-
clearable?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Called when the current value is cleared.
|
|
93
|
-
*/
|
|
94
|
-
onClear?: () => void;
|
|
95
|
-
}
|
|
96
|
-
interface StateProps {
|
|
97
|
-
/**
|
|
98
|
-
* Displays an error state.
|
|
99
|
-
*/
|
|
100
|
-
error?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Displays a success state.
|
|
103
|
-
*/
|
|
104
|
-
success?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Displays a warning state.
|
|
107
|
-
*/
|
|
108
|
-
warning?: boolean;
|
|
109
|
-
}
|
|
110
|
-
interface StatusProps {
|
|
111
|
-
/**
|
|
112
|
-
* Can be `'success'` or `'error'` or `'warning'` or `'none'`
|
|
113
|
-
*/
|
|
114
|
-
status?: FormFieldStatus;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Generic controlled/uncontrolled props with custom property names.
|
|
118
|
-
*/
|
|
119
|
-
type ControlledProps<T, TValueProp extends string = "value", TDefaultProp extends string = "defaultValue", TOnChangeProp extends string = "onValueChange"> = {
|
|
120
|
-
[K in TValueProp]?: T;
|
|
121
|
-
} & {
|
|
122
|
-
[K in TDefaultProp]?: T;
|
|
123
|
-
} & {
|
|
124
|
-
[K in TOnChangeProp]?: (value: T) => void;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Props for a string‑based value (e.g. input, select).
|
|
128
|
-
*/
|
|
129
|
-
type ValueProps<T = string> = ControlledProps<T, 'value', 'defaultValue', 'onValueChange'>;
|
|
130
|
-
interface TrimProps {
|
|
131
|
-
/**
|
|
132
|
-
* Removes leading and trailing whitespace from the value
|
|
133
|
-
* when the value is committed.
|
|
134
|
-
*
|
|
135
|
-
* @default false
|
|
136
|
-
*/
|
|
137
|
-
trim?: boolean;
|
|
138
|
-
}
|
|
139
|
-
interface EmbeddedProps {
|
|
140
|
-
/**
|
|
141
|
-
* Renders the component as part of a parent component's visual container.
|
|
142
|
-
*
|
|
143
|
-
* Removes standalone container styling such as borders, radius,
|
|
144
|
-
* and focus ring.
|
|
145
|
-
*/
|
|
146
|
-
embedded?: boolean;
|
|
147
|
-
}
|
|
148
|
-
type ValidationResult = boolean | string;
|
|
149
|
-
type ValidateOn = "change" | "blur" | "both";
|
|
150
|
-
interface ValidateProps<T = string> {
|
|
151
|
-
/**
|
|
152
|
-
* Validates the current value.
|
|
153
|
-
*
|
|
154
|
-
* Return `true` when valid, or `false`/a string when invalid.
|
|
155
|
-
* A returned string is used as the validation message.
|
|
156
|
-
*/
|
|
157
|
-
validate?: (value: T) => ValidationResult;
|
|
158
|
-
/**
|
|
159
|
-
* Determines when validation runs.
|
|
160
|
-
*
|
|
161
|
-
* @default "blur"
|
|
162
|
-
*/
|
|
163
|
-
validateOn?: ValidateOn;
|
|
14
|
+
position?: "start" | "end";
|
|
164
15
|
}
|
|
165
16
|
|
|
17
|
+
declare const Adornment: react.ForwardRefExoticComponent<AdornmentProps & react.RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
|
|
166
19
|
type ButtonSize = SizeValue | "icon";
|
|
167
20
|
type ButtonVariant = BaseVariant | "link";
|
|
168
21
|
type ButtonColor = BaseColor;
|
|
169
|
-
interface ButtonRenderProps {
|
|
22
|
+
interface ButtonRenderProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color"> {
|
|
170
23
|
className?: string;
|
|
171
24
|
style?: CSSProperties;
|
|
172
25
|
disabled?: boolean;
|
|
173
26
|
"aria-disabled"?: boolean;
|
|
174
27
|
"aria-busy"?: boolean;
|
|
28
|
+
"data-kui-responsive"?: string;
|
|
175
29
|
children?: ReactNode;
|
|
176
30
|
}
|
|
177
31
|
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
@@ -208,686 +62,76 @@ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onD
|
|
|
208
62
|
|
|
209
63
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
210
64
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
* Typically used to apply styles generated by a styling solution (e.g., CSS Modules, Tailwind, Panda CSS).
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* ```ts
|
|
217
|
-
* const baseStyle: RecipeStyle = "btn btn-primary";
|
|
218
|
-
* const variantStyle: RecipeStyle = "bg-blue-500 hover:bg-blue-600";
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
type RecipeStyle = string;
|
|
222
|
-
type RecipeVariantValue = string | boolean | number;
|
|
223
|
-
/**
|
|
224
|
-
* A mapping of variant key to a CSS class string.
|
|
225
|
-
* Each variant option maps to a specific style.
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* ```ts
|
|
229
|
-
* const colorVariants: RecipeVariant = {
|
|
230
|
-
* brand: "bg-brand text-white",
|
|
231
|
-
* destructive: "bg-red-500 text-white",
|
|
232
|
-
* outline: "border-2 border-current bg-transparent",
|
|
233
|
-
* };
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
type RecipeVariant = Record<string, RecipeStyle>;
|
|
237
|
-
/**
|
|
238
|
-
* Defines a compound variant: a set of conditions (multiple variant keys)
|
|
239
|
-
* that together produce a specific className.
|
|
240
|
-
*
|
|
241
|
-
* This is useful when you need to apply styles only when two or more
|
|
242
|
-
* variant values are combined (e.g., `variant="solid"` AND `color="brand"`).
|
|
243
|
-
*
|
|
244
|
-
* @property conditions - A record where keys are variant names and values are the variant values.
|
|
245
|
-
* @property className - The style to apply when all conditions match.
|
|
246
|
-
*
|
|
247
|
-
* @example
|
|
248
|
-
* ```ts
|
|
249
|
-
* const compound: RecipeCompoundVariant = {
|
|
250
|
-
* conditions: { variant: "solid", color: "brand" },
|
|
251
|
-
* className: "shadow-lg bg-brand-dark",
|
|
252
|
-
* };
|
|
253
|
-
* ```
|
|
254
|
-
*/
|
|
255
|
-
interface RecipeCompoundVariant {
|
|
256
|
-
conditions: Record<string, RecipeVariantValue>;
|
|
257
|
-
className: RecipeStyle;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Defines the complete styling recipe for a single component.
|
|
261
|
-
*
|
|
262
|
-
* A recipe consists of:
|
|
263
|
-
* - **base**: styles applied to every instance of the component.
|
|
264
|
-
* - **variants**: a set of variant groups (e.g., `size`, `color`, `variant`).
|
|
265
|
-
* - **defaultVariants**: which variant values to use when none are provided.
|
|
266
|
-
* - **compoundVariants**: conditional styles that apply when multiple variant conditions are met.
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* ```ts
|
|
270
|
-
* const buttonRecipe: RecipeDefinition = {
|
|
271
|
-
* base: "inline-flex items-center justify-center rounded font-medium transition-colors",
|
|
272
|
-
* variants: {
|
|
273
|
-
* variant: {
|
|
274
|
-
* solid: "bg-brand text-white hover:bg-brand-dark",
|
|
275
|
-
* outline: "border-2 border-brand text-brand hover:bg-brand/10",
|
|
276
|
-
* ghost: "text-brand hover:bg-brand/10",
|
|
277
|
-
* },
|
|
278
|
-
* size: {
|
|
279
|
-
* sm: "px-3 py-1 text-sm",
|
|
280
|
-
* md: "px-4 py-2 text-base",
|
|
281
|
-
* lg: "px-6 py-3 text-lg",
|
|
282
|
-
* },
|
|
283
|
-
* },
|
|
284
|
-
* defaultVariants: {
|
|
285
|
-
* variant: "solid",
|
|
286
|
-
* size: "md",
|
|
287
|
-
* },
|
|
288
|
-
* compoundVariants: [
|
|
289
|
-
* {
|
|
290
|
-
* conditions: { variant: "solid", size: "lg" },
|
|
291
|
-
* className: "shadow-lg",
|
|
292
|
-
* },
|
|
293
|
-
* ],
|
|
294
|
-
* };
|
|
295
|
-
* ```
|
|
296
|
-
*/
|
|
297
|
-
interface RecipeDefinition {
|
|
65
|
+
type ButtonGroupSpacing = "none" | "sm" | "md" | "lg";
|
|
66
|
+
interface ButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "size">, Omit<BaseProps, "unstyled">, SizeProps, OrientationProps {
|
|
298
67
|
/**
|
|
299
|
-
*
|
|
300
|
-
* These are combined with the variant classes.
|
|
68
|
+
* Whether adjacent buttons should visually connect.
|
|
301
69
|
*
|
|
302
|
-
* @
|
|
303
|
-
* ```ts
|
|
304
|
-
* base: "flex items-center gap-2"
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
base?: RecipeStyle;
|
|
308
|
-
/**
|
|
309
|
-
* Variant groups.
|
|
310
|
-
* Each key defines a variant prop name (e.g., `size`, `color`).
|
|
311
|
-
* The value is a map of variant option → CSS classes.
|
|
312
|
-
*
|
|
313
|
-
* @example
|
|
314
|
-
* ```ts
|
|
315
|
-
* variants: {
|
|
316
|
-
* size: {
|
|
317
|
-
* sm: "text-sm px-3 py-1",
|
|
318
|
-
* md: "text-base px-4 py-2",
|
|
319
|
-
* },
|
|
320
|
-
* color: {
|
|
321
|
-
* brand: "bg-brand text-white",
|
|
322
|
-
* destructive: "bg-red-500 text-white",
|
|
323
|
-
* },
|
|
324
|
-
* }
|
|
325
|
-
* ```
|
|
326
|
-
*/
|
|
327
|
-
variants?: Record<string, RecipeVariant>;
|
|
328
|
-
/**
|
|
329
|
-
* Variants used when no explicit prop is provided.
|
|
330
|
-
*
|
|
331
|
-
* Supports string, boolean, and numeric values.
|
|
332
|
-
*
|
|
333
|
-
* @example
|
|
334
|
-
* ```ts
|
|
335
|
-
* defaultVariants: {
|
|
336
|
-
* size: "md",
|
|
337
|
-
* rounded: false,
|
|
338
|
-
* }
|
|
339
|
-
* ```
|
|
70
|
+
* @default false
|
|
340
71
|
*/
|
|
341
|
-
|
|
72
|
+
attached?: boolean;
|
|
342
73
|
/**
|
|
343
|
-
*
|
|
344
|
-
* This is useful for special combinations that require additional styling.
|
|
74
|
+
* Space between group items when not attached.
|
|
345
75
|
*
|
|
346
|
-
* @
|
|
347
|
-
* ```ts
|
|
348
|
-
* compoundVariants: [
|
|
349
|
-
* {
|
|
350
|
-
* conditions: { variant: "solid", color: "brand" },
|
|
351
|
-
* className: "shadow-lg",
|
|
352
|
-
* },
|
|
353
|
-
* {
|
|
354
|
-
* conditions: { size: "lg", color: "destructive" },
|
|
355
|
-
* className: "uppercase",
|
|
356
|
-
* },
|
|
357
|
-
* ]
|
|
358
|
-
* ```
|
|
76
|
+
* @default "md"
|
|
359
77
|
*/
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* A collection of component recipes, keyed by component name.
|
|
364
|
-
* Each component has its own `RecipeDefinition`.
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```ts
|
|
368
|
-
* const recipes: RecipeCollection = {
|
|
369
|
-
* Button: buttonRecipe,
|
|
370
|
-
* Card: cardRecipe,
|
|
371
|
-
* Input: inputRecipe,
|
|
372
|
-
* };
|
|
373
|
-
* ```
|
|
374
|
-
*/
|
|
375
|
-
type RecipeCollection = Record<string, RecipeDefinition>;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* The primitive value type for any design token.
|
|
379
|
-
* Can be a CSS value as a string (e.g., "16px", "#fff", "1.5rem")
|
|
380
|
-
* or a unitless number (e.g., 0, 1.5, 4).
|
|
381
|
-
*
|
|
382
|
-
* @example
|
|
383
|
-
* ```ts
|
|
384
|
-
* const fontSize: TokenValue = "1.25rem";
|
|
385
|
-
* const opacity: TokenValue = 0.8;
|
|
386
|
-
* ```
|
|
387
|
-
*/
|
|
388
|
-
type TokenValue = string | number;
|
|
389
|
-
/**
|
|
390
|
-
* A wrapper around a single design value.
|
|
391
|
-
* @template T - The specific TokenValue type (defaults to string | number).
|
|
392
|
-
*
|
|
393
|
-
* Every leaf in the token tree is a TokenDefinition.
|
|
394
|
-
*
|
|
395
|
-
* @example
|
|
396
|
-
* ```ts
|
|
397
|
-
* const blue500: TokenDefinition<string> = { value: "#3b82f6" };
|
|
398
|
-
* const spacing4: TokenDefinition<number> = { value: 4 };
|
|
399
|
-
* ```
|
|
400
|
-
*/
|
|
401
|
-
interface TokenDefinition<T extends TokenValue = TokenValue> {
|
|
402
|
-
value: T;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* A recursive structure that allows nested token collections.
|
|
406
|
-
* Keys are arbitrary strings and values are either a leaf (TokenDefinition)
|
|
407
|
-
* or another nested group.
|
|
408
|
-
*
|
|
409
|
-
* This enables hierarchical paths like:
|
|
410
|
-
* - colors.blue.500
|
|
411
|
-
* - spacing.4
|
|
412
|
-
* - radii.md
|
|
413
|
-
*
|
|
414
|
-
* @example
|
|
415
|
-
* ```ts
|
|
416
|
-
* const tokens: TokenGroup = {
|
|
417
|
-
* colors: {
|
|
418
|
-
* blue: {
|
|
419
|
-
* 50: { value: "#eff6ff" },
|
|
420
|
-
* 500: { value: "#3b82f6" },
|
|
421
|
-
* },
|
|
422
|
-
* red: { value: "#ef4444" }, // direct leaf
|
|
423
|
-
* },
|
|
424
|
-
* spacing: {
|
|
425
|
-
* sm: { value: "8px" },
|
|
426
|
-
* md: { value: "16px" },
|
|
427
|
-
* },
|
|
428
|
-
* };
|
|
429
|
-
* ```
|
|
430
|
-
*/
|
|
431
|
-
interface TokenGroup {
|
|
432
|
-
[key: string]: TokenDefinition | TokenGroup;
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* A flat collection of color values for a single color family.
|
|
436
|
-
* Keys typically represent shades (e.g., "50", "100", "500", "900").
|
|
437
|
-
* Each value is a TokenDefinition<string> representing a CSS color.
|
|
438
|
-
*
|
|
439
|
-
* @example
|
|
440
|
-
* ```ts
|
|
441
|
-
* const blueScale: ColorScale = {
|
|
442
|
-
* 50: { value: "#eff6ff" },
|
|
443
|
-
* 100: { value: "#dbeafe" },
|
|
444
|
-
* 500: { value: "#3b82f6" },
|
|
445
|
-
* 900: { value: "#1e3a8a" },
|
|
446
|
-
* };
|
|
447
|
-
* ```
|
|
448
|
-
*/
|
|
449
|
-
interface ColorScale {
|
|
450
|
-
[key: string]: TokenDefinition<string>;
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* A collection of color scales and/or direct color tokens.
|
|
454
|
-
* Keys are colour family names (e.g., "blue", "gray", "brand").
|
|
455
|
-
* Values can be a full ColorScale or a single TokenDefinition<string>.
|
|
456
|
-
*
|
|
457
|
-
* @example
|
|
458
|
-
* ```ts
|
|
459
|
-
* const colors: ColorTokens = {
|
|
460
|
-
* blue: { 50: { value: "#eff6ff" }, 500: { value: "#3b82f6" } },
|
|
461
|
-
* gray: { 100: { value: "#f3f4f6" }, 900: { value: "#111827" } },
|
|
462
|
-
* brand: { value: "#2563eb" }, // flat single color
|
|
463
|
-
* };
|
|
464
|
-
* ```
|
|
465
|
-
*/
|
|
466
|
-
interface ColorTokens {
|
|
467
|
-
[key: string]: ColorScale | TokenDefinition<string>;
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* A flat map of spacing tokens.
|
|
471
|
-
* Keys describe the spacing size (e.g., "xs", "md", "lg", "4").
|
|
472
|
-
* Values are TokenDefinition<string> containing a CSS length.
|
|
473
|
-
*
|
|
474
|
-
* @example
|
|
475
|
-
* ```ts
|
|
476
|
-
* const spacing: SpacingTokens = {
|
|
477
|
-
* xs: { value: "4px" },
|
|
478
|
-
* md: { value: "16px" },
|
|
479
|
-
* lg: { value: "24px" },
|
|
480
|
-
* };
|
|
481
|
-
* ```
|
|
482
|
-
*/
|
|
483
|
-
interface SpacingTokens {
|
|
484
|
-
[key: string]: TokenDefinition<string>;
|
|
78
|
+
spacing?: ButtonGroupSpacing;
|
|
485
79
|
}
|
|
486
|
-
|
|
487
|
-
* A flat map of border‑radius tokens.
|
|
488
|
-
* Keys describe the radius size (e.g., "sm", "md", "full").
|
|
489
|
-
* Values are TokenDefinition<string> containing a CSS length.
|
|
490
|
-
*/
|
|
491
|
-
interface RadiusTokens {
|
|
492
|
-
[key: string]: TokenDefinition<string>;
|
|
80
|
+
interface ButtonGroupSeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, OrientationProps {
|
|
493
81
|
}
|
|
494
|
-
|
|
495
|
-
* A flat map of font‑family tokens.
|
|
496
|
-
* Keys describe the font name (e.g., "body", "heading", "mono").
|
|
497
|
-
* Values are TokenDefinition<string> containing a CSS font‑family value.
|
|
498
|
-
*/
|
|
499
|
-
interface FontTokens {
|
|
500
|
-
[key: string]: TokenDefinition<string>;
|
|
82
|
+
interface ButtonGroupTextProps extends HTMLAttributes<HTMLSpanElement>, Omit<BaseProps, "unstyled"> {
|
|
501
83
|
}
|
|
502
|
-
|
|
503
|
-
* A flat map of font‑size tokens.
|
|
504
|
-
* Keys describe the size name (e.g., "xs", "sm", "base", "xl").
|
|
505
|
-
* Values are TokenDefinition<string> containing a CSS font‑size.
|
|
506
|
-
*/
|
|
507
|
-
interface FontSizeTokens {
|
|
508
|
-
[key: string]: TokenDefinition<string>;
|
|
84
|
+
interface ButtonGroupLabelProps extends HTMLAttributes<HTMLSpanElement>, Omit<BaseProps, "unstyled"> {
|
|
509
85
|
}
|
|
510
|
-
|
|
511
|
-
* A flat map of font‑weight tokens.
|
|
512
|
-
* Keys describe the weight name (e.g., "normal", "medium", "bold").
|
|
513
|
-
* Values are TokenDefinition<string> containing a CSS font‑weight (e.g., "400", "700").
|
|
514
|
-
*/
|
|
515
|
-
interface FontWeightTokens {
|
|
516
|
-
[key: string]: TokenDefinition<string>;
|
|
86
|
+
interface ButtonGroupItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
517
87
|
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
[key: string]: TokenDefinition<string>;
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* A flat map of letter‑spacing tokens.
|
|
528
|
-
* Keys describe the spacing name (e.g., "tight", "wide", "wider").
|
|
529
|
-
* Values are TokenDefinition<string> containing a CSS letter‑spacing.
|
|
530
|
-
*/
|
|
531
|
-
interface LetterSpacingTokens {
|
|
532
|
-
[key: string]: TokenDefinition<string>;
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* A flat map of shadow tokens.
|
|
536
|
-
* Keys describe the shadow name (e.g., "sm", "md", "lg", "xl").
|
|
537
|
-
* Values are TokenDefinition<string> containing a CSS box‑shadow value.
|
|
538
|
-
*/
|
|
539
|
-
interface ShadowTokens {
|
|
540
|
-
[key: string]: TokenDefinition<string>;
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* A flat map of animation tokens.
|
|
544
|
-
* Keys describe the animation name (e.g., "fade", "slide", "spin").
|
|
545
|
-
* Values are TokenDefinition<string> containing a CSS animation shorthand or keyframes name.
|
|
546
|
-
*/
|
|
547
|
-
interface AnimationTokens {
|
|
548
|
-
[key: string]: TokenDefinition<string>;
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Primitive (raw) design tokens.
|
|
552
|
-
* These are mode‑agnostic values that serve as the foundation for semantic tokens.
|
|
553
|
-
* Each category is optional; you may define only the ones you need.
|
|
554
|
-
*
|
|
555
|
-
* The index signature allows custom token groups (e.g., "zIndices", "borders", "opacities")
|
|
556
|
-
* to be added as the design system evolves.
|
|
557
|
-
*
|
|
558
|
-
* @example
|
|
559
|
-
* ```ts
|
|
560
|
-
* const tokens: DesignTokens = {
|
|
561
|
-
* colors: {
|
|
562
|
-
* blue: { 50: { value: "#eff6ff" }, 500: { value: "#3b82f6" } },
|
|
563
|
-
* gray: { 100: { value: "#f3f4f6" }, 900: { value: "#111827" } },
|
|
564
|
-
* },
|
|
565
|
-
* spacing: { sm: { value: "8px" }, md: { value: "16px" } },
|
|
566
|
-
* radii: { md: { value: "8px" } },
|
|
567
|
-
* };
|
|
568
|
-
* ```
|
|
569
|
-
*/
|
|
570
|
-
interface DesignTokens {
|
|
571
|
-
colors?: ColorTokens;
|
|
572
|
-
spacing?: SpacingTokens;
|
|
573
|
-
radii?: RadiusTokens;
|
|
574
|
-
fonts?: FontTokens;
|
|
575
|
-
fontSizes?: FontSizeTokens;
|
|
576
|
-
fontWeights?: FontWeightTokens;
|
|
577
|
-
lineHeights?: LineHeightTokens;
|
|
578
|
-
letterSpacings?: LetterSpacingTokens;
|
|
579
|
-
shadows?: ShadowTokens;
|
|
580
|
-
animations?: AnimationTokens;
|
|
581
|
-
[key: string]: unknown;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* A value that can differ between light and dark color modes.
|
|
585
|
-
* @template T - The type of the value (defaults to string).
|
|
586
|
-
*
|
|
587
|
-
* @example
|
|
588
|
-
* ```ts
|
|
589
|
-
* const brandColor: ColorModeValue = {
|
|
590
|
-
* light: "#3b82f6",
|
|
591
|
-
* dark: "#60a5fa",
|
|
592
|
-
* };
|
|
593
|
-
* ```
|
|
594
|
-
*/
|
|
595
|
-
type ColorModeValue<T = string> = {
|
|
596
|
-
light: T;
|
|
597
|
-
dark: T;
|
|
88
|
+
|
|
89
|
+
declare const ButtonGroup: react.ForwardRefExoticComponent<ButtonGroupProps & react.RefAttributes<HTMLDivElement>> & {
|
|
90
|
+
Separator: react.ForwardRefExoticComponent<ButtonGroupSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
Text: react.ForwardRefExoticComponent<ButtonGroupTextProps & react.RefAttributes<HTMLSpanElement>>;
|
|
92
|
+
Label: react.ForwardRefExoticComponent<ButtonGroupLabelProps & react.RefAttributes<HTMLSpanElement>>;
|
|
93
|
+
Item: react.ForwardRefExoticComponent<ButtonGroupItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
598
94
|
};
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
*
|
|
606
|
-
* @example
|
|
607
|
-
* ```ts
|
|
608
|
-
* const surfaceToken: SemanticToken = {
|
|
609
|
-
* value: { light: "#ffffff", dark: "#1e293b" }
|
|
610
|
-
* };
|
|
611
|
-
* const dangerToken: SemanticToken = { value: "#ef4444" }; // static
|
|
612
|
-
* ```
|
|
613
|
-
*/
|
|
614
|
-
interface SemanticToken<T extends TokenValue = string> {
|
|
615
|
-
value: T | ColorModeValue<T>;
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* A flat record of semantic color tokens.
|
|
619
|
-
* Keys describe the color role (e.g., "brand", "surface", "text", "danger").
|
|
620
|
-
* Values are SemanticToken<string> that resolve to a CSS color.
|
|
621
|
-
*
|
|
622
|
-
* @example
|
|
623
|
-
* ```ts
|
|
624
|
-
* const semanticColors: SemanticColorTokens = {
|
|
625
|
-
* brand: { value: { light: "#3b82f6", dark: "#60a5fa" } },
|
|
626
|
-
* surface: { value: { light: "#ffffff", dark: "#1e293b" } },
|
|
627
|
-
* text: { value: { light: "#111827", dark: "#f1f5f9" } },
|
|
628
|
-
* danger: { value: "#ef4444" }, // static
|
|
629
|
-
* };
|
|
630
|
-
* ```
|
|
631
|
-
*/
|
|
632
|
-
interface SemanticColorTokens {
|
|
633
|
-
[key: string]: SemanticToken<string>;
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* Container for all semantic tokens.
|
|
637
|
-
* Currently only `colors` is defined, but the index signature allows
|
|
638
|
-
* future categories like `shadows`, `borders`, or `opacities`.
|
|
639
|
-
*/
|
|
640
|
-
interface SemanticTokens {
|
|
641
|
-
colors?: SemanticColorTokens;
|
|
642
|
-
[key: string]: unknown;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* A set of CSS properties that define a typography style.
|
|
646
|
-
* All properties are optional – you can compose styles incrementally.
|
|
647
|
-
*
|
|
648
|
-
* @example
|
|
649
|
-
* ```ts
|
|
650
|
-
* const headingStyle: TextStyle = {
|
|
651
|
-
* fontFamily: "Inter, sans-serif",
|
|
652
|
-
* fontSize: "2rem",
|
|
653
|
-
* fontWeight: 700,
|
|
654
|
-
* lineHeight: "1.2",
|
|
655
|
-
* letterSpacing: "-0.02em",
|
|
656
|
-
* };
|
|
657
|
-
* ```
|
|
658
|
-
*/
|
|
659
|
-
interface TypographyStyle {
|
|
660
|
-
fontFamily?: string;
|
|
661
|
-
fontSize?: string;
|
|
662
|
-
fontWeight?: string | number;
|
|
663
|
-
lineHeight?: string;
|
|
664
|
-
letterSpacing?: string;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* A collection of named text styles.
|
|
668
|
-
* Keys are style names (e.g., "heading", "body", "caption", "label").
|
|
669
|
-
*
|
|
670
|
-
* @example
|
|
671
|
-
* ```ts
|
|
672
|
-
* const typography: Typography = {
|
|
673
|
-
* heading: { fontSize: "2rem", fontWeight: 700 },
|
|
674
|
-
* body: { fontSize: "1rem", lineHeight: "1.5" },
|
|
675
|
-
* };
|
|
676
|
-
* ```
|
|
677
|
-
*/
|
|
678
|
-
type Typography = Record<string, TypographyStyle>;
|
|
679
|
-
/**
|
|
680
|
-
* A set of CSS properties that define the dimensions and spacing
|
|
681
|
-
* for a component at a specific size.
|
|
682
|
-
*
|
|
683
|
-
* Used to build size‑variant scales for components (e.g., "sm", "md", "lg").
|
|
684
|
-
*
|
|
685
|
-
* @example
|
|
686
|
-
* ```ts
|
|
687
|
-
* const buttonSize: SizeToken = {
|
|
688
|
-
* height: "40px",
|
|
689
|
-
* paddingX: "16px",
|
|
690
|
-
* fontSize: "1rem",
|
|
691
|
-
* iconSize: "20px",
|
|
692
|
-
* radius: "8px",
|
|
693
|
-
* };
|
|
694
|
-
* ```
|
|
695
|
-
*/
|
|
696
|
-
interface SizeToken {
|
|
697
|
-
height?: string;
|
|
698
|
-
width?: string;
|
|
699
|
-
paddingX?: string;
|
|
700
|
-
paddingY?: string;
|
|
701
|
-
fontSize?: string;
|
|
702
|
-
gap?: string;
|
|
703
|
-
iconSize?: string;
|
|
704
|
-
radius?: string;
|
|
95
|
+
|
|
96
|
+
interface ButtonGroupContextValue {
|
|
97
|
+
orientation: Orientation;
|
|
98
|
+
attached: boolean;
|
|
99
|
+
spacing: ButtonGroupSpacing;
|
|
100
|
+
size?: ButtonProps["size"];
|
|
705
101
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
* Keys are size names (e.g., "sm", "md", "lg", "xl").
|
|
709
|
-
*
|
|
710
|
-
* @example
|
|
711
|
-
* ```ts
|
|
712
|
-
* const sizes: SizeScale = {
|
|
713
|
-
* sm: { height: "32px", paddingX: "12px", fontSize: "0.875rem" },
|
|
714
|
-
* md: { height: "40px", paddingX: "16px", fontSize: "1rem" },
|
|
715
|
-
* lg: { height: "48px", paddingX: "24px", fontSize: "1.125rem" },
|
|
716
|
-
* };
|
|
717
|
-
* ```
|
|
718
|
-
*/
|
|
719
|
-
type SizeScale = Record<string, SizeToken>;
|
|
720
|
-
/**
|
|
721
|
-
* Defines the transition properties for a theme change.
|
|
722
|
-
* `type` refers to a base transition key (imported from BaseTransition).
|
|
723
|
-
* `duration` and `delay` are in milliseconds.
|
|
724
|
-
* `easing` is a CSS easing function.
|
|
725
|
-
*/
|
|
726
|
-
interface ThemeTransition {
|
|
727
|
-
type?: BaseTransition;
|
|
728
|
-
duration?: number;
|
|
729
|
-
delay?: number;
|
|
730
|
-
easing?: string;
|
|
102
|
+
interface ButtonGroupItemContextValue {
|
|
103
|
+
embedded: true;
|
|
731
104
|
}
|
|
105
|
+
declare const ButtonGroupContext: react.Context<ButtonGroupContextValue>;
|
|
106
|
+
declare const ButtonGroupItemContext: react.Context<ButtonGroupItemContextValue | null>;
|
|
732
107
|
/**
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
* component recipes, a global intensity, legacy tokens, and size scales.
|
|
736
|
-
*
|
|
737
|
-
* @property tokens - Raw design values (colors, spacing, radii, etc.).
|
|
738
|
-
* @property semanticTokens - Role‑based tokens that adapt to color mode.
|
|
739
|
-
* @property typography - Reusable typography styles.
|
|
740
|
-
* @property recipes - Component‑specific styles (from RecipeCollection).
|
|
741
|
-
* @property intensity - A global multiplier for visual prominence (e.g., 0.8, 1, 1.2).
|
|
742
|
-
* @property light - Legacy theme tokens for light mode (kept for migration).
|
|
743
|
-
* @property dark - Legacy theme tokens for dark mode (kept for migration).
|
|
744
|
-
* @property sizes - Legacy component size scale (will move to recipes).
|
|
108
|
+
* Hook to consume the button group context.
|
|
109
|
+
* Throws an error if used outside of a `ButtonGroup` provider.
|
|
745
110
|
*/
|
|
746
|
-
|
|
747
|
-
tokens: DesignTokens;
|
|
748
|
-
semanticTokens: SemanticTokens;
|
|
749
|
-
typography: Typography;
|
|
750
|
-
recipes: RecipeCollection;
|
|
751
|
-
intensity: number;
|
|
752
|
-
sizes: SizeScale;
|
|
753
|
-
}
|
|
111
|
+
declare function useButtonGroupContext(): ButtonGroupContextValue;
|
|
754
112
|
/**
|
|
755
|
-
*
|
|
756
|
-
*
|
|
113
|
+
* Hook to consume the button group context without throwing.
|
|
114
|
+
* Returns the default context if used outside a provider.
|
|
757
115
|
*/
|
|
758
|
-
|
|
116
|
+
declare function useOptionalButtonGroupContext(): ButtonGroupContextValue;
|
|
759
117
|
/**
|
|
760
|
-
*
|
|
761
|
-
*
|
|
118
|
+
* Hook to check if a button is embedded inside a `ButtonGroupItem`.
|
|
119
|
+
* Returns `true` if used inside an item, otherwise `false`.
|
|
762
120
|
*/
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
default: number;
|
|
766
|
-
bold: number;
|
|
767
|
-
}
|
|
768
|
-
interface ThemeOverride {
|
|
769
|
-
/**
|
|
770
|
-
* Override primitive design tokens.
|
|
771
|
-
* Allows partial updates to raw values like colors, spacing, radii, etc.
|
|
772
|
-
*
|
|
773
|
-
* @example
|
|
774
|
-
* ```ts
|
|
775
|
-
* tokens: {
|
|
776
|
-
* colors: { blue: { 500: { value: "#1d4ed8" } } },
|
|
777
|
-
* spacing: { md: { value: "20px" } },
|
|
778
|
-
* }
|
|
779
|
-
* ```
|
|
780
|
-
*/
|
|
781
|
-
tokens?: DeepPartial<DesignTokens>;
|
|
782
|
-
/**
|
|
783
|
-
* Override semantic tokens.
|
|
784
|
-
* Allows partial updates to role‑based tokens (brand, surface, text, etc.)
|
|
785
|
-
* that can adapt to light/dark modes.
|
|
786
|
-
*
|
|
787
|
-
* @example
|
|
788
|
-
* ```ts
|
|
789
|
-
* semanticTokens: {
|
|
790
|
-
* colors: {
|
|
791
|
-
* brand: { value: { light: "#1d4ed8", dark: "#60a5fa" } },
|
|
792
|
-
* surface: { value: { light: "#ffffff", dark: "#0f172a" } },
|
|
793
|
-
* },
|
|
794
|
-
* }
|
|
795
|
-
* ```
|
|
796
|
-
*/
|
|
797
|
-
semanticTokens?: DeepPartial<SemanticTokens>;
|
|
798
|
-
/**
|
|
799
|
-
* Override reusable text styles.
|
|
800
|
-
* Allows partial updates to typography presets like heading, body, caption, etc.
|
|
801
|
-
*
|
|
802
|
-
* @example
|
|
803
|
-
* ```ts
|
|
804
|
-
* typography: {
|
|
805
|
-
* heading: { fontSize: "2.5rem", fontWeight: 800 },
|
|
806
|
-
* body: { fontSize: "1.125rem", lineHeight: "1.75" },
|
|
807
|
-
* }
|
|
808
|
-
* ```
|
|
809
|
-
*/
|
|
810
|
-
typography?: DeepPartial<Typography>;
|
|
811
|
-
/**
|
|
812
|
-
* Override component recipes.
|
|
813
|
-
* Allows modifying the base styles, variants, default variants, and compound variants
|
|
814
|
-
* for any component (e.g., Button, Card, Input) without rewriting the entire theme.
|
|
815
|
-
*
|
|
816
|
-
* Each key is a component name, and the value is a deep partial of its RecipeDefinition.
|
|
817
|
-
* This means you can override only specific variants or classes while keeping the rest intact.
|
|
818
|
-
*
|
|
819
|
-
* @example
|
|
820
|
-
* ```ts
|
|
821
|
-
* recipes: {
|
|
822
|
-
* Button: {
|
|
823
|
-
* base: "custom-base-class inline-flex items-center",
|
|
824
|
-
* variants: {
|
|
825
|
-
* size: {
|
|
826
|
-
* md: "px-6 py-3 text-lg", // override only the "md" size
|
|
827
|
-
* },
|
|
828
|
-
* },
|
|
829
|
-
* compoundVariants: [
|
|
830
|
-
* {
|
|
831
|
-
* conditions: { variant: "solid", color: "brand" },
|
|
832
|
-
* className: "shadow-lg custom-brand-shadow",
|
|
833
|
-
* },
|
|
834
|
-
* ],
|
|
835
|
-
* },
|
|
836
|
-
* Card: {
|
|
837
|
-
* base: "rounded-xl p-6 bg-surface",
|
|
838
|
-
* },
|
|
839
|
-
* }
|
|
840
|
-
* ```
|
|
841
|
-
*/
|
|
842
|
-
recipes?: DeepPartial<RecipeCollection>;
|
|
843
|
-
/**
|
|
844
|
-
* Override the global visual intensity.
|
|
845
|
-
* A multiplier for effects like shadows, saturation, or contrast.
|
|
846
|
-
* Typical values: 0.8 (subtle), 1.0 (default), 1.2 (bold).
|
|
847
|
-
*
|
|
848
|
-
* @example
|
|
849
|
-
* ```ts
|
|
850
|
-
* intensity: 1.1 // Slightly bolder than default
|
|
851
|
-
* ```
|
|
852
|
-
*/
|
|
853
|
-
intensity?: number;
|
|
854
|
-
/**
|
|
855
|
-
* Override legacy component size scales.
|
|
856
|
-
* Allows updating specific size tokens (height, padding, fontSize, etc.)
|
|
857
|
-
* for a given size name (e.g., "sm", "md", "lg").
|
|
858
|
-
*
|
|
859
|
-
* This will eventually be replaced by component‑specific size variants in recipes.
|
|
860
|
-
*
|
|
861
|
-
* @example
|
|
862
|
-
* ```ts
|
|
863
|
-
* sizes: {
|
|
864
|
-
* md: { height: "44px", paddingX: "20px" }, // override only "md" size
|
|
865
|
-
* lg: { height: "52px", fontSize: "1.25rem" },
|
|
866
|
-
* }
|
|
867
|
-
* ```
|
|
868
|
-
*/
|
|
869
|
-
sizes?: Record<string, Partial<SizeToken>>;
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* Represents the active color mode.
|
|
873
|
-
* - "light": force light mode.
|
|
874
|
-
* - "dark": force dark mode.
|
|
875
|
-
* - "system": follow the user's operating system preference.
|
|
876
|
-
*/
|
|
877
|
-
type ColorMode = "light" | "dark" | "system";
|
|
121
|
+
declare function useButtonGroupItemContext(): boolean;
|
|
122
|
+
declare function useOptionalButtonGroupItemContext(): ButtonGroupItemContextValue | null;
|
|
878
123
|
|
|
879
|
-
type ThemeTogglerVariant = Exclude<ButtonVariant,
|
|
124
|
+
type ThemeTogglerVariant = Exclude<ButtonVariant, "link">;
|
|
880
125
|
type ThemeTogglerDisplay = "buttons" | "cycle";
|
|
881
126
|
type ThemeTogglerColor = Exclude<BaseColor, "destructive" | "warning" | "success" | "white" | "info">;
|
|
882
|
-
interface ThemeTogglerProps extends Omit<BaseProps, "
|
|
883
|
-
variant?:
|
|
884
|
-
activeVariant?: ThemeTogglerVariant;
|
|
127
|
+
interface ThemeTogglerProps extends Omit<BaseProps, "style">, OrientationProps, VariantProps<ButtonVariant> {
|
|
128
|
+
variant?: ButtonVariant;
|
|
885
129
|
color?: ButtonProps["color"];
|
|
130
|
+
activeVariant?: ButtonVariant;
|
|
886
131
|
activeColor?: ButtonProps["color"];
|
|
887
132
|
size?: ButtonProps["size"];
|
|
888
133
|
iconOnly?: boolean;
|
|
889
134
|
allowSystem?: boolean;
|
|
890
|
-
orientation?: Orientation;
|
|
891
135
|
rounded?: boolean;
|
|
892
136
|
labels?: {
|
|
893
137
|
light?: string;
|
|
@@ -895,119 +139,178 @@ interface ThemeTogglerProps extends Omit<BaseProps, "children"> {
|
|
|
895
139
|
system?: string;
|
|
896
140
|
};
|
|
897
141
|
icons?: {
|
|
898
|
-
light?:
|
|
899
|
-
dark?:
|
|
900
|
-
system?:
|
|
142
|
+
light?: ReactNode;
|
|
143
|
+
dark?: ReactNode;
|
|
144
|
+
system?: ReactNode;
|
|
901
145
|
};
|
|
902
|
-
buttonProps?:
|
|
903
|
-
display?:
|
|
904
|
-
|
|
146
|
+
buttonProps?: ButtonProps;
|
|
147
|
+
display?: "buttons" | "cycle";
|
|
148
|
+
animated?: boolean;
|
|
149
|
+
transition?: ThemeTogglerTransition;
|
|
150
|
+
indicatorClassName?: string;
|
|
151
|
+
indicatorStyle?: CSSProperties;
|
|
905
152
|
}
|
|
906
153
|
|
|
907
|
-
declare function ThemeToggler({ variant,
|
|
154
|
+
declare function ThemeToggler({ variant, color, activeVariant, activeColor, size, iconOnly, allowSystem, orientation, rounded, unstyled, labels, icons, className, buttonProps, display, animated, transition, }: ThemeTogglerProps): react.JSX.Element;
|
|
908
155
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
156
|
+
/**
|
|
157
|
+
* Internal. Not part of the public API — do not re-export from the package index.
|
|
158
|
+
* Callers resolve `type` themselves. This function has no password concept.
|
|
159
|
+
*/
|
|
160
|
+
type BaseInputExtraAdornmentContext = {
|
|
161
|
+
iconSize: string | number;
|
|
162
|
+
/** Motion-gated icon-button classes. Transition styles are omitted when motion is off. */
|
|
163
|
+
iconButtonClass: string;
|
|
164
|
+
};
|
|
165
|
+
type BaseInputProps = Omit<ComponentPropsWithoutRef<"input">, "size" | "type"> & BaseProps & SizeProps & VariantProps<InputVariant> & DisabledProps & LoadingProps & FullWidthProps & ClearableProps & UndoRedoProps & ValueProps<string | number> & StateProps & TrimProps & TypographyProps & {
|
|
166
|
+
type: HTMLInputTypeAttribute;
|
|
913
167
|
inputClassName?: string;
|
|
914
|
-
|
|
915
|
-
rounded?: boolean;
|
|
168
|
+
scrollIntoViewOnError?: boolean;
|
|
916
169
|
startIcon?: ReactNode;
|
|
917
170
|
endIcon?: ReactNode;
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
171
|
+
rounded?: boolean;
|
|
172
|
+
motion?: boolean;
|
|
173
|
+
validatePattern?: string | RegExp;
|
|
174
|
+
patternMessage?: string;
|
|
175
|
+
embedded?: boolean;
|
|
176
|
+
extraEndAdornment?: ReactNode | ((ctx: BaseInputExtraAdornmentContext) => ReactNode);
|
|
177
|
+
};
|
|
178
|
+
type InputVariant = "outline" | "filled" | "ghost";
|
|
179
|
+
type InputSize = "xs" | "sm" | "md" | "lg";
|
|
180
|
+
type InputKind = "text" | "email" | "tel" | "url" | "search" | "numeric" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
|
|
181
|
+
type PasswordKind = "password-current" | "password-new";
|
|
182
|
+
type KindDefaultBase = {
|
|
921
183
|
type?: string;
|
|
922
|
-
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
923
184
|
autoComplete?: string;
|
|
924
185
|
placeholder?: string;
|
|
925
186
|
pattern?: string;
|
|
926
187
|
min?: number;
|
|
927
188
|
max?: number;
|
|
928
189
|
step?: number;
|
|
190
|
+
};
|
|
191
|
+
type InputKindDefaults = Record<InputKind, KindDefaultBase & {
|
|
192
|
+
inputMode?: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
|
|
193
|
+
}>;
|
|
194
|
+
type PasswordInputKindDefaults = Record<PasswordKind, KindDefaultBase & {
|
|
195
|
+
inputMode?: "none" | "text";
|
|
929
196
|
}>;
|
|
197
|
+
type InputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
198
|
+
kind?: InputKind;
|
|
199
|
+
hideKindIcon?: boolean;
|
|
200
|
+
type?: HTMLInputTypeAttribute;
|
|
201
|
+
motion?: boolean;
|
|
202
|
+
};
|
|
203
|
+
type PasswordInputProps = Omit<BaseInputProps, "type" | "extraEndAdornment" | "motion"> & {
|
|
204
|
+
motion?: boolean;
|
|
205
|
+
kind?: PasswordKind;
|
|
206
|
+
visible?: boolean;
|
|
207
|
+
defaultVisible?: boolean;
|
|
208
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
209
|
+
};
|
|
930
210
|
|
|
931
|
-
declare const Input:
|
|
211
|
+
declare const Input: _splenddev_kreativ_core.KuiComponent<InputProps, HTMLInputElement>;
|
|
932
212
|
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
213
|
+
interface FormFieldControlProps {
|
|
214
|
+
children: react.ReactElement;
|
|
215
|
+
}
|
|
216
|
+
declare const FormFieldControl: _splenddev_kreativ_core.KuiComponent<FormFieldControlProps, unknown>;
|
|
217
|
+
|
|
218
|
+
type SingleFormControlComponent<P extends object = any> = KuiComponent<P, any> & {
|
|
219
|
+
__kui: {
|
|
220
|
+
formControl: "single";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Forge sets this on a safe, motionGated component at render-start.
|
|
225
|
+
* Data attributes stringify, so both the boolean prop and the "true"
|
|
226
|
+
* attribute count as gated.
|
|
227
|
+
*/
|
|
228
|
+
interface MotionGatedProps {
|
|
229
|
+
"data-kui-motion-gated"?: boolean | "true" | "false";
|
|
230
|
+
}
|
|
231
|
+
type ValuePropConvention = "value" | "checked";
|
|
232
|
+
|
|
233
|
+
interface FormFieldError {
|
|
234
|
+
name: string;
|
|
235
|
+
message: react.ReactNode;
|
|
236
|
+
}
|
|
237
|
+
interface FormFieldMessageProps extends react.HTMLAttributes<HTMLParagraphElement> {
|
|
238
|
+
children?: react.ReactNode;
|
|
239
|
+
forceMount?: boolean;
|
|
240
|
+
"data-kui-motion-gated"?: "true" | "false";
|
|
940
241
|
}
|
|
941
242
|
interface FormFieldMessageProps {
|
|
942
243
|
children?: ReactNode;
|
|
943
244
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
declare namespace FormField {
|
|
947
|
-
var Label: typeof FormFieldLabel;
|
|
948
|
-
var Control: typeof FormFieldControl;
|
|
949
|
-
var Description: typeof FormFieldDescription;
|
|
950
|
-
var Message: typeof FormFieldMessage;
|
|
245
|
+
interface FormFieldLabelProps extends react.LabelHTMLAttributes<HTMLLabelElement> {
|
|
246
|
+
children?: react.ReactNode;
|
|
951
247
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
248
|
+
interface FormFieldDescriptionProps extends react.HTMLAttributes<HTMLParagraphElement> {
|
|
249
|
+
children?: react.ReactNode;
|
|
250
|
+
}
|
|
251
|
+
interface FormFieldRootProps {
|
|
252
|
+
id?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
status?: FormFieldStatus;
|
|
255
|
+
message?: react.ReactNode;
|
|
256
|
+
required?: boolean;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
invalid?: boolean;
|
|
955
259
|
className?: string;
|
|
956
|
-
|
|
260
|
+
children?: react.ReactNode;
|
|
261
|
+
validateOn?: ValidateOn;
|
|
262
|
+
valuePropConvention?: ValuePropConvention;
|
|
263
|
+
}
|
|
264
|
+
interface FormFieldProps$1<P extends object = Record<string, never>> extends Omit<FormFieldRootProps, "children"> {
|
|
265
|
+
as?: SingleFormControlComponent<P>;
|
|
266
|
+
controlProps?: Partial<P>;
|
|
267
|
+
label?: react.ReactNode;
|
|
268
|
+
description?: react.ReactNode;
|
|
269
|
+
message?: react.ReactNode;
|
|
270
|
+
children?: react.ReactNode;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare const FormField: (<P extends object>(props: FormFieldProps$1<P> & {
|
|
274
|
+
ref?: react.Ref<unknown>;
|
|
275
|
+
}) => react.ReactElement | null) & {
|
|
276
|
+
Root: _splenddev_kreativ_core.KuiComponent<FormFieldRootProps, HTMLDivElement>;
|
|
277
|
+
Label: _splenddev_kreativ_core.KuiComponent<FormFieldLabelProps, HTMLLabelElement>;
|
|
278
|
+
Description: _splenddev_kreativ_core.KuiComponent<FormFieldDescriptionProps, HTMLParagraphElement>;
|
|
279
|
+
Message: _splenddev_kreativ_core.KuiComponent<FormFieldMessageProps, HTMLParagraphElement>;
|
|
280
|
+
Control: _splenddev_kreativ_core.KuiComponent<FormFieldControlProps, unknown>;
|
|
281
|
+
};
|
|
957
282
|
|
|
958
|
-
declare
|
|
959
|
-
children: React.ReactNode;
|
|
960
|
-
}): react.JSX.Element;
|
|
283
|
+
declare const FormFieldLabel: _splenddev_kreativ_core.KuiComponent<FormFieldLabelProps, HTMLLabelElement>;
|
|
961
284
|
|
|
962
|
-
declare
|
|
285
|
+
declare const FormFieldDescription: _splenddev_kreativ_core.KuiComponent<FormFieldDescriptionProps, HTMLParagraphElement>;
|
|
963
286
|
|
|
964
|
-
|
|
965
|
-
children: ReactElement<T>;
|
|
966
|
-
};
|
|
967
|
-
declare function FormFieldControl<T = Record<string, unknown>>({ children, }: FormFieldControlProps<T>): react.JSX.Element;
|
|
287
|
+
declare const FormFieldMessage: _splenddev_kreativ_core.KuiComponent<FormFieldMessageProps, HTMLParagraphElement>;
|
|
968
288
|
|
|
969
|
-
interface
|
|
970
|
-
className?: string;
|
|
289
|
+
interface SelectRootProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "children" | "defaultValue">, Omit<BaseProps$1, "children">, Omit<SizeProps$1, "size">, ValueProps$1<string | undefined>, VariantProps$1<InputVariant>, DisabledProps$1, Omit<ClearableProps$1, "onClear">, Omit<StateProps$1, "warning" | "scrollIntoViewOnError"> {
|
|
971
290
|
rounded?: boolean;
|
|
972
|
-
error?: boolean;
|
|
973
|
-
success?: boolean;
|
|
974
|
-
value?: string;
|
|
975
291
|
placeholder?: string;
|
|
976
|
-
defaultValue?: string;
|
|
977
|
-
onValueChange?(value: string | undefined): void;
|
|
978
292
|
required?: boolean;
|
|
979
293
|
name?: string;
|
|
980
|
-
disabled?: boolean;
|
|
981
|
-
clearable?: boolean;
|
|
982
|
-
variant?: InputVariant;
|
|
983
294
|
size?: InputSize;
|
|
984
295
|
children: ReactNode;
|
|
985
296
|
}
|
|
986
|
-
interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"
|
|
987
|
-
className?: string;
|
|
297
|
+
interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "className">, Styleable {
|
|
988
298
|
}
|
|
989
|
-
interface SelectContentProps extends HTMLAttributes<HTMLDivElement
|
|
990
|
-
className?: string;
|
|
299
|
+
interface SelectContentProps extends Omit<HTMLAttributes<HTMLDivElement>, "className">, Styleable {
|
|
991
300
|
}
|
|
992
|
-
interface SelectItemProps extends HTMLAttributes<HTMLDivElement
|
|
301
|
+
interface SelectItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "className">, DisabledProps$1, Styleable {
|
|
993
302
|
value: string;
|
|
994
|
-
disabled?: boolean;
|
|
995
303
|
children: ReactNode;
|
|
996
304
|
}
|
|
997
|
-
interface SelectValueProps {
|
|
305
|
+
interface SelectValueProps extends Styleable {
|
|
998
306
|
placeholder?: string;
|
|
999
|
-
className?: string;
|
|
1000
307
|
}
|
|
1001
|
-
interface SelectGroupProps {
|
|
1002
|
-
children: ReactNode;
|
|
1003
|
-
className?: string;
|
|
308
|
+
interface SelectGroupProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
1004
309
|
}
|
|
1005
|
-
interface SelectLabelProps {
|
|
1006
|
-
children: ReactNode;
|
|
1007
|
-
className?: string;
|
|
310
|
+
interface SelectLabelProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
|
|
1008
311
|
}
|
|
1009
312
|
|
|
1010
|
-
declare function SelectContent({ className, children, ...props }: SelectContentProps): react.JSX.Element
|
|
313
|
+
declare function SelectContent({ className, children, ...props }: SelectContentProps): react.JSX.Element;
|
|
1011
314
|
|
|
1012
315
|
declare function SelectItem({ value, disabled, children, className, ...props }: SelectItemProps): react.JSX.Element;
|
|
1013
316
|
|
|
@@ -1017,18 +320,31 @@ declare function SelectGroup({ children, className }: SelectGroupProps): react.J
|
|
|
1017
320
|
|
|
1018
321
|
declare function SelectLabel({ children, className }: SelectLabelProps): react.JSX.Element;
|
|
1019
322
|
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
var Item: typeof SelectItem;
|
|
1025
|
-
var Value: typeof SelectValue;
|
|
1026
|
-
var Group: typeof SelectGroup;
|
|
1027
|
-
var Label: typeof SelectLabel;
|
|
323
|
+
interface SelectOption {
|
|
324
|
+
value: string;
|
|
325
|
+
label: react.ReactNode;
|
|
326
|
+
disabled?: boolean;
|
|
1028
327
|
}
|
|
328
|
+
interface SelectProps extends SelectRootProps {
|
|
329
|
+
options?: SelectOption[];
|
|
330
|
+
}
|
|
331
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLDivElement>> & {
|
|
332
|
+
Root: _splenddev_kreativ_core.KuiComponent<SelectRootProps, HTMLDivElement>;
|
|
333
|
+
Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
334
|
+
Content: typeof SelectContent;
|
|
335
|
+
Item: typeof SelectItem;
|
|
336
|
+
Value: typeof SelectValue;
|
|
337
|
+
Group: typeof SelectGroup;
|
|
338
|
+
Label: typeof SelectLabel;
|
|
339
|
+
__kui: {
|
|
340
|
+
formControl: "compound";
|
|
341
|
+
};
|
|
342
|
+
};
|
|
1029
343
|
|
|
1030
344
|
declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1031
345
|
|
|
346
|
+
declare const SelectRoot: _splenddev_kreativ_core.KuiComponent<SelectRootProps, HTMLDivElement>;
|
|
347
|
+
|
|
1032
348
|
type MarkdownEditorTabs = "write" | "preview";
|
|
1033
349
|
interface MarkdownEditorProps extends Omit<TextareaCoreProps, "resize" | "autoResize"> {
|
|
1034
350
|
/** Renders the Preview tab. Omit and Preview shows raw text with a dev warning. */
|
|
@@ -1040,7 +356,7 @@ interface MarkdownEditorProps extends Omit<TextareaCoreProps, "resize" | "autoRe
|
|
|
1040
356
|
}
|
|
1041
357
|
|
|
1042
358
|
type TextareaResize = "none" | "both" | "horizontal" | "vertical";
|
|
1043
|
-
interface TextareaCoreProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "defaultValue" | "value">, Omit<BaseProps, "unstyled" | "style">, SizeProps, StateProps, VariantProps<InputVariant>, ClearableProps, ValueProps, FullWidthProps, EmbeddedProps, StateProps, TrimProps, ValidateProps<string
|
|
359
|
+
interface TextareaCoreProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "defaultValue" | "value">, Omit<BaseProps, "unstyled" | "style">, SizeProps, StateProps, VariantProps<InputVariant>, ClearableProps, ValueProps, FullWidthProps, EmbeddedProps, StateProps, TrimProps, ValidateProps<string>, TypographyProps {
|
|
1044
360
|
resize?: TextareaResize;
|
|
1045
361
|
autoResize?: boolean;
|
|
1046
362
|
minRows?: number;
|
|
@@ -1054,11 +370,11 @@ type TextareaProps = ({
|
|
|
1054
370
|
allowMarkdown: true;
|
|
1055
371
|
} & Omit<TextareaCoreProps, "resize"> & MarkdownEditorProps);
|
|
1056
372
|
|
|
1057
|
-
declare const Textarea:
|
|
373
|
+
declare const Textarea: _splenddev_kreativ_core.KuiComponent<TextareaProps, HTMLTextAreaElement>;
|
|
1058
374
|
|
|
1059
375
|
declare const MarkdownEditor: react.ForwardRefExoticComponent<MarkdownEditorProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
1060
376
|
|
|
1061
|
-
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable, StateProps, StatusProps, ControlledProps<boolean, "checked", "defaultChecked", "onCheckedChange"> {
|
|
377
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "children">, Styleable$1, StateProps, StatusProps, MotionGatedProps, ControlledProps<boolean, "checked", "defaultChecked", "onCheckedChange"> {
|
|
1062
378
|
indeterminate?: boolean;
|
|
1063
379
|
size?: InputSize;
|
|
1064
380
|
disabled?: boolean;
|
|
@@ -1066,17 +382,17 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "siz
|
|
|
1066
382
|
description?: ReactNode;
|
|
1067
383
|
}
|
|
1068
384
|
|
|
1069
|
-
declare const Checkbox:
|
|
385
|
+
declare const Checkbox: _splenddev_kreativ_core.KuiComponent<CheckboxProps, HTMLInputElement>;
|
|
1070
386
|
|
|
1071
387
|
type RadioSize = "sm" | "md" | "lg";
|
|
1072
|
-
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "onChange" | "name" | "value">, Styleable {
|
|
388
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "onChange" | "name" | "value">, Styleable$1 {
|
|
1073
389
|
value: string;
|
|
1074
390
|
disabled?: boolean;
|
|
1075
391
|
label?: ReactNode;
|
|
1076
392
|
description?: ReactNode;
|
|
1077
393
|
}
|
|
1078
394
|
|
|
1079
|
-
interface RadioGroupProps extends Styleable {
|
|
395
|
+
interface RadioGroupProps extends Styleable$1 {
|
|
1080
396
|
value?: string;
|
|
1081
397
|
defaultValue?: string;
|
|
1082
398
|
onValueChange?: (value: string) => void;
|
|
@@ -1094,39 +410,26 @@ declare function RadioGroup({ value: valueProp, defaultValue, onValueChange, nam
|
|
|
1094
410
|
|
|
1095
411
|
declare function Radio({ value, disabled: itemDisabled, label, description, className, ...props }: RadioProps): react.JSX.Element;
|
|
1096
412
|
|
|
1097
|
-
|
|
413
|
+
type SwitchSize = "xs" | "sm" | "md" | "lg";
|
|
414
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable$1 {
|
|
1098
415
|
checked?: boolean;
|
|
1099
416
|
defaultChecked?: boolean;
|
|
1100
417
|
onCheckedChange?: (checked: boolean) => void;
|
|
1101
|
-
size?:
|
|
418
|
+
size?: SwitchSize;
|
|
1102
419
|
error?: boolean;
|
|
1103
420
|
success?: boolean;
|
|
1104
|
-
required?: boolean;
|
|
1105
|
-
disabled?: boolean;
|
|
1106
421
|
label?: ReactNode;
|
|
1107
422
|
description?: ReactNode;
|
|
1108
423
|
}
|
|
1109
424
|
|
|
1110
|
-
declare
|
|
425
|
+
declare const Switch: _splenddev_kreativ_core.KuiComponent<SwitchProps & MotionGatedProps, HTMLInputElement>;
|
|
1111
426
|
|
|
1112
|
-
interface ComboboxProps extends
|
|
1113
|
-
value?: string;
|
|
1114
|
-
onValueChange?: (value: string | undefined) => void;
|
|
1115
|
-
inputValue?: string;
|
|
1116
|
-
defaultInputValue?: string;
|
|
1117
|
-
onInputChange?: (input: string) => void;
|
|
1118
|
-
disabled?: boolean;
|
|
427
|
+
interface ComboboxProps extends Omit<BaseProps, "unstyled">, ValueProps<string | undefined>, ControlledProps<string | undefined, "inputValue", "defaultInputValue", "onInputChange">, DisabledProps, VariantProps<BaseVariant>, SizeProps, ClearableProps, StatusProps, StateProps {
|
|
1119
428
|
required?: boolean;
|
|
1120
|
-
error?: boolean;
|
|
1121
|
-
success?: boolean;
|
|
1122
429
|
rounded?: boolean;
|
|
1123
430
|
name?: string;
|
|
1124
|
-
variant?: InputVariant;
|
|
1125
|
-
size?: InputSize;
|
|
1126
431
|
placeholder?: string;
|
|
1127
|
-
clearable?: boolean;
|
|
1128
432
|
allowFreeText?: boolean;
|
|
1129
|
-
children: ReactNode;
|
|
1130
433
|
}
|
|
1131
434
|
interface ComboboxItemProps {
|
|
1132
435
|
value: string;
|
|
@@ -1134,13 +437,8 @@ interface ComboboxItemProps {
|
|
|
1134
437
|
children: ReactNode;
|
|
1135
438
|
className?: string;
|
|
1136
439
|
}
|
|
1137
|
-
interface ComboboxInputProps {
|
|
1138
|
-
variant?: InputVariant;
|
|
1139
|
-
size?: InputSize;
|
|
1140
|
-
placeholder?: string;
|
|
1141
|
-
clearable?: boolean;
|
|
440
|
+
interface ComboboxInputProps extends InputProps {
|
|
1142
441
|
allowFreeText?: boolean;
|
|
1143
|
-
className?: string;
|
|
1144
442
|
}
|
|
1145
443
|
|
|
1146
444
|
declare function ComboboxItem({ value, disabled, children, className, }: ComboboxItemProps): react.JSX.Element | null;
|
|
@@ -1173,7 +471,7 @@ declare namespace Combobox {
|
|
|
1173
471
|
|
|
1174
472
|
declare const ComboboxInput: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
1175
473
|
|
|
1176
|
-
interface MultiSelectProps extends Styleable {
|
|
474
|
+
interface MultiSelectProps extends Styleable$1 {
|
|
1177
475
|
value?: string[];
|
|
1178
476
|
defaultValue?: string[];
|
|
1179
477
|
onValueChange?: (value: string[]) => void;
|
|
@@ -1217,6 +515,555 @@ declare const MultiSelectTrigger: react.ForwardRefExoticComponent<{
|
|
|
1217
515
|
className?: string;
|
|
1218
516
|
} & react.RefAttributes<HTMLButtonElement>>;
|
|
1219
517
|
|
|
518
|
+
type FormValues = Record<string, unknown>;
|
|
519
|
+
type FormErrors = Record<string, react.ReactNode | undefined>;
|
|
520
|
+
interface FormContextValue {
|
|
521
|
+
values: FormValues;
|
|
522
|
+
isSubmitting: boolean;
|
|
523
|
+
isDirty: boolean;
|
|
524
|
+
schema: unknown;
|
|
525
|
+
setValue: (name: string, value: unknown) => void;
|
|
526
|
+
getValue: (name: string) => unknown;
|
|
527
|
+
setFieldError: (name: string, message: react.ReactNode | undefined) => void;
|
|
528
|
+
registerField: (name: string, element: HTMLElement | null) => void;
|
|
529
|
+
submit: () => void;
|
|
530
|
+
reset: () => void;
|
|
531
|
+
errors: FormErrors;
|
|
532
|
+
errorList: FormFieldError[];
|
|
533
|
+
}
|
|
534
|
+
declare function useFormContext(): FormContextValue | null;
|
|
535
|
+
|
|
536
|
+
interface SchemaLike {
|
|
537
|
+
safeParse: (values: FormValues) => {
|
|
538
|
+
success: true;
|
|
539
|
+
data: FormValues;
|
|
540
|
+
} | {
|
|
541
|
+
success: false;
|
|
542
|
+
error: {
|
|
543
|
+
issues: Array<{
|
|
544
|
+
path: PropertyKey[];
|
|
545
|
+
message: string;
|
|
546
|
+
}>;
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
type ManualValidator = (values: FormValues) => FormErrors | undefined | Promise<FormErrors | undefined>;
|
|
551
|
+
interface FormRootProps {
|
|
552
|
+
schema?: SchemaLike;
|
|
553
|
+
validate?: ManualValidator;
|
|
554
|
+
defaultValues?: FormValues;
|
|
555
|
+
onSubmit?: (values: FormValues) => void | Promise<void>;
|
|
556
|
+
onSubmitCapture?: (event: react.FormEvent<HTMLFormElement>) => void;
|
|
557
|
+
scrollToFirstOnError?: boolean;
|
|
558
|
+
className?: string;
|
|
559
|
+
children: react.ReactNode;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface FormSubmitButtonProps {
|
|
563
|
+
children: react.ReactElement;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* asChild-style: injects type="submit" + disabled (while invalid or
|
|
567
|
+
* submitting) + aria-busy (while submitting) onto the supplied child.
|
|
568
|
+
* Owns no visual content/spinner of its own — pending state is
|
|
569
|
+
* exposed for the child's own Button to react to.
|
|
570
|
+
*
|
|
571
|
+
* Not a createComponent. It renders no DOM node of its own; the ref is
|
|
572
|
+
* forwarded onto the child. Submit is a one-shot action and is not a
|
|
573
|
+
* video.controlled value.
|
|
574
|
+
*/
|
|
575
|
+
declare const FormSubmitButton: react.ForwardRefExoticComponent<FormSubmitButtonProps & react.RefAttributes<unknown>>;
|
|
576
|
+
interface FormResetButtonProps {
|
|
577
|
+
children: react.ReactElement;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* asChild-style: injects type="button" + an internal reset handler
|
|
581
|
+
* (native type="reset" isn't used since Form's values are
|
|
582
|
+
* controlled/context-owned, not native-form-reset-compatible) +
|
|
583
|
+
* disabled gated on isDirty rather than validity — resetting an
|
|
584
|
+
* invalid, untouched form is a no-op state that should read as
|
|
585
|
+
* disabled; resetting a dirty form should be available regardless of
|
|
586
|
+
* validity.
|
|
587
|
+
*
|
|
588
|
+
* Not a createComponent. Same reason as FormSubmitButton. Reset is a
|
|
589
|
+
* one-shot action and is not a video.controlled value.
|
|
590
|
+
*/
|
|
591
|
+
declare const FormResetButton: react.ForwardRefExoticComponent<FormResetButtonProps & react.RefAttributes<unknown>>;
|
|
592
|
+
|
|
593
|
+
interface NumberStepperValidationResult {
|
|
594
|
+
valid: boolean;
|
|
595
|
+
value: number | null;
|
|
596
|
+
errors: Array<"required" | "invalid" | "min" | "max" | "step">;
|
|
597
|
+
}
|
|
598
|
+
type NumberStepperClampOn = "change" | "blur" | "commit" | "never";
|
|
599
|
+
type NumberStepperButtonLayout = "vertical" | "horizontal";
|
|
600
|
+
interface NumberStepperProps {
|
|
601
|
+
value?: number;
|
|
602
|
+
defaultValue?: number;
|
|
603
|
+
onValueChange?: BaseInputProps["onValueChange"];
|
|
604
|
+
min?: number;
|
|
605
|
+
max?: number;
|
|
606
|
+
step?: number;
|
|
607
|
+
precision?: number;
|
|
608
|
+
variant?: InputVariant;
|
|
609
|
+
error?: boolean;
|
|
610
|
+
success?: boolean;
|
|
611
|
+
rounded?: boolean;
|
|
612
|
+
fullWidth?: boolean;
|
|
613
|
+
clampOn?: NumberStepperClampOn;
|
|
614
|
+
onValidate?: (result: NumberStepperValidationResult) => void;
|
|
615
|
+
buttonLayout?: NumberStepperButtonLayout;
|
|
616
|
+
disabled?: boolean;
|
|
617
|
+
required?: boolean;
|
|
618
|
+
name?: string;
|
|
619
|
+
size?: "sm" | "md" | "lg";
|
|
620
|
+
className?: string;
|
|
621
|
+
style?: react.CSSProperties;
|
|
622
|
+
"aria-label"?: string;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
interface ComponentPropsMap {
|
|
626
|
+
input: InputProps;
|
|
627
|
+
select: SelectProps;
|
|
628
|
+
switch: SwitchProps;
|
|
629
|
+
textarea: TextareaProps;
|
|
630
|
+
checkbox: CheckboxProps;
|
|
631
|
+
'number-stepper': NumberStepperProps;
|
|
632
|
+
}
|
|
633
|
+
type ComponentKey = keyof ComponentPropsMap;
|
|
634
|
+
|
|
635
|
+
interface FormControlProps {
|
|
636
|
+
id: string;
|
|
637
|
+
"aria-invalid": boolean | undefined;
|
|
638
|
+
"aria-required": boolean | undefined;
|
|
639
|
+
"aria-describedby": string | undefined;
|
|
640
|
+
disabled: boolean;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
interface KuiFormControlValueProps<T = unknown> {
|
|
644
|
+
value?: T;
|
|
645
|
+
onValueChange: (value: T) => void;
|
|
646
|
+
}
|
|
647
|
+
type KuiFormControlComponent<P extends KuiFormControlValueProps<any> = KuiFormControlValueProps<any>> = react.ComponentType<P> & {
|
|
648
|
+
__kui: {
|
|
649
|
+
formControl: "single" | "compound";
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
interface FieldState {
|
|
653
|
+
error?: react.ReactNode;
|
|
654
|
+
invalid: boolean;
|
|
655
|
+
isDirty: boolean;
|
|
656
|
+
}
|
|
657
|
+
interface FieldApi<T = unknown> {
|
|
658
|
+
value: T;
|
|
659
|
+
onChange: (value: T) => void;
|
|
660
|
+
onBlur: () => void;
|
|
661
|
+
name: string;
|
|
662
|
+
}
|
|
663
|
+
type CustomFieldRenderer<T = unknown> = (args: {
|
|
664
|
+
field: FieldApi<T>;
|
|
665
|
+
fieldState: FieldState;
|
|
666
|
+
controlProps: FormControlProps;
|
|
667
|
+
}) => react.ReactNode;
|
|
668
|
+
interface FormFieldProps {
|
|
669
|
+
tone?: "default" | "warning" | "info";
|
|
670
|
+
orientation?: "vertical" | "horizontal";
|
|
671
|
+
}
|
|
672
|
+
interface UISectionSchema {
|
|
673
|
+
label?: react.ReactNode;
|
|
674
|
+
description?: react.ReactNode;
|
|
675
|
+
fields: string[];
|
|
676
|
+
layout?: string;
|
|
677
|
+
columns?: string;
|
|
678
|
+
order?: number;
|
|
679
|
+
}
|
|
680
|
+
interface UIFieldSchemaWidgetKey<K extends ComponentKey = ComponentKey> extends UIFieldSchemaBase {
|
|
681
|
+
widget: K;
|
|
682
|
+
props?: Partial<ComponentPropsMap[K]>;
|
|
683
|
+
render?: never;
|
|
684
|
+
}
|
|
685
|
+
interface UIFieldSchemaWidgetComponent<P extends KuiFormControlValueProps = KuiFormControlValueProps> extends UIFieldSchemaBase {
|
|
686
|
+
widget: KuiFormControlComponent<P>;
|
|
687
|
+
props?: Partial<P>;
|
|
688
|
+
render?: never;
|
|
689
|
+
}
|
|
690
|
+
interface UIFieldSchemaWidgetInferred extends UIFieldSchemaBase {
|
|
691
|
+
widget?: never;
|
|
692
|
+
props?: never;
|
|
693
|
+
render?: never;
|
|
694
|
+
}
|
|
695
|
+
interface UIFieldSchemaRender<T = unknown> extends UIFieldSchemaBase {
|
|
696
|
+
widget?: never;
|
|
697
|
+
props?: never;
|
|
698
|
+
render: CustomFieldRenderer<T>;
|
|
699
|
+
}
|
|
700
|
+
interface UIFieldSchemaBase {
|
|
701
|
+
label?: react.ReactNode;
|
|
702
|
+
description?: react.ReactNode;
|
|
703
|
+
order?: number;
|
|
704
|
+
hidden?: boolean;
|
|
705
|
+
formField?: FormFieldProps;
|
|
706
|
+
}
|
|
707
|
+
interface UIFieldSchemaBase {
|
|
708
|
+
label?: react.ReactNode;
|
|
709
|
+
description?: react.ReactNode;
|
|
710
|
+
order?: number;
|
|
711
|
+
hidden?: boolean;
|
|
712
|
+
formField?: FormFieldProps;
|
|
713
|
+
/**
|
|
714
|
+
* CSS `grid-area` name used to place this field inside a `$sections`
|
|
715
|
+
* grid. Only honored for leaf fields (widgets, inferred, custom
|
|
716
|
+
* renderers) — object and array groups ignore it. When the field is
|
|
717
|
+
* claimed by a section, the section's own `layout` grid takes precedence.
|
|
718
|
+
*/
|
|
719
|
+
gridArea?: string;
|
|
720
|
+
}
|
|
721
|
+
type UIFieldSchema<K extends ComponentKey = ComponentKey, P extends KuiFormControlValueProps = KuiFormControlValueProps, T = unknown> = UIFieldSchemaWidgetKey<K> | UIFieldSchemaWidgetComponent<P> | UIFieldSchemaWidgetInferred | UIFieldSchemaRender<T>;
|
|
722
|
+
type UIFieldSchemaFor<V> = V extends Array<infer Item> ? UIArraySchemaFor<Item> : V extends object ? UIObjectSchemaForShape<V> | UIFieldSchema<ComponentKey, any, V> : UIFieldSchema<ComponentKey, any, V>;
|
|
723
|
+
type UIObjectSchema = {
|
|
724
|
+
[key: string]: UIFieldSchema | UIObjectSchema | UIArraySchema;
|
|
725
|
+
} & {
|
|
726
|
+
$sections?: UISectionSchema[];
|
|
727
|
+
};
|
|
728
|
+
interface UIArraySchema {
|
|
729
|
+
label?: react.ReactNode;
|
|
730
|
+
description?: react.ReactNode;
|
|
731
|
+
item: UIFieldSchema | UIObjectSchema;
|
|
732
|
+
addLabel?: react.ReactNode;
|
|
733
|
+
itemLabel?: string;
|
|
734
|
+
removable?: boolean;
|
|
735
|
+
reorderable?: boolean;
|
|
736
|
+
/**
|
|
737
|
+
* CSS `grid-area` name used to place this field inside a `$sections`
|
|
738
|
+
* grid. Only honored for leaf fields (widgets, inferred, custom
|
|
739
|
+
* renderers) — object and array groups ignore it. When the field is
|
|
740
|
+
* claimed by a section, the section's own `layout` grid takes precedence.
|
|
741
|
+
*/
|
|
742
|
+
gridArea?: string;
|
|
743
|
+
}
|
|
744
|
+
type UIObjectSchemaFor<Schema extends z.ZodObject<any>> = {
|
|
745
|
+
[K in keyof z.infer<Schema>]?: UIFieldSchemaFor<z.infer<Schema>[K]>;
|
|
746
|
+
} & {
|
|
747
|
+
$sections?: UISectionSchema[];
|
|
748
|
+
};
|
|
749
|
+
type UIObjectSchemaForShape<V> = {
|
|
750
|
+
[K in keyof V]?: UIFieldSchemaFor<V[K]>;
|
|
751
|
+
};
|
|
752
|
+
type UIArraySchemaFor<Item> = {
|
|
753
|
+
label?: react.ReactNode;
|
|
754
|
+
description?: react.ReactNode;
|
|
755
|
+
item: UIFieldSchemaFor<Item>;
|
|
756
|
+
addLabel?: react.ReactNode;
|
|
757
|
+
itemLabel?: string;
|
|
758
|
+
removable?: boolean;
|
|
759
|
+
reorderable?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* CSS `grid-area` name used to place this field inside a `$sections`
|
|
762
|
+
* grid. Only honored for leaf fields (widgets, inferred, custom
|
|
763
|
+
* renderers) — object and array groups ignore it. When the field is
|
|
764
|
+
* claimed by a section, the section's own `layout` grid takes precedence.
|
|
765
|
+
*/
|
|
766
|
+
gridArea?: string;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* Object schema shape with unconstrained keys.
|
|
770
|
+
*
|
|
771
|
+
* @deprecated Use {@link UIObjectSchemaFor} for strict, Zod-inferred key and
|
|
772
|
+
* widget checking. `UIObjectSchema` accepts any string key and any
|
|
773
|
+
* `UIFieldSchema`, so it won't catch typos or wrong widget names — it exists
|
|
774
|
+
* only as the fallback shape when no Zod schema is in scope (e.g. inside a
|
|
775
|
+
* `<Form>` when `Schema` isn't supplied as a type argument). Prefer typing
|
|
776
|
+
* `uiSchema` against the inferred shape:
|
|
777
|
+
*
|
|
778
|
+
* @example
|
|
779
|
+
* const ui: UIObjectSchemaFor<typeof profileSchema> = { ... };
|
|
780
|
+
*/
|
|
781
|
+
type UISchema = UIObjectSchema;
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Props for using Form.FromSchema inside a parent `<Form schema={...}>`.
|
|
785
|
+
* The schema comes from context, so `schema` is typed `never` here — passing
|
|
786
|
+
* one is a compile error rather than a silent override.
|
|
787
|
+
*/
|
|
788
|
+
interface FormFromSchemaContextProps<Schema extends z.ZodObject<any>> {
|
|
789
|
+
/**
|
|
790
|
+
* Zod object schema to generate fields from. When omitted, the enclosing
|
|
791
|
+
* `<Form>`'s schema is used. Providing it here also drives inference of
|
|
792
|
+
* `Schema` for `uiSchema`.
|
|
793
|
+
*/
|
|
794
|
+
uiSchema?: UIObjectSchemaFor<Schema>;
|
|
795
|
+
/**
|
|
796
|
+
* Presentation overlay keyed by the schema's field names. When `Schema`
|
|
797
|
+
* is known, keys and per-field props are checked against the inferred
|
|
798
|
+
* shape; otherwise keys are unconstrained.
|
|
799
|
+
*/
|
|
800
|
+
schema?: never;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Props for using Form.FromSchema on its own, with `schema` passed directly.
|
|
804
|
+
*/
|
|
805
|
+
interface FormFromSchemaStandaloneProps<Schema extends z.ZodObject<any>> {
|
|
806
|
+
/**
|
|
807
|
+
* Zod object schema to generate fields from. When omitted, the enclosing
|
|
808
|
+
* `<Form>`'s schema is used. Providing it here also drives inference of
|
|
809
|
+
* `Schema` for `uiSchema`.
|
|
810
|
+
*/
|
|
811
|
+
uiSchema?: UIObjectSchemaFor<Schema>;
|
|
812
|
+
/**
|
|
813
|
+
* Presentation overlay keyed by the schema's field names. When `Schema`
|
|
814
|
+
* is known, keys and per-field props are checked against the inferred
|
|
815
|
+
* shape; otherwise keys are unconstrained.
|
|
816
|
+
*/
|
|
817
|
+
schema: Schema;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Props for `<Form.FromSchema>`.
|
|
821
|
+
*
|
|
822
|
+
* `Schema` is inferred from the `schema` prop in standalone mode; when used
|
|
823
|
+
* inside a `<Form>`, supply it explicitly as a type argument to get
|
|
824
|
+
* key-checking on `uiSchema`. Otherwise `uiSchema` falls back to the
|
|
825
|
+
* unconstrained `UIObjectSchema` shape.
|
|
826
|
+
*
|
|
827
|
+
* ### Strict vs. loose `uiSchema` typing
|
|
828
|
+
*
|
|
829
|
+
* - **Strict**: type `uiSchema` as `UIObjectSchemaFor<typeof schema>` (or let
|
|
830
|
+
* it be inferred by passing `schema` directly). Keys, nested field names,
|
|
831
|
+
* widget keys, and per-field `props` are all checked against the Zod
|
|
832
|
+
* output. This is what you want almost everywhere.
|
|
833
|
+
* - **Loose**: `UIObjectSchema` / `UISchema`. Any string key, any
|
|
834
|
+
* `UIFieldSchema`. Used only as the fallback when `Schema` can't be
|
|
835
|
+
* inferred (e.g. `<Form.FromSchema uiSchema={...} />` inside a `<Form>`).
|
|
836
|
+
* Wrong keys, misspelled widgets, and mismatched `props` all type-check.
|
|
837
|
+
*
|
|
838
|
+
* `UISchema` is deprecated for this reason — reach for `UIObjectSchemaFor`
|
|
839
|
+
* whenever you have a Zod schema available.
|
|
840
|
+
*/
|
|
841
|
+
type FormFromSchemaProps<Schema extends z.ZodObject<any> = z.ZodObject<any>> = FormFromSchemaContextProps<Schema> | FormFromSchemaStandaloneProps<Schema>;
|
|
842
|
+
/**
|
|
843
|
+
* Generates a set of fields from a Zod object schema.
|
|
844
|
+
*
|
|
845
|
+
* Write the shape once in Zod, optionally layer presentation on top with a
|
|
846
|
+
* `uiSchema`, and skip writing a `<Field>` for every property. Fields you
|
|
847
|
+
* don't mention in `uiSchema` still render — the generator picks a widget
|
|
848
|
+
* based on the Zod type. Use `uiSchema` only for the ones you want to
|
|
849
|
+
* override.
|
|
850
|
+
*
|
|
851
|
+
* `Schema` is inferred automatically when you pass `schema` directly
|
|
852
|
+
* (standalone mode) — `uiSchema`'s keys are checked against that schema's
|
|
853
|
+
* shape with no extra annotation needed. Inside a `<Form>`, there's no
|
|
854
|
+
* `schema` prop for inference to key off, so `Schema` must be supplied
|
|
855
|
+
* explicitly as a type argument for `uiSchema` to get the same
|
|
856
|
+
* key-checking; omitted, it falls back to the unconstrained shape.
|
|
857
|
+
*
|
|
858
|
+
* Schema resolution, in order:
|
|
859
|
+
* 1. The `schema` prop, if you passed one.
|
|
860
|
+
* 2. The enclosing `<Form>`'s schema, if there is one.
|
|
861
|
+
*
|
|
862
|
+
* If neither exists, or the result isn't a `z.object({...})`, this throws.
|
|
863
|
+
* Errors are prefixed `[kreativ-ui/Form.FromSchema]` so they're easy to
|
|
864
|
+
* grep for.
|
|
865
|
+
*
|
|
866
|
+
* Renders a fragment — no wrapper element — so the fields land directly
|
|
867
|
+
* inside whatever container you put this in.
|
|
868
|
+
*
|
|
869
|
+
* @example
|
|
870
|
+
* // Schema from context — Schema isn't inferable here, so uiSchema is
|
|
871
|
+
* // checked against profileSchema only if you supply the type argument:
|
|
872
|
+
* <Form schema={profileSchema}>
|
|
873
|
+
* <Form.FromSchema<typeof profileSchema> uiSchema={profileUiSchema} />
|
|
874
|
+
* </Form>
|
|
875
|
+
*
|
|
876
|
+
* @example
|
|
877
|
+
* // Schema passed in — Schema is inferred from `schema`, uiSchema is
|
|
878
|
+
* // checked automatically, no type argument needed:
|
|
879
|
+
* <Form.FromSchema schema={profileSchema} uiSchema={profileUiSchema} />
|
|
880
|
+
*/
|
|
881
|
+
declare function FormFromSchema<Schema extends z.ZodObject<any> = z.ZodObject<any>>({ uiSchema, schema: standaloneSchema }: FormFromSchemaProps<Schema>): react.JSX.Element;
|
|
882
|
+
|
|
883
|
+
declare function defineUIField<K extends ComponentKey>(field: UIFieldSchemaWidgetKey<K>): UIFieldSchemaWidgetKey<K>;
|
|
884
|
+
declare function defineUIField<P extends KuiFormControlValueProps<any>>(field: UIFieldSchemaWidgetComponent<P>): UIFieldSchemaWidgetComponent<P>;
|
|
885
|
+
declare function defineUIField(field: UIFieldSchemaWidgetInferred): UIFieldSchemaWidgetInferred;
|
|
886
|
+
declare function defineUIField<T>(field: UIFieldSchemaRender<T>): UIFieldSchemaRender<T>;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Form owns real orchestration, not a thin semantic <form> wrapper —
|
|
890
|
+
* submit handling, validation orchestration across its FormFields,
|
|
891
|
+
* and error aggregation are all Form's responsibility. It provides a
|
|
892
|
+
* FormContext that FormField reads to auto-wire validation/errors/
|
|
893
|
+
* disabled state.
|
|
894
|
+
*
|
|
895
|
+
* Usage:
|
|
896
|
+
* ```tsx
|
|
897
|
+
* <Form schema={zodSchema} onSubmit={handleSubmit}>
|
|
898
|
+
* <FormField name="email" as={Input} label="Email" />
|
|
899
|
+
* <Form.SubmitButton><Button>Submit</Button></Form.SubmitButton>
|
|
900
|
+
* </Form>
|
|
901
|
+
*```
|
|
902
|
+
* Or, schema-driven field generation:
|
|
903
|
+
* ```tsx
|
|
904
|
+
* <Form schema={zodSchema} onSubmit={handleSubmit}>
|
|
905
|
+
* <Form.FromSchema uiSchema={uiSchema} />
|
|
906
|
+
* <Form.SubmitButton><Button>Submit</Button></Form.SubmitButton>
|
|
907
|
+
* </Form>
|
|
908
|
+
* ```
|
|
909
|
+
*/
|
|
910
|
+
declare const Form: react.ForwardRefExoticComponent<FormRootProps & react.RefAttributes<HTMLFormElement>> & {
|
|
911
|
+
__kui: _splenddev_kreativ_core.KuiMeta<FormRootProps>;
|
|
912
|
+
providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
|
|
913
|
+
} & {
|
|
914
|
+
SubmitButton: react.ForwardRefExoticComponent<FormSubmitButtonProps & react.RefAttributes<unknown>>;
|
|
915
|
+
ResetButton: react.ForwardRefExoticComponent<FormResetButtonProps & react.RefAttributes<unknown>>;
|
|
916
|
+
FromSchema: typeof FormFromSchema;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
interface ContainerProps extends BaseProps {
|
|
920
|
+
/**
|
|
921
|
+
* Max-width of the container, mapped to the Container recipe's `size` variant.
|
|
922
|
+
* @default "lg"
|
|
923
|
+
*/
|
|
924
|
+
maxWidth?: Size | (string & {});
|
|
925
|
+
/**
|
|
926
|
+
* Horizontal padding. Token-based (Size) or a raw responsive CSS value.
|
|
927
|
+
*/
|
|
928
|
+
padding?: ResponsiveValue<Size | (string & {})>;
|
|
929
|
+
/**
|
|
930
|
+
* Centers the container horizontally via margin-inline: auto.
|
|
931
|
+
* @default true
|
|
932
|
+
*/
|
|
933
|
+
centered?: boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Element type to render as.
|
|
936
|
+
* @default "div"
|
|
937
|
+
*/
|
|
938
|
+
as?: ElementType;
|
|
939
|
+
children?: ReactNode;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
943
|
+
|
|
944
|
+
interface FlexProps extends BaseProps {
|
|
945
|
+
/** @default "row" */
|
|
946
|
+
direction?: ResponsiveValue<CSSProperties["flexDirection"]>;
|
|
947
|
+
/** @default "nowrap" */
|
|
948
|
+
wrap?: ResponsiveValue<CSSProperties["flexWrap"]>;
|
|
949
|
+
align?: ResponsiveValue<CSSProperties["alignItems"]>;
|
|
950
|
+
justify?: ResponsiveValue<CSSProperties["justifyContent"]>;
|
|
951
|
+
/** Token-based gap, e.g. "sm" | "md" | raw CSS length */
|
|
952
|
+
gap?: ResponsiveValue<Size | (string & {})>;
|
|
953
|
+
as?: ElementType;
|
|
954
|
+
children?: ReactNode;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
declare const Flex: react.ForwardRefExoticComponent<FlexProps & react.RefAttributes<HTMLDivElement>>;
|
|
958
|
+
|
|
959
|
+
interface StackProps extends BaseProps {
|
|
960
|
+
/**
|
|
961
|
+
* Layout direction of the stack.
|
|
962
|
+
* @default "vertical"
|
|
963
|
+
*/
|
|
964
|
+
orientation?: Orientation;
|
|
965
|
+
gap?: ResponsiveValue<Size | (string & {})>;
|
|
966
|
+
align?: ResponsiveValue<CSSProperties["alignItems"]>;
|
|
967
|
+
justify?: ResponsiveValue<CSSProperties["justifyContent"]>;
|
|
968
|
+
wrap?: ResponsiveValue<CSSProperties["flexWrap"]>;
|
|
969
|
+
/** Renders between each child. */
|
|
970
|
+
divider?: ReactNode;
|
|
971
|
+
as?: ElementType;
|
|
972
|
+
children?: ReactNode;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLDivElement>>;
|
|
976
|
+
|
|
977
|
+
interface GridProps extends BaseProps {
|
|
978
|
+
/**
|
|
979
|
+
* Shorthand for equal-width columns, e.g. `columns={3}` → repeat(3, 1fr).
|
|
980
|
+
* Ignored if `templateColumns` is set.
|
|
981
|
+
*/
|
|
982
|
+
columns?: ResponsiveValue<number>;
|
|
983
|
+
/** Raw escape hatch for gridTemplateColumns, e.g. "200px 1fr 1fr". */
|
|
984
|
+
templateColumns?: ResponsiveValue<string>;
|
|
985
|
+
/** Raw escape hatch for gridTemplateRows. */
|
|
986
|
+
templateRows?: ResponsiveValue<string>;
|
|
987
|
+
/** Raw escape hatch for gridTemplateAreas. Not responsive — rarely varies by breakpoint. */
|
|
988
|
+
templateAreas?: string;
|
|
989
|
+
gap?: ResponsiveValue<Size | (string & {})>;
|
|
990
|
+
columnGap?: ResponsiveValue<Size | (string & {})>;
|
|
991
|
+
rowGap?: ResponsiveValue<Size | (string & {})>;
|
|
992
|
+
align?: ResponsiveValue<CSSProperties["alignItems"]>;
|
|
993
|
+
justify?: ResponsiveValue<CSSProperties["justifyContent"]>;
|
|
994
|
+
as?: ElementType;
|
|
995
|
+
children?: ReactNode;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLDivElement>>;
|
|
999
|
+
|
|
1000
|
+
type CardVariant = "solid" | "outline" | "ghost" | "elevated" | "compact";
|
|
1001
|
+
type CardSize = "sm" | "md" | "lg";
|
|
1002
|
+
interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
1003
|
+
/**
|
|
1004
|
+
* Visual style of the card.
|
|
1005
|
+
*/
|
|
1006
|
+
variant?: CardVariant;
|
|
1007
|
+
/**
|
|
1008
|
+
* Controls the card's padding and overall density.
|
|
1009
|
+
*/
|
|
1010
|
+
size?: CardSize;
|
|
1011
|
+
/**
|
|
1012
|
+
* Indicates that the card contains an image.
|
|
1013
|
+
*/
|
|
1014
|
+
hasImage?: boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* Makes the card span the full available width.
|
|
1017
|
+
*/
|
|
1018
|
+
fullWidth?: boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* Removes the card's default padding.
|
|
1021
|
+
*/
|
|
1022
|
+
noPadding?: boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* Card content.
|
|
1025
|
+
*/
|
|
1026
|
+
children?: ReactNode;
|
|
1027
|
+
}
|
|
1028
|
+
interface CardHeaderProps extends ComponentPropsWithoutRef<"div"> {
|
|
1029
|
+
children?: ReactNode;
|
|
1030
|
+
}
|
|
1031
|
+
interface CardBodyProps extends ComponentPropsWithoutRef<"div"> {
|
|
1032
|
+
children?: ReactNode;
|
|
1033
|
+
}
|
|
1034
|
+
interface CardFooterProps extends ComponentPropsWithoutRef<"div"> {
|
|
1035
|
+
children?: ReactNode;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>> & {
|
|
1039
|
+
__kui: _splenddev_kreativ_core.KuiMeta<CardProps>;
|
|
1040
|
+
providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
|
|
1041
|
+
} & {
|
|
1042
|
+
Header: _splenddev_kreativ_core.KuiComponent<CardHeaderProps, HTMLDivElement>;
|
|
1043
|
+
Body: _splenddev_kreativ_core.KuiComponent<CardBodyProps, HTMLDivElement>;
|
|
1044
|
+
Footer: _splenddev_kreativ_core.KuiComponent<CardFooterProps, HTMLDivElement>;
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
type SkeletonShape = {
|
|
1048
|
+
rows?: number;
|
|
1049
|
+
avatar?: boolean | {
|
|
1050
|
+
size?: Extract<Size, "xs" | "sm" | "md">;
|
|
1051
|
+
shape?: "circle" | "square";
|
|
1052
|
+
};
|
|
1053
|
+
width?: string | number;
|
|
1054
|
+
height?: string | number;
|
|
1055
|
+
radius?: string | number;
|
|
1056
|
+
gap?: string | number;
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
type SkeletonResolver<P = any> = (props: Partial<P>) => SkeletonShape;
|
|
1060
|
+
type SkeletonDefinition<P = any> = {
|
|
1061
|
+
resolve: SkeletonResolver<P>;
|
|
1062
|
+
defaults?: SkeletonShape;
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
declare const cardSkeleton: SkeletonDefinition<CardProps>;
|
|
1066
|
+
|
|
1220
1067
|
/**
|
|
1221
1068
|
* Represents the visual state of the field for feedback and styling.
|
|
1222
1069
|
*/
|
|
@@ -1251,7 +1098,7 @@ interface InputFieldProps extends InputProps {
|
|
|
1251
1098
|
*
|
|
1252
1099
|
* @default 'none'
|
|
1253
1100
|
*/
|
|
1254
|
-
status?: FormFieldStatus;
|
|
1101
|
+
status?: FormFieldStatus$1;
|
|
1255
1102
|
/**
|
|
1256
1103
|
* Feedback message displayed below the input.
|
|
1257
1104
|
* Typically paired with `status` to show success confirmations or error details.
|
|
@@ -1334,52 +1181,29 @@ interface InputFieldProps extends InputProps {
|
|
|
1334
1181
|
|
|
1335
1182
|
declare const InputField: react.ForwardRefExoticComponent<InputFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
1336
1183
|
|
|
1184
|
+
interface TextProps extends TypographyProps {
|
|
1185
|
+
as?: ElementType;
|
|
1186
|
+
color?: BaseColor | string;
|
|
1187
|
+
align?: "left" | "center" | "right" | "justify";
|
|
1188
|
+
truncate?: boolean;
|
|
1189
|
+
clampLines?: number;
|
|
1190
|
+
weight?: "normal" | "medium" | "semibold" | "bold";
|
|
1191
|
+
italic?: boolean;
|
|
1192
|
+
className?: string;
|
|
1193
|
+
style?: CSSProperties;
|
|
1194
|
+
children?: ReactNode;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1337
1197
|
interface UIProviderProps {
|
|
1338
1198
|
children: ReactNode;
|
|
1339
1199
|
theme?: ThemeOverride;
|
|
1340
1200
|
defaultMode?: ColorMode;
|
|
1341
1201
|
as?: keyof JSX.IntrinsicElements;
|
|
1342
1202
|
fallbackSize?: string;
|
|
1203
|
+
background?: string;
|
|
1204
|
+
textColor?: string;
|
|
1343
1205
|
}
|
|
1344
|
-
declare function
|
|
1345
|
-
|
|
1346
|
-
interface ThemeContextValue {
|
|
1347
|
-
theme: Theme;
|
|
1348
|
-
mode: ColorMode;
|
|
1349
|
-
resolvedMode: "light" | "dark";
|
|
1350
|
-
setMode: (mode: ColorMode) => void;
|
|
1351
|
-
fallbackSize: string;
|
|
1352
|
-
tokens: ResolvedTokens;
|
|
1353
|
-
}
|
|
1354
|
-
declare const ThemeContext: react.Context<ThemeContextValue | null>;
|
|
1355
|
-
|
|
1356
|
-
declare function useTheme(): ThemeContextValue;
|
|
1357
|
-
|
|
1358
|
-
declare const BREAKPOINTS: {
|
|
1359
|
-
readonly sm: 640;
|
|
1360
|
-
readonly md: 768;
|
|
1361
|
-
readonly lg: 1024;
|
|
1362
|
-
readonly xl: 1280;
|
|
1363
|
-
readonly "2xl": 1536;
|
|
1364
|
-
};
|
|
1365
|
-
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
1366
|
-
/** Returns whether the viewport is at or above the given breakpoint. */
|
|
1367
|
-
declare function useBreakpoint(breakpoint: Breakpoint): boolean;
|
|
1368
|
-
|
|
1369
|
-
interface ResolvedSize {
|
|
1370
|
-
style: CSSProperties;
|
|
1371
|
-
iconSize?: CSSProperties["width"];
|
|
1372
|
-
fontSize?: CSSProperties["fontSize"];
|
|
1373
|
-
gap?: CSSProperties["gap"];
|
|
1374
|
-
}
|
|
1375
|
-
interface UseSizeStyleOptions {
|
|
1376
|
-
includeHeight?: boolean;
|
|
1377
|
-
widthFromHeight?: boolean;
|
|
1378
|
-
sizeOffset?: string;
|
|
1379
|
-
fontSizeOffset?: string;
|
|
1380
|
-
iconSizeOffset?: string;
|
|
1381
|
-
}
|
|
1382
|
-
declare function useSizeStyle(size: string, iconOnly?: boolean, componentName?: string, options?: UseSizeStyleOptions): ResolvedSize;
|
|
1206
|
+
declare function KreativUIProvider({ children, theme: themeOverride, defaultMode, as, fallbackSize, textColor, background, }: UIProviderProps): JSX.Element;
|
|
1383
1207
|
|
|
1384
1208
|
declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open: boolean): {
|
|
1385
1209
|
contentRef: RefObject<HTMLDivElement | null>;
|
|
@@ -1387,52 +1211,65 @@ declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open
|
|
|
1387
1211
|
};
|
|
1388
1212
|
|
|
1389
1213
|
type TransitionStatus = Exclude<FormFieldStatus, "none"> | undefined;
|
|
1390
|
-
declare function useStatusTransition(status: FormFieldStatus
|
|
1391
|
-
|
|
1392
|
-
|
|
1214
|
+
declare function useStatusTransition(status: FormFieldStatus, options?: {
|
|
1215
|
+
enabled?: boolean;
|
|
1216
|
+
}): TransitionStatus;
|
|
1393
1217
|
|
|
1394
|
-
|
|
1218
|
+
type ClearableFieldOptions = {
|
|
1219
|
+
onClear?: () => void;
|
|
1220
|
+
onUndo?: (value: string) => void;
|
|
1221
|
+
onRedo?: (value: string) => void;
|
|
1222
|
+
};
|
|
1223
|
+
declare function useClearableField<T extends HTMLInputElement | HTMLTextAreaElement>(elementRef: RefObject<T | null>, initialValue: unknown, { onClear, onUndo, onRedo }?: ClearableFieldOptions): {
|
|
1395
1224
|
hasValue: boolean;
|
|
1396
1225
|
setHasValue: react.Dispatch<react.SetStateAction<boolean>>;
|
|
1397
1226
|
clear: () => void;
|
|
1227
|
+
undo: () => void;
|
|
1228
|
+
redo: () => void;
|
|
1229
|
+
canUndo: boolean;
|
|
1230
|
+
canRedo: boolean;
|
|
1398
1231
|
};
|
|
1399
1232
|
|
|
1233
|
+
type ShortcutHandler = (event: KeyboardEvent) => void;
|
|
1234
|
+
declare function useKeyboardShortcuts(enabled: boolean, shortcuts: Record<string, ShortcutHandler>, deps?: any[]): react.RefObject<HTMLInputElement | null>;
|
|
1235
|
+
|
|
1400
1236
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1401
1237
|
|
|
1402
1238
|
/**
|
|
1403
|
-
* Converts an RGB
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1406
|
-
* - "
|
|
1407
|
-
* - "
|
|
1408
|
-
* - "
|
|
1239
|
+
* Converts an RGB colour string to a 6‑digit uppercase hex string.
|
|
1240
|
+
* Supports the following input formats:
|
|
1241
|
+
* - Hex: `"#fff"`, `"#FFFFFF"`
|
|
1242
|
+
* - CSS rgb/rgba: `"rgb(255, 0, 0)"`, `"rgba(255, 0, 0, 0.5)"`
|
|
1243
|
+
* - Space‑separated numbers: `"255 0 0"`
|
|
1244
|
+
* - Comma‑separated numbers: `"255,0,0"`
|
|
1409
1245
|
*
|
|
1410
|
-
*
|
|
1246
|
+
* @param value - The colour string to convert.
|
|
1247
|
+
* @returns A 6‑digit uppercase hex string (e.g. `"#FF0000"`).
|
|
1248
|
+
* If the input cannot be parsed, returns `"#000000"`.
|
|
1411
1249
|
*/
|
|
1412
1250
|
declare function rgbToHex(value: string): string;
|
|
1413
1251
|
declare function hexToRgbString(hex: string): string | null;
|
|
1414
1252
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1253
|
+
/**
|
|
1254
|
+
* Overrides a single component's recipe against the built-in default
|
|
1255
|
+
* for that component. For overriding just one recipe inline, without
|
|
1256
|
+
* constructing a partial keyed-by-component-name object.
|
|
1257
|
+
*/
|
|
1258
|
+
declare function extendRecipe<K extends keyof RecipeCollection>(name: K, override?: DeepPartial<RecipeCollection[K]>): RecipeCollection[K];
|
|
1259
|
+
/**
|
|
1260
|
+
* Overrides the theme's full recipe collection against the built-in
|
|
1261
|
+
* defaults. Thin wrapper over extendRecipe — the actual merge logic
|
|
1262
|
+
* lives in exactly one place.
|
|
1263
|
+
*/
|
|
1264
|
+
declare function extendRecipes(override?: DeepPartial<RecipeCollection>): RecipeCollection;
|
|
1420
1265
|
|
|
1421
|
-
declare function
|
|
1266
|
+
declare function getRecipeNames(): (keyof DefaultRecipeCollection)[];
|
|
1422
1267
|
|
|
1423
|
-
declare function
|
|
1424
|
-
value: T;
|
|
1425
|
-
};
|
|
1426
|
-
declare function defineSemanticToken<T>(light: T, dark: T): {
|
|
1427
|
-
value: {
|
|
1428
|
-
light: T;
|
|
1429
|
-
dark: T;
|
|
1430
|
-
};
|
|
1431
|
-
};
|
|
1268
|
+
declare function extendTypography(override?: ThemeOverride$1["typography"]): Typography;
|
|
1432
1269
|
|
|
1433
|
-
declare function extendTokens(override?: ThemeOverride["tokens"]): DesignTokens;
|
|
1434
|
-
declare function extendSemanticTokens(override?: ThemeOverride["semanticTokens"]): SemanticTokens;
|
|
1270
|
+
declare function extendTokens(override?: ThemeOverride$1["tokens"]): DesignTokens;
|
|
1271
|
+
declare function extendSemanticTokens(override?: ThemeOverride$1["semanticTokens"]): SemanticTokens;
|
|
1435
1272
|
|
|
1436
|
-
declare function extendTheme(override?: ThemeOverride): Theme;
|
|
1273
|
+
declare function extendTheme(override?: ThemeOverride$1): Theme;
|
|
1437
1274
|
|
|
1438
|
-
export { type
|
|
1275
|
+
export { Adornment, type AdornmentProps, type BaseInputExtraAdornmentContext, type BaseInputProps, Button, ButtonGroup, ButtonGroupContext, type ButtonGroupContextValue, ButtonGroupItemContext, type ButtonGroupItemContextValue, type ButtonGroupItemProps, type ButtonGroupLabelProps, type ButtonGroupProps, type ButtonGroupSeparatorProps, type ButtonGroupSpacing, type ButtonGroupTextProps, type ButtonProps, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, type CardSize, type CardVariant, Checkbox, type CheckboxProps, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type ComponentKey, type ComponentPropsMap, Container, type ContainerProps, type CustomFieldRenderer, Flex, type FlexProps, Form, type FormContextValue, type FormControlProps, type FormErrors, FormField, FormFieldControl, FormFieldDescription, type FormFieldDescriptionProps, FormFieldLabel, type FormFieldLabelProps, FormFieldMessage, type FormFieldMessageProps, type FormFieldProps$1 as FormFieldProps, type FormFieldRootProps, FormResetButton, type FormResetButtonProps, type FormRootProps, FormSubmitButton, type FormSubmitButtonProps, type FormValues, Grid, type GridProps, Input, InputField, type InputFieldProps, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, KreativUIProvider, type KuiFormControlComponent, type ManualValidator, MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorTabs, type MotionGatedProps, MultiSelect, MultiSelectContent, MultiSelectItem, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type PasswordInputKindDefaults, type PasswordInputProps, type PasswordKind, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type SchemaLike, Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectProps, SelectRoot, type SelectRootProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SingleFormControlComponent, Stack, type StackProps, Switch, type SwitchProps, type SwitchSize, type TextProps, Textarea, type TextareaCoreProps, type TextareaProps, type TextareaResize, ThemeToggler, type ThemeTogglerColor, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type UIArraySchema, type UIArraySchemaFor, type UIFieldSchema, type UIFieldSchemaFor, type UIFieldSchemaRender, type UIObjectSchema, type UIObjectSchemaFor, type UIObjectSchemaForShape, type UIProviderProps, type UISchema, type ValuePropConvention, cardSkeleton, cn, defineUIField, extendRecipe, extendRecipes, extendSemanticTokens, extendTheme, extendTokens, extendTypography, getRecipeNames, hexToRgbString, rgbToHex, useButtonGroupContext, useButtonGroupItemContext, useClearableField, useFloatingSide, useFormContext, useKeyboardShortcuts, useOptionalButtonGroupContext, useOptionalButtonGroupItemContext, useStatusTransition };
|