expo-dev-client-components 1.0.0 → 1.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.
Files changed (255) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +129 -0
  3. package/assets/branch-icon-light.png +0 -0
  4. package/assets/branch-icon-light@2x.png +0 -0
  5. package/assets/branch-icon-light@3x.png +0 -0
  6. package/assets/branch-icon.png +0 -0
  7. package/assets/branch-icon@2x.png +0 -0
  8. package/assets/branch-icon@3x.png +0 -0
  9. package/assets/check-icon-light.png +0 -0
  10. package/assets/check-icon-light@2x.png +0 -0
  11. package/assets/check-icon-light@3x.png +0 -0
  12. package/assets/check-icon.png +0 -0
  13. package/assets/check-icon@2x.png +0 -0
  14. package/assets/check-icon@3x.png +0 -0
  15. package/assets/clipboard-icon.png +0 -0
  16. package/assets/clipboard-icon@2x.png +0 -0
  17. package/assets/clipboard-icon@3x.png +0 -0
  18. package/assets/debug-icon.png +0 -0
  19. package/assets/debug-icon@2x.png +0 -0
  20. package/assets/debug-icon@3x.png +0 -0
  21. package/assets/extensions-filled-active-icon-light.png +0 -0
  22. package/assets/extensions-filled-active-icon-light@2x.png +0 -0
  23. package/assets/extensions-filled-active-icon-light@3x.png +0 -0
  24. package/assets/extensions-filled-active-icon.png +0 -0
  25. package/assets/extensions-filled-active-icon@2x.png +0 -0
  26. package/assets/extensions-filled-active-icon@3x.png +0 -0
  27. package/assets/extensions-filled-inactive-icon-light.png +0 -0
  28. package/assets/extensions-filled-inactive-icon-light@2x.png +0 -0
  29. package/assets/extensions-filled-inactive-icon-light@3x.png +0 -0
  30. package/assets/extensions-filled-inactive-icon.png +0 -0
  31. package/assets/extensions-filled-inactive-icon@2x.png +0 -0
  32. package/assets/extensions-filled-inactive-icon@3x.png +0 -0
  33. package/assets/extensions-icon-light.png +0 -0
  34. package/assets/extensions-icon-light@2x.png +0 -0
  35. package/assets/extensions-icon-light@3x.png +0 -0
  36. package/assets/extensions-icon.png +0 -0
  37. package/assets/extensions-icon@2x.png +0 -0
  38. package/assets/extensions-icon@3x.png +0 -0
  39. package/assets/home-filled-active-icon-light.png +0 -0
  40. package/assets/home-filled-active-icon-light@2x.png +0 -0
  41. package/assets/home-filled-active-icon-light@3x.png +0 -0
  42. package/assets/home-filled-inactive-icon-light.png +0 -0
  43. package/assets/home-filled-inactive-icon-light@2x.png +0 -0
  44. package/assets/home-filled-inactive-icon-light@3x.png +0 -0
  45. package/assets/info-icon-light.png +0 -0
  46. package/assets/info-icon-light@2x.png +0 -0
  47. package/assets/info-icon-light@3x.png +0 -0
  48. package/assets/info-icon.png +0 -0
  49. package/assets/info-icon@2x.png +0 -0
  50. package/assets/info-icon@3x.png +0 -0
  51. package/assets/inspect-element-icon.png +0 -0
  52. package/assets/inspect-element-icon@2x.png +0 -0
  53. package/assets/inspect-element-icon@3x.png +0 -0
  54. package/assets/loading-indicator-icon.png +0 -0
  55. package/assets/loading-indicator-icon@2x.png +0 -0
  56. package/assets/loading-indicator-icon@3x.png +0 -0
  57. package/assets/performance-icon.png +0 -0
  58. package/assets/performance-icon@2x.png +0 -0
  59. package/assets/performance-icon@3x.png +0 -0
  60. package/assets/run-icon.png +0 -0
  61. package/assets/run-icon@2x.png +0 -0
  62. package/assets/run-icon@3x.png +0 -0
  63. package/assets/settings-filled-active-icon-light.png +0 -0
  64. package/assets/settings-filled-active-icon-light@2x.png +0 -0
  65. package/assets/settings-filled-active-icon-light@3x.png +0 -0
  66. package/assets/settings-filled-inactive-icon-light.png +0 -0
  67. package/assets/settings-filled-inactive-icon-light@2x.png +0 -0
  68. package/assets/settings-filled-inactive-icon-light@3x.png +0 -0
  69. package/assets/shake-device-icon-light.png +0 -0
  70. package/assets/shake-device-icon-light@2x.png +0 -0
  71. package/assets/shake-device-icon-light@3x.png +0 -0
  72. package/assets/show-menu-at-launch-icon-light.png +0 -0
  73. package/assets/show-menu-at-launch-icon-light@2x.png +0 -0
  74. package/assets/show-menu-at-launch-icon-light@3x.png +0 -0
  75. package/assets/three-finger-long-press-icon-light.png +0 -0
  76. package/assets/three-finger-long-press-icon-light@2x.png +0 -0
  77. package/assets/three-finger-long-press-icon-light@3x.png +0 -0
  78. package/assets/update-icon-light.png +0 -0
  79. package/assets/update-icon-light@2x.png +0 -0
  80. package/assets/update-icon-light@3x.png +0 -0
  81. package/assets/update-icon.png +0 -0
  82. package/assets/update-icon@2x.png +0 -0
  83. package/assets/update-icon@3x.png +0 -0
  84. package/assets/user-icon-light.png +0 -0
  85. package/assets/user-icon-light@2x.png +0 -0
  86. package/assets/user-icon-light@3x.png +0 -0
  87. package/assets/warning-triangle-icon-light.png +0 -0
  88. package/assets/warning-triangle-icon-light@2x.png +0 -0
  89. package/assets/warning-triangle-icon-light@3x.png +0 -0
  90. package/assets/warning-triangle-icon.png +0 -0
  91. package/assets/warning-triangle-icon@2x.png +0 -0
  92. package/assets/warning-triangle-icon@3x.png +0 -0
  93. package/assets/x-icon-light.png +0 -0
  94. package/assets/x-icon-light@2x.png +0 -0
  95. package/assets/x-icon-light@3x.png +0 -0
  96. package/assets/x-icon.png +0 -0
  97. package/assets/x-icon@2x.png +0 -0
  98. package/assets/x-icon@3x.png +0 -0
  99. package/build/Button.d.ts +46 -22
  100. package/build/Button.d.ts.map +1 -0
  101. package/build/Button.js +4 -3
  102. package/build/Button.js.map +1 -1
  103. package/build/Image.d.ts +7 -1
  104. package/build/Image.d.ts.map +1 -0
  105. package/build/Image.js +1 -1
  106. package/build/Image.js.map +1 -1
  107. package/build/Text.d.ts +36 -10
  108. package/build/Text.d.ts.map +1 -0
  109. package/build/Text.js +30 -21
  110. package/build/Text.js.map +1 -1
  111. package/build/View.d.ts +80 -28
  112. package/build/View.d.ts.map +1 -0
  113. package/build/View.js +93 -43
  114. package/build/View.js.map +1 -1
  115. package/build/create-primitive.d.ts +41 -0
  116. package/build/create-primitive.d.ts.map +1 -0
  117. package/build/create-primitive.js +73 -0
  118. package/build/create-primitive.js.map +1 -0
  119. package/build/icons/BranchIcon.d.ts +4 -0
  120. package/build/icons/BranchIcon.d.ts.map +1 -0
  121. package/build/icons/BranchIcon.js +11 -0
  122. package/build/icons/BranchIcon.js.map +1 -0
  123. package/build/icons/CheckIcon.d.ts +1 -0
  124. package/build/icons/CheckIcon.d.ts.map +1 -0
  125. package/build/icons/CheckIcon.js +5 -1
  126. package/build/icons/CheckIcon.js.map +1 -1
  127. package/build/icons/ChevronRightIcon.d.ts +1 -0
  128. package/build/icons/ChevronRightIcon.d.ts.map +1 -0
  129. package/build/icons/ClipboardIcon.d.ts +4 -0
  130. package/build/icons/ClipboardIcon.d.ts.map +1 -0
  131. package/build/icons/ClipboardIcon.js +7 -0
  132. package/build/icons/ClipboardIcon.js.map +1 -0
  133. package/build/icons/DebugIcon.d.ts +4 -0
  134. package/build/icons/DebugIcon.d.ts.map +1 -0
  135. package/build/icons/DebugIcon.js +7 -0
  136. package/build/icons/DebugIcon.js.map +1 -0
  137. package/build/icons/ExpoLogoIcon.d.ts +1 -0
  138. package/build/icons/ExpoLogoIcon.d.ts.map +1 -0
  139. package/build/icons/ExtensionsFilledIcon.d.ts +8 -0
  140. package/build/icons/ExtensionsFilledIcon.d.ts.map +1 -0
  141. package/build/icons/ExtensionsFilledIcon.js +24 -0
  142. package/build/icons/ExtensionsFilledIcon.js.map +1 -0
  143. package/build/icons/ExtensionsIcon.d.ts +4 -0
  144. package/build/icons/ExtensionsIcon.d.ts.map +1 -0
  145. package/build/icons/ExtensionsIcon.js +11 -0
  146. package/build/icons/ExtensionsIcon.js.map +1 -0
  147. package/build/icons/HomeFilledIcon.d.ts +1 -0
  148. package/build/icons/HomeFilledIcon.d.ts.map +1 -0
  149. package/build/icons/HomeFilledIcon.js +16 -1
  150. package/build/icons/HomeFilledIcon.js.map +1 -1
  151. package/build/icons/InfoIcon.d.ts +1 -0
  152. package/build/icons/InfoIcon.d.ts.map +1 -0
  153. package/build/icons/InfoIcon.js +5 -1
  154. package/build/icons/InfoIcon.js.map +1 -1
  155. package/build/icons/InspectElementIcon.d.ts +4 -0
  156. package/build/icons/InspectElementIcon.d.ts.map +1 -0
  157. package/build/icons/InspectElementIcon.js +7 -0
  158. package/build/icons/InspectElementIcon.js.map +1 -0
  159. package/build/icons/LoadingIndicatorIcon.d.ts +4 -0
  160. package/build/icons/LoadingIndicatorIcon.d.ts.map +1 -0
  161. package/build/icons/LoadingIndicatorIcon.js +7 -0
  162. package/build/icons/LoadingIndicatorIcon.js.map +1 -0
  163. package/build/icons/PerformanceIcon.d.ts +4 -0
  164. package/build/icons/PerformanceIcon.d.ts.map +1 -0
  165. package/build/icons/PerformanceIcon.js +7 -0
  166. package/build/icons/PerformanceIcon.js.map +1 -0
  167. package/build/icons/QuestionMarkIcon.d.ts +1 -0
  168. package/build/icons/QuestionMarkIcon.d.ts.map +1 -0
  169. package/build/icons/RefreshIcon.d.ts +1 -0
  170. package/build/icons/RefreshIcon.d.ts.map +1 -0
  171. package/build/icons/RunIcon.d.ts +4 -0
  172. package/build/icons/RunIcon.d.ts.map +1 -0
  173. package/build/icons/RunIcon.js +7 -0
  174. package/build/icons/RunIcon.js.map +1 -0
  175. package/build/icons/SettingsFilledIcon.d.ts +1 -0
  176. package/build/icons/SettingsFilledIcon.d.ts.map +1 -0
  177. package/build/icons/SettingsFilledIcon.js +16 -1
  178. package/build/icons/SettingsFilledIcon.js.map +1 -1
  179. package/build/icons/ShakeDeviceIcon.d.ts +1 -0
  180. package/build/icons/ShakeDeviceIcon.d.ts.map +1 -0
  181. package/build/icons/ShakeDeviceIcon.js +5 -1
  182. package/build/icons/ShakeDeviceIcon.js.map +1 -1
  183. package/build/icons/ShowMenuIcon.d.ts +1 -0
  184. package/build/icons/ShowMenuIcon.d.ts.map +1 -0
  185. package/build/icons/ShowMenuIcon.js +5 -1
  186. package/build/icons/ShowMenuIcon.js.map +1 -1
  187. package/build/icons/TerminalIcon.d.ts +1 -0
  188. package/build/icons/TerminalIcon.d.ts.map +1 -0
  189. package/build/icons/ThreeFingerPressIcon.d.ts +1 -0
  190. package/build/icons/ThreeFingerPressIcon.d.ts.map +1 -0
  191. package/build/icons/ThreeFingerPressIcon.js +5 -1
  192. package/build/icons/ThreeFingerPressIcon.js.map +1 -1
  193. package/build/icons/ToolbarOverlayIcon.d.ts +1 -0
  194. package/build/icons/ToolbarOverlayIcon.d.ts.map +1 -0
  195. package/build/icons/UpdateIcon.d.ts +4 -0
  196. package/build/icons/UpdateIcon.d.ts.map +1 -0
  197. package/build/icons/UpdateIcon.js +11 -0
  198. package/build/icons/UpdateIcon.js.map +1 -0
  199. package/build/icons/UserIcon.d.ts +1 -0
  200. package/build/icons/UserIcon.d.ts.map +1 -0
  201. package/build/icons/UserIcon.js +5 -1
  202. package/build/icons/UserIcon.js.map +1 -1
  203. package/build/icons/WarningIcon.d.ts +4 -0
  204. package/build/icons/WarningIcon.d.ts.map +1 -0
  205. package/build/icons/WarningIcon.js +11 -0
  206. package/build/icons/WarningIcon.js.map +1 -0
  207. package/build/icons/XIcon.d.ts +1 -0
  208. package/build/icons/XIcon.d.ts.map +1 -0
  209. package/build/icons/XIcon.js +5 -1
  210. package/build/icons/XIcon.js.map +1 -1
  211. package/build/icons/index.d.ts +13 -1
  212. package/build/icons/index.d.ts.map +1 -0
  213. package/build/icons/index.js +12 -1
  214. package/build/icons/index.js.map +1 -1
  215. package/build/index.d.ts +1 -0
  216. package/build/index.d.ts.map +1 -0
  217. package/build/theme.d.ts +128 -131
  218. package/build/theme.d.ts.map +1 -0
  219. package/build/theme.js +77 -73
  220. package/build/theme.js.map +1 -1
  221. package/build/useExpoTheme.d.ts +236 -0
  222. package/build/useExpoTheme.d.ts.map +1 -0
  223. package/build/useExpoTheme.js +24 -3
  224. package/build/useExpoTheme.js.map +1 -1
  225. package/package.json +15 -9
  226. package/setupTests.js +35 -0
  227. package/src/Button.tsx +4 -3
  228. package/src/Image.tsx +1 -1
  229. package/src/Text.tsx +35 -21
  230. package/src/View.tsx +115 -44
  231. package/src/create-primitive.tsx +128 -0
  232. package/src/icons/BranchIcon.tsx +14 -0
  233. package/src/icons/CheckIcon.tsx +6 -1
  234. package/src/icons/ClipboardIcon.tsx +9 -0
  235. package/src/icons/DebugIcon.tsx +9 -0
  236. package/src/icons/ExtensionsFilledIcon.tsx +31 -0
  237. package/src/icons/ExtensionsIcon.tsx +14 -0
  238. package/src/icons/HomeFilledIcon.tsx +17 -1
  239. package/src/icons/InfoIcon.tsx +6 -1
  240. package/src/icons/InspectElementIcon.tsx +9 -0
  241. package/src/icons/LoadingIndicatorIcon.tsx +9 -0
  242. package/src/icons/PerformanceIcon.tsx +9 -0
  243. package/src/icons/RunIcon.tsx +9 -0
  244. package/src/icons/SettingsFilledIcon.tsx +17 -1
  245. package/src/icons/ShakeDeviceIcon.tsx +6 -1
  246. package/src/icons/ShowMenuIcon.tsx +6 -1
  247. package/src/icons/ThreeFingerPressIcon.tsx +6 -1
  248. package/src/icons/UpdateIcon.tsx +14 -0
  249. package/src/icons/UserIcon.tsx +6 -1
  250. package/src/icons/WarningIcon.tsx +14 -0
  251. package/src/icons/XIcon.tsx +6 -1
  252. package/src/icons/index.ts +12 -1
  253. package/src/theme.ts +90 -78
  254. package/src/useExpoTheme.tsx +50 -0
  255. package/src/useExpoTheme.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 1.1.0 — 2022-04-18
14
+
15
+ ### 🎉 New features
16
+
17
+ - Extend components to include the spacing scale from `@expo/styleguide-native` ([#16309](https://github.com/expo/expo/pull/16309) by [@ajsmth](https://github.com/ajsmth))
18
+
13
19
  ## 1.0.0 — 2021-12-22
14
20
 
15
21
  _This version does not introduce any user-facing changes._
package/README.md CHANGED
@@ -24,6 +24,135 @@ function ExampleRow() {
24
24
  }
25
25
  ```
26
26
 
27
+ ### Documentation
28
+
29
+ `create-primitive` is a utility that generates a set of themed react-native components.
30
+
31
+ Features:
32
+
33
+ - theme-ability
34
+ - typesafety
35
+ - clear and flexible API
36
+
37
+ ## API
38
+
39
+ ```tsx
40
+ import { Text } from 'react-native';
41
+ import { create } from './create-primitives';
42
+
43
+ const Heading = create(Text, {
44
+ base: {
45
+ fontFamily: 'Helvetica',
46
+ },
47
+
48
+ variants: {
49
+ size: {
50
+ large: {
51
+ fontSize: 28,
52
+ lineHeight: 34,
53
+ },
54
+ medium: {
55
+ fontSize: 22,
56
+ lineHeight: 28,
57
+ },
58
+ small: {
59
+ fontSize: 18,
60
+ lineHeight: 22,
61
+ },
62
+ },
63
+ color: {
64
+ success: {
65
+ color: 'green',
66
+ },
67
+ danger: {
68
+ color: 'red',
69
+ },
70
+ },
71
+ },
72
+ });
73
+ ```
74
+
75
+ This above produces a `Heading` component that can be used like so:
76
+
77
+ ```tsx
78
+ function App() {
79
+ return (
80
+ <Heading size="medium" color="success">
81
+ Hi
82
+ </Heading>
83
+ );
84
+ }
85
+ ```
86
+
87
+ All of the variants are captured by typescript which makes using them a breeze.
88
+
89
+ ## Declarative Selectors
90
+
91
+ We can extend the `Heading` component above with selectors:
92
+
93
+ ```tsx
94
+ const Heading = create(RNText, {
95
+ variants: {
96
+ // ....
97
+ },
98
+ selectors: {
99
+ // when device theme is 'light'...
100
+ light: {
101
+ color: {
102
+ // ...any `Heading` with `color="success"`...
103
+ success: {
104
+ // ...will have these styles applied
105
+ color: 'green',
106
+ },
107
+ },
108
+ },
109
+ },
110
+ });
111
+ ```
112
+
113
+ You can also pass selectors to primitives for one-off instances where you need a specific style:
114
+
115
+ ```tsx
116
+ function App() {
117
+ return (
118
+ <View>
119
+ <Heading
120
+ selectors={{
121
+ dark: { color: 'green' },
122
+ light: { color: 'blue' },
123
+ }}>
124
+ Hi
125
+ </Heading>
126
+ </View>
127
+ );
128
+ }
129
+ ```
130
+
131
+ ## Flexibility
132
+
133
+ You can use any style library you'd like - for example using tailwind for a terser, readable configuration.
134
+
135
+ ```tsx
136
+ import tw from 'somewhere';
137
+ import { create } from './create-primitives';
138
+
139
+ const Heading = create(RNText, {
140
+ size: {
141
+ large: tw('text-4xl'),
142
+ medium: tw('text-3xl'),
143
+ small: tw('text-2xl'),
144
+ },
145
+ weight: {
146
+ normal: tw('font-medium'),
147
+ heavy: tw('font-semibold'),
148
+ },
149
+ color: {
150
+ success: tw('text-green-500'),
151
+ danger: tw('text-red-500'),
152
+ },
153
+ });
154
+ ```
155
+
27
156
  ## Installation in managed Expo projects
28
157
 
29
158
  There are no native dependencies exported and so this module should be compatible with any RN project
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/assets/x-icon.png CHANGED
Binary file
Binary file
Binary file
package/build/Button.d.ts CHANGED
@@ -3,36 +3,54 @@ import { Animated } from 'react-native';
3
3
  declare const Container: React.ForwardRefExoticComponent<Pick<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>> & {
4
4
  children?: React.ReactNode;
5
5
  } & {
6
- margin?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
7
- mx?: "small" | "medium" | "large" | "micro" | "tiny" | undefined;
8
- my?: "small" | "medium" | "large" | "micro" | "tiny" | undefined;
9
- padding?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
10
- px?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
11
- py?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
12
- rounded?: "none" | "small" | "medium" | "large" | "full" | undefined;
13
- roundedTop?: "none" | "small" | "medium" | "large" | "full" | undefined;
14
- roundedBottom?: "none" | "small" | "medium" | "large" | "full" | undefined;
6
+ margin?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
7
+ mx?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
8
+ my?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
9
+ mb?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
10
+ mt?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
11
+ padding?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
12
+ px?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
13
+ py?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
14
+ pb?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
15
+ pt?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
16
+ rounded?: "small" | "medium" | "large" | "none" | "full" | undefined;
17
+ roundedTop?: "small" | "medium" | "large" | "none" | "full" | undefined;
18
+ roundedBottom?: "small" | "medium" | "large" | "none" | "full" | undefined;
15
19
  bg?: "transparent" | "primary" | "secondary" | "tertiary" | "ghost" | "default" | "disabled" | undefined;
16
20
  border?: "ghost" | undefined;
17
21
  shadow?: "button" | undefined;
18
- }, keyof import("react-native").PressableProps | "key" | "bg" | "border" | "shadow" | "margin" | "mx" | "my" | "padding" | "px" | "py" | "rounded" | "roundedTop" | "roundedBottom"> & React.RefAttributes<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>>>;
22
+ } & {
23
+ selectors?: {
24
+ light?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
25
+ dark?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
26
+ } | undefined;
27
+ }, "selectors" | "padding" | "margin" | keyof import("react-native").PressableProps | "key" | "bg" | "border" | "shadow" | "mx" | "my" | "mb" | "mt" | "px" | "py" | "pb" | "pt" | "rounded" | "roundedTop" | "roundedBottom"> & React.RefAttributes<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>>>;
19
28
  export declare const Button: {
20
29
  Container: React.ForwardRefExoticComponent<Pick<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>> & {
21
30
  children?: React.ReactNode;
22
31
  } & {
23
- margin?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
24
- mx?: "small" | "medium" | "large" | "micro" | "tiny" | undefined;
25
- my?: "small" | "medium" | "large" | "micro" | "tiny" | undefined;
26
- padding?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
27
- px?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
28
- py?: "small" | "medium" | "large" | "micro" | "tiny" | "xl" | undefined;
29
- rounded?: "none" | "small" | "medium" | "large" | "full" | undefined;
30
- roundedTop?: "none" | "small" | "medium" | "large" | "full" | undefined;
31
- roundedBottom?: "none" | "small" | "medium" | "large" | "full" | undefined;
32
+ margin?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
33
+ mx?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
34
+ my?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
35
+ mb?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
36
+ mt?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
37
+ padding?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
38
+ px?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
39
+ py?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
40
+ pb?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
41
+ pt?: "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | ("small" | "micro" | "tiny" | "medium" | "large" | "xl") | undefined;
42
+ rounded?: "small" | "medium" | "large" | "none" | "full" | undefined;
43
+ roundedTop?: "small" | "medium" | "large" | "none" | "full" | undefined;
44
+ roundedBottom?: "small" | "medium" | "large" | "none" | "full" | undefined;
32
45
  bg?: "transparent" | "primary" | "secondary" | "tertiary" | "ghost" | "default" | "disabled" | undefined;
33
46
  border?: "ghost" | undefined;
34
47
  shadow?: "button" | undefined;
35
- }, keyof import("react-native").PressableProps | "key" | "bg" | "border" | "shadow" | "margin" | "mx" | "my" | "padding" | "px" | "py" | "rounded" | "roundedTop" | "roundedBottom"> & React.RefAttributes<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>>>;
48
+ } & {
49
+ selectors?: {
50
+ light?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
51
+ dark?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
52
+ } | undefined;
53
+ }, "selectors" | "padding" | "margin" | keyof import("react-native").PressableProps | "key" | "bg" | "border" | "shadow" | "mx" | "my" | "mb" | "mt" | "px" | "py" | "pb" | "pt" | "rounded" | "roundedTop" | "roundedBottom"> & React.RefAttributes<Animated.AnimatedProps<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>>>;
36
54
  ScaleOnPressContainer: typeof ScaleOnPressContainer;
37
55
  Text: React.ForwardRefExoticComponent<import("react-native").TextProps & {
38
56
  children?: React.ReactNode;
@@ -41,8 +59,13 @@ export declare const Button: {
41
59
  align?: "center" | undefined;
42
60
  size?: "small" | "medium" | "large" | undefined;
43
61
  leading?: "large" | undefined;
44
- type?: "mono" | undefined;
45
- weight?: "normal" | "bold" | "medium" | "thin" | "extralight" | "light" | "semibold" | "extrabold" | "black" | undefined;
62
+ type?: "mono" | "InterBlack" | "InterBlackItalic" | "InterBold" | "InterBoldItalic" | "InterExtraBold" | "InterExtraBoldItalic" | "InterExtraLight" | "InterExtraLightItalic" | "InterRegular" | "InterItalic" | "InterLight" | "InterLightItalic" | "InterMedium" | "InterMediumItalic" | "InterSemiBold" | "InterSemiBoldItalic" | "InterThin" | "InterThinItalic" | undefined;
63
+ weight?: "light" | "bold" | "medium" | "thin" | "extralight" | "normal" | "semibold" | "extrabold" | "black" | undefined;
64
+ } & {
65
+ selectors?: {
66
+ light?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
67
+ dark?: (import("react-native").ViewStyle | import("react-native").TextStyle | import("react-native").ImageStyle) | undefined;
68
+ } | undefined;
46
69
  } & React.RefAttributes<import("react-native").TextProps>>;
47
70
  };
48
71
  declare type ScalingPressableProps = {
@@ -50,3 +73,4 @@ declare type ScalingPressableProps = {
50
73
  };
51
74
  declare function ScaleOnPressContainer({ minScale, ...props }: React.ComponentProps<typeof Container> & ScalingPressableProps): JSX.Element;
52
75
  export {};
76
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkB,QAAQ,EAA4C,MAAM,cAAc,CAAC;AAkDlG,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;uWAgDb,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlB,CAAC;AAEF,aAAK,qBAAqB,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkCF,iBAAS,qBAAqB,CAAC,EAC7B,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG,qBAAqB,eAoDhE"}
package/build/Button.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { lightTheme, darkTheme, borderRadius, shadows, palette } from '@expo/styleguide-native';
2
2
  import * as React from 'react';
3
- import { Pressable as RNPressable, Text as RNText, Animated, useColorScheme } from 'react-native';
4
- import { create } from 'react-native-primitives';
3
+ import { Text as RNText, Animated, useColorScheme, Pressable as RNPressable } from 'react-native';
4
+ import { create } from './create-primitive';
5
5
  import { rounded, margin, padding, text } from './theme';
6
6
  const AnimatedPressable = Animated.createAnimatedComponent(RNPressable);
7
7
  const Text = create(RNText, {
8
8
  base: {
9
- fontWeight: '400',
9
+ fontFamily: 'Inter-Regular',
10
10
  color: lightTheme.text.default,
11
11
  fontSize: 16,
12
+ lineHeight: 22,
12
13
  },
13
14
  props: {
14
15
  accessib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AAC,CAAC;KACtD;IAED,MAAM,aAAa,GAAG;QACpB,eAAe;KAChB,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,KAAM,KAAK,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC;QACrF,oBAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,aAAa,IAAG,KAAK,CAAC,QAAQ,CAAiB,CAC3D,CACb,CAAC;AACJ,CAAC","sourcesContent":["import { lightTheme, darkTheme, borderRadius, shadows, palette } from '@expo/styleguide-native';\nimport * as React from 'react';\nimport { Pressable as RNPressable, Text as RNText, Animated, useColorScheme } from 'react-native';\nimport { create } from 'react-native-primitives';\n\nimport { rounded, margin, padding, text } from './theme';\n\nconst AnimatedPressable = Animated.createAnimatedComponent(RNPressable);\n\nconst Text = create(RNText, {\n base: {\n fontWeight: '400',\n color: lightTheme.text.default,\n fontSize: 16,\n },\n\n props: {\n accessibilityRole: 'text',\n },\n\n variants: {\n ...text,\n\n color: {\n primary: { color: lightTheme.button.primary.foreground },\n secondary: { color: lightTheme.button.secondary.foreground },\n tertiary: { color: lightTheme.button.tertiary.foreground },\n ghost: { color: lightTheme.button.ghost.foreground },\n transparent: { color: lightTheme.button.transparent.foreground },\n default: { color: lightTheme.text.default },\n },\n },\n\n selectors: {\n dark: {\n base: {\n color: darkTheme.text.default,\n },\n\n color: {\n primary: { color: darkTheme.button.primary.foreground },\n secondary: { color: darkTheme.button.secondary.foreground },\n tertiary: { color: darkTheme.button.tertiary.foreground },\n ghost: { color: darkTheme.button.ghost.foreground },\n transparent: { color: darkTheme.button.transparent.foreground },\n default: { color: darkTheme.text.default },\n },\n },\n },\n});\n\nconst Container = create(AnimatedPressable, {\n base: {\n overflow: 'hidden',\n borderRadius: borderRadius.medium,\n },\n\n props: {\n accessibilityRole: 'button',\n android_disableSound: true,\n },\n\n variants: {\n bg: {\n default: { backgroundColor: lightTheme.background.default },\n primary: { backgroundColor: lightTheme.button.primary.background },\n secondary: { backgroundColor: lightTheme.button.secondary.background },\n tertiary: { backgroundColor: lightTheme.button.tertiary.background },\n ghost: { backgroundColor: lightTheme.button.ghost.background },\n transparent: { backgroundColor: lightTheme.button.transparent.background },\n disabled: { backgroundColor: lightTheme.status.default },\n },\n\n border: {\n ghost: { borderColor: lightTheme.button.ghost.border, borderWidth: 1 },\n },\n\n shadow: {\n button: shadows.button,\n },\n\n ...rounded,\n ...padding,\n ...margin,\n },\n\n selectors: {\n dark: {\n bg: {\n default: { backgroundColor: darkTheme.background.default },\n primary: { backgroundColor: darkTheme.button.primary.background },\n secondary: { backgroundColor: darkTheme.button.secondary.background },\n tertiary: { backgroundColor: darkTheme.button.tertiary.background },\n ghost: { backgroundColor: darkTheme.button.ghost.background },\n transparent: { backgroundColor: darkTheme.button.transparent.background },\n disabled: { backgroundColor: darkTheme.status.default },\n },\n },\n },\n});\n\nexport const Button = {\n Container,\n ScaleOnPressContainer,\n Text,\n};\n\ntype ScalingPressableProps = {\n minScale?: number;\n};\n\ntype NoOptionals<T> = {\n [P in keyof T]-?: T[P];\n};\n\ntype ContainerProps = React.ComponentProps<typeof Container>;\ntype ContainerBackgroundColors = NoOptionals<ContainerProps>['bg'];\n\nconst lightHighlightColorMap: Record<ContainerBackgroundColors, string> = {\n disabled: 'transparent',\n default: lightTheme.background.secondary,\n primary: lightTheme.background.tertiary,\n secondary: lightTheme.background.quaternary,\n tertiary: palette.light.gray[600],\n ghost: lightTheme.background.tertiary,\n transparent: lightTheme.background.secondary,\n};\n\nconst darkHighlightColorMap: Record<ContainerBackgroundColors, string> = {\n disabled: 'transparent',\n default: darkTheme.background.secondary,\n primary: darkTheme.background.tertiary,\n secondary: darkTheme.background.quaternary,\n tertiary: palette.dark.gray[600],\n ghost: darkTheme.background.tertiary,\n transparent: darkTheme.background.secondary,\n};\n\nconst highlightColorMap = {\n dark: darkHighlightColorMap,\n light: lightHighlightColorMap,\n};\n\nfunction ScaleOnPressContainer({\n minScale = 0.975,\n ...props\n}: React.ComponentProps<typeof Container> & ScalingPressableProps) {\n const theme = useColorScheme();\n const animatedValue = React.useRef(new Animated.Value(0));\n const [isPressing, setIsPressing] = React.useState(false);\n\n const onPressIn = React.useCallback(() => {\n setIsPressing(true);\n\n Animated.spring(animatedValue.current, {\n toValue: 1,\n stiffness: 1000,\n damping: 500,\n mass: 3,\n overshootClamping: true,\n useNativeDriver: true,\n }).start();\n }, []);\n\n const onPressOut = React.useCallback(() => {\n setIsPressing(false);\n Animated.spring(animatedValue.current, {\n toValue: 0,\n stiffness: 1000,\n damping: 500,\n mass: 3,\n overshootClamping: true,\n useNativeDriver: true,\n }).start();\n }, []);\n\n const scale = animatedValue.current.interpolate({\n inputRange: [0, 1],\n outputRange: [1, minScale],\n });\n\n const scaleStyle = { transform: [{ scale }] };\n\n let backgroundColor = 'transparent';\n\n if (props.bg && isPressing && theme != null) {\n backgroundColor = highlightColorMap[theme][props.bg];\n }\n\n const underlayStyle = {\n backgroundColor,\n };\n\n return (\n <Container onPressIn={onPressIn} onPressOut={onPressOut} {...props} style={[scaleStyle]}>\n <Animated.View style={underlayStyle}>{props.children}</Animated.View>\n </Container>\n );\n}\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,iBAAiB,GAAG,QAAQ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C,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE;YACrC,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,GAAG;YACZ,IAAI,EAAE,CAAC;YACP,iBAAiB,EAAE,IAAI;YACvB,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC,KAAK,EAAE,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC;QAC9C,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC;KAC3B,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAE9C,IAAI,eAAe,GAAG,aAAa,CAAC;IAEpC,IAAI,KAAK,CAAC,EAAE,IAAI,UAAU,IAAI,KAAK,IAAI,IAAI,EAAE;QAC3C,eAAe,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KACtD;IAED,MAAM,aAAa,GAAG;QACpB,eAAe;KAChB,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,KAAM,KAAK,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC;QACrF,oBAAC,QAAQ,CAAC,IAAI,IAAC,KAAK,EAAE,aAAa,IAAG,KAAK,CAAC,QAAQ,CAAiB,CAC3D,CACb,CAAC;AACJ,CAAC","sourcesContent":["import { lightTheme, darkTheme, borderRadius, shadows, palette } from '@expo/styleguide-native';\nimport * as React from 'react';\nimport { Text as RNText, Animated, useColorScheme, Pressable as RNPressable } from 'react-native';\n\nimport { create } from './create-primitive';\nimport { rounded, margin, padding, text } from './theme';\n\nconst AnimatedPressable = Animated.createAnimatedComponent(RNPressable);\n\nconst Text = create(RNText, {\n base: {\n fontFamily: 'Inter-Regular',\n color: lightTheme.text.default,\n fontSize: 16,\n lineHeight: 22,\n },\n\n props: {\n accessibilityRole: 'text',\n },\n\n variants: {\n ...text,\n\n color: {\n primary: { color: lightTheme.button.primary.foreground },\n secondary: { color: lightTheme.button.secondary.foreground },\n tertiary: { color: lightTheme.button.tertiary.foreground },\n ghost: { color: lightTheme.button.ghost.foreground },\n transparent: { color: lightTheme.button.transparent.foreground },\n default: { color: lightTheme.text.default },\n },\n },\n\n selectors: {\n dark: {\n base: {\n color: darkTheme.text.default,\n },\n\n color: {\n primary: { color: darkTheme.button.primary.foreground },\n secondary: { color: darkTheme.button.secondary.foreground },\n tertiary: { color: darkTheme.button.tertiary.foreground },\n ghost: { color: darkTheme.button.ghost.foreground },\n transparent: { color: darkTheme.button.transparent.foreground },\n default: { color: darkTheme.text.default },\n },\n },\n },\n});\n\nconst Container = create(AnimatedPressable, {\n base: {\n overflow: 'hidden',\n borderRadius: borderRadius.medium,\n },\n\n props: {\n accessibilityRole: 'button',\n android_disableSound: true,\n },\n\n variants: {\n bg: {\n default: { backgroundColor: lightTheme.background.default },\n primary: { backgroundColor: lightTheme.button.primary.background },\n secondary: { backgroundColor: lightTheme.button.secondary.background },\n tertiary: { backgroundColor: lightTheme.button.tertiary.background },\n ghost: { backgroundColor: lightTheme.button.ghost.background },\n transparent: { backgroundColor: lightTheme.button.transparent.background },\n disabled: { backgroundColor: lightTheme.status.default },\n },\n\n border: {\n ghost: { borderColor: lightTheme.button.ghost.border, borderWidth: 1 },\n },\n\n shadow: {\n button: shadows.button,\n },\n\n ...rounded,\n ...padding,\n ...margin,\n },\n\n selectors: {\n dark: {\n bg: {\n default: { backgroundColor: darkTheme.background.default },\n primary: { backgroundColor: darkTheme.button.primary.background },\n secondary: { backgroundColor: darkTheme.button.secondary.background },\n tertiary: { backgroundColor: darkTheme.button.tertiary.background },\n ghost: { backgroundColor: darkTheme.button.ghost.background },\n transparent: { backgroundColor: darkTheme.button.transparent.background },\n disabled: { backgroundColor: darkTheme.status.default },\n },\n },\n },\n});\n\nexport const Button = {\n Container,\n ScaleOnPressContainer,\n Text,\n};\n\ntype ScalingPressableProps = {\n minScale?: number;\n};\n\ntype NoOptionals<T> = {\n [P in keyof T]-?: T[P];\n};\n\ntype ContainerProps = React.ComponentProps<typeof Container>;\ntype ContainerBackgroundColors = NoOptionals<ContainerProps>['bg'];\n\nconst lightHighlightColorMap: Record<ContainerBackgroundColors, string> = {\n disabled: 'transparent',\n default: lightTheme.background.secondary,\n primary: lightTheme.background.tertiary,\n secondary: lightTheme.background.quaternary,\n tertiary: palette.light.gray[600],\n ghost: lightTheme.background.tertiary,\n transparent: lightTheme.background.secondary,\n};\n\nconst darkHighlightColorMap: Record<ContainerBackgroundColors, string> = {\n disabled: 'transparent',\n default: darkTheme.background.secondary,\n primary: darkTheme.background.tertiary,\n secondary: darkTheme.background.quaternary,\n tertiary: palette.dark.gray[600],\n ghost: darkTheme.background.tertiary,\n transparent: darkTheme.background.secondary,\n};\n\nconst highlightColorMap = {\n dark: darkHighlightColorMap,\n light: lightHighlightColorMap,\n};\n\nfunction ScaleOnPressContainer({\n minScale = 0.975,\n ...props\n}: React.ComponentProps<typeof Container> & ScalingPressableProps) {\n const theme = useColorScheme();\n const animatedValue = React.useRef(new Animated.Value(0));\n const [isPressing, setIsPressing] = React.useState(false);\n\n const onPressIn = React.useCallback(() => {\n setIsPressing(true);\n\n Animated.spring(animatedValue.current, {\n toValue: 1,\n stiffness: 1000,\n damping: 500,\n mass: 3,\n overshootClamping: true,\n useNativeDriver: true,\n }).start();\n }, []);\n\n const onPressOut = React.useCallback(() => {\n setIsPressing(false);\n Animated.spring(animatedValue.current, {\n toValue: 0,\n stiffness: 1000,\n damping: 500,\n mass: 3,\n overshootClamping: true,\n useNativeDriver: true,\n }).start();\n }, []);\n\n const scale = animatedValue.current.interpolate({\n inputRange: [0, 1],\n outputRange: [1, minScale],\n });\n\n const scaleStyle = { transform: [{ scale }] };\n\n let backgroundColor = 'transparent';\n\n if (props.bg && isPressing && theme != null) {\n backgroundColor = highlightColorMap[theme][props.bg];\n }\n\n const underlayStyle = {\n backgroundColor,\n };\n\n return (\n <Container onPressIn={onPressIn} onPressOut={onPressOut} {...props} style={[scaleStyle]}>\n <Animated.View style={underlayStyle}>{props.children}</Animated.View>\n </Container>\n );\n}\n"]}