@codeleap/mobile 2.3.19 → 2.3.20

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 (87) hide show
  1. package/dist/components/AutoComplete/index.d.ts +1 -0
  2. package/dist/components/AutoComplete/index.js +2 -1
  3. package/dist/components/AutoComplete/index.js.map +1 -1
  4. package/dist/components/AutoComplete/styles.js +67 -3
  5. package/dist/components/AutoComplete/styles.js.map +1 -1
  6. package/dist/components/Checkbox/index.d.ts +1 -1
  7. package/dist/components/EmptyPlaceholder/index.d.ts +5 -2
  8. package/dist/components/EmptyPlaceholder/index.js +19 -5
  9. package/dist/components/EmptyPlaceholder/index.js.map +1 -1
  10. package/dist/components/EmptyPlaceholder/styles.d.ts +1 -1
  11. package/dist/components/EmptyPlaceholder/styles.js +5 -7
  12. package/dist/components/EmptyPlaceholder/styles.js.map +1 -1
  13. package/dist/components/Grid/styles.d.ts +49 -0
  14. package/dist/components/Image/index.d.ts +1 -0
  15. package/dist/components/Image/index.js +21 -3
  16. package/dist/components/Image/index.js.map +1 -1
  17. package/dist/components/List/styles.d.ts +49 -0
  18. package/dist/components/List/styles.js +5 -4
  19. package/dist/components/List/styles.js.map +1 -1
  20. package/dist/components/Modal/index.d.ts +2 -0
  21. package/dist/components/Modal/index.js +11 -9
  22. package/dist/components/Modal/index.js.map +1 -1
  23. package/dist/components/Modal/styles.d.ts +2 -2
  24. package/dist/components/Modal/styles.js +18 -19
  25. package/dist/components/Modal/styles.js.map +1 -1
  26. package/dist/components/MultiSelect/index.js +7 -5
  27. package/dist/components/MultiSelect/index.js.map +1 -1
  28. package/dist/components/MultiSelect/styles.d.ts +0 -51
  29. package/dist/components/MultiSelect/styles.js +67 -5
  30. package/dist/components/MultiSelect/styles.js.map +1 -1
  31. package/dist/components/MultiSelect/types.d.ts +8 -1
  32. package/dist/components/Scroll/styles.d.ts +49 -0
  33. package/dist/components/Scroll/styles.js +3 -4
  34. package/dist/components/Scroll/styles.js.map +1 -1
  35. package/dist/components/SegmentedControl/index.js +5 -4
  36. package/dist/components/SegmentedControl/index.js.map +1 -1
  37. package/dist/components/SegmentedControl/styles.d.ts +1 -1
  38. package/dist/components/SegmentedControl/styles.js +9 -9
  39. package/dist/components/SegmentedControl/styles.js.map +1 -1
  40. package/dist/components/Select/index.d.ts +4 -1
  41. package/dist/components/Select/index.js +16 -21
  42. package/dist/components/Select/index.js.map +1 -1
  43. package/dist/components/Select/styles.d.ts +54 -53
  44. package/dist/components/Select/styles.js +61 -10
  45. package/dist/components/Select/styles.js.map +1 -1
  46. package/dist/components/Select/types.d.ts +8 -1
  47. package/dist/components/TextInput/index.js +4 -1
  48. package/dist/components/TextInput/index.js.map +1 -1
  49. package/dist/components/Touchable/index.js +5 -1
  50. package/dist/components/Touchable/index.js.map +1 -1
  51. package/dist/components/View/index.js +19 -13
  52. package/dist/components/View/index.js.map +1 -1
  53. package/dist/components/defaultStyles.d.ts +147 -51
  54. package/dist/utils/KeyboardAware/context.js +1 -6
  55. package/dist/utils/KeyboardAware/context.js.map +1 -1
  56. package/dist/utils/PermissionManager/context.js +3 -2
  57. package/dist/utils/PermissionManager/context.js.map +1 -1
  58. package/dist/utils/hooks.d.ts +2 -0
  59. package/dist/utils/hooks.js +44 -1
  60. package/dist/utils/hooks.js.map +1 -1
  61. package/dist/utils/theme.js +3 -3
  62. package/dist/utils/theme.js.map +1 -1
  63. package/package.json +3 -2
  64. package/src/components/AutoComplete/index.tsx +5 -1
  65. package/src/components/AutoComplete/styles.ts +112 -6
  66. package/src/components/EmptyPlaceholder/index.tsx +32 -8
  67. package/src/components/EmptyPlaceholder/styles.ts +18 -15
  68. package/src/components/Image/index.tsx +33 -3
  69. package/src/components/List/styles.ts +7 -1
  70. package/src/components/Modal/index.tsx +12 -7
  71. package/src/components/Modal/styles.ts +36 -46
  72. package/src/components/MultiSelect/index.tsx +10 -4
  73. package/src/components/MultiSelect/styles.ts +117 -4
  74. package/src/components/MultiSelect/types.ts +8 -0
  75. package/src/components/Scroll/styles.ts +4 -1
  76. package/src/components/SegmentedControl/index.tsx +5 -4
  77. package/src/components/SegmentedControl/styles.ts +13 -10
  78. package/src/components/Select/index.tsx +50 -27
  79. package/src/components/Select/styles.ts +103 -25
  80. package/src/components/Select/types.ts +11 -1
  81. package/src/components/TextInput/index.tsx +3 -1
  82. package/src/components/Touchable/index.tsx +5 -3
  83. package/src/components/View/index.tsx +25 -13
  84. package/src/utils/KeyboardAware/context.tsx +2 -7
  85. package/src/utils/PermissionManager/context.tsx +1 -1
  86. package/src/utils/hooks.ts +50 -0
  87. package/src/utils/theme.ts +1 -1
@@ -9,22 +9,127 @@ const createAutoCompleteStyle = createDefaultVariantFactory<AutoCompleteComposit
9
9
  export const AutoCompleteStyles = {
10
10
  ...SelectStyles,
11
11
  default: createAutoCompleteStyle((theme) => {
12
- const defaultStyle = SelectStyles.default(theme)
13
12
 
14
13
  return {
15
- ...defaultStyle,
14
+ wrapper: {
15
+ ...theme.presets.absolute,
16
+ // ...theme.presets.whole,
17
+ ...theme.presets.fullHeight,
18
+ ...theme.presets.fullWidth,
19
+ },
20
+ 'box:transition': {
21
+ scale: {
22
+ duration: theme.values.transitions.modal.duration,
23
+ type: 'timing',
24
+ },
25
+ opacity: {
26
+ duration: theme.values.transitions.modal.duration,
27
+ type: 'timing',
28
+ },
29
+ },
30
+ 'backdrop:transition': {
31
+ opacity: {
32
+ duration: theme.values.transitions.modal.duration,
33
+ type: 'timing',
34
+ },
35
+ },
36
+ backdrop: {
37
+ ...theme.presets.absolute,
38
+ ...theme.presets.whole,
39
+
40
+ backgroundColor: theme.colors.black,
41
+
42
+ },
43
+ backdropTouchable: {
44
+ // height: '100%',
45
+ ...theme.presets.absolute,
46
+ ...theme.presets.whole,
47
+
48
+ },
49
+ 'backdrop:visible': {
50
+ opacity: 0.5,
51
+ },
52
+ 'backdrop:hidden': {
53
+ opacity: 0,
54
+ },
55
+ innerWrapper: {
56
+
57
+ },
58
+ scroll: {
59
+ flex: 1,
60
+ // maxHeight: theme.values.height,
61
+ },
62
+ scrollContent: {
63
+ ...theme.presets.alignCenter,
64
+ ...theme.presets.justifyCenter,
65
+ minHeight: '100%',
66
+ ...theme.presets.safeAreaTop(theme.values.innerSpacing.Y),
67
+ ...theme.presets.safeAreaBottom(theme.values.innerSpacing.Y),
68
+ },
69
+ box: {
70
+ backgroundColor: theme.colors.background,
71
+ width: theme.values.width - theme.spacing.value(theme.values.innerSpacing.X * 2),
72
+ borderRadius: theme.borderRadius.modalOuter,
73
+ ...theme.spacing.paddingHorizontal(theme.values.innerSpacing.X),
74
+ ...theme.spacing.paddingVertical(theme.values.innerSpacing.Y),
75
+ },
76
+
77
+ 'box:hidden': {
78
+ opacity: 0,
79
+ scale: 0.8,
80
+
81
+ },
82
+ 'box:visible': {
83
+ opacity: 1,
84
+ scale: 1,
85
+ },
86
+
87
+ closeButtonTouchableWrapper: {
88
+ alignSelf: 'center',
89
+ ...theme.spacing.marginLeft('auto'),
90
+ },
91
+ closeButtonIcon: {
92
+ color: theme.colors.text,
93
+ },
94
+
95
+ listWrapper: {
96
+ height: 'auto',
97
+ },
98
+
99
+ itemWrapper: {
100
+ ...theme.presets.row,
101
+ ...theme.presets.justifySpaceBetween,
102
+ ...theme.presets.alignCenter,
103
+ borderRadius: theme.borderRadius.medium,
104
+ ...theme.spacing.padding(1),
105
+ backgroundColor: theme.colors.backgroundSecondary,
106
+ },
107
+ 'itemWrapper:selected': {
108
+ backgroundColor: theme.colors.primary,
109
+ },
110
+ 'itemIcon:selected': {
111
+ color: theme.colors.backgroundSecondary,
112
+ ...theme.sized(2),
113
+
114
+ },
115
+ 'itemText:selected': {
116
+ color: theme.colors.backgroundSecondary,
117
+
118
+ },
119
+ itemIcon: {
120
+ height: 0,
121
+ width: 0,
122
+ },
16
123
  header: {
17
- ...theme.spacing.paddingHorizontal(2),
18
- ...theme.spacing.paddingTop(1),
124
+ ...theme.spacing.paddingHorizontal(theme.values.innerSpacing.X),
125
+ ...theme.spacing.paddingVertical(theme.values.innerSpacing.Y),
19
126
  ...theme.presets.column,
20
127
  ...theme.presets.alignStart,
21
128
  },
22
-
23
129
  searchInputWrapper: {
24
130
  ...theme.presets.fullWidth,
25
131
  ...theme.spacing.marginTop(2),
26
132
  },
27
-
28
133
  titleWrapper: {
29
134
  ...theme.presets.row,
30
135
  ...theme.presets.alignCenter,
@@ -33,6 +138,7 @@ export const AutoCompleteStyles = {
33
138
  },
34
139
  title: {
35
140
  ...theme.presets.textCenter,
141
+ ...assignTextStyle('h3')(theme).text,
36
142
  flex: 1,
37
143
  },
38
144
  closeButtonWrapper: {
@@ -16,18 +16,25 @@ import {
16
16
  EmptyPlaceholderStyles,
17
17
  } from './styles'
18
18
 
19
- import { StyleSheet } from 'react-native'
19
+ import { ImageSourcePropType, StyleSheet, Image as RNImage } from 'react-native'
20
20
  import { StylesOf } from '../../types'
21
+ import { Image } from '../Image'
21
22
 
22
23
  export * from './styles'
23
24
 
24
25
  export type EmptyPlaceholderProps = {
25
26
  itemName?: string
26
- title?: React.ReactElement
27
+
28
+ title?: React.ReactElement | string
29
+ description?: React.ReactElement | string
30
+ image?: ImageSourcePropType
31
+ icon?: IconPlaceholder
32
+
27
33
  loading?: boolean
34
+
28
35
  styles?: StylesOf<EmptyPlaceholderComposition>
29
36
  variants?: ComponentVariants<typeof EmptyPlaceholderStyles>['variants']
30
- emptyIconName?: IconPlaceholder
37
+
31
38
  renderEmpty?: (props: {
32
39
  emptyText:string | React.ReactElement
33
40
  emptyIconName?: IconPlaceholder
@@ -40,14 +47,16 @@ export const EmptyPlaceholder:React.FC<EmptyPlaceholderProps> = (props: EmptyPla
40
47
  itemName,
41
48
  title,
42
49
  loading,
50
+ description,
51
+ image,
43
52
  styles = {},
44
53
  variants = [],
45
- emptyIconName = 'placeholder',
54
+ icon = null,
46
55
  renderEmpty,
47
56
  } = props
48
57
  const emptyText = title || (itemName && `No ${itemName} found.`) || 'No items.'
49
58
 
50
- const componentStyles = useDefaultComponentStyle('EmptyPlaceholder', {
59
+ const componentStyles = useDefaultComponentStyle<'u:EmptyPlaceholder', typeof EmptyPlaceholderStyles>('u:EmptyPlaceholder', {
51
60
  variants,
52
61
  transform: StyleSheet.flatten,
53
62
  styles,
@@ -69,7 +78,7 @@ export const EmptyPlaceholder:React.FC<EmptyPlaceholderProps> = (props: EmptyPla
69
78
  <View style={componentStyles.wrapper}>
70
79
  {renderEmpty({
71
80
  emptyText,
72
- emptyIconName: emptyIconName as IconPlaceholder,
81
+ emptyIconName: icon as IconPlaceholder,
73
82
  styles: {
74
83
  ...componentStyles,
75
84
  activityIndicatorStyles,
@@ -79,10 +88,25 @@ export const EmptyPlaceholder:React.FC<EmptyPlaceholderProps> = (props: EmptyPla
79
88
  )
80
89
  }
81
90
 
91
+ let _image = null
92
+
93
+ if (icon) {
94
+ _image = <Icon name={icon} style={componentStyles.icon}/>
95
+ } else if (image) {
96
+ _image = <Image source={image} style={[
97
+ componentStyles.image,
98
+
99
+ ]}/>
100
+ }
101
+
82
102
  return (
83
103
  <View style={componentStyles.wrapper}>
84
- <Icon name={emptyIconName as IconPlaceholder} style={componentStyles.icon}/>
85
- <Text text={emptyText} style={componentStyles.text}/>
104
+ <View style={componentStyles.imageWrapper}>
105
+ {_image}
106
+ </View>
107
+
108
+ {React.isValidElement(emptyText) ? emptyText : <Text text={emptyText} style={componentStyles.title}/> }
109
+ {React.isValidElement(description) ? description : <Text text={description} style={componentStyles.description}/> }
86
110
  </View>
87
111
  )
88
112
  }
@@ -5,7 +5,10 @@ export type EmptyPlaceholderComposition =
5
5
  | 'wrapper:loading'
6
6
  | `loader${Capitalize<ActivityIndicatorComposition>}`
7
7
  | 'wrapper'
8
- | 'text'
8
+ | 'title'
9
+ | 'description'
10
+ | 'image'
11
+ | 'imageWrapper'
9
12
  | 'icon'
10
13
 
11
14
  const createEmptyPlaceholderStyle = createDefaultVariantFactory<EmptyPlaceholderComposition>()
@@ -17,24 +20,24 @@ export const EmptyPlaceholderStyles = {
17
20
  ...presets,
18
21
  default: createEmptyPlaceholderStyle((theme) => ({
19
22
  wrapper: {
23
+ flexGrow: 1,
20
24
  ...theme.presets.center,
21
- minHeight: theme.values.window.height / 2,
22
- height: '100%',
23
- flex: 1,
24
25
  },
25
- loaderWrapper: {
26
-
27
- ...theme.spacing.marginVertical(8),
28
- ...theme.presets.center,
29
- ...theme.presets.flex,
30
- },
31
- icon: {
32
- color: theme.colors.placeholder,
33
- size: theme.spacing.value(24),
26
+ title: {
27
+ ...assignTextStyle('h3')(theme).text,
28
+ ...theme.spacing.marginBottom(theme.values.innerSpacing.Y),
34
29
  },
35
- text: {
30
+ description: {
36
31
  ...assignTextStyle('p1')(theme).text,
37
- ...theme.presets.textCenter,
32
+ },
33
+ imageWrapper: {
34
+ ...theme.spacing.paddingBottom(theme.values.innerSpacing.Y * 2),
35
+ ...theme.presets.fullWidth,
36
+ ...theme.presets.alignCenter,
37
+ height: '45%',
38
+ },
39
+ image: {
40
+ ...theme.presets.fullHeight,
38
41
  },
39
42
  })),
40
43
  compact: createEmptyPlaceholderStyle((theme) => ({
@@ -38,10 +38,20 @@ export type ImageProps = Omit<NativeImageProps, 'source' | 'style'> & {
38
38
  | number
39
39
  resizeMode?: keyof typeof FastImage.resizeMode
40
40
  spotlight?: string
41
+ maintainAspectRatioFrom?: 'width' | 'height' | 'none'
41
42
  }
42
43
 
43
44
  export const ImageComponent: React.FC<ImageProps> = (props) => {
44
- const { variants, style, fast = true, spotlight = null, resizeMode = 'contain', source, ...imageProps } = props
45
+ const {
46
+ variants,
47
+ style,
48
+ fast = true,
49
+ spotlight = null,
50
+ resizeMode = 'contain',
51
+ source,
52
+ maintainAspectRatioFrom = 'height',
53
+ ...imageProps
54
+ } = props
45
55
 
46
56
  const variantStyles = useDefaultComponentStyle<'u:Image', typeof ImageStyles>('u:Image', { variants })
47
57
 
@@ -60,12 +70,32 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
60
70
  style: [variantStyles.touchable],
61
71
  android_ripple: null,
62
72
  }
73
+
74
+ const aspectRatioStyle = React.useMemo(() => {
75
+ if (maintainAspectRatioFrom === 'none' || !imSource) return null
76
+ try {
77
+ // @ts-ignore
78
+ const assetSource = NativeImage.resolveAssetSource(imSource)
79
+ const aspectRatio = assetSource.width / assetSource.height
80
+
81
+ if (Number.isNaN(aspectRatio)) {
82
+ return null
83
+ }
84
+ return {
85
+ aspectRatio,
86
+ }
87
+ } catch (e) {
88
+ return null
89
+ }
90
+
91
+ }, [maintainAspectRatioFrom, imSource])
92
+
63
93
  if (fast) {
64
94
  return (
65
95
  <Wrapper {...wrapperProps}>
66
96
 
67
97
  <FastImage
68
- style={styles}
98
+ style={[aspectRatioStyle, styles]}
69
99
  // @ts-ignore
70
100
  tintColor={styles?.tintColor}
71
101
  source={imSource}
@@ -76,7 +106,7 @@ export const ImageComponent: React.FC<ImageProps> = (props) => {
76
106
  )
77
107
  }
78
108
  return <Wrapper {...wrapperProps}>
79
- <NativeImage style={styles} resizeMode={resizeMode} source={imSource} {...(imageProps as any)} />
109
+ <NativeImage style={[aspectRatioStyle, styles]} resizeMode={resizeMode} source={imSource} {...(imageProps as any)} />
80
110
 
81
111
  </Wrapper>
82
112
  }
@@ -1,11 +1,14 @@
1
- import { createDefaultVariantFactory } from '@codeleap/common'
1
+ import { createDefaultVariantFactory, includePresets } from '@codeleap/common'
2
2
  import { ScrollComposition, ScrollStyles } from '../Scroll/styles'
3
3
 
4
4
  export type ListComposition = ScrollComposition | 'separator'
5
5
 
6
6
  const createListStyle = createDefaultVariantFactory<ListComposition>()
7
7
 
8
+ const presets = includePresets(style => createListStyle(() => ({ content: style })))
9
+
8
10
  export const ListStyles = {
11
+ ...presets,
9
12
  default: createListStyle((theme) => {
10
13
  const defaultStyles = ScrollStyles.default(theme)
11
14
  return {
@@ -14,6 +17,9 @@ export const ListStyles = {
14
17
  width: '100%',
15
18
  height: theme.spacing.value(1),
16
19
  },
20
+ content: {
21
+ flexGrow: 1,
22
+ },
17
23
  }
18
24
  }),
19
25
  }
@@ -25,6 +25,7 @@ import { useBackButton, useStaticAnimationStyles } from '../../utils/hooks'
25
25
  import { Text, TextProps } from '../Text'
26
26
  import { Touchable } from '../Touchable'
27
27
  import { GetKeyboardAwarePropsOptions } from '../../utils'
28
+ import { ActionIcon } from '../ActionIcon'
28
29
 
29
30
  export * from './styles'
30
31
 
@@ -43,6 +44,7 @@ export type ModalProps = Omit<ViewProps, 'variants' | 'styles'> & {
43
44
  visible: boolean
44
45
  toggle?: () => void
45
46
  zIndex?: number
47
+ description?: React.ReactElement
46
48
  scroll?: boolean
47
49
  header?: React.ReactElement
48
50
  closeOnHardwareBackPress?: boolean
@@ -57,12 +59,13 @@ export type ModalHeaderProps = Omit<ModalProps, 'styles' | 'renderHeader'> & {
57
59
  title: TextProps['style']
58
60
  closeButton: ButtonProps['styles']
59
61
  }
62
+ description?: React.ReactElement
60
63
  }
61
64
 
62
65
  const DefaultHeader:React.FC<ModalHeaderProps> = (props) => {
63
- const { styles, title = null, showClose = false, closable, debugName, closeIconName = 'close', toggle } = props
66
+ const { styles, title = null, showClose = false, description = null, closable, debugName, closeIconName = 'close', toggle } = props
64
67
  return <>
65
- {(title || showClose) && (
68
+ {(title || showClose || description) && (
66
69
  <View style={styles.wrapper}>
67
70
  {typeof title === 'string' ? (
68
71
  <Text text={title} style={styles.title} />
@@ -71,10 +74,9 @@ const DefaultHeader:React.FC<ModalHeaderProps> = (props) => {
71
74
  )}
72
75
 
73
76
  {(showClose && closable) && (
74
- <Button
77
+ <ActionIcon
75
78
  debugName={`${debugName} modal close button`}
76
79
  icon={closeIconName as IconPlaceholder}
77
- variants={['icon']}
78
80
  onPress={toggle}
79
81
  styles={styles.closeButton}
80
82
  />
@@ -104,7 +106,6 @@ export const Modal: React.FC<ModalProps> = (modalProps) => {
104
106
  closeOnHardwareBackPress = true,
105
107
  ...props
106
108
  } = modalProps
107
-
108
109
  const variantStyles = useDefaultComponentStyle('u:Modal', {
109
110
  variants: variants as any,
110
111
  transform: StyleSheet.flatten,
@@ -136,7 +137,9 @@ export const Modal: React.FC<ModalProps> = (modalProps) => {
136
137
  const scrollStyle = scroll ? getStyles('scroll') : getStyles('innerWrapper')
137
138
 
138
139
  const headerProps:ModalHeaderProps = {
140
+
139
141
  ...modalProps,
142
+ closable,
140
143
  styles: {
141
144
  wrapper: getStyles('header'),
142
145
  title: getStyles('title'),
@@ -170,14 +173,16 @@ export const Modal: React.FC<ModalProps> = (modalProps) => {
170
173
  <ScrollComponent
171
174
  style={scrollStyle}
172
175
  contentContainerStyle={getStyles('scrollContent')}
176
+ showsVerticalScrollIndicator={false}
173
177
  keyboardAware= {{
174
- adapt: 'marginBottom',
178
+ adapt: 'maxHeight',
175
179
  baseStyleProp: 'style',
176
180
  animated: true,
177
181
  enabled: visible,
178
- enableOnAndroid: true,
182
+ // enableOnAndroid: true,
179
183
  }}
180
184
  animated
185
+ // ref={scrollRef}
181
186
  { ...scrollProps}
182
187
  >
183
188
  {dismissOnBackdrop &&
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  assignTextStyle,
3
- ButtonComposition,
4
3
  createDefaultVariantFactory,
5
4
  includePresets,
6
5
  } from '@codeleap/common'
6
+ import { ActionIconComposition } from '../ActionIcon'
7
7
 
8
8
  export type AnimatableParts = 'box' | 'backdrop'
9
9
 
@@ -11,7 +11,6 @@ export type ModalParts =
11
11
  | AnimatableParts
12
12
  | 'wrapper'
13
13
  | 'innerWrapper'
14
-
15
14
  | 'scrollContent'
16
15
  | 'scroll'
17
16
  | 'body'
@@ -19,7 +18,7 @@ export type ModalParts =
19
18
  | 'header'
20
19
  | 'backdropTouchable'
21
20
  | 'title'
22
- | `closeButton${Capitalize<ButtonComposition>}`
21
+ | `closeButton${Capitalize<ActionIconComposition>}`
23
22
 
24
23
  export type ModalComposition =
25
24
  | ModalParts
@@ -32,26 +31,14 @@ const createModalStyle = createDefaultVariantFactory<ModalComposition>()
32
31
  const presets = includePresets((style) => createModalStyle(() => ({ body: style })))
33
32
 
34
33
  export const ModalStyles = {
35
-
36
34
  ...presets,
37
35
  default: createModalStyle((theme) => {
38
- const fullSize = {
39
- ...theme.presets.whole,
40
- position: 'absolute',
41
- width: theme.values.width,
42
- height: theme.values.height,
43
- maxHeight: theme.values.height,
44
- }
45
-
46
36
  return {
47
37
  wrapper: {
48
- zIndex: 1,
49
- height: theme.values.height,
50
- width: theme.values.width,
51
- ...theme.presets.whole,
52
- position: 'absolute',
53
- ...theme.presets.safeAreaTop(),
54
- paddingBottom: theme.values.bottomNavHeight,
38
+ ...theme.presets.absolute,
39
+ // ...theme.presets.whole,
40
+ ...theme.presets.fullHeight,
41
+ ...theme.presets.fullWidth,
55
42
  },
56
43
  'box:transition': {
57
44
  scale: {
@@ -70,12 +57,17 @@ export const ModalStyles = {
70
57
  },
71
58
  },
72
59
  backdrop: {
60
+ ...theme.presets.absolute,
61
+ ...theme.presets.whole,
73
62
 
74
63
  backgroundColor: theme.colors.black,
75
- ...fullSize,
64
+
76
65
  },
77
66
  backdropTouchable: {
78
- ...fullSize,
67
+ // height: '100%',
68
+ ...theme.presets.absolute,
69
+ ...theme.presets.whole,
70
+
79
71
  },
80
72
  'backdrop:visible': {
81
73
  opacity: 0.5,
@@ -84,28 +76,25 @@ export const ModalStyles = {
84
76
  opacity: 0,
85
77
  },
86
78
  innerWrapper: {
87
- ...theme.presets.alignCenter,
88
- ...theme.presets.justifyCenter,
89
- width: theme.values.width,
90
- flex: 1,
79
+
91
80
  },
92
81
  scroll: {
93
- width: theme.values.width,
94
- height: theme.values.window.height,
95
- maxHeight: theme.values.window.height,
82
+ flex: 1,
83
+ // maxHeight: theme.values.height,
96
84
  },
97
85
  scrollContent: {
98
86
  ...theme.presets.alignCenter,
99
87
  ...theme.presets.justifyCenter,
100
- ...theme.spacing.paddingVertical(2),
101
- ...theme.presets.fullWidth,
102
- flex: 1,
88
+ flexGrow: 1,
89
+ ...theme.presets.safeAreaTop(theme.values.innerSpacing.Y),
90
+ ...theme.presets.safeAreaBottom(theme.values.innerSpacing.Y),
103
91
  },
104
92
  box: {
105
- width: '80%',
106
93
  backgroundColor: theme.colors.background,
107
- borderRadius: theme.borderRadius.medium,
108
- ...theme.spacing.padding(2),
94
+ width: theme.values.width - theme.spacing.value(theme.values.innerSpacing.X * 2),
95
+ borderRadius: theme.borderRadius.modalOuter,
96
+ ...theme.spacing.paddingHorizontal(theme.values.innerSpacing.X),
97
+ ...theme.spacing.paddingVertical(theme.values.innerSpacing.Y),
109
98
  },
110
99
 
111
100
  'box:hidden': {
@@ -121,33 +110,34 @@ export const ModalStyles = {
121
110
  flexDirection: 'row',
122
111
  ...theme.presets.justifySpaceBetween,
123
112
  ...theme.presets.alignCenter,
113
+ ...theme.presets.alignSelfStretch,
114
+ ...theme.spacing.marginBottom(1),
124
115
  },
125
- closeButtonWrapper: {
116
+ closeButtonTouchableWrapper: {
126
117
  alignSelf: 'center',
127
118
  ...theme.spacing.marginLeft('auto'),
128
119
  },
120
+ closeButtonIcon: {
121
+ color: theme.colors.text,
122
+ },
129
123
  title: {
130
- ...theme.presets.textCenter,
131
124
  ...assignTextStyle('h3')(theme).text,
132
- ...theme.spacing.paddingBottom(1),
133
- flex: 1,
134
125
  },
135
126
  }
136
127
  }),
137
128
  popup: createModalStyle(() => ({})),
138
129
  fullscreen: createModalStyle((theme) => ({
139
- overlay: {
140
- backgroundColor: theme.colors.background,
141
- },
142
- 'overlay:visible': {
143
- opacity: 1,
130
+ scrollContent: {
131
+ paddingTop: 0,
132
+ paddingBottom: 0,
144
133
  },
145
134
  box: {
146
- flex: 1,
135
+ width: '100%',
136
+ flexGrow: 1,
147
137
  borderRadius: 0,
148
- width: theme.values.width,
149
- height: theme.values.window.height,
150
138
  ...theme.presets.center,
139
+ ...theme.presets.safeAreaTop(theme.values.innerSpacing.Y),
140
+ ...theme.presets.safeAreaBottom(theme.values.innerSpacing.Y),
151
141
  },
152
142
  })),
153
143
  }
@@ -32,6 +32,7 @@ export const MultiSelect = <T extends string|number = string>(selectProps:MultiS
32
32
  clearIconName = 'close',
33
33
  limit = null,
34
34
  validate = null,
35
+ itemProps = {},
35
36
  ...drawerProps
36
37
  } = selectProps
37
38
 
@@ -81,6 +82,8 @@ export const MultiSelect = <T extends string|number = string>(selectProps:MultiS
81
82
  onPress={() => select(item.value)}
82
83
  styles={variantStyles}
83
84
  icon={selectedIcon as IconPlaceholder}
85
+ {...itemProps}
86
+
84
87
  />
85
88
  }
86
89
 
@@ -123,16 +126,19 @@ export const MultiSelect = <T extends string|number = string>(selectProps:MultiS
123
126
  )
124
127
  }
125
128
 
126
- <ModalManager.Drawer scroll={false} title={label} {...drawerProps} styles={variantStyles}>
129
+ <ModalManager.Modal title={label} {...drawerProps} styles={variantStyles} id={null}>
127
130
  <List<MultiSelectProps<any>['options']>
128
131
  data={options}
129
- style={variantStyles.list}
130
- contentContainerStyle={variantStyles.listContent}
132
+ styles={getNestedStylesByKey('list', variantStyles)}
131
133
  keyExtractor={(i) => i.value}
134
+ separators
135
+ keyboardAware={{
136
+ enabled: false,
137
+ }}
132
138
  renderItem={renderListItem}
133
139
  {...listProps}
134
140
  />
135
- </ModalManager.Drawer>
141
+ </ModalManager.Modal>
136
142
 
137
143
  </>
138
144
  }