@hero-design/rn 8.12.1 → 8.12.3

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 (41) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/es/index.js +102 -46
  3. package/lib/index.js +101 -45
  4. package/package.json +5 -5
  5. package/src/components/Button/Button.tsx +42 -2
  6. package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +1 -1
  7. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +1 -1
  8. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  9. package/src/components/Button/StyledButton.tsx +21 -14
  10. package/src/components/Button/__tests__/Button.spec.tsx +46 -1
  11. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +1564 -0
  12. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +126 -110
  13. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +24 -22
  14. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +12 -9
  15. package/src/components/FAB/ActionGroup/ActionItem.tsx +17 -6
  16. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +15 -17
  17. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +170 -160
  18. package/src/components/FAB/FAB.tsx +3 -1
  19. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +36 -27
  20. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  21. package/src/components/Tabs/__tests__/index.spec.tsx +5 -5
  22. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +12 -9
  23. package/src/components/Typography/Text/StyledText.tsx +1 -0
  24. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  25. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +23 -0
  26. package/src/components/Typography/Text/index.tsx +1 -0
  27. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +19 -0
  28. package/src/theme/components/button.ts +16 -2
  29. package/src/theme/components/fab.ts +2 -0
  30. package/src/theme/components/typography.ts +2 -0
  31. package/src/theme/global/borders.ts +2 -0
  32. package/src/theme/global/colors/__tests__/__snapshots__/eBens.spec.ts.snap +4 -4
  33. package/types/components/Button/Button.d.ts +1 -1
  34. package/types/components/Button/StyledButton.d.ts +4 -3
  35. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -3
  36. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  37. package/types/components/Typography/Text/index.d.ts +1 -1
  38. package/types/theme/components/button.d.ts +14 -0
  39. package/types/theme/components/fab.d.ts +2 -0
  40. package/types/theme/components/typography.d.ts +2 -0
  41. package/types/theme/global/borders.d.ts +1 -0
@@ -1,9 +1,9 @@
1
- @hero-design/rn:build: cache hit, replaying output 11519c5263d6ba02
2
- @hero-design/rn:build: $ yarn build:js && yarn build:types
3
- @hero-design/rn:build: $ rollup -c
4
- @hero-design/rn:build: 
5
- @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
- @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
- @hero-design/rn:build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
8
- @hero-design/rn:build: created lib/index.js, es/index.js in 31.5s
9
- @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
1
+ @hero-design/rn:build: cache hit, replaying output eea1c2ee08c7c3cf
2
+ @hero-design/rn:build: $ yarn build:js && yarn build:types
3
+ @hero-design/rn:build: $ rollup -c
4
+ @hero-design/rn:build: 
5
+ @hero-design/rn:build: src/index.ts → lib/index.js, es/index.js...
6
+ @hero-design/rn:build: (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
7
+ @hero-design/rn:build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
8
+ @hero-design/rn:build: created lib/index.js, es/index.js in 31.1s
9
+ @hero-design/rn:build: $ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as reactNative from 'react-native';
2
- import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, ScrollView, Modal, FlatList, useWindowDimensions, TextInput as TextInput$1, PanResponder, TouchableHighlight, InteractionManager, Keyboard, SectionList, LayoutAnimation, RefreshControl as RefreshControl$1 } from 'react-native';
2
+ import { Platform, Dimensions, StyleSheet as StyleSheet$1, Animated, View, Easing, TouchableOpacity, Text as Text$1, Image as Image$1, TouchableWithoutFeedback, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, Modal, FlatList, useWindowDimensions, TextInput as TextInput$1, PanResponder, InteractionManager, Keyboard, SectionList, LayoutAnimation, RefreshControl as RefreshControl$1 } from 'react-native';
3
3
  import React, { useContext, createContext, createElement, useMemo, forwardRef, useEffect, useCallback, useRef, useState, useLayoutEffect, useImperativeHandle } from 'react';
4
4
  import { createIconSet } from 'react-native-vector-icons';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -969,7 +969,7 @@ var blue$1 = colorScales.blue,
969
969
  purple$1 = colorScales.purple,
970
970
  vermilion$3 = colorScales.vermilion,
971
971
  smalt = colorScales.smalt,
972
- violet$2 = colorScales.violet,
972
+ violet$1 = colorScales.violet,
973
973
  yellow$1 = colorScales.yellow;
974
974
  ({
975
975
  black: '#000000',
@@ -1042,16 +1042,16 @@ var blue$1 = colorScales.blue,
1042
1042
  smaltLight45: smalt.lighten45,
1043
1043
  smaltLight75: smalt.lighten75,
1044
1044
  smaltLight90: smalt.lighten90,
1045
- violet: violet$2.base,
1046
- violetDark15: violet$2.darken15,
1047
- violetDark30: violet$2.darken30,
1048
- violetDark45: violet$2.darken45,
1049
- violetDark60: violet$2.darken60,
1050
- violetDark75: violet$2.darken75,
1051
- violetLight30: violet$2.lighten30,
1052
- violetLight60: violet$2.lighten60,
1053
- violetLight75: violet$2.lighten75,
1054
- violetLight90: violet$2.lighten90,
1045
+ violet: violet$1.base,
1046
+ violetDark15: violet$1.darken15,
1047
+ violetDark30: violet$1.darken30,
1048
+ violetDark45: violet$1.darken45,
1049
+ violetDark60: violet$1.darken60,
1050
+ violetDark75: violet$1.darken75,
1051
+ violetLight30: violet$1.lighten30,
1052
+ violetLight60: violet$1.lighten60,
1053
+ violetLight75: violet$1.lighten75,
1054
+ violetLight90: violet$1.lighten90,
1055
1055
  yellow: yellow$1.base,
1056
1056
  yellowDark15: yellow$1.darken15,
1057
1057
  yellowDark75: yellow$1.darken75,
@@ -1191,8 +1191,8 @@ var currant$1 = colorScales.currant,
1191
1191
  pastelRed = colorScales.pastelRed,
1192
1192
  vermilion = colorScales.vermilion,
1193
1193
  mauve$3 = colorScales.mauve,
1194
- violet1$2 = colorScales.violet1,
1195
- violet$1 = colorScales.violet,
1194
+ violet1$3 = colorScales.violet1,
1195
+ violet$2 = colorScales.violet,
1196
1196
  scarletGum$2 = colorScales.scarletGum;
1197
1197
  var palette$6 = {
1198
1198
  currant: currant$1.base,
@@ -1211,18 +1211,18 @@ var palette$6 = {
1211
1211
  pastelRed: pastelRed.base,
1212
1212
  vermilion: vermilion.base,
1213
1213
  mauve: mauve$3.base,
1214
- violetLight30: violet$1.lighten30,
1215
- violet1: violet1$2.base,
1216
- violet: violet$1.base,
1214
+ violetLight30: violet$2.lighten30,
1215
+ violet1: violet1$3.base,
1216
+ violet: violet$2.base,
1217
1217
  scarletGum: scarletGum$2.base
1218
1218
  };
1219
- var violet$3 = colorScales.violet,
1219
+ var violet1$2 = colorScales.violet1,
1220
1220
  mauve$2 = colorScales.mauve;
1221
1221
  var palette$5 = Object.assign(Object.assign({}, palette$8), {
1222
- violet: violet$3.base,
1223
- violetLight20: violet$3.lighten20,
1224
- violetLight30: violet$3.lighten30,
1225
- violetLight90: violet$3.lighten90,
1222
+ violet: violet1$2.base,
1223
+ violetLight20: violet1$2.lighten20,
1224
+ violetLight30: violet1$2.lighten30,
1225
+ violetLight90: violet1$2.lighten90,
1226
1226
  mauve: mauve$2.base,
1227
1227
  mauveLight80: mauve$2.lighten80
1228
1228
  });
@@ -1590,7 +1590,8 @@ var getRadii = function getRadii(baseRadius) {
1590
1590
  large: baseRadius * 3,
1591
1591
  xlarge: baseRadius * 4,
1592
1592
  xxlarge: baseRadius * 5,
1593
- xxxlarge: baseRadius * 6 // 24
1593
+ xxxlarge: baseRadius * 6,
1594
+ '5xlarge': baseRadius * 8 // 32
1594
1595
  };
1595
1596
  };
1596
1597
 
@@ -1853,6 +1854,7 @@ var getButtonTheme = function getButtonTheme(theme) {
1853
1854
  };
1854
1855
  var space = {
1855
1856
  buttonPadding: theme.space.medium,
1857
+ textButtonPadding: theme.space.smallMedium,
1856
1858
  iconPadding: theme.space.smallMedium,
1857
1859
  utilityPadding: theme.space.small
1858
1860
  };
@@ -1860,8 +1862,9 @@ var getButtonTheme = function getButtonTheme(theme) {
1860
1862
  iconSize: theme.fontSizes.xxlarge
1861
1863
  };
1862
1864
  var radii = {
1863
- "default": theme.space.xlarge,
1864
- utilityRadii: theme.space.small
1865
+ "default": theme.radii['5xlarge'],
1866
+ utilityRadii: theme.radii.medium,
1867
+ text: theme.radii.base
1865
1868
  };
1866
1869
  var colors = {
1867
1870
  primary: theme.colors.primary,
@@ -1872,7 +1875,19 @@ var getButtonTheme = function getButtonTheme(theme) {
1872
1875
  disabledBorder: theme.colors.disabledOnDefaultGlobalSurface,
1873
1876
  disabledBackground: theme.colors.disabledOnDefaultGlobalSurface,
1874
1877
  invertedText: theme.colors.onDarkGlobalSurface,
1875
- utilityBackground: theme.colors.neutralGlobalSurface
1878
+ utilityBackground: theme.colors.neutralGlobalSurface,
1879
+ textLoadingBackground: theme.colors.highlightedSurface,
1880
+ pressedBackground: {
1881
+ filledPrimary: theme.colors.pressedSurface,
1882
+ filledSecondary: theme.colors.pressedSurface,
1883
+ filledDanger: theme.colors.errorSurface,
1884
+ outlinedPrimary: theme.colors.highlightedSurface,
1885
+ outlinedSecondary: theme.colors.highlightedSurface,
1886
+ outlineDanger: theme.colors.errorSurface,
1887
+ textPrimary: theme.colors.highlightedSurface,
1888
+ textSecondary: theme.colors.highlightedSurface,
1889
+ textDanger: theme.colors.errorSurface
1890
+ }
1876
1891
  };
1877
1892
  return {
1878
1893
  borderWidth: borderWidth,
@@ -2137,9 +2152,11 @@ var getEmptyTheme = function getEmptyTheme(theme) {
2137
2152
  var getFABTheme = function getFABTheme(theme) {
2138
2153
  var colors = {
2139
2154
  buttonBackground: theme.colors.primary,
2155
+ buttonPressedBackground: theme.colors.pressedSurface,
2140
2156
  icon: theme.colors.onPrimary,
2141
2157
  headerText: theme.colors.onDefaultGlobalSurface,
2142
2158
  actionItemBackground: theme.colors.primary,
2159
+ actionItemPressedBackground: theme.colors.pressedSurface,
2143
2160
  backdropBackground: theme.colors.overlayGlobalSurface,
2144
2161
  titleText: theme.colors.onPrimary,
2145
2162
  actionItemText: theme.colors.onPrimary
@@ -2852,6 +2869,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2852
2869
  archived: theme.colors.onArchivedSurface
2853
2870
  };
2854
2871
  var fontSizes = {
2872
+ xsmall: theme.fontSizes.xsmall,
2855
2873
  small: theme.fontSizes.small,
2856
2874
  medium: theme.fontSizes.medium,
2857
2875
  large: theme.fontSizes.large,
@@ -2863,6 +2881,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2863
2881
  '7xlarge': theme.fontSizes['7xlarge']
2864
2882
  };
2865
2883
  var lineHeights = {
2884
+ xsmall: theme.lineHeights.xsmall,
2866
2885
  small: theme.lineHeights.small,
2867
2886
  medium: theme.lineHeights.medium,
2868
2887
  large: theme.lineHeights.large,
@@ -7343,8 +7362,8 @@ var StyledLoadingDot = index$a(View)(function (_ref2) {
7343
7362
  backgroundColor: theme.__hd__.button.colors.invertedText
7344
7363
  };
7345
7364
  case 'outlined-primary':
7346
- case 'text-primary':
7347
7365
  return genLoadingIndicatorStyles(theme, 'primary');
7366
+ case 'text-primary':
7348
7367
  case 'outlined-secondary':
7349
7368
  case 'text-secondary':
7350
7369
  return genLoadingIndicatorStyles(theme, 'secondary');
@@ -7426,9 +7445,9 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
7426
7445
  }, nativeProps), Array.from(new Array(count), renderLoadingDot, themeVariant));
7427
7446
  };
7428
7447
 
7429
- var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, disabled) {
7448
+ var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, disabled, loading) {
7430
7449
  var backgroundColorStyling = function backgroundColorStyling() {
7431
- if (disabled) {
7450
+ if (!loading && disabled) {
7432
7451
  return {
7433
7452
  backgroundColor: theme.__hd__.button.colors.disabledBorder
7434
7453
  };
@@ -7446,9 +7465,9 @@ var genFilledContainerStyles = function genFilledContainerStyles(theme, intent,
7446
7465
  borderRadius: theme.__hd__.button.radii["default"]
7447
7466
  }, backgroundColorStyling());
7448
7467
  };
7449
- var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, disabled) {
7468
+ var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, disabled, loading) {
7450
7469
  var borderColorStyling = function borderColorStyling() {
7451
- if (disabled) {
7470
+ if (!loading && disabled) {
7452
7471
  return {
7453
7472
  borderColor: theme.__hd__.button.colors.disabledBorder
7454
7473
  };
@@ -7500,33 +7519,37 @@ var genTextVariantTextStyles = function genTextVariantTextStyles(theme, intent,
7500
7519
  lineHeight: theme.__hd__.button.lineHeight["default"]
7501
7520
  }, textColorStyling());
7502
7521
  };
7503
- var StyledButtonContainer = index$a(TouchableOpacity)(function (_ref) {
7522
+ var StyledButtonContainer = index$a(TouchableHighlight)(function (_ref) {
7504
7523
  var _ref$disabled = _ref.disabled,
7505
7524
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
7525
+ _ref$loading = _ref.loading,
7526
+ loading = _ref$loading === void 0 ? false : _ref$loading,
7506
7527
  themeVariant = _ref.themeVariant,
7507
7528
  theme = _ref.theme;
7508
7529
  switch (themeVariant) {
7509
7530
  case 'filled-primary':
7510
- return genFilledContainerStyles(theme, 'primary', disabled);
7531
+ return genFilledContainerStyles(theme, 'primary', disabled, loading);
7511
7532
  case 'filled-secondary':
7512
- return genFilledContainerStyles(theme, 'secondary', disabled);
7533
+ return genFilledContainerStyles(theme, 'secondary', disabled, loading);
7513
7534
  case 'filled-danger':
7514
- return genFilledContainerStyles(theme, 'danger', disabled);
7535
+ return genFilledContainerStyles(theme, 'danger', disabled, loading);
7515
7536
  case 'outlined-primary':
7516
- return genOutlineContainerStyles(theme, 'primary', disabled);
7537
+ return genOutlineContainerStyles(theme, 'primary', disabled, loading);
7517
7538
  case 'outlined-secondary':
7518
- return genOutlineContainerStyles(theme, 'secondary', disabled);
7539
+ return genOutlineContainerStyles(theme, 'secondary', disabled, loading);
7519
7540
  case 'outlined-danger':
7520
- return genOutlineContainerStyles(theme, 'danger', disabled);
7541
+ return genOutlineContainerStyles(theme, 'danger', disabled, loading);
7521
7542
  case 'text-primary':
7522
7543
  case 'text-secondary':
7523
7544
  case 'text-danger':
7524
7545
  return {
7546
+ borderRadius: theme.__hd__.button.radii.text,
7525
7547
  flexDirection: 'row',
7526
7548
  justifyContent: 'center',
7527
7549
  alignItems: 'center',
7528
- padding: theme.__hd__.button.space.buttonPadding,
7529
- borderWidth: 0
7550
+ padding: theme.__hd__.button.space.textButtonPadding,
7551
+ borderWidth: 0,
7552
+ backgroundColor: loading ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
7530
7553
  };
7531
7554
  }
7532
7555
  });
@@ -7634,6 +7657,29 @@ var getThemeVariant = function getThemeVariant(variant, intent) {
7634
7657
  return TEXT_VARIANTS[intent];
7635
7658
  }
7636
7659
  };
7660
+ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
7661
+ switch (themeVariant) {
7662
+ case 'filled-primary':
7663
+ return theme.__hd__.button.colors.pressedBackground.filledPrimary;
7664
+ case 'filled-secondary':
7665
+ return theme.__hd__.button.colors.pressedBackground.filledSecondary;
7666
+ case 'filled-danger':
7667
+ return theme.__hd__.button.colors.pressedBackground.filledDanger;
7668
+ case 'outlined-primary':
7669
+ return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
7670
+ case 'outlined-secondary':
7671
+ return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
7672
+ case 'outlined-danger':
7673
+ return theme.__hd__.button.colors.pressedBackground.outlineDanger;
7674
+ case 'text-primary':
7675
+ return theme.__hd__.button.colors.pressedBackground.textPrimary;
7676
+ case 'text-secondary':
7677
+ return theme.__hd__.button.colors.pressedBackground.textSecondary;
7678
+ case 'text-danger':
7679
+ return theme.__hd__.button.colors.pressedBackground.textDanger;
7680
+ }
7681
+ };
7682
+ var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
7637
7683
  var Button = function Button(_ref) {
7638
7684
  var accessibilityHint = _ref.accessibilityHint,
7639
7685
  accessibilityLabel = _ref.accessibilityLabel,
@@ -7652,14 +7698,21 @@ var Button = function Button(_ref) {
7652
7698
  _ref$variant = _ref.variant,
7653
7699
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
7654
7700
  var themeVariant = getThemeVariant(variant, intent);
7701
+ var theme = useTheme();
7702
+ var underlayColor = useMemo(function () {
7703
+ return getUnderlayColor(theme, themeVariant);
7704
+ }, [theme, themeVariant]);
7705
+ useDeprecation("Button variant ".concat(deprecatedVariants.join(', '), " are deprecated."), deprecatedVariants.includes(themeVariant));
7655
7706
  return /*#__PURE__*/React.createElement(StyledButtonContainer, {
7656
7707
  accessibilityHint: accessibilityHint,
7657
7708
  accessibilityLabel: accessibilityLabel,
7658
7709
  disabled: disabled || loading,
7710
+ loading: loading,
7659
7711
  onPress: onPress,
7660
7712
  testID: testID,
7661
7713
  themeVariant: themeVariant,
7662
- style: style
7714
+ style: style,
7715
+ underlayColor: underlayColor
7663
7716
  }, loading === true ? /*#__PURE__*/React.createElement(LoadingIndicator, {
7664
7717
  testID: "".concat(testID, "-loading-indicator"),
7665
7718
  themeVariant: themeVariant
@@ -12278,11 +12331,12 @@ var FAB = function FAB(_ref3) {
12278
12331
  active = _ref3.active,
12279
12332
  style = _ref3.style;
12280
12333
  var isIconOnly = !title;
12334
+ var theme = useTheme();
12281
12335
  return /*#__PURE__*/React.createElement(StyledFABContainer, {
12336
+ underlayColor: theme.__hd__.fab.colors.buttonPressedBackground,
12282
12337
  testID: testID,
12283
12338
  style: style,
12284
- onPress: onPress,
12285
- activeOpacity: 0.6
12339
+ onPress: onPress
12286
12340
  }, isIconOnly ? /*#__PURE__*/React.createElement(IconOnlyContent, {
12287
12341
  animated: animated,
12288
12342
  active: active,
@@ -12293,7 +12347,7 @@ var FAB = function FAB(_ref3) {
12293
12347
  }));
12294
12348
  };
12295
12349
 
12296
- var StyledActionItem = index$a(TouchableOpacity)(function (_ref) {
12350
+ var StyledActionItem = index$a(TouchableHighlight)(function (_ref) {
12297
12351
  var theme = _ref.theme;
12298
12352
  return {
12299
12353
  paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
@@ -12333,13 +12387,15 @@ var ActionItem = function ActionItem(_ref) {
12333
12387
  onPress = _ref.onPress,
12334
12388
  style = _ref.style,
12335
12389
  testID = _ref.testID;
12390
+ var theme = useTheme();
12336
12391
  return /*#__PURE__*/React.createElement(StyledActionItem, {
12392
+ underlayColor: theme.__hd__.fab.colors.actionItemPressedBackground,
12337
12393
  style: style,
12338
12394
  onPress: onPress,
12339
12395
  testID: testID
12340
- }, /*#__PURE__*/React.createElement(StyledIcon, {
12396
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledIcon, {
12341
12397
  icon: icon
12342
- }), /*#__PURE__*/React.createElement(StyledActionItemText, null, title));
12398
+ }), /*#__PURE__*/React.createElement(StyledActionItemText, null, title)));
12343
12399
  };
12344
12400
 
12345
12401
  var StyledContainer$1 = index$a(View)({
package/lib/index.js CHANGED
@@ -998,7 +998,7 @@ var blue$1 = colorScales.blue,
998
998
  purple$1 = colorScales.purple,
999
999
  vermilion$3 = colorScales.vermilion,
1000
1000
  smalt = colorScales.smalt,
1001
- violet$2 = colorScales.violet,
1001
+ violet$1 = colorScales.violet,
1002
1002
  yellow$1 = colorScales.yellow;
1003
1003
  ({
1004
1004
  black: '#000000',
@@ -1071,16 +1071,16 @@ var blue$1 = colorScales.blue,
1071
1071
  smaltLight45: smalt.lighten45,
1072
1072
  smaltLight75: smalt.lighten75,
1073
1073
  smaltLight90: smalt.lighten90,
1074
- violet: violet$2.base,
1075
- violetDark15: violet$2.darken15,
1076
- violetDark30: violet$2.darken30,
1077
- violetDark45: violet$2.darken45,
1078
- violetDark60: violet$2.darken60,
1079
- violetDark75: violet$2.darken75,
1080
- violetLight30: violet$2.lighten30,
1081
- violetLight60: violet$2.lighten60,
1082
- violetLight75: violet$2.lighten75,
1083
- violetLight90: violet$2.lighten90,
1074
+ violet: violet$1.base,
1075
+ violetDark15: violet$1.darken15,
1076
+ violetDark30: violet$1.darken30,
1077
+ violetDark45: violet$1.darken45,
1078
+ violetDark60: violet$1.darken60,
1079
+ violetDark75: violet$1.darken75,
1080
+ violetLight30: violet$1.lighten30,
1081
+ violetLight60: violet$1.lighten60,
1082
+ violetLight75: violet$1.lighten75,
1083
+ violetLight90: violet$1.lighten90,
1084
1084
  yellow: yellow$1.base,
1085
1085
  yellowDark15: yellow$1.darken15,
1086
1086
  yellowDark75: yellow$1.darken75,
@@ -1220,8 +1220,8 @@ var currant$1 = colorScales.currant,
1220
1220
  pastelRed = colorScales.pastelRed,
1221
1221
  vermilion = colorScales.vermilion,
1222
1222
  mauve$3 = colorScales.mauve,
1223
- violet1$2 = colorScales.violet1,
1224
- violet$1 = colorScales.violet,
1223
+ violet1$3 = colorScales.violet1,
1224
+ violet$2 = colorScales.violet,
1225
1225
  scarletGum$2 = colorScales.scarletGum;
1226
1226
  var palette$6 = {
1227
1227
  currant: currant$1.base,
@@ -1240,18 +1240,18 @@ var palette$6 = {
1240
1240
  pastelRed: pastelRed.base,
1241
1241
  vermilion: vermilion.base,
1242
1242
  mauve: mauve$3.base,
1243
- violetLight30: violet$1.lighten30,
1244
- violet1: violet1$2.base,
1245
- violet: violet$1.base,
1243
+ violetLight30: violet$2.lighten30,
1244
+ violet1: violet1$3.base,
1245
+ violet: violet$2.base,
1246
1246
  scarletGum: scarletGum$2.base
1247
1247
  };
1248
- var violet$3 = colorScales.violet,
1248
+ var violet1$2 = colorScales.violet1,
1249
1249
  mauve$2 = colorScales.mauve;
1250
1250
  var palette$5 = Object.assign(Object.assign({}, palette$8), {
1251
- violet: violet$3.base,
1252
- violetLight20: violet$3.lighten20,
1253
- violetLight30: violet$3.lighten30,
1254
- violetLight90: violet$3.lighten90,
1251
+ violet: violet1$2.base,
1252
+ violetLight20: violet1$2.lighten20,
1253
+ violetLight30: violet1$2.lighten30,
1254
+ violetLight90: violet1$2.lighten90,
1255
1255
  mauve: mauve$2.base,
1256
1256
  mauveLight80: mauve$2.lighten80
1257
1257
  });
@@ -1619,7 +1619,8 @@ var getRadii = function getRadii(baseRadius) {
1619
1619
  large: baseRadius * 3,
1620
1620
  xlarge: baseRadius * 4,
1621
1621
  xxlarge: baseRadius * 5,
1622
- xxxlarge: baseRadius * 6 // 24
1622
+ xxxlarge: baseRadius * 6,
1623
+ '5xlarge': baseRadius * 8 // 32
1623
1624
  };
1624
1625
  };
1625
1626
 
@@ -1882,6 +1883,7 @@ var getButtonTheme = function getButtonTheme(theme) {
1882
1883
  };
1883
1884
  var space = {
1884
1885
  buttonPadding: theme.space.medium,
1886
+ textButtonPadding: theme.space.smallMedium,
1885
1887
  iconPadding: theme.space.smallMedium,
1886
1888
  utilityPadding: theme.space.small
1887
1889
  };
@@ -1889,8 +1891,9 @@ var getButtonTheme = function getButtonTheme(theme) {
1889
1891
  iconSize: theme.fontSizes.xxlarge
1890
1892
  };
1891
1893
  var radii = {
1892
- "default": theme.space.xlarge,
1893
- utilityRadii: theme.space.small
1894
+ "default": theme.radii['5xlarge'],
1895
+ utilityRadii: theme.radii.medium,
1896
+ text: theme.radii.base
1894
1897
  };
1895
1898
  var colors = {
1896
1899
  primary: theme.colors.primary,
@@ -1901,7 +1904,19 @@ var getButtonTheme = function getButtonTheme(theme) {
1901
1904
  disabledBorder: theme.colors.disabledOnDefaultGlobalSurface,
1902
1905
  disabledBackground: theme.colors.disabledOnDefaultGlobalSurface,
1903
1906
  invertedText: theme.colors.onDarkGlobalSurface,
1904
- utilityBackground: theme.colors.neutralGlobalSurface
1907
+ utilityBackground: theme.colors.neutralGlobalSurface,
1908
+ textLoadingBackground: theme.colors.highlightedSurface,
1909
+ pressedBackground: {
1910
+ filledPrimary: theme.colors.pressedSurface,
1911
+ filledSecondary: theme.colors.pressedSurface,
1912
+ filledDanger: theme.colors.errorSurface,
1913
+ outlinedPrimary: theme.colors.highlightedSurface,
1914
+ outlinedSecondary: theme.colors.highlightedSurface,
1915
+ outlineDanger: theme.colors.errorSurface,
1916
+ textPrimary: theme.colors.highlightedSurface,
1917
+ textSecondary: theme.colors.highlightedSurface,
1918
+ textDanger: theme.colors.errorSurface
1919
+ }
1905
1920
  };
1906
1921
  return {
1907
1922
  borderWidth: borderWidth,
@@ -2166,9 +2181,11 @@ var getEmptyTheme = function getEmptyTheme(theme) {
2166
2181
  var getFABTheme = function getFABTheme(theme) {
2167
2182
  var colors = {
2168
2183
  buttonBackground: theme.colors.primary,
2184
+ buttonPressedBackground: theme.colors.pressedSurface,
2169
2185
  icon: theme.colors.onPrimary,
2170
2186
  headerText: theme.colors.onDefaultGlobalSurface,
2171
2187
  actionItemBackground: theme.colors.primary,
2188
+ actionItemPressedBackground: theme.colors.pressedSurface,
2172
2189
  backdropBackground: theme.colors.overlayGlobalSurface,
2173
2190
  titleText: theme.colors.onPrimary,
2174
2191
  actionItemText: theme.colors.onPrimary
@@ -2881,6 +2898,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2881
2898
  archived: theme.colors.onArchivedSurface
2882
2899
  };
2883
2900
  var fontSizes = {
2901
+ xsmall: theme.fontSizes.xsmall,
2884
2902
  small: theme.fontSizes.small,
2885
2903
  medium: theme.fontSizes.medium,
2886
2904
  large: theme.fontSizes.large,
@@ -2892,6 +2910,7 @@ var getTypographyTheme = function getTypographyTheme(theme) {
2892
2910
  '7xlarge': theme.fontSizes['7xlarge']
2893
2911
  };
2894
2912
  var lineHeights = {
2913
+ xsmall: theme.lineHeights.xsmall,
2895
2914
  small: theme.lineHeights.small,
2896
2915
  medium: theme.lineHeights.medium,
2897
2916
  large: theme.lineHeights.large,
@@ -7372,8 +7391,8 @@ var StyledLoadingDot = index$a(reactNative.View)(function (_ref2) {
7372
7391
  backgroundColor: theme.__hd__.button.colors.invertedText
7373
7392
  };
7374
7393
  case 'outlined-primary':
7375
- case 'text-primary':
7376
7394
  return genLoadingIndicatorStyles(theme, 'primary');
7395
+ case 'text-primary':
7377
7396
  case 'outlined-secondary':
7378
7397
  case 'text-secondary':
7379
7398
  return genLoadingIndicatorStyles(theme, 'secondary');
@@ -7455,9 +7474,9 @@ var LoadingIndicator = function LoadingIndicator(_ref2) {
7455
7474
  }, nativeProps), Array.from(new Array(count), renderLoadingDot, themeVariant));
7456
7475
  };
7457
7476
 
7458
- var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, disabled) {
7477
+ var genFilledContainerStyles = function genFilledContainerStyles(theme, intent, disabled, loading) {
7459
7478
  var backgroundColorStyling = function backgroundColorStyling() {
7460
- if (disabled) {
7479
+ if (!loading && disabled) {
7461
7480
  return {
7462
7481
  backgroundColor: theme.__hd__.button.colors.disabledBorder
7463
7482
  };
@@ -7475,9 +7494,9 @@ var genFilledContainerStyles = function genFilledContainerStyles(theme, intent,
7475
7494
  borderRadius: theme.__hd__.button.radii["default"]
7476
7495
  }, backgroundColorStyling());
7477
7496
  };
7478
- var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, disabled) {
7497
+ var genOutlineContainerStyles = function genOutlineContainerStyles(theme, intent, disabled, loading) {
7479
7498
  var borderColorStyling = function borderColorStyling() {
7480
- if (disabled) {
7499
+ if (!loading && disabled) {
7481
7500
  return {
7482
7501
  borderColor: theme.__hd__.button.colors.disabledBorder
7483
7502
  };
@@ -7529,33 +7548,37 @@ var genTextVariantTextStyles = function genTextVariantTextStyles(theme, intent,
7529
7548
  lineHeight: theme.__hd__.button.lineHeight["default"]
7530
7549
  }, textColorStyling());
7531
7550
  };
7532
- var StyledButtonContainer = index$a(reactNative.TouchableOpacity)(function (_ref) {
7551
+ var StyledButtonContainer = index$a(reactNative.TouchableHighlight)(function (_ref) {
7533
7552
  var _ref$disabled = _ref.disabled,
7534
7553
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
7554
+ _ref$loading = _ref.loading,
7555
+ loading = _ref$loading === void 0 ? false : _ref$loading,
7535
7556
  themeVariant = _ref.themeVariant,
7536
7557
  theme = _ref.theme;
7537
7558
  switch (themeVariant) {
7538
7559
  case 'filled-primary':
7539
- return genFilledContainerStyles(theme, 'primary', disabled);
7560
+ return genFilledContainerStyles(theme, 'primary', disabled, loading);
7540
7561
  case 'filled-secondary':
7541
- return genFilledContainerStyles(theme, 'secondary', disabled);
7562
+ return genFilledContainerStyles(theme, 'secondary', disabled, loading);
7542
7563
  case 'filled-danger':
7543
- return genFilledContainerStyles(theme, 'danger', disabled);
7564
+ return genFilledContainerStyles(theme, 'danger', disabled, loading);
7544
7565
  case 'outlined-primary':
7545
- return genOutlineContainerStyles(theme, 'primary', disabled);
7566
+ return genOutlineContainerStyles(theme, 'primary', disabled, loading);
7546
7567
  case 'outlined-secondary':
7547
- return genOutlineContainerStyles(theme, 'secondary', disabled);
7568
+ return genOutlineContainerStyles(theme, 'secondary', disabled, loading);
7548
7569
  case 'outlined-danger':
7549
- return genOutlineContainerStyles(theme, 'danger', disabled);
7570
+ return genOutlineContainerStyles(theme, 'danger', disabled, loading);
7550
7571
  case 'text-primary':
7551
7572
  case 'text-secondary':
7552
7573
  case 'text-danger':
7553
7574
  return {
7575
+ borderRadius: theme.__hd__.button.radii.text,
7554
7576
  flexDirection: 'row',
7555
7577
  justifyContent: 'center',
7556
7578
  alignItems: 'center',
7557
- padding: theme.__hd__.button.space.buttonPadding,
7558
- borderWidth: 0
7579
+ padding: theme.__hd__.button.space.textButtonPadding,
7580
+ borderWidth: 0,
7581
+ backgroundColor: loading ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
7559
7582
  };
7560
7583
  }
7561
7584
  });
@@ -7663,6 +7686,29 @@ var getThemeVariant = function getThemeVariant(variant, intent) {
7663
7686
  return TEXT_VARIANTS[intent];
7664
7687
  }
7665
7688
  };
7689
+ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
7690
+ switch (themeVariant) {
7691
+ case 'filled-primary':
7692
+ return theme.__hd__.button.colors.pressedBackground.filledPrimary;
7693
+ case 'filled-secondary':
7694
+ return theme.__hd__.button.colors.pressedBackground.filledSecondary;
7695
+ case 'filled-danger':
7696
+ return theme.__hd__.button.colors.pressedBackground.filledDanger;
7697
+ case 'outlined-primary':
7698
+ return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
7699
+ case 'outlined-secondary':
7700
+ return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
7701
+ case 'outlined-danger':
7702
+ return theme.__hd__.button.colors.pressedBackground.outlineDanger;
7703
+ case 'text-primary':
7704
+ return theme.__hd__.button.colors.pressedBackground.textPrimary;
7705
+ case 'text-secondary':
7706
+ return theme.__hd__.button.colors.pressedBackground.textSecondary;
7707
+ case 'text-danger':
7708
+ return theme.__hd__.button.colors.pressedBackground.textDanger;
7709
+ }
7710
+ };
7711
+ var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
7666
7712
  var Button = function Button(_ref) {
7667
7713
  var accessibilityHint = _ref.accessibilityHint,
7668
7714
  accessibilityLabel = _ref.accessibilityLabel,
@@ -7681,14 +7727,21 @@ var Button = function Button(_ref) {
7681
7727
  _ref$variant = _ref.variant,
7682
7728
  variant = _ref$variant === void 0 ? 'filled' : _ref$variant;
7683
7729
  var themeVariant = getThemeVariant(variant, intent);
7730
+ var theme = useTheme();
7731
+ var underlayColor = React.useMemo(function () {
7732
+ return getUnderlayColor(theme, themeVariant);
7733
+ }, [theme, themeVariant]);
7734
+ useDeprecation("Button variant ".concat(deprecatedVariants.join(', '), " are deprecated."), deprecatedVariants.includes(themeVariant));
7684
7735
  return /*#__PURE__*/React__default["default"].createElement(StyledButtonContainer, {
7685
7736
  accessibilityHint: accessibilityHint,
7686
7737
  accessibilityLabel: accessibilityLabel,
7687
7738
  disabled: disabled || loading,
7739
+ loading: loading,
7688
7740
  onPress: onPress,
7689
7741
  testID: testID,
7690
7742
  themeVariant: themeVariant,
7691
- style: style
7743
+ style: style,
7744
+ underlayColor: underlayColor
7692
7745
  }, loading === true ? /*#__PURE__*/React__default["default"].createElement(LoadingIndicator, {
7693
7746
  testID: "".concat(testID, "-loading-indicator"),
7694
7747
  themeVariant: themeVariant
@@ -12307,11 +12360,12 @@ var FAB = function FAB(_ref3) {
12307
12360
  active = _ref3.active,
12308
12361
  style = _ref3.style;
12309
12362
  var isIconOnly = !title;
12363
+ var theme = useTheme();
12310
12364
  return /*#__PURE__*/React__default["default"].createElement(StyledFABContainer, {
12365
+ underlayColor: theme.__hd__.fab.colors.buttonPressedBackground,
12311
12366
  testID: testID,
12312
12367
  style: style,
12313
- onPress: onPress,
12314
- activeOpacity: 0.6
12368
+ onPress: onPress
12315
12369
  }, isIconOnly ? /*#__PURE__*/React__default["default"].createElement(IconOnlyContent, {
12316
12370
  animated: animated,
12317
12371
  active: active,
@@ -12322,7 +12376,7 @@ var FAB = function FAB(_ref3) {
12322
12376
  }));
12323
12377
  };
12324
12378
 
12325
- var StyledActionItem = index$a(reactNative.TouchableOpacity)(function (_ref) {
12379
+ var StyledActionItem = index$a(reactNative.TouchableHighlight)(function (_ref) {
12326
12380
  var theme = _ref.theme;
12327
12381
  return {
12328
12382
  paddingLeft: theme.__hd__.fab.space.actionItemPaddingLeft,
@@ -12362,13 +12416,15 @@ var ActionItem = function ActionItem(_ref) {
12362
12416
  onPress = _ref.onPress,
12363
12417
  style = _ref.style,
12364
12418
  testID = _ref.testID;
12419
+ var theme = useTheme();
12365
12420
  return /*#__PURE__*/React__default["default"].createElement(StyledActionItem, {
12421
+ underlayColor: theme.__hd__.fab.colors.actionItemPressedBackground,
12366
12422
  style: style,
12367
12423
  onPress: onPress,
12368
12424
  testID: testID
12369
- }, /*#__PURE__*/React__default["default"].createElement(StyledIcon, {
12425
+ }, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledIcon, {
12370
12426
  icon: icon
12371
- }), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title));
12427
+ }), /*#__PURE__*/React__default["default"].createElement(StyledActionItemText, null, title)));
12372
12428
  };
12373
12429
 
12374
12430
  var StyledContainer$1 = index$a(reactNative.View)({