@hero-design/rn 8.2.2 → 8.3.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 (57) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/es/index.js +409 -80
  3. package/lib/index.js +407 -77
  4. package/package.json +5 -5
  5. package/src/components/Box/StyledBox.tsx +8 -6
  6. package/src/components/Card/StyledCard.tsx +1 -1
  7. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +74 -0
  8. package/src/components/Card/__tests__/index.spec.tsx +2 -0
  9. package/src/components/Card/index.tsx +1 -1
  10. package/src/components/Carousel/CarouselItem.tsx +49 -0
  11. package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +19 -0
  12. package/src/components/Carousel/CarouselPaginator/index.tsx +58 -0
  13. package/src/components/Carousel/StyledCarousel.tsx +55 -0
  14. package/src/components/Carousel/__tests__/StyledCarousel.spec.tsx +13 -0
  15. package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +21 -0
  16. package/src/components/Carousel/__tests__/index.spec.tsx +86 -0
  17. package/src/components/Carousel/index.tsx +176 -0
  18. package/src/components/Carousel/types.ts +10 -0
  19. package/src/components/Icon/index.tsx +28 -2
  20. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +160 -0
  21. package/src/components/TextInput/__tests__/index.spec.tsx +50 -3
  22. package/src/components/TextInput/index.tsx +65 -30
  23. package/src/components/Toolbar/ToolbarGroup.tsx +20 -14
  24. package/src/components/Toolbar/ToolbarItem.tsx +9 -1
  25. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -0
  26. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -0
  27. package/src/index.ts +2 -0
  28. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +27 -0
  29. package/src/theme/components/carousel.ts +39 -0
  30. package/src/theme/getTheme.ts +3 -0
  31. package/src/types.ts +4 -1
  32. package/src/utils/__tests__/helpers.spec.ts +22 -4
  33. package/src/utils/helpers.ts +10 -9
  34. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
  35. package/types/components/Box/StyledBox.d.ts +2 -2
  36. package/types/components/Button/StyledButton.d.ts +1 -1
  37. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +1 -1
  38. package/types/components/Card/StyledCard.d.ts +1 -1
  39. package/types/components/Card/index.d.ts +1 -1
  40. package/types/components/Carousel/CarouselItem.d.ts +7 -0
  41. package/types/components/Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts +16 -0
  42. package/types/components/Carousel/CarouselPaginator/index.d.ts +7 -0
  43. package/types/components/Carousel/StyledCarousel.d.ts +34 -0
  44. package/types/components/Carousel/index.d.ts +46 -0
  45. package/types/components/Carousel/types.d.ts +9 -0
  46. package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
  47. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +1 -1
  48. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +1 -1
  49. package/types/components/Icon/index.d.ts +3 -3
  50. package/types/components/TextInput/StyledTextInput.d.ts +7 -7
  51. package/types/components/TextInput/index.d.ts +25 -3
  52. package/types/components/Toolbar/ToolbarItem.d.ts +6 -1
  53. package/types/index.d.ts +2 -1
  54. package/types/theme/components/carousel.d.ts +29 -0
  55. package/types/theme/getTheme.d.ts +2 -0
  56. package/types/types.d.ts +3 -2
  57. package/types/utils/helpers.d.ts +2 -2
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ import BottomSheet from './components/BottomSheet';
21
21
  import Box from './components/Box';
22
22
  import Button from './components/Button';
23
23
  import Calendar from './components/Calendar';
24
+ import Carousel from './components/Carousel';
24
25
  import Card from './components/Card';
25
26
  import Collapse from './components/Collapse';
26
27
  import Checkbox from './components/Checkbox';
@@ -76,6 +77,7 @@ export {
76
77
  Button,
77
78
  Calendar,
78
79
  Card,
80
+ Carousel,
79
81
  Collapse,
80
82
  Checkbox,
81
83
  ContentNavigator,
@@ -253,6 +253,33 @@ Object {
253
253
  "indicatorWidth": 16,
254
254
  },
255
255
  },
256
+ "carousel": Object {
257
+ "colors": Object {
258
+ "paginatorBackgroundColor": "#401960",
259
+ },
260
+ "fontSizes": Object {
261
+ "heading": 32,
262
+ },
263
+ "fonts": Object {
264
+ "heading": "RebondGrotesque-SemiBold",
265
+ },
266
+ "lineHeights": Object {
267
+ "heading": 32,
268
+ },
269
+ "radii": Object {
270
+ "paginatorBorderRadius": 999,
271
+ },
272
+ "sizes": Object {
273
+ "indicatorWidth": 16,
274
+ "paginatorHeight": 8,
275
+ "paginatorWidth": 8,
276
+ },
277
+ "space": Object {
278
+ "headingMarginBottom": 16,
279
+ "headingMarginTop": 8,
280
+ "paginatorMarginHorizontal": 8,
281
+ },
282
+ },
256
283
  "checkbox": Object {
257
284
  "borderWidths": Object {
258
285
  "icon": 2,
@@ -0,0 +1,39 @@
1
+ import type { GlobalTheme } from '../global';
2
+
3
+ const getCarouselTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ paginatorBackgroundColor: theme.colors.primary,
6
+ };
7
+
8
+ const space = {
9
+ headingMarginTop: theme.space.small,
10
+ headingMarginBottom: theme.space.medium,
11
+ paginatorMarginHorizontal: theme.space.small,
12
+ };
13
+
14
+ const sizes = {
15
+ indicatorWidth: theme.sizes.medium,
16
+ paginatorHeight: theme.sizes.small,
17
+ paginatorWidth: theme.sizes.small,
18
+ };
19
+
20
+ const radii = {
21
+ paginatorBorderRadius: theme.radii.rounded,
22
+ };
23
+
24
+ const fontSizes = {
25
+ heading: theme.fontSizes.xxxxxlarge,
26
+ };
27
+
28
+ const fonts = {
29
+ heading: theme.fonts.playful.semiBold,
30
+ };
31
+
32
+ const lineHeights = {
33
+ heading: theme.lineHeights.xxxlarge,
34
+ };
35
+
36
+ return { colors, sizes, radii, space, fonts, fontSizes, lineHeights };
37
+ };
38
+
39
+ export default getCarouselTheme;
@@ -10,6 +10,7 @@ import getBottomSheetTheme from './components/bottomSheet';
10
10
  import getButtonTheme from './components/button';
11
11
  import getCalendarTheme from './components/calendar';
12
12
  import getCardTheme from './components/card';
13
+ import getCarouselTheme from './components/carousel';
13
14
  import getCheckboxTheme from './components/checkbox';
14
15
  import getContentNavigatorTheme from './components/contentNavigator';
15
16
  import getDatePickerTheme from './components/datePicker';
@@ -53,6 +54,7 @@ type Theme = GlobalTheme & {
53
54
  button: ReturnType<typeof getButtonTheme>;
54
55
  calendar: ReturnType<typeof getCalendarTheme>;
55
56
  card: ReturnType<typeof getCardTheme>;
57
+ carousel: ReturnType<typeof getCarouselTheme>;
56
58
  checkbox: ReturnType<typeof getCheckboxTheme>;
57
59
  contentNavigator: ReturnType<typeof getContentNavigatorTheme>;
58
60
  datePicker: ReturnType<typeof getDatePickerTheme>;
@@ -102,6 +104,7 @@ const getTheme = (
102
104
  button: getButtonTheme(globalTheme),
103
105
  calendar: getCalendarTheme(globalTheme),
104
106
  card: getCardTheme(globalTheme),
107
+ carousel: getCarouselTheme(globalTheme),
105
108
  checkbox: getCheckboxTheme(globalTheme),
106
109
  contentNavigator: getContentNavigatorTheme(globalTheme),
107
110
  datePicker: getDatePickerTheme(globalTheme),
package/src/types.ts CHANGED
@@ -2,7 +2,7 @@ import type { BottomNavigationTabType } from './components/BottomNavigation';
2
2
  import type { IconName } from './components/Icon';
3
3
  import type { SingleSelectProps, MultiSelectProps } from './components/Select';
4
4
  import type { TabType } from './components/Tabs';
5
- import type { TextInputProps } from './components/TextInput';
5
+ import type { TextInputProps, TextInputHandles } from './components/TextInput';
6
6
  import type {
7
7
  RichTextEditorRef,
8
8
  RichTextEditorProps,
@@ -13,6 +13,7 @@ import type {
13
13
  SectionListRenderOptionInfo,
14
14
  } from './components/Select/types';
15
15
  import { SwipeableProps } from './components/Swipeable';
16
+ import { TextProps } from './components/Typography/Text';
16
17
 
17
18
  export type {
18
19
  BottomNavigationTabType,
@@ -26,5 +27,7 @@ export type {
26
27
  RichTextEditorRef,
27
28
  TabType,
28
29
  TextInputProps,
30
+ TextProps,
31
+ TextInputHandles,
29
32
  Theme,
30
33
  };
@@ -2,10 +2,19 @@ import { omit, pick } from '../helpers';
2
2
 
3
3
  describe('pick', () => {
4
4
  it('works', () => {
5
- const keys = ['a', 'b', 'f'];
6
5
  const props = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
7
6
 
8
- expect(pick(keys, props)).toEqual({
7
+ expect(pick(['a', 'b', 'f'], props)).toEqual({
8
+ a: 1,
9
+ b: true,
10
+ f: 'whatever',
11
+ });
12
+ });
13
+
14
+ it('work with any', () => {
15
+ const props: any = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
16
+
17
+ expect(pick(['a', 'b', 'f'], props)).toEqual({
9
18
  a: 1,
10
19
  b: true,
11
20
  f: 'whatever',
@@ -15,10 +24,19 @@ describe('pick', () => {
15
24
 
16
25
  describe('omit', () => {
17
26
  it('works', () => {
18
- const keys = ['a', 'b'];
19
27
  const props = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
20
28
 
21
- expect(omit(keys, props)).toEqual({
29
+ expect(omit(['a', 'b'], props)).toEqual({
30
+ c: 'outline',
31
+ d: null,
32
+ f: 'whatever',
33
+ });
34
+ });
35
+
36
+ it('work with any', () => {
37
+ const props: any = { a: 1, b: true, c: 'outline', d: null, f: 'whatever' };
38
+
39
+ expect(omit(['a', 'b'], props)).toEqual({
22
40
  c: 'outline',
23
41
  d: null,
24
42
  f: 'whatever',
@@ -3,23 +3,24 @@ import { Platform } from 'react-native';
3
3
  export const isIOS = Platform.OS === 'ios';
4
4
  export const isAndroid = Platform.OS === 'android';
5
5
 
6
- export const pick = (keys: Array<string>, props: Record<string, any>) =>
7
- keys
8
- .filter((key) => key in props)
9
- .reduce(
6
+ export function pick<O, T extends keyof O>(keys: T[], obj: O): Pick<O, T> {
7
+ return keys
8
+ .filter((key) => key in obj)
9
+ .reduce<Partial<O>>(
10
10
  (result, cur) => ({
11
11
  ...result,
12
- [cur]: props[cur],
12
+ [cur]: obj[cur],
13
13
  }),
14
14
  {}
15
- );
15
+ ) as Pick<O, T>;
16
+ }
16
17
 
17
- export const omit = (keys: Array<string>, props: Record<string, any>) => {
18
- const result = props;
18
+ export function omit<O, T extends keyof O>(keys: T[], obj: O): Omit<O, T> {
19
+ const result = obj;
19
20
 
20
21
  keys.forEach((key) => {
21
22
  delete result[key];
22
23
  });
23
24
 
24
25
  return result;
25
- };
26
+ }
@@ -44,7 +44,7 @@ declare const BottomBarItem: import("@emotion/native").StyledComponent<import("r
44
44
  }, {}, {
45
45
  ref?: import("react").Ref<View> | undefined;
46
46
  }>;
47
- declare const StyledBottomBarText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
47
+ declare const StyledBottomBarText: import("@emotion/native").StyledComponent<import("../..").TextProps & {
48
48
  theme?: import("@emotion/react").Theme | undefined;
49
49
  as?: import("react").ElementType<any> | undefined;
50
50
  }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  import { Theme } from '@emotion/react';
2
2
  import { View } from 'react-native';
3
- import { StyleProps } from './types';
3
+ import { FlexStyleProps, StyleProps } from './types';
4
4
  export declare const getThemeValue: (theme: Theme, key: keyof StyleProps, props: StyleProps) => {
5
5
  [x: string]: string;
6
6
  } | {
@@ -9,7 +9,7 @@ export declare const getThemeValue: (theme: Theme, key: keyof StyleProps, props:
9
9
  declare const StyledBox: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
10
10
  theme?: Theme | undefined;
11
11
  as?: import("react").ElementType<any> | undefined;
12
- } & StyleProps, {}, {
12
+ } & StyleProps & FlexStyleProps, {}, {
13
13
  ref?: import("react").Ref<View> | undefined;
14
14
  }>;
15
15
  export { StyledBox };
@@ -11,7 +11,7 @@ declare const StyledButtonContainer: import("@emotion/native").StyledComponent<i
11
11
  }, {}, {
12
12
  ref?: import("react").Ref<TouchableOpacity> | undefined;
13
13
  }>;
14
- declare const StyledButtonText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
14
+ declare const StyledButtonText: import("@emotion/native").StyledComponent<import("../..").TextProps & {
15
15
  theme?: Theme | undefined;
16
16
  as?: import("react").ElementType<any> | undefined;
17
17
  } & {
@@ -11,7 +11,7 @@ export declare const IconWrapper: import("@emotion/native").StyledComponent<impo
11
11
  }, {}, {
12
12
  ref?: import("react").Ref<View> | undefined;
13
13
  }>;
14
- export declare const ButtonText: import("@emotion/native").StyledComponent<import("../../Typography/Text").TextProps & {
14
+ export declare const ButtonText: import("@emotion/native").StyledComponent<import("../../..").TextProps & {
15
15
  theme?: import("@emotion/react").Theme | undefined;
16
16
  as?: import("react").ElementType<any> | undefined;
17
17
  }, {}, {}>;
@@ -3,7 +3,7 @@ declare const StyledCard: import("@emotion/native").StyledComponent<import("reac
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any> | undefined;
5
5
  } & {
6
- themeIntent?: "primary" | "success" | "warning" | undefined;
6
+ themeIntent?: "primary" | "success" | "warning" | "danger" | "archived" | undefined;
7
7
  }, {}, {
8
8
  ref?: import("react").Ref<View> | undefined;
9
9
  }>;
@@ -8,7 +8,7 @@ interface CardProps extends ViewProps {
8
8
  /**
9
9
  * Visual intent color to apply to card.
10
10
  */
11
- intent?: 'primary' | 'success' | 'warning';
11
+ intent?: 'primary' | 'success' | 'warning' | 'danger' | 'archived';
12
12
  /**
13
13
  * Additional style.
14
14
  */
@@ -0,0 +1,7 @@
1
+ import { CarouselData } from './types';
2
+ interface CarouselItemProps extends Omit<CarouselData, 'background'> {
3
+ width: number;
4
+ minHeight: number;
5
+ }
6
+ declare const CarouselItem: ({ width, image, content, heading, body, minHeight, }: CarouselItemProps) => JSX.Element;
7
+ export default CarouselItem;
@@ -0,0 +1,16 @@
1
+ import { Animated, View } from 'react-native';
2
+ declare const StyledCarouselPaginator: 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 StyledCarouselPaginatorAnimatedView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
9
+ children?: import("react").ReactNode;
10
+ } & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ } & {
14
+ indicatorWidth: Animated.AnimatedInterpolation;
15
+ }, {}, {}>;
16
+ export { StyledCarouselPaginator, StyledCarouselPaginatorAnimatedView };
@@ -0,0 +1,7 @@
1
+ import { Animated } from 'react-native';
2
+ interface CarouselPaginatorProps {
3
+ numberOfSlides: number;
4
+ scrollX: Animated.Value;
5
+ }
6
+ declare const CarouselPaginator: ({ numberOfSlides, scrollX, }: CarouselPaginatorProps) => JSX.Element;
7
+ export default CarouselPaginator;
@@ -0,0 +1,34 @@
1
+ import { View } from 'react-native';
2
+ declare const StyledCarousel: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
6
+ themeSlideBackground: string;
7
+ }, {}, {
8
+ ref?: import("react").Ref<View> | undefined;
9
+ }>;
10
+ declare const StyledCarouselView: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, {}, {
14
+ ref?: import("react").Ref<View> | undefined;
15
+ }>;
16
+ declare const StyledCarouselHeading: import("@emotion/native").StyledComponent<import("../..").TextProps & {
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any> | undefined;
19
+ }, {}, {}>;
20
+ declare const StyledCarouselImage: import("@emotion/native").StyledComponent<import("../Image").ImageProps & {
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ }, {}, {}>;
24
+ declare const StyledCarouselContentWrapper: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
25
+ theme?: import("@emotion/react").Theme | undefined;
26
+ as?: import("react").ElementType<any> | undefined;
27
+ } & {
28
+ width: number;
29
+ }, {}, {}>;
30
+ declare const StyledCarouselFooterWrapper: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any> | undefined;
33
+ }, {}, {}>;
34
+ export { StyledCarousel, StyledCarouselView, StyledCarouselHeading, StyledCarouselImage, StyledCarouselContentWrapper, StyledCarouselFooterWrapper, };
@@ -0,0 +1,46 @@
1
+ import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
+ import { CarouselData } from './types';
3
+ interface CarouselProps extends ViewProps {
4
+ /**
5
+ * Additional style.
6
+ */
7
+ style?: StyleProp<ViewStyle>;
8
+ /**
9
+ * Testing id of the component.
10
+ */
11
+ testID?: string;
12
+ /**
13
+ * Callback to be called when the user slides to the next slide.
14
+ */
15
+ onSlideChange?: (currentSlide?: CarouselData) => void;
16
+ /**
17
+ * Callback to be called when the user skips the intro carousel.
18
+ */
19
+ onSkipPress?: (currentSlide?: CarouselData) => void;
20
+ /**
21
+ * Callback to be called when the user finishes the intro carousel.
22
+ */
23
+ onFinishPress?: (currentSlide?: CarouselData) => void;
24
+ /**
25
+ * Carousel data.
26
+ */
27
+ items: CarouselData[];
28
+ /**
29
+ * Finish button label.
30
+ */
31
+ finishButtonLabel?: string;
32
+ /**
33
+ * Skip button label.
34
+ */
35
+ skipButtonLabel?: string;
36
+ /**
37
+ * Footer height.
38
+ */
39
+ footerHeight?: number;
40
+ /**
41
+ * Min content height.
42
+ */
43
+ minContentHeight?: number;
44
+ }
45
+ declare const Carousel: ({ items, onFinishPress, onSkipPress, onSlideChange, finishButtonLabel, skipButtonLabel, footerHeight, minContentHeight, ...nativeProps }: CarouselProps) => JSX.Element;
46
+ export default Carousel;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ImageSourcePropType } from 'react-native';
3
+ export declare type CarouselData = {
4
+ image: ImageSourcePropType | string;
5
+ content?: ReactNode;
6
+ heading: string;
7
+ body?: string;
8
+ background: string;
9
+ };
@@ -8,7 +8,7 @@ export declare const StyledWrapper: import("@emotion/native").StyledComponent<im
8
8
  }, {}, {
9
9
  ref?: import("react").Ref<TouchableOpacity> | undefined;
10
10
  }>;
11
- export declare const StyledDescription: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
11
+ export declare const StyledDescription: import("@emotion/native").StyledComponent<import("../..").TextProps & {
12
12
  theme?: import("@emotion/react").Theme | undefined;
13
13
  as?: import("react").ElementType<any> | undefined;
14
14
  }, {}, {}>;
@@ -5,7 +5,7 @@ declare const Wrapper: import("@emotion/native").StyledComponent<import("react-n
5
5
  }, {}, {
6
6
  ref?: import("react").Ref<View> | undefined;
7
7
  }>;
8
- declare const Value: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
8
+ declare const Value: import("@emotion/native").StyledComponent<import("../..").TextProps & {
9
9
  theme?: import("@emotion/react").Theme | undefined;
10
10
  as?: import("react").ElementType<any> | undefined;
11
11
  }, {}, {}>;
@@ -7,7 +7,7 @@ declare const StyledActionItem: import("@emotion/native").StyledComponent<Toucha
7
7
  }, {}, {
8
8
  ref?: import("react").Ref<TouchableOpacity> | undefined;
9
9
  }>;
10
- declare const StyledActionItemText: import("@emotion/native").StyledComponent<import("../../Typography/Text").TextProps & {
10
+ declare const StyledActionItemText: import("@emotion/native").StyledComponent<import("../../..").TextProps & {
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
12
  as?: import("react").ElementType<any> | undefined;
13
13
  } & TouchableOpacityProps, {}, {}>;
@@ -1,7 +1,7 @@
1
- import type { StyleProp, TextStyle } from 'react-native';
1
+ import type { AccessibilityProps, StyleProp, TextStyle } from 'react-native';
2
2
  import IconList from './IconList';
3
3
  export declare type IconName = typeof IconList[number];
4
- export interface IconProps {
4
+ export interface IconProps extends AccessibilityProps {
5
5
  /**
6
6
  * Name of the Icon.
7
7
  */
@@ -28,7 +28,7 @@ export interface IconProps {
28
28
  testID?: string;
29
29
  }
30
30
  declare const Icon: {
31
- ({ icon, style, size, intent, testID, spin, }: IconProps): JSX.Element;
31
+ ({ icon, style, size, intent, testID, spin, accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityState, accessibilityValue, accessibilityLiveRegion, accessibilityElementsHidden, accessible, accessibilityIgnoresInvertColors, accessibilityViewIsModal, accessibilityActions, }: IconProps): JSX.Element;
32
32
  List: readonly ["activate", "add-emoji", "add-person", "adjustment", "alignment", "antenna", "archive", "assignment-warning", "bank", "bell", "billing", "bookmark", "box-check", "box", "buildings", "cake", "calendar-clock", "calendar", "candy-box-menu", "caret-down-small", "caret-down", "caret-left-small", "caret-left", "caret-right-small", "caret-right", "caret-up-small", "caret-up", "check-radio", "circle-add", "circle-cancel", "circle-check", "circle-down", "circle-info", "circle-left", "circle-ok", "circle-pencil", "circle-question", "circle-remove", "circle-right", "circle-up", "circle-warning", "clock-3", "clock", "cloud-download", "cloud-upload", "cog", "coin", "contacts", "credit-card", "diamond", "direction-arrows", "directory", "document", "dollar-coin-shine", "double-buildings", "edit-template", "envelope", "expense", "eye-circle", "eye-invisible", "eye", "face-meh", "face-sad", "face-smiley", "feed", "feedbacks", "file-certified", "file-clone", "file-copy", "file-csv", "file-dispose", "file-doc", "file-excel", "file-export", "file-lock", "file-pdf", "file-powerpoint", "file-search", "file-secured", "file-sheets", "file-slide", "file-verified", "file-word", "file", "filter", "folder-user", "folder", "format-bold", "format-heading1", "format-heading2", "format-italic", "format-list-bulleted", "format-list-numbered", "format-underlined", "funnel-filter", "global-dollar", "globe", "graduation-cap", "graph", "happy-sun", "health-bag", "heart", "home", "image", "import", "incident-siren", "instapay", "list", "loading-2", "loading", "location", "lock", "looks-one", "looks-two", "media-content", "menu", "moneybag", "moon", "multiple-stars", "multiple-users", "node", "open-folder", "paperclip", "payment-summary", "pencil", "phone", "piggy-bank", "plane", "play-circle", "print", "raising-hands", "reply-arrow", "reply", "reschedule", "rostering", "save", "schedule-send", "schedule", "search-person", "send", "speaker-active", "speaker", "star-award", "star-badge", "star-medal", "star", "steps-circle", "stopwatch", "suitcase", "survey", "swag", "switch", "tag", "target", "teams", "timesheet", "touch-id", "trash-bin", "unlock", "user", "video-1", "video-2", "wallet", "warning", "activate-outlined", "add-credit-card-outlined", "add-person-outlined", "add-section-outlined", "add-time-outlined", "add", "adjustment-outlined", "alignment-2-outlined", "alignment-outlined", "all-caps", "arrow-down", "arrow-downwards", "arrow-left", "arrow-leftwards", "arrow-right", "arrow-rightwards", "arrow-up", "arrow-upwards", "at-sign", "bell-active-outlined", "bell-outlined", "bell-slash-outlined", "billing-outlined", "body-outlined", "bold", "bookmark-added-outlined", "bookmark-outlined", "box-check-outlined", "box-outlined", "bullet-points", "cake-outlined", "calendar-dates-outlined", "calendar-star-outlined", "camera-outlined", "cancel", "chat-bubble-outlined", "chat-unread-outlined", "checkmark", "circle-add-outlined", "circle-cancel-outlined", "circle-down-outlined", "circle-info-outlined", "circle-left-outlined", "circle-ok-outlined", "circle-question-outlined", "circle-remove-outlined", "circle-right-outlined", "circle-up-outlined", "circle-warning-outlined", "clock-2-outlined", "clock-outlined", "cog-outlined", "coin-outlined", "comment-outlined", "contacts-outlined", "credit-card-outlined", "cup-outlined", "direction-arrows-outlined", "directory-outlined", "document-outlined", "dollar-card-outlined", "dollar-coin-shine-outlined", "dollar-sign", "double-buildings-outlined", "double-left-arrows", "double-right-arrows", "download-outlined", "edit-template-outlined", "email-outlined", "enter-arrow", "envelope-outlined", "expense-outlined", "explore-outlined", "external-link", "eye-invisible-outlined", "eye-outlined", "face-id", "face-meh-outlined", "face-open-smiley-outlined", "face-sad-outlined", "face-smiley-outlined", "feed-outlined", "file-certified-outlined", "file-clone-outlined", "file-copy-outlined", "file-dispose-outlined", "file-dollar-outlined", "file-download-outlined", "file-export-outlined", "file-lock-outlined", "file-outlined", "file-search-outlined", "file-secured-outlined", "file-verified-outlined", "filter-outlined", "folder-outlined", "folder-user-outlined", "funnel-filter-outline", "graph-outlined", "hand-holding-user-outlined", "happy-sun-outlined", "health-bag-outlined", "heart-outlined", "home-active-outlined", "home-outlined", "id-card-outlined", "image-outlined", "import-outlined", "instapay-outlined", "italic", "link-1", "link-2", "list-outlined", "live-help-outlined", "location-outlined", "lock-outlined", "locked-file-outlined", "log-out", "media-content-outlined", "menu-close", "menu-expand", "menu-fold-outlined", "menu-unfold-outlined", "moneybag-outlined", "moon-outlined", "more-horizontal", "more-vertical", "multiple-folders-outlined", "multiple-users-outlined", "near-me-outlined", "node-outlined", "number-points", "number", "payment-summary-outlined", "payslip-outlined", "pencil-outlined", "percentage", "phone-outlined", "piggy-bank-outlined", "plane-outlined", "play-circle-outlined", "print-outlined", "qr-code-outlined", "qualification-outlined", "re-assign", "redeem", "refresh", "remove", "reply-outlined", "restart", "return-arrow", "rostering-outlined", "save-outlined", "schedule-outlined", "search-outlined", "search-secured-outlined", "send-outlined", "share-1", "share-2", "share-outlined", "single-down-arrow", "single-left-arrow", "single-right-arrow", "single-up-arrow", "speaker-active-outlined", "speaker-outlined", "star-outlined", "stopwatch-outlined", "strikethrough", "suitcase-clock-outlined", "suitcase-outlined", "survey-outlined", "switch-outlined", "sync", "target-outlined", "timesheet-outlined", "today-outlined", "transfer", "trash-bin-outlined", "umbrela-outlined", "unavailable", "underline", "unlock-outlined", "upload-outlined", "user-circle-outlined", "user-gear-outlined", "user-outlined", "user-rectangle-outlined", "video-1-outlined", "video-2-outlined", "wallet-outlined"];
33
33
  };
34
34
  export default Icon;
@@ -12,13 +12,13 @@ declare const StyledLabelContainer: import("@emotion/native").StyledComponent<im
12
12
  }, {}, {
13
13
  ref?: import("react").Ref<View> | undefined;
14
14
  }>;
15
- declare const StyledLabel: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
15
+ declare const StyledLabel: import("@emotion/native").StyledComponent<import("../..").TextProps & {
16
16
  theme?: import("@emotion/react").Theme | undefined;
17
17
  as?: import("react").ElementType<any> | undefined;
18
18
  } & {
19
19
  themeVariant: Variant;
20
20
  }, {}, {}>;
21
- declare const StyledAsteriskLabel: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
21
+ declare const StyledAsteriskLabel: import("@emotion/native").StyledComponent<import("../..").TextProps & {
22
22
  theme?: import("@emotion/react").Theme | undefined;
23
23
  as?: import("react").ElementType<any> | undefined;
24
24
  } & {
@@ -30,13 +30,13 @@ declare const StyledLabelContainerInsideTextInput: import("@emotion/native").Sty
30
30
  }, {}, {
31
31
  ref?: import("react").Ref<View> | undefined;
32
32
  }>;
33
- declare const StyledLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
33
+ declare const StyledLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../..").TextProps & {
34
34
  theme?: import("@emotion/react").Theme | undefined;
35
35
  as?: import("react").ElementType<any> | undefined;
36
36
  } & {
37
37
  themeVariant: Variant;
38
38
  }, {}, {}>;
39
- declare const StyledAsteriskLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
39
+ declare const StyledAsteriskLabelInsideTextInput: import("@emotion/native").StyledComponent<import("../..").TextProps & {
40
40
  theme?: import("@emotion/react").Theme | undefined;
41
41
  as?: import("react").ElementType<any> | undefined;
42
42
  } & {
@@ -48,17 +48,17 @@ declare const StyledErrorContainer: import("@emotion/native").StyledComponent<im
48
48
  }, {}, {
49
49
  ref?: import("react").Ref<View> | undefined;
50
50
  }>;
51
- declare const StyledError: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
51
+ declare const StyledError: import("@emotion/native").StyledComponent<import("../..").TextProps & {
52
52
  theme?: import("@emotion/react").Theme | undefined;
53
53
  as?: import("react").ElementType<any> | undefined;
54
54
  }, {}, {}>;
55
- declare const StyledMaxLengthMessage: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
55
+ declare const StyledMaxLengthMessage: import("@emotion/native").StyledComponent<import("../..").TextProps & {
56
56
  theme?: import("@emotion/react").Theme | undefined;
57
57
  as?: import("react").ElementType<any> | undefined;
58
58
  } & {
59
59
  themeVariant: Variant;
60
60
  }, {}, {}>;
61
- declare const StyledHelperText: import("@emotion/native").StyledComponent<import("../Typography/Text").TextProps & {
61
+ declare const StyledHelperText: import("@emotion/native").StyledComponent<import("../..").TextProps & {
62
62
  theme?: import("@emotion/react").Theme | undefined;
63
63
  as?: import("react").ElementType<any> | undefined;
64
64
  }, {}, {}>;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { TextInput as RNTextInput } from 'react-native';
2
3
  import type { TextInputProps as NativeTextInputProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
3
4
  import type { Variant } from './StyledTextInput';
4
5
  import type { IconName } from '../Icon';
6
+ export declare type TextInputHandles = Pick<RNTextInput, 'focus' | 'clear' | 'blur' | 'isFocused' | 'setNativeProps'>;
5
7
  export interface TextInputProps extends NativeTextInputProps {
6
8
  /**
7
9
  * Field label.
@@ -37,7 +39,7 @@ export interface TextInputProps extends NativeTextInputProps {
37
39
  error?: string;
38
40
  /**
39
41
  * Whether the input is required, if true, an asterisk will be appended to the label.
40
- * */
42
+ */
41
43
  required?: boolean;
42
44
  /**
43
45
  * Placeholder text to display.
@@ -47,11 +49,31 @@ export interface TextInputProps extends NativeTextInputProps {
47
49
  * Whether the input is editable.
48
50
  * */
49
51
  editable?: boolean;
52
+ /**
53
+ * Whether the input is disabled.
54
+ */
50
55
  disabled?: boolean;
56
+ /**
57
+ * Whether the input is loading.
58
+ */
51
59
  loading?: boolean;
60
+ /**
61
+ * The max length of the input.
62
+ * If the max length is set, the input will display the current length and the max length.
63
+ * */
52
64
  maxLength?: number;
65
+ /**
66
+ * The helper text to display.
67
+ */
53
68
  helpText?: string;
69
+ /**
70
+ * Customise input value renderer
71
+ */
54
72
  renderInputValue?: (inputProps: NativeTextInputProps) => React.ReactNode;
73
+ /**
74
+ * Component ref.
75
+ */
76
+ ref?: React.Ref<TextInputHandles>;
55
77
  }
56
78
  export declare const getVariant: ({ disabled, error, editable, loading, isEmptyValue, }: {
57
79
  disabled?: boolean | undefined;
@@ -61,5 +83,5 @@ export declare const getVariant: ({ disabled, error, editable, loading, isEmptyV
61
83
  isFocused?: boolean | undefined;
62
84
  isEmptyValue?: boolean | undefined;
63
85
  }) => Variant;
64
- declare const TextInput: ({ label, prefix, suffix, style, textStyle, testID, accessibilityLabelledBy, error, required, editable, disabled, loading, maxLength, helpText, value, defaultValue, renderInputValue, ...nativeProps }: TextInputProps) => JSX.Element;
65
- export default TextInput;
86
+ declare const _default: React.ForwardRefExoticComponent<Pick<TextInputProps, "children" | "label" | "style" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "disabled" | "value" | "onBlur" | "onFocus" | "onPressIn" | "onPressOut" | "allowFontScaling" | "numberOfLines" | "maxFontSizeMultiplier" | "selectionColor" | "textBreakStrategy" | "loading" | "textAlign" | "error" | "textAlignVertical" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "onChange" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "keyboardType" | "maxLength" | "multiline" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "onKeyPress" | "placeholder" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "spellCheck" | "textContentType" | "autoComplete" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "showSoftInputOnFocus" | "prefix" | "suffix" | "textStyle" | "accessibilityLabelledBy" | "required" | "helpText" | "renderInputValue"> & React.RefAttributes<TextInputHandles>>;
87
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
1
2
  import type { IconName } from '../Icon';
2
3
  export interface ToolbarItemProps {
3
4
  /**
@@ -20,6 +21,10 @@ export interface ToolbarItemProps {
20
21
  * Whether the toolbar item is disabled.
21
22
  */
22
23
  disabled?: boolean;
24
+ /**
25
+ * Addtitional style.
26
+ */
27
+ style?: StyleProp<ViewStyle>;
23
28
  }
24
- declare const ToolbarItem: ({ icon, label, onPress, intent, disabled, }: ToolbarItemProps) => JSX.Element;
29
+ declare const ToolbarItem: ({ icon, label, onPress, intent, disabled, style, }: ToolbarItemProps) => JSX.Element;
25
30
  export default ToolbarItem;
package/types/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import BottomSheet from './components/BottomSheet';
10
10
  import Box from './components/Box';
11
11
  import Button from './components/Button';
12
12
  import Calendar from './components/Calendar';
13
+ import Carousel from './components/Carousel';
13
14
  import Card from './components/Card';
14
15
  import Collapse from './components/Collapse';
15
16
  import Checkbox from './components/Checkbox';
@@ -40,5 +41,5 @@ import Toolbar from './components/Toolbar';
40
41
  import Typography from './components/Typography';
41
42
  import RefreshControl from './components/RefreshControl';
42
43
  import RichTextEditor from './components/RichTextEditor';
43
- export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, swagSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, Image, List, PinInput, Progress, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
44
+ export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, swagSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, FAB, Icon, Image, List, PinInput, Progress, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
44
45
  export * from './types';