@splenddev/kreativ-ui 0.3.4 → 0.3.6

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.
Files changed (58) hide show
  1. package/dist/chunk-4KNQFZZT.cjs +211 -0
  2. package/dist/chunk-4KNQFZZT.cjs.map +1 -0
  3. package/dist/chunk-52AQLHWM.cjs +208 -0
  4. package/dist/chunk-52AQLHWM.cjs.map +1 -0
  5. package/dist/chunk-6ZVPNLAW.cjs +31 -0
  6. package/dist/chunk-6ZVPNLAW.cjs.map +1 -0
  7. package/dist/chunk-CXR2HHQQ.js +12 -0
  8. package/dist/chunk-CXR2HHQQ.js.map +1 -0
  9. package/dist/chunk-EZIFSNRD.js +151 -0
  10. package/dist/chunk-EZIFSNRD.js.map +1 -0
  11. package/dist/chunk-KGNJ2KLQ.cjs +1280 -0
  12. package/dist/chunk-KGNJ2KLQ.cjs.map +1 -0
  13. package/dist/chunk-MAUKS2DZ.cjs +16 -0
  14. package/dist/chunk-MAUKS2DZ.cjs.map +1 -0
  15. package/dist/chunk-PW2S3ZJG.js +28 -0
  16. package/dist/chunk-PW2S3ZJG.js.map +1 -0
  17. package/dist/chunk-TGYV2M2L.js +88 -0
  18. package/dist/chunk-TGYV2M2L.js.map +1 -0
  19. package/dist/chunk-WF6Y3BRR.js +1241 -0
  20. package/dist/chunk-WF6Y3BRR.js.map +1 -0
  21. package/dist/components/index.cjs +22360 -0
  22. package/dist/components/index.cjs.map +1 -0
  23. package/dist/components/index.d.cts +1622 -0
  24. package/dist/components/index.d.ts +1622 -0
  25. package/dist/components/index.js +22285 -0
  26. package/dist/components/index.js.map +1 -0
  27. package/dist/core/index.cjs +69 -0
  28. package/dist/core/index.cjs.map +1 -0
  29. package/dist/core/index.d.cts +26 -0
  30. package/dist/core/index.d.ts +26 -0
  31. package/dist/core/index.js +4 -0
  32. package/dist/core/index.js.map +1 -0
  33. package/dist/hooks/index.cjs +77 -0
  34. package/dist/hooks/index.cjs.map +1 -0
  35. package/dist/hooks/index.d.cts +35 -0
  36. package/dist/hooks/index.d.ts +35 -0
  37. package/dist/hooks/index.js +4 -0
  38. package/dist/hooks/index.js.map +1 -0
  39. package/dist/index.cjs +19 -23977
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +4 -1700
  42. package/dist/index.d.ts +4 -1700
  43. package/dist/index.js +9 -23839
  44. package/dist/index.js.map +1 -1
  45. package/dist/styles/index.css +1 -1
  46. package/dist/types/index.cjs +4 -0
  47. package/dist/types/index.cjs.map +1 -0
  48. package/dist/types/index.d.cts +21 -0
  49. package/dist/types/index.d.ts +21 -0
  50. package/dist/types/index.js +3 -0
  51. package/dist/types/index.js.map +1 -0
  52. package/dist/utils/index.cjs +149 -0
  53. package/dist/utils/index.cjs.map +1 -0
  54. package/dist/utils/index.d.cts +39 -0
  55. package/dist/utils/index.d.ts +39 -0
  56. package/dist/utils/index.js +4 -0
  57. package/dist/utils/index.js.map +1 -0
  58. package/package.json +27 -2
package/dist/index.d.cts CHANGED
@@ -1,1635 +1,6 @@
1
- import * as react from 'react';
2
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, CSSProperties, ReactElement, ComponentPropsWithoutRef, HTMLInputTypeAttribute, TextareaHTMLAttributes, InputHTMLAttributes, ElementType, UIEvent, RefObject, LabelHTMLAttributes, JSX } 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, MotionGatedProps as MotionGatedProps$1, 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 { MotionGatedProps, 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 { PersistMode, PersistModeProps, ThemeContext, defineRecipe, defineSemanticToken, defineSemanticTokens, defineTheme, defineToken, defineTokens, defineTypography, resolveTypography, useTheme, useValidateChildren } from '@splenddev/kreativ-core';
8
- import { z } from 'zod';
9
- export * from '@splenddev/kreativ-core/hooks';
10
- import { ClassValue } from 'clsx';
11
-
12
- interface AdornmentProps extends HTMLAttributes<HTMLSpanElement> {
13
- children?: ReactNode;
14
- position?: "start" | "end";
15
- }
16
-
17
- declare const Adornment: react.ForwardRefExoticComponent<AdornmentProps & react.RefAttributes<HTMLSpanElement>>;
18
-
19
- type ButtonSize = SizeValue | "icon";
20
- type ButtonVariant = BaseVariant | "link";
21
- type ButtonColor = BaseColor | "black";
22
- interface ButtonRenderProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color"> {
23
- className?: string;
24
- style?: CSSProperties;
25
- disabled?: boolean;
26
- "aria-disabled"?: boolean;
27
- "aria-busy"?: boolean;
28
- "data-kui-responsive"?: string;
29
- children?: ReactNode;
30
- }
31
- interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
32
- size?: ButtonSize;
33
- leftIcon?: ReactNode;
34
- rightIcon?: ReactNode;
35
- iconOnly?: boolean;
36
- /**
37
- * Custom rendering escape hatch.
38
- *
39
- * Receives the resolved Button props and allows the consumer
40
- * to render the Button using another element or component.
41
- *
42
- * @example
43
- * ```tsx
44
- * <Button
45
- * render={(props) => (
46
- * <a {...props} href="/templates">
47
- * Templates
48
- * </a>
49
- * )}
50
- * >
51
- * Templates
52
- * </Button>
53
- * ```
54
- *
55
- * @remarks
56
- * The render function must be created inside a Client Component
57
- * when using Next.js App Router. Functions cannot be passed from
58
- * Server Components to Client Components.
59
- */
60
- render?: (props: ButtonRenderProps) => ReactElement;
61
- }
62
-
63
- declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
64
-
65
- type ButtonGroupSpacing = "none" | "sm" | "md" | "lg";
66
- interface ButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "size">, Omit<BaseProps, "unstyled">, SizeProps, OrientationProps {
67
- /**
68
- * Whether adjacent buttons should visually connect.
69
- *
70
- * @default false
71
- */
72
- attached?: boolean;
73
- /**
74
- * Space between group items when not attached.
75
- *
76
- * @default "md"
77
- */
78
- spacing?: ButtonGroupSpacing;
79
- }
80
- interface ButtonGroupSeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">, OrientationProps {
81
- }
82
- interface ButtonGroupTextProps extends HTMLAttributes<HTMLSpanElement>, Omit<BaseProps, "unstyled"> {
83
- }
84
- interface ButtonGroupLabelProps extends HTMLAttributes<HTMLSpanElement>, Omit<BaseProps, "unstyled"> {
85
- }
86
- interface ButtonGroupItemProps extends HTMLAttributes<HTMLDivElement> {
87
- }
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>>;
94
- };
95
-
96
- interface ButtonGroupContextValue {
97
- orientation: Orientation;
98
- attached: boolean;
99
- spacing: ButtonGroupSpacing;
100
- size?: ButtonProps["size"];
101
- }
102
- interface ButtonGroupItemContextValue {
103
- embedded: true;
104
- }
105
- declare const ButtonGroupContext: react.Context<ButtonGroupContextValue>;
106
- declare const ButtonGroupItemContext: react.Context<ButtonGroupItemContextValue | null>;
107
- /**
108
- * Hook to consume the button group context.
109
- * Throws an error if used outside of a `ButtonGroup` provider.
110
- */
111
- declare function useButtonGroupContext(): ButtonGroupContextValue;
112
- /**
113
- * Hook to consume the button group context without throwing.
114
- * Returns the default context if used outside a provider.
115
- */
116
- declare function useOptionalButtonGroupContext(): ButtonGroupContextValue;
117
- /**
118
- * Hook to check if a button is embedded inside a `ButtonGroupItem`.
119
- * Returns `true` if used inside an item, otherwise `false`.
120
- */
121
- declare function useButtonGroupItemContext(): boolean;
122
- declare function useOptionalButtonGroupItemContext(): ButtonGroupItemContextValue | null;
123
-
124
- type ThemeTogglerVariant = Exclude<ButtonVariant, "link">;
125
- type ThemeTogglerDisplay = "buttons" | "cycle";
126
- type ThemeTogglerColor = Exclude<BaseColor, "destructive" | "warning" | "success" | "white" | "info">;
127
- interface ThemeTogglerProps extends Omit<BaseProps, "style">, OrientationProps, VariantProps<ButtonVariant> {
128
- variant?: ButtonVariant;
129
- color?: ButtonProps["color"];
130
- activeVariant?: ButtonVariant;
131
- activeColor?: ButtonProps["color"];
132
- size?: ButtonProps["size"];
133
- iconOnly?: boolean;
134
- allowSystem?: boolean;
135
- rounded?: boolean;
136
- labels?: {
137
- light?: string;
138
- dark?: string;
139
- system?: string;
140
- };
141
- icons?: {
142
- light?: ReactNode;
143
- dark?: ReactNode;
144
- system?: ReactNode;
145
- };
146
- buttonProps?: ButtonProps;
147
- display?: "buttons" | "cycle";
148
- animated?: boolean;
149
- transition?: ThemeTogglerTransition;
150
- indicatorClassName?: string;
151
- indicatorStyle?: CSSProperties;
152
- }
153
-
154
- declare const ThemeToggler: _splenddev_kreativ_core.KuiComponent<ThemeTogglerProps & MotionGatedProps, HTMLElement>;
155
-
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;
167
- inputClassName?: string;
168
- scrollIntoViewOnError?: boolean;
169
- startIcon?: ReactNode;
170
- endIcon?: ReactNode;
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 = {
183
- type?: string;
184
- autoComplete?: string;
185
- placeholder?: string;
186
- pattern?: string;
187
- min?: number;
188
- max?: number;
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";
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
- };
210
-
211
- declare const Input: _splenddev_kreativ_core.KuiComponent<InputProps, HTMLInputElement>;
212
-
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
- type ValuePropConvention = "value" | "checked";
224
- /** Token names that map to `--kui-spacing-<token>`. */
225
- type SpaceToken = "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | (string & {});
226
- /**
227
- * - `"sm"` / `"md"` / … → `var(--kui-spacing-sm)`
228
- * - `24` → `"24px"`
229
- * - `"24px"` / `"1rem"` → used as-is
230
- */
231
- type SpaceValue = SpaceToken | number | (string & {});
232
- /** Any color token (`"brand"`, `"surface-raised"`) or raw CSS color. */
233
- type RadiusValue = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | (string & {});
234
-
235
- interface FormFieldError {
236
- name: string;
237
- message: react.ReactNode;
238
- }
239
- interface FormFieldMessageProps extends react.HTMLAttributes<HTMLParagraphElement> {
240
- children?: react.ReactNode;
241
- forceMount?: boolean;
242
- "data-kui-motion-gated"?: "true" | "false";
243
- }
244
- interface FormFieldMessageProps {
245
- children?: ReactNode;
246
- }
247
- interface FormFieldLabelProps extends react.LabelHTMLAttributes<HTMLLabelElement> {
248
- children?: react.ReactNode;
249
- }
250
- interface FormFieldDescriptionProps extends react.HTMLAttributes<HTMLParagraphElement> {
251
- children?: react.ReactNode;
252
- }
253
- interface FormFieldRootProps {
254
- id?: string;
255
- name?: string;
256
- status?: FormFieldStatus;
257
- message?: react.ReactNode;
258
- required?: boolean;
259
- disabled?: boolean;
260
- invalid?: boolean;
261
- className?: string;
262
- children?: react.ReactNode;
263
- validateOn?: ValidateOn;
264
- valuePropConvention?: ValuePropConvention;
265
- }
266
- interface FormFieldProps$1<P extends object = Record<string, never>> extends Omit<FormFieldRootProps, "children"> {
267
- as?: SingleFormControlComponent<P>;
268
- controlProps?: Partial<P>;
269
- label?: react.ReactNode;
270
- description?: react.ReactNode;
271
- message?: react.ReactNode;
272
- children?: react.ReactNode;
273
- }
274
-
275
- declare const FormField: (<P extends object>(props: FormFieldProps$1<P> & {
276
- ref?: react.Ref<unknown>;
277
- }) => react.ReactElement | null) & {
278
- Root: _splenddev_kreativ_core.KuiComponent<FormFieldRootProps, HTMLDivElement>;
279
- Label: _splenddev_kreativ_core.KuiComponent<FormFieldLabelProps, HTMLLabelElement>;
280
- Description: _splenddev_kreativ_core.KuiComponent<FormFieldDescriptionProps, HTMLParagraphElement>;
281
- Message: _splenddev_kreativ_core.KuiComponent<FormFieldMessageProps, HTMLParagraphElement>;
282
- Control: _splenddev_kreativ_core.KuiComponent<FormFieldControlProps, unknown>;
283
- };
284
-
285
- declare const FormFieldLabel: _splenddev_kreativ_core.KuiComponent<FormFieldLabelProps, HTMLLabelElement>;
286
-
287
- declare const FormFieldDescription: _splenddev_kreativ_core.KuiComponent<FormFieldDescriptionProps, HTMLParagraphElement>;
288
-
289
- declare const FormFieldMessage: _splenddev_kreativ_core.KuiComponent<FormFieldMessageProps, HTMLParagraphElement>;
290
-
291
- 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"> {
292
- rounded?: boolean;
293
- placeholder?: string;
294
- required?: boolean;
295
- name?: string;
296
- size?: InputSize;
297
- children: ReactNode;
298
- }
299
- interface SelectTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "className">, Styleable {
300
- }
301
- interface SelectContentProps extends Omit<HTMLAttributes<HTMLDivElement>, "className">, Styleable {
302
- }
303
- interface SelectItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "className">, DisabledProps$1, Styleable {
304
- value: string;
305
- children: ReactNode;
306
- }
307
- interface SelectValueProps extends Styleable {
308
- placeholder?: string;
309
- }
310
- interface SelectGroupProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
311
- }
312
- interface SelectLabelProps extends Styleable, Required<Pick<BaseProps$1, "children">> {
313
- }
314
-
315
- declare function SelectContent({ className, children, ...props }: SelectContentProps): react.JSX.Element;
316
-
317
- declare function SelectItem({ value, disabled, children, className, ...props }: SelectItemProps): react.JSX.Element;
318
-
319
- declare function SelectValue({ placeholder, className }: SelectValueProps): react.JSX.Element;
320
-
321
- declare function SelectGroup({ children, className }: SelectGroupProps): react.JSX.Element;
322
-
323
- declare function SelectLabel({ children, className }: SelectLabelProps): react.JSX.Element;
324
-
325
- interface SelectOption {
326
- value: string;
327
- label: react.ReactNode;
328
- disabled?: boolean;
329
- }
330
- interface SelectProps extends Omit<SelectRootProps, "children"> {
331
- options?: SelectOption[];
332
- children?: react.ReactNode;
333
- label?: string | react.ReactNode;
334
- }
335
- declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLDivElement>> & {
336
- Root: _splenddev_kreativ_core.KuiComponent<SelectRootProps, HTMLDivElement>;
337
- Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
338
- Content: typeof SelectContent;
339
- Item: typeof SelectItem;
340
- Value: typeof SelectValue;
341
- Group: typeof SelectGroup;
342
- Label: typeof SelectLabel;
343
- __kui: {
344
- formControl: "compound";
345
- };
346
- };
347
-
348
- declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
349
-
350
- declare const SelectRoot: _splenddev_kreativ_core.KuiComponent<SelectRootProps, HTMLDivElement>;
351
-
352
- type TextareaResize = "none" | "both" | "horizontal" | "vertical";
353
- 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 {
354
- resize?: TextareaResize;
355
- autoResize?: boolean;
356
- minRows?: number;
357
- maxRows?: number;
358
- characterCounter?: boolean;
359
- debounceDelay?: number;
360
- }
361
- type TextareaProps = TextareaCoreProps;
362
-
363
- declare const Textarea: _splenddev_kreativ_core.KuiComponent<TextareaCoreProps, HTMLTextAreaElement>;
364
-
365
- type MarkdownEditorTabs = "write" | "preview";
366
- interface MarkdownEditorProps extends Omit<TextareaCoreProps, "resize" | "autoResize"> {
367
- /** Renders the Preview tab. Omit and Preview shows raw text with a dev warning. */
368
- renderMarkdown?: (value: string) => ReactNode;
369
- tab?: MarkdownEditorTabs;
370
- defaultTab?: MarkdownEditorTabs;
371
- onTabChange?: (tab: MarkdownEditorTabs) => void;
372
- hint?: ReactNode;
373
- }
374
-
375
- declare const MarkdownEditor: _splenddev_kreativ_core.KuiComponent<MarkdownEditorProps & MotionGatedProps, HTMLTextAreaElement>;
376
-
377
- interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "children">, Styleable$1, StateProps, StatusProps, MotionGatedProps$1, ControlledProps<boolean, "checked", "defaultChecked", "onCheckedChange"> {
378
- indeterminate?: boolean;
379
- size?: InputSize;
380
- disabled?: boolean;
381
- label?: ReactNode;
382
- description?: ReactNode;
383
- }
384
-
385
- declare const Checkbox: _splenddev_kreativ_core.KuiComponent<CheckboxProps, HTMLInputElement>;
386
-
387
- type RadioSize = "sm" | "md" | "lg";
388
- interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked" | "onChange" | "name" | "value">, Styleable$1 {
389
- value: string;
390
- disabled?: boolean;
391
- label?: ReactNode;
392
- description?: ReactNode;
393
- }
394
-
395
- interface RadioGroupProps extends Styleable$1 {
396
- value?: string;
397
- defaultValue?: string;
398
- onValueChange?: (value: string) => void;
399
- name?: string;
400
- disabled?: boolean;
401
- required?: boolean;
402
- orientation?: "horizontal" | "vertical";
403
- size?: RadioSize;
404
- error?: boolean;
405
- success?: boolean;
406
- children: ReactNode;
407
- }
408
-
409
- declare function RadioGroup({ value: valueProp, defaultValue, onValueChange, name: nameProp, disabled, required, orientation, size, error, success, className, children, }: RadioGroupProps): react.JSX.Element;
410
-
411
- declare function Radio({ value, disabled: itemDisabled, label, description, className, ...props }: RadioProps): react.JSX.Element;
412
-
413
- type SwitchSize = "xs" | "sm" | "md" | "lg";
414
- interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable$1 {
415
- checked?: boolean;
416
- defaultChecked?: boolean;
417
- onCheckedChange?: (checked: boolean) => void;
418
- size?: SwitchSize;
419
- error?: boolean;
420
- success?: boolean;
421
- label?: ReactNode;
422
- description?: ReactNode;
423
- }
424
-
425
- declare const Switch: _splenddev_kreativ_core.KuiComponent<SwitchProps & MotionGatedProps$1, HTMLInputElement>;
426
-
427
- interface ComboboxProps extends Omit<BaseProps, "unstyled">, ValueProps<string | undefined>, ControlledProps<string | undefined, "inputValue", "defaultInputValue", "onInputChange">, DisabledProps, VariantProps<BaseVariant>, SizeProps, ClearableProps, StatusProps, StateProps {
428
- required?: boolean;
429
- rounded?: boolean;
430
- name?: string;
431
- placeholder?: string;
432
- allowFreeText?: boolean;
433
- }
434
- interface ComboboxItemProps {
435
- value: string;
436
- disabled?: boolean;
437
- children: ReactNode;
438
- className?: string;
439
- }
440
- interface ComboboxInputProps extends InputProps {
441
- allowFreeText?: boolean;
442
- }
443
-
444
- declare function ComboboxItem({ value, disabled, children, className, }: ComboboxItemProps): react.JSX.Element | null;
445
-
446
- declare function ComboboxContent({ className, children, }: {
447
- className?: string;
448
- children: React.ReactNode;
449
- }): react.JSX.Element | null;
450
-
451
- interface ComboboxEmptyProps {
452
- children?: React.ReactNode;
453
- className?: string;
454
- }
455
- declare function ComboboxEmpty({ children }: ComboboxEmptyProps): react.JSX.Element | null;
456
-
457
- interface ComboboxLoadingProps {
458
- children?: React.ReactNode;
459
- className?: string;
460
- }
461
- declare function ComboboxLoading({ children, className, }: ComboboxLoadingProps): react.JSX.Element;
462
-
463
- declare function Combobox({ value, onValueChange, inputValue: inputValueProp, defaultInputValue, onInputChange, disabled, name, error, success, rounded, className, children, }: ComboboxProps): react.JSX.Element;
464
- declare namespace Combobox {
465
- var Input: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
466
- var Item: typeof ComboboxItem;
467
- var Content: typeof ComboboxContent;
468
- var Empty: typeof ComboboxEmpty;
469
- var Loading: typeof ComboboxLoading;
470
- }
471
-
472
- declare const ComboboxInput: react.ForwardRefExoticComponent<ComboboxInputProps & react.RefAttributes<HTMLInputElement>>;
473
-
474
- interface MultiSelectProps extends Styleable$1 {
475
- value?: string[];
476
- defaultValue?: string[];
477
- onValueChange?: (value: string[]) => void;
478
- disabled?: boolean;
479
- required?: boolean;
480
- error?: boolean;
481
- success?: boolean;
482
- rounded?: boolean;
483
- clearable?: boolean;
484
- name?: string;
485
- variant?: InputVariant;
486
- size?: InputSize;
487
- placeholder?: string;
488
- maxVisibleChips?: number;
489
- children: ReactNode;
490
- }
491
- interface MultiSelectItemProps {
492
- value: string;
493
- disabled?: boolean;
494
- children: ReactNode;
495
- className?: string;
496
- }
497
-
498
- interface MultiSelectContentProps extends HTMLAttributes<HTMLDivElement> {
499
- className?: string;
500
- }
501
- declare function MultiSelectContent({ className, children, ...props }: MultiSelectContentProps): react.JSX.Element | null;
502
-
503
- declare function MultiSelectItem({ value, disabled, children, className, }: MultiSelectItemProps): react.JSX.Element;
504
-
505
- declare function MultiSelect({ value: valueProp, defaultValue, onValueChange, disabled, required, name, variant, size, placeholder, maxVisibleChips, className, children, error, success, rounded, clearable, }: MultiSelectProps): react.JSX.Element;
506
- declare namespace MultiSelect {
507
- var Trigger: react.ForwardRefExoticComponent<{
508
- className?: string;
509
- } & react.RefAttributes<HTMLButtonElement>>;
510
- var Content: typeof MultiSelectContent;
511
- var Item: typeof MultiSelectItem;
512
- }
513
-
514
- declare const MultiSelectTrigger: react.ForwardRefExoticComponent<{
515
- className?: string;
516
- } & react.RefAttributes<HTMLButtonElement>>;
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
- hideKindIcon?: InputProps["hideKindIcon"];
610
- error?: boolean;
611
- success?: boolean;
612
- rounded?: boolean;
613
- fullWidth?: boolean;
614
- clampOn?: NumberStepperClampOn;
615
- onValidate?: (result: NumberStepperValidationResult) => void;
616
- buttonLayout?: NumberStepperButtonLayout;
617
- disabled?: boolean;
618
- required?: boolean;
619
- name?: string;
620
- size?: "sm" | "md" | "lg";
621
- className?: string;
622
- style?: react.CSSProperties;
623
- "aria-label"?: string;
624
- }
625
-
626
- interface ComponentPropsMap {
627
- input: InputProps;
628
- select: SelectProps;
629
- switch: SwitchProps;
630
- textarea: TextareaProps;
631
- checkbox: CheckboxProps;
632
- 'number-stepper': NumberStepperProps;
633
- }
634
- type ComponentKey = keyof ComponentPropsMap;
635
-
636
- interface FormControlProps {
637
- id: string;
638
- "aria-invalid": boolean | undefined;
639
- "aria-required": boolean | undefined;
640
- "aria-describedby": string | undefined;
641
- disabled: boolean;
642
- }
643
-
644
- interface KuiFormControlValueProps<T = unknown> {
645
- value?: T;
646
- onValueChange: (value: T) => void;
647
- }
648
- type KuiFormControlComponent<P extends KuiFormControlValueProps<any> = KuiFormControlValueProps<any>> = react.ComponentType<P> & {
649
- __kui: {
650
- formControl: "single" | "compound";
651
- };
652
- };
653
- interface FieldState {
654
- error?: react.ReactNode;
655
- invalid: boolean;
656
- isDirty: boolean;
657
- }
658
- interface FieldApi<T = unknown> {
659
- value: T;
660
- onChange: (value: T) => void;
661
- onBlur: () => void;
662
- name: string;
663
- }
664
- type CustomFieldRenderer<T = unknown> = (args: {
665
- field: FieldApi<T>;
666
- fieldState: FieldState;
667
- controlProps: FormControlProps;
668
- }) => react.ReactNode;
669
- interface FormFieldProps {
670
- tone?: "default" | "warning" | "info";
671
- orientation?: "vertical" | "horizontal";
672
- }
673
- interface UISectionSchema {
674
- label?: react.ReactNode;
675
- description?: react.ReactNode;
676
- fields: string[];
677
- layout?: string;
678
- columns?: string;
679
- order?: number;
680
- }
681
- interface UIFieldSchemaWidgetKey<K extends ComponentKey = ComponentKey> extends UIFieldSchemaBase {
682
- widget: K;
683
- props?: Partial<ComponentPropsMap[K]>;
684
- render?: never;
685
- }
686
- interface UIFieldSchemaWidgetComponent<P extends KuiFormControlValueProps = KuiFormControlValueProps> extends UIFieldSchemaBase {
687
- widget: KuiFormControlComponent<P>;
688
- props?: Partial<P>;
689
- render?: never;
690
- }
691
- interface UIFieldSchemaWidgetInferred extends UIFieldSchemaBase {
692
- widget?: never;
693
- props?: never;
694
- render?: never;
695
- }
696
- interface UIFieldSchemaRender<T = unknown> extends UIFieldSchemaBase {
697
- widget?: never;
698
- props?: never;
699
- render: CustomFieldRenderer<T>;
700
- }
701
- interface UIFieldSchemaBase {
702
- label?: react.ReactNode;
703
- description?: react.ReactNode;
704
- order?: number;
705
- hidden?: boolean;
706
- formField?: FormFieldProps;
707
- }
708
- interface UIFieldSchemaBase {
709
- label?: react.ReactNode;
710
- description?: react.ReactNode;
711
- order?: number;
712
- hidden?: boolean;
713
- formField?: FormFieldProps;
714
- /**
715
- * CSS `grid-area` name used to place this field inside a `$sections`
716
- * grid. Only honored for leaf fields (widgets, inferred, custom
717
- * renderers) — object and array groups ignore it. When the field is
718
- * claimed by a section, the section's own `layout` grid takes precedence.
719
- */
720
- gridArea?: string;
721
- }
722
- type UIFieldSchema<K extends ComponentKey = ComponentKey, P extends KuiFormControlValueProps = KuiFormControlValueProps, T = unknown> = UIFieldSchemaWidgetKey<K> | UIFieldSchemaWidgetComponent<P> | UIFieldSchemaWidgetInferred | UIFieldSchemaRender<T>;
723
- type UIFieldSchemaFor<V> = V extends Array<infer Item> ? UIArraySchemaFor<Item> : V extends object ? UIObjectSchemaForShape<V> | UIFieldSchema<ComponentKey, any, V> : UIFieldSchema<ComponentKey, any, V>;
724
- type UIObjectSchema = {
725
- [key: string]: UIFieldSchema | UIObjectSchema | UIArraySchema;
726
- } & {
727
- $sections?: UISectionSchema[];
728
- };
729
- interface UIArraySchema {
730
- label?: react.ReactNode;
731
- description?: react.ReactNode;
732
- item: UIFieldSchema | UIObjectSchema;
733
- addLabel?: react.ReactNode;
734
- itemLabel?: string;
735
- removable?: boolean;
736
- reorderable?: boolean;
737
- /**
738
- * CSS `grid-area` name used to place this field inside a `$sections`
739
- * grid. Only honored for leaf fields (widgets, inferred, custom
740
- * renderers) — object and array groups ignore it. When the field is
741
- * claimed by a section, the section's own `layout` grid takes precedence.
742
- */
743
- gridArea?: string;
744
- }
745
- type UIObjectSchemaFor<Schema extends z.ZodObject<any>> = {
746
- [K in keyof z.infer<Schema>]?: UIFieldSchemaFor<z.infer<Schema>[K]>;
747
- } & {
748
- $sections?: UISectionSchema[];
749
- };
750
- type UIObjectSchemaForShape<V> = {
751
- [K in keyof V]?: UIFieldSchemaFor<V[K]>;
752
- };
753
- type UIArraySchemaFor<Item> = {
754
- label?: react.ReactNode;
755
- description?: react.ReactNode;
756
- item: UIFieldSchemaFor<Item>;
757
- addLabel?: react.ReactNode;
758
- itemLabel?: string;
759
- removable?: boolean;
760
- reorderable?: boolean;
761
- /**
762
- * CSS `grid-area` name used to place this field inside a `$sections`
763
- * grid. Only honored for leaf fields (widgets, inferred, custom
764
- * renderers) — object and array groups ignore it. When the field is
765
- * claimed by a section, the section's own `layout` grid takes precedence.
766
- */
767
- gridArea?: string;
768
- };
769
- /**
770
- * Object schema shape with unconstrained keys.
771
- *
772
- * @deprecated Use {@link UIObjectSchemaFor} for strict, Zod-inferred key and
773
- * widget checking. `UIObjectSchema` accepts any string key and any
774
- * `UIFieldSchema`, so it won't catch typos or wrong widget names — it exists
775
- * only as the fallback shape when no Zod schema is in scope (e.g. inside a
776
- * `<Form>` when `Schema` isn't supplied as a type argument). Prefer typing
777
- * `uiSchema` against the inferred shape:
778
- *
779
- * @example
780
- * const ui: UIObjectSchemaFor<typeof profileSchema> = { ... };
781
- */
782
- type UISchema = UIObjectSchema;
783
-
784
- /**
785
- * Props for using Form.FromSchema inside a parent `<Form schema={...}>`.
786
- * The schema comes from context, so `schema` is typed `never` here — passing
787
- * one is a compile error rather than a silent override.
788
- */
789
- interface FormFromSchemaContextProps<Schema extends z.ZodObject<any>> {
790
- /**
791
- * Zod object schema to generate fields from. When omitted, the enclosing
792
- * `<Form>`'s schema is used. Providing it here also drives inference of
793
- * `Schema` for `uiSchema`.
794
- */
795
- uiSchema?: UIObjectSchemaFor<Schema>;
796
- /**
797
- * Presentation overlay keyed by the schema's field names. When `Schema`
798
- * is known, keys and per-field props are checked against the inferred
799
- * shape; otherwise keys are unconstrained.
800
- */
801
- schema?: never;
802
- }
803
- /**
804
- * Props for using Form.FromSchema on its own, with `schema` passed directly.
805
- */
806
- interface FormFromSchemaStandaloneProps<Schema extends z.ZodObject<any>> {
807
- /**
808
- * Zod object schema to generate fields from. When omitted, the enclosing
809
- * `<Form>`'s schema is used. Providing it here also drives inference of
810
- * `Schema` for `uiSchema`.
811
- */
812
- uiSchema?: UIObjectSchemaFor<Schema>;
813
- /**
814
- * Presentation overlay keyed by the schema's field names. When `Schema`
815
- * is known, keys and per-field props are checked against the inferred
816
- * shape; otherwise keys are unconstrained.
817
- */
818
- schema: Schema;
819
- }
820
- /**
821
- * Props for `<Form.FromSchema>`.
822
- *
823
- * `Schema` is inferred from the `schema` prop in standalone mode; when used
824
- * inside a `<Form>`, supply it explicitly as a type argument to get
825
- * key-checking on `uiSchema`. Otherwise `uiSchema` falls back to the
826
- * unconstrained `UIObjectSchema` shape.
827
- *
828
- * ### Strict vs. loose `uiSchema` typing
829
- *
830
- * - **Strict**: type `uiSchema` as `UIObjectSchemaFor<typeof schema>` (or let
831
- * it be inferred by passing `schema` directly). Keys, nested field names,
832
- * widget keys, and per-field `props` are all checked against the Zod
833
- * output. This is what you want almost everywhere.
834
- * - **Loose**: `UIObjectSchema` / `UISchema`. Any string key, any
835
- * `UIFieldSchema`. Used only as the fallback when `Schema` can't be
836
- * inferred (e.g. `<Form.FromSchema uiSchema={...} />` inside a `<Form>`).
837
- * Wrong keys, misspelled widgets, and mismatched `props` all type-check.
838
- *
839
- * `UISchema` is deprecated for this reason — reach for `UIObjectSchemaFor`
840
- * whenever you have a Zod schema available.
841
- */
842
- type FormFromSchemaProps<Schema extends z.ZodObject<any> = z.ZodObject<any>> = FormFromSchemaContextProps<Schema> | FormFromSchemaStandaloneProps<Schema>;
843
- /**
844
- * Generates a set of fields from a Zod object schema.
845
- *
846
- * Write the shape once in Zod, optionally layer presentation on top with a
847
- * `uiSchema`, and skip writing a `<Field>` for every property. Fields you
848
- * don't mention in `uiSchema` still render — the generator picks a widget
849
- * based on the Zod type. Use `uiSchema` only for the ones you want to
850
- * override.
851
- *
852
- * `Schema` is inferred automatically when you pass `schema` directly
853
- * (standalone mode) — `uiSchema`'s keys are checked against that schema's
854
- * shape with no extra annotation needed. Inside a `<Form>`, there's no
855
- * `schema` prop for inference to key off, so `Schema` must be supplied
856
- * explicitly as a type argument for `uiSchema` to get the same
857
- * key-checking; omitted, it falls back to the unconstrained shape.
858
- *
859
- * Schema resolution, in order:
860
- * 1. The `schema` prop, if you passed one.
861
- * 2. The enclosing `<Form>`'s schema, if there is one.
862
- *
863
- * If neither exists, or the result isn't a `z.object({...})`, this throws.
864
- * Errors are prefixed `[kreativ-ui/Form.FromSchema]` so they're easy to
865
- * grep for.
866
- *
867
- * Renders a fragment — no wrapper element — so the fields land directly
868
- * inside whatever container you put this in.
869
- *
870
- * @example
871
- * // Schema from context — Schema isn't inferable here, so uiSchema is
872
- * // checked against profileSchema only if you supply the type argument:
873
- * <Form schema={profileSchema}>
874
- * <Form.FromSchema<typeof profileSchema> uiSchema={profileUiSchema} />
875
- * </Form>
876
- *
877
- * @example
878
- * // Schema passed in — Schema is inferred from `schema`, uiSchema is
879
- * // checked automatically, no type argument needed:
880
- * <Form.FromSchema schema={profileSchema} uiSchema={profileUiSchema} />
881
- */
882
- declare function FormFromSchema<Schema extends z.ZodObject<any> = z.ZodObject<any>>({ uiSchema, schema: standaloneSchema }: FormFromSchemaProps<Schema>): react.JSX.Element;
883
-
884
- declare function defineUIField<K extends ComponentKey>(field: UIFieldSchemaWidgetKey<K>): UIFieldSchemaWidgetKey<K>;
885
- declare function defineUIField<P extends KuiFormControlValueProps<any>>(field: UIFieldSchemaWidgetComponent<P>): UIFieldSchemaWidgetComponent<P>;
886
- declare function defineUIField(field: UIFieldSchemaWidgetInferred): UIFieldSchemaWidgetInferred;
887
- declare function defineUIField<T>(field: UIFieldSchemaRender<T>): UIFieldSchemaRender<T>;
888
-
889
- /**
890
- * Form owns real orchestration, not a thin semantic <form> wrapper —
891
- * submit handling, validation orchestration across its FormFields,
892
- * and error aggregation are all Form's responsibility. It provides a
893
- * FormContext that FormField reads to auto-wire validation/errors/
894
- * disabled state.
895
- *
896
- * Usage:
897
- * ```tsx
898
- * <Form schema={zodSchema} onSubmit={handleSubmit}>
899
- * <FormField name="email" as={Input} label="Email" />
900
- * <Form.SubmitButton><Button>Submit</Button></Form.SubmitButton>
901
- * </Form>
902
- *```
903
- * Or, schema-driven field generation:
904
- * ```tsx
905
- * <Form schema={zodSchema} onSubmit={handleSubmit}>
906
- * <Form.FromSchema uiSchema={uiSchema} />
907
- * <Form.SubmitButton><Button>Submit</Button></Form.SubmitButton>
908
- * </Form>
909
- * ```
910
- */
911
- declare const Form: react.ForwardRefExoticComponent<FormRootProps & react.RefAttributes<HTMLFormElement>> & {
912
- __kui: _splenddev_kreativ_core.KuiMeta<FormRootProps>;
913
- providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
914
- } & {
915
- SubmitButton: react.ForwardRefExoticComponent<FormSubmitButtonProps & react.RefAttributes<unknown>>;
916
- ResetButton: react.ForwardRefExoticComponent<FormResetButtonProps & react.RefAttributes<unknown>>;
917
- FromSchema: typeof FormFromSchema;
918
- };
919
-
920
- interface ContainerProps extends BaseProps {
921
- /** @default "lg" */
922
- maxWidth?: Size | (string & {});
923
- /** Token name ("sm"), pixel number (24), or raw length ("24px"). */
924
- padding?: ResponsiveValue<SpaceValue>;
925
- /** @default true */
926
- centered?: boolean;
927
- as?: ElementType;
928
- children?: ReactNode;
929
- }
930
-
931
- declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLDivElement>>;
932
-
933
- interface FlexProps extends BaseProps {
934
- /**
935
- * `display: inline-flex` instead of `flex`.
936
- * Use when the container should sit in a line of text or shrink to its content.
937
- * @default false
938
- */
939
- inline?: boolean;
940
- /**
941
- * `flex-direction`. Main axis of the items.
942
- * @default "row"
943
- */
944
- direction?: ResponsiveValue<CSSProperties["flexDirection"]>;
945
- /**
946
- * `flex-wrap`. Whether items stay on one line or wrap onto new lines.
947
- * @default "nowrap"
948
- */
949
- wrap?: ResponsiveValue<CSSProperties["flexWrap"]>;
950
- /**
951
- * `align-items`. Alignment on the cross axis.
952
- * `"stretch"` fills the cross size; `"center"` centers; `"start"` / `"end"` pin to an edge.
953
- */
954
- align?: ResponsiveValue<CSSProperties["alignItems"]>;
955
- /**
956
- * `justify-content`. Distribution on the main axis.
957
- * `"between"` pushes the first and last items to the edges; `"center"` groups them in the middle.
958
- */
959
- justify?: ResponsiveValue<CSSProperties["justifyContent"]>;
960
- /**
961
- * `gap` on both axes. Token (`"sm"`), pixel number (`24`), or raw length (`"24px"`).
962
- * Overridden per axis by `gapX` / `gapY`.
963
- */
964
- gap?: ResponsiveValue<SpaceValue>;
965
- /**
966
- * `column-gap`. Space between items on the inline axis.
967
- * Overrides `gap` for that axis only.
968
- */
969
- gapX?: ResponsiveValue<SpaceValue>;
970
- /**
971
- * `row-gap`. Space between items on the block axis.
972
- * Overrides `gap` for that axis only.
973
- */
974
- gapY?: ResponsiveValue<SpaceValue>;
975
- /**
976
- * `flex-grow`. How much free space this item takes on the main axis.
977
- * - `true` is `1` (share leftover space).
978
- * - `false` is `0` (do not grow).
979
- * - A number, or a responsive map, is passed through.
980
- */
981
- grow?: ResponsiveValue<CSSProperties["flexGrow"]> | boolean;
982
- /**
983
- * `flex-shrink`. How readily this item gives up space when the line is tight.
984
- * - `true` is `1` (may shrink; the CSS default).
985
- * - `false` is `0` (keep its size).
986
- * - A number, or a responsive map, is passed through.
987
- */
988
- shrink?: ResponsiveValue<CSSProperties["flexShrink"]> | boolean;
989
- /**
990
- * `flex-basis`. Starting size before free space is distributed.
991
- * `"auto"` uses the item's width/height. `"0"` ignores content size and shares space by `grow`.
992
- * Also accepts `"content"`, a length, or a percentage.
993
- */
994
- basis?: ResponsiveValue<CSSProperties["flexBasis"]>;
995
- /** `width: 100%`. */
996
- fullWidth?: boolean;
997
- /** `height: 100%`. */
998
- fullHeight?: boolean;
999
- /**
1000
- * Element to render.
1001
- * @default "div"
1002
- */
1003
- as?: ElementType;
1004
- }
1005
-
1006
- declare const Flex: _splenddev_kreativ_core.KuiComponent<FlexProps, HTMLDivElement>;
1007
-
1008
- interface StackProps extends BaseProps {
1009
- /**
1010
- * Layout direction of the stack.
1011
- * @default "vertical"
1012
- */
1013
- orientation?: Orientation;
1014
- gap?: ResponsiveValue<Size | (string & {})>;
1015
- align?: ResponsiveValue<CSSProperties["alignItems"]>;
1016
- justify?: ResponsiveValue<CSSProperties["justifyContent"]>;
1017
- wrap?: ResponsiveValue<CSSProperties["flexWrap"]>;
1018
- /** Renders between each child. */
1019
- divider?: ReactNode;
1020
- as?: ElementType;
1021
- children?: ReactNode;
1022
- }
1023
-
1024
- declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLDivElement>>;
1025
-
1026
- interface GridProps extends BaseProps {
1027
- /**
1028
- * Equal columns. `columns={3}` is `repeat(3, minmax(0, 1fr))`.
1029
- * Do not combine with `minChildWidth` or `templateColumns`.
1030
- */
1031
- columns?: ResponsiveValue<number>;
1032
- /**
1033
- * Wrap columns to the container. `minChildWidth="200px"` is
1034
- * `repeat(auto-fit, minmax(200px, 1fr))`.
1035
- * Do not combine with `columns` or `templateColumns`.
1036
- */
1037
- minChildWidth?: ResponsiveValue<Size | (string & {})>;
1038
- /**
1039
- * Raw `grid-template-columns`. Wins over `columns` and `minChildWidth`.
1040
- */
1041
- templateColumns?: ResponsiveValue<string>;
1042
- /** Raw `grid-template-rows`. */
1043
- templateRows?: ResponsiveValue<string>;
1044
- /**
1045
- * Raw `grid-template-areas`.
1046
- * Not responsive. Areas rarely change by breakpoint.
1047
- */
1048
- templateAreas?: string;
1049
- /**
1050
- * `grid-auto-flow`. `"row dense"` packs holes.
1051
- */
1052
- autoFlow?: ResponsiveValue<CSSProperties["gridAutoFlow"]>;
1053
- /**
1054
- * `gap` on both axes. Token, pixel number, or raw length.
1055
- * Overridden per axis by `gapX` / `gapY`.
1056
- */
1057
- gap?: ResponsiveValue<SpaceValue>;
1058
- /** `column-gap`. Overrides `gap` on the inline axis. */
1059
- gapX?: ResponsiveValue<SpaceValue>;
1060
- /** `row-gap`. Overrides `gap` on the block axis. */
1061
- gapY?: ResponsiveValue<SpaceValue>;
1062
- /** `align-items`. Alignment inside the cell, on the block axis. */
1063
- align?: ResponsiveValue<CSSProperties["alignItems"]>;
1064
- /** `justify-items`. Alignment inside the cell, on the inline axis. */
1065
- justifyItems?: ResponsiveValue<CSSProperties["justifyItems"]>;
1066
- /**
1067
- * `display: inline-grid` instead of `grid`.
1068
- * @default false
1069
- */
1070
- inline?: boolean;
1071
- /**
1072
- * Element to render.
1073
- * @default "div"
1074
- */
1075
- as?: ElementType;
1076
- }
1077
- interface GridItemProps extends BaseProps {
1078
- /**
1079
- * `grid-column`. A number is `span <n>`. `"full"` is `1 / -1`.
1080
- */
1081
- span?: ResponsiveValue<number | "full">;
1082
- /**
1083
- * `grid-row`. A number is `span <n>`. `"full"` is `1 / -1`.
1084
- */
1085
- rowSpan?: ResponsiveValue<number | "full">;
1086
- /**
1087
- * Element to render.
1088
- * @default "div"
1089
- */
1090
- as?: ElementType;
1091
- }
1092
-
1093
- declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLDivElement>> & {
1094
- __kui: _splenddev_kreativ_core.KuiMeta<GridProps>;
1095
- providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
1096
- } & {
1097
- Item: _splenddev_kreativ_core.KuiComponent<GridItemProps, HTMLDivElement>;
1098
- };
1099
-
1100
- type CardVariant = "solid" | "outline" | "ghost" | "elevated" | "compact";
1101
- type CardSize = "sm" | "md" | "lg";
1102
- interface CardProps extends ComponentPropsWithoutRef<"div"> {
1103
- /**
1104
- * Visual style of the card.
1105
- */
1106
- variant?: CardVariant;
1107
- /**
1108
- * Controls each section's padding and overall density. Read by
1109
- * Card.Header/Card.Body/Card.Footer, not applied by Card itself.
1110
- */
1111
- size?: CardSize;
1112
- /**
1113
- * Makes the card span the full available width.
1114
- */
1115
- fullWidth?: boolean;
1116
- /**
1117
- * Card content.
1118
- */
1119
- children?: ReactNode;
1120
- }
1121
- interface CardHeaderProps extends ComponentPropsWithoutRef<"div"> {
1122
- /**
1123
- * Controls this section's padding. Defaults to the nearest Card's
1124
- * `size`, settable per-section when it needs to differ.
1125
- */
1126
- size?: CardSize;
1127
- /**
1128
- * Removes this section's padding — for a section that should bleed,
1129
- * independent of its siblings.
1130
- */
1131
- noPadding?: boolean;
1132
- children?: ReactNode;
1133
- }
1134
- interface CardBodyProps extends ComponentPropsWithoutRef<"div"> {
1135
- size?: CardSize;
1136
- noPadding?: boolean;
1137
- children?: ReactNode;
1138
- }
1139
- interface CardFooterProps extends ComponentPropsWithoutRef<"div"> {
1140
- size?: CardSize;
1141
- noPadding?: boolean;
1142
- children?: ReactNode;
1143
- }
1144
- type CardMediaFit = "cover" | "contain" | "fill" | "none";
1145
- type CardMediaBlend = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten";
1146
- interface CardMediaProps extends ComponentPropsWithoutRef<"div"> {
1147
- /**
1148
- * Image source, rendered by Media's internal `<img>`.
1149
- */
1150
- src: string;
1151
- /**
1152
- * Alt text for the internal `<img>`.
1153
- */
1154
- alt: string;
1155
- /**
1156
- * Controls how the image fills Media's box, mirroring `object-fit`.
1157
- */
1158
- fit?: CardMediaFit;
1159
- /**
1160
- * Blend mode applied to the image, mirroring `mix-blend-mode`.
1161
- */
1162
- blend?: CardMediaBlend;
1163
- /**
1164
- * Fixed aspect ratio for Media's box (e.g. `16 / 9`). Media is the
1165
- * sizing context for the card's media area — content stacked inside it
1166
- * (Card.Overlay, custom children) positions against this box.
1167
- */
1168
- aspectRatio?: number | string;
1169
- /**
1170
- * Content stacked on top of the image — Card.Overlay, text, controls.
1171
- */
1172
- children?: ReactNode;
1173
- }
1174
- type CardOverlayGradientEdge = "top" | "bottom" | "left" | "right";
1175
- interface CardOverlayRadialGradient {
1176
- type: "radial";
1177
- /**
1178
- * CSS position for the radial's center (e.g. "center", "top left").
1179
- * Defaults to "center".
1180
- */
1181
- position?: string;
1182
- }
1183
- type CardOverlayGradient = CardOverlayGradientEdge | CardOverlayRadialGradient;
1184
- interface CardOverlayProps extends ComponentPropsWithoutRef<"div"> {
1185
- /**
1186
- * Scrim tint color drawn over the underlying layer. When `gradient` is
1187
- * set, this is the gradient's solid stop color rather than a flat wash.
1188
- */
1189
- color?: string;
1190
- /**
1191
- * Opacity of the scrim tint, 0–1. When `gradient` is set, this is the
1192
- * gradient's starting-stop opacity rather than a uniform multiply.
1193
- */
1194
- opacity?: number;
1195
- /**
1196
- * Blur applied over the composited layer beneath the overlay. Independent
1197
- * of `gradient` — the two compose freely (a frosted panel that also
1198
- * fades out).
1199
- */
1200
- blur?: number | string;
1201
- /**
1202
- * Fades `color` to transparent instead of painting a uniform flat wash —
1203
- * either linear from a named edge, or radial from a position (default
1204
- * "center").
1205
- */
1206
- gradient?: CardOverlayGradient;
1207
- /**
1208
- * Content rendered above the overlay (title, actions, etc.). Usable
1209
- * inside Card.Media (over an image) or inside Card.Header/Body/Footer
1210
- * (as a decorative background layer behind section content) — any of
1211
- * these are a positioned ancestor Overlay can fill.
1212
- */
1213
- children?: ReactNode;
1214
- }
1215
-
1216
- declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>> & {
1217
- __kui: _splenddev_kreativ_core.KuiMeta<CardProps>;
1218
- providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
1219
- } & {
1220
- Header: _splenddev_kreativ_core.KuiComponent<CardHeaderProps, HTMLDivElement>;
1221
- Body: _splenddev_kreativ_core.KuiComponent<CardBodyProps, HTMLDivElement>;
1222
- Footer: _splenddev_kreativ_core.KuiComponent<CardFooterProps, HTMLDivElement>;
1223
- Media: _splenddev_kreativ_core.KuiComponent<CardMediaProps, HTMLDivElement>;
1224
- Overlay: _splenddev_kreativ_core.KuiComponent<CardOverlayProps, HTMLDivElement>;
1225
- };
1226
-
1227
- declare const CardOverlay: _splenddev_kreativ_core.KuiComponent<CardOverlayProps, HTMLDivElement>;
1228
-
1229
- /** Scroll axis. `"both"` overflows on x and y. */
1230
- type ScrollDirection = "vertical" | "horizontal" | "both";
1231
- /**
1232
- * When the scrollbar is painted.
1233
- * `"auto"` follows the platform. `"hover"` shows it only while the area is hovered.
1234
- * `"always"` keeps it visible. `"never"` hides it; scrolling still works.
1235
- */
1236
- type ScrollbarVisibility = "auto" | "always" | "hover" | "never";
1237
- /** Scrollbar thickness. `"thin"` is the compact track. */
1238
- type ScrollbarVariant = "thin" | "default";
1239
- /** An edge of the scrollport. */
1240
- type ScrollEdge = "top" | "bottom" | "left" | "right";
1241
- /**
1242
- * `scroll-snap-type` strictness.
1243
- * `"proximity"` snaps when close. `"mandatory"` always settles on a snap point.
1244
- */
1245
- type ScrollSnap = "none" | "proximity" | "mandatory";
1246
- /** `scroll-snap-align` for snap targets. */
1247
- type ScrollSnapAlign = "start" | "center" | "end";
1248
- /**
1249
- * How a Scene measures its own progress.
1250
- * `"through"` is 0 when the scene enters the scrollport and 1 when it leaves.
1251
- * `"pinned"` holds at 1 while the scene covers the scrollport.
1252
- */
1253
- type SceneRange = "through" | "pinned";
1254
- /** Per-edge fade. A missing edge is off. */
1255
- interface FadeEdgesConfig {
1256
- top?: boolean;
1257
- bottom?: boolean;
1258
- left?: boolean;
1259
- right?: boolean;
1260
- }
1261
- /** `0` → `1` on each axis. `0` when that axis does not overflow. */
1262
- type ScrollProgress = {
1263
- x: number;
1264
- y: number;
1265
- };
1266
- /**
1267
- * External store for a value that changes outside React render.
1268
- * `get` is a live layout read: use it in effects and handlers, not during render.
1269
- */
1270
- interface ProgressStore<T> {
1271
- get(): T;
1272
- subscribe(fn: (value: T) => void): () => void;
1273
- }
1274
- interface ScrollAreaProps extends BaseProps {
1275
- /**
1276
- * `max-height`. Caps the vertical scrollport.
1277
- * Token, pixel number, or raw length. Responsive maps are resolved to breakpoint styles.
1278
- */
1279
- maxHeight?: ResponsiveValue<string | number>;
1280
- /**
1281
- * `max-width`. Caps the horizontal scrollport.
1282
- * Token, pixel number, or raw length. Responsive maps are resolved to breakpoint styles.
1283
- */
1284
- maxWidth?: ResponsiveValue<string | number>;
1285
- /**
1286
- * Which axis overflows.
1287
- * @default "vertical"
1288
- */
1289
- direction?: ScrollDirection;
1290
- /**
1291
- * When the scrollbar is shown. Scrolling is unaffected.
1292
- * @default "auto"
1293
- */
1294
- showScrollbar?: ScrollbarVisibility;
1295
- /**
1296
- * Scrollbar thickness.
1297
- * @default "thin"
1298
- */
1299
- scrollbarVariant?: ScrollbarVariant;
1300
- /**
1301
- * Edge fade on axes that still have room to scroll.
1302
- * `true` fades every eligible edge. An object turns on specific edges.
1303
- * A fade is omitted when that edge is already at the end, or the axis does not overflow.
1304
- * @default false
1305
- */
1306
- fadeEdges?: boolean | FadeEdgesConfig;
1307
- /**
1308
- * Length of the edge fade. Number is pixels.
1309
- * @default "24px"
1310
- */
1311
- fadeSize?: string | number;
1312
- /**
1313
- * `overscroll-behavior`. `"contain"` stops scroll chaining to the parent.
1314
- * @default "contain"
1315
- */
1316
- overscrollBehavior?: "auto" | "contain" | "none";
1317
- /**
1318
- * `scroll-snap-type`. `"none"` disables snapping.
1319
- * With `"mandatory"`, drag-to-scroll settles on the nearest item on release.
1320
- * @default "none"
1321
- */
1322
- snap?: ScrollSnap;
1323
- /**
1324
- * `scroll-snap-align` used by snap targets and `scrollToIndex`.
1325
- * @default "start"
1326
- */
1327
- snapAlign?: ScrollSnapAlign;
1328
- /**
1329
- * Pointer-drag scrolling. Off by default so text selection still works.
1330
- * @default false
1331
- */
1332
- dragToScroll?: boolean;
1333
- /** Native scroll event, after the area has recorded its position. */
1334
- onScroll?: (e: UIEvent<HTMLElement>) => void;
1335
- /**
1336
- * Fires when a scroll gesture settles on an edge, within `endThreshold`.
1337
- * The edge is the one that was reached (`"bottom"` for a vertical list at the end).
1338
- */
1339
- onScrollEnd?: (edge: ScrollEdge) => void;
1340
- /**
1341
- * Distance from an edge, in pixels, that still counts as "at the edge".
1342
- * @default 0
1343
- */
1344
- endThreshold?: number;
1345
- /**
1346
- * Publish scroll progress for Scene and other consumers.
1347
- * Off by default; progress reads are idle unless something subscribes.
1348
- * @default false
1349
- */
1350
- trackProgress?: boolean;
1351
- /**
1352
- * Makes the scrollport focusable so it can be scrolled by keyboard.
1353
- * Omit to use `0` while content overflows, and no tab stop when it does not.
1354
- */
1355
- tabIndex?: number;
1356
- /**
1357
- * Element to render.
1358
- * @default "div"
1359
- */
1360
- as?: ElementType;
1361
- }
1362
- /** Options for `scrollNext` / `scrollPrev`. */
1363
- interface ScrollStepOptions {
1364
- /** Axis to step on. Defaults to the area's main axis (`"y"` unless `direction` is `"horizontal"`). */
1365
- axis?: "x" | "y";
1366
- /**
1367
- * `"page"` moves by one client width/height.
1368
- * `"item"` moves to the next snap target past the current offset.
1369
- * @default "page"
1370
- */
1371
- step?: "page" | "item";
1372
- /** Native scroll behavior. `"auto"` if omitted. */
1373
- behavior?: ScrollBehavior;
1374
- }
1375
- /**
1376
- * Imperative handle. The ref is this handle, not the DOM node.
1377
- * Use `getElement()` for the scrollport.
1378
- */
1379
- interface ScrollAreaHandle {
1380
- /** The scrollport element, or `null` before mount. */
1381
- getElement: () => HTMLElement | null;
1382
- /** Re-read overflow and edge state. */
1383
- measure: () => void;
1384
- /** Native `scrollTo`. */
1385
- scrollTo: (opts: ScrollToOptions) => void;
1386
- scrollToTop: (behavior?: ScrollBehavior) => void;
1387
- scrollToBottom: (behavior?: ScrollBehavior) => void;
1388
- /** Scroll so the given edge of the content meets the scrollport. */
1389
- scrollToEdge: (edge: ScrollEdge, behavior?: ScrollBehavior) => void;
1390
- /** Step forward by a page or to the next item. */
1391
- scrollNext: (opts?: ScrollStepOptions) => void;
1392
- /** Step backward by a page or to the previous item. */
1393
- scrollPrev: (opts?: ScrollStepOptions) => void;
1394
- /**
1395
- * Scroll so the nth direct child aligns to `snapAlign`.
1396
- * No-op if the index is out of range.
1397
- */
1398
- scrollToIndex: (index: number, opts?: Omit<ScrollStepOptions, "step">) => void;
1399
- }
1400
- /**
1401
- * Publishes its own travel through the scrollport as `--kui-scene-progress` (`0` → `1`),
1402
- * inherited by every descendant.
1403
- */
1404
- interface ScrollAreaSceneProps extends HTMLAttributes<HTMLElement> {
1405
- /**
1406
- * How progress is measured.
1407
- * `"through"` runs `0` → `1` as the scene crosses the scrollport.
1408
- * `"pinned"` stays at `1` while the scene covers it.
1409
- */
1410
- range?: SceneRange;
1411
- /** Axis to measure. Defaults to the ScrollArea's main axis. */
1412
- axis?: "x" | "y";
1413
- /**
1414
- * Element to render.
1415
- * @default "div"
1416
- */
1417
- as?: ElementType;
1418
- }
1419
- /**
1420
- * `position: sticky` inside the ScrollArea.
1421
- * With no offset, sticks to the start of the scroll axis: `top` when vertical,
1422
- * `left` when horizontal, both when `direction` is `"both"`.
1423
- * An explicit `top` / `right` / `bottom` / `left` wins.
1424
- * Does nothing if an ancestor between this node and the ScrollArea has `overflow` other than `visible`.
1425
- */
1426
- interface ScrollAreaStickyProps extends HTMLAttributes<HTMLElement> {
1427
- /** Inset from the top edge while stuck. Number is pixels. */
1428
- top?: number | string;
1429
- /** Inset from the bottom edge while stuck. Number is pixels. */
1430
- bottom?: number | string;
1431
- /** Inset from the left edge while stuck. Number is pixels. */
1432
- left?: number | string;
1433
- /** Inset from the right edge while stuck. Number is pixels. */
1434
- right?: number | string;
1435
- /**
1436
- * `z-index` while in the scrollport.
1437
- * @default 1
1438
- */
1439
- zIndex?: number;
1440
- /** Called when the sticky node starts or stops being stuck. */
1441
- onStuckChange?: (stuck: boolean) => void;
1442
- /**
1443
- * Element to render.
1444
- * @default "div"
1445
- */
1446
- as?: ElementType;
1447
- }
1448
-
1449
- declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaProps & MotionGatedProps & react.RefAttributes<ScrollAreaHandle>> & {
1450
- __kui: _splenddev_kreativ_core.KuiMeta<ScrollAreaProps & MotionGatedProps>;
1451
- providerRequired?: _splenddev_kreativ_core.KuiProviderRequirement;
1452
- } & {
1453
- Scene: _splenddev_kreativ_core.KuiComponent<ScrollAreaSceneProps & MotionGatedProps, HTMLElement>;
1454
- Sticky: _splenddev_kreativ_core.KuiComponent<ScrollAreaStickyProps, HTMLElement>;
1455
- };
1456
-
1457
- /** Container progress. Subscribe-based, so it never re-renders anything by itself. */
1458
- declare function useScrollProgress(): ProgressStore<ScrollProgress>;
1459
- interface ScrollSceneOptions {
1460
- range?: SceneRange;
1461
- axis?: "x" | "y";
1462
- }
1463
- /** Progress of an element through the surrounding ScrollArea's viewport. */
1464
- declare function useElementScrollProgress(ref: RefObject<HTMLElement | null>, { range, axis }?: ScrollSceneOptions): ProgressStore<number>;
1465
-
1466
- interface BoxProps extends BaseProps {
1467
- /**
1468
- * Element to render.
1469
- * @default "div"
1470
- */
1471
- as?: ElementType;
1472
- /** Padding. Token, pixel number, or raw length. */
1473
- p?: ResponsiveValue<SpaceValue>;
1474
- /** Padding on the inline axis. Overrides `p`. */
1475
- px?: ResponsiveValue<SpaceValue>;
1476
- /** Padding on the block axis. Overrides `p`. */
1477
- py?: ResponsiveValue<SpaceValue>;
1478
- /** Margin. `"auto"` centers on that axis. */
1479
- m?: ResponsiveValue<SpaceValue | "auto">;
1480
- /** Margin on the inline axis. Overrides `m`. */
1481
- mx?: ResponsiveValue<SpaceValue | "auto">;
1482
- /** Margin on the block axis. Overrides `m`. */
1483
- my?: ResponsiveValue<SpaceValue | "auto">;
1484
- /** Background. Token or raw CSS color. */
1485
- bg?: ResponsiveValue<ColorProps<BaseColor> | string>;
1486
- /** Foreground. Token or raw CSS color. */
1487
- color?: ResponsiveValue<ColorProps<BaseColor> | string>;
1488
- /**
1489
- * Border. `true` is a 1px solid line in the default border color.
1490
- * A color paints that line in the given color.
1491
- * @default false
1492
- */
1493
- border?: boolean | ResponsiveValue<ColorProps<BaseColor> | string>;
1494
- /** Corner radius. */
1495
- rounded?: ResponsiveValue<RadiusValue>;
1496
- /** Width. `"full"` is 100%, `"fit"` is max-content. */
1497
- w?: ResponsiveValue<SpaceValue | "auto" | "full" | "fit">;
1498
- /** Height. `"full"` is 100%, `"fit"` is max-content. */
1499
- h?: ResponsiveValue<SpaceValue | "auto" | "full" | "fit">;
1500
- }
1501
-
1502
- declare const Box: _splenddev_kreativ_core.KuiComponent<BoxProps, HTMLDivElement>;
1503
-
1504
- /**
1505
- * Represents the visual state of the field for feedback and styling.
1506
- */
1507
- interface InputFieldProps extends InputProps {
1508
- /**
1509
- * The primary label for the input. Supports React nodes for rich formatting
1510
- * (e.g., icons, badges, or custom typography).
1511
- */
1512
- label?: ReactNode;
1513
- /**
1514
- * Helper text displayed near the input (usually below the label or the input itself).
1515
- * Use this for permanent instructions or contextual guidance.
1516
- */
1517
- description?: ReactNode;
1518
- /**
1519
- * Content (e.g., an icon, badge, or avatar) rendered inline at the start of the label.
1520
- */
1521
- labelStart?: ReactNode;
1522
- /**
1523
- * Content (e.g., a badge, status indicator, or small action button)
1524
- * rendered inline at the end of the label.
1525
- */
1526
- labelEnd?: ReactNode;
1527
- /**
1528
- * An optional tooltip, info icon, or popover trigger rendered next to the label.
1529
- * Ideal for providing supplementary explanations without cluttering the UI.
1530
- */
1531
- tooltip?: ReactNode;
1532
- /**
1533
- * The current validation or status state of the field.
1534
- * Drives the visual appearance (border color, label color, message styling).
1535
- *
1536
- * @default 'none'
1537
- */
1538
- status?: FormFieldStatus$1;
1539
- /**
1540
- * Feedback message displayed below the input.
1541
- * Typically paired with `status` to show success confirmations or error details.
1542
- *
1543
- * @example "Please enter a valid email address."
1544
- */
1545
- message?: string;
1546
- /**
1547
- * A subtle, temporary hint displayed below the input, distinct from `description`.
1548
- * Great for showing formatting rules, password requirements, or dynamic suggestions.
1549
- */
1550
- hint?: ReactNode;
1551
- /**
1552
- * Marks the field as required. Automatically appends a required indicator
1553
- * (e.g., an asterisk `*`) to the label.
1554
- *
1555
- * @default false
1556
- */
1557
- required?: boolean;
1558
- /**
1559
- * Controls whether the field displays an optional indicator
1560
- * (e.g., "(optional)") next to the label.
1561
- * This is typically ignored if `required` is `true`.
1562
- *
1563
- * @default false
1564
- */
1565
- optional?: boolean;
1566
- /**
1567
- * Visually hides the label while keeping it accessible to screen readers.
1568
- * Useful for search bars or compact forms where layout space is limited.
1569
- *
1570
- * @default false
1571
- */
1572
- labelHidden?: boolean;
1573
- /**
1574
- * Defines the layout relationship between the label and the input.
1575
- * - `'vertical'`: Label sits above the input (default for most forms).
1576
- * - `'horizontal'`: Label and input sit side-by-side (common in admin panels).
1577
- *
1578
- * @default 'vertical'
1579
- */
1580
- orientation?: "vertical" | "horizontal";
1581
- /**
1582
- * Enables a character counter (e.g., "0 / 100") displayed near the input.
1583
- * Automatically uses the `maxLength` prop from the underlying `InputProps`.
1584
- *
1585
- * @default false
1586
- */
1587
- showCounter?: boolean;
1588
- /**
1589
- * The unique ID for the underlying input element.
1590
- * Used to link the `<label>` (via `htmlFor`) and description/error messages
1591
- * (via `aria-describedby`) for improved screen-reader support.
1592
- */
1593
- id?: string;
1594
- /**
1595
- * Props forwarded directly to the underlying `<label>` element,
1596
- * allowing fine-grained control over attributes like `className` or `onClick`.
1597
- */
1598
- labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
1599
- /**
1600
- * Custom class name applied to the root wrapper container of the entire field.
1601
- */
1602
- wrapperClassName?: string;
1603
- /**
1604
- * Custom class name applied specifically to the label element.
1605
- */
1606
- labelClassName?: string;
1607
- /**
1608
- * Custom class name applied to the container holding the description,
1609
- * feedback message, and hint.
1610
- */
1611
- messageClassName?: string;
1612
- /**
1613
- * Custom class name applied to the wrapper around the input element itself.
1614
- * Useful for adding padding, backgrounds, or borders to the input's parent.
1615
- */
1616
- inputWrapperClassName?: string;
1617
- }
1618
-
1619
- declare const InputField: react.ForwardRefExoticComponent<InputFieldProps & react.RefAttributes<HTMLInputElement>>;
1620
-
1621
- interface TextProps extends TypographyProps {
1622
- as?: ElementType;
1623
- color?: BaseColor | string;
1624
- align?: "left" | "center" | "right" | "justify";
1625
- truncate?: boolean;
1626
- clampLines?: number;
1627
- weight?: "normal" | "medium" | "semibold" | "bold";
1628
- italic?: boolean;
1629
- className?: string;
1630
- style?: CSSProperties;
1631
- children?: ReactNode;
1632
- }
1
+ import { ReactNode, JSX } from 'react';
2
+ import { ThemeOverride, ColorMode } from '@splenddev/kreativ-core';
3
+ export { PersistMode, PersistModeProps, ThemeContext } from '@splenddev/kreativ-core';
1633
4
 
1634
5
  interface UIProviderProps {
1635
6
  children: ReactNode;
@@ -1644,71 +15,4 @@ interface UIProviderProps {
1644
15
  }
1645
16
  declare function KreativUIProvider({ children, theme: themeOverride, defaultMode, as, fallbackSize, textColor, background, style, className, }: UIProviderProps): JSX.Element;
1646
17
 
1647
- declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open: boolean): {
1648
- contentRef: RefObject<HTMLDivElement | null>;
1649
- side: "bottom" | "top";
1650
- };
1651
-
1652
- type TransitionStatus = Exclude<FormFieldStatus, "none"> | undefined;
1653
- declare function useStatusTransition(status: FormFieldStatus, options?: {
1654
- enabled?: boolean;
1655
- }): TransitionStatus;
1656
-
1657
- type ClearableFieldOptions = {
1658
- onClear?: () => void;
1659
- onUndo?: (value: string) => void;
1660
- onRedo?: (value: string) => void;
1661
- };
1662
- declare function useClearableField<T extends HTMLInputElement | HTMLTextAreaElement>(elementRef: RefObject<T | null>, initialValue: unknown, { onClear, onUndo, onRedo }?: ClearableFieldOptions): {
1663
- hasValue: boolean;
1664
- setHasValue: react.Dispatch<react.SetStateAction<boolean>>;
1665
- clear: () => void;
1666
- undo: () => void;
1667
- redo: () => void;
1668
- canUndo: boolean;
1669
- canRedo: boolean;
1670
- };
1671
-
1672
- type ShortcutHandler = (event: KeyboardEvent) => void;
1673
- declare function useKeyboardShortcuts(enabled: boolean, shortcuts: Record<string, ShortcutHandler>, deps?: any[]): react.RefObject<HTMLInputElement | null>;
1674
-
1675
- declare function cn(...inputs: ClassValue[]): string;
1676
-
1677
- /**
1678
- * Converts an RGB colour string to a 6‑digit uppercase hex string.
1679
- * Supports the following input formats:
1680
- * - Hex: `"#fff"`, `"#FFFFFF"`
1681
- * - CSS rgb/rgba: `"rgb(255, 0, 0)"`, `"rgba(255, 0, 0, 0.5)"`
1682
- * - Space‑separated numbers: `"255 0 0"`
1683
- * - Comma‑separated numbers: `"255,0,0"`
1684
- *
1685
- * @param value - The colour string to convert.
1686
- * @returns A 6‑digit uppercase hex string (e.g. `"#FF0000"`).
1687
- * If the input cannot be parsed, returns `"#000000"`.
1688
- */
1689
- declare function rgbToHex(value: string): string;
1690
- declare function hexToRgbString(hex: string): string | null;
1691
-
1692
- /**
1693
- * Overrides a single component's recipe against the built-in default
1694
- * for that component. For overriding just one recipe inline, without
1695
- * constructing a partial keyed-by-component-name object.
1696
- */
1697
- declare function extendRecipe<K extends keyof RecipeCollection>(name: K, override?: DeepPartial<RecipeCollection[K]>): RecipeCollection[K];
1698
- /**
1699
- * Overrides the theme's full recipe collection against the built-in
1700
- * defaults. Thin wrapper over extendRecipe — the actual merge logic
1701
- * lives in exactly one place.
1702
- */
1703
- declare function extendRecipes(override?: DeepPartial<RecipeCollection>): RecipeCollection;
1704
-
1705
- declare function getRecipeNames(): (keyof DefaultRecipeCollection)[];
1706
-
1707
- declare function extendTypography(override?: ThemeOverride$1["typography"]): Typography;
1708
-
1709
- declare function extendTokens(override?: ThemeOverride$1["tokens"]): DesignTokens;
1710
- declare function extendSemanticTokens(override?: ThemeOverride$1["semanticTokens"]): SemanticTokens;
1711
-
1712
- declare function extendTheme(override?: ThemeOverride$1): Theme;
1713
-
1714
- export { Adornment, type AdornmentProps, type BaseInputExtraAdornmentContext, type BaseInputProps, Box, type BoxProps, 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 CardMediaBlend, type CardMediaFit, type CardMediaProps, CardOverlay, type CardOverlayGradient, type CardOverlayGradientEdge, type CardOverlayProps, type CardOverlayRadialGradient, 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, type FadeEdgesConfig, 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, MultiSelect, MultiSelectContent, MultiSelectItem, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type PasswordInputKindDefaults, type PasswordInputProps, type PasswordKind, type ProgressStore, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadiusValue, type SceneRange, type SchemaLike, ScrollArea, type ScrollAreaHandle, type ScrollAreaProps, type ScrollAreaSceneProps, type ScrollAreaStickyProps, type ScrollDirection, type ScrollEdge, type ScrollProgress, type ScrollSnap, type ScrollSnapAlign, type ScrollStepOptions, type ScrollbarVariant, type ScrollbarVisibility, 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, type SpaceToken, type SpaceValue, 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, cn, defineUIField, extendRecipe, extendRecipes, extendSemanticTokens, extendTheme, extendTokens, extendTypography, getRecipeNames, hexToRgbString, rgbToHex, useButtonGroupContext, useButtonGroupItemContext, useClearableField, useElementScrollProgress, useFloatingSide, useFormContext, useKeyboardShortcuts, useOptionalButtonGroupContext, useOptionalButtonGroupItemContext, useScrollProgress, useStatusTransition };
18
+ export { KreativUIProvider, type UIProviderProps };