@splenddev/kreativ-ui 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, ReactElement, HTMLAttributes, TextareaHTMLAttributes, RefObject, JSX } from 'react';
2
+ import { CSSProperties, ReactNode, ButtonHTMLAttributes, ReactElement, InputHTMLAttributes, HTMLAttributes, TextareaHTMLAttributes, LabelHTMLAttributes, JSX, RefObject } from 'react';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
5
  type Size = "xs" | "sm" | "md" | "lg" | "xl";
@@ -18,6 +18,10 @@ type DeepPartial<T> = {
18
18
  type CSSPropertiesWithVars = CSSProperties & {
19
19
  [key: `--${string}`]: string | number | undefined;
20
20
  };
21
+ type ReportedValidity = {
22
+ invalid: boolean;
23
+ message?: string;
24
+ };
21
25
  interface BaseProps {
22
26
  /**
23
27
  * Additional CSS classes.
@@ -98,23 +102,65 @@ interface StateProps {
98
102
  * Displays a success state.
99
103
  */
100
104
  success?: boolean;
105
+ /**
106
+ * Displays a warning state.
107
+ */
108
+ warning?: boolean;
101
109
  }
102
- interface ValueProps {
110
+ interface StatusProps {
103
111
  /**
104
- * Passed value
112
+ * Can be `'success'` or `'error'` or `'warning'` or `'none'`
105
113
  */
106
- value?: string;
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 {
107
131
  /**
108
- * For uncontrolled form control
132
+ * Removes leading and trailing whitespace from the value
133
+ * when the value is committed.
134
+ *
135
+ * @default false
109
136
  */
110
- defaultValue?: string;
137
+ trim?: boolean;
138
+ }
139
+ interface EmbeddedProps {
111
140
  /**
112
- * Called when value is changed
141
+ * Renders the component as part of a parent component's visual container.
113
142
  *
114
- * @param newValue
115
- * @returns void
143
+ * Removes standalone container styling such as borders, radius,
144
+ * and focus ring.
116
145
  */
117
- onValueChange?: (newValue: string) => void;
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;
118
164
  }
119
165
 
120
166
  type ButtonSize = SizeValue | "icon";
@@ -122,17 +168,42 @@ type ButtonVariant = BaseVariant | "link";
122
168
  type ButtonColor = BaseColor;
123
169
  interface ButtonRenderProps {
124
170
  className?: string;
125
- style?: React.CSSProperties;
171
+ style?: CSSProperties;
126
172
  disabled?: boolean;
173
+ "aria-disabled"?: boolean;
127
174
  "aria-busy"?: boolean;
128
- children?: React.ReactNode;
175
+ children?: ReactNode;
129
176
  }
130
177
  interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
131
178
  size?: ButtonSize;
132
179
  leftIcon?: ReactNode;
133
180
  rightIcon?: ReactNode;
134
181
  iconOnly?: boolean;
135
- render?: (props: ButtonRenderProps) => React.ReactElement;
182
+ /**
183
+ * Custom rendering escape hatch.
184
+ *
185
+ * Receives the resolved Button props and allows the consumer
186
+ * to render the Button using another element or component.
187
+ *
188
+ * @example
189
+ * ```tsx
190
+ * <Button
191
+ * render={(props) => (
192
+ * <a {...props} href="/templates">
193
+ * Templates
194
+ * </a>
195
+ * )}
196
+ * >
197
+ * Templates
198
+ * </Button>
199
+ * ```
200
+ *
201
+ * @remarks
202
+ * The render function must be created inside a Client Component
203
+ * when using Next.js App Router. Functions cannot be passed from
204
+ * Server Components to Client Components.
205
+ */
206
+ render?: (props: ButtonRenderProps) => ReactElement;
136
207
  }
137
208
 
138
209
  declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
@@ -836,9 +907,9 @@ interface ThemeTogglerProps extends Omit<BaseProps, "children"> {
836
907
  declare function ThemeToggler({ variant, activeVariant, color, activeColor, size, iconOnly, allowSystem, orientation, rounded, unstyled, labels, icons, className, buttonProps, display, transition, }: ThemeTogglerProps): react.JSX.Element;
837
908
 
838
909
  type InputVariant = "outline" | "filled" | "ghost";
839
- type InputSize = "sm" | "md" | "lg";
910
+ type InputSize = "xs" | "sm" | "md" | "lg";
840
911
  type InputKind = "text" | "email" | "tel" | "url" | "search" | "numeric" | "password-current" | "password-new" | "number" | "date" | "time" | "datetime-local" | "month" | "week";
841
- interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, BaseProps, SizeProps, VariantProps<InputVariant>, DisabledProps, LoadingProps, FullWidthProps, ClearableProps, StateProps {
912
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "defaultValue">, BaseProps, SizeProps, VariantProps<InputVariant>, DisabledProps, LoadingProps, FullWidthProps, ClearableProps, ValueProps<string | number | undefined>, StateProps, TrimProps {
842
913
  inputClassName?: string;
843
914
  kind?: InputKind;
844
915
  rounded?: boolean;
@@ -859,15 +930,19 @@ type InputKindDefaults = Record<InputKind, {
859
930
 
860
931
  declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
861
932
 
862
- declare const inputKindDefaults: InputKindDefaults;
863
-
933
+ type FormFieldStatus = "none" | "error" | "success" | "warning";
864
934
  interface FormFieldProps extends Omit<BaseProps, "unstyled"> {
865
935
  id?: string;
866
936
  error?: string;
937
+ message?: ReactNode;
938
+ status?: FormFieldStatus;
867
939
  required?: boolean;
868
940
  }
941
+ interface FormFieldMessageProps {
942
+ children?: ReactNode;
943
+ }
869
944
 
870
- declare function FormField({ id: externalId, error, required, className, children, }: FormFieldProps): react.JSX.Element;
945
+ declare function FormField({ id: externalId, status, message: formMessage, required, className, children, }: FormFieldProps): react.JSX.Element;
871
946
  declare namespace FormField {
872
947
  var Label: typeof FormFieldLabel;
873
948
  var Control: typeof FormFieldControl;
@@ -884,9 +959,7 @@ declare function FormFieldDescription({ children, }: {
884
959
  children: React.ReactNode;
885
960
  }): react.JSX.Element;
886
961
 
887
- declare function FormFieldMessage({ children }: {
888
- children: React.ReactNode;
889
- }): react.JSX.Element;
962
+ declare function FormFieldMessage({ children }: FormFieldMessageProps): react.JSX.Element | null;
890
963
 
891
964
  type FormFieldControlProps<T = Record<string, unknown>> = {
892
965
  children: ReactElement<T>;
@@ -956,45 +1029,6 @@ declare namespace Select {
956
1029
 
957
1030
  declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
958
1031
 
959
- interface SelectItemMeta {
960
- label: ReactNode;
961
- disabled?: boolean;
962
- }
963
- interface SelectContextValue {
964
- value?: string;
965
- onValueChange: (value: string) => void;
966
- disabled: boolean;
967
- variant: InputVariant;
968
- size: InputSize;
969
- rounded?: boolean;
970
- open: boolean;
971
- setOpen: (open: boolean) => void;
972
- triggerId: string;
973
- triggerRef: React.RefObject<HTMLDivElement | null>;
974
- contentId: string;
975
- describedBy?: string;
976
- selectedLabel?: React.ReactNode;
977
- labelId: string | undefined;
978
- tabIndex?: number;
979
- required?: boolean;
980
- isInvalid: boolean;
981
- isSuccess: boolean;
982
- activeValue: string | undefined;
983
- setActiveValue: (value: string | undefined) => void;
984
- items: Map<string, SelectItemMeta>;
985
- registerItem: (value: string, meta: SelectItemMeta) => () => void;
986
- optionId: (value: string) => string;
987
- placeholder?: string;
988
- clearable: boolean;
989
- onClear: () => void;
990
- }
991
- declare const SelectContext: react.Context<SelectContextValue | null>;
992
- declare function useSelectContext(componentName: string): SelectContextValue;
993
- declare const SelectGroupContext: react.Context<{
994
- labelId: string;
995
- setHasLabel: (id: string) => void;
996
- } | null>;
997
-
998
1032
  type MarkdownEditorTabs = "write" | "preview";
999
1033
  interface MarkdownEditorProps extends Omit<TextareaCoreProps, "resize" | "autoResize"> {
1000
1034
  /** Renders the Preview tab. Omit and Preview shows raw text with a dev warning. */
@@ -1006,15 +1040,13 @@ interface MarkdownEditorProps extends Omit<TextareaCoreProps, "resize" | "autoRe
1006
1040
  }
1007
1041
 
1008
1042
  type TextareaResize = "none" | "both" | "horizontal" | "vertical";
1009
- interface TextareaCoreProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "defaultValue" | "value">, Omit<BaseProps, "unstyled" | "style">, SizeProps, StateProps, VariantProps<InputVariant>, ClearableProps, ValueProps, FullWidthProps {
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> {
1010
1044
  resize?: TextareaResize;
1011
1045
  autoResize?: boolean;
1012
1046
  minRows?: number;
1013
1047
  maxRows?: number;
1014
1048
  characterCounter?: boolean;
1015
1049
  debounceDelay?: number;
1016
- trimOnBlur?: boolean;
1017
- onValidate?: (value: string) => boolean | string;
1018
1050
  }
1019
1051
  type TextareaProps = ({
1020
1052
  allowMarkdown?: false;
@@ -1022,20 +1054,13 @@ type TextareaProps = ({
1022
1054
  allowMarkdown: true;
1023
1055
  } & Omit<TextareaCoreProps, "resize"> & MarkdownEditorProps);
1024
1056
 
1025
- declare const TextareaCore: react.ForwardRefExoticComponent<TextareaCoreProps & react.RefAttributes<HTMLTextAreaElement>>;
1026
-
1027
1057
  declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
1028
1058
 
1029
1059
  declare const MarkdownEditor: react.ForwardRefExoticComponent<MarkdownEditorProps & react.RefAttributes<HTMLTextAreaElement>>;
1030
1060
 
1031
- interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable {
1032
- checked?: boolean;
1033
- defaultChecked?: boolean;
1034
- onCheckedChange?: (checked: boolean) => void;
1061
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "checked" | "defaultChecked">, Styleable, StateProps, StatusProps, ControlledProps<boolean, "checked", "defaultChecked", "onCheckedChange"> {
1035
1062
  indeterminate?: boolean;
1036
1063
  size?: InputSize;
1037
- error?: boolean;
1038
- success?: boolean;
1039
1064
  disabled?: boolean;
1040
1065
  label?: ReactNode;
1041
1066
  description?: ReactNode;
@@ -1192,39 +1217,122 @@ declare const MultiSelectTrigger: react.ForwardRefExoticComponent<{
1192
1217
  className?: string;
1193
1218
  } & react.RefAttributes<HTMLButtonElement>>;
1194
1219
 
1195
- interface MultiSelectItemMeta {
1196
- label: React.ReactNode;
1197
- disabled?: boolean;
1198
- }
1199
- interface MultiSelectContextValue {
1200
- value: string[];
1201
- toggleValue: (v: string) => void;
1202
- removeValue: (v: string) => void;
1203
- disabled: boolean;
1204
- variant: InputVariant;
1205
- size: InputSize;
1206
- open: boolean;
1207
- setOpen: (open: boolean) => void;
1208
- triggerId: string;
1209
- contentId: string;
1210
- triggerRef: RefObject<HTMLDivElement | null>;
1211
- isInvalid: boolean;
1212
- isSuccess?: boolean;
1213
- describedBy?: string;
1220
+ /**
1221
+ * Represents the visual state of the field for feedback and styling.
1222
+ */
1223
+ interface InputFieldProps extends InputProps {
1224
+ /**
1225
+ * The primary label for the input. Supports React nodes for rich formatting
1226
+ * (e.g., icons, badges, or custom typography).
1227
+ */
1228
+ label?: ReactNode;
1229
+ /**
1230
+ * Helper text displayed near the input (usually below the label or the input itself).
1231
+ * Use this for permanent instructions or contextual guidance.
1232
+ */
1233
+ description?: ReactNode;
1234
+ /**
1235
+ * Content (e.g., an icon, badge, or avatar) rendered inline at the start of the label.
1236
+ */
1237
+ labelStart?: ReactNode;
1238
+ /**
1239
+ * Content (e.g., a badge, status indicator, or small action button)
1240
+ * rendered inline at the end of the label.
1241
+ */
1242
+ labelEnd?: ReactNode;
1243
+ /**
1244
+ * An optional tooltip, info icon, or popover trigger rendered next to the label.
1245
+ * Ideal for providing supplementary explanations without cluttering the UI.
1246
+ */
1247
+ tooltip?: ReactNode;
1248
+ /**
1249
+ * The current validation or status state of the field.
1250
+ * Drives the visual appearance (border color, label color, message styling).
1251
+ *
1252
+ * @default 'none'
1253
+ */
1254
+ status?: FormFieldStatus;
1255
+ /**
1256
+ * Feedback message displayed below the input.
1257
+ * Typically paired with `status` to show success confirmations or error details.
1258
+ *
1259
+ * @example "Please enter a valid email address."
1260
+ */
1261
+ message?: string;
1262
+ /**
1263
+ * A subtle, temporary hint displayed below the input, distinct from `description`.
1264
+ * Great for showing formatting rules, password requirements, or dynamic suggestions.
1265
+ */
1266
+ hint?: ReactNode;
1267
+ /**
1268
+ * Marks the field as required. Automatically appends a required indicator
1269
+ * (e.g., an asterisk `*`) to the label.
1270
+ *
1271
+ * @default false
1272
+ */
1214
1273
  required?: boolean;
1215
- placeholder?: string;
1216
- maxVisibleChips?: number;
1217
- activeValue: string | undefined;
1218
- setActiveValue: (v: string | undefined) => void;
1219
- items: Map<string, MultiSelectItemMeta>;
1220
- registerItem: (value: string, meta: MultiSelectItemMeta) => () => void;
1221
- optionId: (value: string) => string;
1222
- onClear: () => void;
1223
- rounded?: boolean;
1224
- clearable?: boolean;
1274
+ /**
1275
+ * Controls whether the field displays an optional indicator
1276
+ * (e.g., "(optional)") next to the label.
1277
+ * This is typically ignored if `required` is `true`.
1278
+ *
1279
+ * @default false
1280
+ */
1281
+ optional?: boolean;
1282
+ /**
1283
+ * Visually hides the label while keeping it accessible to screen readers.
1284
+ * Useful for search bars or compact forms where layout space is limited.
1285
+ *
1286
+ * @default false
1287
+ */
1288
+ labelHidden?: boolean;
1289
+ /**
1290
+ * Defines the layout relationship between the label and the input.
1291
+ * - `'vertical'`: Label sits above the input (default for most forms).
1292
+ * - `'horizontal'`: Label and input sit side-by-side (common in admin panels).
1293
+ *
1294
+ * @default 'vertical'
1295
+ */
1296
+ orientation?: "vertical" | "horizontal";
1297
+ /**
1298
+ * Enables a character counter (e.g., "0 / 100") displayed near the input.
1299
+ * Automatically uses the `maxLength` prop from the underlying `InputProps`.
1300
+ *
1301
+ * @default false
1302
+ */
1303
+ showCounter?: boolean;
1304
+ /**
1305
+ * The unique ID for the underlying input element.
1306
+ * Used to link the `<label>` (via `htmlFor`) and description/error messages
1307
+ * (via `aria-describedby`) for improved screen-reader support.
1308
+ */
1309
+ id?: string;
1310
+ /**
1311
+ * Props forwarded directly to the underlying `<label>` element,
1312
+ * allowing fine-grained control over attributes like `className` or `onClick`.
1313
+ */
1314
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
1315
+ /**
1316
+ * Custom class name applied to the root wrapper container of the entire field.
1317
+ */
1318
+ wrapperClassName?: string;
1319
+ /**
1320
+ * Custom class name applied specifically to the label element.
1321
+ */
1322
+ labelClassName?: string;
1323
+ /**
1324
+ * Custom class name applied to the container holding the description,
1325
+ * feedback message, and hint.
1326
+ */
1327
+ messageClassName?: string;
1328
+ /**
1329
+ * Custom class name applied to the wrapper around the input element itself.
1330
+ * Useful for adding padding, backgrounds, or borders to the input's parent.
1331
+ */
1332
+ inputWrapperClassName?: string;
1225
1333
  }
1226
- declare const MultiSelectContext: react.Context<MultiSelectContextValue | null>;
1227
- declare function useMultiSelectContext(componentName: string): MultiSelectContextValue;
1334
+
1335
+ declare const InputField: react.ForwardRefExoticComponent<InputFieldProps & react.RefAttributes<HTMLInputElement>>;
1228
1336
 
1229
1337
  interface UIProviderProps {
1230
1338
  children: ReactNode;
@@ -1245,12 +1353,6 @@ interface ThemeContextValue {
1245
1353
  }
1246
1354
  declare const ThemeContext: react.Context<ThemeContextValue | null>;
1247
1355
 
1248
- declare const defaultSizes: SizeScale;
1249
- declare const defaultRecipes: RecipeCollection;
1250
- declare const defaultTheme: Theme;
1251
-
1252
- declare function tokensToCssVars(tokens: ResolvedTokens, mode: "light" | "dark", intensity: number): Record<string, string>;
1253
-
1254
1356
  declare function useTheme(): ThemeContextValue;
1255
1357
 
1256
1358
  declare const BREAKPOINTS: {
@@ -1266,24 +1368,35 @@ declare function useBreakpoint(breakpoint: Breakpoint): boolean;
1266
1368
 
1267
1369
  interface ResolvedSize {
1268
1370
  style: CSSProperties;
1269
- iconSize?: string;
1371
+ iconSize?: CSSProperties["width"];
1372
+ fontSize?: CSSProperties["fontSize"];
1373
+ gap?: CSSProperties["gap"];
1270
1374
  }
1271
1375
  interface UseSizeStyleOptions {
1272
1376
  includeHeight?: boolean;
1377
+ widthFromHeight?: boolean;
1378
+ sizeOffset?: string;
1379
+ fontSizeOffset?: string;
1380
+ iconSizeOffset?: string;
1273
1381
  }
1274
- declare function useSizeStyle(size: string, iconOnly?: boolean, component?: string, options?: UseSizeStyleOptions): ResolvedSize;
1382
+ declare function useSizeStyle(size: string, iconOnly?: boolean, componentName?: string, options?: UseSizeStyleOptions): ResolvedSize;
1275
1383
 
1276
1384
  declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open: boolean): {
1277
1385
  contentRef: RefObject<HTMLDivElement | null>;
1278
1386
  side: "bottom" | "top";
1279
1387
  };
1280
1388
 
1281
- type State = "none" | "error" | "success";
1282
- type TransitionState = Exclude<State, "none"> | undefined;
1283
- declare function useStateTransition(state: State): TransitionState;
1389
+ type TransitionStatus = Exclude<FormFieldStatus, "none"> | undefined;
1390
+ declare function useStatusTransition(status: FormFieldStatus): TransitionStatus;
1284
1391
 
1285
1392
  declare function useTypography(name?: string): react.CSSProperties;
1286
1393
 
1394
+ declare function useClearableField<T extends HTMLInputElement | HTMLTextAreaElement>(elementRef: RefObject<T | null>, initialValue: unknown, onClear?: () => void): {
1395
+ hasValue: boolean;
1396
+ setHasValue: react.Dispatch<react.SetStateAction<boolean>>;
1397
+ clear: () => void;
1398
+ };
1399
+
1287
1400
  declare function cn(...inputs: ClassValue[]): string;
1288
1401
 
1289
1402
  /**
@@ -1299,165 +1412,13 @@ declare function cn(...inputs: ClassValue[]): string;
1299
1412
  declare function rgbToHex(value: string): string;
1300
1413
  declare function hexToRgbString(hex: string): string | null;
1301
1414
 
1302
- declare const buttonBase: string;
1303
- declare const buttonVariants: {
1304
- readonly solid: "";
1305
- readonly outline: "border bg-transparent";
1306
- readonly ghost: "bg-transparent";
1307
- readonly soft: "";
1308
- readonly link: "bg-transparent p-0 h-auto hover:underline";
1309
- };
1310
- declare const buttonColors: {
1311
- readonly brand: {
1312
- readonly solid: "bg-brand text-brand-fg hover:bg-brand-hover";
1313
- readonly outline: "border-brand text-brand hover:bg-brand/10";
1314
- readonly ghost: "text-brand hover:bg-brand/10";
1315
- readonly soft: "bg-brand/10 text-brand hover:bg-brand/20";
1316
- readonly link: "text-brand";
1317
- };
1318
- readonly destructive: {
1319
- readonly solid: "bg-destructive text-destructive-fg hover:bg-destructive-hover";
1320
- readonly outline: "border-destructive text-destructive hover:bg-destructive/10";
1321
- readonly ghost: "text-destructive hover:bg-destructive/10";
1322
- readonly soft: "bg-destructive/10 text-destructive hover:bg-destructive/20";
1323
- readonly link: "text-destructive";
1324
- };
1325
- readonly success: {
1326
- readonly solid: "bg-success text-success-fg hover:bg-success-hover";
1327
- readonly outline: "border-success text-success hover:bg-success/10";
1328
- readonly ghost: "text-success hover:bg-success/10";
1329
- readonly soft: "bg-success/10 text-success hover:bg-success/20";
1330
- readonly link: "text-success";
1331
- };
1332
- readonly warning: {
1333
- readonly solid: "bg-warning text-warning-fg hover:bg-warning-hover";
1334
- readonly outline: "border-warning text-warning hover:bg-warning/10";
1335
- readonly ghost: "text-warning hover:bg-warning/10";
1336
- readonly soft: "bg-warning/10 text-warning hover:bg-warning/20";
1337
- readonly link: "text-warning";
1338
- };
1339
- readonly info: {
1340
- readonly solid: "bg-info text-info-fg hover:bg-info-hover";
1341
- readonly outline: "border-info text-info hover:bg-info/10";
1342
- readonly ghost: "text-info hover:bg-info/10";
1343
- readonly soft: "bg-info/10 text-info hover:bg-info/20";
1344
- readonly link: "text-info";
1345
- };
1346
- readonly white: {
1347
- readonly solid: "bg-white text-black hover:bg-gray-50";
1348
- readonly outline: "border-white/30 text-white hover:bg-white/10";
1349
- readonly ghost: "text-white hover:bg-white/10";
1350
- readonly soft: "bg-white/10 text-white hover:bg-white/20";
1351
- readonly link: "text-white";
1352
- };
1353
- readonly neutral: {
1354
- readonly solid: "bg-surface-raised text-text hover:bg-surface-sunken";
1355
- readonly outline: "border-border text-text hover:bg-surface-raised";
1356
- readonly ghost: "text-text hover:bg-surface-raised";
1357
- readonly soft: "bg-surface-raised text-text hover:bg-surface-sunken";
1358
- readonly link: "text-text";
1359
- };
1360
- };
1361
- declare const buttonRecipe: {
1362
- base: string;
1363
- variants: {
1364
- variant: {
1365
- readonly solid: "";
1366
- readonly outline: "border bg-transparent";
1367
- readonly ghost: "bg-transparent";
1368
- readonly soft: "";
1369
- readonly link: "bg-transparent p-0 h-auto hover:underline";
1370
- };
1371
- color: Record<string, string>;
1372
- };
1373
- defaultVariants: {
1374
- variant: string;
1375
- color: string;
1376
- };
1377
- compoundVariants: {
1378
- conditions: Record<string, string>;
1379
- className: string;
1380
- }[];
1381
- };
1382
-
1383
- declare const inputBase: string;
1384
- declare const inputRecipe: {
1385
- base: string;
1386
- variants: {
1387
- variant: {
1388
- outline: string;
1389
- filled: string;
1390
- ghost: string;
1391
- };
1392
- };
1393
- defaultVariants: {
1394
- variant: string;
1395
- };
1396
- };
1397
-
1398
- declare const formControlBase: string;
1399
- declare const formControlVariants: {
1400
- readonly outline: "border border-border bg-transparent text-text hover:border-brand";
1401
- readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
1402
- readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
1403
- };
1404
- declare const formControlStates: {
1405
- readonly none: "focus-within:ring-brand/20";
1406
- readonly error: "border-destructive focus-within:ring-destructive/20";
1407
- readonly success: "border-success focus-within:ring-success/20";
1408
- };
1409
- declare const formControlRecipe: {
1410
- base: string;
1411
- variants: {
1412
- variant: {
1413
- readonly outline: "border border-border bg-transparent text-text hover:border-brand";
1414
- readonly filled: "border border-transparent bg-surface-raised text-text hover:bg-surface";
1415
- readonly ghost: "border border-transparent bg-transparent text-text hover:bg-surface-raised";
1416
- };
1417
- state: {
1418
- readonly none: "focus-within:ring-brand/20";
1419
- readonly error: "border-destructive focus-within:ring-destructive/20";
1420
- readonly success: "border-success focus-within:ring-success/20";
1421
- };
1422
- rounded: {
1423
- true: string;
1424
- false: string;
1425
- };
1426
- fullWidth: {
1427
- true: string;
1428
- false: string;
1429
- };
1430
- disabled: {
1431
- true: string;
1432
- false: string;
1433
- };
1434
- hasAdornment: {
1435
- true: string;
1436
- false: string;
1437
- };
1438
- };
1439
- defaultVariants: {
1440
- variant: string;
1441
- state: string;
1442
- rounded: false;
1443
- fullWidth: true;
1444
- disabled: false;
1445
- hasAdornment: false;
1446
- };
1447
- };
1448
-
1449
1415
  declare function defineRecipe<T extends RecipeDefinition>(recipe: T): T;
1450
1416
 
1451
- declare function mergeRecipes(base: RecipeCollection, override?: ThemeOverride["recipes"]): RecipeCollection;
1417
+ declare function extendRecipes(override?: ThemeOverride["recipes"]): RecipeCollection;
1452
1418
 
1453
- interface RecipeProps {
1454
- [key: string]: RecipeVariantValue | undefined;
1455
- }
1456
- declare function resolveRecipe(recipe: RecipeDefinition | undefined, props?: RecipeProps): string;
1457
-
1458
- declare function resolveTypography(typography: TypographyStyle | undefined, tokens: DesignTokens): CSSProperties;
1419
+ declare function defineTypography<T extends Typography>(typography: T): T;
1459
1420
 
1460
- declare function defineTypography(typography: TypographyStyle): TypographyStyle;
1421
+ declare function extendTypography(override?: ThemeOverride["typography"]): Typography;
1461
1422
 
1462
1423
  declare function defineToken<T>(value: T): {
1463
1424
  value: T;
@@ -1469,4 +1430,9 @@ declare function defineSemanticToken<T>(light: T, dark: T): {
1469
1430
  };
1470
1431
  };
1471
1432
 
1472
- export { type AnimationTokens, type BaseColor, type BaseProps, type BaseTransition, type BaseVariant, Button, type ButtonProps, type CSSPropertiesWithVars, Checkbox, type CheckboxProps, type ClearableProps, type ColorMode, type ColorModeValue, type ColorProps, type ColorScale, type ColorTokens, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type DeepPartial, type DesignTokens, type DisabledProps, type FontSizeTokens, type FontTokens, type FontWeightTokens, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, type FormFieldProps, type FullWidthProps, Input, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, type IntensityMap, type LetterSpacingTokens, type LineHeightTokens, type LoadingProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorTabs, MultiSelect, MultiSelectContent, MultiSelectContext, type MultiSelectContextValue, MultiSelectItem, type MultiSelectItemMeta, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type Orientation, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadiusTokens, type RecipeCollection, type RecipeCompoundVariant, type RecipeDefinition, type RecipeProps, type RecipeStyle, type RecipeVariant, type RecipeVariantValue, type ResolvedSize, type ResolvedTokens, Select, SelectContent, type SelectContentProps, SelectContext, type SelectContextValue, SelectGroup, SelectGroupContext, type SelectGroupProps, SelectItem, type SelectItemMeta, type SelectItemProps, type SelectLabelProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SemanticColorTokens, type SemanticToken, type SemanticTokens, type ShadowTokens, type Size, type SizeProps, type SizeScale, type SizeToken, type SizeValue, type SpacingTokens, type StateProps, type Styleable, Switch, type SwitchProps, Textarea, TextareaCore, type TextareaCoreProps, type TextareaProps, type TextareaResize, type Theme, ThemeContext, type ThemeContextValue, type ThemeOverride, ThemeToggler, type ThemeTogglerColor, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type ThemeTransition, type TokenDefinition, type TokenGroup, type TokenValue, type Typography, type TypographyProps, type TypographyStyle, UIProvider, type UIProviderProps, type UseSizeStyleOptions, type ValueProps, type Variant, type VariantProps, buttonBase, buttonColors, buttonRecipe, buttonVariants, cn, defaultRecipes, defaultSizes, defaultTheme, defineRecipe, defineSemanticToken, defineToken, defineTypography, formControlBase, formControlRecipe, formControlStates, formControlVariants, hexToRgbString, inputBase, inputKindDefaults, inputRecipe, mergeRecipes, resolveRecipe, resolveTypography, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
1433
+ declare function extendTokens(override?: ThemeOverride["tokens"]): DesignTokens;
1434
+ declare function extendSemanticTokens(override?: ThemeOverride["semanticTokens"]): SemanticTokens;
1435
+
1436
+ declare function extendTheme(override?: ThemeOverride): Theme;
1437
+
1438
+ export { type AnimationTokens, type BaseColor, type BaseProps, type BaseTransition, type BaseVariant, Button, type ButtonProps, type CSSPropertiesWithVars, Checkbox, type CheckboxProps, type ClearableProps, type ColorMode, type ColorModeValue, type ColorProps, type ColorScale, type ColorTokens, Combobox, ComboboxContent, ComboboxInput, type ComboboxInputProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, type ControlledProps, type DeepPartial, type DesignTokens, type DisabledProps, type EmbeddedProps, type FontSizeTokens, type FontTokens, type FontWeightTokens, FormField, FormFieldControl, FormFieldDescription, FormFieldLabel, FormFieldMessage, type FormFieldMessageProps, type FormFieldProps, type FormFieldStatus, type FullWidthProps, Input, InputField, type InputFieldProps, type InputKind, type InputKindDefaults, type InputProps, type InputSize, type InputVariant, type IntensityMap, type LetterSpacingTokens, type LineHeightTokens, type LoadingProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorTabs, MultiSelect, MultiSelectContent, MultiSelectItem, type MultiSelectItemProps, type MultiSelectProps, MultiSelectTrigger, type Orientation, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadioSize, type RadiusTokens, type RecipeCollection, type RecipeCompoundVariant, type RecipeDefinition, type RecipeStyle, type RecipeVariant, type RecipeVariantValue, type ReportedValidity, type ResolvedSize, type ResolvedTokens, Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, type SelectLabelProps, type SelectProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SemanticColorTokens, type SemanticToken, type SemanticTokens, type ShadowTokens, type Size, type SizeProps, type SizeScale, type SizeToken, type SizeValue, type SpacingTokens, type StateProps, type StatusProps, type Styleable, Switch, type SwitchProps, Textarea, type TextareaCoreProps, type TextareaProps, type TextareaResize, type Theme, ThemeContext, type ThemeOverride, ThemeToggler, type ThemeTogglerColor, type ThemeTogglerDisplay, type ThemeTogglerProps, type ThemeTogglerVariant, type ThemeTransition, type TokenDefinition, type TokenGroup, type TokenValue, type TrimProps, type Typography, type TypographyProps, type TypographyStyle, UIProvider, type UIProviderProps, type UseSizeStyleOptions, type ValidateOn, type ValidateProps, type ValidationResult, type ValueProps, type Variant, type VariantProps, cn, defineRecipe, defineSemanticToken, defineToken, defineTypography, extendRecipes, extendSemanticTokens, extendTheme, extendTokens, extendTypography, hexToRgbString, rgbToHex, useBreakpoint, useClearableField, useFloatingSide, useSizeStyle, useStatusTransition, useTheme, useTypography };