@frosted-ui/react-native 0.0.1-canary.100
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 +160 -0
- package/dist/components/accordion.d.ts +21 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +94 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +67 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +170 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +4 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +4 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +23 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +128 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +81 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +81 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/callout.d.ts +23 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +128 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +41 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox.d.ts +12 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +100 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/circular-progress.d.ts +21 -0
- package/dist/components/circular-progress.d.ts.map +1 -0
- package/dist/components/circular-progress.js +78 -0
- package/dist/components/circular-progress.js.map +1 -0
- package/dist/components/code.d.ts +18 -0
- package/dist/components/code.d.ts.map +1 -0
- package/dist/components/code.js +83 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/context-menu.d.ts +65 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +441 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.d.ts +49 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +141 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +65 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +441 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/heading.d.ts +15 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +8 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/hover-card.d.ts +24 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +49 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/icon-button.d.ts +14 -0
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +81 -0
- package/dist/components/icon-button.js.map +1 -0
- package/dist/components/icon.d.ts +27 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +30 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/index.d.ts +37 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +49 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +26 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/link.d.ts +19 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +68 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/list.d.ts +37 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +112 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/native-only-animated-view.d.ts +219 -0
- package/dist/components/native-only-animated-view.d.ts.map +1 -0
- package/dist/components/native-only-animated-view.js +26 -0
- package/dist/components/native-only-animated-view.js.map +1 -0
- package/dist/components/popover.d.ts +24 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +52 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +14 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +52 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +18 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +122 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/segmented-control.d.ts +21 -0
- package/dist/components/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control.js +113 -0
- package/dist/components/segmented-control.js.map +1 -0
- package/dist/components/select.d.ts +58 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +491 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +12 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +47 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/skeleton.d.ts +28 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +137 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +30 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +248 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.d.ts +17 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +199 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.d.ts +12 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +188 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.d.ts +26 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +125 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text-area.d.ts +16 -0
- package/dist/components/text-area.d.ts.map +1 -0
- package/dist/components/text-area.js +121 -0
- package/dist/components/text-area.js.map +1 -0
- package/dist/components/text-field.d.ts +35 -0
- package/dist/components/text-field.d.ts.map +1 -0
- package/dist/components/text-field.js +300 -0
- package/dist/components/text-field.js.map +1 -0
- package/dist/components/text.d.ts +23 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/text.js +44 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/tooltip.d.ts +24 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +63 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/button-styles.d.ts +13 -0
- package/dist/lib/button-styles.d.ts.map +1 -0
- package/dist/lib/button-styles.js +115 -0
- package/dist/lib/button-styles.js.map +1 -0
- package/dist/lib/color-utils.d.ts +26 -0
- package/dist/lib/color-utils.d.ts.map +1 -0
- package/dist/lib/color-utils.js +48 -0
- package/dist/lib/color-utils.js.map +1 -0
- package/dist/lib/dialog-styles.d.ts +42 -0
- package/dist/lib/dialog-styles.d.ts.map +1 -0
- package/dist/lib/dialog-styles.js +162 -0
- package/dist/lib/dialog-styles.js.map +1 -0
- package/dist/lib/full-window-overlay.d.ts +11 -0
- package/dist/lib/full-window-overlay.d.ts.map +1 -0
- package/dist/lib/full-window-overlay.js +16 -0
- package/dist/lib/full-window-overlay.js.map +1 -0
- package/dist/lib/panel-styles.d.ts +32 -0
- package/dist/lib/panel-styles.d.ts.map +1 -0
- package/dist/lib/panel-styles.js +96 -0
- package/dist/lib/panel-styles.js.map +1 -0
- package/dist/lib/text-input-styles.d.ts +36 -0
- package/dist/lib/text-input-styles.d.ts.map +1 -0
- package/dist/lib/text-input-styles.js +88 -0
- package/dist/lib/text-input-styles.js.map +1 -0
- package/dist/lib/theme-context.d.ts +80 -0
- package/dist/lib/theme-context.d.ts.map +1 -0
- package/dist/lib/theme-context.js +97 -0
- package/dist/lib/theme-context.js.map +1 -0
- package/dist/lib/theme-tokens.d.ts +222 -0
- package/dist/lib/theme-tokens.d.ts.map +1 -0
- package/dist/lib/theme-tokens.js +158 -0
- package/dist/lib/theme-tokens.js.map +1 -0
- package/dist/lib/theme.d.ts +40 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +194 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/types.d.ts +18 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/use-theme-tokens.d.ts +593 -0
- package/dist/lib/use-theme-tokens.d.ts.map +1 -0
- package/dist/lib/use-theme-tokens.js +44 -0
- package/dist/lib/use-theme-tokens.js.map +1 -0
- package/docs/llm/COLOR_SYSTEM.md +799 -0
- package/docs/llm/COMPONENTS.md +1329 -0
- package/docs/llm/DESIGN_PATTERNS.md +2567 -0
- package/docs/llm/README.md +118 -0
- package/docs/llm/TYPOGRAPHY.md +516 -0
- package/package.json +106 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Get padding and border radius for panel content based on size
|
|
4
|
+
*/
|
|
5
|
+
function getPanelSizeStyle(size) {
|
|
6
|
+
switch (size) {
|
|
7
|
+
case '1':
|
|
8
|
+
return { padding: 12, borderRadius: 8 }; // space-3, 8px
|
|
9
|
+
case '2':
|
|
10
|
+
return { padding: 16, borderRadius: 12 }; // space-4, 12px
|
|
11
|
+
case '3':
|
|
12
|
+
return { padding: 24, borderRadius: 16 }; // space-5, 16px
|
|
13
|
+
case '4':
|
|
14
|
+
return { padding: 32, borderRadius: 20 }; // space-6, 20px
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get backdrop filter style for translucent panels (web only)
|
|
19
|
+
*/
|
|
20
|
+
function getPanelBackdropStyle(variant, isDark) {
|
|
21
|
+
if (variant !== 'translucent' || Platform.OS !== 'web') {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const backdropFilter = isDark
|
|
25
|
+
? 'blur(20px) saturate(190%) contrast(90%) brightness(80%)'
|
|
26
|
+
: 'blur(20px) saturate(190%) contrast(50%) brightness(130%)';
|
|
27
|
+
return {
|
|
28
|
+
backdropFilter,
|
|
29
|
+
WebkitBackdropFilter: backdropFilter,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get shadow style for panel content
|
|
34
|
+
* Includes outline via boxShadow on web:
|
|
35
|
+
* - Light mode: 1px gray.a6 outline (no border)
|
|
36
|
+
* - Dark mode: 0.5px black outline (+ border)
|
|
37
|
+
*/
|
|
38
|
+
function getPanelShadowStyle(colors, isDark) {
|
|
39
|
+
const baseShadow = '0px 12px 60px rgba(0, 0, 0, 0.25), 0px 2px 8px rgba(0, 0, 0, 0.12)';
|
|
40
|
+
const outlineShadow = isDark
|
|
41
|
+
? `, 0 0 0 0.5px black`
|
|
42
|
+
: `, 0 0 0 1px ${colors.palettes.gray.a6}`;
|
|
43
|
+
return Platform.select({
|
|
44
|
+
web: {
|
|
45
|
+
boxShadow: baseShadow + outlineShadow,
|
|
46
|
+
},
|
|
47
|
+
default: {
|
|
48
|
+
shadowColor: '#000',
|
|
49
|
+
shadowOffset: { width: 0, height: 12 },
|
|
50
|
+
shadowOpacity: 0.25,
|
|
51
|
+
shadowRadius: 30,
|
|
52
|
+
elevation: 24,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get border style for panel content
|
|
58
|
+
* Dark mode has 1px gray.a6 border on all platforms
|
|
59
|
+
* Light mode: no border on web (uses boxShadow outline), border on native as fallback
|
|
60
|
+
*/
|
|
61
|
+
function getPanelBorderStyle(colors, isDark) {
|
|
62
|
+
if (isDark || Platform.OS !== 'web') {
|
|
63
|
+
return {
|
|
64
|
+
borderWidth: 1,
|
|
65
|
+
borderColor: colors.palettes.gray.a6,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get complete panel content style
|
|
72
|
+
*/
|
|
73
|
+
function getPanelContentStyle(options) {
|
|
74
|
+
const { size, variant, colors, isDark } = options;
|
|
75
|
+
const sizeStyle = getPanelSizeStyle(size);
|
|
76
|
+
// TODO: Handle translucent variant properly on native (iOS/Android) with blur effect
|
|
77
|
+
// For now, native always uses solid background since backdrop-filter is web-only
|
|
78
|
+
// and native blur requires additional setup (expo-blur or @react-native-community/blur)
|
|
79
|
+
const backgroundColor = Platform.OS === 'web' && variant === 'translucent'
|
|
80
|
+
? colors.panelTranslucent
|
|
81
|
+
: colors.panelSolid;
|
|
82
|
+
const backdropStyle = getPanelBackdropStyle(variant, isDark);
|
|
83
|
+
const shadowStyle = getPanelShadowStyle(colors, isDark);
|
|
84
|
+
const borderStyle = getPanelBorderStyle(colors, isDark);
|
|
85
|
+
return {
|
|
86
|
+
backgroundColor,
|
|
87
|
+
padding: sizeStyle.padding,
|
|
88
|
+
borderRadius: sizeStyle.borderRadius,
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
...shadowStyle,
|
|
91
|
+
...backdropStyle,
|
|
92
|
+
...borderStyle,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export { getPanelContentStyle, getPanelSizeStyle };
|
|
96
|
+
//# sourceMappingURL=panel-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-styles.js","sourceRoot":"","sources":["../../src/lib/panel-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,cAAc,CAAC;AAsBxD;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAe;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,GAAG;YACN,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,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+
import { useThemeTokens } from '../lib/use-theme-tokens';
|
|
3
|
+
import { type ViewStyle } from 'react-native';
|
|
4
|
+
export type TextInputSize = '1' | '2' | '3' | '4';
|
|
5
|
+
export type TextInputVariant = 'surface' | 'soft';
|
|
6
|
+
type PaletteKey = Color | 'accent' | 'gray';
|
|
7
|
+
/**
|
|
8
|
+
* Convert hex color to rgba with specified opacity
|
|
9
|
+
*/
|
|
10
|
+
export declare function hexToRgba(hex: string, opacity: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get background and border styles for surface variant
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSurfaceVariantStyle(colors: ReturnType<typeof useThemeTokens>['colors']): ViewStyle;
|
|
15
|
+
/**
|
|
16
|
+
* Get background style for soft variant
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSoftVariantStyle(colors: ReturnType<typeof useThemeTokens>['colors'], paletteKey: PaletteKey): ViewStyle;
|
|
19
|
+
/**
|
|
20
|
+
* Get text and placeholder colors based on variant
|
|
21
|
+
*/
|
|
22
|
+
export declare function getTextInputColors(variant: TextInputVariant, colors: ReturnType<typeof useThemeTokens>['colors'], paletteKey: PaletteKey, disabled?: boolean): {
|
|
23
|
+
textColor: string;
|
|
24
|
+
placeholderColor: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Get disabled background style for surface variant
|
|
28
|
+
* Uses gray-a3 overlay (simulated with opacity/background)
|
|
29
|
+
*/
|
|
30
|
+
export declare function getDisabledSurfaceStyle(colors: ReturnType<typeof useThemeTokens>['colors']): ViewStyle;
|
|
31
|
+
/**
|
|
32
|
+
* Get disabled background style for soft variant
|
|
33
|
+
*/
|
|
34
|
+
export declare function getDisabledSoftStyle(colors: ReturnType<typeof useThemeTokens>['colors']): ViewStyle;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=text-input-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input-styles.d.ts","sourceRoot":"","sources":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,QAAQ,CAAC,GAClD,SAAS,CAIX"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Convert hex color to rgba with specified opacity
|
|
4
|
+
*/
|
|
5
|
+
export function hexToRgba(hex, opacity) {
|
|
6
|
+
// Remove # if present
|
|
7
|
+
const cleanHex = hex.replace('#', '');
|
|
8
|
+
const r = parseInt(cleanHex.substring(0, 2), 16);
|
|
9
|
+
const g = parseInt(cleanHex.substring(2, 4), 16);
|
|
10
|
+
const b = parseInt(cleanHex.substring(4, 6), 16);
|
|
11
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
12
|
+
}
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Variant Styles
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Get background and border styles for surface variant
|
|
18
|
+
*/
|
|
19
|
+
export function getSurfaceVariantStyle(colors) {
|
|
20
|
+
return {
|
|
21
|
+
backgroundColor: colors.surface,
|
|
22
|
+
borderWidth: 1,
|
|
23
|
+
borderColor: colors.palettes.gray.a5,
|
|
24
|
+
...(Platform.OS === 'web'
|
|
25
|
+
? {
|
|
26
|
+
boxShadow: '0px 1px 2px 0px rgba(0, 0, 0, 0.05)',
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
shadowColor: '#000',
|
|
30
|
+
shadowOffset: { width: 0, height: 1 },
|
|
31
|
+
shadowOpacity: 0.05,
|
|
32
|
+
shadowRadius: 2,
|
|
33
|
+
elevation: 1,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get background style for soft variant
|
|
39
|
+
*/
|
|
40
|
+
export function getSoftVariantStyle(colors, paletteKey) {
|
|
41
|
+
return {
|
|
42
|
+
backgroundColor: colors.palettes[paletteKey].a3,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get text and placeholder colors based on variant
|
|
47
|
+
*/
|
|
48
|
+
export function getTextInputColors(variant, colors, paletteKey, disabled) {
|
|
49
|
+
const grayPalette = colors.palettes.gray;
|
|
50
|
+
const palette = colors.palettes[paletteKey];
|
|
51
|
+
// Disabled state: always use gray-a11 for text
|
|
52
|
+
// Placeholder uses gray-a5 (lighter alpha shade approximating gray-a11 at 0.5 opacity)
|
|
53
|
+
if (disabled) {
|
|
54
|
+
return {
|
|
55
|
+
textColor: grayPalette.a11,
|
|
56
|
+
placeholderColor: grayPalette.a5,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (variant === 'surface') {
|
|
60
|
+
return {
|
|
61
|
+
textColor: grayPalette['12'],
|
|
62
|
+
placeholderColor: grayPalette.a10,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Soft variant
|
|
66
|
+
return {
|
|
67
|
+
textColor: palette['12'],
|
|
68
|
+
placeholderColor: hexToRgba(palette['12'], 0.65), // TextArea uses 0.65, TextField uses 0.6
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get disabled background style for surface variant
|
|
73
|
+
* Uses gray-a3 overlay (simulated with opacity/background)
|
|
74
|
+
*/
|
|
75
|
+
export function getDisabledSurfaceStyle(colors) {
|
|
76
|
+
return {
|
|
77
|
+
backgroundColor: colors.palettes.gray.a3,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get disabled background style for soft variant
|
|
82
|
+
*/
|
|
83
|
+
export function getDisabledSoftStyle(colors) {
|
|
84
|
+
return {
|
|
85
|
+
backgroundColor: colors.palettes.gray.a4,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=text-input-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input-styles.js","sourceRoot":"","sources":["../../src/lib/text-input-styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAk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
+
type DangerColor = 'tomato' | 'red' | 'ruby';
|
|
5
|
+
type WarningColor = 'yellow' | 'amber';
|
|
6
|
+
type SuccessColor = 'teal' | 'jade' | 'green' | 'grass';
|
|
7
|
+
type InfoColor = 'blue' | 'sky';
|
|
8
|
+
type SemanticColorConfig = {
|
|
9
|
+
accentColor: AccentColor;
|
|
10
|
+
dangerColor: DangerColor;
|
|
11
|
+
warningColor: WarningColor;
|
|
12
|
+
successColor: SuccessColor;
|
|
13
|
+
infoColor: InfoColor;
|
|
14
|
+
};
|
|
15
|
+
declare const defaultSemanticColors: SemanticColorConfig;
|
|
16
|
+
type ThemeContextValue = {
|
|
17
|
+
colorScheme: ColorScheme;
|
|
18
|
+
setColorScheme: (scheme: ColorScheme) => void;
|
|
19
|
+
toggleColorScheme: () => void;
|
|
20
|
+
} & SemanticColorConfig;
|
|
21
|
+
declare const ThemeContext: React.Context<ThemeContextValue | undefined>;
|
|
22
|
+
type ThemeProviderProps = {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
/** Initial color scheme. Defaults to system preference. */
|
|
25
|
+
defaultColorScheme?: ColorScheme;
|
|
26
|
+
/** Accent color for primary actions and highlights. Defaults to 'blue'. */
|
|
27
|
+
accentColor?: AccentColor;
|
|
28
|
+
/** Color for danger/error states. Defaults to 'red'. */
|
|
29
|
+
dangerColor?: DangerColor;
|
|
30
|
+
/** Color for warning states. Defaults to 'amber'. */
|
|
31
|
+
warningColor?: WarningColor;
|
|
32
|
+
/** Color for success states. Defaults to 'green'. */
|
|
33
|
+
successColor?: SuccessColor;
|
|
34
|
+
/** Color for informational states. Defaults to 'sky'. */
|
|
35
|
+
infoColor?: InfoColor;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Provider for theme context that allows programmatic color scheme control
|
|
39
|
+
* and semantic color customization.
|
|
40
|
+
*
|
|
41
|
+
* Wrap your app with this provider to enable theme toggling and custom colors.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* function App() {
|
|
45
|
+
* return (
|
|
46
|
+
* <ThemeProvider
|
|
47
|
+
* accentColor="purple"
|
|
48
|
+
* dangerColor="tomato"
|
|
49
|
+
* warningColor="yellow"
|
|
50
|
+
* successColor="teal"
|
|
51
|
+
* infoColor="blue"
|
|
52
|
+
* >
|
|
53
|
+
* <YourApp />
|
|
54
|
+
* </ThemeProvider>
|
|
55
|
+
* );
|
|
56
|
+
* }
|
|
57
|
+
*/
|
|
58
|
+
declare function ThemeProvider({ children, defaultColorScheme, accentColor, dangerColor, warningColor, successColor, infoColor, }: ThemeProviderProps): React.JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* Hook to access and control the current color scheme.
|
|
61
|
+
* Must be used within a ThemeProvider.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const { colorScheme, toggleColorScheme, accentColor } = useTheme();
|
|
65
|
+
*/
|
|
66
|
+
declare function useTheme(): ThemeContextValue;
|
|
67
|
+
/**
|
|
68
|
+
* Internal hook to get the current color scheme.
|
|
69
|
+
* Checks ThemeContext first, falls back to system preference.
|
|
70
|
+
* Used by useThemeTokens.
|
|
71
|
+
*/
|
|
72
|
+
declare function useColorScheme(): ColorScheme;
|
|
73
|
+
/**
|
|
74
|
+
* Internal hook to get the semantic color configuration.
|
|
75
|
+
* Returns defaults if not within a ThemeProvider.
|
|
76
|
+
*/
|
|
77
|
+
declare function useSemanticColors(): SemanticColorConfig;
|
|
78
|
+
export { defaultSemanticColors, ThemeContext, ThemeProvider, useColorScheme, useSemanticColors, useTheme, };
|
|
79
|
+
export type { ColorScheme, DangerColor, InfoColor, SemanticColorConfig, SuccessColor, ThemeContextValue, ThemeProviderProps, WarningColor, };
|
|
80
|
+
//# sourceMappingURL=theme-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-context.d.ts","sourceRoot":"","sources":["../../src/lib/theme-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,C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AoBG;AACH,iBAAS,aAAa,CAAC,EACrB,QAAQ,EACR,kBAAkB,EAClB,WAA+C,EAC/C,WAA+C,EAC/C,YAAiD,EACjD,YAAiD,EACjD,SAA2C,GAC5C,EAAE,kBAAkB,qBAiCpB;AAED;;;;;;GAMG;AACH,iBAAS,QAAQ,IAAI,iBAAiB,CAMrC;AAED;;;;GAIG;AACH,iBAAS,cAAc,IAAI,WAAW,CAWrC;AAED;;;GAGG;AACH,iBAAS,iBAAiB,IAAI,mBAAmB,CAGhD;AAED,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,CAAC;AACF,YAAY,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useColorScheme as useSystemColorScheme } from 'react-native';
|
|
3
|
+
// Default semantic colors (matching web defaults)
|
|
4
|
+
const defaultSemanticColors = {
|
|
5
|
+
accentColor: 'blue',
|
|
6
|
+
dangerColor: 'red',
|
|
7
|
+
warningColor: 'amber',
|
|
8
|
+
successColor: 'green',
|
|
9
|
+
infoColor: 'sky',
|
|
10
|
+
};
|
|
11
|
+
const ThemeContext = React.createContext(undefined);
|
|
12
|
+
/**
|
|
13
|
+
* Provider for theme context that allows programmatic color scheme control
|
|
14
|
+
* and semantic color customization.
|
|
15
|
+
*
|
|
16
|
+
* Wrap your app with this provider to enable theme toggling and custom colors.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* function App() {
|
|
20
|
+
* return (
|
|
21
|
+
* <ThemeProvider
|
|
22
|
+
* accentColor="purple"
|
|
23
|
+
* dangerColor="tomato"
|
|
24
|
+
* warningColor="yellow"
|
|
25
|
+
* successColor="teal"
|
|
26
|
+
* infoColor="blue"
|
|
27
|
+
* >
|
|
28
|
+
* <YourApp />
|
|
29
|
+
* </ThemeProvider>
|
|
30
|
+
* );
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
function ThemeProvider({ children, defaultColorScheme, accentColor = defaultSemanticColors.accentColor, dangerColor = defaultSemanticColors.dangerColor, warningColor = defaultSemanticColors.warningColor, successColor = defaultSemanticColors.successColor, infoColor = defaultSemanticColors.infoColor, }) {
|
|
34
|
+
const systemColorScheme = useSystemColorScheme();
|
|
35
|
+
const [colorScheme, setColorScheme] = React.useState(defaultColorScheme ?? (systemColorScheme === 'dark' ? 'dark' : 'light'));
|
|
36
|
+
const toggleColorScheme = React.useCallback(() => {
|
|
37
|
+
setColorScheme((prev) => (prev === 'dark' ? 'light' : 'dark'));
|
|
38
|
+
}, []);
|
|
39
|
+
const value = React.useMemo(() => ({
|
|
40
|
+
colorScheme,
|
|
41
|
+
setColorScheme,
|
|
42
|
+
toggleColorScheme,
|
|
43
|
+
accentColor,
|
|
44
|
+
dangerColor,
|
|
45
|
+
warningColor,
|
|
46
|
+
successColor,
|
|
47
|
+
infoColor,
|
|
48
|
+
}), [
|
|
49
|
+
colorScheme,
|
|
50
|
+
toggleColorScheme,
|
|
51
|
+
accentColor,
|
|
52
|
+
dangerColor,
|
|
53
|
+
warningColor,
|
|
54
|
+
successColor,
|
|
55
|
+
infoColor,
|
|
56
|
+
]);
|
|
57
|
+
return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hook to access and control the current color scheme.
|
|
61
|
+
* Must be used within a ThemeProvider.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const { colorScheme, toggleColorScheme, accentColor } = useTheme();
|
|
65
|
+
*/
|
|
66
|
+
function useTheme() {
|
|
67
|
+
const context = React.useContext(ThemeContext);
|
|
68
|
+
if (!context) {
|
|
69
|
+
throw new Error('useTheme must be used within a ThemeProvider');
|
|
70
|
+
}
|
|
71
|
+
return context;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Internal hook to get the current color scheme.
|
|
75
|
+
* Checks ThemeContext first, falls back to system preference.
|
|
76
|
+
* Used by useThemeTokens.
|
|
77
|
+
*/
|
|
78
|
+
function useColorScheme() {
|
|
79
|
+
const context = React.useContext(ThemeContext);
|
|
80
|
+
const systemColorScheme = useSystemColorScheme();
|
|
81
|
+
// If ThemeProvider is used, respect the programmatic value
|
|
82
|
+
if (context) {
|
|
83
|
+
return context.colorScheme;
|
|
84
|
+
}
|
|
85
|
+
// Otherwise fall back to system preference
|
|
86
|
+
return systemColorScheme === 'dark' ? 'dark' : 'light';
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Internal hook to get the semantic color configuration.
|
|
90
|
+
* Returns defaults if not within a ThemeProvider.
|
|
91
|
+
*/
|
|
92
|
+
function useSemanticColors() {
|
|
93
|
+
const context = React.useContext(ThemeContext);
|
|
94
|
+
return context ?? defaultSemanticColors;
|
|
95
|
+
}
|
|
96
|
+
export { defaultSemanticColors, ThemeContext, ThemeProvider, useColorScheme, useSemanticColors, useTheme, };
|
|
97
|
+
//# sourceMappingURL=theme-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-context.js","sourceRoot":"","sources":["../../src/lib/theme-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAoBtE,kDAAkD;AAClD,MAAM,qBAAqB,GAAwB;IACjD,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,OAAO;IACrB,YAAY,EAAE,OAAO;IACrB,SAAS,EAAE,KAAK;CACjB,CAAC;AAQF,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAgC,SAAS,CAAC,CAAC;AAkBnF;;;;;;;;;;;;;;;;;;;;GAoBG;A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C,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc;IACrB,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/C,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,2DAA2D;IAC3D,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,WAAW,CAAC;IAC7B,CAAC;IAED,2CAA2C;IAC3C,OAAO,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/C,OAAO,OAAO,IAAI,qBAAqB,CAAC;AAC1C,CAAC;AAED,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
declare const typography: {
|
|
2
|
+
readonly '0': {
|
|
3
|
+
readonly fontSize: 10;
|
|
4
|
+
readonly lineHeight: 12;
|
|
5
|
+
readonly letterSpacing: 0.01;
|
|
6
|
+
};
|
|
7
|
+
readonly '1': {
|
|
8
|
+
readonly fontSize: 12;
|
|
9
|
+
readonly lineHeight: 16;
|
|
10
|
+
readonly letterSpacing: 0.01;
|
|
11
|
+
};
|
|
12
|
+
readonly '2': {
|
|
13
|
+
readonly fontSize: 14;
|
|
14
|
+
readonly lineHeight: 20;
|
|
15
|
+
readonly letterSpacing: 0.01;
|
|
16
|
+
};
|
|
17
|
+
readonly '3': {
|
|
18
|
+
readonly fontSize: 16;
|
|
19
|
+
readonly lineHeight: 24;
|
|
20
|
+
readonly letterSpacing: 0.01;
|
|
21
|
+
};
|
|
22
|
+
readonly '4': {
|
|
23
|
+
readonly fontSize: 18;
|
|
24
|
+
readonly lineHeight: 26;
|
|
25
|
+
readonly letterSpacing: 0.01;
|
|
26
|
+
};
|
|
27
|
+
readonly '5': {
|
|
28
|
+
readonly fontSize: 20;
|
|
29
|
+
readonly lineHeight: 28;
|
|
30
|
+
readonly letterSpacing: 0.01;
|
|
31
|
+
};
|
|
32
|
+
readonly '6': {
|
|
33
|
+
readonly fontSize: 24;
|
|
34
|
+
readonly lineHeight: 30;
|
|
35
|
+
readonly letterSpacing: 0.01;
|
|
36
|
+
};
|
|
37
|
+
readonly '7': {
|
|
38
|
+
readonly fontSize: 28;
|
|
39
|
+
readonly lineHeight: 34;
|
|
40
|
+
readonly letterSpacing: 0.005;
|
|
41
|
+
};
|
|
42
|
+
readonly '8': {
|
|
43
|
+
readonly fontSize: 32;
|
|
44
|
+
readonly lineHeight: 38;
|
|
45
|
+
readonly letterSpacing: 0;
|
|
46
|
+
};
|
|
47
|
+
readonly '9': {
|
|
48
|
+
readonly fontSize: 40;
|
|
49
|
+
readonly lineHeight: 48;
|
|
50
|
+
readonly letterSpacing: 0;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type TypographyStepKey = keyof typeof typography;
|
|
54
|
+
declare const fontWeights: {
|
|
55
|
+
readonly light: "300";
|
|
56
|
+
readonly regular: "400";
|
|
57
|
+
readonly medium: "500";
|
|
58
|
+
readonly 'semi-bold': "600";
|
|
59
|
+
readonly bold: "700";
|
|
60
|
+
};
|
|
61
|
+
type FontWeightKey = keyof typeof fontWeights;
|
|
62
|
+
type ShadeKey = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
63
|
+
type AlphaShadeKey = 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6' | 'a7' | 'a8' | 'a9' | 'a10' | 'a11' | 'a12';
|
|
64
|
+
type ColorShades = {
|
|
65
|
+
[K in ShadeKey]: string;
|
|
66
|
+
} & {
|
|
67
|
+
'9-contrast': string;
|
|
68
|
+
} & {
|
|
69
|
+
[K in AlphaShadeKey]: string;
|
|
70
|
+
};
|
|
71
|
+
type AlphaOnlyShades = {
|
|
72
|
+
[K in AlphaShadeKey]: string;
|
|
73
|
+
};
|
|
74
|
+
export declare function blackAndWhitePalettes(): {
|
|
75
|
+
black: AlphaOnlyShades;
|
|
76
|
+
white: AlphaOnlyShades;
|
|
77
|
+
};
|
|
78
|
+
export declare const themeTokens: {
|
|
79
|
+
typography: {
|
|
80
|
+
readonly '0': {
|
|
81
|
+
readonly fontSize: 10;
|
|
82
|
+
readonly lineHeight: 12;
|
|
83
|
+
readonly letterSpacing: 0.01;
|
|
84
|
+
};
|
|
85
|
+
readonly '1': {
|
|
86
|
+
readonly fontSize: 12;
|
|
87
|
+
readonly lineHeight: 16;
|
|
88
|
+
readonly letterSpacing: 0.01;
|
|
89
|
+
};
|
|
90
|
+
readonly '2': {
|
|
91
|
+
readonly fontSize: 14;
|
|
92
|
+
readonly lineHeight: 20;
|
|
93
|
+
readonly letterSpacing: 0.01;
|
|
94
|
+
};
|
|
95
|
+
readonly '3': {
|
|
96
|
+
readonly fontSize: 16;
|
|
97
|
+
readonly lineHeight: 24;
|
|
98
|
+
readonly letterSpacing: 0.01;
|
|
99
|
+
};
|
|
100
|
+
readonly '4': {
|
|
101
|
+
readonly fontSize: 18;
|
|
102
|
+
readonly lineHeight: 26;
|
|
103
|
+
readonly letterSpacing: 0.01;
|
|
104
|
+
};
|
|
105
|
+
readonly '5': {
|
|
106
|
+
readonly fontSize: 20;
|
|
107
|
+
readonly lineHeight: 28;
|
|
108
|
+
readonly letterSpacing: 0.01;
|
|
109
|
+
};
|
|
110
|
+
readonly '6': {
|
|
111
|
+
readonly fontSize: 24;
|
|
112
|
+
readonly lineHeight: 30;
|
|
113
|
+
readonly letterSpacing: 0.01;
|
|
114
|
+
};
|
|
115
|
+
readonly '7': {
|
|
116
|
+
readonly fontSize: 28;
|
|
117
|
+
readonly lineHeight: 34;
|
|
118
|
+
readonly letterSpacing: 0.005;
|
|
119
|
+
};
|
|
120
|
+
readonly '8': {
|
|
121
|
+
readonly fontSize: 32;
|
|
122
|
+
readonly lineHeight: 38;
|
|
123
|
+
readonly letterSpacing: 0;
|
|
124
|
+
};
|
|
125
|
+
readonly '9': {
|
|
126
|
+
readonly fontSize: 40;
|
|
127
|
+
readonly lineHeight: 48;
|
|
128
|
+
readonly letterSpacing: 0;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
fontWeights: {
|
|
132
|
+
readonly light: "300";
|
|
133
|
+
readonly regular: "400";
|
|
134
|
+
readonly medium: "500";
|
|
135
|
+
readonly 'semi-bold': "600";
|
|
136
|
+
readonly bold: "700";
|
|
137
|
+
};
|
|
138
|
+
colors: {
|
|
139
|
+
light: {
|
|
140
|
+
palettes: {
|
|
141
|
+
black: AlphaOnlyShades;
|
|
142
|
+
white: AlphaOnlyShades;
|
|
143
|
+
tomato: ColorShades;
|
|
144
|
+
red: ColorShades;
|
|
145
|
+
ruby: ColorShades;
|
|
146
|
+
crimson: ColorShades;
|
|
147
|
+
pink: ColorShades;
|
|
148
|
+
plum: ColorShades;
|
|
149
|
+
purple: ColorShades;
|
|
150
|
+
violet: ColorShades;
|
|
151
|
+
iris: ColorShades;
|
|
152
|
+
cyan: ColorShades;
|
|
153
|
+
teal: ColorShades;
|
|
154
|
+
jade: ColorShades;
|
|
155
|
+
green: ColorShades;
|
|
156
|
+
grass: ColorShades;
|
|
157
|
+
brown: ColorShades;
|
|
158
|
+
blue: ColorShades;
|
|
159
|
+
orange: ColorShades;
|
|
160
|
+
indigo: ColorShades;
|
|
161
|
+
sky: ColorShades;
|
|
162
|
+
mint: ColorShades;
|
|
163
|
+
yellow: ColorShades;
|
|
164
|
+
amber: ColorShades;
|
|
165
|
+
lime: ColorShades;
|
|
166
|
+
lemon: ColorShades;
|
|
167
|
+
magenta: ColorShades;
|
|
168
|
+
gold: ColorShades;
|
|
169
|
+
bronze: ColorShades;
|
|
170
|
+
gray: ColorShades;
|
|
171
|
+
};
|
|
172
|
+
background: string;
|
|
173
|
+
overlay: string;
|
|
174
|
+
panelSolid: string;
|
|
175
|
+
panelTranslucent: string;
|
|
176
|
+
surface: string;
|
|
177
|
+
stroke: string;
|
|
178
|
+
};
|
|
179
|
+
dark: {
|
|
180
|
+
palettes: {
|
|
181
|
+
black: AlphaOnlyShades;
|
|
182
|
+
white: AlphaOnlyShades;
|
|
183
|
+
tomato: ColorShades;
|
|
184
|
+
red: ColorShades;
|
|
185
|
+
ruby: ColorShades;
|
|
186
|
+
crimson: ColorShades;
|
|
187
|
+
pink: ColorShades;
|
|
188
|
+
plum: ColorShades;
|
|
189
|
+
purple: ColorShades;
|
|
190
|
+
violet: ColorShades;
|
|
191
|
+
iris: ColorShades;
|
|
192
|
+
cyan: ColorShades;
|
|
193
|
+
teal: ColorShades;
|
|
194
|
+
jade: ColorShades;
|
|
195
|
+
green: ColorShades;
|
|
196
|
+
grass: ColorShades;
|
|
197
|
+
brown: ColorShades;
|
|
198
|
+
blue: ColorShades;
|
|
199
|
+
orange: ColorShades;
|
|
200
|
+
indigo: ColorShades;
|
|
201
|
+
sky: ColorShades;
|
|
202
|
+
mint: ColorShades;
|
|
203
|
+
yellow: ColorShades;
|
|
204
|
+
amber: ColorShades;
|
|
205
|
+
lime: ColorShades;
|
|
206
|
+
lemon: ColorShades;
|
|
207
|
+
magenta: ColorShades;
|
|
208
|
+
gold: ColorShades;
|
|
209
|
+
bronze: ColorShades;
|
|
210
|
+
gray: ColorShades;
|
|
211
|
+
};
|
|
212
|
+
background: string;
|
|
213
|
+
overlay: string;
|
|
214
|
+
panelSolid: string;
|
|
215
|
+
panelTranslucent: string;
|
|
216
|
+
surface: string;
|
|
217
|
+
stroke: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export type { ColorShades, FontWeight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