@hero-design/rn 7.7.0 → 7.9.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 (221) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/es/index.js +1775 -333
  3. package/lib/index.js +1780 -336
  4. package/package.json +4 -8
  5. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  6. package/src/components/Avatar/index.tsx +1 -1
  7. package/src/components/Button/Button.tsx +4 -2
  8. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -2
  9. package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +2 -0
  10. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +40 -0
  11. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +242 -0
  12. package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +2 -0
  13. package/src/components/Button/LoadingIndicator/index.tsx +3 -1
  14. package/src/components/Button/StyledButton.tsx +15 -2
  15. package/src/components/Button/__tests__/Button.spec.tsx +2 -0
  16. package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -0
  17. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +314 -0
  18. package/src/components/Card/DataCard/StyledDataCard.tsx +18 -0
  19. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +24 -0
  20. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +96 -0
  21. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +151 -0
  22. package/src/components/Card/DataCard/__tests__/index.spec.tsx +30 -0
  23. package/src/components/Card/DataCard/index.tsx +35 -0
  24. package/src/components/Card/StyledCard.tsx +1 -3
  25. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
  26. package/src/components/Card/index.tsx +7 -2
  27. package/src/components/Checkbox/index.tsx +1 -1
  28. package/src/components/Collapse/index.tsx +1 -1
  29. package/src/components/Icon/HeroIcon/index.tsx +3 -1
  30. package/src/components/Icon/index.tsx +3 -2
  31. package/src/components/List/BasicListItem.tsx +98 -0
  32. package/src/components/List/ListItem.tsx +142 -0
  33. package/src/components/List/StyledBasicListItem.tsx +34 -0
  34. package/src/components/List/StyledListItem.tsx +82 -0
  35. package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -0
  36. package/src/components/List/__tests__/ListItem.spec.tsx +110 -0
  37. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +24 -0
  38. package/src/components/List/__tests__/StyledListItem.spec.tsx +48 -0
  39. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +103 -0
  40. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +760 -0
  41. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +105 -0
  42. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +200 -0
  43. package/src/components/List/index.tsx +14 -0
  44. package/src/components/SectionHeading/index.tsx +1 -1
  45. package/src/components/Select/Footer.tsx +13 -0
  46. package/src/components/Select/MultiSelect/Option.tsx +25 -0
  47. package/src/components/Select/MultiSelect/OptionList.tsx +30 -63
  48. package/src/components/Select/MultiSelect/__tests__/Option.spec.tsx +16 -0
  49. package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +42 -0
  50. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +70 -0
  51. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +627 -0
  52. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -6
  53. package/src/components/Select/MultiSelect/index.tsx +8 -7
  54. package/src/components/Select/SingleSelect/Option.tsx +23 -0
  55. package/src/components/Select/SingleSelect/OptionList.tsx +43 -0
  56. package/src/components/Select/SingleSelect/__tests__/Option.spec.tsx +16 -0
  57. package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +42 -0
  58. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +56 -0
  59. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +571 -0
  60. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1430 -0
  61. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +89 -0
  62. package/src/components/Select/SingleSelect/index.tsx +89 -0
  63. package/src/components/Select/{MultiSelect/StyledMultiSelect.tsx → StyledSelect.tsx} +1 -1
  64. package/src/components/Select/{MultiSelect/__tests__/StyledMultiSelect.spec.tsx → __tests__/StyledSelect.spec.tsx} +2 -2
  65. package/src/components/Select/{MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap → __tests__/__snapshots__/StyledSelect.spec.tsx.snap} +0 -0
  66. package/src/components/Select/helpers.tsx +18 -0
  67. package/src/components/Select/index.tsx +4 -3
  68. package/src/components/Select/{MultiSelect/types.ts → types.ts} +0 -0
  69. package/src/components/Switch/index.tsx +1 -1
  70. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +2 -2
  71. package/src/components/Toolbar/StyledToolbar.tsx +42 -0
  72. package/src/components/Toolbar/ToolbarGroup.tsx +31 -0
  73. package/src/components/Toolbar/ToolbarItem.tsx +57 -0
  74. package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +32 -0
  75. package/src/components/Toolbar/__tests__/ToolbarItem.spec.tsx +57 -0
  76. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +391 -0
  77. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +355 -0
  78. package/src/components/Toolbar/index.tsx +18 -0
  79. package/src/components/Typography/Text/StyledText.tsx +8 -1
  80. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +5 -0
  81. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +110 -0
  82. package/src/components/Typography/Text/index.tsx +9 -2
  83. package/src/index.ts +4 -0
  84. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +83 -3
  85. package/src/theme/components/button.ts +2 -0
  86. package/src/theme/components/card.ts +13 -2
  87. package/src/theme/components/icon.ts +1 -0
  88. package/src/theme/components/list.ts +46 -0
  89. package/src/theme/components/toolbar.ts +27 -0
  90. package/src/theme/components/typography.ts +4 -0
  91. package/src/theme/global/colors.ts +9 -2
  92. package/src/theme/global/space.ts +2 -0
  93. package/src/theme/index.ts +6 -0
  94. package/tsconfig.json +1 -2
  95. package/types/components/Avatar/index.d.ts +1 -1
  96. package/types/components/Button/Button.d.ts +2 -2
  97. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
  98. package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
  99. package/types/components/Button/StyledButton.d.ts +2 -2
  100. package/types/components/Card/DataCard/StyledDataCard.d.ts +16 -0
  101. package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Card/DataCard/__tests__/StyledDataCard.spec.d.ts} +0 -0
  102. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +1 -0
  103. package/types/components/Card/DataCard/index.d.ts +22 -0
  104. package/types/components/Card/index.d.ts +7 -3
  105. package/types/components/Checkbox/index.d.ts +1 -1
  106. package/types/components/Collapse/index.d.ts +1 -1
  107. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  108. package/types/components/Icon/index.d.ts +2 -2
  109. package/types/components/List/BasicListItem.d.ts +43 -0
  110. package/types/components/List/ListItem.d.ts +51 -0
  111. package/types/components/List/StyledBasicListItem.d.ts +29 -0
  112. package/types/components/List/StyledListItem.d.ts +51 -0
  113. package/types/components/List/__tests__/BasicListItem.spec.d.ts +1 -0
  114. package/types/components/List/__tests__/ListItem.spec.d.ts +1 -0
  115. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +1 -0
  116. package/types/components/List/__tests__/StyledListItem.spec.d.ts +1 -0
  117. package/types/components/List/index.d.ts +8 -0
  118. package/types/components/SectionHeading/index.d.ts +1 -1
  119. package/types/components/Select/{MultiSelect/Footer.d.ts → Footer.d.ts} +2 -2
  120. package/types/components/Select/MultiSelect/Option.d.ts +6 -0
  121. package/types/components/Select/MultiSelect/OptionList.d.ts +7 -1
  122. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +1 -0
  123. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +1 -0
  124. package/types/components/Select/MultiSelect/index.d.ts +4 -4
  125. package/types/components/Select/SingleSelect/Option.d.ts +6 -0
  126. package/types/components/Select/SingleSelect/OptionList.d.ts +9 -0
  127. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +1 -0
  128. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +1 -0
  129. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +1 -0
  130. package/types/components/Select/SingleSelect/index.d.ts +35 -0
  131. package/types/components/Select/{MultiSelect/StyledMultiSelect.d.ts → StyledSelect.d.ts} +1 -1
  132. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +1 -0
  133. package/types/components/Select/helpers.d.ts +2 -0
  134. package/types/components/Select/index.d.ts +3 -3
  135. package/types/components/Select/{MultiSelect/types.d.ts → types.d.ts} +0 -0
  136. package/types/components/Switch/index.d.ts +1 -1
  137. package/types/components/Toolbar/StyledToolbar.d.ts +22 -0
  138. package/types/components/Toolbar/ToolbarGroup.d.ts +13 -0
  139. package/types/components/Toolbar/ToolbarItem.d.ts +25 -0
  140. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +1 -0
  141. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +1 -0
  142. package/types/components/Toolbar/index.d.ts +11 -0
  143. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  144. package/types/components/Typography/Text/index.d.ts +2 -2
  145. package/types/index.d.ts +3 -1
  146. package/types/theme/components/button.d.ts +2 -0
  147. package/types/theme/components/card.d.ts +10 -0
  148. package/types/theme/components/icon.d.ts +1 -0
  149. package/types/theme/components/list.d.ts +40 -0
  150. package/types/theme/components/toolbar.d.ts +21 -0
  151. package/types/theme/components/typography.d.ts +4 -0
  152. package/types/theme/global/colors.d.ts +5 -0
  153. package/types/theme/global/index.d.ts +5 -0
  154. package/types/theme/global/space.d.ts +1 -0
  155. package/types/theme/index.d.ts +4 -0
  156. package/playground/.detoxrc.json +0 -49
  157. package/playground/.prettierrc.json +0 -8
  158. package/playground/.turbo/turbo-type-check.log +0 -7
  159. package/playground/app.json +0 -9
  160. package/playground/babel.config.js +0 -63
  161. package/playground/e2e/config.json +0 -9
  162. package/playground/e2e/environment.js +0 -23
  163. package/playground/e2e/firstTest.e2e.js +0 -16
  164. package/playground/expoEntry.js +0 -5
  165. package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
  166. package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
  167. package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
  168. package/playground/fonts/hero-icons.ttf +0 -0
  169. package/playground/index.js +0 -7
  170. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +0 -9
  171. package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +0 -75
  172. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  173. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +0 -6
  174. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
  175. package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
  176. package/playground/ios/MobileHeroDesignPlayground/Info.plist +0 -85
  177. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +0 -3
  178. package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +0 -8
  179. package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +0 -40
  180. package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +0 -16
  181. package/playground/ios/MobileHeroDesignPlayground/main.m +0 -10
  182. package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +0 -4
  183. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +0 -515
  184. package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +0 -88
  185. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +0 -10
  186. package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  187. package/playground/ios/Podfile +0 -49
  188. package/playground/ios/Podfile.lock +0 -478
  189. package/playground/ios/Podfile.properties.json +0 -3
  190. package/playground/metro.config.js +0 -24
  191. package/playground/package.json +0 -63
  192. package/playground/src/Alert.tsx +0 -80
  193. package/playground/src/App.tsx +0 -210
  194. package/playground/src/Avatar.tsx +0 -102
  195. package/playground/src/Badge.tsx +0 -187
  196. package/playground/src/BottomNavigation.tsx +0 -72
  197. package/playground/src/BottomSheet.tsx +0 -43
  198. package/playground/src/Button.tsx +0 -170
  199. package/playground/src/Card.tsx +0 -342
  200. package/playground/src/Checkbox.tsx +0 -55
  201. package/playground/src/Collapse.tsx +0 -99
  202. package/playground/src/ContentNavigator.tsx +0 -58
  203. package/playground/src/Divider.tsx +0 -13
  204. package/playground/src/Drawer.tsx +0 -32
  205. package/playground/src/FAB.tsx +0 -66
  206. package/playground/src/Icon.tsx +0 -144
  207. package/playground/src/IconButton.tsx +0 -78
  208. package/playground/src/MultipleThemes.tsx +0 -34
  209. package/playground/src/Progress.tsx +0 -95
  210. package/playground/src/Radio.tsx +0 -25
  211. package/playground/src/SectionHeading.tsx +0 -68
  212. package/playground/src/Select.tsx +0 -32
  213. package/playground/src/Spinner.tsx +0 -19
  214. package/playground/src/Switch.tsx +0 -80
  215. package/playground/src/Tabs.tsx +0 -136
  216. package/playground/src/Tag.tsx +0 -45
  217. package/playground/src/TextInput.tsx +0 -14
  218. package/playground/src/Toast.tsx +0 -114
  219. package/playground/src/Typography.tsx +0 -23
  220. package/playground/tsconfig.json +0 -21
  221. package/src/components/Select/MultiSelect/Footer.tsx +0 -15
@@ -0,0 +1,51 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { IconName } from '../Icon';
4
+ export interface ListItemProps {
5
+ /**
6
+ * Name of Icon or ReactElement to render on the left side of title.
7
+ */
8
+ prefix?: IconName | React.ReactElement;
9
+ /**
10
+ * Name of Icon or ReactElement to render on the right side of title.
11
+ */
12
+ suffix?: IconName | React.ReactElement;
13
+ /**
14
+ * The title of the component.
15
+ */
16
+ title?: string;
17
+ /**
18
+ * The subtile title of the component.
19
+ */
20
+ subtitle?: string;
21
+ /**
22
+ * Additional wrapper style.
23
+ */
24
+ style?: StyleProp<ViewStyle>;
25
+ /**
26
+ * Children to be rendered inside the component.
27
+ */
28
+ children?: ReactNode;
29
+ /**
30
+ * Leading status of the component
31
+ * */
32
+ leadingStatus?: 'success' | 'warning' | 'danger' | 'info' | 'archived';
33
+ variant?: 'full-width' | 'card';
34
+ /**
35
+ * Whether the component is disabled. Default value is false
36
+ */
37
+ disabled?: boolean;
38
+ /** * Whether the component is selected. Default value is false
39
+ */
40
+ selected?: boolean;
41
+ /**
42
+ * Testing id of the component.
43
+ */
44
+ testID?: string;
45
+ /**
46
+ * Set the handler to handle press event.
47
+ */
48
+ onPress?: () => void;
49
+ }
50
+ declare const ListItem: ({ prefix, suffix, title, subtitle, style, testID, selected, children, leadingStatus, variant, onPress, disabled, }: ListItemProps) => JSX.Element;
51
+ export default ListItem;
@@ -0,0 +1,29 @@
1
+ import { TouchableOpacity, View } from 'react-native';
2
+ declare const StyledPrefixContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, {}, {
6
+ ref?: import("react").Ref<View> | undefined;
7
+ }>;
8
+ declare const StyledSuffixContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ }, {}, {
12
+ ref?: import("react").Ref<View> | undefined;
13
+ }>;
14
+ declare const StyledTitleContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, {}, {
18
+ ref?: import("react").Ref<View> | undefined;
19
+ }>;
20
+ declare const StyledListItemContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ } & {
24
+ themeSelected?: boolean | undefined;
25
+ themeDisabled?: boolean | undefined;
26
+ }, {}, {
27
+ ref?: import("react").Ref<TouchableOpacity> | undefined;
28
+ }>;
29
+ export { StyledListItemContainer, StyledPrefixContainer, StyledTitleContainer, StyledSuffixContainer, };
@@ -0,0 +1,51 @@
1
+ import { TouchableOpacity, View } from 'react-native';
2
+ export declare type Variant = 'full-width' | 'card';
3
+ export declare type LeadingStatusIntent = 'success' | 'warning' | 'danger' | 'info' | 'archived';
4
+ declare const StyledListItemContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
5
+ theme?: import("@emotion/react").Theme | undefined;
6
+ as?: import("react").ElementType<any> | undefined;
7
+ } & {
8
+ themeSelected?: boolean | undefined;
9
+ themeVariant?: Variant | undefined;
10
+ }, {}, {
11
+ ref?: import("react").Ref<TouchableOpacity> | undefined;
12
+ }>;
13
+ declare const StyledContentContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
14
+ theme?: import("@emotion/react").Theme | undefined;
15
+ as?: import("react").ElementType<any> | undefined;
16
+ }, {}, {
17
+ ref?: import("react").Ref<View> | undefined;
18
+ }>;
19
+ declare const StyledChildrenContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
20
+ theme?: import("@emotion/react").Theme | undefined;
21
+ as?: import("react").ElementType<any> | undefined;
22
+ }, {}, {
23
+ ref?: import("react").Ref<View> | undefined;
24
+ }>;
25
+ declare const StyledLeadingStatus: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ as?: import("react").ElementType<any> | undefined;
28
+ } & {
29
+ themeLeadingStatusIntent: LeadingStatusIntent;
30
+ }, {}, {
31
+ ref?: import("react").Ref<View> | undefined;
32
+ }>;
33
+ declare const StyledPrefixContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
34
+ theme?: import("@emotion/react").Theme | undefined;
35
+ as?: import("react").ElementType<any> | undefined;
36
+ }, {}, {
37
+ ref?: import("react").Ref<View> | undefined;
38
+ }>;
39
+ declare const StyledSuffixContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
40
+ theme?: import("@emotion/react").Theme | undefined;
41
+ as?: import("react").ElementType<any> | undefined;
42
+ }, {}, {
43
+ ref?: import("react").Ref<View> | undefined;
44
+ }>;
45
+ declare const StyledTitleContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
46
+ theme?: import("@emotion/react").Theme | undefined;
47
+ as?: import("react").ElementType<any> | undefined;
48
+ }, {}, {
49
+ ref?: import("react").Ref<View> | undefined;
50
+ }>;
51
+ export { StyledListItemContainer, StyledContentContainer, StyledChildrenContainer, StyledLeadingStatus, StyledPrefixContainer, StyledTitleContainer, StyledSuffixContainer, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import ListItem from './ListItem';
2
+ import BasicListItem from './BasicListItem';
3
+ interface ListType {
4
+ Item: typeof ListItem;
5
+ BasicItem: typeof BasicListItem;
6
+ }
7
+ declare const List: ListType;
8
+ export default List;
@@ -27,7 +27,7 @@ export interface SectionHeadingProps extends ViewProps {
27
27
  */
28
28
  intent?: 'subdued' | 'body' | 'primary';
29
29
  /**
30
- * Addditional style.
30
+ * Additional style.
31
31
  */
32
32
  style?: StyleProp<ViewStyle>;
33
33
  /**
@@ -1,5 +1,5 @@
1
- declare function Footer({ label, onPress }: {
1
+ declare const Footer: ({ label, onPress }: {
2
2
  label: string;
3
3
  onPress: () => void;
4
- }): JSX.Element;
4
+ }) => JSX.Element;
5
5
  export default Footer;
@@ -0,0 +1,6 @@
1
+ declare const Option: ({ text, selected, onPress, }: {
2
+ text: string;
3
+ selected: boolean;
4
+ onPress: () => void;
5
+ }) => JSX.Element;
6
+ export default Option;
@@ -1,3 +1,9 @@
1
1
  import { MultiSelectProps } from '.';
2
- declare function OptionList<T>({ value, options, onPress, keyExtractor, }: Pick<MultiSelectProps<T>, 'value' | 'options' | 'onPress' | 'keyExtractor'>): JSX.Element;
2
+ interface OptionListProps<T> extends MultiSelectProps<T> {
3
+ /**
4
+ * event handler for select
5
+ */
6
+ onPress: (value: T[]) => void;
7
+ }
8
+ declare const OptionList: <T>({ value, options, onPress, keyExtractor, }: Pick<OptionListProps<T>, "onPress" | "value" | "options" | "keyExtractor">) => JSX.Element;
3
9
  export default OptionList;
@@ -1,5 +1,5 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
- import { OptionType } from './types';
2
+ import { OptionType } from '../types';
3
3
  export interface MultiSelectProps<T> {
4
4
  /**
5
5
  * An array of options to be selected.
@@ -10,9 +10,9 @@ export interface MultiSelectProps<T> {
10
10
  */
11
11
  value: T[];
12
12
  /**
13
- * onPress event handler.
13
+ * event handler for footer button.
14
14
  */
15
- onPress: (value: T[]) => void;
15
+ onConfirm: (value: T[]) => void;
16
16
  /**
17
17
  * Field label.
18
18
  */
@@ -35,5 +35,5 @@ export interface MultiSelectProps<T> {
35
35
  */
36
36
  testID?: string;
37
37
  }
38
- declare function MultiSelect<T>({ options, value, testID, style, label, footerLabel, onPress, }: MultiSelectProps<T>): JSX.Element;
38
+ declare function MultiSelect<T>({ options, value, testID, style, label, footerLabel, onConfirm, }: MultiSelectProps<T>): JSX.Element;
39
39
  export default MultiSelect;
@@ -0,0 +1,6 @@
1
+ declare const Option: ({ text, selected, onPress, }: {
2
+ text: string;
3
+ selected: boolean;
4
+ onPress: () => void;
5
+ }) => JSX.Element;
6
+ export default Option;
@@ -0,0 +1,9 @@
1
+ import { SingleSelectProps } from '.';
2
+ interface OptionListProps<T> extends SingleSelectProps<T> {
3
+ /**
4
+ * event handler for select
5
+ */
6
+ onPress: (value: T | null) => void;
7
+ }
8
+ declare const OptionList: <T>({ value, options, onPress, keyExtractor, }: Pick<OptionListProps<T>, "onPress" | "value" | "options" | "keyExtractor">) => JSX.Element;
9
+ export default OptionList;
@@ -0,0 +1,35 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+ import { OptionType } from '../types';
3
+ export interface SingleSelectProps<T> {
4
+ /**
5
+ * An array of options to be selected.
6
+ */
7
+ options: OptionType<T>[];
8
+ /**
9
+ * Current selected value.
10
+ */
11
+ value: T | null;
12
+ /**
13
+ * event handler for confirm button
14
+ */
15
+ onConfirm: (value: T | null) => void;
16
+ /**
17
+ * Field label.
18
+ */
19
+ label: string;
20
+ /**
21
+ * Used to extract a unique key for a given option at the specified index. Key is used for caching and as the react key to track item re-ordering.
22
+ * The default extractor checks option.key, and then falls back to using the index, like React does.
23
+ */
24
+ keyExtractor?: (option: OptionType<T>, index?: number) => string;
25
+ /**
26
+ * Additional style.
27
+ */
28
+ style?: StyleProp<ViewStyle>;
29
+ /**
30
+ * Testing id of the component.
31
+ */
32
+ testID?: string;
33
+ }
34
+ declare const SingleSelect: <T>({ options, value, testID, style, label, onConfirm, }: SingleSelectProps<T>) => JSX.Element;
35
+ export default SingleSelect;
@@ -19,7 +19,7 @@ declare const Spacer: import("@emotion/native").StyledComponent<import("react-na
19
19
  }, {}, {
20
20
  ref?: import("react").Ref<View> | undefined;
21
21
  }>;
22
- declare const FooterText: import("@emotion/native").StyledComponent<import("../../Typography/Text").TextProps & {
22
+ declare const FooterText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
23
23
  theme?: import("@emotion/react").Theme | undefined;
24
24
  as?: import("react").ElementType<any> | undefined;
25
25
  }, {}, {}>;
@@ -0,0 +1,2 @@
1
+ import { OptionType } from './types';
2
+ export declare const getKey: <T>(option: OptionType<T>, index: number, keyExtractor?: ((opt: OptionType<T>, i?: number | undefined) => string) | undefined) => import("react").Key;
@@ -1,5 +1,5 @@
1
1
  import MultiSelect from './MultiSelect';
2
- declare const CompoundSelect: {
3
- readonly Multi: typeof MultiSelect;
2
+ declare const _default: (<T>({ options, value, testID, style, label, onConfirm, }: import("./SingleSelect").SingleSelectProps<T>) => JSX.Element) & {
3
+ Multi: typeof MultiSelect;
4
4
  };
5
- export default CompoundSelect;
5
+ export default _default;
@@ -18,7 +18,7 @@ export interface SwitchProps {
18
18
  */
19
19
  size?: 'small' | 'medium';
20
20
  /**
21
- * Addditional style.
21
+ * Additional style.
22
22
  */
23
23
  style?: StyleProp<ViewStyle>;
24
24
  /**
@@ -0,0 +1,22 @@
1
+ import { TouchableOpacity, View, ViewProps } from 'react-native';
2
+ declare const ToolbarWrapper: import("@emotion/native").StyledComponent<ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, {}, {
6
+ ref?: import("react").Ref<View> | undefined;
7
+ }>;
8
+ declare const ToolbarGroupWrapper: import("@emotion/native").StyledComponent<ViewProps & {
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ } & {
12
+ align: 'left' | 'center' | 'right';
13
+ }, {}, {
14
+ ref?: import("react").Ref<View> | undefined;
15
+ }>;
16
+ declare const ToolbarItemWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any> | undefined;
19
+ }, {}, {
20
+ ref?: import("react").Ref<TouchableOpacity> | undefined;
21
+ }>;
22
+ export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper };
@@ -0,0 +1,13 @@
1
+ import { ToolbarItemProps } from './ToolbarItem';
2
+ export interface ToolbarGroupProps {
3
+ /**
4
+ * List of action items in the toolbar group.
5
+ */
6
+ items?: ToolbarItemProps[];
7
+ /**
8
+ * Alignment of the items in the group.
9
+ */
10
+ align: 'left' | 'center' | 'right';
11
+ }
12
+ declare const ToolbarGroup: ({ align, items }: ToolbarGroupProps) => JSX.Element;
13
+ export default ToolbarGroup;
@@ -0,0 +1,25 @@
1
+ import { IconName } from '../Icon';
2
+ export interface ToolbarItemProps {
3
+ /**
4
+ * Visual intent of the toolbar item.
5
+ */
6
+ intent?: 'primary' | 'info' | 'success' | 'danger' | 'warning';
7
+ /**
8
+ * Icon of the toolbar item.
9
+ */
10
+ icon?: IconName;
11
+ /**
12
+ * Action label of the toolbar item.
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Callback that trigger when user press the toolbar item.
17
+ */
18
+ onPress?: () => void;
19
+ /**
20
+ * Whether the toolbar item is disabled.
21
+ */
22
+ disabled?: boolean;
23
+ }
24
+ declare const ToolbarItem: ({ icon, label, onPress, intent, disabled, }: ToolbarItemProps) => JSX.Element;
25
+ export default ToolbarItem;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ToolbarProps {
3
+ /**
4
+ * Toolbar's content.
5
+ */
6
+ children?: ReactNode;
7
+ }
8
+ declare const _default: (({ children }: ToolbarProps) => JSX.Element) & {
9
+ Group: ({ align, items }: import("./ToolbarGroup").ToolbarGroupProps) => JSX.Element;
10
+ };
11
+ export default _default;
@@ -5,7 +5,7 @@ declare const StyledText: import("@emotion/native").StyledComponent<import("reac
5
5
  } & {
6
6
  themeFontSize: 'small' | 'medium' | 'large' | 'xlarge';
7
7
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
8
- themeIntent: 'body' | 'subdued' | 'primary';
8
+ themeIntent: 'body' | 'subdued' | 'primary' | 'success' | 'info' | 'warning' | 'danger';
9
9
  }, {}, {
10
10
  ref?: import("react").Ref<Text> | undefined;
11
11
  }>;
@@ -16,9 +16,9 @@ export interface TextProps extends NativeTextProps {
16
16
  /**
17
17
  * Visual intent color to apply to the text.
18
18
  */
19
- intent?: 'body' | 'subdued' | 'primary';
19
+ intent?: 'body' | 'subdued' | 'primary' | 'success' | 'info' | 'warning' | 'danger';
20
20
  /**
21
- * Addditional style.
21
+ * Additional style.
22
22
  */
23
23
  style?: StyleProp<TextStyle>;
24
24
  /**
package/types/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import Divider from './components/Divider';
14
14
  import Drawer from './components/Drawer';
15
15
  import FAB from './components/FAB';
16
16
  import Icon from './components/Icon';
17
+ import List from './components/List';
17
18
  import Progress from './components/Progress';
18
19
  import Spinner from './components/Spinner';
19
20
  import Radio from './components/Radio';
@@ -24,6 +25,7 @@ import Tabs from './components/Tabs';
24
25
  import Tag from './components/Tag';
25
26
  import TextInput from './components/TextInput';
26
27
  import Toast from './components/Toast';
28
+ import Toolbar from './components/Toolbar';
27
29
  import Typography from './components/Typography';
28
- export { theme, getTheme, useTheme, scale, ThemeProvider, Alert, Avatar, Badge, BottomNavigation, BottomSheet, Button, Card, Collapse, Checkbox, ContentNavigator, Divider, Drawer, FAB, Icon, Progress, Spinner, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, Toast, Typography, };
30
+ export { theme, getTheme, useTheme, scale, ThemeProvider, Alert, Avatar, Badge, BottomNavigation, BottomSheet, Button, Card, Collapse, Checkbox, ContentNavigator, Divider, Drawer, FAB, Icon, List, Progress, Spinner, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, Toast, Toolbar, Typography, };
29
31
  export * from './types';
@@ -20,6 +20,8 @@ declare const getButtonTheme: (theme: GlobalTheme) => {
20
20
  pressedPrimary: string;
21
21
  secondary: string;
22
22
  pressedSecondary: string;
23
+ danger: string;
24
+ pressedDanger: string;
23
25
  defaultText: string;
24
26
  disabledText: string;
25
27
  disabledBorder: string;
@@ -2,6 +2,16 @@ import { GlobalTheme } from '../global';
2
2
  declare const getCardTheme: (theme: GlobalTheme) => {
3
3
  colors: {
4
4
  dataCardIndicator: string;
5
+ indicator: {
6
+ archived: string;
7
+ info: string;
8
+ success: string;
9
+ warning: string;
10
+ danger: string;
11
+ };
12
+ };
13
+ sizes: {
14
+ indicatorWidth: number;
5
15
  };
6
16
  radii: {
7
17
  default: number;
@@ -8,6 +8,7 @@ declare const getIconTheme: (theme: GlobalTheme) => {
8
8
  success: string;
9
9
  warning: string;
10
10
  disabledText: string;
11
+ invertedText: string;
11
12
  };
12
13
  sizes: {
13
14
  xsmall: number;
@@ -0,0 +1,40 @@
1
+ import { GlobalTheme } from '../global';
2
+ declare const getListTheme: (theme: GlobalTheme) => {
3
+ colors: {
4
+ checkedListItemContainerBackground: string;
5
+ listItemContainerBackground: string;
6
+ leadingStatus: {
7
+ danger: string;
8
+ info: string;
9
+ success: string;
10
+ warning: string;
11
+ archived: string;
12
+ };
13
+ };
14
+ space: {
15
+ listItemContainerPadding: number;
16
+ leadingStatusMarginRight: number;
17
+ prefixContainerMarginRight: number;
18
+ suffixContainerMarginLeft: number;
19
+ };
20
+ radii: {
21
+ card: number;
22
+ cardShadow: number;
23
+ leadingStatus: number;
24
+ };
25
+ offsets: {
26
+ cardShadow: {
27
+ width: number;
28
+ height: number;
29
+ };
30
+ };
31
+ widths: {
32
+ leadingStatus: number;
33
+ };
34
+ opacity: {
35
+ disabled: number;
36
+ enabled: number;
37
+ cardShadow: number;
38
+ };
39
+ };
40
+ export default getListTheme;
@@ -0,0 +1,21 @@
1
+ import { GlobalTheme } from '../global';
2
+ declare const getToolbarTheme: (theme: GlobalTheme) => {
3
+ colors: {
4
+ background: string;
5
+ border: string;
6
+ primary: string;
7
+ info: string;
8
+ success: string;
9
+ danger: string;
10
+ error: string;
11
+ disabled: string;
12
+ };
13
+ space: {
14
+ verticalPadding: number;
15
+ horizontalPadding: number;
16
+ };
17
+ borderWidths: {
18
+ default: number;
19
+ };
20
+ };
21
+ export default getToolbarTheme;
@@ -4,6 +4,10 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
4
4
  body: string;
5
5
  subdued: string;
6
6
  primary: string;
7
+ info: string;
8
+ danger: string;
9
+ warning: string;
10
+ success: string;
7
11
  };
8
12
  fonts: {
9
13
  light: string;
@@ -10,12 +10,15 @@ declare const systemPalette: {
10
10
  infoLight: string;
11
11
  infoBackground: string;
12
12
  success: string;
13
+ successLight: string;
13
14
  successDark: string;
14
15
  successBackground: string;
15
16
  danger: string;
17
+ dangerMediumLight: string;
16
18
  dangerLight: string;
17
19
  dangerBackground: string;
18
20
  warning: string;
21
+ warningLight: string;
19
22
  warningDark: string;
20
23
  warningBackground: string;
21
24
  platformBackground: string;
@@ -26,9 +29,11 @@ declare const systemPalette: {
26
29
  disabledLightText: string;
27
30
  invertedText: string;
28
31
  outline: string;
32
+ archivedDark: string;
29
33
  archived: string;
30
34
  black: string;
31
35
  inactiveBackground: string;
36
+ shadow: string;
32
37
  };
33
38
  declare type SystemPalette = typeof systemPalette;
34
39
  export { systemPalette, SystemPalette };
@@ -13,12 +13,15 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
13
13
  infoLight: string;
14
14
  infoBackground: string;
15
15
  success: string;
16
+ successLight: string;
16
17
  successDark: string;
17
18
  successBackground: string;
18
19
  danger: string;
20
+ dangerMediumLight: string;
19
21
  dangerLight: string;
20
22
  dangerBackground: string;
21
23
  warning: string;
24
+ warningLight: string;
22
25
  warningDark: string;
23
26
  warningBackground: string;
24
27
  platformBackground: string;
@@ -29,9 +32,11 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
29
32
  disabledLightText: string;
30
33
  invertedText: string;
31
34
  outline: string;
35
+ archivedDark: string;
32
36
  archived: string;
33
37
  black: string;
34
38
  inactiveBackground: string;
39
+ shadow: string;
35
40
  };
36
41
  fonts: import("./typography").Fonts;
37
42
  fontSizes: import("./typography").FontSizes;
@@ -2,6 +2,7 @@ interface Space {
2
2
  large: number;
3
3
  medium: number;
4
4
  small: number;
5
+ smallMedium: number;
5
6
  xlarge: number;
6
7
  xsmall: number;
7
8
  xxlarge: number;