@aurora-ds/theme 1.6.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.dev.md +84 -2
- package/README.md +187 -90
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -419
- package/dist/index.d.ts +34 -419
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -23,69 +23,45 @@ type BaseBreakpoints = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Base color tokens following modern design system semantics
|
|
26
|
+
* Base color tokens following modern design system semantics - V2
|
|
27
27
|
*/
|
|
28
28
|
type BaseColors = {
|
|
29
|
+
background: string;
|
|
30
|
+
surface: string;
|
|
31
|
+
surfaceHover: string;
|
|
32
|
+
surfaceActive: string;
|
|
33
|
+
text: string;
|
|
34
|
+
textSecondary: string;
|
|
35
|
+
textTertiary: string;
|
|
29
36
|
primary: string;
|
|
30
|
-
onPrimary: string;
|
|
31
37
|
primaryHover: string;
|
|
32
38
|
primaryActive: string;
|
|
33
39
|
primarySubtle: string;
|
|
34
40
|
primaryDisabled: string;
|
|
41
|
+
onPrimary: string;
|
|
35
42
|
secondary: string;
|
|
36
|
-
onSecondary: string;
|
|
37
43
|
secondaryHover: string;
|
|
38
44
|
secondaryActive: string;
|
|
39
45
|
secondarySubtle: string;
|
|
40
46
|
secondaryDisabled: string;
|
|
41
|
-
|
|
42
|
-
onAccent: string;
|
|
43
|
-
accentHover: string;
|
|
44
|
-
accentActive: string;
|
|
45
|
-
accentSubtle: string;
|
|
46
|
-
tertiary: string;
|
|
47
|
-
onTertiary: string;
|
|
48
|
-
tertiaryHover: string;
|
|
49
|
-
tertiaryActive: string;
|
|
50
|
-
tertiarySubtle: string;
|
|
51
|
-
tertiaryDisabled: string;
|
|
52
|
-
background: string;
|
|
53
|
-
surface: string;
|
|
54
|
-
surfaceHover: string;
|
|
55
|
-
surfaceActive: string;
|
|
56
|
-
elevated: string;
|
|
57
|
-
overlay: string;
|
|
58
|
-
text: string;
|
|
59
|
-
textSecondary: string;
|
|
60
|
-
textTertiary: string;
|
|
61
|
-
textInverse: string;
|
|
47
|
+
onSecondary: string;
|
|
62
48
|
border: string;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
borderSubtle: string;
|
|
49
|
+
disabled: string;
|
|
50
|
+
disabledText: string;
|
|
66
51
|
success: string;
|
|
67
|
-
onSuccess: string;
|
|
68
|
-
successHover: string;
|
|
69
52
|
successSubtle: string;
|
|
70
53
|
warning: string;
|
|
71
|
-
onWarning: string;
|
|
72
|
-
warningHover: string;
|
|
73
54
|
warningSubtle: string;
|
|
74
55
|
error: string;
|
|
75
|
-
onError: string;
|
|
76
56
|
errorHover: string;
|
|
77
57
|
errorSubtle: string;
|
|
58
|
+
onError: string;
|
|
78
59
|
info: string;
|
|
79
|
-
onInfo: string;
|
|
80
|
-
infoHover: string;
|
|
81
60
|
infoSubtle: string;
|
|
82
61
|
link: string;
|
|
83
62
|
linkHover: string;
|
|
84
63
|
linkActive: string;
|
|
85
|
-
|
|
86
|
-
focus: string;
|
|
87
|
-
disabled: string;
|
|
88
|
-
disabledText: string;
|
|
64
|
+
linkDisabled: string;
|
|
89
65
|
};
|
|
90
66
|
|
|
91
67
|
/**
|
|
@@ -379,11 +355,6 @@ type ColorName = 'gray' | 'slate' | 'stone' | 'red' | 'orange' | 'amber' | 'yell
|
|
|
379
355
|
*/
|
|
380
356
|
type ColorShade = keyof ColorScale;
|
|
381
357
|
|
|
382
|
-
/**
|
|
383
|
-
* Available palette preset names
|
|
384
|
-
*/
|
|
385
|
-
type PaletteName = 'indigo' | 'blue' | 'rose' | 'emerald' | 'teal' | 'violet' | 'amber' | 'cyan' | 'slate' | 'gray';
|
|
386
|
-
|
|
387
358
|
type ThemeProviderProps<T extends Theme = Theme> = {
|
|
388
359
|
theme: T;
|
|
389
360
|
children?: ReactNode;
|
|
@@ -464,21 +435,9 @@ declare const defaultOpacity: Theme['opacity'];
|
|
|
464
435
|
*/
|
|
465
436
|
declare const defaultBreakpoints: Theme['breakpoints'];
|
|
466
437
|
/**
|
|
467
|
-
*
|
|
468
|
-
*/
|
|
469
|
-
declare const defaultColors: BaseColors;
|
|
470
|
-
/**
|
|
471
|
-
* Default dark colors (using indigo palette)
|
|
472
|
-
*/
|
|
473
|
-
declare const defaultDarkColors: BaseColors;
|
|
474
|
-
/**
|
|
475
|
-
* Complete default light theme
|
|
438
|
+
* Complete default theme V2
|
|
476
439
|
*/
|
|
477
440
|
declare const defaultTheme: Theme;
|
|
478
|
-
/**
|
|
479
|
-
* Complete default dark theme
|
|
480
|
-
*/
|
|
481
|
-
declare const defaultDarkTheme: Theme;
|
|
482
441
|
|
|
483
442
|
/**
|
|
484
443
|
* Create a theme by merging a base theme with overrides
|
|
@@ -599,52 +558,23 @@ declare const createCustomTheme: <TColors extends Record<string, string>, TSpaci
|
|
|
599
558
|
breakpoints?: TBreakpoints;
|
|
600
559
|
}) => CustomTheme<TColors, TSpacing, TRadius, TShadows, TFontSize, TFontWeight, TLineHeight, TZIndex, TTransition, TOpacity, TBreakpoints>;
|
|
601
560
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
declare const lime: ColorScale;
|
|
617
|
-
|
|
618
|
-
declare const green: ColorScale;
|
|
619
|
-
|
|
620
|
-
declare const emerald: ColorScale;
|
|
621
|
-
|
|
622
|
-
declare const teal: ColorScale;
|
|
623
|
-
|
|
624
|
-
declare const cyan: ColorScale;
|
|
625
|
-
|
|
626
|
-
declare const sky: ColorScale;
|
|
627
|
-
|
|
628
|
-
declare const blue: ColorScale;
|
|
629
|
-
|
|
630
|
-
declare const indigo: ColorScale;
|
|
631
|
-
|
|
632
|
-
declare const violet: ColorScale;
|
|
633
|
-
|
|
634
|
-
declare const purple: ColorScale;
|
|
635
|
-
|
|
636
|
-
declare const fuchsia: ColorScale;
|
|
637
|
-
|
|
638
|
-
declare const pink: ColorScale;
|
|
639
|
-
|
|
640
|
-
declare const rose: ColorScale;
|
|
641
|
-
|
|
642
|
-
declare const white = "#ffffff";
|
|
643
|
-
declare const black = "#000000";
|
|
644
|
-
declare const transparent = "transparent";
|
|
645
|
-
declare const current = "currentColor";
|
|
561
|
+
/**
|
|
562
|
+
* Color Scales - Modern color palettes with shades from 25 to 950
|
|
563
|
+
*
|
|
564
|
+
* Scales are only accessible via the colors object to maintain consistency
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```ts
|
|
568
|
+
* import { colors } from '@aurora-ui/theme'
|
|
569
|
+
*
|
|
570
|
+
* colors.indigo[500] // '#6366f1'
|
|
571
|
+
* colors.emerald[400] // '#34d399'
|
|
572
|
+
* colors.gray[900] // '#18181b'
|
|
573
|
+
* ```
|
|
574
|
+
*/
|
|
646
575
|
/**
|
|
647
576
|
* All color scales organized by name
|
|
577
|
+
* All scales and special values are only accessible via this object
|
|
648
578
|
*/
|
|
649
579
|
declare const colors: {
|
|
650
580
|
readonly gray: ColorScale;
|
|
@@ -673,171 +603,11 @@ declare const colors: {
|
|
|
673
603
|
readonly current: "currentColor";
|
|
674
604
|
};
|
|
675
605
|
|
|
676
|
-
type ColorPalette$9 = Theme['colors'];
|
|
677
606
|
/**
|
|
678
|
-
*
|
|
679
|
-
*
|
|
607
|
+
* Default light theme palette - V2
|
|
608
|
+
* A clean, modern palette using Indigo as primary and Slate as neutral
|
|
680
609
|
*/
|
|
681
|
-
declare const
|
|
682
|
-
/**
|
|
683
|
-
* Indigo dark palette - Modern, accessible color scheme
|
|
684
|
-
* Follows WCAG AA contrast guidelines
|
|
685
|
-
*/
|
|
686
|
-
declare const indigoDark: ColorPalette$9;
|
|
687
|
-
|
|
688
|
-
type ColorPalette$8 = Theme['colors'];
|
|
689
|
-
/**
|
|
690
|
-
* Blue light palette - Classic, accessible color scheme
|
|
691
|
-
* Follows WCAG AA contrast guidelines
|
|
692
|
-
*/
|
|
693
|
-
declare const blueLight: ColorPalette$8;
|
|
694
|
-
/**
|
|
695
|
-
* Blue dark palette - Classic, accessible color scheme
|
|
696
|
-
* Follows WCAG AA contrast guidelines
|
|
697
|
-
*/
|
|
698
|
-
declare const blueDark: ColorPalette$8;
|
|
699
|
-
|
|
700
|
-
type ColorPalette$7 = Theme['colors'];
|
|
701
|
-
/**
|
|
702
|
-
* Rose light palette - Elegant, accessible color scheme
|
|
703
|
-
* Follows WCAG AA contrast guidelines
|
|
704
|
-
*/
|
|
705
|
-
declare const roseLight: ColorPalette$7;
|
|
706
|
-
/**
|
|
707
|
-
* Rose dark palette - Elegant, accessible color scheme
|
|
708
|
-
* Follows WCAG AA contrast guidelines
|
|
709
|
-
*/
|
|
710
|
-
declare const roseDark: ColorPalette$7;
|
|
711
|
-
|
|
712
|
-
type ColorPalette$6 = Theme['colors'];
|
|
713
|
-
/**
|
|
714
|
-
* Emerald light palette - Fresh, accessible color scheme
|
|
715
|
-
* Follows WCAG AA contrast guidelines
|
|
716
|
-
*/
|
|
717
|
-
declare const emeraldLight: ColorPalette$6;
|
|
718
|
-
/**
|
|
719
|
-
* Emerald dark palette - Fresh, accessible color scheme
|
|
720
|
-
* Follows WCAG AA contrast guidelines
|
|
721
|
-
*/
|
|
722
|
-
declare const emeraldDark: ColorPalette$6;
|
|
723
|
-
|
|
724
|
-
type ColorPalette$5 = Theme['colors'];
|
|
725
|
-
/**
|
|
726
|
-
* Teal light palette - Cool, accessible color scheme
|
|
727
|
-
* Follows WCAG AA contrast guidelines
|
|
728
|
-
*/
|
|
729
|
-
declare const tealLight: ColorPalette$5;
|
|
730
|
-
/**
|
|
731
|
-
* Teal dark palette - Cool, accessible color scheme
|
|
732
|
-
* Follows WCAG AA contrast guidelines
|
|
733
|
-
*/
|
|
734
|
-
declare const tealDark: ColorPalette$5;
|
|
735
|
-
|
|
736
|
-
type ColorPalette$4 = Theme['colors'];
|
|
737
|
-
/**
|
|
738
|
-
* Violet light palette - Creative, accessible color scheme
|
|
739
|
-
* Follows WCAG AA contrast guidelines
|
|
740
|
-
*/
|
|
741
|
-
declare const violetLight: ColorPalette$4;
|
|
742
|
-
/**
|
|
743
|
-
* Violet dark palette - Creative, accessible color scheme
|
|
744
|
-
* Follows WCAG AA contrast guidelines
|
|
745
|
-
*/
|
|
746
|
-
declare const violetDark: ColorPalette$4;
|
|
747
|
-
|
|
748
|
-
type ColorPalette$3 = Theme['colors'];
|
|
749
|
-
/**
|
|
750
|
-
* Amber light palette - Warm, accessible color scheme
|
|
751
|
-
* Follows WCAG AA contrast guidelines
|
|
752
|
-
*/
|
|
753
|
-
declare const amberLight: ColorPalette$3;
|
|
754
|
-
/**
|
|
755
|
-
* Amber dark palette - Warm, accessible color scheme
|
|
756
|
-
* Follows WCAG AA contrast guidelines
|
|
757
|
-
*/
|
|
758
|
-
declare const amberDark: ColorPalette$3;
|
|
759
|
-
|
|
760
|
-
type ColorPalette$2 = Theme['colors'];
|
|
761
|
-
/**
|
|
762
|
-
* Cyan light palette - Fresh, accessible color scheme
|
|
763
|
-
* Follows WCAG AA contrast guidelines
|
|
764
|
-
*/
|
|
765
|
-
declare const cyanLight: ColorPalette$2;
|
|
766
|
-
/**
|
|
767
|
-
* Cyan dark palette - Fresh, accessible color scheme
|
|
768
|
-
* Follows WCAG AA contrast guidelines
|
|
769
|
-
*/
|
|
770
|
-
declare const cyanDark: ColorPalette$2;
|
|
771
|
-
|
|
772
|
-
type ColorPalette$1 = Theme['colors'];
|
|
773
|
-
/**
|
|
774
|
-
* Slate light palette - Professional, accessible color scheme
|
|
775
|
-
* Follows WCAG AA contrast guidelines
|
|
776
|
-
*/
|
|
777
|
-
declare const slateLight: ColorPalette$1;
|
|
778
|
-
/**
|
|
779
|
-
* Slate dark palette - Professional, accessible color scheme
|
|
780
|
-
* Follows WCAG AA contrast guidelines
|
|
781
|
-
*/
|
|
782
|
-
declare const slateDark: ColorPalette$1;
|
|
783
|
-
|
|
784
|
-
type ColorPalette = Theme['colors'];
|
|
785
|
-
/**
|
|
786
|
-
* Gray light palette - Clean, accessible color scheme
|
|
787
|
-
* Follows WCAG AA contrast guidelines
|
|
788
|
-
*/
|
|
789
|
-
declare const grayLight: ColorPalette;
|
|
790
|
-
/**
|
|
791
|
-
* Gray dark palette - Clean, accessible color scheme
|
|
792
|
-
* Follows WCAG AA contrast guidelines
|
|
793
|
-
*/
|
|
794
|
-
declare const grayDark: ColorPalette;
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* All available color palettes organized by name
|
|
798
|
-
*/
|
|
799
|
-
declare const palettes: {
|
|
800
|
-
readonly indigo: {
|
|
801
|
-
readonly light: BaseColors;
|
|
802
|
-
readonly dark: BaseColors;
|
|
803
|
-
};
|
|
804
|
-
readonly blue: {
|
|
805
|
-
readonly light: BaseColors;
|
|
806
|
-
readonly dark: BaseColors;
|
|
807
|
-
};
|
|
808
|
-
readonly rose: {
|
|
809
|
-
readonly light: BaseColors;
|
|
810
|
-
readonly dark: BaseColors;
|
|
811
|
-
};
|
|
812
|
-
readonly emerald: {
|
|
813
|
-
readonly light: BaseColors;
|
|
814
|
-
readonly dark: BaseColors;
|
|
815
|
-
};
|
|
816
|
-
readonly teal: {
|
|
817
|
-
readonly light: BaseColors;
|
|
818
|
-
readonly dark: BaseColors;
|
|
819
|
-
};
|
|
820
|
-
readonly violet: {
|
|
821
|
-
readonly light: BaseColors;
|
|
822
|
-
readonly dark: BaseColors;
|
|
823
|
-
};
|
|
824
|
-
readonly amber: {
|
|
825
|
-
readonly light: BaseColors;
|
|
826
|
-
readonly dark: BaseColors;
|
|
827
|
-
};
|
|
828
|
-
readonly cyan: {
|
|
829
|
-
readonly light: BaseColors;
|
|
830
|
-
readonly dark: BaseColors;
|
|
831
|
-
};
|
|
832
|
-
readonly slate: {
|
|
833
|
-
readonly light: BaseColors;
|
|
834
|
-
readonly dark: BaseColors;
|
|
835
|
-
};
|
|
836
|
-
readonly gray: {
|
|
837
|
-
readonly light: BaseColors;
|
|
838
|
-
readonly dark: BaseColors;
|
|
839
|
-
};
|
|
840
|
-
};
|
|
610
|
+
declare const defaultPalette: BaseColors;
|
|
841
611
|
|
|
842
612
|
/**
|
|
843
613
|
* Extended type to support pseudo-classes, media queries, container queries, supports and complex selectors
|
|
@@ -1039,159 +809,4 @@ declare const insertRule: (rule: string) => void;
|
|
|
1039
809
|
*/
|
|
1040
810
|
declare const sanitizeCssValue: (value: string) => string;
|
|
1041
811
|
|
|
1042
|
-
|
|
1043
|
-
* WCAG Contrast Utilities
|
|
1044
|
-
*
|
|
1045
|
-
* Utilities for checking color contrast ratios according to WCAG 2.1 guidelines.
|
|
1046
|
-
*
|
|
1047
|
-
* @example
|
|
1048
|
-
* ```ts
|
|
1049
|
-
* import { getContrastRatio, meetsWCAG, checkThemeContrast } from '@aurora-ds/theme'
|
|
1050
|
-
*
|
|
1051
|
-
* // Check contrast between two colors
|
|
1052
|
-
* const ratio = getContrastRatio('#ffffff', '#000000') // 21
|
|
1053
|
-
*
|
|
1054
|
-
* // Check if colors meet WCAG standards
|
|
1055
|
-
* meetsWCAG('#ffffff', '#767676', 'AA') // true for large text
|
|
1056
|
-
* meetsWCAG('#ffffff', '#767676', 'AAA') // false
|
|
1057
|
-
*
|
|
1058
|
-
* // Check all theme color pairs
|
|
1059
|
-
* const issues = checkThemeContrast(myTheme)
|
|
1060
|
-
* ```
|
|
1061
|
-
*/
|
|
1062
|
-
/**
|
|
1063
|
-
* WCAG contrast level requirements
|
|
1064
|
-
* - AA: 4.5:1 for normal text, 3:1 for large text
|
|
1065
|
-
* - AAA: 7:1 for normal text, 4.5:1 for large text
|
|
1066
|
-
*/
|
|
1067
|
-
type WCAGLevel = 'AA' | 'AAA';
|
|
1068
|
-
/**
|
|
1069
|
-
* Result of a contrast check
|
|
1070
|
-
*/
|
|
1071
|
-
type ContrastResult = {
|
|
1072
|
-
/** The two colors being compared */
|
|
1073
|
-
colors: [string, string];
|
|
1074
|
-
/** The contrast ratio (1-21) */
|
|
1075
|
-
ratio: number;
|
|
1076
|
-
/** Whether it passes WCAG AA for normal text (4.5:1) */
|
|
1077
|
-
passesAA: boolean;
|
|
1078
|
-
/** Whether it passes WCAG AA for large text (3:1) */
|
|
1079
|
-
passesAALarge: boolean;
|
|
1080
|
-
/** Whether it passes WCAG AAA for normal text (7:1) */
|
|
1081
|
-
passesAAA: boolean;
|
|
1082
|
-
/** Whether it passes WCAG AAA for large text (4.5:1) */
|
|
1083
|
-
passesAAALarge: boolean;
|
|
1084
|
-
};
|
|
1085
|
-
/**
|
|
1086
|
-
* Theme contrast check result
|
|
1087
|
-
*/
|
|
1088
|
-
type ThemeContrastIssue = {
|
|
1089
|
-
/** Name of the color pair (e.g., "primary/onPrimary") */
|
|
1090
|
-
pair: string;
|
|
1091
|
-
/** Foreground color name */
|
|
1092
|
-
foreground: string;
|
|
1093
|
-
/** Background color name */
|
|
1094
|
-
background: string;
|
|
1095
|
-
/** The contrast ratio */
|
|
1096
|
-
ratio: number;
|
|
1097
|
-
/** Required minimum ratio */
|
|
1098
|
-
required: number;
|
|
1099
|
-
/** WCAG level that failed */
|
|
1100
|
-
level: 'AA' | 'AALarge';
|
|
1101
|
-
};
|
|
1102
|
-
/**
|
|
1103
|
-
* Calculate the contrast ratio between two colors
|
|
1104
|
-
* @see https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio
|
|
1105
|
-
*
|
|
1106
|
-
* @param foreground - Foreground color (hex)
|
|
1107
|
-
* @param background - Background color (hex)
|
|
1108
|
-
* @returns Contrast ratio (1-21), or null if colors are invalid
|
|
1109
|
-
*
|
|
1110
|
-
* @example
|
|
1111
|
-
* ```ts
|
|
1112
|
-
* getContrastRatio('#ffffff', '#000000') // 21
|
|
1113
|
-
* getContrastRatio('#ffffff', '#ffffff') // 1
|
|
1114
|
-
* getContrastRatio('#6366f1', '#ffffff') // ~4.5
|
|
1115
|
-
* ```
|
|
1116
|
-
*/
|
|
1117
|
-
declare const getContrastRatio: (foreground: string, background: string) => number | null;
|
|
1118
|
-
/**
|
|
1119
|
-
* Check if two colors meet WCAG contrast requirements
|
|
1120
|
-
*
|
|
1121
|
-
* @param foreground - Foreground color (hex)
|
|
1122
|
-
* @param background - Background color (hex)
|
|
1123
|
-
* @param level - WCAG level to check ('AA' or 'AAA')
|
|
1124
|
-
* @param largeText - Whether this is for large text (14pt bold or 18pt+)
|
|
1125
|
-
* @returns Whether the contrast meets the specified WCAG level
|
|
1126
|
-
*
|
|
1127
|
-
* @example
|
|
1128
|
-
* ```ts
|
|
1129
|
-
* meetsWCAG('#ffffff', '#6366f1', 'AA') // true
|
|
1130
|
-
* meetsWCAG('#ffffff', '#6366f1', 'AAA') // false
|
|
1131
|
-
* meetsWCAG('#ffffff', '#94a3b8', 'AA', true) // true (large text)
|
|
1132
|
-
* ```
|
|
1133
|
-
*/
|
|
1134
|
-
declare const meetsWCAG: (foreground: string, background: string, level?: WCAGLevel, largeText?: boolean) => boolean;
|
|
1135
|
-
/**
|
|
1136
|
-
* Get detailed contrast information between two colors
|
|
1137
|
-
*
|
|
1138
|
-
* @param foreground - Foreground color (hex)
|
|
1139
|
-
* @param background - Background color (hex)
|
|
1140
|
-
* @returns Detailed contrast result or null if colors are invalid
|
|
1141
|
-
*
|
|
1142
|
-
* @example
|
|
1143
|
-
* ```ts
|
|
1144
|
-
* const result = checkContrast('#ffffff', '#6366f1')
|
|
1145
|
-
* // {
|
|
1146
|
-
* // colors: ['#ffffff', '#6366f1'],
|
|
1147
|
-
* // ratio: 4.54,
|
|
1148
|
-
* // passesAA: true,
|
|
1149
|
-
* // passesAALarge: true,
|
|
1150
|
-
* // passesAAA: false,
|
|
1151
|
-
* // passesAAALarge: true
|
|
1152
|
-
* // }
|
|
1153
|
-
* ```
|
|
1154
|
-
*/
|
|
1155
|
-
declare const checkContrast: (foreground: string, background: string) => ContrastResult | null;
|
|
1156
|
-
/**
|
|
1157
|
-
* Check all important color pairs in a theme for WCAG compliance
|
|
1158
|
-
*
|
|
1159
|
-
* @param theme - The theme to check
|
|
1160
|
-
* @param level - Minimum WCAG level to require ('AA' or 'AAA')
|
|
1161
|
-
* @returns Array of contrast issues found
|
|
1162
|
-
*
|
|
1163
|
-
* @example
|
|
1164
|
-
* ```ts
|
|
1165
|
-
* import { checkThemeContrast, defaultTheme } from '@aurora-ds/theme'
|
|
1166
|
-
*
|
|
1167
|
-
* const issues = checkThemeContrast(defaultTheme)
|
|
1168
|
-
* if (issues.length > 0) {
|
|
1169
|
-
* console.warn('Theme has contrast issues:', issues)
|
|
1170
|
-
* }
|
|
1171
|
-
*
|
|
1172
|
-
* // Check for AAA compliance
|
|
1173
|
-
* const strictIssues = checkThemeContrast(defaultTheme, 'AAA')
|
|
1174
|
-
* ```
|
|
1175
|
-
*/
|
|
1176
|
-
declare const checkThemeContrast: (theme: {
|
|
1177
|
-
colors: Record<string, string>;
|
|
1178
|
-
}, level?: WCAGLevel) => ThemeContrastIssue[];
|
|
1179
|
-
/**
|
|
1180
|
-
* Get a suggested color that meets WCAG contrast requirements
|
|
1181
|
-
* Adjusts the lightness of the foreground color to meet the target ratio
|
|
1182
|
-
*
|
|
1183
|
-
* @param foreground - Current foreground color (hex)
|
|
1184
|
-
* @param background - Background color (hex)
|
|
1185
|
-
* @param targetRatio - Desired contrast ratio (default 4.5 for AA)
|
|
1186
|
-
* @returns Adjusted foreground color or null if adjustment isn't possible
|
|
1187
|
-
*
|
|
1188
|
-
* @example
|
|
1189
|
-
* ```ts
|
|
1190
|
-
* // If #94a3b8 on #ffffff doesn't meet AA
|
|
1191
|
-
* const suggested = suggestContrastColor('#94a3b8', '#ffffff', 4.5)
|
|
1192
|
-
* // Returns a darker shade that meets the requirement
|
|
1193
|
-
* ```
|
|
1194
|
-
*/
|
|
1195
|
-
declare const suggestContrastColor: (foreground: string, background: string, targetRatio?: number) => string | null;
|
|
1196
|
-
|
|
1197
|
-
export { type BaseBreakpoints, type BaseColors, type BaseFontSize, type BaseFontWeight, type BaseLineHeight, type BaseOpacity, type BaseRadius, type BaseShadows, type BaseSpacing, type BaseTransition, type BaseZIndex, type ColorName, type ColorScale, type ColorShade, type ContrastResult, type CreateCustomThemeOptions, type CreateThemeOptions, type CustomTheme, type CustomThemeBase, type DeepPartial, type ExtendTheme, type ExtendedTheme, type FontFaceOptions, type PaletteName, type StyleFunction, type StyleWithPseudos, type Theme, type ThemeContrastIssue, type ThemeOverride, ThemeProvider, type ThemeProviderProps, type WCAGLevel, amber, amberDark, amberLight, black, blue, blueDark, blueLight, checkContrast, checkThemeContrast, clearSSRRules, colors, createCustomTheme, createStyles, createTheme, createThemeVariant, createTypedStyles, cssVar, cssVariables, current, cyan, cyanDark, cyanLight, defaultBreakpoints, defaultColors, defaultDarkColors, defaultDarkTheme, defaultFontSize, defaultFontWeight, defaultLineHeight, defaultOpacity, defaultRadius, defaultShadows, defaultSpacing, defaultTheme, defaultTransition, defaultZIndex, emerald, emeraldDark, emeraldLight, fontFace, fuchsia, getContrastRatio, getSSRRulesArray, getSSRStyleTag, getSSRStyles, getTheme, gray, grayDark, grayLight, green, indigo, indigoDark, indigoLight, injectCssVariables, insertRule, keyframes, lime, meetsWCAG, mergeThemes, orange, palettes, pink, purple, red, rose, roseDark, roseLight, sanitizeCssValue, setThemeContextGetter, sky, slate, slateDark, slateLight, stone, suggestContrastColor, teal, tealDark, tealLight, transparent, useTheme, violet, violetDark, violetLight, white, yellow };
|
|
812
|
+
export { type BaseBreakpoints, type BaseColors, type BaseFontSize, type BaseFontWeight, type BaseLineHeight, type BaseOpacity, type BaseRadius, type BaseShadows, type BaseSpacing, type BaseTransition, type BaseZIndex, type ColorName, type ColorScale, type ColorShade, type CreateCustomThemeOptions, type CreateThemeOptions, type CustomTheme, type CustomThemeBase, type DeepPartial, type ExtendTheme, type ExtendedTheme, type FontFaceOptions, type StyleFunction, type StyleWithPseudos, type Theme, type ThemeOverride, ThemeProvider, type ThemeProviderProps, clearSSRRules, colors, createCustomTheme, createStyles, createTheme, createThemeVariant, createTypedStyles, cssVar, cssVariables, defaultBreakpoints, defaultFontSize, defaultFontWeight, defaultLineHeight, defaultOpacity, defaultPalette, defaultRadius, defaultShadows, defaultSpacing, defaultTheme, defaultTransition, defaultZIndex, fontFace, getSSRRulesArray, getSSRStyleTag, getSSRStyles, getTheme, injectCssVariables, insertRule, keyframes, mergeThemes, sanitizeCssValue, setThemeContextGetter, useTheme };
|