@dangerousthings/react-native 0.1.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/dist/components/DTAccordion.d.ts +75 -0
- package/dist/components/DTAccordion.d.ts.map +1 -0
- package/dist/components/DTAccordion.js +147 -0
- package/dist/components/DTAccordion.js.map +1 -0
- package/dist/components/DTButton.d.ts +68 -0
- package/dist/components/DTButton.d.ts.map +1 -0
- package/dist/components/DTButton.js +59 -0
- package/dist/components/DTButton.js.map +1 -0
- package/dist/components/DTCard.d.ts +97 -0
- package/dist/components/DTCard.d.ts.map +1 -0
- package/dist/components/DTCard.js +81 -0
- package/dist/components/DTCard.js.map +1 -0
- package/dist/components/DTCheckbox.d.ts +63 -0
- package/dist/components/DTCheckbox.d.ts.map +1 -0
- package/dist/components/DTCheckbox.js +55 -0
- package/dist/components/DTCheckbox.js.map +1 -0
- package/dist/components/DTChip.d.ts +40 -0
- package/dist/components/DTChip.d.ts.map +1 -0
- package/dist/components/DTChip.js +55 -0
- package/dist/components/DTChip.js.map +1 -0
- package/dist/components/DTDrawer.d.ts +82 -0
- package/dist/components/DTDrawer.d.ts.map +1 -0
- package/dist/components/DTDrawer.js +146 -0
- package/dist/components/DTDrawer.js.map +1 -0
- package/dist/components/DTGallery.d.ts +83 -0
- package/dist/components/DTGallery.d.ts.map +1 -0
- package/dist/components/DTGallery.js +160 -0
- package/dist/components/DTGallery.js.map +1 -0
- package/dist/components/DTHexagon.d.ts +81 -0
- package/dist/components/DTHexagon.d.ts.map +1 -0
- package/dist/components/DTHexagon.js +110 -0
- package/dist/components/DTHexagon.js.map +1 -0
- package/dist/components/DTLabel.d.ts +100 -0
- package/dist/components/DTLabel.d.ts.map +1 -0
- package/dist/components/DTLabel.js +189 -0
- package/dist/components/DTLabel.js.map +1 -0
- package/dist/components/DTMediaFrame.d.ts +77 -0
- package/dist/components/DTMediaFrame.d.ts.map +1 -0
- package/dist/components/DTMediaFrame.js +84 -0
- package/dist/components/DTMediaFrame.js.map +1 -0
- package/dist/components/DTMenu.d.ts +119 -0
- package/dist/components/DTMenu.d.ts.map +1 -0
- package/dist/components/DTMenu.js +188 -0
- package/dist/components/DTMenu.js.map +1 -0
- package/dist/components/DTModal.d.ts +64 -0
- package/dist/components/DTModal.d.ts.map +1 -0
- package/dist/components/DTModal.js +45 -0
- package/dist/components/DTModal.js.map +1 -0
- package/dist/components/DTProgressBar.d.ts +66 -0
- package/dist/components/DTProgressBar.d.ts.map +1 -0
- package/dist/components/DTProgressBar.js +82 -0
- package/dist/components/DTProgressBar.js.map +1 -0
- package/dist/components/DTQuantityStepper.d.ts +76 -0
- package/dist/components/DTQuantityStepper.d.ts.map +1 -0
- package/dist/components/DTQuantityStepper.js +108 -0
- package/dist/components/DTQuantityStepper.js.map +1 -0
- package/dist/components/DTRadioGroup.d.ts +79 -0
- package/dist/components/DTRadioGroup.d.ts.map +1 -0
- package/dist/components/DTRadioGroup.js +107 -0
- package/dist/components/DTRadioGroup.js.map +1 -0
- package/dist/components/DTSearchInput.d.ts +72 -0
- package/dist/components/DTSearchInput.d.ts.map +1 -0
- package/dist/components/DTSearchInput.js +71 -0
- package/dist/components/DTSearchInput.js.map +1 -0
- package/dist/components/DTSwitch.d.ts +52 -0
- package/dist/components/DTSwitch.d.ts.map +1 -0
- package/dist/components/DTSwitch.js +85 -0
- package/dist/components/DTSwitch.js.map +1 -0
- package/dist/components/DTTextInput.d.ts +58 -0
- package/dist/components/DTTextInput.d.ts.map +1 -0
- package/dist/components/DTTextInput.js +85 -0
- package/dist/components/DTTextInput.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/DTThemeProvider.d.ts +49 -0
- package/dist/theme/DTThemeProvider.d.ts.map +1 -0
- package/dist/theme/DTThemeProvider.js +52 -0
- package/dist/theme/DTThemeProvider.js.map +1 -0
- package/dist/theme/colors.d.ts +42 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +59 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/paperTheme.d.ts +39 -0
- package/dist/theme/paperTheme.d.ts.map +1 -0
- package/dist/theme/paperTheme.js +116 -0
- package/dist/theme/paperTheme.js.map +1 -0
- package/dist/theme/typography.d.ts +57 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/typography.js +170 -0
- package/dist/theme/typography.js.map +1 -0
- package/dist/utils/bevelPaths.d.ts +42 -0
- package/dist/utils/bevelPaths.d.ts.map +1 -0
- package/dist/utils/bevelPaths.js +105 -0
- package/dist/utils/bevelPaths.js.map +1 -0
- package/dist/utils/useComponentLayout.d.ts +18 -0
- package/dist/utils/useComponentLayout.d.ts.map +1 -0
- package/dist/utils/useComponentLayout.js +24 -0
- package/dist/utils/useComponentLayout.js.map +1 -0
- package/dist/utils/variantColors.d.ts +12 -0
- package/dist/utils/variantColors.d.ts.map +1 -0
- package/dist/utils/variantColors.js +20 -0
- package/dist/utils/variantColors.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native Paper MD3 Theme Configuration
|
|
3
|
+
*
|
|
4
|
+
* This creates a Material Design 3 compliant theme that follows
|
|
5
|
+
* the Dangerous Things cyberpunk aesthetic while respecting
|
|
6
|
+
* React Native Paper's design principles.
|
|
7
|
+
*/
|
|
8
|
+
import { MD3Theme } from 'react-native-paper';
|
|
9
|
+
/**
|
|
10
|
+
* Dangerous Things Dark Theme
|
|
11
|
+
*
|
|
12
|
+
* Based on MD3DarkTheme with cyberpunk color overrides.
|
|
13
|
+
* Primary = Cyan, Secondary = Yellow (following DT brand)
|
|
14
|
+
*/
|
|
15
|
+
export declare const DTDarkTheme: MD3Theme;
|
|
16
|
+
/**
|
|
17
|
+
* Extended theme with DT-specific custom properties
|
|
18
|
+
* Use this when you need access to non-MD3 colors
|
|
19
|
+
*/
|
|
20
|
+
export interface DTExtendedTheme extends MD3Theme {
|
|
21
|
+
custom: {
|
|
22
|
+
success: string;
|
|
23
|
+
warning: string;
|
|
24
|
+
modeNormal: string;
|
|
25
|
+
modeEmphasis: string;
|
|
26
|
+
modeWarning: string;
|
|
27
|
+
modeSuccess: string;
|
|
28
|
+
modeOther: string;
|
|
29
|
+
border: string;
|
|
30
|
+
borderEmphasis: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare const DTExtendedDarkTheme: DTExtendedTheme;
|
|
34
|
+
/**
|
|
35
|
+
* Hook to access extended theme properties
|
|
36
|
+
* Usage: const { custom } = useDTTheme();
|
|
37
|
+
*/
|
|
38
|
+
export { useTheme as usePaperTheme } from 'react-native-paper';
|
|
39
|
+
//# sourceMappingURL=paperTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperTheme.d.ts","sourceRoot":"","sources":["../../src/theme/paperTheme.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAgB,QAAQ,EAAkB,MAAM,oBAAoB,CAAC;AA2B5E;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,QAoEzB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,EAAE,eAajC,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native Paper MD3 Theme Configuration
|
|
3
|
+
*
|
|
4
|
+
* This creates a Material Design 3 compliant theme that follows
|
|
5
|
+
* the Dangerous Things cyberpunk aesthetic while respecting
|
|
6
|
+
* React Native Paper's design principles.
|
|
7
|
+
*/
|
|
8
|
+
import { MD3DarkTheme, configureFonts } from 'react-native-paper';
|
|
9
|
+
import { DTColors } from './colors';
|
|
10
|
+
import { DTTypography, DTFonts } from './typography';
|
|
11
|
+
/**
|
|
12
|
+
* MD3 Font configuration for React Native Paper
|
|
13
|
+
* Maps our typography to RNP's expected font config
|
|
14
|
+
*/
|
|
15
|
+
const fontConfig = {
|
|
16
|
+
fontFamily: DTFonts.regular,
|
|
17
|
+
displayLarge: DTTypography.displayLarge,
|
|
18
|
+
displayMedium: DTTypography.displayMedium,
|
|
19
|
+
displaySmall: DTTypography.displaySmall,
|
|
20
|
+
headlineLarge: DTTypography.headlineLarge,
|
|
21
|
+
headlineMedium: DTTypography.headlineMedium,
|
|
22
|
+
headlineSmall: DTTypography.headlineSmall,
|
|
23
|
+
titleLarge: DTTypography.titleLarge,
|
|
24
|
+
titleMedium: DTTypography.titleMedium,
|
|
25
|
+
titleSmall: DTTypography.titleSmall,
|
|
26
|
+
bodyLarge: DTTypography.bodyLarge,
|
|
27
|
+
bodyMedium: DTTypography.bodyMedium,
|
|
28
|
+
bodySmall: DTTypography.bodySmall,
|
|
29
|
+
labelLarge: DTTypography.labelLarge,
|
|
30
|
+
labelMedium: DTTypography.labelMedium,
|
|
31
|
+
labelSmall: DTTypography.labelSmall,
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Dangerous Things Dark Theme
|
|
35
|
+
*
|
|
36
|
+
* Based on MD3DarkTheme with cyberpunk color overrides.
|
|
37
|
+
* Primary = Cyan, Secondary = Yellow (following DT brand)
|
|
38
|
+
*/
|
|
39
|
+
export const DTDarkTheme = {
|
|
40
|
+
...MD3DarkTheme,
|
|
41
|
+
dark: true,
|
|
42
|
+
roundness: 4, // Slightly rounded, but we use custom clip-path for bevels
|
|
43
|
+
fonts: configureFonts({ config: fontConfig }),
|
|
44
|
+
colors: {
|
|
45
|
+
...MD3DarkTheme.colors,
|
|
46
|
+
// Primary (Cyan)
|
|
47
|
+
primary: DTColors.modeNormal,
|
|
48
|
+
onPrimary: DTColors.dark,
|
|
49
|
+
primaryContainer: DTColors.modeNormalSelected,
|
|
50
|
+
onPrimaryContainer: DTColors.dark,
|
|
51
|
+
// Secondary (Yellow)
|
|
52
|
+
secondary: DTColors.modeEmphasis,
|
|
53
|
+
onSecondary: DTColors.dark,
|
|
54
|
+
secondaryContainer: DTColors.modeEmphasisSelected,
|
|
55
|
+
onSecondaryContainer: DTColors.dark,
|
|
56
|
+
// Tertiary (Magenta)
|
|
57
|
+
tertiary: DTColors.modeOther,
|
|
58
|
+
onTertiary: DTColors.dark,
|
|
59
|
+
tertiaryContainer: 'rgba(255, 0, 255, 0.3)',
|
|
60
|
+
onTertiaryContainer: DTColors.light,
|
|
61
|
+
// Error (Red)
|
|
62
|
+
error: DTColors.modeWarning,
|
|
63
|
+
onError: DTColors.dark,
|
|
64
|
+
errorContainer: 'rgba(255, 0, 0, 0.3)',
|
|
65
|
+
onErrorContainer: DTColors.light,
|
|
66
|
+
// Background & Surface
|
|
67
|
+
background: DTColors.background,
|
|
68
|
+
onBackground: DTColors.onBackground,
|
|
69
|
+
surface: DTColors.surface,
|
|
70
|
+
onSurface: DTColors.onSurface,
|
|
71
|
+
surfaceVariant: DTColors.surfaceVariant,
|
|
72
|
+
onSurfaceVariant: DTColors.light,
|
|
73
|
+
// Surface elevation (MD3 uses tonal elevation)
|
|
74
|
+
elevation: {
|
|
75
|
+
level0: 'transparent',
|
|
76
|
+
level1: DTColors.surfaceVariant,
|
|
77
|
+
level2: '#0a0a0a',
|
|
78
|
+
level3: '#0f0f0f',
|
|
79
|
+
level4: '#121212',
|
|
80
|
+
level5: '#151515',
|
|
81
|
+
},
|
|
82
|
+
// Outline (borders)
|
|
83
|
+
outline: DTColors.modeNormal,
|
|
84
|
+
outlineVariant: 'rgba(0, 255, 255, 0.5)',
|
|
85
|
+
// Inverse (for snackbars, etc.)
|
|
86
|
+
inverseSurface: DTColors.light,
|
|
87
|
+
inverseOnSurface: DTColors.dark,
|
|
88
|
+
inversePrimary: '#008B8B', // Darker cyan for light backgrounds
|
|
89
|
+
// Misc
|
|
90
|
+
shadow: DTColors.dark,
|
|
91
|
+
scrim: DTColors.overlay,
|
|
92
|
+
surfaceDisabled: DTColors.disabledBackground,
|
|
93
|
+
onSurfaceDisabled: DTColors.disabled,
|
|
94
|
+
backdrop: DTColors.overlay,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
export const DTExtendedDarkTheme = {
|
|
98
|
+
...DTDarkTheme,
|
|
99
|
+
custom: {
|
|
100
|
+
success: DTColors.modeSuccess,
|
|
101
|
+
warning: DTColors.modeWarning,
|
|
102
|
+
modeNormal: DTColors.modeNormal,
|
|
103
|
+
modeEmphasis: DTColors.modeEmphasis,
|
|
104
|
+
modeWarning: DTColors.modeWarning,
|
|
105
|
+
modeSuccess: DTColors.modeSuccess,
|
|
106
|
+
modeOther: DTColors.modeOther,
|
|
107
|
+
border: DTColors.border,
|
|
108
|
+
borderEmphasis: DTColors.borderEmphasis,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Hook to access extended theme properties
|
|
113
|
+
* Usage: const { custom } = useDTTheme();
|
|
114
|
+
*/
|
|
115
|
+
export { useTheme as usePaperTheme } from 'react-native-paper';
|
|
116
|
+
//# sourceMappingURL=paperTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paperTheme.js","sourceRoot":"","sources":["../../src/theme/paperTheme.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5E,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QACpC,QAAQ,EAAE,QAAQ,CAAC,OAAO;KAC3B;CACF,CAAC;AAoBF,MAAM,CAAC,MAAM,mBAAmB,GAAoB;IAClD,GAAG,WAAW;IACd,MAAM,EAAE;QACN,OAAO,EAAE,QAAQ,CAAC,WAAW;QAC7B,OAAO,EAAE,QAAQ,CAAC,WAAW;QAC7B,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,cAAc,EAAE,QAAQ,CAAC,cAAc;KACxC;CACF,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dangerous Things Typography
|
|
3
|
+
*
|
|
4
|
+
* Primary font: Tektur (variable font)
|
|
5
|
+
* Fallback: System default sans-serif
|
|
6
|
+
*
|
|
7
|
+
* Note: To use Tektur, you must:
|
|
8
|
+
* 1. Download Tektur from Google Fonts
|
|
9
|
+
* 2. Add to your project's assets/fonts/
|
|
10
|
+
* 3. Link fonts in react-native.config.js or use expo-font
|
|
11
|
+
*/
|
|
12
|
+
import { TextStyle } from 'react-native';
|
|
13
|
+
/**
|
|
14
|
+
* Font family configuration
|
|
15
|
+
* Tektur is a variable font with weights 100-900
|
|
16
|
+
*/
|
|
17
|
+
export declare const DTFonts: {
|
|
18
|
+
readonly regular: string;
|
|
19
|
+
readonly medium: string;
|
|
20
|
+
readonly bold: string;
|
|
21
|
+
readonly fallback: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Font weights for variable font
|
|
25
|
+
*/
|
|
26
|
+
export declare const DTFontWeights: {
|
|
27
|
+
thin: "100";
|
|
28
|
+
light: "300";
|
|
29
|
+
regular: "400";
|
|
30
|
+
medium: "500";
|
|
31
|
+
semibold: "600";
|
|
32
|
+
bold: "700";
|
|
33
|
+
extrabold: "800";
|
|
34
|
+
black: "900";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Typography scale following Material Design 3 naming
|
|
38
|
+
*/
|
|
39
|
+
export declare const DTTypography: {
|
|
40
|
+
readonly displayLarge: TextStyle;
|
|
41
|
+
readonly displayMedium: TextStyle;
|
|
42
|
+
readonly displaySmall: TextStyle;
|
|
43
|
+
readonly headlineLarge: TextStyle;
|
|
44
|
+
readonly headlineMedium: TextStyle;
|
|
45
|
+
readonly headlineSmall: TextStyle;
|
|
46
|
+
readonly titleLarge: TextStyle;
|
|
47
|
+
readonly titleMedium: TextStyle;
|
|
48
|
+
readonly titleSmall: TextStyle;
|
|
49
|
+
readonly bodyLarge: TextStyle;
|
|
50
|
+
readonly bodyMedium: TextStyle;
|
|
51
|
+
readonly bodySmall: TextStyle;
|
|
52
|
+
readonly labelLarge: TextStyle;
|
|
53
|
+
readonly labelMedium: TextStyle;
|
|
54
|
+
readonly labelSmall: TextStyle;
|
|
55
|
+
};
|
|
56
|
+
export type DTTypographyKey = keyof typeof DTTypography;
|
|
57
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;CAsBV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;CASzB,CAAC;AAWF;;GAEG;AACH,eAAO,MAAM,YAAY;2BAQlB,SAAS;4BAOT,SAAS;2BAOT,SAAS;4BAQT,SAAS;6BAOT,SAAS;4BAOT,SAAS;yBAQT,SAAS;0BAQT,SAAS;yBAQT,SAAS;wBAST,SAAS;yBAQT,SAAS;wBAQT,SAAS;yBAST,SAAS;0BAQT,SAAS;yBAQT,SAAS;CACN,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dangerous Things Typography
|
|
3
|
+
*
|
|
4
|
+
* Primary font: Tektur (variable font)
|
|
5
|
+
* Fallback: System default sans-serif
|
|
6
|
+
*
|
|
7
|
+
* Note: To use Tektur, you must:
|
|
8
|
+
* 1. Download Tektur from Google Fonts
|
|
9
|
+
* 2. Add to your project's assets/fonts/
|
|
10
|
+
* 3. Link fonts in react-native.config.js or use expo-font
|
|
11
|
+
*/
|
|
12
|
+
import { Platform } from 'react-native';
|
|
13
|
+
/**
|
|
14
|
+
* Font family configuration
|
|
15
|
+
* Tektur is a variable font with weights 100-900
|
|
16
|
+
*/
|
|
17
|
+
export const DTFonts = {
|
|
18
|
+
regular: Platform.select({
|
|
19
|
+
ios: 'Tektur',
|
|
20
|
+
android: 'Tektur-Regular',
|
|
21
|
+
default: 'Tektur',
|
|
22
|
+
}),
|
|
23
|
+
medium: Platform.select({
|
|
24
|
+
ios: 'Tektur',
|
|
25
|
+
android: 'Tektur-Medium',
|
|
26
|
+
default: 'Tektur',
|
|
27
|
+
}),
|
|
28
|
+
bold: Platform.select({
|
|
29
|
+
ios: 'Tektur',
|
|
30
|
+
android: 'Tektur-Bold',
|
|
31
|
+
default: 'Tektur',
|
|
32
|
+
}),
|
|
33
|
+
// Fallback when Tektur is not available
|
|
34
|
+
fallback: Platform.select({
|
|
35
|
+
ios: 'System',
|
|
36
|
+
android: 'sans-serif',
|
|
37
|
+
default: 'sans-serif',
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Font weights for variable font
|
|
42
|
+
*/
|
|
43
|
+
export const DTFontWeights = {
|
|
44
|
+
thin: '100',
|
|
45
|
+
light: '300',
|
|
46
|
+
regular: '400',
|
|
47
|
+
medium: '500',
|
|
48
|
+
semibold: '600',
|
|
49
|
+
bold: '700',
|
|
50
|
+
extrabold: '800',
|
|
51
|
+
black: '900',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Base text styles
|
|
55
|
+
*/
|
|
56
|
+
const baseTextStyle = {
|
|
57
|
+
fontFamily: DTFonts.regular,
|
|
58
|
+
color: '#FFFFFF',
|
|
59
|
+
letterSpacing: 0.5,
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Typography scale following Material Design 3 naming
|
|
63
|
+
*/
|
|
64
|
+
export const DTTypography = {
|
|
65
|
+
// Display styles (large headlines)
|
|
66
|
+
displayLarge: {
|
|
67
|
+
...baseTextStyle,
|
|
68
|
+
fontSize: 57,
|
|
69
|
+
fontWeight: DTFontWeights.bold,
|
|
70
|
+
lineHeight: 64,
|
|
71
|
+
letterSpacing: -0.25,
|
|
72
|
+
},
|
|
73
|
+
displayMedium: {
|
|
74
|
+
...baseTextStyle,
|
|
75
|
+
fontSize: 45,
|
|
76
|
+
fontWeight: DTFontWeights.bold,
|
|
77
|
+
lineHeight: 52,
|
|
78
|
+
},
|
|
79
|
+
displaySmall: {
|
|
80
|
+
...baseTextStyle,
|
|
81
|
+
fontSize: 36,
|
|
82
|
+
fontWeight: DTFontWeights.bold,
|
|
83
|
+
lineHeight: 44,
|
|
84
|
+
},
|
|
85
|
+
// Headline styles
|
|
86
|
+
headlineLarge: {
|
|
87
|
+
...baseTextStyle,
|
|
88
|
+
fontSize: 32,
|
|
89
|
+
fontWeight: DTFontWeights.semibold,
|
|
90
|
+
lineHeight: 40,
|
|
91
|
+
},
|
|
92
|
+
headlineMedium: {
|
|
93
|
+
...baseTextStyle,
|
|
94
|
+
fontSize: 28,
|
|
95
|
+
fontWeight: DTFontWeights.semibold,
|
|
96
|
+
lineHeight: 36,
|
|
97
|
+
},
|
|
98
|
+
headlineSmall: {
|
|
99
|
+
...baseTextStyle,
|
|
100
|
+
fontSize: 24,
|
|
101
|
+
fontWeight: DTFontWeights.semibold,
|
|
102
|
+
lineHeight: 32,
|
|
103
|
+
},
|
|
104
|
+
// Title styles
|
|
105
|
+
titleLarge: {
|
|
106
|
+
...baseTextStyle,
|
|
107
|
+
fontSize: 22,
|
|
108
|
+
fontWeight: DTFontWeights.medium,
|
|
109
|
+
lineHeight: 28,
|
|
110
|
+
},
|
|
111
|
+
titleMedium: {
|
|
112
|
+
...baseTextStyle,
|
|
113
|
+
fontSize: 16,
|
|
114
|
+
fontWeight: DTFontWeights.medium,
|
|
115
|
+
lineHeight: 24,
|
|
116
|
+
letterSpacing: 0.15,
|
|
117
|
+
},
|
|
118
|
+
titleSmall: {
|
|
119
|
+
...baseTextStyle,
|
|
120
|
+
fontSize: 14,
|
|
121
|
+
fontWeight: DTFontWeights.medium,
|
|
122
|
+
lineHeight: 20,
|
|
123
|
+
letterSpacing: 0.1,
|
|
124
|
+
},
|
|
125
|
+
// Body styles
|
|
126
|
+
bodyLarge: {
|
|
127
|
+
...baseTextStyle,
|
|
128
|
+
fontSize: 16,
|
|
129
|
+
fontWeight: DTFontWeights.regular,
|
|
130
|
+
lineHeight: 24,
|
|
131
|
+
letterSpacing: 0.5,
|
|
132
|
+
},
|
|
133
|
+
bodyMedium: {
|
|
134
|
+
...baseTextStyle,
|
|
135
|
+
fontSize: 14,
|
|
136
|
+
fontWeight: DTFontWeights.regular,
|
|
137
|
+
lineHeight: 20,
|
|
138
|
+
letterSpacing: 0.25,
|
|
139
|
+
},
|
|
140
|
+
bodySmall: {
|
|
141
|
+
...baseTextStyle,
|
|
142
|
+
fontSize: 12,
|
|
143
|
+
fontWeight: DTFontWeights.regular,
|
|
144
|
+
lineHeight: 16,
|
|
145
|
+
letterSpacing: 0.4,
|
|
146
|
+
},
|
|
147
|
+
// Label styles
|
|
148
|
+
labelLarge: {
|
|
149
|
+
...baseTextStyle,
|
|
150
|
+
fontSize: 14,
|
|
151
|
+
fontWeight: DTFontWeights.medium,
|
|
152
|
+
lineHeight: 20,
|
|
153
|
+
letterSpacing: 0.1,
|
|
154
|
+
},
|
|
155
|
+
labelMedium: {
|
|
156
|
+
...baseTextStyle,
|
|
157
|
+
fontSize: 12,
|
|
158
|
+
fontWeight: DTFontWeights.medium,
|
|
159
|
+
lineHeight: 16,
|
|
160
|
+
letterSpacing: 0.5,
|
|
161
|
+
},
|
|
162
|
+
labelSmall: {
|
|
163
|
+
...baseTextStyle,
|
|
164
|
+
fontSize: 11,
|
|
165
|
+
fontWeight: DTFontWeights.medium,
|
|
166
|
+
lineHeight: 16,
|
|
167
|
+
letterSpacing: 0.5,
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,gBAAgB;QACzB,OAAO,EAAE,QAAQ;KAClB,CAAC;IACF,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;QACtB,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,QAAQ;KAClB,CAAC;IACF,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QACpB,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,aAAa;QACtB,OAAO,EAAE,QAAQ;KAClB,CAAC;IACF,wCAAwC;IACxC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;QACxB,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,YAAY;K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AG;KACN;IAEd,UAAU,EAAE;QACV,GAAG,aAAa;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,aAAa,CAAC,MAAM;QAChC,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,GAAG;KACN;CACN,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared SVG bevel path builders
|
|
3
|
+
*
|
|
4
|
+
* Generic and preset functions for generating SVG path data
|
|
5
|
+
* for beveled rectangle shapes used across DT components.
|
|
6
|
+
*/
|
|
7
|
+
type BevelCorner = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
|
|
8
|
+
interface BevelConfig {
|
|
9
|
+
corners: Partial<Record<BevelCorner, number>>;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
/** Additional inset applied to all coordinates (used for frame overlays) */
|
|
12
|
+
offset?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build an SVG path for a rectangle with any combination of beveled corners.
|
|
16
|
+
*
|
|
17
|
+
* Each corner can have an independent bevel size. Corners without a bevel
|
|
18
|
+
* value (or with 0) are rendered as sharp 90-degree angles.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildBeveledRectPath(width: number, height: number, config: BevelConfig): string;
|
|
21
|
+
/**
|
|
22
|
+
* DTButton shape: bottom-right bevel only
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildButtonBevelPath(width: number, height: number, bevelSize: number, strokeWidth: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* DTCard shape: bottom-right (large) + bottom-left (small) bevels
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildCardBevelPath(width: number, height: number, bevelBR: number, bevelBL: number, inset: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* DTLabel shape: top-right bevel only
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildLabelBevelPath(width: number, height: number, bevelSize: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* DTMediaFrame shape: top-left + bottom-right (diagonal symmetry)
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildMediaFrameBevelPath(width: number, height: number, bevelSize: number, offset?: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* DTDrawer shape (right-side): top-left + bottom-left bevels
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildDrawerBevelPath(width: number, height: number, bevelSize: number, position?: 'left' | 'right'): string;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=bevelPaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bevelPaths.d.ts","sourceRoot":"","sources":["../../src/utils/bevelPaths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AAEzE,UAAU,WAAW;IACnB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,GAClB,MAAM,CAkCR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,CAkBR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,MAAM,SAAI,GACT,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAM,GAAG,OAAiB,GACnC,MAAM,CASR"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared SVG bevel path builders
|
|
3
|
+
*
|
|
4
|
+
* Generic and preset functions for generating SVG path data
|
|
5
|
+
* for beveled rectangle shapes used across DT components.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Build an SVG path for a rectangle with any combination of beveled corners.
|
|
9
|
+
*
|
|
10
|
+
* Each corner can have an independent bevel size. Corners without a bevel
|
|
11
|
+
* value (or with 0) are rendered as sharp 90-degree angles.
|
|
12
|
+
*/
|
|
13
|
+
export function buildBeveledRectPath(width, height, config) {
|
|
14
|
+
const sw = config.strokeWidth ?? 0;
|
|
15
|
+
const off = config.offset ?? 0;
|
|
16
|
+
const inset = sw / 2 + off;
|
|
17
|
+
const w = width - sw - off * 2;
|
|
18
|
+
const h = height - sw - off * 2;
|
|
19
|
+
if (w <= 0 || h <= 0)
|
|
20
|
+
return '';
|
|
21
|
+
const maxBevel = Math.min(w / 3, h / 3);
|
|
22
|
+
const tl = Math.min(config.corners.topLeft ?? 0, maxBevel);
|
|
23
|
+
const tr = Math.min(config.corners.topRight ?? 0, maxBevel);
|
|
24
|
+
const br = Math.min(config.corners.bottomRight ?? 0, maxBevel);
|
|
25
|
+
const bl = Math.min(config.corners.bottomLeft ?? 0, maxBevel);
|
|
26
|
+
// Build path clockwise from top-left
|
|
27
|
+
return [
|
|
28
|
+
// Top-left corner
|
|
29
|
+
`M ${inset + tl} ${inset}`,
|
|
30
|
+
// Top edge → top-right corner
|
|
31
|
+
`L ${w + inset - tr} ${inset}`,
|
|
32
|
+
tr > 0 ? `L ${w + inset} ${inset + tr}` : `L ${w + inset} ${inset}`,
|
|
33
|
+
// Right edge → bottom-right corner
|
|
34
|
+
br > 0
|
|
35
|
+
? `L ${w + inset} ${h + inset - br} L ${w + inset - br} ${h + inset}`
|
|
36
|
+
: `L ${w + inset} ${h + inset}`,
|
|
37
|
+
// Bottom edge → bottom-left corner
|
|
38
|
+
bl > 0
|
|
39
|
+
? `L ${inset + bl} ${h + inset} L ${inset} ${h + inset - bl}`
|
|
40
|
+
: `L ${inset} ${h + inset}`,
|
|
41
|
+
// Left edge → back to top-left
|
|
42
|
+
tl > 0 ? `L ${inset} ${inset + tl}` : `L ${inset} ${inset}`,
|
|
43
|
+
'Z',
|
|
44
|
+
].join(' ');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* DTButton shape: bottom-right bevel only
|
|
48
|
+
*/
|
|
49
|
+
export function buildButtonBevelPath(width, height, bevelSize, strokeWidth) {
|
|
50
|
+
return buildBeveledRectPath(width, height, {
|
|
51
|
+
corners: { bottomRight: bevelSize },
|
|
52
|
+
strokeWidth,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* DTCard shape: bottom-right (large) + bottom-left (small) bevels
|
|
57
|
+
*/
|
|
58
|
+
export function buildCardBevelPath(width, height, bevelBR, bevelBL, inset) {
|
|
59
|
+
const w = width - inset * 2;
|
|
60
|
+
const h = height - inset * 2;
|
|
61
|
+
if (w <= 0 || h <= 0)
|
|
62
|
+
return '';
|
|
63
|
+
const br = Math.min(bevelBR, w / 3, h / 3);
|
|
64
|
+
const bl = Math.min(bevelBL, w / 3, h / 3);
|
|
65
|
+
return `
|
|
66
|
+
M ${inset} ${inset}
|
|
67
|
+
L ${w + inset} ${inset}
|
|
68
|
+
L ${w + inset} ${h - br + inset}
|
|
69
|
+
L ${w - br + inset} ${h + inset}
|
|
70
|
+
L ${bl + inset} ${h + inset}
|
|
71
|
+
L ${inset} ${h - bl + inset}
|
|
72
|
+
Z
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* DTLabel shape: top-right bevel only
|
|
77
|
+
*/
|
|
78
|
+
export function buildLabelBevelPath(width, height, bevelSize) {
|
|
79
|
+
return buildBeveledRectPath(width, height, {
|
|
80
|
+
corners: { topRight: bevelSize },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* DTMediaFrame shape: top-left + bottom-right (diagonal symmetry)
|
|
85
|
+
*/
|
|
86
|
+
export function buildMediaFrameBevelPath(width, height, bevelSize, offset = 0) {
|
|
87
|
+
return buildBeveledRectPath(width, height, {
|
|
88
|
+
corners: { topLeft: bevelSize, bottomRight: bevelSize },
|
|
89
|
+
offset,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* DTDrawer shape (right-side): top-left + bottom-left bevels
|
|
94
|
+
*/
|
|
95
|
+
export function buildDrawerBevelPath(width, height, bevelSize, position = 'right') {
|
|
96
|
+
if (position === 'right') {
|
|
97
|
+
return buildBeveledRectPath(width, height, {
|
|
98
|
+
corners: { topLeft: bevelSize, bottomLeft: bevelSize },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return buildBeveledRectPath(width, height, {
|
|
102
|
+
corners: { topRight: bevelSize, bottomRight: bevelSize },
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=bevelPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bevelPaths.js","sourceRoot":"","sources":["../../src/utils/bevelPaths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,MAAc,EACd,MAAmB;IAEnB,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW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O,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC;SACrD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE;QACzC,OAAO,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC;KACvD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared layout measurement hook
|
|
3
|
+
*
|
|
4
|
+
* Extracts the common pattern of tracking component dimensions
|
|
5
|
+
* via onLayout for SVG rendering.
|
|
6
|
+
*/
|
|
7
|
+
import { LayoutChangeEvent } from 'react-native';
|
|
8
|
+
interface ComponentDimensions {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function useComponentLayout(): {
|
|
13
|
+
dimensions: ComponentDimensions;
|
|
14
|
+
onLayout: (event: LayoutChangeEvent) => void;
|
|
15
|
+
hasDimensions: boolean;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useComponentLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentLayout.d.ts","sourceRoot":"","sources":["../../src/utils/useComponentLayout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAE/C,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,kBAAkB;;sBAMK,iBAAiB;;EAWvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared layout measurement hook
|
|
3
|
+
*
|
|
4
|
+
* Extracts the common pattern of tracking component dimensions
|
|
5
|
+
* via onLayout for SVG rendering.
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useCallback } from 'react';
|
|
8
|
+
export function useComponentLayout() {
|
|
9
|
+
const [dimensions, setDimensions] = useState({
|
|
10
|
+
width: 0,
|
|
11
|
+
height: 0,
|
|
12
|
+
});
|
|
13
|
+
const onLayout = useCallback((event) => {
|
|
14
|
+
const { width, height } = event.nativeEvent.layout;
|
|
15
|
+
setDimensions(prev => {
|
|
16
|
+
if (prev.width === width && prev.height === height)
|
|
17
|
+
return prev;
|
|
18
|
+
return { width, height };
|
|
19
|
+
});
|
|
20
|
+
}, []);
|
|
21
|
+
const hasDimensions = dimensions.width > 0 && dimensions.height > 0;
|
|
22
|
+
return { dimensions, onLayout, hasDimensions };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=useComponentLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentLayout.js","sourceRoot":"","sources":["../../src/utils/useComponentLayout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,OAAO,CAAC;AAQ5C,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAsB;QAChE,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,KAAwB,EAAE,EAAE;QACxD,MAAM,EAAC,KAAK,EAAE,MAAM,EAAC,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;QACjD,aAAa,CAAC,IAAI,CAAC,EAAE;YACnB,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM;gBAAE,OAAO,IAAI,CAAC;YAChE,OAAO,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAEpE,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized variant type and color mapping
|
|
3
|
+
*
|
|
4
|
+
* Used by all DT components for consistent mode/variant color resolution.
|
|
5
|
+
*/
|
|
6
|
+
export type DTVariant = 'normal' | 'emphasis' | 'warning' | 'success' | 'other';
|
|
7
|
+
export declare const variantColorMap: Record<DTVariant, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve variant to color, with optional custom color override.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getVariantColor(variant: DTVariant, customColor?: string): string;
|
|
12
|
+
//# sourceMappingURL=variantColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantColors.d.ts","sourceRoot":"","sources":["../../src/utils/variantColors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMrD,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAER"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized variant type and color mapping
|
|
3
|
+
*
|
|
4
|
+
* Used by all DT components for consistent mode/variant color resolution.
|
|
5
|
+
*/
|
|
6
|
+
import { DTColors } from '../theme/colors';
|
|
7
|
+
export const variantColorMap = {
|
|
8
|
+
normal: DTColors.modeNormal,
|
|
9
|
+
emphasis: DTColors.modeEmphasis,
|
|
10
|
+
warning: DTColors.modeWarning,
|
|
11
|
+
success: DTColors.modeSuccess,
|
|
12
|
+
other: DTColors.modeOther,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolve variant to color, with optional custom color override.
|
|
16
|
+
*/
|
|
17
|
+
export function getVariantColor(variant, customColor) {
|
|
18
|
+
return customColor ?? variantColorMap[variant];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=variantColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantColors.js","sourceRoot":"","sources":["../../src/utils/variantColors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAIzC,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,MAAM,EAAE,QAAQ,CAAC,UAAU;IAC3B,QAAQ,EAAE,QAAQ,CAAC,YAAY;IAC/B,OAAO,EAAE,QAAQ,CAAC,WAAW;IAC7B,OAAO,EAAE,QAAQ,CAAC,WAAW;IAC7B,KAAK,EAAE,QAAQ,CAAC,SAAS;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAkB,EAClB,WAAoB;IAEpB,OAAO,WAAW,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC"}
|