@hero-design/rn 8.3.0 → 8.3.2

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 (30) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/es/index.js +88 -88
  3. package/lib/index.js +85 -85
  4. package/package.json +5 -5
  5. package/src/components/Carousel/CarouselItem.tsx +1 -6
  6. package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +10 -9
  7. package/src/components/Carousel/CarouselPaginator/index.tsx +2 -3
  8. package/src/components/Carousel/StyledCarousel.tsx +9 -6
  9. package/src/components/Carousel/__tests__/StyledCarousel.spec.tsx +3 -3
  10. package/src/components/Carousel/__tests__/__snapshots__/StyledCarousel.spec.tsx.snap +1 -2
  11. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +600 -0
  12. package/src/components/Carousel/__tests__/index.spec.tsx +15 -7
  13. package/src/components/Carousel/index.tsx +65 -84
  14. package/src/components/TextInput/index.tsx +199 -197
  15. package/src/components/Typography/Text/StyledText.tsx +1 -0
  16. package/src/components/Typography/Text/index.tsx +1 -0
  17. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +9 -2
  18. package/src/theme/components/carousel.ts +5 -2
  19. package/src/theme/components/typography.ts +2 -0
  20. package/src/theme/global/typography.ts +3 -0
  21. package/types/components/Carousel/CarouselItem.d.ts +1 -2
  22. package/types/components/Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts +0 -2
  23. package/types/components/Carousel/StyledCarousel.d.ts +6 -4
  24. package/types/components/Carousel/index.d.ts +9 -23
  25. package/types/components/TextInput/index.d.ts +2 -2
  26. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  27. package/types/components/Typography/Text/index.d.ts +1 -1
  28. package/types/theme/components/carousel.d.ts +3 -0
  29. package/types/theme/components/typography.d.ts +2 -0
  30. package/types/theme/global/typography.d.ts +1 -0
@@ -258,13 +258,13 @@ Object {
258
258
  "paginatorBackgroundColor": "#401960",
259
259
  },
260
260
  "fontSizes": Object {
261
- "heading": 32,
261
+ "heading": 36,
262
262
  },
263
263
  "fonts": Object {
264
264
  "heading": "RebondGrotesque-SemiBold",
265
265
  },
266
266
  "lineHeights": Object {
267
- "heading": 32,
267
+ "heading": 44,
268
268
  },
269
269
  "radii": Object {
270
270
  "paginatorBorderRadius": 999,
@@ -275,6 +275,9 @@ Object {
275
275
  "paginatorWidth": 8,
276
276
  },
277
277
  "space": Object {
278
+ "footerMarginBottom": 24,
279
+ "footerPaddingHorizontal": 24,
280
+ "footerPaddingVertical": 16,
278
281
  "headingMarginBottom": 16,
279
282
  "headingMarginTop": 8,
280
283
  "paginatorMarginHorizontal": 8,
@@ -927,6 +930,7 @@ Object {
927
930
  "warning": "#ffa234",
928
931
  },
929
932
  "fontSizes": Object {
933
+ "6xlarge": 36,
930
934
  "7xlarge": 42,
931
935
  "large": 16,
932
936
  "medium": 14,
@@ -948,6 +952,7 @@ Object {
948
952
  },
949
953
  },
950
954
  "lineHeights": Object {
955
+ "6xlarge": 44,
951
956
  "7xlarge": 50,
952
957
  "large": 24,
953
958
  "medium": 22,
@@ -1007,6 +1012,7 @@ Object {
1007
1012
  "warningSurface": "#fff6eb",
1008
1013
  },
1009
1014
  "fontSizes": Object {
1015
+ "6xlarge": 36,
1010
1016
  "7xlarge": 42,
1011
1017
  "large": 16,
1012
1018
  "medium": 14,
@@ -1031,6 +1037,7 @@ Object {
1031
1037
  },
1032
1038
  },
1033
1039
  "lineHeights": Object {
1040
+ "6xlarge": 44,
1034
1041
  "7xlarge": 50,
1035
1042
  "large": 24,
1036
1043
  "medium": 22,
@@ -9,6 +9,9 @@ const getCarouselTheme = (theme: GlobalTheme) => {
9
9
  headingMarginTop: theme.space.small,
10
10
  headingMarginBottom: theme.space.medium,
11
11
  paginatorMarginHorizontal: theme.space.small,
12
+ footerPaddingHorizontal: theme.space.large,
13
+ footerPaddingVertical: theme.space.medium,
14
+ footerMarginBottom: theme.space.large,
12
15
  };
13
16
 
14
17
  const sizes = {
@@ -22,7 +25,7 @@ const getCarouselTheme = (theme: GlobalTheme) => {
22
25
  };
23
26
 
24
27
  const fontSizes = {
25
- heading: theme.fontSizes.xxxxxlarge,
28
+ heading: theme.fontSizes['6xlarge'],
26
29
  };
27
30
 
28
31
  const fonts = {
@@ -30,7 +33,7 @@ const getCarouselTheme = (theme: GlobalTheme) => {
30
33
  };
31
34
 
32
35
  const lineHeights = {
33
- heading: theme.lineHeights.xxxlarge,
36
+ heading: theme.lineHeights['6xlarge'],
34
37
  };
35
38
 
36
39
  return { colors, sizes, radii, space, fonts, fontSizes, lineHeights };
@@ -20,6 +20,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
20
20
  xlarge: theme.fontSizes.xlarge,
21
21
  xxxlarge: theme.fontSizes.xxxlarge,
22
22
  xxxxxlarge: theme.fontSizes.xxxxxlarge,
23
+ '6xlarge': theme.fontSizes['6xlarge'],
23
24
  '7xlarge': theme.fontSizes['7xlarge'],
24
25
  };
25
26
 
@@ -30,6 +31,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
30
31
  xlarge: theme.lineHeights.xlarge,
31
32
  xxxlarge: theme.lineHeights.xxxlarge,
32
33
  xxxxxlarge: theme.lineHeights.xxxxxlarge,
34
+ '6xlarge': theme.lineHeights['6xlarge'],
33
35
  '7xlarge': theme.lineHeights['7xlarge'],
34
36
  };
35
37
 
@@ -13,6 +13,7 @@ interface Fonts {
13
13
 
14
14
  interface FontSizes {
15
15
  '7xlarge': number;
16
+ '6xlarge': number;
16
17
  xxxxxlarge: number;
17
18
  xxxxlarge: number;
18
19
  xxxlarge: number;
@@ -62,6 +63,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
62
63
  });
63
64
  return {
64
65
  '7xlarge': scale(fontSizes[10]), // 42
66
+ '6xlarge': scale(fontSizes[9]), // 36
65
67
  xxxxxlarge: scale(fontSizes[8]), // 32
66
68
  xxxxlarge: scale(fontSizes[7]), // 28
67
69
  xxxlarge: scale(fontSizes[6]), // 24
@@ -78,6 +80,7 @@ const getLineHeights = (fontSizes: FontSizes): LineHeights => {
78
80
  const additionalSpace = 8;
79
81
  return {
80
82
  '7xlarge': fontSizes['7xlarge'] + additionalSpace,
83
+ '6xlarge': fontSizes['6xlarge'] + additionalSpace,
81
84
  xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
82
85
  xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
83
86
  xxxlarge: fontSizes.xxxlarge + additionalSpace,
@@ -1,7 +1,6 @@
1
1
  import { CarouselData } from './types';
2
2
  interface CarouselItemProps extends Omit<CarouselData, 'background'> {
3
3
  width: number;
4
- minHeight: number;
5
4
  }
6
- declare const CarouselItem: ({ width, image, content, heading, body, minHeight, }: CarouselItemProps) => JSX.Element;
5
+ declare const CarouselItem: ({ width, image, content, heading, body, }: CarouselItemProps) => JSX.Element;
7
6
  export default CarouselItem;
@@ -10,7 +10,5 @@ declare const StyledCarouselPaginatorAnimatedView: import("@emotion/native").Sty
10
10
  } & {
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
12
  as?: import("react").ElementType<any> | undefined;
13
- } & {
14
- indicatorWidth: Animated.AnimatedInterpolation;
15
13
  }, {}, {}>;
16
14
  export { StyledCarouselPaginator, StyledCarouselPaginatorAnimatedView };
@@ -1,5 +1,5 @@
1
1
  import { View } from 'react-native';
2
- declare const StyledCarousel: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
2
+ declare const StyledBackDrop: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any> | undefined;
5
5
  } & {
@@ -27,8 +27,10 @@ declare const StyledCarouselContentWrapper: import("@emotion/native").StyledComp
27
27
  } & {
28
28
  width: number;
29
29
  }, {}, {}>;
30
- declare const StyledCarouselFooterWrapper: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
30
+ declare const StyledCarouselFooterWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
31
31
  theme?: import("@emotion/react").Theme | undefined;
32
32
  as?: import("react").ElementType<any> | undefined;
33
- }, {}, {}>;
34
- export { StyledCarousel, StyledCarouselView, StyledCarouselHeading, StyledCarouselImage, StyledCarouselContentWrapper, StyledCarouselFooterWrapper, };
33
+ }, {}, {
34
+ ref?: import("react").Ref<View> | undefined;
35
+ }>;
36
+ export { StyledBackDrop, StyledCarouselView, StyledCarouselHeading, StyledCarouselImage, StyledCarouselContentWrapper, StyledCarouselFooterWrapper, };
@@ -1,3 +1,4 @@
1
+ import { Dispatch, SetStateAction } from 'react';
1
2
  import { StyleProp, ViewProps, ViewStyle } from 'react-native';
2
3
  import { CarouselData } from './types';
3
4
  interface CarouselProps extends ViewProps {
@@ -10,37 +11,22 @@ interface CarouselProps extends ViewProps {
10
11
  */
11
12
  testID?: string;
12
13
  /**
13
- * Callback to be called when the user slides to the next slide.
14
+ * onItemIndexChange event handler receiving index of selected Item.
14
15
  */
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;
16
+ onItemIndexChange?: Dispatch<SetStateAction<number>>;
24
17
  /**
25
18
  * Carousel data.
26
19
  */
27
20
  items: CarouselData[];
28
21
  /**
29
- * Finish button label.
30
- */
31
- finishButtonLabel?: string;
32
- /**
33
- * Skip button label.
34
- */
35
- skipButtonLabel?: string;
36
- /**
37
- * Footer height.
22
+ * Render action elements function.
38
23
  */
39
- footerHeight?: number;
24
+ renderActions?: (pageIndex: number) => JSX.Element;
40
25
  /**
41
- * Min content height.
26
+ * Current selected item index.
42
27
  */
43
- minContentHeight?: number;
28
+ selectedItemIndex?: number;
44
29
  }
45
- declare const Carousel: ({ items, onFinishPress, onSkipPress, onSlideChange, finishButtonLabel, skipButtonLabel, footerHeight, minContentHeight, ...nativeProps }: CarouselProps) => JSX.Element;
30
+ export declare function useStateFromProp<T>(initialValue: T): [T, Dispatch<SetStateAction<T>>];
31
+ declare const Carousel: ({ items, onItemIndexChange, renderActions, selectedItemIndex, style, ...nativeProps }: CarouselProps) => JSX.Element;
46
32
  export default Carousel;
@@ -83,5 +83,5 @@ export declare const getVariant: ({ disabled, error, editable, loading, isEmptyV
83
83
  isFocused?: boolean | undefined;
84
84
  isEmptyValue?: boolean | undefined;
85
85
  }) => Variant;
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;
86
+ declare const TextInput: 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 TextInput;
@@ -3,7 +3,7 @@ declare const StyledText: 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
- themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxxlarge' | '7xlarge';
6
+ themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
7
7
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
8
8
  themeIntent: 'body' | 'subdued' | 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'inverted';
9
9
  themeTypeface: 'neutral' | 'playful';
@@ -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' | 'xxxlarge' | 'xxxxxlarge' | '7xlarge';
11
+ fontSize?: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxlarge' | 'xxxxxlarge' | '6xlarge' | '7xlarge';
12
12
  /**
13
13
  * Font weight of the text.
14
14
  */
@@ -15,6 +15,9 @@ declare const getCarouselTheme: (theme: GlobalTheme) => {
15
15
  headingMarginTop: number;
16
16
  headingMarginBottom: number;
17
17
  paginatorMarginHorizontal: number;
18
+ footerPaddingHorizontal: number;
19
+ footerPaddingVertical: number;
20
+ footerMarginBottom: number;
18
21
  };
19
22
  fonts: {
20
23
  heading: string;
@@ -19,6 +19,7 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
19
19
  xlarge: number;
20
20
  xxxlarge: number;
21
21
  xxxxxlarge: number;
22
+ '6xlarge': number;
22
23
  '7xlarge': number;
23
24
  };
24
25
  lineHeights: {
@@ -28,6 +29,7 @@ declare const getTypographyTheme: (theme: GlobalTheme) => {
28
29
  xlarge: number;
29
30
  xxxlarge: number;
30
31
  xxxxxlarge: number;
32
+ '6xlarge': number;
31
33
  '7xlarge': number;
32
34
  };
33
35
  };
@@ -9,6 +9,7 @@ interface Fonts {
9
9
  }
10
10
  interface FontSizes {
11
11
  '7xlarge': number;
12
+ '6xlarge': number;
12
13
  xxxxxlarge: number;
13
14
  xxxxlarge: number;
14
15
  xxxlarge: number;