fluent-styles 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 (133) hide show
  1. package/README.md +77 -0
  2. package/lib/commonjs/assets/img/doctor.png +0 -0
  3. package/lib/commonjs/index.js +248 -0
  4. package/lib/commonjs/index.js.map +1 -0
  5. package/lib/commonjs/package/badge/index.js +159 -0
  6. package/lib/commonjs/package/badge/index.js.map +1 -0
  7. package/lib/commonjs/package/button/index.js +96 -0
  8. package/lib/commonjs/package/button/index.js.map +1 -0
  9. package/lib/commonjs/package/card/index.js +32 -0
  10. package/lib/commonjs/package/card/index.js.map +1 -0
  11. package/lib/commonjs/package/checkBox/index.js +84 -0
  12. package/lib/commonjs/package/checkBox/index.js.map +1 -0
  13. package/lib/commonjs/package/cycle/index.js +28 -0
  14. package/lib/commonjs/package/cycle/index.js.map +1 -0
  15. package/lib/commonjs/package/dialog/index.js +192 -0
  16. package/lib/commonjs/package/dialog/index.js.map +1 -0
  17. package/lib/commonjs/package/dropdown/index.js +116 -0
  18. package/lib/commonjs/package/dropdown/index.js.map +1 -0
  19. package/lib/commonjs/package/form/index.js +184 -0
  20. package/lib/commonjs/package/form/index.js.map +1 -0
  21. package/lib/commonjs/package/header/index.js +89 -0
  22. package/lib/commonjs/package/header/index.js.map +1 -0
  23. package/lib/commonjs/package/image/index.js +123 -0
  24. package/lib/commonjs/package/image/index.js.map +1 -0
  25. package/lib/commonjs/package/radioButton/index.js +84 -0
  26. package/lib/commonjs/package/radioButton/index.js.map +1 -0
  27. package/lib/commonjs/package/safeAreaView/index.js +16 -0
  28. package/lib/commonjs/package/safeAreaView/index.js.map +1 -0
  29. package/lib/commonjs/package/scrollView/index.js +16 -0
  30. package/lib/commonjs/package/scrollView/index.js.map +1 -0
  31. package/lib/commonjs/package/separator/index.js +33 -0
  32. package/lib/commonjs/package/separator/index.js.map +1 -0
  33. package/lib/commonjs/package/spacer/index.js +18 -0
  34. package/lib/commonjs/package/spacer/index.js.map +1 -0
  35. package/lib/commonjs/package/spinner/index.js +43 -0
  36. package/lib/commonjs/package/spinner/index.js.map +1 -0
  37. package/lib/commonjs/package/stack/__test__/index.test.js +91 -0
  38. package/lib/commonjs/package/stack/__test__/index.test.js.map +1 -0
  39. package/lib/commonjs/package/stack/index.js +41 -0
  40. package/lib/commonjs/package/stack/index.js.map +1 -0
  41. package/lib/commonjs/package/styled/__test__/index.test.js +161 -0
  42. package/lib/commonjs/package/styled/__test__/index.test.js.map +1 -0
  43. package/lib/commonjs/package/styled/index.js +42 -0
  44. package/lib/commonjs/package/styled/index.js.map +1 -0
  45. package/lib/commonjs/package/switch/index.js +43 -0
  46. package/lib/commonjs/package/switch/index.js.map +1 -0
  47. package/lib/commonjs/package/text/index.js +73 -0
  48. package/lib/commonjs/package/text/index.js.map +1 -0
  49. package/lib/commonjs/package/theme.js +384 -0
  50. package/lib/commonjs/package/theme.js.map +1 -0
  51. package/lib/commonjs/package/utils/index.js +130 -0
  52. package/lib/commonjs/package/utils/index.js.map +1 -0
  53. package/lib/commonjs/styled.code-workspace +9 -0
  54. package/lib/module/assets/img/doctor.png +0 -0
  55. package/lib/module/index.js +23 -0
  56. package/lib/module/index.js.map +1 -0
  57. package/lib/module/package/badge/index.js +151 -0
  58. package/lib/module/package/badge/index.js.map +1 -0
  59. package/lib/module/package/button/index.js +89 -0
  60. package/lib/module/package/button/index.js.map +1 -0
  61. package/lib/module/package/card/index.js +25 -0
  62. package/lib/module/package/card/index.js.map +1 -0
  63. package/lib/module/package/checkBox/index.js +75 -0
  64. package/lib/module/package/checkBox/index.js.map +1 -0
  65. package/lib/module/package/cycle/index.js +21 -0
  66. package/lib/module/package/cycle/index.js.map +1 -0
  67. package/lib/module/package/dialog/index.js +182 -0
  68. package/lib/module/package/dialog/index.js.map +1 -0
  69. package/lib/module/package/dropdown/index.js +106 -0
  70. package/lib/module/package/dropdown/index.js.map +1 -0
  71. package/lib/module/package/form/index.js +176 -0
  72. package/lib/module/package/form/index.js.map +1 -0
  73. package/lib/module/package/header/index.js +83 -0
  74. package/lib/module/package/header/index.js.map +1 -0
  75. package/lib/module/package/image/index.js +115 -0
  76. package/lib/module/package/image/index.js.map +1 -0
  77. package/lib/module/package/radioButton/index.js +75 -0
  78. package/lib/module/package/radioButton/index.js.map +1 -0
  79. package/lib/module/package/safeAreaView/index.js +11 -0
  80. package/lib/module/package/safeAreaView/index.js.map +1 -0
  81. package/lib/module/package/scrollView/index.js +11 -0
  82. package/lib/module/package/scrollView/index.js.map +1 -0
  83. package/lib/module/package/separator/index.js +26 -0
  84. package/lib/module/package/separator/index.js.map +1 -0
  85. package/lib/module/package/spacer/index.js +11 -0
  86. package/lib/module/package/spacer/index.js.map +1 -0
  87. package/lib/module/package/spinner/index.js +36 -0
  88. package/lib/module/package/spinner/index.js.map +1 -0
  89. package/lib/module/package/stack/__test__/index.test.js +89 -0
  90. package/lib/module/package/stack/__test__/index.test.js.map +1 -0
  91. package/lib/module/package/stack/index.js +36 -0
  92. package/lib/module/package/stack/index.js.map +1 -0
  93. package/lib/module/package/styled/__test__/index.test.js +158 -0
  94. package/lib/module/package/styled/__test__/index.test.js.map +1 -0
  95. package/lib/module/package/styled/index.js +35 -0
  96. package/lib/module/package/styled/index.js.map +1 -0
  97. package/lib/module/package/switch/index.js +36 -0
  98. package/lib/module/package/switch/index.js.map +1 -0
  99. package/lib/module/package/text/index.js +68 -0
  100. package/lib/module/package/text/index.js.map +1 -0
  101. package/lib/module/package/theme.js +379 -0
  102. package/lib/module/package/theme.js.map +1 -0
  103. package/lib/module/package/utils/index.js +120 -0
  104. package/lib/module/package/utils/index.js.map +1 -0
  105. package/lib/module/styled.code-workspace +9 -0
  106. package/package.json +85 -0
  107. package/src/assets/img/doctor.png +0 -0
  108. package/src/index.js +23 -0
  109. package/src/package/badge/index.jsx +133 -0
  110. package/src/package/button/index.jsx +80 -0
  111. package/src/package/card/index.jsx +38 -0
  112. package/src/package/checkBox/index.jsx +80 -0
  113. package/src/package/cycle/index.jsx +23 -0
  114. package/src/package/dialog/index.jsx +214 -0
  115. package/src/package/dropdown/index.jsx +102 -0
  116. package/src/package/form/index.jsx +145 -0
  117. package/src/package/header/index.jsx +92 -0
  118. package/src/package/image/index.jsx +93 -0
  119. package/src/package/radioButton/index.jsx +81 -0
  120. package/src/package/safeAreaView/index.jsx +12 -0
  121. package/src/package/scrollView/index.jsx +12 -0
  122. package/src/package/separator/index.jsx +26 -0
  123. package/src/package/spacer/index.jsx +13 -0
  124. package/src/package/spinner/index.jsx +33 -0
  125. package/src/package/stack/__test__/index.test.js +68 -0
  126. package/src/package/stack/index.jsx +37 -0
  127. package/src/package/styled/__test__/index.test.js +132 -0
  128. package/src/package/styled/index.js +32 -0
  129. package/src/package/switch/index.jsx +33 -0
  130. package/src/package/text/index.jsx +61 -0
  131. package/src/package/theme.js +376 -0
  132. package/src/package/utils/index.js +108 -0
  133. package/src/styled.code-workspace +9 -0
@@ -0,0 +1,108 @@
1
+ import { Platform, Dimensions } from 'react-native'
2
+ import { theme } from '../theme'
3
+ import React from 'react'
4
+
5
+ export const isValidColor = value =>
6
+ /^#[0-9A-F]{6}$/i.test(value) || typeof value === 'string' // Simple hex color validation, expand as needed
7
+ export const isValidNumber = value => typeof value === 'number' && isFinite(value)
8
+ export const isValidString = value =>
9
+ typeof value === 'string' && value.trim().length > 0
10
+
11
+ const shadow = {
12
+ light: Platform.select({
13
+ ios: {
14
+ shadowColor: theme.colors.gray[900],
15
+ shadowOffset: { width: 0, height: 1 },
16
+ shadowOpacity: 0.22,
17
+ shadowRadius: 2.22
18
+ },
19
+ android: {
20
+ elevation: 1
21
+ }
22
+ }),
23
+ lightMedium: Platform.select({
24
+ ios: {
25
+ shadowColor: theme.colors.gray[900],
26
+ shadowOffset: { width: 0, height: 2 },
27
+ shadowOpacity: 0.24,
28
+ shadowRadius: 2.84
29
+ },
30
+ android: {
31
+ elevation: 3
32
+ }
33
+ }),
34
+ medium: Platform.select({
35
+ ios: {
36
+ shadowColor: theme.colors.gray[900],
37
+ shadowOffset: { width: 0, height: 3 },
38
+ shadowOpacity: 0.29,
39
+ shadowRadius: 4.65
40
+ },
41
+ android: {
42
+ elevation: 7
43
+ }
44
+ }),
45
+ mediumDark: Platform.select({
46
+ ios: {
47
+ shadowColor: theme.colors.gray[900],
48
+ shadowOffset: { width: 0, height: 5 },
49
+ shadowOpacity: 0.36,
50
+ shadowRadius: 6.68
51
+ },
52
+ android: {
53
+ elevation: 10
54
+ }
55
+ }),
56
+ dark: Platform.select({
57
+ ios: {
58
+ shadowColor: theme.colors.gray[900],
59
+ shadowOffset: { width: 0, height: 7 },
60
+ shadowOpacity: 0.41,
61
+ shadowRadius: 9.11
62
+ },
63
+ android: {
64
+ elevation: 14
65
+ }
66
+ }),
67
+ veryDark: Platform.select({
68
+ ios: {
69
+ shadowColor: theme.colors.gray[900],
70
+ shadowOffset: { width: 0, height: 10 },
71
+ shadowOpacity: 0.5,
72
+ shadowRadius: 13.34
73
+ },
74
+ android: {
75
+ elevation: 20
76
+ }
77
+ })
78
+ }
79
+
80
+ class ErrorBoundary extends React.Component {
81
+ constructor (props) {
82
+ super(props)
83
+ this.state = { hasError: false }
84
+ }
85
+
86
+ static getDerivedStateFromError (error) {
87
+ return { hasError: true }
88
+ }
89
+
90
+ componentDidCatch (error, info) {
91
+ console.log(error, info.componentStack)
92
+ }
93
+
94
+ render () {
95
+ if (this.state.hasError) {
96
+ return this.props.fallback
97
+ }
98
+
99
+ return this.props.children
100
+ }
101
+ }
102
+
103
+ export const isIOS = Platform.OS === 'ios'
104
+ export const isAndroid = !isIOS
105
+ export const windowWidth = Dimensions.get('window').width
106
+ export const windowHeight = Dimensions.get('window').height
107
+
108
+ export { shadow, ErrorBoundary }
@@ -0,0 +1,9 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "name": "styled",
5
+ "path": "../.."
6
+ }
7
+ ],
8
+ "settings": {}
9
+ }