@hero-design/rn 7.19.0 → 7.20.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 (171) hide show
  1. package/.eslintrc.json +6 -1
  2. package/.turbo/turbo-build.log +2 -2
  3. package/es/index.js +572 -194
  4. package/lib/index.js +572 -193
  5. package/package.json +4 -4
  6. package/src/components/Alert/StyledAlert.tsx +5 -5
  7. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
  8. package/src/components/Alert/__tests__/index.spec.tsx +21 -0
  9. package/src/components/Alert/index.tsx +13 -6
  10. package/src/components/Avatar/StyledAvatar.tsx +2 -1
  11. package/src/components/Avatar/index.tsx +2 -1
  12. package/src/components/Box/StyledBox.tsx +54 -0
  13. package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
  14. package/src/components/Box/__tests__/helpers.spec.ts +14 -0
  15. package/src/components/Box/__tests__/index.spec.tsx +155 -0
  16. package/src/components/Box/config.ts +201 -0
  17. package/src/components/Box/helpers.ts +10 -0
  18. package/src/components/Box/index.tsx +13 -0
  19. package/src/components/Box/types.ts +38 -0
  20. package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
  21. package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
  22. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
  23. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
  24. package/src/components/Card/DataCard/index.tsx +1 -1
  25. package/src/components/Card/StyledCard.tsx +12 -19
  26. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
  27. package/src/components/Card/__tests__/index.spec.tsx +18 -0
  28. package/src/components/Card/index.tsx +6 -1
  29. package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
  30. package/src/components/FAB/ActionGroup/index.tsx +6 -8
  31. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -8
  32. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  33. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  34. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  35. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  36. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  37. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  38. package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
  39. package/src/components/Spinner/StyledSpinner.tsx +24 -19
  40. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
  41. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
  42. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
  43. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
  44. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
  45. package/src/components/Spinner/index.tsx +10 -2
  46. package/src/components/Tabs/ScrollableTabs.tsx +9 -4
  47. package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
  48. package/src/components/Tabs/StyledTabs.tsx +6 -0
  49. package/src/components/Tabs/TabWithBadge.tsx +68 -0
  50. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +13 -0
  51. package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
  52. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
  53. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
  54. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
  55. package/src/components/Tabs/__tests__/index.spec.tsx +12 -0
  56. package/src/components/Tabs/index.tsx +11 -4
  57. package/src/components/Tag/StyledTag.tsx +1 -11
  58. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
  59. package/src/components/Tag/index.tsx +2 -2
  60. package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
  61. package/src/components/Toast/StyledToast.tsx +13 -7
  62. package/src/components/Toast/Toast.tsx +34 -9
  63. package/src/components/Toast/ToastProvider.tsx +15 -12
  64. package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
  65. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
  66. package/src/components/Toast/types.ts +15 -1
  67. package/src/components/Typography/Text/StyledText.tsx +7 -1
  68. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  69. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  70. package/src/components/Typography/Text/index.tsx +7 -1
  71. package/src/index.ts +2 -0
  72. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +76 -23
  73. package/src/theme/components/.eslintrc.json +10 -0
  74. package/src/theme/components/alert.ts +5 -1
  75. package/src/theme/components/avatar.ts +2 -0
  76. package/src/theme/components/card.ts +6 -7
  77. package/src/theme/components/sectionHeading.ts +1 -1
  78. package/src/theme/components/spinner.ts +19 -7
  79. package/src/theme/components/tabs.ts +3 -2
  80. package/src/theme/components/tag.ts +13 -13
  81. package/src/theme/components/toast.ts +17 -3
  82. package/src/theme/components/typography.ts +2 -0
  83. package/src/theme/global/colors/swag.ts +23 -0
  84. package/src/theme/global/colors/types.ts +23 -0
  85. package/src/theme/global/colors/work.ts +5 -0
  86. package/tsconfig.json +4 -15
  87. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  88. package/types/components/Alert/StyledAlert.d.ts +16 -16
  89. package/types/components/Alert/index.d.ts +1 -1
  90. package/types/components/Avatar/StyledAvatar.d.ts +16 -16
  91. package/types/components/Avatar/index.d.ts +2 -2
  92. package/types/components/Badge/StyledBadge.d.ts +7 -7
  93. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  94. package/types/components/BottomSheet/Header.d.ts +1 -1
  95. package/types/components/BottomSheet/StyledBottomSheet.d.ts +19 -19
  96. package/types/components/Box/StyledBox.d.ts +15 -0
  97. package/types/components/Box/__tests__/helpers.spec.d.ts +1 -0
  98. package/types/components/Box/__tests__/index.spec.d.ts +1 -0
  99. package/types/components/Box/config.d.ts +170 -0
  100. package/types/components/Box/helpers.d.ts +1 -0
  101. package/types/components/Box/index.d.ts +5 -0
  102. package/types/components/Box/types.d.ts +31 -0
  103. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  104. package/types/components/Button/StyledButton.d.ts +16 -16
  105. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  106. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  107. package/types/components/Calendar/helpers.d.ts +2 -2
  108. package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
  109. package/types/components/Card/DataCard/index.d.ts +1 -1
  110. package/types/components/Card/StyledCard.d.ts +7 -6
  111. package/types/components/Card/index.d.ts +5 -1
  112. package/types/components/Checkbox/StyledCheckbox.d.ts +10 -10
  113. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  114. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  115. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  116. package/types/components/Divider/StyledDivider.d.ts +5 -5
  117. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  118. package/types/components/Empty/StyledEmpty.d.ts +12 -12
  119. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  120. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  121. package/types/components/FAB/StyledFAB.d.ts +8 -8
  122. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  123. package/types/components/List/StyledBasicListItem.d.ts +14 -14
  124. package/types/components/List/StyledListItem.d.ts +23 -23
  125. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  126. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  127. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  128. package/types/components/Radio/StyledRadio.d.ts +9 -9
  129. package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
  130. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  131. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  132. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  133. package/types/components/RichTextEditor/index.d.ts +2 -2
  134. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  135. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  136. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  137. package/types/components/Select/StyledSelect.d.ts +11 -11
  138. package/types/components/Select/helpers.d.ts +1 -1
  139. package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
  140. package/types/components/Spinner/StyledSpinner.d.ts +14 -12
  141. package/types/components/Spinner/index.d.ts +5 -1
  142. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  143. package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
  144. package/types/components/Tabs/StyledTabs.d.ts +26 -20
  145. package/types/components/Tabs/TabWithBadge.d.ts +17 -0
  146. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
  147. package/types/components/Tabs/index.d.ts +3 -1
  148. package/types/components/Tag/StyledTag.d.ts +6 -6
  149. package/types/components/Tag/index.d.ts +1 -1
  150. package/types/components/TextInput/StyledTextInput.d.ts +44 -44
  151. package/types/components/TextInput/index.d.ts +5 -5
  152. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  153. package/types/components/Toast/StyledToast.d.ts +19 -18
  154. package/types/components/Toast/types.d.ts +2 -1
  155. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  156. package/types/components/Typography/Text/StyledText.d.ts +4 -4
  157. package/types/components/Typography/Text/index.d.ts +1 -1
  158. package/types/index.d.ts +2 -1
  159. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  160. package/types/theme/ThemeSwitcher.d.ts +1 -1
  161. package/types/theme/components/alert.d.ts +5 -1
  162. package/types/theme/components/avatar.d.ts +2 -0
  163. package/types/theme/components/card.d.ts +6 -7
  164. package/types/theme/components/spinner.d.ts +17 -5
  165. package/types/theme/components/tabs.d.ts +1 -0
  166. package/types/theme/components/tag.d.ts +2 -2
  167. package/types/theme/components/toast.d.ts +18 -2
  168. package/types/theme/components/typography.d.ts +2 -0
  169. package/types/theme/global/colors/types.d.ts +17 -0
  170. package/types/theme/global/index.d.ts +17 -0
  171. package/types/utils/hooks.d.ts +1 -1
@@ -1,26 +1,26 @@
1
1
  import { Animated, View } from 'react-native';
2
2
  import PagerView from 'react-native-pager-view';
3
3
  declare const TabScreen: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  }, {}, {
7
- ref?: import("react").Ref<View> | undefined;
7
+ ref?: import("react").Ref<View>;
8
8
  }>;
9
9
  declare const TabContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
- theme?: import("@emotion/react").Theme | undefined;
11
- as?: import("react").ElementType<any> | undefined;
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: import("react").ElementType<any>;
12
12
  }, {}, {
13
- ref?: import("react").Ref<View> | undefined;
13
+ ref?: import("react").Ref<View>;
14
14
  }>;
15
15
  declare const ContentWrapper: import("@emotion/native").StyledComponent<import("react-native-pager-view").PagerViewProps & {
16
- theme?: import("@emotion/react").Theme | undefined;
17
- as?: import("react").ElementType<any> | undefined;
16
+ theme?: import("@emotion/react").Theme;
17
+ as?: import("react").ElementType<any>;
18
18
  }, {}, {
19
- ref?: import("react").Ref<PagerView> | undefined;
19
+ ref?: import("react").Ref<PagerView>;
20
20
  }>;
21
21
  declare const HeaderTabWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
22
- theme?: import("@emotion/react").Theme | undefined;
23
- as?: import("react").ElementType<any> | undefined;
22
+ theme?: import("@emotion/react").Theme;
23
+ as?: import("react").ElementType<any>;
24
24
  } & {
25
25
  themeInsets: {
26
26
  top: number;
@@ -29,32 +29,34 @@ declare const HeaderTabWrapper: import("@emotion/native").StyledComponent<import
29
29
  left: number;
30
30
  };
31
31
  }, {}, {
32
- ref?: import("react").Ref<View> | undefined;
32
+ ref?: import("react").Ref<View>;
33
33
  }>;
34
34
  declare const HeaderTabItem: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
35
35
  children?: import("react").ReactNode;
36
36
  } & {
37
- theme?: import("@emotion/react").Theme | undefined;
38
- as?: import("react").ElementType<any> | undefined;
37
+ theme?: import("@emotion/react").Theme;
38
+ as?: import("react").ElementType<any>;
39
+ } & {
40
+ isFirstItem?: boolean;
39
41
  }, {}, {}>;
40
42
  declare const HeaderTabItemOutlineWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
41
- theme?: import("@emotion/react").Theme | undefined;
42
- as?: import("react").ElementType<any> | undefined;
43
+ theme?: import("@emotion/react").Theme;
44
+ as?: import("react").ElementType<any>;
43
45
  }, {}, {
44
- ref?: import("react").Ref<View> | undefined;
46
+ ref?: import("react").Ref<View>;
45
47
  }>;
46
48
  declare const HeaderTabItemOutline: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
47
49
  children?: import("react").ReactNode;
48
50
  } & {
49
- theme?: import("@emotion/react").Theme | undefined;
50
- as?: import("react").ElementType<any> | undefined;
51
+ theme?: import("@emotion/react").Theme;
52
+ as?: import("react").ElementType<any>;
51
53
  } & {
52
54
  themeActive: boolean;
53
55
  }, {}, {}>;
54
56
  declare const HeaderTabItemWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
55
- theme?: import("@emotion/react").Theme | undefined;
56
- as?: import("react").ElementType<any> | undefined;
57
+ theme?: import("@emotion/react").Theme;
58
+ as?: import("react").ElementType<any>;
57
59
  }, {}, {
58
- ref?: import("react").Ref<View> | undefined;
60
+ ref?: import("react").Ref<View>;
59
61
  }>;
60
62
  export { HeaderTabItem, TabScreen, TabContainer, HeaderTabWrapper, ContentWrapper, HeaderTabItemOutlineWrapper, HeaderTabItemOutline, HeaderTabItemWrapper, };
@@ -1,14 +1,14 @@
1
1
  import { Animated, View } from 'react-native';
2
2
  import PagerView from 'react-native-pager-view';
3
3
  declare const TabContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  }, {}, {
7
- ref?: import("react").Ref<View> | undefined;
7
+ ref?: import("react").Ref<View>;
8
8
  }>;
9
9
  declare const HeaderTabWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
- theme?: import("@emotion/react").Theme | undefined;
11
- as?: import("react").ElementType<any> | undefined;
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: import("react").ElementType<any>;
12
12
  } & {
13
13
  themeInsets: {
14
14
  top: number;
@@ -17,38 +17,44 @@ declare const HeaderTabWrapper: import("@emotion/native").StyledComponent<import
17
17
  left: number;
18
18
  };
19
19
  }, {}, {
20
- ref?: import("react").Ref<View> | undefined;
20
+ ref?: import("react").Ref<View>;
21
21
  }>;
22
22
  declare const HeaderTab: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
23
- theme?: import("@emotion/react").Theme | undefined;
24
- as?: import("react").ElementType<any> | undefined;
23
+ theme?: import("@emotion/react").Theme;
24
+ as?: import("react").ElementType<any>;
25
25
  }, {}, {
26
- ref?: import("react").Ref<View> | undefined;
26
+ ref?: import("react").Ref<View>;
27
27
  }>;
28
28
  declare const HeaderTabItem: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
29
- theme?: import("@emotion/react").Theme | undefined;
30
- as?: import("react").ElementType<any> | undefined;
29
+ theme?: import("@emotion/react").Theme;
30
+ as?: import("react").ElementType<any>;
31
31
  }, {}, {
32
- ref?: import("react").Ref<View> | undefined;
32
+ ref?: import("react").Ref<View>;
33
33
  }>;
34
34
  declare const ContentWrapper: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native-pager-view").PagerViewProps & import("react").RefAttributes<PagerView>> & {
35
35
  children?: import("react").ReactNode;
36
36
  } & {
37
- theme?: import("@emotion/react").Theme | undefined;
38
- as?: import("react").ElementType<any> | undefined;
37
+ theme?: import("@emotion/react").Theme;
38
+ as?: import("react").ElementType<any>;
39
39
  }, {}, {}>;
40
40
  declare const TabScreen: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
41
- theme?: import("@emotion/react").Theme | undefined;
42
- as?: import("react").ElementType<any> | undefined;
41
+ theme?: import("@emotion/react").Theme;
42
+ as?: import("react").ElementType<any>;
43
43
  }, {}, {
44
- ref?: import("react").Ref<View> | undefined;
44
+ ref?: import("react").Ref<View>;
45
45
  }>;
46
46
  declare const StyledIndicator: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
47
47
  children?: import("react").ReactNode;
48
48
  } & {
49
- theme?: import("@emotion/react").Theme | undefined;
50
- as?: import("react").ElementType<any> | undefined;
49
+ theme?: import("@emotion/react").Theme;
50
+ as?: import("react").ElementType<any>;
51
51
  } & {
52
52
  themeWidth: number;
53
53
  }, {}, {}>;
54
- export { TabContainer, HeaderTabWrapper, HeaderTab, HeaderTabItem, ContentWrapper, TabScreen, StyledIndicator, };
54
+ declare const StyledBadgeWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
55
+ theme?: import("@emotion/react").Theme;
56
+ as?: import("react").ElementType<any>;
57
+ }, {}, {
58
+ ref?: import("react").Ref<View>;
59
+ }>;
60
+ export { TabContainer, HeaderTabWrapper, HeaderTab, HeaderTabItem, ContentWrapper, TabScreen, StyledIndicator, StyledBadgeWrapper, };
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ export declare type StatusBadgeType = {
3
+ type: 'status';
4
+ };
5
+ export declare type CounterBadgeType = {
6
+ type: 'counter';
7
+ value: number;
8
+ max?: number;
9
+ };
10
+ export declare type BadgeConfigType = StatusBadgeType | CounterBadgeType;
11
+ interface TabWithBadgeProps {
12
+ showBadge?: boolean;
13
+ config?: BadgeConfigType;
14
+ tabItem: ReactNode;
15
+ }
16
+ declare const TabWithBadge: ({ showBadge, config, tabItem }: TabWithBadgeProps) => JSX.Element;
17
+ export default TabWithBadge;
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
- import type { IconName } from '../Icon';
3
+ import type { BadgeConfigType } from './TabWithBadge';
4
+ import { IconName } from '../Icon';
4
5
  export declare type ItemType = string | IconName | ((props: {
5
6
  color: string;
6
7
  }) => ReactNode);
@@ -11,6 +12,7 @@ export declare type TabType = {
11
12
  component: ReactNode;
12
13
  testID?: string;
13
14
  showBadge?: boolean;
15
+ badge?: BadgeConfigType;
14
16
  };
15
17
  export interface TabsProps extends ViewProps {
16
18
  /**
@@ -1,19 +1,19 @@
1
1
  import { View, Text } from 'react-native';
2
2
  declare type ThemeIntent = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'archived';
3
3
  declare const StyledView: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  } & {
7
7
  themeIntent: ThemeIntent;
8
8
  }, {}, {
9
- ref?: import("react").Ref<View> | undefined;
9
+ ref?: import("react").Ref<View>;
10
10
  }>;
11
11
  declare const StyledText: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
12
- theme?: import("@emotion/react").Theme | undefined;
13
- as?: import("react").ElementType<any> | undefined;
12
+ theme?: import("@emotion/react").Theme;
13
+ as?: import("react").ElementType<any>;
14
14
  } & {
15
15
  themeIntent: ThemeIntent;
16
16
  }, {}, {
17
- ref?: import("react").Ref<Text> | undefined;
17
+ ref?: import("react").Ref<Text>;
18
18
  }>;
19
19
  export { StyledView, StyledText };
@@ -7,7 +7,7 @@ interface TagProps extends ViewProps {
7
7
  /**
8
8
  * Visual intent color to apply to Tag.
9
9
  */
10
- intent?: 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'archived';
10
+ intent?: 'primary' | 'default' | 'info' | 'success' | 'warning' | 'danger' | 'archived';
11
11
  /**
12
12
  * Additional style.
13
13
  */
@@ -1,103 +1,103 @@
1
1
  import { TextInput, View } from 'react-native';
2
2
  export declare type Variant = 'default' | 'filled' | 'focused' | 'disabled' | 'readonly' | 'error';
3
3
  declare const StyledContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  }, {}, {
7
- ref?: import("react").Ref<View> | undefined;
7
+ ref?: import("react").Ref<View>;
8
8
  }>;
9
9
  declare const StyledLabelContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
- theme?: import("@emotion/react").Theme | undefined;
11
- as?: import("react").ElementType<any> | undefined;
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: import("react").ElementType<any>;
12
12
  }, {}, {
13
- ref?: import("react").Ref<View> | undefined;
13
+ ref?: import("react").Ref<View>;
14
14
  }>;
15
15
  declare const StyledLabel: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
16
- theme?: import("@emotion/react").Theme | undefined;
17
- as?: import("react").ElementType<any> | undefined;
16
+ theme?: import("@emotion/react").Theme;
17
+ as?: import("react").ElementType<any>;
18
18
  } & {
19
19
  themeVariant: Variant;
20
20
  }, {}, {}>;
21
21
  declare const StyledAsteriskLabel: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
22
- theme?: import("@emotion/react").Theme | undefined;
23
- as?: import("react").ElementType<any> | undefined;
22
+ theme?: import("@emotion/react").Theme;
23
+ as?: import("react").ElementType<any>;
24
24
  } & {
25
25
  themeVariant: Variant;
26
26
  }, {}, {}>;
27
27
  declare const StyledLabelContainerInsideTextInput: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
28
- theme?: import("@emotion/react").Theme | undefined;
29
- as?: import("react").ElementType<any> | undefined;
28
+ theme?: import("@emotion/react").Theme;
29
+ as?: import("react").ElementType<any>;
30
30
  }, {}, {
31
- ref?: import("react").Ref<View> | undefined;
31
+ ref?: import("react").Ref<View>;
32
32
  }>;
33
33
  declare const StyledLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
34
- theme?: import("@emotion/react").Theme | undefined;
35
- as?: import("react").ElementType<any> | undefined;
34
+ theme?: import("@emotion/react").Theme;
35
+ as?: import("react").ElementType<any>;
36
36
  } & {
37
37
  themeVariant: Variant;
38
38
  }, {}, {}>;
39
39
  declare const StyledAsteriskLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
40
- theme?: import("@emotion/react").Theme | undefined;
41
- as?: import("react").ElementType<any> | undefined;
40
+ theme?: import("@emotion/react").Theme;
41
+ as?: import("react").ElementType<any>;
42
42
  } & {
43
43
  themeVariant: Variant;
44
44
  }, {}, {}>;
45
45
  declare const StyledErrorContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
46
- theme?: import("@emotion/react").Theme | undefined;
47
- as?: import("react").ElementType<any> | undefined;
46
+ theme?: import("@emotion/react").Theme;
47
+ as?: import("react").ElementType<any>;
48
48
  }, {}, {
49
- ref?: import("react").Ref<View> | undefined;
49
+ ref?: import("react").Ref<View>;
50
50
  }>;
51
51
  declare const StyledError: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
52
- theme?: import("@emotion/react").Theme | undefined;
53
- as?: import("react").ElementType<any> | undefined;
52
+ theme?: import("@emotion/react").Theme;
53
+ as?: import("react").ElementType<any>;
54
54
  }, {}, {}>;
55
55
  declare const StyledMaxLengthMessage: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
56
- theme?: import("@emotion/react").Theme | undefined;
57
- as?: import("react").ElementType<any> | undefined;
56
+ theme?: import("@emotion/react").Theme;
57
+ as?: import("react").ElementType<any>;
58
58
  } & {
59
59
  themeVariant: Variant;
60
60
  }, {}, {}>;
61
61
  declare const StyledHelperText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
62
- theme?: import("@emotion/react").Theme | undefined;
63
- as?: import("react").ElementType<any> | undefined;
62
+ theme?: import("@emotion/react").Theme;
63
+ as?: import("react").ElementType<any>;
64
64
  }, {}, {}>;
65
65
  declare const StyledTextInput: import("@emotion/native").StyledComponent<import("react-native").TextInputProps & {
66
- theme?: import("@emotion/react").Theme | undefined;
67
- as?: import("react").ElementType<any> | undefined;
66
+ theme?: import("@emotion/react").Theme;
67
+ as?: import("react").ElementType<any>;
68
68
  }, {}, {
69
- ref?: import("react").Ref<TextInput> | undefined;
69
+ ref?: import("react").Ref<TextInput>;
70
70
  }>;
71
71
  declare const StyledBorderBackDrop: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
72
- theme?: import("@emotion/react").Theme | undefined;
73
- as?: import("react").ElementType<any> | undefined;
72
+ theme?: import("@emotion/react").Theme;
73
+ as?: import("react").ElementType<any>;
74
74
  } & {
75
75
  themeVariant: Variant;
76
76
  }, {}, {
77
- ref?: import("react").Ref<View> | undefined;
77
+ ref?: import("react").Ref<View>;
78
78
  }>;
79
79
  declare const StyledTextInputContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
80
- theme?: import("@emotion/react").Theme | undefined;
81
- as?: import("react").ElementType<any> | undefined;
80
+ theme?: import("@emotion/react").Theme;
81
+ as?: import("react").ElementType<any>;
82
82
  }, {}, {
83
- ref?: import("react").Ref<View> | undefined;
83
+ ref?: import("react").Ref<View>;
84
84
  }>;
85
85
  declare const StyledTextInputAndLabelContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
86
- theme?: import("@emotion/react").Theme | undefined;
87
- as?: import("react").ElementType<any> | undefined;
86
+ theme?: import("@emotion/react").Theme;
87
+ as?: import("react").ElementType<any>;
88
88
  }, {}, {
89
- ref?: import("react").Ref<View> | undefined;
89
+ ref?: import("react").Ref<View>;
90
90
  }>;
91
91
  declare const StyledErrorAndHelpTextContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
92
- theme?: import("@emotion/react").Theme | undefined;
93
- as?: import("react").ElementType<any> | undefined;
92
+ theme?: import("@emotion/react").Theme;
93
+ as?: import("react").ElementType<any>;
94
94
  }, {}, {
95
- ref?: import("react").Ref<View> | undefined;
95
+ ref?: import("react").Ref<View>;
96
96
  }>;
97
97
  declare const StyledErrorAndMaxLengthContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
98
- theme?: import("@emotion/react").Theme | undefined;
99
- as?: import("react").ElementType<any> | undefined;
98
+ theme?: import("@emotion/react").Theme;
99
+ as?: import("react").ElementType<any>;
100
100
  }, {}, {
101
- ref?: import("react").Ref<View> | undefined;
101
+ ref?: import("react").Ref<View>;
102
102
  }>;
103
103
  export { StyledTextInputContainer, StyledLabel, StyledLabelContainer, StyledAsteriskLabel, StyledAsteriskLabelInsideTextInput, StyledTextInput, StyledError, StyledMaxLengthMessage, StyledLabelInsideTextInput, StyledContainer, StyledErrorContainer, StyledHelperText, StyledTextInputAndLabelContainer, StyledLabelContainerInsideTextInput, StyledErrorAndHelpTextContainer, StyledBorderBackDrop, StyledErrorAndMaxLengthContainer, };
@@ -53,12 +53,12 @@ export interface TextInputProps extends NativeTextInputProps {
53
53
  helpText?: string;
54
54
  }
55
55
  export declare const getVariant: ({ disabled, error, editable, loading, isFocused, isEmptyValue, }: {
56
- disabled?: boolean | undefined;
57
- error?: string | undefined;
58
- editable?: boolean | undefined;
56
+ disabled?: boolean;
57
+ error?: string;
58
+ editable?: boolean;
59
59
  loading: boolean;
60
- isFocused?: boolean | undefined;
61
- isEmptyValue?: boolean | undefined;
60
+ isFocused?: boolean;
61
+ isEmptyValue?: boolean;
62
62
  }) => Variant;
63
63
  declare const TextInput: ({ label, prefix, suffix, style, textStyle, testID, accessibilityLabelledBy, error, required, editable, disabled, loading, maxLength, helpText, value, defaultValue, ...nativeProps }: TextInputProps) => JSX.Element;
64
64
  export default TextInput;
@@ -1,9 +1,9 @@
1
1
  import { View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
3
  declare const StyledPickerWrapper: import("@emotion/native").StyledComponent<ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  }, {}, {
7
- ref?: import("react").Ref<View> | undefined;
7
+ ref?: import("react").Ref<View>;
8
8
  }>;
9
9
  export { StyledPickerWrapper };
@@ -1,46 +1,47 @@
1
1
  import { Animated, TouchableOpacity, View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
+ import { IntentType } from './types';
3
4
  declare const ToastContainerWrapper: import("@emotion/native").StyledComponent<ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
5
+ theme?: import("@emotion/react").Theme;
6
+ as?: import("react").ElementType<any>;
6
7
  } & {
7
8
  position: 'top' | 'bottom';
8
9
  }, {}, {
9
- ref?: import("react").Ref<View> | undefined;
10
+ ref?: import("react").Ref<View>;
10
11
  }>;
11
12
  declare const Container: import("@emotion/native").StyledComponent<Animated.AnimatedProps<ViewProps & import("react").RefAttributes<View>> & {
12
13
  children?: import("react").ReactNode;
13
14
  } & {
14
- theme?: import("@emotion/react").Theme | undefined;
15
- as?: import("react").ElementType<any> | undefined;
15
+ theme?: import("@emotion/react").Theme;
16
+ as?: import("react").ElementType<any>;
16
17
  } & {
17
18
  themeVariant: 'default' | 'round';
18
- themeIntent: 'success' | 'info' | 'warning' | 'error';
19
+ themeIntent: IntentType;
19
20
  }, {}, {}>;
20
21
  declare const IconContainer: import("@emotion/native").StyledComponent<ViewProps & {
21
- theme?: import("@emotion/react").Theme | undefined;
22
- as?: import("react").ElementType<any> | undefined;
22
+ theme?: import("@emotion/react").Theme;
23
+ as?: import("react").ElementType<any>;
23
24
  }, {}, {
24
- ref?: import("react").Ref<View> | undefined;
25
+ ref?: import("react").Ref<View>;
25
26
  }>;
26
27
  declare const TextContainer: import("@emotion/native").StyledComponent<ViewProps & {
27
- theme?: import("@emotion/react").Theme | undefined;
28
- as?: import("react").ElementType<any> | undefined;
28
+ theme?: import("@emotion/react").Theme;
29
+ as?: import("react").ElementType<any>;
29
30
  }, {}, {
30
- ref?: import("react").Ref<View> | undefined;
31
+ ref?: import("react").Ref<View>;
31
32
  }>;
32
33
  declare const ContentContainer: import("@emotion/native").StyledComponent<ViewProps & {
33
- theme?: import("@emotion/react").Theme | undefined;
34
- as?: import("react").ElementType<any> | undefined;
34
+ theme?: import("@emotion/react").Theme;
35
+ as?: import("react").ElementType<any>;
35
36
  } & {
36
37
  showDivider: boolean;
37
38
  }, {}, {
38
- ref?: import("react").Ref<View> | undefined;
39
+ ref?: import("react").Ref<View>;
39
40
  }>;
40
41
  declare const CTAWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
41
- theme?: import("@emotion/react").Theme | undefined;
42
- as?: import("react").ElementType<any> | undefined;
42
+ theme?: import("@emotion/react").Theme;
43
+ as?: import("react").ElementType<any>;
43
44
  }, {}, {
44
- ref?: import("react").Ref<TouchableOpacity> | undefined;
45
+ ref?: import("react").Ref<TouchableOpacity>;
45
46
  }>;
46
47
  export { ToastContainerWrapper, Container, ContentContainer, TextContainer, IconContainer, CTAWrapper, };
@@ -1,6 +1,7 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { StyleProp, ViewStyle } from 'react-native';
3
3
  import type { IconName } from '../Icon';
4
+ export declare type IntentType = 'success' | 'info' | 'warning' | 'error' | 'notification' | 'snackbar';
4
5
  export interface ToastProps {
5
6
  /**
6
7
  * Toast content.
@@ -16,7 +17,7 @@ export interface ToastProps {
16
17
  /**
17
18
  * Visual intent color to apply to alert.
18
19
  */
19
- intent?: 'success' | 'info' | 'warning' | 'error';
20
+ intent?: 'success' | 'info' | 'warning' | 'error' | 'notification' | 'snackbar';
20
21
  /**
21
22
  * Toast variants
22
23
  */
@@ -1,23 +1,23 @@
1
1
  import { TouchableOpacity, View } from 'react-native';
2
2
  import type { ViewProps } from 'react-native';
3
3
  declare const ToolbarWrapper: import("@emotion/native").StyledComponent<ViewProps & {
4
- theme?: import("@emotion/react").Theme | undefined;
5
- as?: import("react").ElementType<any> | undefined;
4
+ theme?: import("@emotion/react").Theme;
5
+ as?: import("react").ElementType<any>;
6
6
  }, {}, {
7
- ref?: import("react").Ref<View> | undefined;
7
+ ref?: import("react").Ref<View>;
8
8
  }>;
9
9
  declare const ToolbarGroupWrapper: import("@emotion/native").StyledComponent<ViewProps & {
10
- theme?: import("@emotion/react").Theme | undefined;
11
- as?: import("react").ElementType<any> | undefined;
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: import("react").ElementType<any>;
12
12
  } & {
13
13
  align: 'left' | 'center' | 'right';
14
14
  }, {}, {
15
- ref?: import("react").Ref<View> | undefined;
15
+ ref?: import("react").Ref<View>;
16
16
  }>;
17
17
  declare const ToolbarItemWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
18
- theme?: import("@emotion/react").Theme | undefined;
19
- as?: import("react").ElementType<any> | undefined;
18
+ theme?: import("@emotion/react").Theme;
19
+ as?: import("react").ElementType<any>;
20
20
  }, {}, {
21
- ref?: import("react").Ref<TouchableOpacity> | undefined;
21
+ ref?: import("react").Ref<TouchableOpacity>;
22
22
  }>;
23
23
  export { ToolbarWrapper, ToolbarGroupWrapper, ToolbarItemWrapper };
@@ -1,12 +1,12 @@
1
1
  import { Text } from 'react-native';
2
2
  declare const StyledText: import("@emotion/native").StyledComponent<import("react-native").TextProps & {
3
- theme?: import("@emotion/react").Theme | undefined;
4
- as?: import("react").ElementType<any> | undefined;
3
+ theme?: import("@emotion/react").Theme;
4
+ as?: import("react").ElementType<any>;
5
5
  } & {
6
- themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxxxlarge';
6
+ themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxxlarge';
7
7
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
8
8
  themeIntent: 'body' | 'subdued' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted';
9
9
  }, {}, {
10
- ref?: import("react").Ref<Text> | undefined;
10
+ ref?: import("react").Ref<Text>;
11
11
  }>;
12
12
  export { StyledText };
@@ -8,7 +8,7 @@ export interface TextProps extends NativeTextProps {
8
8
  /**
9
9
  * Size of the text.
10
10
  */
11
- fontSize?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxxxlarge';
11
+ fontSize?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxxlarge';
12
12
  /**
13
13
  * Font weight of the text.
14
14
  */
package/types/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import Avatar from './components/Avatar';
6
6
  import Badge from './components/Badge';
7
7
  import BottomNavigation from './components/BottomNavigation';
8
8
  import BottomSheet from './components/BottomSheet';
9
+ import Box from './components/Box';
9
10
  import Button from './components/Button';
10
11
  import Calendar from './components/Calendar';
11
12
  import Card from './components/Card';
@@ -34,5 +35,5 @@ import Toast from './components/Toast';
34
35
  import Toolbar from './components/Toolbar';
35
36
  import Typography from './components/Typography';
36
37
  import RichTextEditor from './components/RichTextEditor';
37
- export { theme, getTheme, useTheme, scale, ThemeProvider, swagSystemPalette, workSystemPalette, Accordion, Alert, Avatar, Badge, BottomNavigation, BottomSheet, Button, Calendar, Card, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, List, PinInput, Progress, Spinner, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RichTextEditor, };
38
+ export { theme, getTheme, useTheme, scale, ThemeProvider, swagSystemPalette, workSystemPalette, Accordion, Alert, Avatar, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, List, PinInput, Progress, Spinner, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RichTextEditor, };
38
39
  export * from './types';
@@ -1,3 +1,3 @@
1
1
  import type { RenderOptions } from '@testing-library/react-native';
2
- declare const renderWithTheme: (ui: JSX.Element, options?: RenderOptions | undefined) => import("@testing-library/react-native").RenderAPI;
2
+ declare const renderWithTheme: (ui: JSX.Element, options?: RenderOptions) => import("@testing-library/react-native").RenderAPI;
3
3
  export default renderWithTheme;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  declare type ThemeName = 'swag' | 'work';
3
3
  declare const ThemeSwitcher: ({ name, children, }: {
4
- name?: ThemeName | undefined;
4
+ name?: ThemeName;
5
5
  children: React.ReactNode;
6
6
  }) => JSX.Element;
7
7
  export default ThemeSwitcher;
@@ -5,6 +5,7 @@ declare const getAlertTheme: (theme: GlobalTheme) => {
5
5
  warning: string;
6
6
  error: string;
7
7
  info: string;
8
+ notification: string;
8
9
  divider: string;
9
10
  };
10
11
  radii: {
@@ -14,7 +15,10 @@ declare const getAlertTheme: (theme: GlobalTheme) => {
14
15
  height: number;
15
16
  };
16
17
  space: {
17
- padding: number;
18
+ contentPaddingHorizontal: number;
19
+ textPaddingHorizontal: number;
20
+ iconLeftPadding: number;
21
+ ctaPadding: number;
18
22
  };
19
23
  borderWidths: {
20
24
  base: number;