@hero-design/rn 8.36.1 → 8.36.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.
- package/.turbo/turbo-build.log +1 -1
- package/es/index.js +55 -50
- package/lib/index.js +55 -50
- package/package.json +7 -7
- package/src/components/Carousel/StyledCardCarousel.tsx +1 -1
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +8 -8
- package/src/components/Checkbox/StyledCheckbox.tsx +7 -14
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +8 -12
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +4 -88
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +12 -324
- package/src/components/Checkbox/__tests__/index.spec.tsx +7 -12
- package/src/components/Checkbox/index.tsx +7 -1
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Drawer/index.tsx +3 -3
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/FAB/StyledFAB.tsx +1 -1
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +4 -4
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/List/StyledListItem.tsx +5 -5
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +6 -6
- package/src/components/Toast/StyledToast.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +7 -7
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +29 -14
- package/src/theme/components/cardCarousel.ts +5 -5
- package/src/theme/components/fab.ts +5 -5
- package/src/theme/components/list.ts +7 -4
- package/src/theme/components/toast.ts +5 -5
- package/src/theme/global/index.ts +3 -0
- package/src/theme/global/shadows.ts +19 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -1
- package/types/components/Checkbox/index.d.ts +1 -0
- package/types/theme/components/cardCarousel.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -1
- package/types/theme/components/list.d.ts +9 -6
- package/types/theme/components/toast.d.ts +1 -1
- package/types/theme/global/index.d.ts +12 -0
- package/types/theme/global/shadows.d.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -4,5 +4,5 @@ $ rollup -c
|
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) 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`.[39m[22m
|
|
6
6
|
[1m[33m(!) 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[39m[22m
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m28s[22m[39m
|
|
8
8
|
$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -1662,6 +1662,21 @@ var getRadii = function getRadii(baseRadius) {
|
|
|
1662
1662
|
};
|
|
1663
1663
|
};
|
|
1664
1664
|
|
|
1665
|
+
var getShadows = function getShadows(systemPalette) {
|
|
1666
|
+
return {
|
|
1667
|
+
"default": {
|
|
1668
|
+
shadowOffset: {
|
|
1669
|
+
width: 0,
|
|
1670
|
+
height: 2
|
|
1671
|
+
},
|
|
1672
|
+
shadowColor: systemPalette.primaryOutline,
|
|
1673
|
+
shadowOpacity: 0.12,
|
|
1674
|
+
shadowRadius: 4,
|
|
1675
|
+
elevation: 3
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1665
1680
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1666
1681
|
var fonts = getFonts(scale.font);
|
|
1667
1682
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
@@ -1670,6 +1685,7 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1670
1685
|
var space = getSpace(scale.space);
|
|
1671
1686
|
var sizes = getSizes(scale.size);
|
|
1672
1687
|
var radii = getRadii(scale.radius);
|
|
1688
|
+
var shadows = getShadows(systemPalette);
|
|
1673
1689
|
return {
|
|
1674
1690
|
colors: _objectSpread2({}, systemPalette),
|
|
1675
1691
|
fonts: fonts,
|
|
@@ -1678,7 +1694,8 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1678
1694
|
borderWidths: borderWidths,
|
|
1679
1695
|
space: space,
|
|
1680
1696
|
sizes: sizes,
|
|
1681
|
-
radii: radii
|
|
1697
|
+
radii: radii,
|
|
1698
|
+
shadows: shadows
|
|
1682
1699
|
};
|
|
1683
1700
|
};
|
|
1684
1701
|
|
|
@@ -2078,17 +2095,14 @@ var getCardCarouselTheme = function getCardCarouselTheme(theme) {
|
|
|
2078
2095
|
contentContainerPaddingHorizontal: theme.space.large
|
|
2079
2096
|
};
|
|
2080
2097
|
var colors = {
|
|
2081
|
-
shadow: theme.colors.primaryOutline,
|
|
2082
2098
|
carouselItemBackground: theme.colors.defaultSurface
|
|
2083
2099
|
};
|
|
2084
2100
|
var shadows = {
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
radius: theme.radii.medium,
|
|
2091
|
-
elevation: 4
|
|
2101
|
+
color: theme.shadows["default"].shadowColor,
|
|
2102
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2103
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2104
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2105
|
+
elevation: theme.shadows["default"].elevation
|
|
2092
2106
|
};
|
|
2093
2107
|
var radii = {
|
|
2094
2108
|
card: theme.radii.medium
|
|
@@ -2295,8 +2309,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2295
2309
|
actionItemPressedBackground: theme.colors.pressedSurface,
|
|
2296
2310
|
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
2297
2311
|
titleText: theme.colors.onPrimary,
|
|
2298
|
-
actionItemText: theme.colors.onPrimary
|
|
2299
|
-
shadow: theme.colors.primaryOutline
|
|
2312
|
+
actionItemText: theme.colors.onPrimary
|
|
2300
2313
|
};
|
|
2301
2314
|
var sizes = {
|
|
2302
2315
|
width: theme.sizes.xxxxxlarge,
|
|
@@ -2321,13 +2334,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2321
2334
|
icon: theme.lineHeights.large
|
|
2322
2335
|
};
|
|
2323
2336
|
var shadows = {
|
|
2324
|
-
offset:
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
radius: theme.radii.medium,
|
|
2330
|
-
elevation: 2
|
|
2337
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2338
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2339
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2340
|
+
elevation: theme.shadows["default"].elevation,
|
|
2341
|
+
color: theme.shadows["default"].shadowColor
|
|
2331
2342
|
};
|
|
2332
2343
|
var space = {
|
|
2333
2344
|
actionItemPadding: theme.space.smallMedium,
|
|
@@ -2412,23 +2423,23 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2412
2423
|
var radii = {
|
|
2413
2424
|
item: theme.radii.medium,
|
|
2414
2425
|
basicItem: theme.radii.base,
|
|
2415
|
-
cardShadow: theme.radii.base,
|
|
2416
2426
|
leadingStatus: theme.radii.rounded
|
|
2417
2427
|
};
|
|
2418
2428
|
var shadows = {
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2429
|
+
card: {
|
|
2430
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2431
|
+
elevation: theme.shadows["default"].elevation,
|
|
2432
|
+
color: theme.shadows["default"].shadowColor,
|
|
2433
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2434
|
+
opacity: theme.shadows["default"].shadowOpacity
|
|
2435
|
+
}
|
|
2424
2436
|
};
|
|
2425
2437
|
var widths = {
|
|
2426
2438
|
leadingStatus: 8
|
|
2427
2439
|
};
|
|
2428
2440
|
var opacity = {
|
|
2429
2441
|
disabled: 0.38,
|
|
2430
|
-
enabled: 1
|
|
2431
|
-
cardShadow: 1
|
|
2442
|
+
enabled: 1
|
|
2432
2443
|
};
|
|
2433
2444
|
return {
|
|
2434
2445
|
colors: colors,
|
|
@@ -3032,8 +3043,7 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3032
3043
|
info: theme.colors.info,
|
|
3033
3044
|
notification: theme.colors.defaultGlobalSurface,
|
|
3034
3045
|
snackbar: theme.colors.darkGlobalSurface,
|
|
3035
|
-
divider: theme.colors.secondaryOutline
|
|
3036
|
-
shadow: theme.colors.primaryOutline
|
|
3046
|
+
divider: theme.colors.secondaryOutline
|
|
3037
3047
|
};
|
|
3038
3048
|
var sizes = {
|
|
3039
3049
|
height: theme.sizes.xxxlarge
|
|
@@ -3053,13 +3063,11 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3053
3063
|
base: theme.borderWidths.base
|
|
3054
3064
|
};
|
|
3055
3065
|
var shadows = {
|
|
3056
|
-
offset:
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
radius: 4,
|
|
3062
|
-
elevation: 4
|
|
3066
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
3067
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
3068
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
3069
|
+
elevation: theme.shadows["default"].elevation,
|
|
3070
|
+
color: theme.shadows["default"].shadowColor
|
|
3063
3071
|
};
|
|
3064
3072
|
return {
|
|
3065
3073
|
colors: colors,
|
|
@@ -11691,7 +11699,7 @@ var StyledShadow = index$c(View)(function (_ref3) {
|
|
|
11691
11699
|
var theme = _ref3.theme;
|
|
11692
11700
|
return {
|
|
11693
11701
|
borderRadius: theme.__hd__.cardCarousel.radii.card,
|
|
11694
|
-
shadowColor: theme.__hd__.cardCarousel.
|
|
11702
|
+
shadowColor: theme.__hd__.cardCarousel.shadows.color,
|
|
11695
11703
|
shadowOffset: theme.__hd__.cardCarousel.shadows.offset,
|
|
11696
11704
|
shadowRadius: theme.__hd__.cardCarousel.shadows.radius,
|
|
11697
11705
|
shadowOpacity: theme.__hd__.cardCarousel.shadows.opacity,
|
|
@@ -11992,17 +12000,14 @@ var index$a = Object.assign(Carousel, {
|
|
|
11992
12000
|
|
|
11993
12001
|
var StyledWrapper$7 = index$c(TouchableOpacity)(function (_ref) {
|
|
11994
12002
|
var theme = _ref.theme,
|
|
11995
|
-
themeWithBorder = _ref.themeWithBorder,
|
|
11996
12003
|
themeState = _ref.themeState;
|
|
11997
|
-
|
|
12004
|
+
return {
|
|
12005
|
+
flexDirection: 'row',
|
|
11998
12006
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
11999
12007
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
12000
12008
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
12001
12009
|
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12002
12010
|
};
|
|
12003
|
-
return _objectSpread2({
|
|
12004
|
-
flexDirection: 'row'
|
|
12005
|
-
}, themeWithBorder && borderStyle);
|
|
12006
12011
|
});
|
|
12007
12012
|
var StyledDescription$1 = index$c(Typography.Body)(function (_ref2) {
|
|
12008
12013
|
var theme = _ref2.theme;
|
|
@@ -12062,6 +12067,7 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12062
12067
|
testID = _ref2.testID,
|
|
12063
12068
|
_ref2$readonly = _ref2.readonly,
|
|
12064
12069
|
readonly = _ref2$readonly === void 0 ? false : _ref2$readonly;
|
|
12070
|
+
useDeprecation("Checkbox's withBorder prop will be removed in the next major release, all checkboxes will have border by default. Please remove it.", withBorder === true);
|
|
12065
12071
|
var themeState = getThemeState({
|
|
12066
12072
|
disabled: disabled,
|
|
12067
12073
|
readonly: readonly
|
|
@@ -12069,7 +12075,6 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12069
12075
|
return /*#__PURE__*/React.createElement(StyledWrapper$7, {
|
|
12070
12076
|
onPress: onPress,
|
|
12071
12077
|
disabled: disabled || readonly,
|
|
12072
|
-
themeWithBorder: withBorder,
|
|
12073
12078
|
themeState: themeState,
|
|
12074
12079
|
style: style,
|
|
12075
12080
|
testID: testID
|
|
@@ -12992,7 +12997,7 @@ var Drawer = function Drawer(_ref) {
|
|
|
12992
12997
|
onDismiss = _ref.onDismiss,
|
|
12993
12998
|
testID = _ref.testID;
|
|
12994
12999
|
var animatedValue = useRef(new Animated.Value(visible ? 1 : 0)).current;
|
|
12995
|
-
var _useState = useState(
|
|
13000
|
+
var _useState = useState(Dimensions.get('window').height),
|
|
12996
13001
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12997
13002
|
height = _useState2[0],
|
|
12998
13003
|
setHeight = _useState2[1];
|
|
@@ -13331,7 +13336,7 @@ var StyledFAB$1 = index$c(TouchableHighlight)(function (_ref) {
|
|
|
13331
13336
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
13332
13337
|
flexDirection: 'row',
|
|
13333
13338
|
elevation: theme.__hd__.fab.shadows.elevation,
|
|
13334
|
-
shadowColor: theme.__hd__.fab.
|
|
13339
|
+
shadowColor: theme.__hd__.fab.shadows.color,
|
|
13335
13340
|
shadowOffset: theme.__hd__.fab.shadows.offset,
|
|
13336
13341
|
shadowRadius: theme.__hd__.fab.shadows.radius,
|
|
13337
13342
|
shadowOpacity: theme.__hd__.fab.shadows.opacity
|
|
@@ -13768,11 +13773,11 @@ var StyledListItemContainer$1 = index$c(TouchableHighlight)(function (_ref) {
|
|
|
13768
13773
|
case 'card':
|
|
13769
13774
|
return _objectSpread2(_objectSpread2({}, sharedStyles), {}, {
|
|
13770
13775
|
alignItems: 'center',
|
|
13771
|
-
shadowColor: theme.
|
|
13772
|
-
shadowRadius: theme.__hd__.list.
|
|
13773
|
-
shadowOffset: theme.__hd__.list.shadows.
|
|
13774
|
-
shadowOpacity: theme.__hd__.list.opacity
|
|
13775
|
-
elevation: theme.__hd__.list.shadows.
|
|
13776
|
+
shadowColor: theme.__hd__.list.shadows.card.color,
|
|
13777
|
+
shadowRadius: theme.__hd__.list.shadows.card.radius,
|
|
13778
|
+
shadowOffset: theme.__hd__.list.shadows.card.offset,
|
|
13779
|
+
shadowOpacity: theme.__hd__.list.shadows.card.opacity,
|
|
13780
|
+
elevation: theme.__hd__.list.shadows.card.elevation
|
|
13776
13781
|
});
|
|
13777
13782
|
default:
|
|
13778
13783
|
return sharedStyles;
|
|
@@ -16872,7 +16877,7 @@ var Container = index$c(Animated.View)(function (_ref2) {
|
|
|
16872
16877
|
backgroundColor: theme.__hd__.toast.colors[themeIntent],
|
|
16873
16878
|
minHeight: theme.__hd__.toast.sizes.height,
|
|
16874
16879
|
flexDirection: 'row',
|
|
16875
|
-
shadowColor: theme.__hd__.toast.
|
|
16880
|
+
shadowColor: theme.__hd__.toast.shadows.color,
|
|
16876
16881
|
shadowOffset: theme.__hd__.toast.shadows.offset,
|
|
16877
16882
|
shadowRadius: theme.__hd__.toast.shadows.radius,
|
|
16878
16883
|
shadowOpacity: theme.__hd__.toast.shadows.opacity,
|
package/lib/index.js
CHANGED
|
@@ -1693,6 +1693,21 @@ var getRadii = function getRadii(baseRadius) {
|
|
|
1693
1693
|
};
|
|
1694
1694
|
};
|
|
1695
1695
|
|
|
1696
|
+
var getShadows = function getShadows(systemPalette) {
|
|
1697
|
+
return {
|
|
1698
|
+
"default": {
|
|
1699
|
+
shadowOffset: {
|
|
1700
|
+
width: 0,
|
|
1701
|
+
height: 2
|
|
1702
|
+
},
|
|
1703
|
+
shadowColor: systemPalette.primaryOutline,
|
|
1704
|
+
shadowOpacity: 0.12,
|
|
1705
|
+
shadowRadius: 4,
|
|
1706
|
+
elevation: 3
|
|
1707
|
+
}
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1696
1711
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
1697
1712
|
var fonts = getFonts(scale.font);
|
|
1698
1713
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
@@ -1701,6 +1716,7 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1701
1716
|
var space = getSpace(scale.space);
|
|
1702
1717
|
var sizes = getSizes(scale.size);
|
|
1703
1718
|
var radii = getRadii(scale.radius);
|
|
1719
|
+
var shadows = getShadows(systemPalette);
|
|
1704
1720
|
return {
|
|
1705
1721
|
colors: _objectSpread2({}, systemPalette),
|
|
1706
1722
|
fonts: fonts,
|
|
@@ -1709,7 +1725,8 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
1709
1725
|
borderWidths: borderWidths,
|
|
1710
1726
|
space: space,
|
|
1711
1727
|
sizes: sizes,
|
|
1712
|
-
radii: radii
|
|
1728
|
+
radii: radii,
|
|
1729
|
+
shadows: shadows
|
|
1713
1730
|
};
|
|
1714
1731
|
};
|
|
1715
1732
|
|
|
@@ -2109,17 +2126,14 @@ var getCardCarouselTheme = function getCardCarouselTheme(theme) {
|
|
|
2109
2126
|
contentContainerPaddingHorizontal: theme.space.large
|
|
2110
2127
|
};
|
|
2111
2128
|
var colors = {
|
|
2112
|
-
shadow: theme.colors.primaryOutline,
|
|
2113
2129
|
carouselItemBackground: theme.colors.defaultSurface
|
|
2114
2130
|
};
|
|
2115
2131
|
var shadows = {
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
radius: theme.radii.medium,
|
|
2122
|
-
elevation: 4
|
|
2132
|
+
color: theme.shadows["default"].shadowColor,
|
|
2133
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2134
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2135
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2136
|
+
elevation: theme.shadows["default"].elevation
|
|
2123
2137
|
};
|
|
2124
2138
|
var radii = {
|
|
2125
2139
|
card: theme.radii.medium
|
|
@@ -2326,8 +2340,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2326
2340
|
actionItemPressedBackground: theme.colors.pressedSurface,
|
|
2327
2341
|
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
2328
2342
|
titleText: theme.colors.onPrimary,
|
|
2329
|
-
actionItemText: theme.colors.onPrimary
|
|
2330
|
-
shadow: theme.colors.primaryOutline
|
|
2343
|
+
actionItemText: theme.colors.onPrimary
|
|
2331
2344
|
};
|
|
2332
2345
|
var sizes = {
|
|
2333
2346
|
width: theme.sizes.xxxxxlarge,
|
|
@@ -2352,13 +2365,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
2352
2365
|
icon: theme.lineHeights.large
|
|
2353
2366
|
};
|
|
2354
2367
|
var shadows = {
|
|
2355
|
-
offset:
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
radius: theme.radii.medium,
|
|
2361
|
-
elevation: 2
|
|
2368
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2369
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
2370
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2371
|
+
elevation: theme.shadows["default"].elevation,
|
|
2372
|
+
color: theme.shadows["default"].shadowColor
|
|
2362
2373
|
};
|
|
2363
2374
|
var space = {
|
|
2364
2375
|
actionItemPadding: theme.space.smallMedium,
|
|
@@ -2443,23 +2454,23 @@ var getListTheme = function getListTheme(theme) {
|
|
|
2443
2454
|
var radii = {
|
|
2444
2455
|
item: theme.radii.medium,
|
|
2445
2456
|
basicItem: theme.radii.base,
|
|
2446
|
-
cardShadow: theme.radii.base,
|
|
2447
2457
|
leadingStatus: theme.radii.rounded
|
|
2448
2458
|
};
|
|
2449
2459
|
var shadows = {
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2460
|
+
card: {
|
|
2461
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
2462
|
+
elevation: theme.shadows["default"].elevation,
|
|
2463
|
+
color: theme.shadows["default"].shadowColor,
|
|
2464
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
2465
|
+
opacity: theme.shadows["default"].shadowOpacity
|
|
2466
|
+
}
|
|
2455
2467
|
};
|
|
2456
2468
|
var widths = {
|
|
2457
2469
|
leadingStatus: 8
|
|
2458
2470
|
};
|
|
2459
2471
|
var opacity = {
|
|
2460
2472
|
disabled: 0.38,
|
|
2461
|
-
enabled: 1
|
|
2462
|
-
cardShadow: 1
|
|
2473
|
+
enabled: 1
|
|
2463
2474
|
};
|
|
2464
2475
|
return {
|
|
2465
2476
|
colors: colors,
|
|
@@ -3063,8 +3074,7 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3063
3074
|
info: theme.colors.info,
|
|
3064
3075
|
notification: theme.colors.defaultGlobalSurface,
|
|
3065
3076
|
snackbar: theme.colors.darkGlobalSurface,
|
|
3066
|
-
divider: theme.colors.secondaryOutline
|
|
3067
|
-
shadow: theme.colors.primaryOutline
|
|
3077
|
+
divider: theme.colors.secondaryOutline
|
|
3068
3078
|
};
|
|
3069
3079
|
var sizes = {
|
|
3070
3080
|
height: theme.sizes.xxxlarge
|
|
@@ -3084,13 +3094,11 @@ var getToastTheme = function getToastTheme(theme) {
|
|
|
3084
3094
|
base: theme.borderWidths.base
|
|
3085
3095
|
};
|
|
3086
3096
|
var shadows = {
|
|
3087
|
-
offset:
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
radius: 4,
|
|
3093
|
-
elevation: 4
|
|
3097
|
+
offset: theme.shadows["default"].shadowOffset,
|
|
3098
|
+
opacity: theme.shadows["default"].shadowOpacity,
|
|
3099
|
+
radius: theme.shadows["default"].shadowRadius,
|
|
3100
|
+
elevation: theme.shadows["default"].elevation,
|
|
3101
|
+
color: theme.shadows["default"].shadowColor
|
|
3094
3102
|
};
|
|
3095
3103
|
return {
|
|
3096
3104
|
colors: colors,
|
|
@@ -11722,7 +11730,7 @@ var StyledShadow = index$c(reactNative.View)(function (_ref3) {
|
|
|
11722
11730
|
var theme = _ref3.theme;
|
|
11723
11731
|
return {
|
|
11724
11732
|
borderRadius: theme.__hd__.cardCarousel.radii.card,
|
|
11725
|
-
shadowColor: theme.__hd__.cardCarousel.
|
|
11733
|
+
shadowColor: theme.__hd__.cardCarousel.shadows.color,
|
|
11726
11734
|
shadowOffset: theme.__hd__.cardCarousel.shadows.offset,
|
|
11727
11735
|
shadowRadius: theme.__hd__.cardCarousel.shadows.radius,
|
|
11728
11736
|
shadowOpacity: theme.__hd__.cardCarousel.shadows.opacity,
|
|
@@ -12023,17 +12031,14 @@ var index$a = Object.assign(Carousel, {
|
|
|
12023
12031
|
|
|
12024
12032
|
var StyledWrapper$7 = index$c(reactNative.TouchableOpacity)(function (_ref) {
|
|
12025
12033
|
var theme = _ref.theme,
|
|
12026
|
-
themeWithBorder = _ref.themeWithBorder,
|
|
12027
12034
|
themeState = _ref.themeState;
|
|
12028
|
-
|
|
12035
|
+
return {
|
|
12036
|
+
flexDirection: 'row',
|
|
12029
12037
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
12030
12038
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
12031
12039
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
12032
12040
|
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12033
12041
|
};
|
|
12034
|
-
return _objectSpread2({
|
|
12035
|
-
flexDirection: 'row'
|
|
12036
|
-
}, themeWithBorder && borderStyle);
|
|
12037
12042
|
});
|
|
12038
12043
|
var StyledDescription$1 = index$c(Typography.Body)(function (_ref2) {
|
|
12039
12044
|
var theme = _ref2.theme;
|
|
@@ -12093,6 +12098,7 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12093
12098
|
testID = _ref2.testID,
|
|
12094
12099
|
_ref2$readonly = _ref2.readonly,
|
|
12095
12100
|
readonly = _ref2$readonly === void 0 ? false : _ref2$readonly;
|
|
12101
|
+
useDeprecation("Checkbox's withBorder prop will be removed in the next major release, all checkboxes will have border by default. Please remove it.", withBorder === true);
|
|
12096
12102
|
var themeState = getThemeState({
|
|
12097
12103
|
disabled: disabled,
|
|
12098
12104
|
readonly: readonly
|
|
@@ -12100,7 +12106,6 @@ var Checkbox = function Checkbox(_ref2) {
|
|
|
12100
12106
|
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$7, {
|
|
12101
12107
|
onPress: onPress,
|
|
12102
12108
|
disabled: disabled || readonly,
|
|
12103
|
-
themeWithBorder: withBorder,
|
|
12104
12109
|
themeState: themeState,
|
|
12105
12110
|
style: style,
|
|
12106
12111
|
testID: testID
|
|
@@ -13023,7 +13028,7 @@ var Drawer = function Drawer(_ref) {
|
|
|
13023
13028
|
onDismiss = _ref.onDismiss,
|
|
13024
13029
|
testID = _ref.testID;
|
|
13025
13030
|
var animatedValue = React.useRef(new reactNative.Animated.Value(visible ? 1 : 0)).current;
|
|
13026
|
-
var _useState = React.useState(
|
|
13031
|
+
var _useState = React.useState(reactNative.Dimensions.get('window').height),
|
|
13027
13032
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13028
13033
|
height = _useState2[0],
|
|
13029
13034
|
setHeight = _useState2[1];
|
|
@@ -13362,7 +13367,7 @@ var StyledFAB$1 = index$c(reactNative.TouchableHighlight)(function (_ref) {
|
|
|
13362
13367
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
13363
13368
|
flexDirection: 'row',
|
|
13364
13369
|
elevation: theme.__hd__.fab.shadows.elevation,
|
|
13365
|
-
shadowColor: theme.__hd__.fab.
|
|
13370
|
+
shadowColor: theme.__hd__.fab.shadows.color,
|
|
13366
13371
|
shadowOffset: theme.__hd__.fab.shadows.offset,
|
|
13367
13372
|
shadowRadius: theme.__hd__.fab.shadows.radius,
|
|
13368
13373
|
shadowOpacity: theme.__hd__.fab.shadows.opacity
|
|
@@ -13799,11 +13804,11 @@ var StyledListItemContainer$1 = index$c(reactNative.TouchableHighlight)(function
|
|
|
13799
13804
|
case 'card':
|
|
13800
13805
|
return _objectSpread2(_objectSpread2({}, sharedStyles), {}, {
|
|
13801
13806
|
alignItems: 'center',
|
|
13802
|
-
shadowColor: theme.
|
|
13803
|
-
shadowRadius: theme.__hd__.list.
|
|
13804
|
-
shadowOffset: theme.__hd__.list.shadows.
|
|
13805
|
-
shadowOpacity: theme.__hd__.list.opacity
|
|
13806
|
-
elevation: theme.__hd__.list.shadows.
|
|
13807
|
+
shadowColor: theme.__hd__.list.shadows.card.color,
|
|
13808
|
+
shadowRadius: theme.__hd__.list.shadows.card.radius,
|
|
13809
|
+
shadowOffset: theme.__hd__.list.shadows.card.offset,
|
|
13810
|
+
shadowOpacity: theme.__hd__.list.shadows.card.opacity,
|
|
13811
|
+
elevation: theme.__hd__.list.shadows.card.elevation
|
|
13807
13812
|
});
|
|
13808
13813
|
default:
|
|
13809
13814
|
return sharedStyles;
|
|
@@ -16903,7 +16908,7 @@ var Container = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
|
16903
16908
|
backgroundColor: theme.__hd__.toast.colors[themeIntent],
|
|
16904
16909
|
minHeight: theme.__hd__.toast.sizes.height,
|
|
16905
16910
|
flexDirection: 'row',
|
|
16906
|
-
shadowColor: theme.__hd__.toast.
|
|
16911
|
+
shadowColor: theme.__hd__.toast.shadows.color,
|
|
16907
16912
|
shadowOffset: theme.__hd__.toast.shadows.offset,
|
|
16908
16913
|
shadowRadius: theme.__hd__.toast.shadows.radius,
|
|
16909
16914
|
shadowOpacity: theme.__hd__.toast.shadows.opacity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.36.
|
|
3
|
+
"version": "8.36.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.36.
|
|
24
|
+
"@hero-design/colors": "8.36.3",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21",
|
|
28
28
|
"nanoid": "^4.0.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@hero-design/react-native-month-year-picker": "^8.36.
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.36.3",
|
|
32
32
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
33
33
|
"@react-native-community/slider": "4.1.12",
|
|
34
34
|
"react": "18.0.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@babel/preset-typescript": "^7.17.12",
|
|
49
49
|
"@babel/runtime": "^7.18.9",
|
|
50
50
|
"@emotion/jest": "^11.9.3",
|
|
51
|
-
"@hero-design/eslint-plugin": "8.36.
|
|
52
|
-
"@hero-design/react-native-month-year-picker": "^8.36.
|
|
51
|
+
"@hero-design/eslint-plugin": "8.36.3",
|
|
52
|
+
"@hero-design/react-native-month-year-picker": "^8.36.3",
|
|
53
53
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
54
54
|
"@react-native-community/slider": "4.1.12",
|
|
55
55
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@types/react-native": "^0.67.7",
|
|
66
66
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
67
67
|
"babel-plugin-inline-import": "^3.0.0",
|
|
68
|
-
"eslint-config-hd": "8.36.
|
|
68
|
+
"eslint-config-hd": "8.36.3",
|
|
69
69
|
"eslint-plugin-import": "^2.27.5",
|
|
70
70
|
"jest": "^27.3.1",
|
|
71
|
-
"prettier-config-hd": "8.36.
|
|
71
|
+
"prettier-config-hd": "8.36.3",
|
|
72
72
|
"react": "18.0.0",
|
|
73
73
|
"react-native": "0.69.7",
|
|
74
74
|
"react-native-gesture-handler": "~2.5.0",
|
|
@@ -19,7 +19,7 @@ const StyledCard = styled(Card)<CardProps>(({ theme }) => ({
|
|
|
19
19
|
}));
|
|
20
20
|
const StyledShadow = styled(View)<ViewProps>(({ theme }) => ({
|
|
21
21
|
borderRadius: theme.__hd__.cardCarousel.radii.card,
|
|
22
|
-
shadowColor: theme.__hd__.cardCarousel.
|
|
22
|
+
shadowColor: theme.__hd__.cardCarousel.shadows.color,
|
|
23
23
|
shadowOffset: theme.__hd__.cardCarousel.shadows.offset,
|
|
24
24
|
shadowRadius: theme.__hd__.cardCarousel.shadows.radius,
|
|
25
25
|
shadowOpacity: theme.__hd__.cardCarousel.shadows.opacity,
|
|
@@ -104,7 +104,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
104
104
|
Array [
|
|
105
105
|
Object {
|
|
106
106
|
"borderRadius": 8,
|
|
107
|
-
"elevation":
|
|
107
|
+
"elevation": 3,
|
|
108
108
|
"flex": 1,
|
|
109
109
|
"shadowColor": "#001f23",
|
|
110
110
|
"shadowOffset": Object {
|
|
@@ -112,7 +112,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
112
112
|
"width": 0,
|
|
113
113
|
},
|
|
114
114
|
"shadowOpacity": 0.12,
|
|
115
|
-
"shadowRadius":
|
|
115
|
+
"shadowRadius": 4,
|
|
116
116
|
},
|
|
117
117
|
undefined,
|
|
118
118
|
]
|
|
@@ -187,7 +187,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
187
187
|
Array [
|
|
188
188
|
Object {
|
|
189
189
|
"borderRadius": 8,
|
|
190
|
-
"elevation":
|
|
190
|
+
"elevation": 3,
|
|
191
191
|
"flex": 1,
|
|
192
192
|
"shadowColor": "#001f23",
|
|
193
193
|
"shadowOffset": Object {
|
|
@@ -195,7 +195,7 @@ exports[`CardCarousel android should render correctly on iOS 1`] = `
|
|
|
195
195
|
"width": 0,
|
|
196
196
|
},
|
|
197
197
|
"shadowOpacity": 0.12,
|
|
198
|
-
"shadowRadius":
|
|
198
|
+
"shadowRadius": 4,
|
|
199
199
|
},
|
|
200
200
|
undefined,
|
|
201
201
|
]
|
|
@@ -399,7 +399,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
399
399
|
Array [
|
|
400
400
|
Object {
|
|
401
401
|
"borderRadius": 8,
|
|
402
|
-
"elevation":
|
|
402
|
+
"elevation": 3,
|
|
403
403
|
"flex": 1,
|
|
404
404
|
"shadowColor": "#001f23",
|
|
405
405
|
"shadowOffset": Object {
|
|
@@ -407,7 +407,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
407
407
|
"width": 0,
|
|
408
408
|
},
|
|
409
409
|
"shadowOpacity": 0.12,
|
|
410
|
-
"shadowRadius":
|
|
410
|
+
"shadowRadius": 4,
|
|
411
411
|
},
|
|
412
412
|
undefined,
|
|
413
413
|
]
|
|
@@ -482,7 +482,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
482
482
|
Array [
|
|
483
483
|
Object {
|
|
484
484
|
"borderRadius": 8,
|
|
485
|
-
"elevation":
|
|
485
|
+
"elevation": 3,
|
|
486
486
|
"flex": 1,
|
|
487
487
|
"shadowColor": "#001f23",
|
|
488
488
|
"shadowOffset": Object {
|
|
@@ -490,7 +490,7 @@ exports[`CardCarousel ios should render correctly on iOS 1`] = `
|
|
|
490
490
|
"width": 0,
|
|
491
491
|
},
|
|
492
492
|
"shadowOpacity": 0.12,
|
|
493
|
-
"shadowRadius":
|
|
493
|
+
"shadowRadius": 4,
|
|
494
494
|
},
|
|
495
495
|
undefined,
|
|
496
496
|
]
|
|
@@ -6,21 +6,14 @@ import Typography from '../Typography';
|
|
|
6
6
|
type CheckboxThemeState = 'default' | 'disabled' | 'readonly';
|
|
7
7
|
|
|
8
8
|
export const StyledWrapper = styled(TouchableOpacity)<{
|
|
9
|
-
themeWithBorder: boolean;
|
|
10
9
|
themeState: CheckboxThemeState;
|
|
11
|
-
}>(({ theme,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
flexDirection: 'row',
|
|
21
|
-
...(themeWithBorder && borderStyle),
|
|
22
|
-
};
|
|
23
|
-
});
|
|
10
|
+
}>(({ theme, themeState }) => ({
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
13
|
+
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
14
|
+
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
15
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState],
|
|
16
|
+
}));
|
|
24
17
|
|
|
25
18
|
export const StyledDescription = styled(Typography.Body)(({ theme }) => ({
|
|
26
19
|
paddingRight: theme.__hd__.checkbox.space.iconDescriptionPadding,
|
|
@@ -5,21 +5,17 @@ import { getThemeState } from '..';
|
|
|
5
5
|
|
|
6
6
|
describe('StyledWrapper', () => {
|
|
7
7
|
it.each`
|
|
8
|
-
|
|
9
|
-
${false}
|
|
10
|
-
${true}
|
|
11
|
-
${false}
|
|
12
|
-
${true}
|
|
13
|
-
${false} | ${false} | ${true}
|
|
14
|
-
${true} | ${false} | ${true}
|
|
15
|
-
${false} | ${true} | ${true}
|
|
16
|
-
${true} | ${true} | ${true}
|
|
8
|
+
disabled | readonly
|
|
9
|
+
${false} | ${false}
|
|
10
|
+
${true} | ${false}
|
|
11
|
+
${false} | ${true}
|
|
12
|
+
${true} | ${true}
|
|
17
13
|
`(
|
|
18
|
-
'renders correctly when disabled is $disabled,
|
|
19
|
-
({ disabled,
|
|
14
|
+
'renders correctly when disabled is $disabled, readonly is $readonly',
|
|
15
|
+
({ disabled, readonly }) => {
|
|
20
16
|
const themeState = getThemeState({ disabled, readonly });
|
|
21
17
|
const { toJSON } = renderWithTheme(
|
|
22
|
-
<StyledWrapper themeState={themeState}
|
|
18
|
+
<StyledWrapper themeState={themeState} />
|
|
23
19
|
);
|
|
24
20
|
|
|
25
21
|
expect(toJSON()).toMatchSnapshot();
|