@swan-io/lake 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 (288) hide show
  1. package/HISTORY.md +3 -0
  2. package/LICENSE +21 -0
  3. package/README.md +49 -0
  4. package/package.json +60 -0
  5. package/src/components/Alert.d.ts +10 -0
  6. package/src/components/Alert.js +36 -0
  7. package/src/components/AppOpeningAnimation.d.ts +10 -0
  8. package/src/components/AppOpeningAnimation.js +50 -0
  9. package/src/components/AutoWidthImage.d.ts +8 -0
  10. package/src/components/AutoWidthImage.js +26 -0
  11. package/src/components/Avatar.d.ts +7 -0
  12. package/src/components/Avatar.js +42 -0
  13. package/src/components/BorderedButton.d.ts +16 -0
  14. package/src/components/BorderedButton.js +98 -0
  15. package/src/components/BorderedIcon.d.ts +12 -0
  16. package/src/components/BorderedIcon.js +25 -0
  17. package/src/components/BottomPanel.d.ts +9 -0
  18. package/src/components/BottomPanel.js +94 -0
  19. package/src/components/Box.d.ts +65 -0
  20. package/src/components/Box.js +31 -0
  21. package/src/components/Breadcrumbs.d.ts +18 -0
  22. package/src/components/Breadcrumbs.js +362 -0
  23. package/src/components/Button.d.ts +15 -0
  24. package/src/components/Button.js +83 -0
  25. package/src/components/Caption.d.ts +6 -0
  26. package/src/components/Caption.js +11 -0
  27. package/src/components/Checkbox.d.ts +12 -0
  28. package/src/components/Checkbox.js +83 -0
  29. package/src/components/ChoicePicker.d.ts +11 -0
  30. package/src/components/ChoicePicker.js +99 -0
  31. package/src/components/Combobox.d.ts +29 -0
  32. package/src/components/Combobox.js +182 -0
  33. package/src/components/FailureIcon.d.ts +8 -0
  34. package/src/components/FailureIcon.js +4 -0
  35. package/src/components/FileTile.d.ts +11 -0
  36. package/src/components/FileTile.js +37 -0
  37. package/src/components/Fill.d.ts +8 -0
  38. package/src/components/Fill.js +24 -0
  39. package/src/components/FilterChooser.d.ts +15 -0
  40. package/src/components/FilterChooser.js +52 -0
  41. package/src/components/Filters.d.ts +57 -0
  42. package/src/components/Filters.js +229 -0
  43. package/src/components/FixedListView.d.ts +104 -0
  44. package/src/components/FixedListView.js +821 -0
  45. package/src/components/FixedListViewCells.d.ts +55 -0
  46. package/src/components/FixedListViewCells.js +157 -0
  47. package/src/components/Flag.d.ts +8 -0
  48. package/src/components/Flag.js +36 -0
  49. package/src/components/FlowPresentation.d.ts +12 -0
  50. package/src/components/FlowPresentation.js +70 -0
  51. package/src/components/FocusTrap.d.ts +16 -0
  52. package/src/components/FocusTrap.js +90 -0
  53. package/src/components/Form.d.ts +8 -0
  54. package/src/components/Form.js +17 -0
  55. package/src/components/FullViewportLayer.d.ts +7 -0
  56. package/src/components/FullViewportLayer.js +91 -0
  57. package/src/components/Grid.d.ts +13 -0
  58. package/src/components/Grid.js +33 -0
  59. package/src/components/Heading.d.ts +61 -0
  60. package/src/components/Heading.js +27 -0
  61. package/src/components/Icon.d.ts +191 -0
  62. package/src/components/Icon.js +11 -0
  63. package/src/components/Input.d.ts +34 -0
  64. package/src/components/Input.js +115 -0
  65. package/src/components/InputError.d.ts +8 -0
  66. package/src/components/InputError.js +16 -0
  67. package/src/components/Label.d.ts +10 -0
  68. package/src/components/Label.js +19 -0
  69. package/src/components/LakeAlert.d.ts +14 -0
  70. package/src/components/LakeAlert.js +75 -0
  71. package/src/components/LakeButton.d.ts +36 -0
  72. package/src/components/LakeButton.js +171 -0
  73. package/src/components/LakeCheckbox.d.ts +16 -0
  74. package/src/components/LakeCheckbox.js +54 -0
  75. package/src/components/LakeCombobox.d.ts +28 -0
  76. package/src/components/LakeCombobox.js +166 -0
  77. package/src/components/LakeCopyButton.d.ts +10 -0
  78. package/src/components/LakeCopyButton.js +16 -0
  79. package/src/components/LakeDownloadButton.d.ts +8 -0
  80. package/src/components/LakeDownloadButton.js +6 -0
  81. package/src/components/LakeHeading.d.ts +10 -0
  82. package/src/components/LakeHeading.js +19 -0
  83. package/src/components/LakeLabel.d.ts +19 -0
  84. package/src/components/LakeLabel.js +43 -0
  85. package/src/components/LakeModal.d.ts +14 -0
  86. package/src/components/LakeModal.js +132 -0
  87. package/src/components/LakeRadio.d.ts +9 -0
  88. package/src/components/LakeRadio.js +44 -0
  89. package/src/components/LakeScrollView.d.ts +10 -0
  90. package/src/components/LakeScrollView.js +35 -0
  91. package/src/components/LakeSearchField.d.ts +10 -0
  92. package/src/components/LakeSearchField.js +111 -0
  93. package/src/components/LakeSelect.d.ts +30 -0
  94. package/src/components/LakeSelect.js +183 -0
  95. package/src/components/LakeSlider.d.ts +12 -0
  96. package/src/components/LakeSlider.js +31 -0
  97. package/src/components/LakeStepper.d.ts +21 -0
  98. package/src/components/LakeStepper.js +134 -0
  99. package/src/components/LakeText.d.ts +19 -0
  100. package/src/components/LakeText.js +20 -0
  101. package/src/components/LakeTextInput.d.ts +36 -0
  102. package/src/components/LakeTextInput.js +154 -0
  103. package/src/components/LakeTooltip.d.ts +24 -0
  104. package/src/components/LakeTooltip.js +188 -0
  105. package/src/components/Link.d.ts +138 -0
  106. package/src/components/Link.js +23 -0
  107. package/src/components/ListRightPanel.d.ts +17 -0
  108. package/src/components/ListRightPanel.js +79 -0
  109. package/src/components/LoadingView.d.ts +9 -0
  110. package/src/components/LoadingView.js +24 -0
  111. package/src/components/Modal.d.ts +12 -0
  112. package/src/components/Modal.js +80 -0
  113. package/src/components/MultiSelect.d.ts +27 -0
  114. package/src/components/MultiSelect.js +223 -0
  115. package/src/components/MultilineInput.d.ts +15 -0
  116. package/src/components/MultilineInput.js +55 -0
  117. package/src/components/Picker.d.ts +26 -0
  118. package/src/components/Picker.js +116 -0
  119. package/src/components/PlainListView.d.ts +36 -0
  120. package/src/components/PlainListView.js +208 -0
  121. package/src/components/Popover.d.ts +23 -0
  122. package/src/components/Popover.js +147 -0
  123. package/src/components/PopoverContent.d.ts +8 -0
  124. package/src/components/PopoverContent.js +9 -0
  125. package/src/components/Portal.d.ts +7 -0
  126. package/src/components/Portal.js +9 -0
  127. package/src/components/Pressable.d.ts +348 -0
  128. package/src/components/Pressable.js +91 -0
  129. package/src/components/ProgressBar.d.ts +11 -0
  130. package/src/components/ProgressBar.js +46 -0
  131. package/src/components/ProjectEnvTag.d.ts +7 -0
  132. package/src/components/ProjectEnvTag.js +12 -0
  133. package/src/components/QuickActions.d.ts +15 -0
  134. package/src/components/QuickActions.js +38 -0
  135. package/src/components/RadioGroup.d.ts +16 -0
  136. package/src/components/RadioGroup.js +34 -0
  137. package/src/components/ReadOnlyFieldList.d.ts +6 -0
  138. package/src/components/ReadOnlyFieldList.js +8 -0
  139. package/src/components/ResponsiveContainer.d.ts +13 -0
  140. package/src/components/ResponsiveContainer.js +23 -0
  141. package/src/components/RightPanel.d.ts +10 -0
  142. package/src/components/RightPanel.js +102 -0
  143. package/src/components/SegmentedControl.d.ts +19 -0
  144. package/src/components/SegmentedControl.js +74 -0
  145. package/src/components/Separator.d.ts +10 -0
  146. package/src/components/Separator.js +19 -0
  147. package/src/components/SidebarNavigationTracker.d.ts +13 -0
  148. package/src/components/SidebarNavigationTracker.js +93 -0
  149. package/src/components/Slider.d.ts +11 -0
  150. package/src/components/Slider.js +119 -0
  151. package/src/components/SmsOpeningAnimation.d.ts +8 -0
  152. package/src/components/SmsOpeningAnimation.js +52 -0
  153. package/src/components/Space.d.ts +10 -0
  154. package/src/components/Space.js +23 -0
  155. package/src/components/Stack.d.ts +12 -0
  156. package/src/components/Stack.js +23 -0
  157. package/src/components/StepDots.d.ts +7 -0
  158. package/src/components/StepDots.js +24 -0
  159. package/src/components/Stepper.d.ts +9 -0
  160. package/src/components/Stepper.js +67 -0
  161. package/src/components/SuccessIcon.d.ts +8 -0
  162. package/src/components/SuccessIcon.js +4 -0
  163. package/src/components/Svg.d.ts +145 -0
  164. package/src/components/Svg.js +24 -0
  165. package/src/components/SwanLogo.d.ts +8 -0
  166. package/src/components/SwanLogo.js +11 -0
  167. package/src/components/Switch.d.ts +9 -0
  168. package/src/components/Switch.js +74 -0
  169. package/src/components/TabView.d.ts +16 -0
  170. package/src/components/TabView.js +398 -0
  171. package/src/components/Table.d.ts +34 -0
  172. package/src/components/Table.js +79 -0
  173. package/src/components/Tag.d.ts +17 -0
  174. package/src/components/Tag.js +76 -0
  175. package/src/components/Tile.d.ts +34 -0
  176. package/src/components/Tile.js +130 -0
  177. package/src/components/TilePlaceholder.d.ts +6 -0
  178. package/src/components/TilePlaceholder.js +51 -0
  179. package/src/components/ToastStack.d.ts +2 -0
  180. package/src/components/ToastStack.js +96 -0
  181. package/src/components/Tooltip.d.ts +18 -0
  182. package/src/components/Tooltip.js +162 -0
  183. package/src/components/TransitionGroupView.d.ts +12 -0
  184. package/src/components/TransitionGroupView.js +43 -0
  185. package/src/components/TransitionView.d.ts +12 -0
  186. package/src/components/TransitionView.js +43 -0
  187. package/src/components/WithCurrentColor.d.ts +12 -0
  188. package/src/components/WithCurrentColor.js +65 -0
  189. package/src/components/WithPartnerAccentColor.d.ts +7 -0
  190. package/src/components/WithPartnerAccentColor.js +91 -0
  191. package/src/constants/colors.d.ts +42 -0
  192. package/src/constants/colors.js +42 -0
  193. package/src/constants/commonStyles.d.ts +66 -0
  194. package/src/constants/commonStyles.js +45 -0
  195. package/src/constants/design.d.ts +168 -0
  196. package/src/constants/design.js +564 -0
  197. package/src/constants/insets.d.ts +10 -0
  198. package/src/constants/insets.js +22 -0
  199. package/src/constants/typography.d.ts +26 -0
  200. package/src/constants/typography.js +54 -0
  201. package/src/hooks/useAnimatedValue.d.ts +2 -0
  202. package/src/hooks/useAnimatedValue.js +3 -0
  203. package/src/hooks/useBodyClassName.d.ts +3 -0
  204. package/src/hooks/useBodyClassName.js +14 -0
  205. package/src/hooks/useBoolean.d.ts +8 -0
  206. package/src/hooks/useBoolean.js +12 -0
  207. package/src/hooks/useComputedColors.d.ts +10 -0
  208. package/src/hooks/useComputedColors.js +42 -0
  209. package/src/hooks/useDebounce.d.ts +1 -0
  210. package/src/hooks/useDebounce.js +12 -0
  211. package/src/hooks/useDisclosure.d.ts +8 -0
  212. package/src/hooks/useDisclosure.js +12 -0
  213. package/src/hooks/useFirstMountState.d.ts +1 -0
  214. package/src/hooks/useFirstMountState.js +9 -0
  215. package/src/hooks/useForceableState.d.ts +1 -0
  216. package/src/hooks/useForceableState.js +6 -0
  217. package/src/hooks/useHover.d.ts +11 -0
  218. package/src/hooks/useHover.js +4 -0
  219. package/src/hooks/useInterval.d.ts +1 -0
  220. package/src/hooks/useInterval.js +11 -0
  221. package/src/hooks/useLazyRef.d.ts +2 -0
  222. package/src/hooks/useLazyRef.js +9 -0
  223. package/src/hooks/useMergeRefs.d.ts +2 -0
  224. package/src/hooks/useMergeRefs.js +5 -0
  225. package/src/hooks/useNativeProp.d.ts +2 -0
  226. package/src/hooks/useNativeProp.js +9 -0
  227. package/src/hooks/useOutsideClick.d.ts +8 -0
  228. package/src/hooks/useOutsideClick.js +54 -0
  229. package/src/hooks/usePersistedState.d.ts +1 -0
  230. package/src/hooks/usePersistedState.js +21 -0
  231. package/src/hooks/usePressEvents.d.ts +31 -0
  232. package/src/hooks/usePressEvents.js +4 -0
  233. package/src/hooks/usePreviousValue.d.ts +1 -0
  234. package/src/hooks/usePreviousValue.js +8 -0
  235. package/src/hooks/useResponsive.d.ts +7 -0
  236. package/src/hooks/useResponsive.js +20 -0
  237. package/src/hooks/useUpdateEffect.d.ts +2 -0
  238. package/src/hooks/useUpdateEffect.js +10 -0
  239. package/src/hooks/useUrqlMutation.d.ts +4 -0
  240. package/src/hooks/useUrqlMutation.js +30 -0
  241. package/src/hooks/useUrqlQuery.d.ts +19 -0
  242. package/src/hooks/useUrqlQuery.js +73 -0
  243. package/src/state/toasts.d.ts +21 -0
  244. package/src/state/toasts.js +61 -0
  245. package/src/utils/__tests__/array.test.d.ts +1 -0
  246. package/src/utils/__tests__/array.test.js +127 -0
  247. package/src/utils/__tests__/base64.test.d.ts +1 -0
  248. package/src/utils/__tests__/base64.test.js +27 -0
  249. package/src/utils/__tests__/function.test.d.ts +1 -0
  250. package/src/utils/__tests__/function.test.js +36 -0
  251. package/src/utils/__tests__/object.test.d.ts +1 -0
  252. package/src/utils/__tests__/object.test.js +17 -0
  253. package/src/utils/__tests__/rifm.test.d.ts +1 -0
  254. package/src/utils/__tests__/rifm.test.js +124 -0
  255. package/src/utils/__tests__/string.test.d.ts +1 -0
  256. package/src/utils/__tests__/string.test.js +16 -0
  257. package/src/utils/a11y.d.ts +1 -0
  258. package/src/utils/a11y.js +18 -0
  259. package/src/utils/array.d.ts +6 -0
  260. package/src/utils/array.js +71 -0
  261. package/src/utils/base64.d.ts +2 -0
  262. package/src/utils/base64.js +20 -0
  263. package/src/utils/file.d.ts +2 -0
  264. package/src/utils/file.js +10 -0
  265. package/src/utils/flagCountry.d.ts +1 -0
  266. package/src/utils/flagCountry.js +1 -0
  267. package/src/utils/function.d.ts +4 -0
  268. package/src/utils/function.js +19 -0
  269. package/src/utils/math.d.ts +16 -0
  270. package/src/utils/math.js +47 -0
  271. package/src/utils/nullish.d.ts +10 -0
  272. package/src/utils/nullish.js +8 -0
  273. package/src/utils/object.d.ts +2 -0
  274. package/src/utils/object.js +7 -0
  275. package/src/utils/popper.d.ts +3 -0
  276. package/src/utils/popper.js +30 -0
  277. package/src/utils/rifm.d.ts +14 -0
  278. package/src/utils/rifm.js +53 -0
  279. package/src/utils/string.d.ts +4 -0
  280. package/src/utils/string.js +233 -0
  281. package/src/utils/timer.d.ts +11 -0
  282. package/src/utils/timer.js +46 -0
  283. package/src/utils/types.d.ts +8 -0
  284. package/src/utils/types.js +1 -0
  285. package/src/utils/userAgent.d.ts +4 -0
  286. package/src/utils/userAgent.js +9 -0
  287. package/src/utils/viewport.d.ts +1 -0
  288. package/src/utils/viewport.js +12 -0
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ type Props = {
3
+ color: string;
4
+ children: ReactNode;
5
+ };
6
+ export declare const WithPartnerAccentColor: ({ color, children }: Props) => JSX.Element;
7
+ export {};
@@ -0,0 +1,91 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Result } from "@swan-io/boxed";
3
+ import { darken, getLuminance, meetsContrastGuidelines, shade, tint } from "polished";
4
+ import { useLayoutEffect, useRef } from "react";
5
+ import { StyleSheet, View } from "react-native";
6
+ import { match, P } from "ts-pattern";
7
+ import { isNotNullish } from "../utils/nullish";
8
+ const colorScaleItems = [900, 800, 700, 600, 500, 400, 300, 200, 100, 50, 0];
9
+ const styles = StyleSheet.create({
10
+ container: {
11
+ flexGrow: 1,
12
+ flexBasis: "0%",
13
+ },
14
+ });
15
+ const getContrastColor = (color, luminance) => {
16
+ if (luminance <= 0.75) {
17
+ return "#fff";
18
+ }
19
+ const delta = 0.5 + (1 - luminance);
20
+ const text = darken(delta / 1.5, color);
21
+ if (meetsContrastGuidelines(color, text).AALarge) {
22
+ return text;
23
+ }
24
+ else {
25
+ return darken(delta, color);
26
+ }
27
+ };
28
+ export const WithPartnerAccentColor = ({ color, children }) => {
29
+ const containerRef = useRef(null);
30
+ useLayoutEffect(() => {
31
+ if (isNotNullish(containerRef.current)) {
32
+ const element = containerRef.current;
33
+ const luminance = Result.fromExecution(() => getLuminance(color));
34
+ luminance.match({
35
+ Ok: luminance => {
36
+ // The Math.pow adjusts the estimation to the default scales
37
+ const mostLikelyPositionScale = colorScaleItems[colorScaleItems.length -
38
+ (((luminance > 0.5 ? luminance : Math.pow(luminance, 0.2)) *
39
+ colorScaleItems.length) |
40
+ 0)];
41
+ const estimated500 = match(mostLikelyPositionScale)
42
+ .with(0, () => shade(0.97, color))
43
+ .with(50, () => shade(0.95, color))
44
+ .with(100, () => shade(0.8, color))
45
+ .with(200, () => shade(0.6, color))
46
+ .with(300, () => shade(0.4, color))
47
+ .with(400, () => shade(0.2, color))
48
+ .with(500, P.nullish, () => color)
49
+ .with(600, () => tint(0.2, color))
50
+ .with(700, () => tint(0.4, color))
51
+ .with(800, () => tint(0.6, color))
52
+ .with(900, () => tint(0.8, color))
53
+ .exhaustive();
54
+ const colorScale = {
55
+ 0: tint(0.97, estimated500),
56
+ 50: tint(0.95, estimated500),
57
+ 100: tint(0.8, estimated500),
58
+ 200: tint(0.6, estimated500),
59
+ 300: tint(0.4, estimated500),
60
+ 400: tint(0.2, estimated500),
61
+ 500: estimated500,
62
+ 600: shade(0.2, estimated500),
63
+ 700: shade(0.4, estimated500),
64
+ 800: shade(0.6, estimated500),
65
+ 900: shade(0.8, estimated500),
66
+ primary: color,
67
+ contrast: getContrastColor(color, luminance),
68
+ secondary: shade(0.2, color),
69
+ };
70
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-900", colorScale[900], "");
71
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-800", colorScale[800], "");
72
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-700", colorScale[700], "");
73
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-600", colorScale[600], "");
74
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-500", colorScale[500], "");
75
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-400", colorScale[400], "");
76
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-300", colorScale[300], "");
77
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-200", colorScale[200], "");
78
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-100", colorScale[100], "");
79
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-50", colorScale[50], "");
80
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-primary", colorScale.primary, "");
81
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-secondary", colorScale.secondary, "");
82
+ element.ownerDocument.documentElement.style.setProperty("--color-partner-contrast", colorScale.contrast, "");
83
+ },
84
+ Error: () => {
85
+ // Do nothing, keep partner color
86
+ },
87
+ });
88
+ }
89
+ }, [color]);
90
+ return (_jsx(View, { ref: containerRef, style: styles.container, children: children }));
91
+ };
@@ -0,0 +1,42 @@
1
+ export declare const colors: {
2
+ transparent: string;
3
+ black: string;
4
+ white: string;
5
+ gray: {
6
+ 3: string;
7
+ 10: string;
8
+ 20: string;
9
+ 30: string;
10
+ 40: string;
11
+ 50: string;
12
+ 60: string;
13
+ 70: string;
14
+ 80: string;
15
+ 90: string;
16
+ 100: string;
17
+ };
18
+ purple: {
19
+ 3: string;
20
+ 10: string;
21
+ 30: string;
22
+ 50: string;
23
+ 80: string;
24
+ 100: string;
25
+ };
26
+ green: {
27
+ 3: string;
28
+ 10: string;
29
+ 100: string;
30
+ };
31
+ orange: {
32
+ 3: string;
33
+ 10: string;
34
+ 100: string;
35
+ };
36
+ red: {
37
+ 3: string;
38
+ 10: string;
39
+ 100: string;
40
+ };
41
+ };
42
+ export declare const defaultAccentColor: string;
@@ -0,0 +1,42 @@
1
+ export const colors = {
2
+ transparent: "transparent",
3
+ black: "#000000",
4
+ white: "#ffffff",
5
+ gray: {
6
+ 3: "#f7f8f8",
7
+ 10: "#e7e8e8",
8
+ 20: "#d0d1d1",
9
+ 30: "#b8baba",
10
+ 40: "#a1a3a3",
11
+ 50: "#898c8c",
12
+ 60: "#727575",
13
+ 70: "#5a5e5e",
14
+ 80: "#434747",
15
+ 90: "#2b2f30",
16
+ 100: "#14191a",
17
+ },
18
+ purple: {
19
+ 3: "#faf9fc",
20
+ 10: "#efebf7",
21
+ 30: "#cfc5e8",
22
+ 50: "#b09fda",
23
+ 80: "#8166c4",
24
+ 100: "#6240b5",
25
+ },
26
+ green: {
27
+ 3: "#f8fdfb",
28
+ 10: "#e8faf2",
29
+ 100: "#1fd286",
30
+ },
31
+ orange: {
32
+ 3: "#fffcf7",
33
+ 10: "#fff5e5",
34
+ 100: "#ff9f00",
35
+ },
36
+ red: {
37
+ 3: "#fef8f9",
38
+ 10: "#fde9ec",
39
+ 100: "#f12b43",
40
+ },
41
+ };
42
+ export const defaultAccentColor = colors.purple[100];
@@ -0,0 +1,66 @@
1
+ export declare const visuallyHiddenStyle: {
2
+ readonly borderWidth: 0;
3
+ readonly clip: "rect(0 0 0 0)";
4
+ readonly clipPath: "inset(50%)";
5
+ readonly height: 1;
6
+ readonly marginBottom: -1;
7
+ readonly marginLeft: 0;
8
+ readonly marginRight: -1;
9
+ readonly marginTop: 0;
10
+ readonly overflow: "hidden";
11
+ readonly padding: 0;
12
+ readonly position: "absolute";
13
+ readonly whiteSpace: "nowrap";
14
+ readonly width: 1;
15
+ };
16
+ export declare const commonStyles: {
17
+ readonly center: {
18
+ readonly alignItems: "center";
19
+ readonly justifyContent: "center";
20
+ };
21
+ readonly centerSelf: {
22
+ readonly marginHorizontal: "auto";
23
+ };
24
+ readonly fill: {
25
+ readonly flexGrow: 1;
26
+ readonly flexShrink: 1;
27
+ };
28
+ readonly hidden: {
29
+ readonly visibility: "hidden";
30
+ };
31
+ readonly view: {
32
+ readonly alignItems: "stretch";
33
+ readonly backgroundColor: "transparent";
34
+ readonly borderColor: "black";
35
+ readonly borderStyle: "solid";
36
+ readonly borderWidth: 0;
37
+ readonly boxSizing: "border-box";
38
+ readonly display: "flex";
39
+ readonly flexBasis: "auto";
40
+ readonly flexDirection: "column";
41
+ readonly flexShrink: 0;
42
+ readonly listStyle: "none";
43
+ readonly margin: 0;
44
+ readonly minHeight: 0;
45
+ readonly minWidth: 0;
46
+ readonly padding: 0;
47
+ readonly position: "relative";
48
+ readonly textDecoration: "none";
49
+ readonly zIndex: 0;
50
+ };
51
+ readonly visuallyHidden: {
52
+ readonly borderWidth: 0;
53
+ readonly clip: "rect(0 0 0 0)";
54
+ readonly clipPath: "inset(50%)";
55
+ readonly height: 1;
56
+ readonly marginBottom: -1;
57
+ readonly marginLeft: 0;
58
+ readonly marginRight: -1;
59
+ readonly marginTop: 0;
60
+ readonly overflow: "hidden";
61
+ readonly padding: 0;
62
+ readonly position: "absolute";
63
+ readonly whiteSpace: "nowrap";
64
+ readonly width: 1;
65
+ };
66
+ };
@@ -0,0 +1,45 @@
1
+ // https://github.com/necolas/react-native-web/blob/0.18.10/packages/react-native-web/src/exports/View/index.js#L149
2
+ const viewStyle = {
3
+ alignItems: "stretch",
4
+ backgroundColor: "transparent",
5
+ borderColor: "black",
6
+ borderStyle: "solid",
7
+ borderWidth: 0,
8
+ boxSizing: "border-box",
9
+ display: "flex",
10
+ flexBasis: "auto",
11
+ flexDirection: "column",
12
+ flexShrink: 0,
13
+ listStyle: "none",
14
+ margin: 0,
15
+ minHeight: 0,
16
+ minWidth: 0,
17
+ padding: 0,
18
+ position: "relative",
19
+ textDecoration: "none",
20
+ zIndex: 0,
21
+ };
22
+ // https://github.com/adobe/react-spectrum/blob/react-aria%403.22.0/packages/@react-aria/visually-hidden/src/VisuallyHidden.tsx#L32
23
+ export const visuallyHiddenStyle = {
24
+ borderWidth: 0,
25
+ clip: "rect(0 0 0 0)",
26
+ clipPath: "inset(50%)",
27
+ height: 1,
28
+ marginBottom: -1,
29
+ marginLeft: 0,
30
+ marginRight: -1,
31
+ marginTop: 0,
32
+ overflow: "hidden",
33
+ padding: 0,
34
+ position: "absolute",
35
+ whiteSpace: "nowrap",
36
+ width: 1,
37
+ };
38
+ export const commonStyles = {
39
+ center: { alignItems: "center", justifyContent: "center" },
40
+ centerSelf: { marginHorizontal: "auto" },
41
+ fill: { flexGrow: 1, flexShrink: 1 },
42
+ hidden: { visibility: "hidden" },
43
+ view: viewStyle,
44
+ visuallyHidden: visuallyHiddenStyle,
45
+ };
@@ -0,0 +1,168 @@
1
+ import { AnimationStyles, TextStyle } from "react-native";
2
+ export type ColorScale = {
3
+ 900: string;
4
+ 800: string;
5
+ 700: string;
6
+ 600: string;
7
+ 500: string;
8
+ 400: string;
9
+ 300: string;
10
+ 200: string;
11
+ 100: string;
12
+ 50: string;
13
+ 0: string;
14
+ primary: string;
15
+ secondary: string;
16
+ contrast: string;
17
+ };
18
+ export declare const gray75 = "var(--color-gray-75)";
19
+ export declare const colors: {
20
+ readonly gray: ColorScale;
21
+ readonly live: ColorScale;
22
+ readonly sandbox: ColorScale;
23
+ readonly positive: ColorScale;
24
+ readonly warning: ColorScale;
25
+ readonly negative: ColorScale;
26
+ readonly current: ColorScale;
27
+ readonly partner: ColorScale;
28
+ readonly swan: ColorScale;
29
+ readonly shakespear: ColorScale;
30
+ readonly darkPink: ColorScale;
31
+ readonly sunglow: ColorScale;
32
+ readonly mediumSladeBlue: ColorScale;
33
+ };
34
+ export declare const invariantColors: {
35
+ black: string;
36
+ white: string;
37
+ transparent: string;
38
+ gray: string;
39
+ };
40
+ export type ColorVariants = keyof typeof colors;
41
+ export type BackgroundColorVariant = {
42
+ default: string;
43
+ defaultTransparent: string;
44
+ default50Transparency: string;
45
+ default75Transparency: string;
46
+ default90Transparency: string;
47
+ accented: string;
48
+ accentedTransparent: string;
49
+ accented50Transparency: string;
50
+ accented75Transparency: string;
51
+ accented90Transparency: string;
52
+ };
53
+ export declare const backgroundColor: BackgroundColorVariant;
54
+ export declare const gradients: {
55
+ readonly vertical: "var(--gradient-vertical)";
56
+ readonly oblique: "var(--gradient-oblique)";
57
+ };
58
+ export declare const interFontStyle: {
59
+ fontFamily: string;
60
+ letterSpacing: number;
61
+ };
62
+ export declare const texts: {
63
+ readonly h1: TextStyle;
64
+ readonly h2: TextStyle;
65
+ readonly h3: TextStyle;
66
+ readonly h4: TextStyle;
67
+ readonly h5: TextStyle;
68
+ readonly h6: TextStyle;
69
+ readonly semibold: TextStyle;
70
+ readonly medium: TextStyle;
71
+ readonly regular: TextStyle;
72
+ readonly light: TextStyle;
73
+ readonly smallSemibold: TextStyle;
74
+ readonly smallMedium: TextStyle;
75
+ readonly smallRegular: TextStyle;
76
+ readonly placeholder: TextStyle;
77
+ readonly smallPlaceholder: TextStyle;
78
+ };
79
+ export type TextVariants = keyof typeof texts;
80
+ export declare const shadows: {
81
+ readonly tile: "var(--shadow-tile)";
82
+ readonly tileHover: "var(--shadow-tile-hover)";
83
+ readonly modal: "var(--shadow-modal)";
84
+ };
85
+ export declare const spacings: {
86
+ readonly 4: "var(--spacing-4)";
87
+ readonly 8: "var(--spacing-8)";
88
+ readonly 12: "var(--spacing-12)";
89
+ readonly 16: "var(--spacing-16)";
90
+ readonly 20: "var(--spacing-20)";
91
+ readonly 24: "var(--spacing-24)";
92
+ readonly 32: "var(--spacing-32)";
93
+ readonly 40: "var(--spacing-40)";
94
+ readonly 48: "var(--spacing-48)";
95
+ readonly 72: "var(--spacing-72)";
96
+ readonly 96: "var(--spacing-96)";
97
+ };
98
+ export type Spacings = keyof typeof spacings;
99
+ export declare const negativeSpacings: {
100
+ readonly 4: "var(--spacing-negative-4)";
101
+ readonly 8: "var(--spacing-negative-8)";
102
+ readonly 12: "var(--spacing-negative-12)";
103
+ readonly 16: "var(--spacing-negative-16)";
104
+ readonly 20: "var(--spacing-negative-20)";
105
+ readonly 24: "var(--spacing-negative-24)";
106
+ readonly 32: "var(--spacing-negative-32)";
107
+ readonly 40: "var(--spacing-negative-40)";
108
+ readonly 48: "var(--spacing-negative-48)";
109
+ readonly 72: "var(--spacing-negative-72)";
110
+ readonly 96: "var(--spacing-negative-96)";
111
+ };
112
+ export type NegativeSpacings = keyof typeof negativeSpacings;
113
+ export declare const radii: {
114
+ readonly 4: number;
115
+ readonly 6: number;
116
+ readonly 8: number;
117
+ };
118
+ export type Radii = keyof typeof radii;
119
+ export declare const fonts: {
120
+ primary: string;
121
+ card: string;
122
+ code: string;
123
+ };
124
+ export type Fonts = keyof typeof fonts;
125
+ export type Animation = {
126
+ enter: AnimationStyles;
127
+ leave: AnimationStyles;
128
+ };
129
+ export declare const animations: {
130
+ fadeAndSlideInFromTop: Animation;
131
+ fadeAndSlideInFromLeft: Animation;
132
+ fadeAndSlideInFromBottom: Animation;
133
+ fadeAndSlideInFromRight: Animation;
134
+ shake: {
135
+ enter: {
136
+ animationKeyframes: {
137
+ "10%, 90%": {
138
+ transform: {
139
+ translateX: number;
140
+ }[];
141
+ };
142
+ "20%, 80%": {
143
+ transform: {
144
+ translateX: number;
145
+ }[];
146
+ };
147
+ "30%, 50%, 70%": {
148
+ transform: {
149
+ translateX: number;
150
+ }[];
151
+ };
152
+ "40%, 60%": {
153
+ transform: {
154
+ translateX: number;
155
+ }[];
156
+ };
157
+ }[];
158
+ animationDuration: string;
159
+ animationTimingFunction: string;
160
+ };
161
+ };
162
+ };
163
+ export declare const breakpoints: {
164
+ large: number;
165
+ medium: number;
166
+ small: number;
167
+ tiny: number;
168
+ };