@hero-design/rn 8.85.0 → 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 +6 -0
- package/es/index.js +108 -27
- package/lib/index.js +108 -27
- package/package.json +1 -1
- 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.86.0/rn-stats.html +4842 -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,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 8.85.0
|
|
4
10
|
|
|
5
11
|
### Minor 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 = {
|
|
@@ -9567,15 +9572,18 @@ var StyledLoadingDot = index$a(View)(function (_ref) {
|
|
|
9567
9572
|
case 'filled-primary':
|
|
9568
9573
|
case 'filled-secondary':
|
|
9569
9574
|
case 'filled-danger':
|
|
9575
|
+
case 'outlined-white':
|
|
9576
|
+
case 'text-white':
|
|
9570
9577
|
return {
|
|
9571
9578
|
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
9572
9579
|
};
|
|
9580
|
+
case 'filled-white':
|
|
9573
9581
|
case 'outlined-primary':
|
|
9574
9582
|
return genLoadingIndicatorStyles(theme, 'primary');
|
|
9575
9583
|
case 'text-primary':
|
|
9576
9584
|
case 'outlined-secondary':
|
|
9577
|
-
case 'text-secondary':
|
|
9578
9585
|
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
9586
|
+
case 'text-secondary':
|
|
9579
9587
|
case 'outlined-danger':
|
|
9580
9588
|
case 'text-danger':
|
|
9581
9589
|
return genLoadingIndicatorStyles(theme, 'danger');
|
|
@@ -9749,15 +9757,20 @@ var StyledButtonContainer = index$a(TouchableHighlight)(function (_ref) {
|
|
|
9749
9757
|
return genFilledContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9750
9758
|
case 'filled-danger':
|
|
9751
9759
|
return genFilledContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9760
|
+
case 'filled-white':
|
|
9761
|
+
return genFilledContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9752
9762
|
case 'outlined-primary':
|
|
9753
9763
|
return genOutlineContainerStyles(theme, 'primary', disabled, loading, themeIsCompact);
|
|
9754
9764
|
case 'outlined-secondary':
|
|
9755
9765
|
return genOutlineContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9756
9766
|
case 'outlined-danger':
|
|
9757
9767
|
return genOutlineContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9768
|
+
case 'outlined-white':
|
|
9769
|
+
return genOutlineContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9758
9770
|
case 'text-primary':
|
|
9759
9771
|
case 'text-secondary':
|
|
9760
9772
|
case 'text-danger':
|
|
9773
|
+
case 'text-white':
|
|
9761
9774
|
return {
|
|
9762
9775
|
height: themeInlineText ? undefined : getButtonHeight(themeIsCompact),
|
|
9763
9776
|
borderRadius: theme.__hd__.button.radii.text,
|
|
@@ -9766,14 +9779,51 @@ var StyledButtonContainer = index$a(TouchableHighlight)(function (_ref) {
|
|
|
9766
9779
|
alignItems: 'center',
|
|
9767
9780
|
padding: themeInlineText ? 0 : theme.__hd__.button.space["default"].textButtonPadding,
|
|
9768
9781
|
borderWidth: 0,
|
|
9769
|
-
backgroundColor: loading && !themeInlineText ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9782
|
+
backgroundColor: loading && !themeInlineText && themeButtonVariant !== 'text-white' ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9770
9783
|
};
|
|
9771
9784
|
}
|
|
9772
9785
|
});
|
|
9773
|
-
var
|
|
9774
|
-
var
|
|
9775
|
-
|
|
9786
|
+
var genWhiteTextStyles = function genWhiteTextStyles(_ref2) {
|
|
9787
|
+
var variant = _ref2.variant,
|
|
9788
|
+
disabled = _ref2.disabled,
|
|
9776
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;
|
|
9777
9827
|
var themeStyling = function themeStyling() {
|
|
9778
9828
|
switch (themeButtonVariant) {
|
|
9779
9829
|
case 'filled-primary':
|
|
@@ -9794,6 +9844,14 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9794
9844
|
return genTextStyles(theme, 'secondary', disabled);
|
|
9795
9845
|
case 'text-danger':
|
|
9796
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
|
+
});
|
|
9797
9855
|
}
|
|
9798
9856
|
};
|
|
9799
9857
|
return _objectSpread2({
|
|
@@ -9802,11 +9860,11 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9802
9860
|
}, themeStyling());
|
|
9803
9861
|
});
|
|
9804
9862
|
var StyledSmallButtonText = StyledButtonText.withComponent(Typography.Body);
|
|
9805
|
-
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (
|
|
9806
|
-
var disabled =
|
|
9807
|
-
themeButtonVariant =
|
|
9808
|
-
themeIsPressed =
|
|
9809
|
-
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;
|
|
9810
9868
|
var themeStyling = function themeStyling() {
|
|
9811
9869
|
switch (themeButtonVariant) {
|
|
9812
9870
|
case 'text-primary':
|
|
@@ -9815,6 +9873,12 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9815
9873
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9816
9874
|
case 'text-danger':
|
|
9817
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
|
+
});
|
|
9818
9882
|
}
|
|
9819
9883
|
};
|
|
9820
9884
|
return _objectSpread2({
|
|
@@ -9824,10 +9888,10 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9824
9888
|
textAlign: 'center'
|
|
9825
9889
|
}, themeStyling());
|
|
9826
9890
|
});
|
|
9827
|
-
var StyledButtonIconWrapper = index$a(View)(function (
|
|
9828
|
-
var themePosition =
|
|
9829
|
-
theme =
|
|
9830
|
-
themeIsCompact =
|
|
9891
|
+
var StyledButtonIconWrapper = index$a(View)(function (_ref5) {
|
|
9892
|
+
var themePosition = _ref5.themePosition,
|
|
9893
|
+
theme = _ref5.theme,
|
|
9894
|
+
themeIsCompact = _ref5.themeIsCompact;
|
|
9831
9895
|
switch (themePosition) {
|
|
9832
9896
|
case 'left':
|
|
9833
9897
|
return {
|
|
@@ -9839,12 +9903,12 @@ var StyledButtonIconWrapper = index$a(View)(function (_ref4) {
|
|
|
9839
9903
|
};
|
|
9840
9904
|
}
|
|
9841
9905
|
});
|
|
9842
|
-
var StyledButtonIcon = index$a(Icon)(function (
|
|
9843
|
-
var disabled =
|
|
9844
|
-
themeButtonVariant =
|
|
9845
|
-
themeIsPressed =
|
|
9846
|
-
theme =
|
|
9847
|
-
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;
|
|
9848
9912
|
var themeStyling = function themeStyling() {
|
|
9849
9913
|
switch (themeButtonVariant) {
|
|
9850
9914
|
case 'filled-primary':
|
|
@@ -9865,6 +9929,14 @@ var StyledButtonIcon = index$a(Icon)(function (_ref5) {
|
|
|
9865
9929
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9866
9930
|
case 'text-danger':
|
|
9867
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
|
+
});
|
|
9868
9940
|
}
|
|
9869
9941
|
};
|
|
9870
9942
|
return _objectSpread2({
|
|
@@ -9878,17 +9950,20 @@ var isIconName = function isIconName(icon) {
|
|
|
9878
9950
|
var FILLED_VARIANTS = {
|
|
9879
9951
|
primary: 'filled-primary',
|
|
9880
9952
|
secondary: 'filled-secondary',
|
|
9881
|
-
danger: 'filled-danger'
|
|
9953
|
+
danger: 'filled-danger',
|
|
9954
|
+
white: 'filled-white'
|
|
9882
9955
|
};
|
|
9883
9956
|
var OUTLINED_VARIANTS = {
|
|
9884
9957
|
primary: 'outlined-primary',
|
|
9885
9958
|
secondary: 'outlined-secondary',
|
|
9886
|
-
danger: 'outlined-danger'
|
|
9959
|
+
danger: 'outlined-danger',
|
|
9960
|
+
white: 'outlined-white'
|
|
9887
9961
|
};
|
|
9888
9962
|
var TEXT_VARIANTS = {
|
|
9889
9963
|
primary: 'text-primary',
|
|
9890
9964
|
secondary: 'text-secondary',
|
|
9891
|
-
danger: 'text-danger'
|
|
9965
|
+
danger: 'text-danger',
|
|
9966
|
+
white: 'text-white'
|
|
9892
9967
|
};
|
|
9893
9968
|
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
9894
9969
|
switch (variant) {
|
|
@@ -9910,23 +9985,29 @@ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
|
|
|
9910
9985
|
return theme.__hd__.button.colors.pressedBackground.filledSecondary;
|
|
9911
9986
|
case 'filled-danger':
|
|
9912
9987
|
return theme.__hd__.button.colors.pressedBackground.filledDanger;
|
|
9988
|
+
case 'filled-white':
|
|
9989
|
+
return theme.__hd__.button.colors.pressedBackground.filledWhite;
|
|
9913
9990
|
case 'outlined-primary':
|
|
9914
9991
|
return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
|
|
9915
9992
|
case 'outlined-secondary':
|
|
9916
9993
|
return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
|
|
9917
9994
|
case 'outlined-danger':
|
|
9918
9995
|
return theme.__hd__.button.colors.pressedBackground.outlineDanger;
|
|
9996
|
+
case 'outlined-white':
|
|
9997
|
+
return theme.__hd__.button.colors.pressedBackground.outlineWhite;
|
|
9919
9998
|
case 'text-primary':
|
|
9920
9999
|
return theme.__hd__.button.colors.pressedBackground.textPrimary;
|
|
9921
10000
|
case 'text-secondary':
|
|
9922
10001
|
return theme.__hd__.button.colors.pressedBackground.textSecondary;
|
|
9923
10002
|
case 'text-danger':
|
|
9924
10003
|
return theme.__hd__.button.colors.pressedBackground.textDanger;
|
|
10004
|
+
case 'text-white':
|
|
10005
|
+
return theme.__hd__.button.colors.pressedBackground.textWhite;
|
|
9925
10006
|
}
|
|
9926
10007
|
};
|
|
9927
10008
|
var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
|
|
9928
10009
|
function isTextVariant(themeVariant) {
|
|
9929
|
-
return ['text-primary', 'text-secondary', 'text-danger'].includes(themeVariant);
|
|
10010
|
+
return ['text-primary', 'text-secondary', 'text-danger', 'text-white'].includes(themeVariant);
|
|
9930
10011
|
}
|
|
9931
10012
|
var Button = function Button(_ref) {
|
|
9932
10013
|
var accessibilityHint = _ref.accessibilityHint,
|
|
@@ -9971,7 +10052,7 @@ var Button = function Button(_ref) {
|
|
|
9971
10052
|
};
|
|
9972
10053
|
var renderTitle = function renderTitle() {
|
|
9973
10054
|
return isCompactVariant ? /*#__PURE__*/React__default.createElement(StyledSmallButtonText, {
|
|
9974
|
-
variant: "small",
|
|
10055
|
+
variant: "small-bold",
|
|
9975
10056
|
ellipsizeMode: "tail",
|
|
9976
10057
|
numberOfLines: 1,
|
|
9977
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 = {
|
|
@@ -9595,15 +9600,18 @@ var StyledLoadingDot = index$a(reactNative.View)(function (_ref) {
|
|
|
9595
9600
|
case 'filled-primary':
|
|
9596
9601
|
case 'filled-secondary':
|
|
9597
9602
|
case 'filled-danger':
|
|
9603
|
+
case 'outlined-white':
|
|
9604
|
+
case 'text-white':
|
|
9598
9605
|
return {
|
|
9599
9606
|
backgroundColor: theme.__hd__.button.colors.invertedText
|
|
9600
9607
|
};
|
|
9608
|
+
case 'filled-white':
|
|
9601
9609
|
case 'outlined-primary':
|
|
9602
9610
|
return genLoadingIndicatorStyles(theme, 'primary');
|
|
9603
9611
|
case 'text-primary':
|
|
9604
9612
|
case 'outlined-secondary':
|
|
9605
|
-
case 'text-secondary':
|
|
9606
9613
|
return genLoadingIndicatorStyles(theme, 'secondary');
|
|
9614
|
+
case 'text-secondary':
|
|
9607
9615
|
case 'outlined-danger':
|
|
9608
9616
|
case 'text-danger':
|
|
9609
9617
|
return genLoadingIndicatorStyles(theme, 'danger');
|
|
@@ -9777,15 +9785,20 @@ var StyledButtonContainer = index$a(reactNative.TouchableHighlight)(function (_r
|
|
|
9777
9785
|
return genFilledContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9778
9786
|
case 'filled-danger':
|
|
9779
9787
|
return genFilledContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9788
|
+
case 'filled-white':
|
|
9789
|
+
return genFilledContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9780
9790
|
case 'outlined-primary':
|
|
9781
9791
|
return genOutlineContainerStyles(theme, 'primary', disabled, loading, themeIsCompact);
|
|
9782
9792
|
case 'outlined-secondary':
|
|
9783
9793
|
return genOutlineContainerStyles(theme, 'secondary', disabled, loading, themeIsCompact);
|
|
9784
9794
|
case 'outlined-danger':
|
|
9785
9795
|
return genOutlineContainerStyles(theme, 'danger', disabled, loading, themeIsCompact);
|
|
9796
|
+
case 'outlined-white':
|
|
9797
|
+
return genOutlineContainerStyles(theme, 'white', disabled, loading, themeIsCompact);
|
|
9786
9798
|
case 'text-primary':
|
|
9787
9799
|
case 'text-secondary':
|
|
9788
9800
|
case 'text-danger':
|
|
9801
|
+
case 'text-white':
|
|
9789
9802
|
return {
|
|
9790
9803
|
height: themeInlineText ? undefined : getButtonHeight(themeIsCompact),
|
|
9791
9804
|
borderRadius: theme.__hd__.button.radii.text,
|
|
@@ -9794,14 +9807,51 @@ var StyledButtonContainer = index$a(reactNative.TouchableHighlight)(function (_r
|
|
|
9794
9807
|
alignItems: 'center',
|
|
9795
9808
|
padding: themeInlineText ? 0 : theme.__hd__.button.space["default"].textButtonPadding,
|
|
9796
9809
|
borderWidth: 0,
|
|
9797
|
-
backgroundColor: loading && !themeInlineText ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9810
|
+
backgroundColor: loading && !themeInlineText && themeButtonVariant !== 'text-white' ? theme.__hd__.button.colors.textLoadingBackground : 'transparent'
|
|
9798
9811
|
};
|
|
9799
9812
|
}
|
|
9800
9813
|
});
|
|
9801
|
-
var
|
|
9802
|
-
var
|
|
9803
|
-
|
|
9814
|
+
var genWhiteTextStyles = function genWhiteTextStyles(_ref2) {
|
|
9815
|
+
var variant = _ref2.variant,
|
|
9816
|
+
disabled = _ref2.disabled,
|
|
9804
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;
|
|
9805
9855
|
var themeStyling = function themeStyling() {
|
|
9806
9856
|
switch (themeButtonVariant) {
|
|
9807
9857
|
case 'filled-primary':
|
|
@@ -9822,6 +9872,14 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9822
9872
|
return genTextStyles(theme, 'secondary', disabled);
|
|
9823
9873
|
case 'text-danger':
|
|
9824
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
|
+
});
|
|
9825
9883
|
}
|
|
9826
9884
|
};
|
|
9827
9885
|
return _objectSpread2({
|
|
@@ -9830,11 +9888,11 @@ var StyledButtonText = index$a(Typography.Title)(function (_ref2) {
|
|
|
9830
9888
|
}, themeStyling());
|
|
9831
9889
|
});
|
|
9832
9890
|
var StyledSmallButtonText = StyledButtonText.withComponent(Typography.Body);
|
|
9833
|
-
var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (
|
|
9834
|
-
var disabled =
|
|
9835
|
-
themeButtonVariant =
|
|
9836
|
-
themeIsPressed =
|
|
9837
|
-
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;
|
|
9838
9896
|
var themeStyling = function themeStyling() {
|
|
9839
9897
|
switch (themeButtonVariant) {
|
|
9840
9898
|
case 'text-primary':
|
|
@@ -9843,6 +9901,12 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9843
9901
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9844
9902
|
case 'text-danger':
|
|
9845
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
|
+
});
|
|
9846
9910
|
}
|
|
9847
9911
|
};
|
|
9848
9912
|
return _objectSpread2({
|
|
@@ -9852,10 +9916,10 @@ var StyledButtonTitleOfVariantText = index$a(Typography.Body)(function (_ref3) {
|
|
|
9852
9916
|
textAlign: 'center'
|
|
9853
9917
|
}, themeStyling());
|
|
9854
9918
|
});
|
|
9855
|
-
var StyledButtonIconWrapper = index$a(reactNative.View)(function (
|
|
9856
|
-
var themePosition =
|
|
9857
|
-
theme =
|
|
9858
|
-
themeIsCompact =
|
|
9919
|
+
var StyledButtonIconWrapper = index$a(reactNative.View)(function (_ref5) {
|
|
9920
|
+
var themePosition = _ref5.themePosition,
|
|
9921
|
+
theme = _ref5.theme,
|
|
9922
|
+
themeIsCompact = _ref5.themeIsCompact;
|
|
9859
9923
|
switch (themePosition) {
|
|
9860
9924
|
case 'left':
|
|
9861
9925
|
return {
|
|
@@ -9867,12 +9931,12 @@ var StyledButtonIconWrapper = index$a(reactNative.View)(function (_ref4) {
|
|
|
9867
9931
|
};
|
|
9868
9932
|
}
|
|
9869
9933
|
});
|
|
9870
|
-
var StyledButtonIcon = index$a(Icon)(function (
|
|
9871
|
-
var disabled =
|
|
9872
|
-
themeButtonVariant =
|
|
9873
|
-
themeIsPressed =
|
|
9874
|
-
theme =
|
|
9875
|
-
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;
|
|
9876
9940
|
var themeStyling = function themeStyling() {
|
|
9877
9941
|
switch (themeButtonVariant) {
|
|
9878
9942
|
case 'filled-primary':
|
|
@@ -9893,6 +9957,14 @@ var StyledButtonIcon = index$a(Icon)(function (_ref5) {
|
|
|
9893
9957
|
return genTextStyles(theme, 'secondary', disabled, themeIsPressed);
|
|
9894
9958
|
case 'text-danger':
|
|
9895
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
|
+
});
|
|
9896
9968
|
}
|
|
9897
9969
|
};
|
|
9898
9970
|
return _objectSpread2({
|
|
@@ -9906,17 +9978,20 @@ var isIconName = function isIconName(icon) {
|
|
|
9906
9978
|
var FILLED_VARIANTS = {
|
|
9907
9979
|
primary: 'filled-primary',
|
|
9908
9980
|
secondary: 'filled-secondary',
|
|
9909
|
-
danger: 'filled-danger'
|
|
9981
|
+
danger: 'filled-danger',
|
|
9982
|
+
white: 'filled-white'
|
|
9910
9983
|
};
|
|
9911
9984
|
var OUTLINED_VARIANTS = {
|
|
9912
9985
|
primary: 'outlined-primary',
|
|
9913
9986
|
secondary: 'outlined-secondary',
|
|
9914
|
-
danger: 'outlined-danger'
|
|
9987
|
+
danger: 'outlined-danger',
|
|
9988
|
+
white: 'outlined-white'
|
|
9915
9989
|
};
|
|
9916
9990
|
var TEXT_VARIANTS = {
|
|
9917
9991
|
primary: 'text-primary',
|
|
9918
9992
|
secondary: 'text-secondary',
|
|
9919
|
-
danger: 'text-danger'
|
|
9993
|
+
danger: 'text-danger',
|
|
9994
|
+
white: 'text-white'
|
|
9920
9995
|
};
|
|
9921
9996
|
var getThemeVariant = function getThemeVariant(variant, intent) {
|
|
9922
9997
|
switch (variant) {
|
|
@@ -9938,23 +10013,29 @@ var getUnderlayColor = function getUnderlayColor(theme, themeVariant) {
|
|
|
9938
10013
|
return theme.__hd__.button.colors.pressedBackground.filledSecondary;
|
|
9939
10014
|
case 'filled-danger':
|
|
9940
10015
|
return theme.__hd__.button.colors.pressedBackground.filledDanger;
|
|
10016
|
+
case 'filled-white':
|
|
10017
|
+
return theme.__hd__.button.colors.pressedBackground.filledWhite;
|
|
9941
10018
|
case 'outlined-primary':
|
|
9942
10019
|
return theme.__hd__.button.colors.pressedBackground.outlinedPrimary;
|
|
9943
10020
|
case 'outlined-secondary':
|
|
9944
10021
|
return theme.__hd__.button.colors.pressedBackground.outlinedSecondary;
|
|
9945
10022
|
case 'outlined-danger':
|
|
9946
10023
|
return theme.__hd__.button.colors.pressedBackground.outlineDanger;
|
|
10024
|
+
case 'outlined-white':
|
|
10025
|
+
return theme.__hd__.button.colors.pressedBackground.outlineWhite;
|
|
9947
10026
|
case 'text-primary':
|
|
9948
10027
|
return theme.__hd__.button.colors.pressedBackground.textPrimary;
|
|
9949
10028
|
case 'text-secondary':
|
|
9950
10029
|
return theme.__hd__.button.colors.pressedBackground.textSecondary;
|
|
9951
10030
|
case 'text-danger':
|
|
9952
10031
|
return theme.__hd__.button.colors.pressedBackground.textDanger;
|
|
10032
|
+
case 'text-white':
|
|
10033
|
+
return theme.__hd__.button.colors.pressedBackground.textWhite;
|
|
9953
10034
|
}
|
|
9954
10035
|
};
|
|
9955
10036
|
var deprecatedVariants = ['filled-secondary', 'filled-danger', 'outlined-secondary', 'outlined-danger'];
|
|
9956
10037
|
function isTextVariant(themeVariant) {
|
|
9957
|
-
return ['text-primary', 'text-secondary', 'text-danger'].includes(themeVariant);
|
|
10038
|
+
return ['text-primary', 'text-secondary', 'text-danger', 'text-white'].includes(themeVariant);
|
|
9958
10039
|
}
|
|
9959
10040
|
var Button = function Button(_ref) {
|
|
9960
10041
|
var accessibilityHint = _ref.accessibilityHint,
|
|
@@ -9999,7 +10080,7 @@ var Button = function Button(_ref) {
|
|
|
9999
10080
|
};
|
|
10000
10081
|
var renderTitle = function renderTitle() {
|
|
10001
10082
|
return isCompactVariant ? /*#__PURE__*/React__namespace.default.createElement(StyledSmallButtonText, {
|
|
10002
|
-
variant: "small",
|
|
10083
|
+
variant: "small-bold",
|
|
10003
10084
|
ellipsizeMode: "tail",
|
|
10004
10085
|
numberOfLines: 1,
|
|
10005
10086
|
disabled: disabled,
|