@hero-design/rn 8.84.3 → 8.86.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.
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +12 -0
- package/es/index.js +112 -27
- package/lib/index.js +112 -27
- package/package.json +1 -1
- package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
- package/src/components/Box/__tests__/index.spec.tsx +1 -0
- package/src/components/Box/config.ts +4 -0
- package/src/components/Button/Button.tsx +22 -6
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +8 -2
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +3 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +139 -1
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +408 -3
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +3 -0
- package/src/components/Button/LoadingIndicator/index.tsx +4 -1
- package/src/components/Button/StyledButton.tsx +95 -5
- package/src/components/Button/__tests__/Button.spec.tsx +12 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +10 -0
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +1240 -90
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +630 -40
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -0
- package/src/theme/components/button.ts +5 -0
- package/stats/8.85.0/rn-stats.html +4842 -0
- package/stats/8.86.0/rn-stats.html +4842 -0
- package/types/components/Box/config.d.ts +4 -0
- package/types/components/Button/Button.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +3 -3
- package/types/theme/components/button.d.ts +5 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(node:
|
|
1
|
+
(node:3022) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
2
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
3
|
[36m
|
|
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 '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m52.9s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.86.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3609](https://github.com/Thinkei/hero-design/pull/3609) [`6cb53946a493e6550c0bdd2b0c2c0fb683e4e77b`](https://github.com/Thinkei/hero-design/commit/6cb53946a493e6550c0bdd2b0c2c0fb683e4e77b) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Button] Add white intent
|
|
8
|
+
|
|
9
|
+
## 8.85.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#3605](https://github.com/Thinkei/hero-design/pull/3605) [`ab87bce2a285fbbe735eca30fa686f26eb2f2a97`](https://github.com/Thinkei/hero-design/commit/ab87bce2a285fbbe735eca30fa686f26eb2f2a97) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Box] Support gap property
|
|
14
|
+
|
|
3
15
|
## 8.84.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -2511,6 +2511,7 @@ var getButtonTheme = function getButtonTheme(theme) {
|
|
|
2511
2511
|
primary: theme.colors.primary,
|
|
2512
2512
|
secondary: theme.colors.mutedOnDefaultGlobalSurface,
|
|
2513
2513
|
danger: theme.colors.onErrorSurface,
|
|
2514
|
+
white: theme.colors.defaultGlobalSurface,
|
|
2514
2515
|
defaultText: theme.colors.onDefaultGlobalSurface,
|
|
2515
2516
|
disabledText: theme.colors.disabledOnDefaultGlobalSurface,
|
|
2516
2517
|
disabledBorder: theme.colors.disabledOnDefaultGlobalSurface,
|
|
@@ -2522,17 +2523,21 @@ var getButtonTheme = function getButtonTheme(theme) {
|
|
|
2522
2523
|
filledPrimary: theme.colors.pressedSurface,
|
|
2523
2524
|
filledSecondary: theme.colors.pressedSurface,
|
|
2524
2525
|
filledDanger: theme.colors.errorSurface,
|
|
2526
|
+
filledWhite: theme.colors.highlightedSurface,
|
|
2525
2527
|
outlinedPrimary: theme.colors.highlightedSurface,
|
|
2526
2528
|
outlinedSecondary: theme.colors.highlightedSurface,
|
|
2527
2529
|
outlineDanger: theme.colors.errorSurface,
|
|
2530
|
+
outlineWhite: theme.colors.pressedSurface,
|
|
2528
2531
|
textPrimary: theme.colors.highlightedSurface,
|
|
2529
2532
|
textSecondary: theme.colors.neutralGlobalSurface,
|
|
2530
|
-
textDanger: theme.colors.errorSurface
|
|
2533
|
+
textDanger: theme.colors.errorSurface,
|
|
2534
|
+
textWhite: theme.colors.pressedSurface
|
|
2531
2535
|
},
|
|
2532
2536
|
pressedText: {
|
|
2533
2537
|
primary: theme.colors.pressedSurface,
|
|
2534
2538
|
secondary: theme.colors.onDefaultGlobalSurface,
|
|
2535
|
-
danger: theme.colors.mutedError
|
|
2539
|
+
danger: theme.colors.mutedError,
|
|
2540
|
+
white: theme.colors.pressedSurface
|
|
2536
2541
|
}
|
|
2537
2542
|
};
|
|
2538
2543
|
var lineHeights = {
|
|
@@ -8831,6 +8836,10 @@ var space = {
|
|
|
8831
8836
|
paddingVertical: {
|
|
8832
8837
|
property: 'paddingVertical',
|
|
8833
8838
|
scale: 'space'
|
|
8839
|
+
},
|
|
8840
|
+
gap: {
|
|
8841
|
+
property: 'gap',
|
|
8842
|
+
scale: 'space'
|
|
8834
8843
|
}
|
|
8835
8844
|
};
|
|
8836
8845
|
var radii = {
|
|
@@ -9563,15 +9572,18 @@ var StyledLoadingDot = index$a(View)(function (_ref) {
|
|
|
9563
9572
|
case 'filled-primary':
|
|
9564
9573
|
case 'filled-secondary':
|
|
9565
9574
|
case 'filled-danger':
|
|
9575
|
+
case 'outlined-white':
|
|
9576
|
+
case 'text-white':
|
|
9566
9577
|
return {
|
|
9567
9578
|
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
9568
9579
|
};
|
|
9580
|
+
case 'filled-white':
|
|
9569
9581
|
case 'outlined-primary':
|
|
9570
9582
|
return genLoadingIndicatorStyles(theme, 'primary');
|
|
9571
9583
|
case 'text-primary':
|
|
9572
9584
|
case 'outlined-secondary':
|
|
9573
|
-
case 'text-secondary':
|
|
9574
9585
|
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
9586
|
+
case 'text-secondary':
|
|
9575
9587
|
case 'outlined-danger':
|
|
9576
9588
|
case 'text-danger':
|
|
9577
9589
|
return genLoadingIndicatorStyles(theme, 'danger');
|
|
@@ -9745,15 +9757,20 @@ var StyledButtonContainer = index$a(TouchableHighlight)(function (_ref) {
|
|
|
9745
9757
|
return genFilledContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9746
9758
|
case 'filled-danger':
|
|
9747
9759
|
return genFilledContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9760
|
+
case 'filled-white':
|
|
9761
|
+
return genFilledContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9748
9762
|
case 'outlined-primary':
|
|
9749
9763
|
return genOutlineContainerStyles(theme, 'primary', disabled, loading, themeIsCompact);
|
|
9750
9764
|
case 'outlined-secondary':
|
|
9751
9765
|
return genOutlineContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9752
9766
|
case 'outlined-danger':
|
|
9753
9767
|
return genOutlineContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9768
|
+
case 'outlined-white':
|
|
9769
|
+
return genOutlineContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9754
9770
|
case 'text-primary':
|
|
9755
9771
|
case 'text-secondary':
|
|
9756
9772
|
case 'text-danger':
|
|
9773
|
+
case 'text-white':
|
|
9757
9774
|
return {
|
|
9758
9775
|
height: themeInlineText ? undefined : getButtonHeight(themeIsCompact),
|
|
9759
9776
|
borderRadius: theme.__hd__.button.radii.text,
|
|
@@ -9762,14 +9779,51 @@ var StyledButtonContainer = index$a(TouchableHighlight)(function (_ref) {
|
|
|
9762
9779
|
alignItems: 'center',
|
|
9763
9780
|
padding: themeInlineText ? 0 : theme.__hd__.button.space["default"].textButtonPadding,
|
|
9764
9781
|
borderWidth: 0,
|
|
9765
|
-
backgroundColor: loading && !themeInlineText ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9782
|
+
backgroundColor: loading && !themeInlineText && themeButtonVariant !== 'text-white' ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9766
9783
|
};
|
|
9767
9784
|
}
|
|
9768
9785
|
});
|
|
9769
|
-
var
|
|
9770
|
-
var
|
|
9771
|
-
|
|
9786
|
+
var genWhiteTextStyles = function genWhiteTextStyles(_ref2) {
|
|
9787
|
+
var variant = _ref2.variant,
|
|
9788
|
+
disabled = _ref2.disabled,
|
|
9772
9789
|
theme = _ref2.theme;
|
|
9790
|
+
if (disabled) {
|
|
9791
|
+
switch (variant) {
|
|
9792
|
+
case 'filled-white':
|
|
9793
|
+
{
|
|
9794
|
+
return {
|
|
9795
|
+
color: theme.__hd__.button.colors.invertedText
|
|
9796
|
+
};
|
|
9797
|
+
}
|
|
9798
|
+
case 'outlined-white':
|
|
9799
|
+
case 'text-white':
|
|
9800
|
+
{
|
|
9801
|
+
return {
|
|
9802
|
+
color: theme.__hd__.button.colors.disabledText
|
|
9803
|
+
};
|
|
9804
|
+
}
|
|
9805
|
+
}
|
|
9806
|
+
}
|
|
9807
|
+
switch (variant) {
|
|
9808
|
+
case 'filled-white':
|
|
9809
|
+
{
|
|
9810
|
+
return {
|
|
9811
|
+
color: theme.__hd__.button.colors.primary
|
|
9812
|
+
};
|
|
9813
|
+
}
|
|
9814
|
+
case 'outlined-white':
|
|
9815
|
+
case 'text-white':
|
|
9816
|
+
{
|
|
9817
|
+
return {
|
|
9818
|
+
color: theme.__hd__.button.colors.invertedText
|
|
9819
|
+
};
|
|
9820
|
+
}
|
|
9821
|
+
}
|
|
9822
|
+
};
|
|
9823
|
+
var StyledButtonText = index$a(Typography.Title)(function (_ref3) {
|
|
9824
|
+
var disabled = _ref3.disabled,
|
|
9825
|
+
themeButtonVariant = _ref3.themeButtonVariant,
|
|
9826
|
+
theme = _ref3.theme;
|
|
9773
9827
|
var themeStyling = function themeStyling() {
|
|
9774
9828
|
switch (themeButtonVariant) {
|
|
9775
9829
|
case 'filled-primary':
|
|
@@ -9790,6 +9844,14 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9790
9844
|
return genTextStyles(theme, 'secondary', disabled);
|
|
9791
9845
|
case 'text-danger':
|
|
9792
9846
|
return genTextStyles(theme, 'danger', disabled);
|
|
9847
|
+
case 'filled-white':
|
|
9848
|
+
case 'outlined-white':
|
|
9849
|
+
case 'text-white':
|
|
9850
|
+
return genWhiteTextStyles({
|
|
9851
|
+
variant: themeButtonVariant,
|
|
9852
|
+
disabled: disabled,
|
|
9853
|
+
theme: theme
|
|
9854
|
+
});
|
|
9793
9855
|
}
|
|
9794
9856
|
};
|
|
9795
9857
|
return _objectSpread2({
|
|
@@ -9798,11 +9860,11 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9798
9860
|
}, themeStyling());
|
|
9799
9861
|
});
|
|
9800
9862
|
var StyledSmallButtonText = StyledButtonText.withComponent(Typography.Body);
|
|
9801
|
-
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (
|
|
9802
|
-
var disabled =
|
|
9803
|
-
themeButtonVariant =
|
|
9804
|
-
themeIsPressed =
|
|
9805
|
-
theme =
|
|
9863
|
+
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref4) {
|
|
9864
|
+
var disabled = _ref4.disabled,
|
|
9865
|
+
themeButtonVariant = _ref4.themeButtonVariant,
|
|
9866
|
+
themeIsPressed = _ref4.themeIsPressed,
|
|
9867
|
+
theme = _ref4.theme;
|
|
9806
9868
|
var themeStyling = function themeStyling() {
|
|
9807
9869
|
switch (themeButtonVariant) {
|
|
9808
9870
|
case 'text-primary':
|
|
@@ -9811,6 +9873,12 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9811
9873
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9812
9874
|
case 'text-danger':
|
|
9813
9875
|
return genTextStyles(theme, 'danger', disabled, themeIsPressed);
|
|
9876
|
+
case 'text-white':
|
|
9877
|
+
return genWhiteTextStyles({
|
|
9878
|
+
variant: 'text-white',
|
|
9879
|
+
disabled: disabled,
|
|
9880
|
+
theme: theme
|
|
9881
|
+
});
|
|
9814
9882
|
}
|
|
9815
9883
|
};
|
|
9816
9884
|
return _objectSpread2({
|
|
@@ -9820,10 +9888,10 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9820
9888
|
textAlign: 'center'
|
|
9821
9889
|
}, themeStyling());
|
|
9822
9890
|
});
|
|
9823
|
-
var StyledButtonIconWrapper = index$a(View)(function (
|
|
9824
|
-
var themePosition =
|
|
9825
|
-
theme =
|
|
9826
|
-
themeIsCompact =
|
|
9891
|
+
var StyledButtonIconWrapper = index$a(View)(function (_ref5) {
|
|
9892
|
+
var themePosition = _ref5.themePosition,
|
|
9893
|
+
theme = _ref5.theme,
|
|
9894
|
+
themeIsCompact = _ref5.themeIsCompact;
|
|
9827
9895
|
switch (themePosition) {
|
|
9828
9896
|
case 'left':
|
|
9829
9897
|
return {
|
|
@@ -9835,12 +9903,12 @@ var StyledButtonIconWrapper = index$a(View)(function (_ref4) {
|
|
|
9835
9903
|
};
|
|
9836
9904
|
}
|
|
9837
9905
|
});
|
|
9838
|
-
var StyledButtonIcon = index$a(Icon)(function (
|
|
9839
|
-
var disabled =
|
|
9840
|
-
themeButtonVariant =
|
|
9841
|
-
themeIsPressed =
|
|
9842
|
-
theme =
|
|
9843
|
-
themeIsCompact =
|
|
9906
|
+
var StyledButtonIcon = index$a(Icon)(function (_ref6) {
|
|
9907
|
+
var disabled = _ref6.disabled,
|
|
9908
|
+
themeButtonVariant = _ref6.themeButtonVariant,
|
|
9909
|
+
themeIsPressed = _ref6.themeIsPressed,
|
|
9910
|
+
theme = _ref6.theme,
|
|
9911
|
+
themeIsCompact = _ref6.themeIsCompact;
|
|
9844
9912
|
var themeStyling = function themeStyling() {
|
|
9845
9913
|
switch (themeButtonVariant) {
|
|
9846
9914
|
case 'filled-primary':
|
|
@@ -9861,6 +9929,14 @@ var StyledButtonIcon = index$a(Icon)(function (_ref5) {
|
|
|
9861
9929
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9862
9930
|
case 'text-danger':
|
|
9863
9931
|
return genTextStyles(theme, 'danger', disabled, themeIsPressed);
|
|
9932
|
+
case 'filled-white':
|
|
9933
|
+
case 'outlined-white':
|
|
9934
|
+
case 'text-white':
|
|
9935
|
+
return genWhiteTextStyles({
|
|
9936
|
+
variant: themeButtonVariant,
|
|
9937
|
+
disabled: disabled,
|
|
9938
|
+
theme: theme
|
|
9939
|
+
});
|
|
9864
9940
|
}
|
|
9865
9941
|
};
|
|
9866
9942
|
return _objectSpread2({
|
|
@@ -9874,17 +9950,20 @@ var isIconName = function isIconName(icon) {
|
|
|
9874
9950
|
var FILLED_VARIANTS = {
|
|
9875
9951
|
primary: 'filled-primary',
|
|
9876
9952
|
secondary: 'filled-secondary',
|
|
9877
|
-
danger: 'filled-danger'
|
|
9953
|
+
danger: 'filled-danger',
|
|
9954
|
+
white: 'filled-white'
|
|
9878
9955
|
};
|
|
9879
9956
|
var OUTLINED_VARIANTS = {
|
|
9880
9957
|
primary: 'outlined-primary',
|
|
9881
9958
|
secondary: 'outlined-secondary',
|
|
9882
|
-
danger: 'outlined-danger'
|
|
9959
|
+
danger: 'outlined-danger',
|
|
9960
|
+
white: 'outlined-white'
|
|
9883
9961
|
};
|
|
9884
9962
|
var TEXT_VARIANTS = {
|
|
9885
9963
|
primary: 'text-primary',
|
|
9886
9964
|
secondary: 'text-secondary',
|
|
9887
|
-
danger: 'text-danger'
|
|
9965
|
+
danger: 'text-danger',
|
|
9966
|
+
white: 'text-white'
|
|
9888
9967
|
};
|
|
9889
9968
|
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
9890
9969
|
switch (variant) {
|
|
@@ -9906,23 +9985,29 @@ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
|
|
|
9906
9985
|
return theme.__hd__.button.colors.pressedBackground.filledSecondary;
|
|
9907
9986
|
case 'filled-danger':
|
|
9908
9987
|
return theme.__hd__.button.colors.pressedBackground.filledDanger;
|
|
9988
|
+
case 'filled-white':
|
|
9989
|
+
return theme.__hd__.button.colors.pressedBackground.filledWhite;
|
|
9909
9990
|
case 'outlined-primary':
|
|
9910
9991
|
return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
|
|
9911
9992
|
case 'outlined-secondary':
|
|
9912
9993
|
return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
|
|
9913
9994
|
case 'outlined-danger':
|
|
9914
9995
|
return theme.__hd__.button.colors.pressedBackground.outlineDanger;
|
|
9996
|
+
case 'outlined-white':
|
|
9997
|
+
return theme.__hd__.button.colors.pressedBackground.outlineWhite;
|
|
9915
9998
|
case 'text-primary':
|
|
9916
9999
|
return theme.__hd__.button.colors.pressedBackground.textPrimary;
|
|
9917
10000
|
case 'text-secondary':
|
|
9918
10001
|
return theme.__hd__.button.colors.pressedBackground.textSecondary;
|
|
9919
10002
|
case 'text-danger':
|
|
9920
10003
|
return theme.__hd__.button.colors.pressedBackground.textDanger;
|
|
10004
|
+
case 'text-white':
|
|
10005
|
+
return theme.__hd__.button.colors.pressedBackground.textWhite;
|
|
9921
10006
|
}
|
|
9922
10007
|
};
|
|
9923
10008
|
var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
|
|
9924
10009
|
function isTextVariant(themeVariant) {
|
|
9925
|
-
return ['text-primary', 'text-secondary', 'text-danger'].includes(themeVariant);
|
|
10010
|
+
return ['text-primary', 'text-secondary', 'text-danger', 'text-white'].includes(themeVariant);
|
|
9926
10011
|
}
|
|
9927
10012
|
var Button = function Button(_ref) {
|
|
9928
10013
|
var accessibilityHint = _ref.accessibilityHint,
|
|
@@ -9967,7 +10052,7 @@ var Button = function Button(_ref) {
|
|
|
9967
10052
|
};
|
|
9968
10053
|
var renderTitle = function renderTitle() {
|
|
9969
10054
|
return isCompactVariant ? /*#__PURE__*/React__default.createElement(StyledSmallButtonText, {
|
|
9970
|
-
variant: "small",
|
|
10055
|
+
variant: "small-bold",
|
|
9971
10056
|
ellipsizeMode: "tail",
|
|
9972
10057
|
numberOfLines: 1,
|
|
9973
10058
|
disabled: disabled,
|
package/lib/index.js
CHANGED
|
@@ -2539,6 +2539,7 @@ var getButtonTheme = function getButtonTheme(theme) {
|
|
|
2539
2539
|
primary: theme.colors.primary,
|
|
2540
2540
|
secondary: theme.colors.mutedOnDefaultGlobalSurface,
|
|
2541
2541
|
danger: theme.colors.onErrorSurface,
|
|
2542
|
+
white: theme.colors.defaultGlobalSurface,
|
|
2542
2543
|
defaultText: theme.colors.onDefaultGlobalSurface,
|
|
2543
2544
|
disabledText: theme.colors.disabledOnDefaultGlobalSurface,
|
|
2544
2545
|
disabledBorder: theme.colors.disabledOnDefaultGlobalSurface,
|
|
@@ -2550,17 +2551,21 @@ var getButtonTheme = function getButtonTheme(theme) {
|
|
|
2550
2551
|
filledPrimary: theme.colors.pressedSurface,
|
|
2551
2552
|
filledSecondary: theme.colors.pressedSurface,
|
|
2552
2553
|
filledDanger: theme.colors.errorSurface,
|
|
2554
|
+
filledWhite: theme.colors.highlightedSurface,
|
|
2553
2555
|
outlinedPrimary: theme.colors.highlightedSurface,
|
|
2554
2556
|
outlinedSecondary: theme.colors.highlightedSurface,
|
|
2555
2557
|
outlineDanger: theme.colors.errorSurface,
|
|
2558
|
+
outlineWhite: theme.colors.pressedSurface,
|
|
2556
2559
|
textPrimary: theme.colors.highlightedSurface,
|
|
2557
2560
|
textSecondary: theme.colors.neutralGlobalSurface,
|
|
2558
|
-
textDanger: theme.colors.errorSurface
|
|
2561
|
+
textDanger: theme.colors.errorSurface,
|
|
2562
|
+
textWhite: theme.colors.pressedSurface
|
|
2559
2563
|
},
|
|
2560
2564
|
pressedText: {
|
|
2561
2565
|
primary: theme.colors.pressedSurface,
|
|
2562
2566
|
secondary: theme.colors.onDefaultGlobalSurface,
|
|
2563
|
-
danger: theme.colors.mutedError
|
|
2567
|
+
danger: theme.colors.mutedError,
|
|
2568
|
+
white: theme.colors.pressedSurface
|
|
2564
2569
|
}
|
|
2565
2570
|
};
|
|
2566
2571
|
var lineHeights = {
|
|
@@ -8859,6 +8864,10 @@ var space = {
|
|
|
8859
8864
|
paddingVertical: {
|
|
8860
8865
|
property: 'paddingVertical',
|
|
8861
8866
|
scale: 'space'
|
|
8867
|
+
},
|
|
8868
|
+
gap: {
|
|
8869
|
+
property: 'gap',
|
|
8870
|
+
scale: 'space'
|
|
8862
8871
|
}
|
|
8863
8872
|
};
|
|
8864
8873
|
var radii = {
|
|
@@ -9591,15 +9600,18 @@ var StyledLoadingDot = index$a(reactNative.View)(function (_ref) {
|
|
|
9591
9600
|
case 'filled-primary':
|
|
9592
9601
|
case 'filled-secondary':
|
|
9593
9602
|
case 'filled-danger':
|
|
9603
|
+
case 'outlined-white':
|
|
9604
|
+
case 'text-white':
|
|
9594
9605
|
return {
|
|
9595
9606
|
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
9596
9607
|
};
|
|
9608
|
+
case 'filled-white':
|
|
9597
9609
|
case 'outlined-primary':
|
|
9598
9610
|
return genLoadingIndicatorStyles(theme, 'primary');
|
|
9599
9611
|
case 'text-primary':
|
|
9600
9612
|
case 'outlined-secondary':
|
|
9601
|
-
case 'text-secondary':
|
|
9602
9613
|
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
9614
|
+
case 'text-secondary':
|
|
9603
9615
|
case 'outlined-danger':
|
|
9604
9616
|
case 'text-danger':
|
|
9605
9617
|
return genLoadingIndicatorStyles(theme, 'danger');
|
|
@@ -9773,15 +9785,20 @@ var StyledButtonContainer = index$a(reactNative.TouchableHighlight)(function (_r
|
|
|
9773
9785
|
return genFilledContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9774
9786
|
case 'filled-danger':
|
|
9775
9787
|
return genFilledContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9788
|
+
case 'filled-white':
|
|
9789
|
+
return genFilledContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9776
9790
|
case 'outlined-primary':
|
|
9777
9791
|
return genOutlineContainerStyles(theme, 'primary', disabled, loading, themeIsCompact);
|
|
9778
9792
|
case 'outlined-secondary':
|
|
9779
9793
|
return genOutlineContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9780
9794
|
case 'outlined-danger':
|
|
9781
9795
|
return genOutlineContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9796
|
+
case 'outlined-white':
|
|
9797
|
+
return genOutlineContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9782
9798
|
case 'text-primary':
|
|
9783
9799
|
case 'text-secondary':
|
|
9784
9800
|
case 'text-danger':
|
|
9801
|
+
case 'text-white':
|
|
9785
9802
|
return {
|
|
9786
9803
|
height: themeInlineText ? undefined : getButtonHeight(themeIsCompact),
|
|
9787
9804
|
borderRadius: theme.__hd__.button.radii.text,
|
|
@@ -9790,14 +9807,51 @@ var StyledButtonContainer = index$a(reactNative.TouchableHighlight)(function (_r
|
|
|
9790
9807
|
alignItems: 'center',
|
|
9791
9808
|
padding: themeInlineText ? 0 : theme.__hd__.button.space["default"].textButtonPadding,
|
|
9792
9809
|
borderWidth: 0,
|
|
9793
|
-
backgroundColor: loading && !themeInlineText ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9810
|
+
backgroundColor: loading && !themeInlineText && themeButtonVariant !== 'text-white' ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9794
9811
|
};
|
|
9795
9812
|
}
|
|
9796
9813
|
});
|
|
9797
|
-
var
|
|
9798
|
-
var
|
|
9799
|
-
|
|
9814
|
+
var genWhiteTextStyles = function genWhiteTextStyles(_ref2) {
|
|
9815
|
+
var variant = _ref2.variant,
|
|
9816
|
+
disabled = _ref2.disabled,
|
|
9800
9817
|
theme = _ref2.theme;
|
|
9818
|
+
if (disabled) {
|
|
9819
|
+
switch (variant) {
|
|
9820
|
+
case 'filled-white':
|
|
9821
|
+
{
|
|
9822
|
+
return {
|
|
9823
|
+
color: theme.__hd__.button.colors.invertedText
|
|
9824
|
+
};
|
|
9825
|
+
}
|
|
9826
|
+
case 'outlined-white':
|
|
9827
|
+
case 'text-white':
|
|
9828
|
+
{
|
|
9829
|
+
return {
|
|
9830
|
+
color: theme.__hd__.button.colors.disabledText
|
|
9831
|
+
};
|
|
9832
|
+
}
|
|
9833
|
+
}
|
|
9834
|
+
}
|
|
9835
|
+
switch (variant) {
|
|
9836
|
+
case 'filled-white':
|
|
9837
|
+
{
|
|
9838
|
+
return {
|
|
9839
|
+
color: theme.__hd__.button.colors.primary
|
|
9840
|
+
};
|
|
9841
|
+
}
|
|
9842
|
+
case 'outlined-white':
|
|
9843
|
+
case 'text-white':
|
|
9844
|
+
{
|
|
9845
|
+
return {
|
|
9846
|
+
color: theme.__hd__.button.colors.invertedText
|
|
9847
|
+
};
|
|
9848
|
+
}
|
|
9849
|
+
}
|
|
9850
|
+
};
|
|
9851
|
+
var StyledButtonText = index$a(Typography.Title)(function (_ref3) {
|
|
9852
|
+
var disabled = _ref3.disabled,
|
|
9853
|
+
themeButtonVariant = _ref3.themeButtonVariant,
|
|
9854
|
+
theme = _ref3.theme;
|
|
9801
9855
|
var themeStyling = function themeStyling() {
|
|
9802
9856
|
switch (themeButtonVariant) {
|
|
9803
9857
|
case 'filled-primary':
|
|
@@ -9818,6 +9872,14 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9818
9872
|
return genTextStyles(theme, 'secondary', disabled);
|
|
9819
9873
|
case 'text-danger':
|
|
9820
9874
|
return genTextStyles(theme, 'danger', disabled);
|
|
9875
|
+
case 'filled-white':
|
|
9876
|
+
case 'outlined-white':
|
|
9877
|
+
case 'text-white':
|
|
9878
|
+
return genWhiteTextStyles({
|
|
9879
|
+
variant: themeButtonVariant,
|
|
9880
|
+
disabled: disabled,
|
|
9881
|
+
theme: theme
|
|
9882
|
+
});
|
|
9821
9883
|
}
|
|
9822
9884
|
};
|
|
9823
9885
|
return _objectSpread2({
|
|
@@ -9826,11 +9888,11 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9826
9888
|
}, themeStyling());
|
|
9827
9889
|
});
|
|
9828
9890
|
var StyledSmallButtonText = StyledButtonText.withComponent(Typography.Body);
|
|
9829
|
-
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (
|
|
9830
|
-
var disabled =
|
|
9831
|
-
themeButtonVariant =
|
|
9832
|
-
themeIsPressed =
|
|
9833
|
-
theme =
|
|
9891
|
+
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref4) {
|
|
9892
|
+
var disabled = _ref4.disabled,
|
|
9893
|
+
themeButtonVariant = _ref4.themeButtonVariant,
|
|
9894
|
+
themeIsPressed = _ref4.themeIsPressed,
|
|
9895
|
+
theme = _ref4.theme;
|
|
9834
9896
|
var themeStyling = function themeStyling() {
|
|
9835
9897
|
switch (themeButtonVariant) {
|
|
9836
9898
|
case 'text-primary':
|
|
@@ -9839,6 +9901,12 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9839
9901
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9840
9902
|
case 'text-danger':
|
|
9841
9903
|
return genTextStyles(theme, 'danger', disabled, themeIsPressed);
|
|
9904
|
+
case 'text-white':
|
|
9905
|
+
return genWhiteTextStyles({
|
|
9906
|
+
variant: 'text-white',
|
|
9907
|
+
disabled: disabled,
|
|
9908
|
+
theme: theme
|
|
9909
|
+
});
|
|
9842
9910
|
}
|
|
9843
9911
|
};
|
|
9844
9912
|
return _objectSpread2({
|
|
@@ -9848,10 +9916,10 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9848
9916
|
textAlign: 'center'
|
|
9849
9917
|
}, themeStyling());
|
|
9850
9918
|
});
|
|
9851
|
-
var StyledButtonIconWrapper = index$a(reactNative.View)(function (
|
|
9852
|
-
var themePosition =
|
|
9853
|
-
theme =
|
|
9854
|
-
themeIsCompact =
|
|
9919
|
+
var StyledButtonIconWrapper = index$a(reactNative.View)(function (_ref5) {
|
|
9920
|
+
var themePosition = _ref5.themePosition,
|
|
9921
|
+
theme = _ref5.theme,
|
|
9922
|
+
themeIsCompact = _ref5.themeIsCompact;
|
|
9855
9923
|
switch (themePosition) {
|
|
9856
9924
|
case 'left':
|
|
9857
9925
|
return {
|
|
@@ -9863,12 +9931,12 @@ var StyledButtonIconWrapper = index$a(reactNative.View)(function (_ref4) {
|
|
|
9863
9931
|
};
|
|
9864
9932
|
}
|
|
9865
9933
|
});
|
|
9866
|
-
var StyledButtonIcon = index$a(Icon)(function (
|
|
9867
|
-
var disabled =
|
|
9868
|
-
themeButtonVariant =
|
|
9869
|
-
themeIsPressed =
|
|
9870
|
-
theme =
|
|
9871
|
-
themeIsCompact =
|
|
9934
|
+
var StyledButtonIcon = index$a(Icon)(function (_ref6) {
|
|
9935
|
+
var disabled = _ref6.disabled,
|
|
9936
|
+
themeButtonVariant = _ref6.themeButtonVariant,
|
|
9937
|
+
themeIsPressed = _ref6.themeIsPressed,
|
|
9938
|
+
theme = _ref6.theme,
|
|
9939
|
+
themeIsCompact = _ref6.themeIsCompact;
|
|
9872
9940
|
var themeStyling = function themeStyling() {
|
|
9873
9941
|
switch (themeButtonVariant) {
|
|
9874
9942
|
case 'filled-primary':
|
|
@@ -9889,6 +9957,14 @@ var StyledButtonIcon = index$a(Icon)(function (_ref5) {
|
|
|
9889
9957
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9890
9958
|
case 'text-danger':
|
|
9891
9959
|
return genTextStyles(theme, 'danger', disabled, themeIsPressed);
|
|
9960
|
+
case 'filled-white':
|
|
9961
|
+
case 'outlined-white':
|
|
9962
|
+
case 'text-white':
|
|
9963
|
+
return genWhiteTextStyles({
|
|
9964
|
+
variant: themeButtonVariant,
|
|
9965
|
+
disabled: disabled,
|
|
9966
|
+
theme: theme
|
|
9967
|
+
});
|
|
9892
9968
|
}
|
|
9893
9969
|
};
|
|
9894
9970
|
return _objectSpread2({
|
|
@@ -9902,17 +9978,20 @@ var isIconName = function isIconName(icon) {
|
|
|
9902
9978
|
var FILLED_VARIANTS = {
|
|
9903
9979
|
primary: 'filled-primary',
|
|
9904
9980
|
secondary: 'filled-secondary',
|
|
9905
|
-
danger: 'filled-danger'
|
|
9981
|
+
danger: 'filled-danger',
|
|
9982
|
+
white: 'filled-white'
|
|
9906
9983
|
};
|
|
9907
9984
|
var OUTLINED_VARIANTS = {
|
|
9908
9985
|
primary: 'outlined-primary',
|
|
9909
9986
|
secondary: 'outlined-secondary',
|
|
9910
|
-
danger: 'outlined-danger'
|
|
9987
|
+
danger: 'outlined-danger',
|
|
9988
|
+
white: 'outlined-white'
|
|
9911
9989
|
};
|
|
9912
9990
|
var TEXT_VARIANTS = {
|
|
9913
9991
|
primary: 'text-primary',
|
|
9914
9992
|
secondary: 'text-secondary',
|
|
9915
|
-
danger: 'text-danger'
|
|
9993
|
+
danger: 'text-danger',
|
|
9994
|
+
white: 'text-white'
|
|
9916
9995
|
};
|
|
9917
9996
|
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
9918
9997
|
switch (variant) {
|
|
@@ -9934,23 +10013,29 @@ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
|
|
|
9934
10013
|
return theme.__hd__.button.colors.pressedBackground.filledSecondary;
|
|
9935
10014
|
case 'filled-danger':
|
|
9936
10015
|
return theme.__hd__.button.colors.pressedBackground.filledDanger;
|
|
10016
|
+
case 'filled-white':
|
|
10017
|
+
return theme.__hd__.button.colors.pressedBackground.filledWhite;
|
|
9937
10018
|
case 'outlined-primary':
|
|
9938
10019
|
return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
|
|
9939
10020
|
case 'outlined-secondary':
|
|
9940
10021
|
return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
|
|
9941
10022
|
case 'outlined-danger':
|
|
9942
10023
|
return theme.__hd__.button.colors.pressedBackground.outlineDanger;
|
|
10024
|
+
case 'outlined-white':
|
|
10025
|
+
return theme.__hd__.button.colors.pressedBackground.outlineWhite;
|
|
9943
10026
|
case 'text-primary':
|
|
9944
10027
|
return theme.__hd__.button.colors.pressedBackground.textPrimary;
|
|
9945
10028
|
case 'text-secondary':
|
|
9946
10029
|
return theme.__hd__.button.colors.pressedBackground.textSecondary;
|
|
9947
10030
|
case 'text-danger':
|
|
9948
10031
|
return theme.__hd__.button.colors.pressedBackground.textDanger;
|
|
10032
|
+
case 'text-white':
|
|
10033
|
+
return theme.__hd__.button.colors.pressedBackground.textWhite;
|
|
9949
10034
|
}
|
|
9950
10035
|
};
|
|
9951
10036
|
var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
|
|
9952
10037
|
function isTextVariant(themeVariant) {
|
|
9953
|
-
return ['text-primary', 'text-secondary', 'text-danger'].includes(themeVariant);
|
|
10038
|
+
return ['text-primary', 'text-secondary', 'text-danger', 'text-white'].includes(themeVariant);
|
|
9954
10039
|
}
|
|
9955
10040
|
var Button = function Button(_ref) {
|
|
9956
10041
|
var accessibilityHint = _ref.accessibilityHint,
|
|
@@ -9995,7 +10080,7 @@ var Button = function Button(_ref) {
|
|
|
9995
10080
|
};
|
|
9996
10081
|
var renderTitle = function renderTitle() {
|
|
9997
10082
|
return isCompactVariant ? /*#__PURE__*/React__namespace.default.createElement(StyledSmallButtonText, {
|
|
9998
|
-
variant: "small",
|
|
10083
|
+
variant: "small-bold",
|
|
9999
10084
|
ellipsizeMode: "tail",
|
|
10000
10085
|
numberOfLines: 1,
|
|
10001
10086
|
disabled: disabled,
|