@neko-os/ui 0.0.7 → 0.0.9

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 (274) hide show
  1. package/dist/NekoUI.js +1 -1
  2. package/dist/abstractions/ActivityIndicator.native.js +1 -1
  3. package/dist/abstractions/ActivityIndicator.web.js +1 -0
  4. package/dist/abstractions/AnimatedView.js +1 -1
  5. package/dist/abstractions/BlurView.js +1 -0
  6. package/dist/abstractions/BlurView.native.js +1 -0
  7. package/dist/abstractions/BlurView.web.js +1 -0
  8. package/dist/abstractions/FlatList.js +1 -0
  9. package/dist/abstractions/FlatList.native.js +1 -0
  10. package/dist/abstractions/FlatList.web.js +1 -0
  11. package/dist/abstractions/GradientView.js +1 -0
  12. package/dist/abstractions/GradientView.native.js +1 -0
  13. package/dist/abstractions/Icon.native.js +1 -1
  14. package/dist/abstractions/ImageBackground.js +1 -0
  15. package/dist/abstractions/ImageBackground.native.js +1 -0
  16. package/dist/abstractions/ImageBackground.web.js +1 -0
  17. package/dist/abstractions/Pressable.js +1 -0
  18. package/dist/abstractions/Pressable.native.js +1 -0
  19. package/dist/abstractions/Pressable.web.js +1 -0
  20. package/dist/abstractions/ScrollView.js +1 -0
  21. package/dist/abstractions/ScrollView.native.js +1 -0
  22. package/dist/abstractions/ScrollView.web.js +1 -0
  23. package/dist/abstractions/TextInput.js +1 -1
  24. package/dist/abstractions/helpers/storage.js +1 -0
  25. package/dist/abstractions/helpers/storage.native.js +1 -0
  26. package/dist/components/actions/Button.js +1 -1
  27. package/dist/components/actions/Dropdown.js +1 -1
  28. package/dist/components/actions/Link.js +1 -1
  29. package/dist/components/actions/Pressable.js +1 -0
  30. package/dist/components/actions/index.js +1 -1
  31. package/dist/components/actions/menu/HorizontalMenu.js +1 -1
  32. package/dist/components/actions/menu/VerticalMenu.js +1 -1
  33. package/dist/components/animations/ReanimatedView.js +1 -0
  34. package/dist/components/calendar/CalendarNav.js +1 -0
  35. package/dist/components/calendar/WeekDaysBar.js +1 -0
  36. package/dist/components/calendar/_helpers/calendarDays.js +1 -1
  37. package/dist/components/calendar/_helpers/dateDisabled.js +1 -0
  38. package/dist/components/calendar/index.js +0 -1
  39. package/dist/components/feedback/alerter.js +1 -0
  40. package/dist/components/feedback/confirmer.js +1 -0
  41. package/dist/components/feedback/index.js +1 -1
  42. package/dist/components/feedback/notifications/Notification.js +1 -1
  43. package/dist/components/feedback/notifications/NotificationsHandler.js +1 -1
  44. package/dist/components/index.js +1 -1
  45. package/dist/components/inputs/DateInput.js +1 -0
  46. package/dist/components/inputs/InputWrapper.js +1 -1
  47. package/dist/components/inputs/LinkInput.js +1 -0
  48. package/dist/components/inputs/MaskInput.js +1 -0
  49. package/dist/components/inputs/TextInput.js +1 -1
  50. package/dist/components/inputs/_DateInput.native.js +1 -0
  51. package/dist/components/inputs/datePicker/DatePicker.js +1 -0
  52. package/dist/components/inputs/datePicker/DayPicker.js +1 -0
  53. package/dist/components/inputs/datePicker/MonthPicker.js +1 -0
  54. package/dist/components/inputs/datePicker/QuarterPicker.js +1 -0
  55. package/dist/components/inputs/datePicker/WeekPicker.js +1 -0
  56. package/dist/components/inputs/datePicker/YearPicker.js +1 -0
  57. package/dist/components/inputs/index.js +1 -1
  58. package/dist/components/layout/Layout.js +1 -1
  59. package/dist/components/list/FlatList.js +1 -0
  60. package/dist/components/list/ScrollView.js +1 -0
  61. package/dist/components/list/index.js +1 -0
  62. package/dist/components/presentation/ImageBackground.js +1 -0
  63. package/dist/components/presentation/Result.js +1 -1
  64. package/dist/components/presentation/index.js +1 -1
  65. package/dist/components/state/LoadingView.js +1 -1
  66. package/dist/components/structure/Accordion.js +1 -1
  67. package/dist/components/structure/BlurView.js +1 -0
  68. package/dist/components/structure/GradientView.js +1 -0
  69. package/dist/components/structure/View.js +1 -1
  70. package/dist/components/structure/bottomDrawer/index.js +1 -0
  71. package/dist/components/structure/bottomDrawer/index.native.js +1 -0
  72. package/dist/components/structure/bottomDrawer/index.web.js +1 -0
  73. package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +1 -0
  74. package/dist/components/structure/bottomDrawer/native/DrawerContext.js +1 -0
  75. package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +1 -0
  76. package/dist/components/structure/bottomDrawer/native/DrawerScrollView.js +1 -0
  77. package/dist/components/structure/bottomDrawer/native/utils.js +1 -0
  78. package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +1 -0
  79. package/dist/components/structure/drawer/Drawer.js +1 -0
  80. package/dist/components/structure/drawer/Drawer.native.js +1 -0
  81. package/dist/components/structure/drawer/index.js +1 -0
  82. package/dist/components/structure/index.js +1 -1
  83. package/dist/components/structure/modal/Modal.js +1 -0
  84. package/dist/components/structure/modal/Modal.native.js +1 -0
  85. package/dist/components/structure/modal/ModalBackdrop.js +1 -0
  86. package/dist/components/structure/modal/ModalContent.js +1 -0
  87. package/dist/components/structure/modal/ModalFooter.js +1 -0
  88. package/dist/components/structure/modal/ModalHeader.js +1 -0
  89. package/dist/components/structure/modal/handler/ModalsHandler.js +1 -0
  90. package/dist/components/structure/modal/index.js +1 -0
  91. package/dist/components/structure/overlay/OverlayWrapper.js +1 -1
  92. package/dist/components/structure/popover/Popover.js +1 -1
  93. package/dist/components/structure/popover/Popover.native.js +1 -1
  94. package/dist/components/theme/ThemePicker.js +1 -0
  95. package/dist/components/theme/ThemePickerDrawer.js +1 -0
  96. package/dist/components/theme/ThemeStatusBar.js +1 -0
  97. package/dist/components/theme/ThemeStatusBar.native.js +1 -0
  98. package/dist/components/theme/ThemeThumb.js +1 -0
  99. package/dist/components/theme/index.js +1 -0
  100. package/dist/helpers/index.js +1 -1
  101. package/dist/helpers/storage.js +1 -0
  102. package/dist/modifiers/animations/animatedEffects.js +1 -1
  103. package/dist/modifiers/animations/animatedEffects.native.js +1 -1
  104. package/dist/modifiers/animations/fadeEffect.js +1 -1
  105. package/dist/modifiers/animations/scaleEffect.js +1 -0
  106. package/dist/modifiers/animations/scaleEffect.native.js +1 -0
  107. package/dist/modifiers/animations/slideEffect.js +1 -1
  108. package/dist/modifiers/background.js +1 -1
  109. package/dist/modifiers/cursor.js +1 -0
  110. package/dist/modifiers/display.js +1 -1
  111. package/dist/modifiers/fullColor.js +1 -1
  112. package/dist/modifiers/hover.js +1 -0
  113. package/dist/modifiers/position.js +1 -1
  114. package/dist/modifiers/size.js +1 -1
  115. package/dist/modifiers/state.js +1 -1
  116. package/dist/responsive/responsiveHooks.js +1 -1
  117. package/dist/theme/ThemeHandler.js +1 -1
  118. package/dist/theme/default/base.js +1 -1
  119. package/dist/theme/default/blackTheme.js +1 -0
  120. package/dist/theme/default/cyberpunkTheme.js +1 -1
  121. package/dist/theme/default/darkTheme.js +1 -1
  122. package/dist/theme/default/deepWoodsTheme.js +1 -1
  123. package/dist/theme/default/forestTheme.js +1 -1
  124. package/dist/theme/default/hackerTheme.js +1 -1
  125. package/dist/theme/default/lightTheme.js +1 -1
  126. package/dist/theme/default/midnightTheme.js +1 -1
  127. package/dist/theme/default/msdosTheme.js +1 -1
  128. package/dist/theme/default/oceanTheme.js +1 -1
  129. package/dist/theme/default/paperTheme.js +1 -0
  130. package/dist/theme/default/pastelTheme.js +1 -1
  131. package/dist/theme/default/sunsetTheme.js +1 -1
  132. package/dist/theme/default/themes.js +1 -1
  133. package/dist/theme/format/formatTheme.js +1 -1
  134. package/dist/theme/helpers/contrastColor.js +1 -1
  135. package/package.json +8 -3
  136. package/src/NekoUI.js +18 -3
  137. package/src/abstractions/ActivityIndicator.native.js +3 -4
  138. package/src/abstractions/ActivityIndicator.web.js +43 -0
  139. package/src/abstractions/AnimatedView.js +3 -3
  140. package/src/abstractions/BlurView.js +43 -0
  141. package/src/abstractions/BlurView.native.js +39 -0
  142. package/src/abstractions/BlurView.web.js +39 -0
  143. package/src/abstractions/FlatList.js +39 -0
  144. package/src/abstractions/FlatList.native.js +32 -0
  145. package/src/abstractions/FlatList.web.js +3 -0
  146. package/src/abstractions/GradientView.js +5 -0
  147. package/src/abstractions/GradientView.native.js +32 -0
  148. package/src/abstractions/Icon.native.js +4 -2
  149. package/src/abstractions/ImageBackground.js +17 -0
  150. package/src/abstractions/ImageBackground.native.js +27 -0
  151. package/src/abstractions/ImageBackground.web.js +7 -0
  152. package/src/abstractions/Pressable.js +4 -0
  153. package/src/abstractions/Pressable.native.js +3 -0
  154. package/src/abstractions/Pressable.web.js +3 -0
  155. package/src/abstractions/ScrollView.js +3 -0
  156. package/src/abstractions/ScrollView.native.js +5 -0
  157. package/src/abstractions/ScrollView.web.js +3 -0
  158. package/src/abstractions/Text.web.js +15 -0
  159. package/src/abstractions/TextInput.js +2 -2
  160. package/src/abstractions/helpers/storage.js +32 -0
  161. package/src/abstractions/helpers/storage.native.js +34 -0
  162. package/src/components/actions/Button.js +8 -0
  163. package/src/components/actions/Dropdown.js +18 -2
  164. package/src/components/actions/Link.js +16 -2
  165. package/src/components/actions/Pressable.js +38 -0
  166. package/src/components/actions/index.js +1 -0
  167. package/src/components/actions/menu/HorizontalMenu.js +2 -1
  168. package/src/components/actions/menu/VerticalMenu.js +5 -4
  169. package/src/components/animations/ReanimatedView.js +40 -0
  170. package/src/components/calendar/CalendarNav.js +67 -0
  171. package/src/components/calendar/WeekDaysBar.js +18 -0
  172. package/src/components/calendar/_helpers/calendarDays.js +1 -3
  173. package/src/components/calendar/_helpers/dateDisabled.js +24 -0
  174. package/src/components/calendar/index.js +1 -1
  175. package/src/components/feedback/alerter.js +31 -0
  176. package/src/components/feedback/confirmer.js +70 -0
  177. package/src/components/feedback/index.js +2 -0
  178. package/src/components/feedback/notifications/Notification.js +1 -1
  179. package/src/components/feedback/notifications/NotificationsHandler.js +3 -3
  180. package/src/components/index.js +2 -0
  181. package/src/components/inputs/DateInput.js +111 -0
  182. package/src/components/inputs/InputWrapper.js +18 -6
  183. package/src/components/inputs/LinkInput.js +17 -0
  184. package/src/components/inputs/MaskInput.js +67 -0
  185. package/src/components/inputs/TextInput.js +2 -2
  186. package/src/components/inputs/_DateInput.native.js +89 -0
  187. package/src/components/inputs/datePicker/DatePicker.js +24 -0
  188. package/src/components/inputs/datePicker/DayPicker.js +65 -0
  189. package/src/components/inputs/datePicker/MonthPicker.js +62 -0
  190. package/src/components/inputs/datePicker/QuarterPicker.js +65 -0
  191. package/src/components/inputs/datePicker/WeekPicker.js +74 -0
  192. package/src/components/inputs/datePicker/YearPicker.js +67 -0
  193. package/src/components/inputs/index.js +4 -0
  194. package/src/components/layout/Layout.js +1 -1
  195. package/src/components/list/FlatList.js +54 -0
  196. package/src/components/list/ScrollView.js +58 -0
  197. package/src/components/list/index.js +2 -0
  198. package/src/components/presentation/ImageBackground.js +38 -0
  199. package/src/components/presentation/Result.js +2 -2
  200. package/src/components/presentation/index.js +1 -0
  201. package/src/components/state/LoadingView.js +10 -1
  202. package/src/components/structure/Accordion.js +1 -1
  203. package/src/components/structure/BlurView.js +58 -0
  204. package/src/components/structure/GradientView.js +42 -0
  205. package/src/components/structure/View.js +2 -0
  206. package/src/components/structure/bottomDrawer/index.js +1 -0
  207. package/src/components/structure/bottomDrawer/index.native.js +4 -0
  208. package/src/components/structure/bottomDrawer/index.web.js +4 -0
  209. package/src/components/structure/bottomDrawer/native/BottomDrawer.js +242 -0
  210. package/src/components/structure/bottomDrawer/native/DrawerContext.js +21 -0
  211. package/src/components/structure/bottomDrawer/native/DrawerHandle.js +12 -0
  212. package/src/components/structure/bottomDrawer/native/DrawerScrollView.js +83 -0
  213. package/src/components/structure/bottomDrawer/native/utils.js +58 -0
  214. package/src/components/structure/bottomDrawer/web/BottomDrawer.js +3 -0
  215. package/src/components/structure/drawer/Drawer.js +5 -0
  216. package/src/components/structure/drawer/Drawer.native.js +3 -0
  217. package/src/components/structure/drawer/index.js +1 -0
  218. package/src/components/structure/index.js +5 -0
  219. package/src/components/structure/modal/Modal.js +84 -0
  220. package/src/components/structure/modal/Modal.native.js +83 -0
  221. package/src/components/structure/modal/ModalBackdrop.js +58 -0
  222. package/src/components/structure/modal/ModalContent.js +28 -0
  223. package/src/components/structure/modal/ModalFooter.js +31 -0
  224. package/src/components/structure/modal/ModalHeader.js +50 -0
  225. package/src/components/structure/modal/handler/ModalsHandler.js +61 -0
  226. package/src/components/structure/modal/index.js +6 -0
  227. package/src/components/structure/overlay/OverlayWrapper.js +1 -1
  228. package/src/components/structure/popover/Popover.js +37 -2
  229. package/src/components/structure/popover/Popover.native.js +46 -16
  230. package/src/components/theme/ThemePicker.js +49 -0
  231. package/src/components/theme/ThemePickerDrawer.js +13 -0
  232. package/src/components/theme/ThemeStatusBar.js +3 -0
  233. package/src/components/theme/ThemeStatusBar.native.js +9 -0
  234. package/src/components/theme/ThemeThumb.js +98 -0
  235. package/src/components/theme/index.js +3 -0
  236. package/src/helpers/index.js +1 -0
  237. package/src/helpers/storage.js +54 -0
  238. package/src/modifiers/animations/animatedEffects.js +2 -0
  239. package/src/modifiers/animations/animatedEffects.native.js +3 -1
  240. package/src/modifiers/animations/fadeEffect.js +4 -2
  241. package/src/modifiers/animations/scaleEffect.js +45 -0
  242. package/src/modifiers/animations/scaleEffect.native.js +33 -0
  243. package/src/modifiers/animations/slideEffect.js +3 -1
  244. package/src/modifiers/background.js +16 -4
  245. package/src/modifiers/cursor.js +21 -0
  246. package/src/modifiers/display.js +2 -2
  247. package/src/modifiers/fullColor.js +2 -2
  248. package/src/modifiers/hover.js +28 -0
  249. package/src/modifiers/position.js +24 -3
  250. package/src/modifiers/size.js +2 -1
  251. package/src/modifiers/state.js +1 -1
  252. package/src/responsive/responsiveHooks.js +7 -0
  253. package/src/theme/ThemeHandler.js +18 -2
  254. package/src/theme/default/base.js +6 -6
  255. package/src/theme/default/blackTheme.js +35 -0
  256. package/src/theme/default/cyberpunkTheme.js +4 -1
  257. package/src/theme/default/darkTheme.js +4 -1
  258. package/src/theme/default/deepWoodsTheme.js +5 -2
  259. package/src/theme/default/forestTheme.js +4 -1
  260. package/src/theme/default/hackerTheme.js +4 -1
  261. package/src/theme/default/lightTheme.js +4 -1
  262. package/src/theme/default/midnightTheme.js +4 -1
  263. package/src/theme/default/msdosTheme.js +19 -4
  264. package/src/theme/default/oceanTheme.js +5 -2
  265. package/src/theme/default/paperTheme.js +35 -0
  266. package/src/theme/default/pastelTheme.js +5 -2
  267. package/src/theme/default/sunsetTheme.js +7 -4
  268. package/src/theme/default/themes.js +9 -10
  269. package/src/theme/format/formatTheme.js +9 -3
  270. package/src/theme/helpers/contrastColor.js +49 -11
  271. package/dist/abstractions/TouchableOpacity.web.js +0 -1
  272. package/dist/components/calendar/DayPicker.js +0 -1
  273. package/src/abstractions/TouchableOpacity.web.js +0 -3
  274. package/src/components/calendar/DayPicker.js +0 -94
@@ -2,6 +2,8 @@ import { mergeDeepRight } from 'ramda'
2
2
  import { BASE_THEME } from './base'
3
3
 
4
4
  export const FOREST_MIST_THEME = mergeDeepRight(BASE_THEME, {
5
+ label: 'Forest Mist',
6
+
5
7
  colors: {
6
8
  primary: '#4CAF50',
7
9
  text: '#0B2414',
@@ -9,8 +11,9 @@ export const FOREST_MIST_THEME = mergeDeepRight(BASE_THEME, {
9
11
  text3: '#1B5E20',
10
12
  text4: '#388E3C',
11
13
 
12
- bg: '#E9F5EC',
14
+ mainBG: '#E9F5EC',
13
15
  overlayBG: '#FFFFFF',
16
+ backdrop: '#E9F5EC',
14
17
  shadow: 'rgba(39, 45, 52, 0.15)',
15
18
  divider: 'rgba(0,0,0, 0.1)',
16
19
 
@@ -3,6 +3,8 @@ import { mergeDeepRight } from 'ramda'
3
3
  import { BASE_THEME } from './base'
4
4
 
5
5
  export const DEFAULT_MATRIX_THEME = mergeDeepRight(BASE_THEME, {
6
+ label: 'Hacker',
7
+
6
8
  colors: {
7
9
  primary: '#00FF41',
8
10
  text: '#00FF41',
@@ -10,8 +12,9 @@ export const DEFAULT_MATRIX_THEME = mergeDeepRight(BASE_THEME, {
10
12
  text3: '#009926',
11
13
  text4: '#00661A',
12
14
 
13
- bg: '#000000',
15
+ mainBG: '#000000',
14
16
  overlayBG: '#0A0A0A',
17
+ backdrop: '#000000',
15
18
  shadow: 'rgba(0, 255, 65, 0.2)',
16
19
  divider: 'rgba(0,255,65, 0.3)',
17
20
 
@@ -2,6 +2,8 @@ import { mergeDeepRight } from 'ramda'
2
2
  import { BASE_THEME } from './base'
3
3
 
4
4
  export const DEFAULT_LIGHT_THEME = mergeDeepRight(BASE_THEME, {
5
+ label: 'Light',
6
+
5
7
  colors: {
6
8
  primary: '#818DF9',
7
9
  text: '#272D34',
@@ -9,8 +11,9 @@ export const DEFAULT_LIGHT_THEME = mergeDeepRight(BASE_THEME, {
9
11
  text3: '#6E7680',
10
12
  text4: '#9AA1AC',
11
13
 
12
- bg: '#F4F5FE',
14
+ mainBG: '#F4F5FE',
13
15
  overlayBG: '#FFFFFF',
16
+ backdrop: '#383E44',
14
17
  shadow: 'rgba(39, 45, 52, 0.15)',
15
18
  divider: '#e0e0e0',
16
19
 
@@ -2,6 +2,8 @@ import { mergeDeepRight } from 'ramda'
2
2
  import { BASE_THEME } from './base'
3
3
 
4
4
  export const MIDNIGHT_NEON_THEME = mergeDeepRight(BASE_THEME, {
5
+ label: 'Midnight',
6
+
5
7
  colors: {
6
8
  primary: '#FF00FF',
7
9
  text: '#F0F0F0',
@@ -9,8 +11,9 @@ export const MIDNIGHT_NEON_THEME = mergeDeepRight(BASE_THEME, {
9
11
  text3: '#A3A3A3',
10
12
  text4: '#7A7A7A',
11
13
 
12
- bg: '#0D0D0D',
14
+ mainBG: '#0D0D0D',
13
15
  overlayBG: '#1A1A1A',
16
+ backdrop: '#0D0D0D',
14
17
  shadow: 'rgba(39, 45, 52, 0.6)',
15
18
  divider: 'rgba(255,255,255, 0.2)',
16
19
 
@@ -3,15 +3,18 @@ import { mergeDeepRight } from 'ramda'
3
3
  import { BASE_THEME } from './base'
4
4
 
5
5
  export const DEFAULT_MSDOS_THEME = mergeDeepRight(BASE_THEME, {
6
+ label: 'MSDOS',
7
+
6
8
  colors: {
7
9
  primary: '#FFFF00',
8
10
  text: '#FFFFFF',
9
- text2: '#FFD700',
10
- text3: '#CCCCCC',
11
- text4: '#999999',
11
+ text2: '#E0E0E0',
12
+ text3: '#B0B0B0',
13
+ text4: '#8A8A8A',
12
14
 
13
- bg: '#0000AA',
15
+ mainBG: '#0000AA',
14
16
  overlayBG: '#000088',
17
+ backdrop: '#0000AA',
15
18
  shadow: 'rgba(0, 0, 0, 0.6)',
16
19
  divider: 'rgba(255,255,255,0.3)',
17
20
 
@@ -30,6 +33,18 @@ export const DEFAULT_MSDOS_THEME = mergeDeepRight(BASE_THEME, {
30
33
  pink: '#FF69B4',
31
34
  },
32
35
 
36
+ radius: {
37
+ xxxs: 1,
38
+ xxs: 2,
39
+ xs: 3,
40
+ sm: 4,
41
+ md: 6,
42
+ lg: 8,
43
+ xl: 10,
44
+ xxl: 12,
45
+ xxxl: 14,
46
+ },
47
+
33
48
  components: {
34
49
  Card: {
35
50
  border: 1,
@@ -2,15 +2,18 @@ import { mergeDeepRight } from 'ramda'
2
2
  import { BASE_THEME } from './base'
3
3
 
4
4
  export const OCEAN_BREEZE_THEME = mergeDeepRight(BASE_THEME, {
5
+ label: 'Ocean Breeze',
6
+
5
7
  colors: {
6
8
  primary: '#2B90D9',
7
- text: '#04364A',
9
+ text: '#065277',
8
10
  text2: '#065A82',
9
11
  text3: '#0B84B4',
10
12
  text4: '#3ABEFF',
11
13
 
12
- bg: '#E6F7FF',
14
+ mainBG: '#E6F7FF',
13
15
  overlayBG: '#FFFFFF',
16
+ backdrop: '#04364A',
14
17
  shadow: 'rgba(39, 45, 52, 0.15)',
15
18
  divider: 'rgba(0,0,0, 0.1)',
16
19
 
@@ -0,0 +1,35 @@
1
+ import { mergeDeepRight } from 'ramda'
2
+
3
+ import { BASE_THEME } from './base'
4
+
5
+ export const DEFAULT_PAPER_THEME = mergeDeepRight(BASE_THEME, {
6
+ label: 'Paper',
7
+
8
+ colors: {
9
+ primary: '#5A5A5A',
10
+ text: '#000000',
11
+ text2: '#333333',
12
+ text3: '#555555',
13
+ text4: '#777777',
14
+
15
+ mainBG: '#F8F1E3',
16
+ overlayBG: '#F8F1E3',
17
+ backdrop: '#383E44',
18
+ shadow: 'rgba(0, 0, 0, 0.04)',
19
+ divider: '#E3D9C9',
20
+
21
+ blue: '#6B8EAE',
22
+ yellow: '#EADCA6',
23
+ green: '#88A288',
24
+ purple: '#A391B8',
25
+ orange: '#D9A066',
26
+ cyan: '#9CC9C2',
27
+ red: '#B85C5C',
28
+ navy: '#4A4A4A',
29
+ indigo: '#70788C',
30
+ gray: '#B8B8B8',
31
+ brown: '#8B7355',
32
+ lylac: '#C7B7D4',
33
+ pink: '#E4A1B2',
34
+ },
35
+ })
@@ -2,6 +2,8 @@ import { mergeDeepRight } from 'ramda'
2
2
  import { BASE_THEME } from './base'
3
3
 
4
4
  export const PASTEL_DREAM_THEME = mergeDeepRight(BASE_THEME, {
5
+ label: 'Pastel Dream',
6
+
5
7
  colors: {
6
8
  primary: '#FFB6C1',
7
9
  text: '#4B4453',
@@ -9,10 +11,11 @@ export const PASTEL_DREAM_THEME = mergeDeepRight(BASE_THEME, {
9
11
  text3: '#A093A6',
10
12
  text4: '#C9BBCF',
11
13
 
12
- bg: '#FFF7FA',
14
+ mainBG: '#FFF7FA',
13
15
  overlayBG: '#FFFFFF',
16
+ backdrop: '#4B4453',
14
17
  shadow: 'rgba(39, 45, 52, 0.15)',
15
- divider: 'rgba(255,255,255, 0.2)',
18
+ divider: '#f0f0f0',
16
19
 
17
20
  blue: '#A5B4FC',
18
21
  yellow: '#FDE68A',
@@ -3,17 +3,20 @@ import { mergeDeepRight } from 'ramda'
3
3
  import { BASE_THEME } from './base'
4
4
 
5
5
  export const SUNSET_GLOW_THEME = mergeDeepRight(BASE_THEME, {
6
+ label: 'Sunset',
7
+
6
8
  colors: {
7
9
  primary: '#FF6B6B',
8
- text: '#331E0A',
10
+ text: '#4B372E',
9
11
  text2: '#5C4033',
10
12
  text3: '#8C5A43',
11
13
  text4: '#B97A57',
12
14
 
13
- bg: '#FFF5E6',
14
- overlayBG: '#FFFFFF',
15
+ mainBG: '#FFF5E6',
16
+ overlayBG: '#FFFAF1',
17
+ backdrop: '#331E0A',
15
18
  shadow: 'rgba(39, 45, 52, 0.15)',
16
- divider: 'rgba(255,255,255, 0.2)',
19
+ divider: '#f0f0f0',
17
20
 
18
21
  blue: '#3B82F6',
19
22
  yellow: '#FBBF24',
@@ -1,25 +1,24 @@
1
1
  import { CYBERPUNK_DARK_THEME } from './cyberpunkTheme'
2
- import { DEEP_WOODS_DARK_THEME } from './deepWoodsTheme'
2
+ import { DEFAULT_BLACK_THEME } from './blackTheme'
3
3
  import { DEFAULT_DARK_THEME } from './darkTheme'
4
4
  import { DEFAULT_LIGHT_THEME } from './lightTheme'
5
5
  import { DEFAULT_MATRIX_THEME } from './hackerTheme'
6
6
  import { DEFAULT_MSDOS_THEME } from './msdosTheme'
7
- import { FOREST_MIST_THEME } from './forestTheme'
7
+ import { DEFAULT_PAPER_THEME } from './paperTheme'
8
8
  import { MIDNIGHT_NEON_THEME } from './midnightTheme'
9
- import { OCEAN_BREEZE_THEME } from './oceanTheme'
10
- import { PASTEL_DREAM_THEME } from './pastelTheme'
11
- import { SUNSET_GLOW_THEME } from './sunsetTheme'
12
9
 
13
10
  export const DEFAULT_THEMES = {
14
11
  light: DEFAULT_LIGHT_THEME,
15
12
  dark: DEFAULT_DARK_THEME,
16
- pastel: PASTEL_DREAM_THEME,
13
+ paper: DEFAULT_PAPER_THEME,
14
+ black: DEFAULT_BLACK_THEME,
15
+ // pastel: PASTEL_DREAM_THEME,
17
16
  midnight: MIDNIGHT_NEON_THEME,
18
- sunset: SUNSET_GLOW_THEME,
19
- ocean: OCEAN_BREEZE_THEME,
20
- forest: FOREST_MIST_THEME,
17
+ // sunset: SUNSET_GLOW_THEME,
18
+ // ocean: OCEAN_BREEZE_THEME,
19
+ // forest: FOREST_MIST_THEME,
21
20
  cyberpunk: CYBERPUNK_DARK_THEME,
22
- deepWoods: DEEP_WOODS_DARK_THEME,
21
+ // deepWoods: DEEP_WOODS_DARK_THEME,
23
22
  hacker: DEFAULT_MATRIX_THEME,
24
23
  msdos: DEFAULT_MSDOS_THEME,
25
24
  }
@@ -1,5 +1,6 @@
1
- import { mergeDeepRight, pipe } from 'ramda'
1
+ import { mergeDeepRight, mergeDeepLeft, pipe } from 'ramda'
2
2
  import React from 'react'
3
+ import tinycolor from 'tinycolor2'
3
4
 
4
5
  import { DEFAULT_LIGHT_THEME } from '../default/lightTheme'
5
6
  import { DEFAULT_THEMES } from '../default/themes'
@@ -15,8 +16,13 @@ export function formatTheme(themes, key) {
15
16
  const theme = themes[key] || DEFAULT_THEMES[key] || DEFAULT_LIGHT_THEME
16
17
  const baseDefaultTheme = DEFAULT_THEMES[theme.base] || DEFAULT_THEMES[key] || DEFAULT_LIGHT_THEME
17
18
 
18
- return pipe(
19
+ const formattedTheme = pipe(
19
20
  mergeDeepRight(baseDefaultTheme), //
20
- applyColorVariantsOnTheme
21
+ applyColorVariantsOnTheme,
22
+ mergeDeepLeft(themes._all || {}) //
21
23
  )({ ...theme })
24
+
25
+ const isDark = tinycolor(formattedTheme?.colors?.overlayBG || formattedTheme?.colors?.bg).isDark()
26
+
27
+ return { ...formattedTheme, isDark, isLight: !isDark }
22
28
  }
@@ -3,18 +3,56 @@ import tinycolor from 'tinycolor2'
3
3
  export function getContrastColor(bg, options = ['#FFFFFF', '#666666'], tolerance = 2.5) {
4
4
  if (!options.length) return '#666666'
5
5
 
6
- return tinycolor.mostReadable(bg, options).toHexString()
6
+ const contrasts = options.map((color) => ({
7
+ color,
8
+ contrast: tinycolor.readability(bg, color),
9
+ }))
7
10
 
8
- // const contrasts = options.map((color) => ({
9
- // color,
10
- // contrast: tinycolor.readability(bg, color),
11
- // }))
11
+ contrasts.sort((a, b) => b.contrast - a.contrast)
12
12
 
13
- // contrasts.sort((a, b) => b.contrast - a.contrast)
13
+ if (contrasts.length > 1 && Math.abs(contrasts[0].contrast - contrasts[1].contrast) < tolerance) {
14
+ return options[0]
15
+ }
14
16
 
15
- // if (contrasts.length > 1 && Math.abs(contrasts[0].contrast - contrasts[1].contrast) < tolerance) {
16
- // return options[0]
17
- // }
18
-
19
- // return contrasts[0].color
17
+ return contrasts[0].color
20
18
  }
19
+
20
+ // export function getContrastColor(bg, options = ['#FFFFFF', '#666666'], tolerance = 2.5) {
21
+ // if (!options.length) return '#666666'
22
+
23
+ // return tinycolor.mostReadable(bg, options).toHexString()
24
+ // }
25
+
26
+ // export function getContrastColor(bg, options = ['#FFFFFF', '#666666'], tolerance = 2.5) {
27
+ // const background = tinycolor(bg)
28
+
29
+ // function scoreColor(color) {
30
+ // const c = tinycolor(color)
31
+ // const contrast = tinycolor.readability(background, c)
32
+ // const { h: bh, s: bs, l: bl } = background.toHsl()
33
+ // const { h, s, l } = c.toHsl()
34
+
35
+ // const hueDiff = Math.abs(bh - h)
36
+ // const harmony = hueDiff > 180 ? 360 - hueDiff : hueDiff
37
+
38
+ // return (
39
+ // (contrast > tolerance ? contrast * 2 : contrast) +
40
+ // (100 - harmony) / 10 +
41
+ // (s > 0.1 && s < 0.8 ? 2 : 0) +
42
+ // (l > 0.2 && l < 0.8 ? 1 : 0)
43
+ // )
44
+ // }
45
+
46
+ // let bestColor = options[0]
47
+ // let bestScore = scoreColor(bestColor)
48
+
49
+ // for (let i = 1; i < options.length; i++) {
50
+ // const score = scoreColor(options[i])
51
+ // if (score > bestScore) {
52
+ // bestColor = options[i]
53
+ // bestScore = score
54
+ // }
55
+ // }
56
+
57
+ // return bestColor
58
+ // }
@@ -1 +0,0 @@
1
- import{TouchableOpacity as RNTouchableOpacity}from"react-native-web";export var AbsTouchableOpacity=RNTouchableOpacity;
@@ -1 +0,0 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/calendar/DayPicker.js";var _excluded=["initialValue","value","onChange","min","max","onCheckDisabled"];import React from'react';import dayjs from'dayjs';import{Col}from"../structure/Col";import{Grid}from"../structure/Row";import{Icon}from"../presentation/Icon";import{Link}from"../actions/Link";import{Text}from"../text/Text";import{View}from"../structure/View";import{useCalendarDays}from"./_helpers/calendarDays";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function DayPicker(_ref){var _this=this;var initialValue=_ref.initialValue,value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(dayjs(initialValue)),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;var handleChange=function handleChange(v){setLocalValue(v);onChange==null?void 0:onChange(v);};var _React$useState3=React.useState(function(){return initialValue?dayjs(initialValue).startOf('month'):dayjs().startOf('month');}),_React$useState4=_slicedToArray(_React$useState3,2),currentMonth=_React$useState4[0],setCurrentMonth=_React$useState4[1];var prevMonth=function prevMonth(){return setCurrentMonth(function(m){return m.subtract(1,'month');});};var nextMonth=function nextMonth(){return setCurrentMonth(function(m){return m.add(1,'month');});};var prevYear=function prevYear(){return setCurrentMonth(function(m){return m.subtract(1,'year');});};var nextYear=function nextYear(){return setCurrentMonth(function(m){return m.add(1,'year');});};var _useCalendarDays=useCalendarDays(currentMonth),weekdayLabels=_useCalendarDays.weekdayLabels,cells=_useCalendarDays.cells;return _jsxs(View,Object.assign({className:"neko-day-picker",width:250},props,{children:[_jsxs(View,{className:"neko-date-picker-header",row:true,centerV:true,gap:"xxs",height:30,children:[_jsx(Link,{onPress:prevYear,"aria-label":"Previous year",padding:"xxs",paddingL:0,children:_jsx(Icon,{name:"arrow-left-double-line"})}),_jsx(Link,{onPress:prevMonth,"aria-label":"Previous month",padding:"xxs",children:_jsx(Icon,{name:"arrow-left-s-line"})}),_jsx(Text,{center:true,flex:true,children:currentMonth.format('MMM YYYY')}),_jsx(Link,{onPress:nextMonth,"aria-label":"Next month",padding:"xxs",children:_jsx(Icon,{name:"arrow-right-s-line"})}),_jsx(Link,{onPress:nextYear,"aria-label":"Next year",padding:"xxs",paddingR:0,children:_jsx(Icon,{name:"arrow-right-double-line"})})]}),_jsx(View,{className:"neko-day-picker-week",row:true,center:true,gap:"sm",children:weekdayLabels.map(function(w){return _jsx(View,{flex:true,height:30,center:true,children:_jsx(Text,{center:true,sm:true,text4:true,children:w})},w);})}),_jsx(Grid,{className:"neko-day-picker-days",colSpan:24/7,gap:"sm",children:cells.map(function(day,i){var dateVal=currentMonth.date(day);var isActive=!!day&&dateVal.isSame(value,'day');var disabled=!!min&&dateVal.isBefore(min)||!!max&&dateVal.isAfter(max)||(onCheckDisabled==null?void 0:onCheckDisabled(dateVal));return _jsx(Col,{className:"day-cell",center:true,children:_jsx(Link,{ratio:1,width:30,center:true,br:"md",onPress:function onPress(){return!!day&&handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsx(Text,{sm:true,text2:true,center:true,strong:isActive,children:day||''})})},day?dateVal.format('YYYYMMDD'):i);})})]}));}
@@ -1,3 +0,0 @@
1
- import { TouchableOpacity as RNTouchableOpacity } from 'react-native'
2
-
3
- export const AbsTouchableOpacity = RNTouchableOpacity
@@ -1,94 +0,0 @@
1
- import React from 'react'
2
- import dayjs from 'dayjs'
3
-
4
- import { Col } from '../structure/Col'
5
- import { Grid } from '../structure/Row'
6
- import { Icon } from '../presentation/Icon'
7
- import { Link } from '../actions/Link'
8
- import { Text } from '../text/Text'
9
- import { View } from '../structure/View'
10
- import { useCalendarDays } from './_helpers/calendarDays'
11
-
12
- export function DayPicker({ initialValue, value, onChange, min, max, onCheckDisabled, ...props }) {
13
- const [localValue, setLocalValue] = React.useState(dayjs(initialValue))
14
- value = value === undefined ? localValue : value
15
- const handleChange = (v) => {
16
- setLocalValue(v)
17
- onChange?.(v)
18
- }
19
-
20
- const [currentMonth, setCurrentMonth] = React.useState(() =>
21
- initialValue ? dayjs(initialValue).startOf('month') : dayjs().startOf('month')
22
- )
23
-
24
- const prevMonth = () => setCurrentMonth((m) => m.subtract(1, 'month'))
25
- const nextMonth = () => setCurrentMonth((m) => m.add(1, 'month'))
26
-
27
- const prevYear = () => setCurrentMonth((m) => m.subtract(1, 'year'))
28
- const nextYear = () => setCurrentMonth((m) => m.add(1, 'year'))
29
-
30
- const { weekdayLabels, cells } = useCalendarDays(currentMonth)
31
-
32
- return (
33
- <View className="neko-day-picker" width={250} {...props}>
34
- <View className="neko-date-picker-header" row centerV gap="xxs" height={30}>
35
- <Link onPress={prevYear} aria-label="Previous year" padding="xxs" paddingL={0}>
36
- <Icon name="arrow-left-double-line" />
37
- </Link>
38
-
39
- <Link onPress={prevMonth} aria-label="Previous month" padding="xxs">
40
- <Icon name="arrow-left-s-line" />
41
- </Link>
42
-
43
- <Text center flex>
44
- {currentMonth.format('MMM YYYY')}
45
- </Text>
46
-
47
- <Link onPress={nextMonth} aria-label="Next month" padding="xxs">
48
- <Icon name="arrow-right-s-line" />
49
- </Link>
50
-
51
- <Link onPress={nextYear} aria-label="Next year" padding="xxs" paddingR={0}>
52
- <Icon name="arrow-right-double-line" />
53
- </Link>
54
- </View>
55
-
56
- <View className="neko-day-picker-week" row center gap="sm">
57
- {weekdayLabels.map((w) => (
58
- <View key={w} flex height={30} center>
59
- <Text center sm text4>
60
- {w}
61
- </Text>
62
- </View>
63
- ))}
64
- </View>
65
-
66
- <Grid className="neko-day-picker-days" colSpan={24 / 7} gap="sm">
67
- {cells.map((day, i) => {
68
- const dateVal = currentMonth.date(day)
69
- const isActive = !!day && dateVal.isSame(value, 'day')
70
- const disabled =
71
- (!!min && dateVal.isBefore(min)) || (!!max && dateVal.isAfter(max)) || onCheckDisabled?.(dateVal)
72
-
73
- return (
74
- <Col key={day ? dateVal.format('YYYYMMDD') : i} className="day-cell" center>
75
- <Link
76
- ratio={1}
77
- width={30}
78
- center
79
- br="md"
80
- onPress={() => !!day && handleChange(dateVal)}
81
- bg={isActive && 'primary'}
82
- disabled={disabled}
83
- >
84
- <Text sm text2 center strong={isActive}>
85
- {day || ''}
86
- </Text>
87
- </Link>
88
- </Col>
89
- )
90
- })}
91
- </Grid>
92
- </View>
93
- )
94
- }