sapo-components-ui-rn 1.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.
Files changed (215) hide show
  1. package/README.md +69 -0
  2. package/dist/assets/error.png +0 -0
  3. package/dist/assets/icon-checkbox-active.svg +4 -0
  4. package/dist/assets/icon-checkbox.svg +3 -0
  5. package/dist/assets/image_default.png +0 -0
  6. package/dist/assets/images/error.png +0 -0
  7. package/dist/assets/images/image_default.png +0 -0
  8. package/dist/assets/images/info.png +0 -0
  9. package/dist/assets/images/success.png +0 -0
  10. package/dist/assets/images/warning.png +0 -0
  11. package/dist/assets/info.png +0 -0
  12. package/dist/assets/success.png +0 -0
  13. package/dist/assets/svg/icon-checkbox-active.svg +4 -0
  14. package/dist/assets/svg/icon-checkbox.svg +3 -0
  15. package/dist/assets/warning.png +0 -0
  16. package/dist/components/ActivityIndicator.d.ts +28 -0
  17. package/dist/components/Avatar/index.d.ts +17 -0
  18. package/dist/components/Badge/index.d.ts +13 -0
  19. package/dist/components/Button/index.d.ts +23 -0
  20. package/dist/components/ButtonIcon/index.d.ts +18 -0
  21. package/dist/components/Checkbox/index.d.ts +14 -0
  22. package/dist/components/ChipBar/index.d.ts +16 -0
  23. package/dist/components/CountingDot/index.d.ts +13 -0
  24. package/dist/components/FloatingButton/index.d.ts +17 -0
  25. package/dist/components/Icon/index.d.ts +17 -0
  26. package/dist/components/IconSvg/index.d.ts +12 -0
  27. package/dist/components/Image/index.d.ts +14 -0
  28. package/dist/components/ProgressBar.d.ts +42 -0
  29. package/dist/components/RadioButton/index.d.ts +13 -0
  30. package/dist/components/ScaleButton/index.d.ts +4 -0
  31. package/dist/components/SelectionField/index.d.ts +24 -0
  32. package/dist/components/Spacer/index.d.ts +9 -0
  33. package/dist/components/Switch/Switch.d.ts +47 -0
  34. package/dist/components/Switch/utils.d.ts +14 -0
  35. package/dist/components/Text/index.d.ts +14 -0
  36. package/dist/components/TextInput/Addons/Outline.d.ts +15 -0
  37. package/dist/components/TextInput/Addons/Underline.d.ts +19 -0
  38. package/dist/components/TextInput/Adornment/TextInputAdornment.d.ts +43 -0
  39. package/dist/components/TextInput/Adornment/TextInputAffix.d.ts +72 -0
  40. package/dist/components/TextInput/Adornment/enums.d.ts +12 -0
  41. package/dist/components/TextInput/Adornment/types.d.ts +11 -0
  42. package/dist/components/TextInput/Adornment/utils.d.ts +11 -0
  43. package/dist/components/TextInput/Label/InputLabel.d.ts +4 -0
  44. package/dist/components/TextInput/Label/LabelBackground.d.ts +4 -0
  45. package/dist/components/TextInput/TextInput.d.ts +171 -0
  46. package/dist/components/TextInput/TextInputDefault.d.ts +4 -0
  47. package/dist/components/TextInput/TextInputFlat.d.ts +4 -0
  48. package/dist/components/TextInput/constants.d.ts +31 -0
  49. package/dist/components/TextInput/helpers.d.ts +95 -0
  50. package/dist/components/TextInput/types.d.ts +154 -0
  51. package/dist/components/Toast/ToastProvider.d.ts +21 -0
  52. package/dist/components/Toast/index.d.ts +3 -0
  53. package/dist/components/Typography/AnimatedText.d.ts +34 -0
  54. package/dist/components/Typography/StyledText.d.ts +12 -0
  55. package/dist/components/Typography/Text.d.ts +35 -0
  56. package/dist/components/Typography/types.d.ts +2 -0
  57. package/dist/components/View/index.d.ts +38 -0
  58. package/dist/components/ViewVisibleAnimated/index.d.ts +25 -0
  59. package/dist/constants.d.ts +1 -0
  60. package/dist/core/theming.d.ts +43 -0
  61. package/dist/icons/IconArrowDown.d.ts +4 -0
  62. package/dist/icons/IconCheckbox.d.ts +4 -0
  63. package/dist/icons/IconCheckboxActive.d.ts +4 -0
  64. package/dist/icons/IconClearText.d.ts +4 -0
  65. package/dist/icons/IconRadio.d.ts +4 -0
  66. package/dist/icons/IconRadioActive.d.ts +4 -0
  67. package/dist/icons/IconRadioDisable.d.ts +4 -0
  68. package/dist/index.d.ts +33 -0
  69. package/dist/index.esm.js +6758 -0
  70. package/dist/index.esm.js.map +1 -0
  71. package/dist/index.js +6823 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/styles/fonts.d.ts +78 -0
  74. package/dist/styles/overlay.d.ts +3 -0
  75. package/dist/styles/shadow.d.ts +18 -0
  76. package/dist/styles/themes/DarkTheme.d.ts +2 -0
  77. package/dist/styles/themes/LightTheme.d.ts +2 -0
  78. package/dist/styles/themes/index.d.ts +2 -0
  79. package/dist/styles/themes/tokens.d.ts +830 -0
  80. package/dist/theme/blue.d.ts +14 -0
  81. package/dist/theme/colors.d.ts +99 -0
  82. package/dist/theme/container-styles.d.ts +124 -0
  83. package/dist/theme/dimensions.d.ts +36 -0
  84. package/dist/theme/green.d.ts +15 -0
  85. package/dist/theme/icon.d.ts +5 -0
  86. package/dist/theme/ink.d.ts +11 -0
  87. package/dist/theme/orange.d.ts +14 -0
  88. package/dist/theme/purple.d.ts +6 -0
  89. package/dist/theme/red.d.ts +15 -0
  90. package/dist/theme/themes.d.ts +277 -0
  91. package/dist/theme/white.d.ts +10 -0
  92. package/dist/theme/yellow.d.ts +15 -0
  93. package/dist/types/index.d.ts +65 -0
  94. package/dist/types.d.ts +220 -0
  95. package/dist/utils/BackHandler/BackHandler.d.ts +9 -0
  96. package/dist/utils/BackHandler/BackHandler.native.d.ts +2 -0
  97. package/dist/utils/addEventListener.d.ts +12 -0
  98. package/dist/utils/forwardRef.d.ts +11 -0
  99. package/dist/utils/function-utils.d.ts +12 -0
  100. package/dist/utils/getContrastingColor.d.ts +2 -0
  101. package/dist/utils/hasTouchHandler.d.ts +5 -0
  102. package/dist/utils/roundLayoutSize.d.ts +1 -0
  103. package/dist/utils/splitStyles.d.ts +19 -0
  104. package/dist/utils/toast-manager.d.ts +21 -0
  105. package/dist/utils/useAnimatedValue.d.ts +2 -0
  106. package/dist/utils/useAnimatedValueArray.d.ts +2 -0
  107. package/dist/utils/useIsKeyboardShown.d.ts +6 -0
  108. package/dist/utils/useLayout.d.ts +6 -0
  109. package/dist/utils/useLazyRef.d.ts +2 -0
  110. package/package.json +104 -0
  111. package/src/.DS_Store +0 -0
  112. package/src/assets/images/error.png +0 -0
  113. package/src/assets/images/image_default.png +0 -0
  114. package/src/assets/images/info.png +0 -0
  115. package/src/assets/images/success.png +0 -0
  116. package/src/assets/images/warning.png +0 -0
  117. package/src/assets/svg/icon-checkbox-active.svg +4 -0
  118. package/src/assets/svg/icon-checkbox.svg +3 -0
  119. package/src/babel/.eslintrc +7 -0
  120. package/src/babel/index.js +63 -0
  121. package/src/components/.DS_Store +0 -0
  122. package/src/components/ActivityIndicator.tsx +238 -0
  123. package/src/components/Avatar/index.tsx +102 -0
  124. package/src/components/Badge/index.tsx +55 -0
  125. package/src/components/Button/index.tsx +162 -0
  126. package/src/components/ButtonIcon/index.tsx +98 -0
  127. package/src/components/Checkbox/index.tsx +107 -0
  128. package/src/components/ChipBar/index.tsx +112 -0
  129. package/src/components/CountingDot/index.tsx +63 -0
  130. package/src/components/FloatingButton/index.tsx +99 -0
  131. package/src/components/Icon/index.tsx +135 -0
  132. package/src/components/IconSvg/index.tsx +42 -0
  133. package/src/components/Image/index.tsx +127 -0
  134. package/src/components/ProgressBar.tsx +272 -0
  135. package/src/components/RadioButton/index.tsx +105 -0
  136. package/src/components/ScaleButton/index.tsx +17 -0
  137. package/src/components/SelectionField/index.tsx +166 -0
  138. package/src/components/Spacer/index.tsx +19 -0
  139. package/src/components/Switch/Switch.tsx +110 -0
  140. package/src/components/Switch/utils.ts +96 -0
  141. package/src/components/Text/index.tsx +69 -0
  142. package/src/components/TextInput/.DS_Store +0 -0
  143. package/src/components/TextInput/Addons/Outline.tsx +62 -0
  144. package/src/components/TextInput/Addons/Underline.tsx +71 -0
  145. package/src/components/TextInput/Adornment/TextInputAdornment.tsx +191 -0
  146. package/src/components/TextInput/Adornment/TextInputAffix.tsx +212 -0
  147. package/src/components/TextInput/Adornment/enums.tsx +12 -0
  148. package/src/components/TextInput/Adornment/types.tsx +11 -0
  149. package/src/components/TextInput/Adornment/utils.ts +39 -0
  150. package/src/components/TextInput/Label/InputLabel.tsx +216 -0
  151. package/src/components/TextInput/Label/LabelBackground.tsx +100 -0
  152. package/src/components/TextInput/TextInput.tsx +564 -0
  153. package/src/components/TextInput/TextInputDefault.tsx +187 -0
  154. package/src/components/TextInput/TextInputFlat.tsx +452 -0
  155. package/src/components/TextInput/constants.tsx +48 -0
  156. package/src/components/TextInput/helpers.tsx +546 -0
  157. package/src/components/TextInput/types.tsx +155 -0
  158. package/src/components/Toast/ToastProvider.tsx +69 -0
  159. package/src/components/Toast/index.tsx +239 -0
  160. package/src/components/Typography/AnimatedText.tsx +84 -0
  161. package/src/components/Typography/StyledText.tsx +53 -0
  162. package/src/components/Typography/Text.tsx +189 -0
  163. package/src/components/Typography/types.tsx +5 -0
  164. package/src/components/View/index.tsx +175 -0
  165. package/src/components/ViewVisibleAnimated/index.tsx +199 -0
  166. package/src/constants.tsx +16 -0
  167. package/src/core/theming.tsx +144 -0
  168. package/src/icons/IconArrowDown.tsx +14 -0
  169. package/src/icons/IconCheckbox.tsx +20 -0
  170. package/src/icons/IconCheckboxActive.tsx +18 -0
  171. package/src/icons/IconClearText.tsx +14 -0
  172. package/src/icons/IconRadio.tsx +11 -0
  173. package/src/icons/IconRadioActive.tsx +12 -0
  174. package/src/icons/IconRadioDisable.tsx +12 -0
  175. package/src/index.ts +51 -0
  176. package/src/index.tsx +50 -0
  177. package/src/styles/fonts.tsx +89 -0
  178. package/src/styles/overlay.tsx +69 -0
  179. package/src/styles/shadow.tsx +47 -0
  180. package/src/styles/themes/DarkTheme.tsx +157 -0
  181. package/src/styles/themes/LightTheme.tsx +160 -0
  182. package/src/styles/themes/index.ts +3 -0
  183. package/src/styles/themes/tokens.tsx +481 -0
  184. package/src/theme/blue.ts +25 -0
  185. package/src/theme/colors.ts +21 -0
  186. package/src/theme/container-styles.tsx +126 -0
  187. package/src/theme/dimensions.ts +44 -0
  188. package/src/theme/green.ts +27 -0
  189. package/src/theme/icon.ts +7 -0
  190. package/src/theme/ink.ts +18 -0
  191. package/src/theme/orange.ts +24 -0
  192. package/src/theme/purple.ts +8 -0
  193. package/src/theme/red.ts +26 -0
  194. package/src/theme/themes.tsx +287 -0
  195. package/src/theme/white.ts +16 -0
  196. package/src/theme/yellow.ts +26 -0
  197. package/src/types/index.ts +71 -0
  198. package/src/types/svg.d.ts +5 -0
  199. package/src/types.ts +259 -0
  200. package/src/types.tsx +284 -0
  201. package/src/utils/BackHandler/BackHandler.native.tsx +3 -0
  202. package/src/utils/BackHandler/BackHandler.tsx +11 -0
  203. package/src/utils/addEventListener.tsx +56 -0
  204. package/src/utils/forwardRef.tsx +23 -0
  205. package/src/utils/function-utils.tsx +108 -0
  206. package/src/utils/getContrastingColor.tsx +15 -0
  207. package/src/utils/hasTouchHandler.tsx +23 -0
  208. package/src/utils/roundLayoutSize.ts +2 -0
  209. package/src/utils/splitStyles.ts +60 -0
  210. package/src/utils/toast-manager.tsx +46 -0
  211. package/src/utils/useAnimatedValue.tsx +9 -0
  212. package/src/utils/useAnimatedValueArray.tsx +13 -0
  213. package/src/utils/useIsKeyboardShown.tsx +55 -0
  214. package/src/utils/useLayout.tsx +29 -0
  215. package/src/utils/useLazyRef.tsx +11 -0
package/src/index.tsx ADDED
@@ -0,0 +1,50 @@
1
+ export { ThemeColors } from "./styles/themes/tokens";
2
+ export { CONSTANTS } from "./styles/themes/tokens";
3
+ export {
4
+ useTheme,
5
+ ThemeProvider,
6
+ DefaultTheme,
7
+ adaptNavigationTheme,
8
+ } from "./core/theming";
9
+ export * from "./styles/themes";
10
+
11
+ export { default as shadow } from "./styles/shadow";
12
+ export { default as overlay } from "./styles/overlay";
13
+ export { default as configureFonts } from "./styles/fonts";
14
+ export { default as ActivityIndicator } from "./components/ActivityIndicator";
15
+ export { default as ProgressBar } from "./components/ProgressBar";
16
+ export { default as Switch } from "./components/Switch/Switch";
17
+ export { default as TextInput } from "./components/TextInput/TextInput";
18
+ export { default as Button } from "./components/Button";
19
+ export { default as ButtonIcon } from "./components/ButtonIcon";
20
+ export { default as FloatingButton } from "./components/FloatingButton";
21
+ export { default as Text } from "./components/Text";
22
+ export { default as Toast } from "./components/Toast";
23
+ export { default as View } from "./components/View";
24
+ export { default as Spacer } from "./components/Spacer";
25
+ export { default as Image } from "./components/Image";
26
+ export { default as Badge } from "./components/Badge";
27
+ export { default as CountingDot } from "./components/CountingDot";
28
+ export { default as ChipBar } from "./components/ChipBar";
29
+ export { default as Checkbox } from "./components/Checkbox";
30
+ export { default as RadioButton } from "./components/RadioButton";
31
+ export { default as Avatar } from "./components/Avatar";
32
+ export { default as SelectionField } from "./components/SelectionField";
33
+ // Types
34
+ export type { Props as ActivityIndicatorProps } from "./components/ActivityIndicator";
35
+ export type { Props as SwitchProps } from "./components/Switch/Switch";
36
+ export type { Props as TextInputProps } from "./components/TextInput/TextInput";
37
+ export type { Props as TextInputAffixProps } from "./components/TextInput/Adornment/TextInputAffix";
38
+
39
+ export type {
40
+ AppTheme,
41
+ ThemeBase,
42
+ MD3Elevation,
43
+ MD3TypescaleKey,
44
+ } from "./types";
45
+
46
+ // Toast Manager
47
+ export * from "./utils/toast-manager";
48
+
49
+ // Toast Provider
50
+ export { default as ToastProvider } from "./components/Toast/ToastProvider";
@@ -0,0 +1,89 @@
1
+ import { typescale } from "./themes/tokens";
2
+ import type { MD3Type, MD3Typescale, MD3TypescaleKey } from "../types";
3
+
4
+ export const fontConfig = {
5
+ ios: {
6
+ regular: {
7
+ fontFamily: "System",
8
+ fontWeight: "400" as "400",
9
+ },
10
+ medium: {
11
+ fontFamily: "System",
12
+ fontWeight: "500" as "500",
13
+ },
14
+ light: {
15
+ fontFamily: "System",
16
+ fontWeight: "300" as "300",
17
+ },
18
+ thin: {
19
+ fontFamily: "System",
20
+ fontWeight: "100" as "100",
21
+ },
22
+ },
23
+ default: {
24
+ regular: {
25
+ fontFamily: "sans-serif",
26
+ fontWeight: "normal" as "normal",
27
+ },
28
+ medium: {
29
+ fontFamily: "sans-serif-medium",
30
+ fontWeight: "normal" as "normal",
31
+ },
32
+ light: {
33
+ fontFamily: "sans-serif-light",
34
+ fontWeight: "normal" as "normal",
35
+ },
36
+ thin: {
37
+ fontFamily: "sans-serif-thin",
38
+ fontWeight: "normal" as "normal",
39
+ },
40
+ },
41
+ };
42
+
43
+ type MD3FontsConfig =
44
+ | {
45
+ [key in MD3TypescaleKey]: Partial<MD3Type>;
46
+ }
47
+ | {
48
+ [key: string]: MD3Type;
49
+ }
50
+ | Partial<MD3Type>;
51
+
52
+ function configureV3Fonts(
53
+ config: MD3FontsConfig
54
+ ): MD3Typescale | (MD3Typescale & { [key: string]: MD3Type }) {
55
+ if (!config) {
56
+ return typescale;
57
+ }
58
+
59
+ const isFlatConfig = Object.keys(config).every(
60
+ (key) => typeof config[key as keyof typeof config] !== "object"
61
+ );
62
+
63
+ if (isFlatConfig) {
64
+ return Object.fromEntries(
65
+ Object.entries(typescale).map(([variantName, variantProperties]) => [
66
+ variantName,
67
+ { ...variantProperties, ...config },
68
+ ])
69
+ ) as MD3Typescale;
70
+ }
71
+
72
+ return Object.assign(
73
+ {},
74
+ typescale,
75
+ ...Object.entries(config).map(([variantName, variantProperties]) => ({
76
+ [variantName]: {
77
+ ...typescale[variantName as MD3TypescaleKey],
78
+ ...variantProperties,
79
+ },
80
+ }))
81
+ );
82
+ }
83
+
84
+ // eslint-disable-next-line no-redeclare
85
+ export default function configureFonts(params?: any) {
86
+ const { config } = params || {};
87
+
88
+ return configureV3Fonts(config);
89
+ }
@@ -0,0 +1,69 @@
1
+ import { Animated } from "react-native";
2
+
3
+ import color from "color";
4
+ import { DarkTheme } from "./themes";
5
+
6
+ export const isAnimatedValue = (
7
+ it: number | string | Animated.AnimatedInterpolation<number | string>
8
+ ): it is Animated.Value => it instanceof Animated.Value;
9
+
10
+ export default function overlay<T extends Animated.Value | number>(
11
+ elevation: T,
12
+ surfaceColor: string = DarkTheme.colors?.backgroundPrimary
13
+ ): T extends number ? string : Animated.AnimatedInterpolation<number | string> {
14
+ if (isAnimatedValue(elevation)) {
15
+ const inputRange = [0, 1, 2, 3, 8, 24];
16
+
17
+ // @ts-expect-error: TS doesn't seem to refine the type correctly
18
+ return elevation.interpolate({
19
+ inputRange,
20
+ outputRange: inputRange.map((elevation) => {
21
+ return calculateColor(surfaceColor, elevation);
22
+ }),
23
+ });
24
+ }
25
+
26
+ // @ts-expect-error: TS doesn't seem to refine the type correctly
27
+ return calculateColor(surfaceColor, elevation);
28
+ }
29
+
30
+ function calculateColor(surfaceColor: string, elevation: number = 1) {
31
+ let overlayTransparency: number;
32
+ if (elevation >= 1 && elevation <= 24) {
33
+ overlayTransparency = elevationOverlayTransparency[elevation];
34
+ } else if (elevation > 24) {
35
+ overlayTransparency = elevationOverlayTransparency[24];
36
+ } else {
37
+ overlayTransparency = elevationOverlayTransparency[1];
38
+ }
39
+ return color(surfaceColor)
40
+ .mix(color("white"), overlayTransparency * 0.01)
41
+ .hex();
42
+ }
43
+
44
+ const elevationOverlayTransparency: Record<string, number> = {
45
+ 1: 5,
46
+ 2: 7,
47
+ 3: 8,
48
+ 4: 9,
49
+ 5: 10,
50
+ 6: 11,
51
+ 7: 11.5,
52
+ 8: 12,
53
+ 9: 12.5,
54
+ 10: 13,
55
+ 11: 13.5,
56
+ 12: 14,
57
+ 13: 14.25,
58
+ 14: 14.5,
59
+ 15: 14.75,
60
+ 16: 15,
61
+ 17: 15.12,
62
+ 18: 15.24,
63
+ 19: 15.36,
64
+ 20: 15.48,
65
+ 21: 15.6,
66
+ 22: 15.72,
67
+ 23: 15.84,
68
+ 24: 16,
69
+ };
@@ -0,0 +1,47 @@
1
+ import { Animated } from "react-native";
2
+ import colors from "../theme/colors";
3
+
4
+ const MD3_SHADOW_OPACITY = 0.3;
5
+ const MD3_SHADOW_COLOR = colors.ink.INK80;
6
+
7
+ export default function shadow(elevation: number | Animated.Value = 0) {
8
+ return v3Shadow(elevation);
9
+ }
10
+
11
+ function v3Shadow(elevation: number | Animated.Value = 0) {
12
+ const inputRange = [0, 1, 2, 3, 4, 5];
13
+ const shadowHeight = [0, 1, 2, 4, 6, 8];
14
+ const shadowRadius = [0, 3, 6, 8, 10, 12];
15
+
16
+ if (elevation instanceof Animated.Value) {
17
+ return {
18
+ shadowColor: MD3_SHADOW_COLOR,
19
+ shadowOffset: {
20
+ width: new Animated.Value(0),
21
+ height: elevation.interpolate({
22
+ inputRange,
23
+ outputRange: shadowHeight,
24
+ }),
25
+ },
26
+ shadowOpacity: elevation.interpolate({
27
+ inputRange: [0, 1],
28
+ outputRange: [0, MD3_SHADOW_OPACITY],
29
+ extrapolate: "clamp",
30
+ }),
31
+ shadowRadius: elevation.interpolate({
32
+ inputRange,
33
+ outputRange: shadowRadius,
34
+ }),
35
+ };
36
+ } else {
37
+ return {
38
+ shadowColor: MD3_SHADOW_COLOR,
39
+ shadowOpacity: elevation ? MD3_SHADOW_OPACITY : 0,
40
+ shadowOffset: {
41
+ width: 0,
42
+ height: shadowHeight[elevation],
43
+ },
44
+ shadowRadius: shadowRadius[elevation],
45
+ };
46
+ }
47
+ }
@@ -0,0 +1,157 @@
1
+ import type { AppTheme } from "../../types";
2
+ import { LightTheme } from "./LightTheme";
3
+ import ink from "../../theme/ink";
4
+ import white from "../../theme/white";
5
+ import blue from "../../theme/blue";
6
+ import red from "../../theme/red";
7
+ import green from "../../theme/green";
8
+ import yellow from "../../theme/yellow";
9
+ import purple from "../../theme/purple";
10
+
11
+ export const DarkTheme: AppTheme = {
12
+ ...LightTheme,
13
+ dark: true,
14
+ mode: "adaptive",
15
+ version: 3,
16
+ colors: {
17
+ elevation: {
18
+ level0: "transparent",
19
+ level1: "rgb(37, 35, 42)",
20
+ level2: "rgb(44, 40, 49)",
21
+ level3: "rgb(49, 44, 56)",
22
+ level4: "rgb(51, 46, 58)",
23
+ level5: "rgb(52, 49, 63)",
24
+ },
25
+ //new theme colors
26
+ backgroundPrimary: ink.INK100,
27
+ backgroundSecondary: white.WHITE100,
28
+ borderBrandDefault: blue.BLUE100,
29
+ borderCriticalDefault: red.RED100,
30
+ borderCriticalHover: red.RED80,
31
+ borderCriticalPressed: red.RED120,
32
+ borderErrorDefault: red.RED100,
33
+ borderInfoDefault: blue.BLUE100,
34
+ borderPrimaryDefault: ink.INK10,
35
+ borderPrimaryDisabled: ink.INK10,
36
+ borderPrimaryHovered: ink.INK20,
37
+ borderPrimaryInverseDefault: blue.BLUE100,
38
+ borderPrimaryPressed: ink.INK20,
39
+ borderSuccessDefault: green.GREEN100,
40
+ borderWarningDefault: yellow.YELLOW100,
41
+ iconBrandDefault: blue.BLUE100,
42
+ iconCriticalDefault: red.RED100,
43
+ iconErrorDefault: red.RED100,
44
+ iconInfoDefault: blue.BLUE100,
45
+ iconPrimaryDefault: ink.INK40,
46
+ iconPrimaryHover: ink.INK60,
47
+ iconPrimaryDisabled: ink.INK60,
48
+ iconPrimaryInverseDefault: white.WHITE100,
49
+ iconPrimaryInverseHover: white.WHITE80,
50
+ iconPrimaryInversePressed: white.WHITE80,
51
+ iconPrimaryPressed: ink.INK60,
52
+ iconSuccessDefault: green.GREEN100,
53
+ iconWarningDefault: yellow.YELLOW100,
54
+ surfaceBrandDefault: blue.BLUE100,
55
+ surfaceBrandDisabled: ink.INK10,
56
+ surfaceBrandHover: blue.BLUE80,
57
+ surfaceBrandInverseDefault: blue.BLUE10,
58
+ surfaceBrandInverseHover: blue.BLUE20,
59
+ surfaceBrandInversePressed: blue.BLUE40,
60
+ surfaceBrandPressed: blue.BLUE120,
61
+ surfaceCriticalDefault: red.RED100,
62
+ surfaceCriticalDisabled: ink.INK10,
63
+ surfaceCriticalHover: red.RED80,
64
+ surfaceCriticalInverseDefault: red.RED10,
65
+ surfaceCriticalInverseHover: red.RED20,
66
+ surfaceCriticalInversePressed: red.RED40,
67
+ surfaceCriticalPressed: red.RED120,
68
+ surfaceErrorDefault: red.RED100,
69
+ surfaceErrorDisabled: ink.INK10,
70
+ surfaceErrorHover: red.RED80,
71
+ surfaceErrorInverseDefault: red.RED10,
72
+ surfaceErrorInverseHover: red.RED20,
73
+ surfaceErrorInversePressed: red.RED40,
74
+ surfaceErrorPressed: red.RED_STATUS,
75
+ surfaceInfoDefault: blue.BLUE100,
76
+ surfaceInfoDisabled: ink.INK10,
77
+ surfaceInfoHover: blue.BLUE80,
78
+ surfaceInfoInverseDefault: blue.BLUE10,
79
+ surfaceInfoInverseHover: blue.BLUE20,
80
+ surfaceInfoInversePressed: blue.BLUE40,
81
+ surfaceInfoPressed: blue.BLUE120,
82
+ surfacePrimaryDefault: white.WHITE100,
83
+ surfacePrimaryDisabled: ink.INK5,
84
+ surfacePrimaryHover: ink.INK5,
85
+ surfacePrimaryInverseDefault: ink.INK80,
86
+ surfacePrimaryInverseHover: ink.INK60,
87
+ surfacePrimaryInversePressed: ink.INK40,
88
+ surfacePrimaryPressed: ink.INK10,
89
+ surfaceSecondaryDefault: ink.INK5,
90
+ surfaceSecondaryDisabled: ink.INK5,
91
+ surfaceSecondaryHover: ink.INK10,
92
+ surfaceSecondaryPressed: ink.INK20,
93
+ surfaceSuccessDefault: green.GREEN100,
94
+ surfaceSuccessDisabled: ink.INK10,
95
+ surfaceSuccessHover: green.GREEN80,
96
+ surfaceSuccessInverseDefault: green.GREEN10,
97
+ surfaceSuccessInverseHover: green.GREEN20,
98
+ surfaceSuccessInversePressed: green.GREEN40,
99
+ surfaceSuccessPressed: green.GREEN_STATUS,
100
+ surfaceWarningDefault: yellow.YELLOW100,
101
+ surfaceWarningDisabled: ink.INK10,
102
+ surfaceWarningHover: yellow.YELLOW80,
103
+ surfaceWarningInverseDefault: yellow.YELLOW10,
104
+ surfaceWarningInverseHover: yellow.YELLOW20,
105
+ surfaceWarningInversePressed: yellow.YELLOW40,
106
+ surfaceWarningPressed: yellow.YELLOW120,
107
+ textDefault: ink.INK5,
108
+ textDisabled: ink.INK20,
109
+ textPlaceholder: ink.INK40,
110
+ textSecondary: ink.INK60,
111
+ textBrandDefault: blue.BLUE100,
112
+ textBrandDisabled: ink.INK20,
113
+ textBrandHovered: blue.BLUE80,
114
+ textBrandPressed: blue.BLUE120,
115
+ textCriticalDefault: red.RED100,
116
+ textCriticalDisabled: ink.INK20,
117
+ textCriticalHovered: red.RED80,
118
+ textCriticalPressed: red.RED_STATUS,
119
+ textErrorDefault: red.RED100,
120
+ textErrorDisabled: ink.INK20,
121
+ textErrorHovered: red.RED80,
122
+ textErrorPressed: red.RED_STATUS,
123
+ textInfoDefault: blue.BLUE100,
124
+ textInfoDisabled: ink.INK20,
125
+ textInfoHovered: blue.BLUE80,
126
+ textInfoPressed: blue.BLUE120,
127
+ textLinkDefault: blue.BLUE100,
128
+ textLinkDisabled: ink.INK20,
129
+ textLinkHovered: blue.BLUE80,
130
+ textLinkPressed: blue.BLUE120,
131
+ textLinkVisitedDefault: purple.PURPLE100,
132
+ textLinkVisitedDisabled: purple.PURPLE_BG,
133
+ textLinkVisitedHovered: purple.PURPLE_BG,
134
+ textLinkVisitedPressed: purple.PURPLE_BG,
135
+ textOnFillDefault: white.WHITE100,
136
+ textOnFillDisabled: white.WHITE20,
137
+ textOnFillHovered: white.WHITE80,
138
+ textOnFillPressed: white.WHITE80,
139
+ textSuccessDefault: green.GREEN100,
140
+ textSuccessDisabled: ink.INK20,
141
+ textSuccessHovered: green.GREEN80,
142
+ textSuccessPressed: green.GREEN_STATUS,
143
+ textWarningDefault: yellow.YELLOW100,
144
+ textWarningDisabled: ink.INK20,
145
+ textWarningHovered: yellow.YELLOW80,
146
+ textWarningPressed: yellow.YELLOW_STATUS,
147
+ selectBackgroundDisabled: white.WHITE40,
148
+ selectIconDisabled: white.WHITE40,
149
+ borderCriticalInverseDefault: red.RED40,
150
+ borderCriticalInverseHover: red.RED20,
151
+ borderCriticalInversePressed: red.RED60,
152
+ borderErrorInverseDefault: red.RED40,
153
+ borderPrimaryFocused: blue.BLUE100,
154
+ borderWarningInverseDefault: yellow.YELLOW40,
155
+ borderSuccessInverseDefault: green.GREEN40,
156
+ },
157
+ };
@@ -0,0 +1,160 @@
1
+ import type { AppTheme } from "../../types";
2
+ import configureFonts from "../fonts";
3
+ import ink from "../../theme/ink";
4
+ import white from "../../theme/white";
5
+ import blue from "../../theme/blue";
6
+ import red from "../../theme/red";
7
+ import green from "../../theme/green";
8
+ import yellow from "../../theme/yellow";
9
+ import purple from "../../theme/purple";
10
+
11
+ export const LightTheme: AppTheme = {
12
+ dark: false,
13
+ roundness: 8,
14
+ version: 3,
15
+ colors: {
16
+ elevation: {
17
+ level0: "transparent",
18
+ level1: "rgb(247, 243, 249)",
19
+ level2: "rgb(243, 237, 246)",
20
+ level3: "rgb(238, 232, 244)",
21
+ level4: "rgb(236, 230, 243)",
22
+ level5: "rgb(233, 227, 241)",
23
+ },
24
+ //new theme colors
25
+ backgroundPrimary: ink.INK5,
26
+ backgroundSecondary: white.WHITE100,
27
+ borderBrandDefault: blue.BLUE100,
28
+ borderCriticalDefault: red.RED100,
29
+ borderCriticalHover: red.RED80,
30
+ borderCriticalPressed: red.RED120,
31
+ borderErrorDefault: red.RED100,
32
+ borderInfoDefault: blue.BLUE100,
33
+ borderPrimaryDefault: ink.INK10,
34
+ borderPrimaryDisabled: ink.INK10,
35
+ borderPrimaryHovered: ink.INK20,
36
+ borderPrimaryInverseDefault: blue.BLUE100,
37
+ borderPrimaryPressed: ink.INK20,
38
+ borderSuccessDefault: green.GREEN100,
39
+ borderWarningDefault: yellow.YELLOW100,
40
+ iconBrandDefault: blue.BLUE100,
41
+ iconCriticalDefault: red.RED100,
42
+ iconErrorDefault: red.RED100,
43
+ iconInfoDefault: blue.BLUE100,
44
+ iconPrimaryDefault: ink.INK40,
45
+ iconPrimaryHover: ink.INK60,
46
+ iconPrimaryDisabled: ink.INK60,
47
+ iconPrimaryInverseDefault: white.WHITE100,
48
+ iconPrimaryInverseHover: white.WHITE80,
49
+ iconPrimaryInversePressed: white.WHITE80,
50
+ iconPrimaryPressed: ink.INK60,
51
+ iconSuccessDefault: green.GREEN100,
52
+ iconWarningDefault: yellow.YELLOW100,
53
+ surfaceBrandDefault: blue.BLUE100,
54
+ surfaceBrandDisabled: ink.INK10,
55
+ surfaceBrandHover: blue.BLUE80,
56
+ surfaceBrandInverseDefault: blue.BLUE10,
57
+ surfaceBrandInverseHover: blue.BLUE20,
58
+ surfaceBrandInversePressed: blue.BLUE40,
59
+ surfaceBrandPressed: blue.BLUE120,
60
+ surfaceCriticalDefault: red.RED100,
61
+ surfaceCriticalDisabled: ink.INK10,
62
+ surfaceCriticalHover: red.RED80,
63
+ surfaceCriticalInverseDefault: red.RED10,
64
+ surfaceCriticalInverseHover: red.RED20,
65
+ surfaceCriticalInversePressed: red.RED40,
66
+ surfaceCriticalPressed: red.RED120,
67
+ surfaceErrorDefault: red.RED100,
68
+ surfaceErrorDisabled: ink.INK10,
69
+ surfaceErrorHover: red.RED80,
70
+ surfaceErrorInverseDefault: red.RED10,
71
+ surfaceErrorInverseHover: red.RED20,
72
+ surfaceErrorInversePressed: red.RED40,
73
+ surfaceErrorPressed: red.RED_STATUS,
74
+ surfaceInfoDefault: blue.BLUE100,
75
+ surfaceInfoDisabled: ink.INK10,
76
+ surfaceInfoHover: blue.BLUE80,
77
+ surfaceInfoInverseDefault: blue.BLUE10,
78
+ surfaceInfoInverseHover: blue.BLUE20,
79
+ surfaceInfoInversePressed: blue.BLUE40,
80
+ surfaceInfoPressed: blue.BLUE120,
81
+ surfacePrimaryDefault: white.WHITE100,
82
+ surfacePrimaryDisabled: ink.INK5,
83
+ surfacePrimaryHover: ink.INK5,
84
+ surfacePrimaryInverseDefault: ink.INK80,
85
+ surfacePrimaryInverseHover: ink.INK60,
86
+ surfacePrimaryInversePressed: ink.INK40,
87
+ surfacePrimaryPressed: ink.INK10,
88
+ surfaceSecondaryDefault: ink.INK5,
89
+ surfaceSecondaryDisabled: ink.INK5,
90
+ surfaceSecondaryHover: ink.INK10,
91
+ surfaceSecondaryPressed: ink.INK20,
92
+ surfaceSuccessDefault: green.GREEN100,
93
+ surfaceSuccessDisabled: ink.INK10,
94
+ surfaceSuccessHover: green.GREEN80,
95
+ surfaceSuccessInverseDefault: green.GREEN10,
96
+ surfaceSuccessInverseHover: green.GREEN20,
97
+ surfaceSuccessInversePressed: green.GREEN40,
98
+ surfaceSuccessPressed: green.GREEN_STATUS,
99
+ surfaceWarningDefault: yellow.YELLOW100,
100
+ surfaceWarningDisabled: ink.INK10,
101
+ surfaceWarningHover: yellow.YELLOW80,
102
+ surfaceWarningInverseDefault: yellow.YELLOW10,
103
+ surfaceWarningInverseHover: yellow.YELLOW20,
104
+ surfaceWarningInversePressed: yellow.YELLOW40,
105
+ surfaceWarningPressed: yellow.YELLOW120,
106
+ textDefault: ink.INK100,
107
+ textDisabled: ink.INK20,
108
+ textPlaceholder: ink.INK40,
109
+ textSecondary: ink.INK60,
110
+ textBrandDefault: blue.BLUE100,
111
+ textBrandDisabled: ink.INK20,
112
+ textBrandHovered: blue.BLUE80,
113
+ textBrandPressed: blue.BLUE120,
114
+ textCriticalDefault: red.RED100,
115
+ textCriticalDisabled: ink.INK20,
116
+ textCriticalHovered: red.RED80,
117
+ textCriticalPressed: red.RED_STATUS,
118
+ textErrorDefault: red.RED100,
119
+ textErrorDisabled: ink.INK20,
120
+ textErrorHovered: red.RED80,
121
+ textErrorPressed: red.RED_STATUS,
122
+ textInfoDefault: blue.BLUE100,
123
+ textInfoDisabled: ink.INK20,
124
+ textInfoHovered: blue.BLUE80,
125
+ textInfoPressed: blue.BLUE120,
126
+ textLinkDefault: blue.BLUE100,
127
+ textLinkDisabled: ink.INK20,
128
+ textLinkHovered: blue.BLUE80,
129
+ textLinkPressed: blue.BLUE120,
130
+ textLinkVisitedDefault: purple.PURPLE100,
131
+ textLinkVisitedDisabled: purple.PURPLE_BG,
132
+ textLinkVisitedHovered: purple.PURPLE_BG,
133
+ textLinkVisitedPressed: purple.PURPLE_BG,
134
+ textOnFillDefault: white.WHITE100,
135
+ textOnFillDisabled: white.WHITE20,
136
+ textOnFillHovered: white.WHITE80,
137
+ textOnFillPressed: white.WHITE80,
138
+ textSuccessDefault: green.GREEN100,
139
+ textSuccessDisabled: ink.INK20,
140
+ textSuccessHovered: green.GREEN80,
141
+ textSuccessPressed: green.GREEN_STATUS,
142
+ textWarningDefault: yellow.YELLOW100,
143
+ textWarningDisabled: ink.INK20,
144
+ textWarningHovered: yellow.YELLOW80,
145
+ textWarningPressed: yellow.YELLOW_STATUS,
146
+ selectBackgroundDisabled: white.WHITE40,
147
+ selectIconDisabled: white.WHITE40,
148
+ borderCriticalInverseDefault: red.RED40,
149
+ borderCriticalInverseHover: red.RED20,
150
+ borderCriticalInversePressed: red.RED60,
151
+ borderErrorInverseDefault: red.RED40,
152
+ borderPrimaryFocused: blue.BLUE100,
153
+ borderWarningInverseDefault: yellow.YELLOW40,
154
+ borderSuccessInverseDefault: green.GREEN40,
155
+ },
156
+ fonts: configureFonts(),
157
+ animation: {
158
+ scale: 1.0,
159
+ },
160
+ };
@@ -0,0 +1,3 @@
1
+ export { LightTheme } from './LightTheme';
2
+ export { DarkTheme } from './DarkTheme';
3
+