@splenddev/kreativ-ui 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1586 -128
- package/dist/index.cjs +347 -335
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +197 -10
- package/dist/index.d.ts +197 -10
- package/dist/index.js +328 -335
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -54,6 +54,13 @@ interface VariantProps<Variant extends string = string> {
|
|
|
54
54
|
*/
|
|
55
55
|
variant?: Variant;
|
|
56
56
|
}
|
|
57
|
+
interface TypographyProps {
|
|
58
|
+
/**
|
|
59
|
+
* Defines the typography style to apply to the component.
|
|
60
|
+
* The value must match a typography style registered in the theme.
|
|
61
|
+
*/
|
|
62
|
+
typography?: string;
|
|
63
|
+
}
|
|
57
64
|
interface DisabledProps {
|
|
58
65
|
/**
|
|
59
66
|
* Disables the component.
|
|
@@ -120,7 +127,7 @@ interface ButtonRenderProps {
|
|
|
120
127
|
"aria-busy"?: boolean;
|
|
121
128
|
children?: React.ReactNode;
|
|
122
129
|
}
|
|
123
|
-
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps {
|
|
130
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
124
131
|
size?: ButtonSize;
|
|
125
132
|
leftIcon?: ReactNode;
|
|
126
133
|
rightIcon?: ReactNode;
|
|
@@ -578,7 +585,7 @@ interface SemanticTokens {
|
|
|
578
585
|
* };
|
|
579
586
|
* ```
|
|
580
587
|
*/
|
|
581
|
-
interface
|
|
588
|
+
interface TypographyStyle {
|
|
582
589
|
fontFamily?: string;
|
|
583
590
|
fontSize?: string;
|
|
584
591
|
fontWeight?: string | number;
|
|
@@ -591,13 +598,13 @@ interface TextStyle {
|
|
|
591
598
|
*
|
|
592
599
|
* @example
|
|
593
600
|
* ```ts
|
|
594
|
-
* const
|
|
601
|
+
* const typography: Typography = {
|
|
595
602
|
* heading: { fontSize: "2rem", fontWeight: 700 },
|
|
596
603
|
* body: { fontSize: "1rem", lineHeight: "1.5" },
|
|
597
604
|
* };
|
|
598
605
|
* ```
|
|
599
606
|
*/
|
|
600
|
-
type
|
|
607
|
+
type Typography = Record<string, TypographyStyle>;
|
|
601
608
|
/**
|
|
602
609
|
* A set of CSS properties that define the dimensions and spacing
|
|
603
610
|
* for a component at a specific size.
|
|
@@ -658,7 +665,7 @@ interface ThemeTransition {
|
|
|
658
665
|
*
|
|
659
666
|
* @property tokens - Raw design values (colors, spacing, radii, etc.).
|
|
660
667
|
* @property semanticTokens - Role‑based tokens that adapt to color mode.
|
|
661
|
-
* @property
|
|
668
|
+
* @property typography - Reusable typography styles.
|
|
662
669
|
* @property recipes - Component‑specific styles (from RecipeCollection).
|
|
663
670
|
* @property intensity - A global multiplier for visual prominence (e.g., 0.8, 1, 1.2).
|
|
664
671
|
* @property light - Legacy theme tokens for light mode (kept for migration).
|
|
@@ -668,7 +675,7 @@ interface ThemeTransition {
|
|
|
668
675
|
interface Theme {
|
|
669
676
|
tokens: DesignTokens;
|
|
670
677
|
semanticTokens: SemanticTokens;
|
|
671
|
-
|
|
678
|
+
typography: Typography;
|
|
672
679
|
recipes: RecipeCollection;
|
|
673
680
|
intensity: number;
|
|
674
681
|
sizes: SizeScale;
|
|
@@ -723,13 +730,13 @@ interface ThemeOverride {
|
|
|
723
730
|
*
|
|
724
731
|
* @example
|
|
725
732
|
* ```ts
|
|
726
|
-
*
|
|
733
|
+
* typography: {
|
|
727
734
|
* heading: { fontSize: "2.5rem", fontWeight: 800 },
|
|
728
735
|
* body: { fontSize: "1.125rem", lineHeight: "1.75" },
|
|
729
736
|
* }
|
|
730
737
|
* ```
|
|
731
738
|
*/
|
|
732
|
-
|
|
739
|
+
typography?: DeepPartial<Typography>;
|
|
733
740
|
/**
|
|
734
741
|
* Override component recipes.
|
|
735
742
|
* Allows modifying the base styles, variants, default variants, and compound variants
|
|
@@ -1239,7 +1246,6 @@ interface ThemeContextValue {
|
|
|
1239
1246
|
declare const ThemeContext: react.Context<ThemeContextValue | null>;
|
|
1240
1247
|
|
|
1241
1248
|
declare const defaultSizes: SizeScale;
|
|
1242
|
-
declare const defaultTextStyles: TextStyles;
|
|
1243
1249
|
declare const defaultRecipes: RecipeCollection;
|
|
1244
1250
|
declare const defaultTheme: Theme;
|
|
1245
1251
|
|
|
@@ -1267,6 +1273,17 @@ interface UseSizeStyleOptions {
|
|
|
1267
1273
|
}
|
|
1268
1274
|
declare function useSizeStyle(size: string, iconOnly?: boolean, component?: string, options?: UseSizeStyleOptions): ResolvedSize;
|
|
1269
1275
|
|
|
1276
|
+
declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open: boolean): {
|
|
1277
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
1278
|
+
side: "bottom" | "top";
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
type State = "none" | "error" | "success";
|
|
1282
|
+
type TransitionState = Exclude<State, "none"> | undefined;
|
|
1283
|
+
declare function useStateTransition(state: State): TransitionState;
|
|
1284
|
+
|
|
1285
|
+
declare function useTypography(name?: string): react.CSSProperties;
|
|
1286
|
+
|
|
1270
1287
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1271
1288
|
|
|
1272
1289
|
/**
|
|
@@ -1282,4 +1299,174 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1282
1299
|
declare function rgbToHex(value: string): string;
|
|
1283
1300
|
declare function hexToRgbString(hex: string): string | null;
|
|
1284
1301
|
|
|
1285
|
-
|
|
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
|
+
declare function defineRecipe<T extends RecipeDefinition>(recipe: T): T;
|
|
1450
|
+
|
|
1451
|
+
declare function mergeRecipes(base: RecipeCollection, override?: ThemeOverride["recipes"]): RecipeCollection;
|
|
1452
|
+
|
|
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;
|
|
1459
|
+
|
|
1460
|
+
declare function defineTypography(typography: TypographyStyle): TypographyStyle;
|
|
1461
|
+
|
|
1462
|
+
declare function defineToken<T>(value: T): {
|
|
1463
|
+
value: T;
|
|
1464
|
+
};
|
|
1465
|
+
declare function defineSemanticToken<T>(light: T, dark: T): {
|
|
1466
|
+
value: {
|
|
1467
|
+
light: T;
|
|
1468
|
+
dark: T;
|
|
1469
|
+
};
|
|
1470
|
+
};
|
|
1471
|
+
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,13 @@ interface VariantProps<Variant extends string = string> {
|
|
|
54
54
|
*/
|
|
55
55
|
variant?: Variant;
|
|
56
56
|
}
|
|
57
|
+
interface TypographyProps {
|
|
58
|
+
/**
|
|
59
|
+
* Defines the typography style to apply to the component.
|
|
60
|
+
* The value must match a typography style registered in the theme.
|
|
61
|
+
*/
|
|
62
|
+
typography?: string;
|
|
63
|
+
}
|
|
57
64
|
interface DisabledProps {
|
|
58
65
|
/**
|
|
59
66
|
* Disables the component.
|
|
@@ -120,7 +127,7 @@ interface ButtonRenderProps {
|
|
|
120
127
|
"aria-busy"?: boolean;
|
|
121
128
|
children?: React.ReactNode;
|
|
122
129
|
}
|
|
123
|
-
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps {
|
|
130
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "color">, BaseProps, ColorProps<ButtonColor>, VariantProps<ButtonVariant>, DisabledProps, LoadingProps, FullWidthProps, TypographyProps {
|
|
124
131
|
size?: ButtonSize;
|
|
125
132
|
leftIcon?: ReactNode;
|
|
126
133
|
rightIcon?: ReactNode;
|
|
@@ -578,7 +585,7 @@ interface SemanticTokens {
|
|
|
578
585
|
* };
|
|
579
586
|
* ```
|
|
580
587
|
*/
|
|
581
|
-
interface
|
|
588
|
+
interface TypographyStyle {
|
|
582
589
|
fontFamily?: string;
|
|
583
590
|
fontSize?: string;
|
|
584
591
|
fontWeight?: string | number;
|
|
@@ -591,13 +598,13 @@ interface TextStyle {
|
|
|
591
598
|
*
|
|
592
599
|
* @example
|
|
593
600
|
* ```ts
|
|
594
|
-
* const
|
|
601
|
+
* const typography: Typography = {
|
|
595
602
|
* heading: { fontSize: "2rem", fontWeight: 700 },
|
|
596
603
|
* body: { fontSize: "1rem", lineHeight: "1.5" },
|
|
597
604
|
* };
|
|
598
605
|
* ```
|
|
599
606
|
*/
|
|
600
|
-
type
|
|
607
|
+
type Typography = Record<string, TypographyStyle>;
|
|
601
608
|
/**
|
|
602
609
|
* A set of CSS properties that define the dimensions and spacing
|
|
603
610
|
* for a component at a specific size.
|
|
@@ -658,7 +665,7 @@ interface ThemeTransition {
|
|
|
658
665
|
*
|
|
659
666
|
* @property tokens - Raw design values (colors, spacing, radii, etc.).
|
|
660
667
|
* @property semanticTokens - Role‑based tokens that adapt to color mode.
|
|
661
|
-
* @property
|
|
668
|
+
* @property typography - Reusable typography styles.
|
|
662
669
|
* @property recipes - Component‑specific styles (from RecipeCollection).
|
|
663
670
|
* @property intensity - A global multiplier for visual prominence (e.g., 0.8, 1, 1.2).
|
|
664
671
|
* @property light - Legacy theme tokens for light mode (kept for migration).
|
|
@@ -668,7 +675,7 @@ interface ThemeTransition {
|
|
|
668
675
|
interface Theme {
|
|
669
676
|
tokens: DesignTokens;
|
|
670
677
|
semanticTokens: SemanticTokens;
|
|
671
|
-
|
|
678
|
+
typography: Typography;
|
|
672
679
|
recipes: RecipeCollection;
|
|
673
680
|
intensity: number;
|
|
674
681
|
sizes: SizeScale;
|
|
@@ -723,13 +730,13 @@ interface ThemeOverride {
|
|
|
723
730
|
*
|
|
724
731
|
* @example
|
|
725
732
|
* ```ts
|
|
726
|
-
*
|
|
733
|
+
* typography: {
|
|
727
734
|
* heading: { fontSize: "2.5rem", fontWeight: 800 },
|
|
728
735
|
* body: { fontSize: "1.125rem", lineHeight: "1.75" },
|
|
729
736
|
* }
|
|
730
737
|
* ```
|
|
731
738
|
*/
|
|
732
|
-
|
|
739
|
+
typography?: DeepPartial<Typography>;
|
|
733
740
|
/**
|
|
734
741
|
* Override component recipes.
|
|
735
742
|
* Allows modifying the base styles, variants, default variants, and compound variants
|
|
@@ -1239,7 +1246,6 @@ interface ThemeContextValue {
|
|
|
1239
1246
|
declare const ThemeContext: react.Context<ThemeContextValue | null>;
|
|
1240
1247
|
|
|
1241
1248
|
declare const defaultSizes: SizeScale;
|
|
1242
|
-
declare const defaultTextStyles: TextStyles;
|
|
1243
1249
|
declare const defaultRecipes: RecipeCollection;
|
|
1244
1250
|
declare const defaultTheme: Theme;
|
|
1245
1251
|
|
|
@@ -1267,6 +1273,17 @@ interface UseSizeStyleOptions {
|
|
|
1267
1273
|
}
|
|
1268
1274
|
declare function useSizeStyle(size: string, iconOnly?: boolean, component?: string, options?: UseSizeStyleOptions): ResolvedSize;
|
|
1269
1275
|
|
|
1276
|
+
declare function useFloatingSide(triggerRef: RefObject<HTMLElement | null>, open: boolean): {
|
|
1277
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
1278
|
+
side: "bottom" | "top";
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
type State = "none" | "error" | "success";
|
|
1282
|
+
type TransitionState = Exclude<State, "none"> | undefined;
|
|
1283
|
+
declare function useStateTransition(state: State): TransitionState;
|
|
1284
|
+
|
|
1285
|
+
declare function useTypography(name?: string): react.CSSProperties;
|
|
1286
|
+
|
|
1270
1287
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1271
1288
|
|
|
1272
1289
|
/**
|
|
@@ -1282,4 +1299,174 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1282
1299
|
declare function rgbToHex(value: string): string;
|
|
1283
1300
|
declare function hexToRgbString(hex: string): string | null;
|
|
1284
1301
|
|
|
1285
|
-
|
|
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
|
+
declare function defineRecipe<T extends RecipeDefinition>(recipe: T): T;
|
|
1450
|
+
|
|
1451
|
+
declare function mergeRecipes(base: RecipeCollection, override?: ThemeOverride["recipes"]): RecipeCollection;
|
|
1452
|
+
|
|
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;
|
|
1459
|
+
|
|
1460
|
+
declare function defineTypography(typography: TypographyStyle): TypographyStyle;
|
|
1461
|
+
|
|
1462
|
+
declare function defineToken<T>(value: T): {
|
|
1463
|
+
value: T;
|
|
1464
|
+
};
|
|
1465
|
+
declare function defineSemanticToken<T>(light: T, dark: T): {
|
|
1466
|
+
value: {
|
|
1467
|
+
light: T;
|
|
1468
|
+
dark: T;
|
|
1469
|
+
};
|
|
1470
|
+
};
|
|
1471
|
+
|
|
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 };
|