@hero-design/rn 8.128.0 → 8.128.1
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/CHANGELOG.md +15 -0
- package/CLAUDE.md +1 -1
- package/es/index.js +61 -50
- package/lib/index.js +61 -50
- package/package.json +1 -1
- package/src/components/FAB/FAB.tsx +37 -5
- package/src/components/FAB/Pair/StyledFAB.tsx +2 -2
- package/src/components/FAB/Pair/index.tsx +6 -0
- package/src/components/FAB/StyledFAB.tsx +3 -1
- package/src/components/StatusScreens/Error/StyledError.tsx +0 -6
- package/src/components/StatusScreens/Error/index.tsx +2 -6
- package/src/components/StatusScreens/Success/StyledSuccess.tsx +0 -6
- package/src/components/StatusScreens/Success/index.tsx +2 -2
- package/src/theme/components/fab.ts +12 -11
- package/src/theme/global/colors/ehJobs.ts +1 -0
- package/src/theme/global/colors/ehWork.ts +1 -1
- package/types/components/Checkbox/StyledInlineCheckBox.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +5 -1
- package/types/components/FAB/Pair/StyledFAB.d.ts +3 -1
- package/types/components/FAB/StyledFAB.d.ts +1 -0
- package/types/components/StatusScreens/Error/StyledError.d.ts +1 -5
- package/types/components/StatusScreens/Success/StyledSuccess.d.ts +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.128.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#5088](https://github.com/Thinkei/hero-design/pull/5088) [`8a8a649b3d2ad1fa030be516afb94841ac4d7fa9`](https://github.com/Thinkei/hero-design/commit/8a8a649b3d2ad1fa030be516afb94841ac4d7fa9) Thanks [@ttkien](https://github.com/ttkien)! - [Error][success] fix: remove erroneous padding from StatusScreen buttons
|
|
8
|
+
|
|
9
|
+
- [#5085](https://github.com/Thinkei/hero-design/pull/5085) [`850eafeaec709444144e6cbe3cc15d53653c2088`](https://github.com/Thinkei/hero-design/commit/850eafeaec709444144e6cbe3cc15d53653c2088) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [FAB] Redesign FAB and FABPair visual tokens
|
|
10
|
+
|
|
11
|
+
- FAB size reduced from 64px (`xxxxxlarge`) to 48px (`xxxlarge`)
|
|
12
|
+
- FAB/FABPair button background changed from black (`overlayGlobalSurface`) to the `primary` color token
|
|
13
|
+
- Action.Item background changed from black to white (`defaultGlobalSurface`); text/icon color changed from `onDarkGlobalSurface` to `onDefaultGlobalSurface`
|
|
14
|
+
- FABPair label changed from 16px semiBold to 14px regular
|
|
15
|
+
|
|
16
|
+
- [#5080](https://github.com/Thinkei/hero-design/pull/5080) [`16e0cb317529452f5a10523c10b60f66fcba6ee4`](https://github.com/Thinkei/hero-design/commit/16e0cb317529452f5a10523c10b60f66fcba6ee4) Thanks [@ttkien](https://github.com/ttkien)! - [Theme] Update primary token to #7622d7 in EH Work & Jobs
|
|
17
|
+
|
|
3
18
|
## 8.128.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/CLAUDE.md
CHANGED
|
@@ -28,7 +28,7 @@ React Native component library for Hero Design. Built with TypeScript and emotio
|
|
|
28
28
|
## Commands
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
yarn turbo run test --filter=@hero-design/rn --
|
|
31
|
+
yarn turbo run test --filter=@hero-design/rn -- ComponentName [--watch|--updateSnapshot]
|
|
32
32
|
yarn workspace @hero-design/rn lint
|
|
33
33
|
yarn workspace @hero-design/rn type-check
|
|
34
34
|
yarn build:watch:rn
|
package/es/index.js
CHANGED
|
@@ -4978,7 +4978,7 @@ var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1),
|
|
|
4978
4978
|
});
|
|
4979
4979
|
|
|
4980
4980
|
var ehWorkBrandSystemPalette = {
|
|
4981
|
-
primary: '#
|
|
4981
|
+
primary: '#7622d7',
|
|
4982
4982
|
onPrimary: '#fdfbff',
|
|
4983
4983
|
secondary: '#b382fd',
|
|
4984
4984
|
onSecondary: palette$4.white,
|
|
@@ -5007,6 +5007,7 @@ var swagSystemPalette = _objectSpread2(_objectSpread2({}, ehWorkSystemPalette),
|
|
|
5007
5007
|
|
|
5008
5008
|
var ehJobsSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette), {}, {
|
|
5009
5009
|
name: 'ehJobs',
|
|
5010
|
+
primary: '#7622d7',
|
|
5010
5011
|
secondary: '#40d1ff',
|
|
5011
5012
|
onSecondary: '#460078',
|
|
5012
5013
|
secondaryHighlightedSurface: '#ecfaff',
|
|
@@ -6373,19 +6374,19 @@ var getErrorTheme = function getErrorTheme(theme) {
|
|
|
6373
6374
|
|
|
6374
6375
|
var getFABTheme = function getFABTheme(theme) {
|
|
6375
6376
|
var colors = {
|
|
6376
|
-
buttonBackground: theme.colors.
|
|
6377
|
-
buttonPressedBackground: theme.colors.
|
|
6378
|
-
buttonActiveBackground: theme.colors.
|
|
6377
|
+
buttonBackground: theme.colors.primary,
|
|
6378
|
+
buttonPressedBackground: theme.colors.primary,
|
|
6379
|
+
buttonActiveBackground: theme.colors.primary,
|
|
6379
6380
|
icon: theme.colors.onDarkGlobalSurface,
|
|
6380
|
-
actionItemBackground: theme.colors.
|
|
6381
|
-
actionItemPressedBackground: theme.colors.
|
|
6381
|
+
actionItemBackground: theme.colors.defaultGlobalSurface,
|
|
6382
|
+
actionItemPressedBackground: theme.colors.defaultGlobalSurface,
|
|
6382
6383
|
backdropBackground: theme.colors.black,
|
|
6383
6384
|
titleText: theme.colors.onDarkGlobalSurface,
|
|
6384
|
-
actionItemText: theme.colors.
|
|
6385
|
+
actionItemText: theme.colors.onDefaultGlobalSurface
|
|
6385
6386
|
};
|
|
6386
6387
|
var sizes = {
|
|
6387
|
-
width: theme.sizes.
|
|
6388
|
-
height: theme.sizes.
|
|
6388
|
+
width: theme.sizes.xxxlarge,
|
|
6389
|
+
height: theme.sizes.xxxlarge,
|
|
6389
6390
|
iconContainerWidth: theme.sizes.large,
|
|
6390
6391
|
iconContainerHeight: theme.sizes.large,
|
|
6391
6392
|
fabPairHeight: theme.sizes.xxxlarge,
|
|
@@ -6393,11 +6394,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
6393
6394
|
};
|
|
6394
6395
|
var fonts = {
|
|
6395
6396
|
actionItemText: theme.fonts.neutral.regular,
|
|
6396
|
-
title: theme.fonts.neutral.
|
|
6397
|
+
title: theme.fonts.neutral.regular
|
|
6397
6398
|
};
|
|
6398
6399
|
var fontSizes = {
|
|
6399
6400
|
actionItemText: theme.fontSizes.large,
|
|
6400
|
-
title: theme.fontSizes.
|
|
6401
|
+
title: theme.fontSizes.medium
|
|
6401
6402
|
};
|
|
6402
6403
|
var lineHeights = {
|
|
6403
6404
|
actionItemText: theme.lineHeights.medium,
|
|
@@ -6414,7 +6415,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
6414
6415
|
actionItemTextPaddingLeft: theme.space.xsmall,
|
|
6415
6416
|
buttonMarginTop: theme.space.large,
|
|
6416
6417
|
buttonMarginRight: theme.space.large,
|
|
6417
|
-
containerPadding: theme.space.
|
|
6418
|
+
containerPadding: theme.space.smallMedium,
|
|
6418
6419
|
titleMarginHorizontal: theme.space.small,
|
|
6419
6420
|
fabPairMarginRight: theme.space.small
|
|
6420
6421
|
};
|
|
@@ -23774,21 +23775,14 @@ var StyledErrorButtonContainer = index$c(View)(function (_ref3) {
|
|
|
23774
23775
|
paddingVertical: theme.__hd__.error.space.button.wrapperVerticalPadding
|
|
23775
23776
|
};
|
|
23776
23777
|
});
|
|
23777
|
-
var
|
|
23778
|
+
var StyledErrorButtonSecondary = index$c(CompoundButton)(function (_ref4) {
|
|
23778
23779
|
var theme = _ref4.theme;
|
|
23779
23780
|
return {
|
|
23780
|
-
|
|
23781
|
+
marginTop: theme.__hd__.error.space.button.margin
|
|
23781
23782
|
};
|
|
23782
23783
|
});
|
|
23783
|
-
var
|
|
23784
|
+
var StyledErrorImageContainer = index$c(View)(function (_ref5) {
|
|
23784
23785
|
var theme = _ref5.theme;
|
|
23785
|
-
return {
|
|
23786
|
-
marginTop: theme.__hd__.error.space.button.margin,
|
|
23787
|
-
padding: theme.__hd__.error.space.button.padding
|
|
23788
|
-
};
|
|
23789
|
-
});
|
|
23790
|
-
var StyledErrorImageContainer = index$c(View)(function (_ref6) {
|
|
23791
|
-
var theme = _ref6.theme;
|
|
23792
23786
|
return {
|
|
23793
23787
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23794
23788
|
width: theme.__hd__.error.sizes.image,
|
|
@@ -23796,8 +23790,8 @@ var StyledErrorImageContainer = index$c(View)(function (_ref6) {
|
|
|
23796
23790
|
alignItems: 'center'
|
|
23797
23791
|
};
|
|
23798
23792
|
});
|
|
23799
|
-
var StyledErrorIconContainer = index$c(View)(function (
|
|
23800
|
-
var theme =
|
|
23793
|
+
var StyledErrorIconContainer = index$c(View)(function (_ref6) {
|
|
23794
|
+
var theme = _ref6.theme;
|
|
23801
23795
|
return {
|
|
23802
23796
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23803
23797
|
width: theme.__hd__.error.sizes.icon,
|
|
@@ -23805,8 +23799,8 @@ var StyledErrorIconContainer = index$c(View)(function (_ref7) {
|
|
|
23805
23799
|
alignItems: 'center'
|
|
23806
23800
|
};
|
|
23807
23801
|
});
|
|
23808
|
-
var StyledErrorImage = index$c(Image)(function (
|
|
23809
|
-
var theme =
|
|
23802
|
+
var StyledErrorImage = index$c(Image)(function (_ref7) {
|
|
23803
|
+
var theme = _ref7.theme;
|
|
23810
23804
|
return {
|
|
23811
23805
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23812
23806
|
width: theme.__hd__.error.sizes.image,
|
|
@@ -23814,16 +23808,16 @@ var StyledErrorImage = index$c(Image)(function (_ref8) {
|
|
|
23814
23808
|
resizeMode: 'contain'
|
|
23815
23809
|
};
|
|
23816
23810
|
});
|
|
23817
|
-
var StyledErrorTitle = index$c(Typography.Title)(function (
|
|
23818
|
-
var theme =
|
|
23811
|
+
var StyledErrorTitle = index$c(Typography.Title)(function (_ref8) {
|
|
23812
|
+
var theme = _ref8.theme;
|
|
23819
23813
|
return {
|
|
23820
23814
|
textAlign: 'center',
|
|
23821
23815
|
marginBottom: theme.__hd__.error.space.titleMarginBottom,
|
|
23822
23816
|
color: theme.__hd__.error.colors.title
|
|
23823
23817
|
};
|
|
23824
23818
|
});
|
|
23825
|
-
var StyledErrorDescription = index$c(Typography.Body)(function (
|
|
23826
|
-
var theme =
|
|
23819
|
+
var StyledErrorDescription = index$c(Typography.Body)(function (_ref9) {
|
|
23820
|
+
var theme = _ref9.theme;
|
|
23827
23821
|
return {
|
|
23828
23822
|
textAlign: 'center',
|
|
23829
23823
|
color: theme.__hd__.error.colors.description
|
|
@@ -23886,7 +23880,7 @@ var ErrorPage = function ErrorPage(_ref2) {
|
|
|
23886
23880
|
typeface: "playful"
|
|
23887
23881
|
}, title), description && /*#__PURE__*/React__default.createElement(StyledErrorDescription, {
|
|
23888
23882
|
typeface: "playful"
|
|
23889
|
-
}, description)), showButtonContainer && /*#__PURE__*/React__default.createElement(StyledErrorButtonContainer, null, showCta && /*#__PURE__*/React__default.createElement(
|
|
23883
|
+
}, description)), showButtonContainer && /*#__PURE__*/React__default.createElement(StyledErrorButtonContainer, null, showCta && /*#__PURE__*/React__default.createElement(CompoundButton, {
|
|
23890
23884
|
variant: "filled",
|
|
23891
23885
|
text: ctaText,
|
|
23892
23886
|
onPress: onCtaPress
|
|
@@ -24017,8 +24011,9 @@ var StyledIcon$3 = index$c(Icon)(function (_ref3) {
|
|
|
24017
24011
|
var AnimatedTouchableHighlight = Animated.createAnimatedComponent(TouchableOpacity);
|
|
24018
24012
|
var StyledFAB$2 = index$c(AnimatedTouchableHighlight)(function (_ref) {
|
|
24019
24013
|
var theme = _ref.theme,
|
|
24020
|
-
themeActive = _ref.themeActive
|
|
24021
|
-
|
|
24014
|
+
themeActive = _ref.themeActive,
|
|
24015
|
+
themeIconOnly = _ref.themeIconOnly;
|
|
24016
|
+
return _objectSpread2(_objectSpread2({
|
|
24022
24017
|
backgroundColor: themeActive ? theme.__hd__.fab.colors.buttonActiveBackground : theme.__hd__.fab.colors.buttonBackground,
|
|
24023
24018
|
borderRadius: theme.radii.rounded,
|
|
24024
24019
|
alignItems: 'center',
|
|
@@ -24027,7 +24022,9 @@ var StyledFAB$2 = index$c(AnimatedTouchableHighlight)(function (_ref) {
|
|
|
24027
24022
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
24028
24023
|
flexDirection: 'row',
|
|
24029
24024
|
height: theme.__hd__.fab.sizes.height
|
|
24030
|
-
},
|
|
24025
|
+
}, themeIconOnly && {
|
|
24026
|
+
width: theme.__hd__.fab.sizes.width
|
|
24027
|
+
}), theme.__hd__.fab.shadows["default"]);
|
|
24031
24028
|
});
|
|
24032
24029
|
var StyledFABIcon = index$c(Icon)(function (_ref2) {
|
|
24033
24030
|
var theme = _ref2.theme;
|
|
@@ -24155,12 +24152,15 @@ var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
|
24155
24152
|
};
|
|
24156
24153
|
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
24157
24154
|
var icon = _ref2.icon,
|
|
24158
|
-
title = _ref2.title
|
|
24155
|
+
title = _ref2.title,
|
|
24156
|
+
titleStyle = _ref2.titleStyle;
|
|
24159
24157
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__default.createElement(StyledFABIcon, {
|
|
24160
24158
|
size: "xsmall",
|
|
24161
24159
|
icon: icon,
|
|
24162
24160
|
testID: "styled-fab-icon"
|
|
24163
|
-
})), /*#__PURE__*/React__default.createElement(StyledFABText,
|
|
24161
|
+
})), /*#__PURE__*/React__default.createElement(StyledFABText, {
|
|
24162
|
+
style: titleStyle
|
|
24163
|
+
}, title));
|
|
24164
24164
|
};
|
|
24165
24165
|
var animateWidth = function animateWidth() {
|
|
24166
24166
|
LayoutAnimation.configureNext({
|
|
@@ -24171,7 +24171,9 @@ var animateWidth = function animateWidth() {
|
|
|
24171
24171
|
}
|
|
24172
24172
|
});
|
|
24173
24173
|
};
|
|
24174
|
-
|
|
24174
|
+
// Full implementation — accepts InternalFABProps including titleStyle.
|
|
24175
|
+
// Exported as FABInternal for use by sibling HD components (e.g. FAB.Pair).
|
|
24176
|
+
var FABWithTitleStyle = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
24175
24177
|
var _StyleSheet$flatten, _StyleSheet$flatten2;
|
|
24176
24178
|
var onPress = _ref3.onPress,
|
|
24177
24179
|
title = _ref3.title,
|
|
@@ -24179,7 +24181,8 @@ var FAB$1 = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
24179
24181
|
iconAnimated = _ref3.animated,
|
|
24180
24182
|
testID = _ref3.testID,
|
|
24181
24183
|
active = _ref3.active,
|
|
24182
|
-
style = _ref3.style
|
|
24184
|
+
style = _ref3.style,
|
|
24185
|
+
titleStyle = _ref3.titleStyle;
|
|
24183
24186
|
var theme = useTheme();
|
|
24184
24187
|
var _React$useState = React__default.useState({
|
|
24185
24188
|
hideTitle: false,
|
|
@@ -24284,6 +24287,7 @@ var FAB$1 = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
24284
24287
|
},
|
|
24285
24288
|
activeOpacity: 0.8,
|
|
24286
24289
|
onPress: onPress,
|
|
24290
|
+
themeIconOnly: isIconOnly,
|
|
24287
24291
|
style: [style, {
|
|
24288
24292
|
bottom: displayState.hideButton ? -(marginBottom + theme.__hd__.fab.sizes.height * 2) : (_StyleSheet$flatten2 = StyleSheet$1.flatten(style)) === null || _StyleSheet$flatten2 === void 0 ? void 0 : _StyleSheet$flatten2.bottom,
|
|
24289
24293
|
transform: [{
|
|
@@ -24309,9 +24313,18 @@ var FAB$1 = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
24309
24313
|
icon: active ? 'add' : icon
|
|
24310
24314
|
}) : /*#__PURE__*/React__default.createElement(IconWithTextContent, {
|
|
24311
24315
|
icon: icon,
|
|
24312
|
-
title: title
|
|
24316
|
+
title: title,
|
|
24317
|
+
titleStyle: titleStyle
|
|
24313
24318
|
})));
|
|
24314
24319
|
});
|
|
24320
|
+
FABWithTitleStyle.displayName = 'FAB';
|
|
24321
|
+
// Public export — clean FABProps, no internal props exposed.
|
|
24322
|
+
// Docgen reads this component and sees only FABProps.
|
|
24323
|
+
var FAB$1 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
24324
|
+
return /*#__PURE__*/React__default.createElement(FABWithTitleStyle, _extends$1({}, props, {
|
|
24325
|
+
ref: ref
|
|
24326
|
+
}));
|
|
24327
|
+
});
|
|
24315
24328
|
FAB$1.displayName = 'FAB';
|
|
24316
24329
|
|
|
24317
24330
|
var StyledContainer$5 = index$c(View)({
|
|
@@ -24480,7 +24493,7 @@ var StyledFABPairWrapper = index$c(Box)({
|
|
|
24480
24493
|
justifyContent: 'center',
|
|
24481
24494
|
alignItems: 'center'
|
|
24482
24495
|
});
|
|
24483
|
-
var StyledFAB = index$c(
|
|
24496
|
+
var StyledFAB = index$c(FABWithTitleStyle)(function (_ref) {
|
|
24484
24497
|
var theme = _ref.theme,
|
|
24485
24498
|
_ref$iconOnly = _ref.iconOnly,
|
|
24486
24499
|
iconOnly = _ref$iconOnly === void 0 ? false : _ref$iconOnly,
|
|
@@ -24502,6 +24515,7 @@ var Pair = function Pair(_ref) {
|
|
|
24502
24515
|
title = fabConfig.title,
|
|
24503
24516
|
onPress = fabConfig.onPress,
|
|
24504
24517
|
testID = fabConfig.testID;
|
|
24518
|
+
var theme = useTheme();
|
|
24505
24519
|
return /*#__PURE__*/React__default.createElement(StyledFABPairWrapper, props, /*#__PURE__*/React__default.createElement(StyledFAB, {
|
|
24506
24520
|
icon: "cancel",
|
|
24507
24521
|
onPress: onCancel,
|
|
@@ -24513,7 +24527,11 @@ var Pair = function Pair(_ref) {
|
|
|
24513
24527
|
onPress: onPress,
|
|
24514
24528
|
testID: testID,
|
|
24515
24529
|
iconOnly: !title,
|
|
24516
|
-
isLast: true
|
|
24530
|
+
isLast: true,
|
|
24531
|
+
titleStyle: {
|
|
24532
|
+
fontSize: theme.fontSizes.medium,
|
|
24533
|
+
fontFamily: theme.fonts.neutral.regular
|
|
24534
|
+
}
|
|
24517
24535
|
}));
|
|
24518
24536
|
};
|
|
24519
24537
|
|
|
@@ -27538,16 +27556,9 @@ var StyledSuccessButtonContainer = index$c(View)(function (_ref8) {
|
|
|
27538
27556
|
paddingVertical: theme.__hd__.success.space.button.wrapperVerticalPadding
|
|
27539
27557
|
};
|
|
27540
27558
|
});
|
|
27541
|
-
var
|
|
27559
|
+
var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref9) {
|
|
27542
27560
|
var theme = _ref9.theme;
|
|
27543
27561
|
return {
|
|
27544
|
-
padding: theme.__hd__.success.space.button.padding
|
|
27545
|
-
};
|
|
27546
|
-
});
|
|
27547
|
-
var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref10) {
|
|
27548
|
-
var theme = _ref10.theme;
|
|
27549
|
-
return {
|
|
27550
|
-
padding: theme.__hd__.success.space.button.padding,
|
|
27551
27562
|
marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop
|
|
27552
27563
|
};
|
|
27553
27564
|
});
|
|
@@ -27608,7 +27619,7 @@ var SuccessPage = function SuccessPage(_ref2) {
|
|
|
27608
27619
|
}), /*#__PURE__*/React__default.createElement(StyledSuccessTitle, {
|
|
27609
27620
|
level: "h4",
|
|
27610
27621
|
typeface: "playful"
|
|
27611
|
-
}, title), typeof description === 'string' ? /*#__PURE__*/React__default.createElement(StyledSuccessDescription, null, description) : description), !!ctaText && /*#__PURE__*/React__default.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__default.createElement(
|
|
27622
|
+
}, title), typeof description === 'string' ? /*#__PURE__*/React__default.createElement(StyledSuccessDescription, null, description) : description), !!ctaText && /*#__PURE__*/React__default.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__default.createElement(CompoundButton, {
|
|
27612
27623
|
text: ctaText,
|
|
27613
27624
|
onPress: onCtaPress
|
|
27614
27625
|
}), !!showSecondaryButton && /*#__PURE__*/React__default.createElement(StyledSuccessButtonSecondary, {
|
package/lib/index.js
CHANGED
|
@@ -5008,7 +5008,7 @@ var swagLightGlobalPalette = _objectSpread2(_objectSpread2({}, globalPalette$1),
|
|
|
5008
5008
|
});
|
|
5009
5009
|
|
|
5010
5010
|
var ehWorkBrandSystemPalette = {
|
|
5011
|
-
primary: '#
|
|
5011
|
+
primary: '#7622d7',
|
|
5012
5012
|
onPrimary: '#fdfbff',
|
|
5013
5013
|
secondary: '#b382fd',
|
|
5014
5014
|
onSecondary: palette$4.white,
|
|
@@ -5037,6 +5037,7 @@ var swagSystemPalette = _objectSpread2(_objectSpread2({}, ehWorkSystemPalette),
|
|
|
5037
5037
|
|
|
5038
5038
|
var ehJobsSystemPalette = _objectSpread2(_objectSpread2({}, swagSystemPalette), {}, {
|
|
5039
5039
|
name: 'ehJobs',
|
|
5040
|
+
primary: '#7622d7',
|
|
5040
5041
|
secondary: '#40d1ff',
|
|
5041
5042
|
onSecondary: '#460078',
|
|
5042
5043
|
secondaryHighlightedSurface: '#ecfaff',
|
|
@@ -6403,19 +6404,19 @@ var getErrorTheme = function getErrorTheme(theme) {
|
|
|
6403
6404
|
|
|
6404
6405
|
var getFABTheme = function getFABTheme(theme) {
|
|
6405
6406
|
var colors = {
|
|
6406
|
-
buttonBackground: theme.colors.
|
|
6407
|
-
buttonPressedBackground: theme.colors.
|
|
6408
|
-
buttonActiveBackground: theme.colors.
|
|
6407
|
+
buttonBackground: theme.colors.primary,
|
|
6408
|
+
buttonPressedBackground: theme.colors.primary,
|
|
6409
|
+
buttonActiveBackground: theme.colors.primary,
|
|
6409
6410
|
icon: theme.colors.onDarkGlobalSurface,
|
|
6410
|
-
actionItemBackground: theme.colors.
|
|
6411
|
-
actionItemPressedBackground: theme.colors.
|
|
6411
|
+
actionItemBackground: theme.colors.defaultGlobalSurface,
|
|
6412
|
+
actionItemPressedBackground: theme.colors.defaultGlobalSurface,
|
|
6412
6413
|
backdropBackground: theme.colors.black,
|
|
6413
6414
|
titleText: theme.colors.onDarkGlobalSurface,
|
|
6414
|
-
actionItemText: theme.colors.
|
|
6415
|
+
actionItemText: theme.colors.onDefaultGlobalSurface
|
|
6415
6416
|
};
|
|
6416
6417
|
var sizes = {
|
|
6417
|
-
width: theme.sizes.
|
|
6418
|
-
height: theme.sizes.
|
|
6418
|
+
width: theme.sizes.xxxlarge,
|
|
6419
|
+
height: theme.sizes.xxxlarge,
|
|
6419
6420
|
iconContainerWidth: theme.sizes.large,
|
|
6420
6421
|
iconContainerHeight: theme.sizes.large,
|
|
6421
6422
|
fabPairHeight: theme.sizes.xxxlarge,
|
|
@@ -6423,11 +6424,11 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
6423
6424
|
};
|
|
6424
6425
|
var fonts = {
|
|
6425
6426
|
actionItemText: theme.fonts.neutral.regular,
|
|
6426
|
-
title: theme.fonts.neutral.
|
|
6427
|
+
title: theme.fonts.neutral.regular
|
|
6427
6428
|
};
|
|
6428
6429
|
var fontSizes = {
|
|
6429
6430
|
actionItemText: theme.fontSizes.large,
|
|
6430
|
-
title: theme.fontSizes.
|
|
6431
|
+
title: theme.fontSizes.medium
|
|
6431
6432
|
};
|
|
6432
6433
|
var lineHeights = {
|
|
6433
6434
|
actionItemText: theme.lineHeights.medium,
|
|
@@ -6444,7 +6445,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
6444
6445
|
actionItemTextPaddingLeft: theme.space.xsmall,
|
|
6445
6446
|
buttonMarginTop: theme.space.large,
|
|
6446
6447
|
buttonMarginRight: theme.space.large,
|
|
6447
|
-
containerPadding: theme.space.
|
|
6448
|
+
containerPadding: theme.space.smallMedium,
|
|
6448
6449
|
titleMarginHorizontal: theme.space.small,
|
|
6449
6450
|
fabPairMarginRight: theme.space.small
|
|
6450
6451
|
};
|
|
@@ -23804,21 +23805,14 @@ var StyledErrorButtonContainer = index$c(reactNative.View)(function (_ref3) {
|
|
|
23804
23805
|
paddingVertical: theme.__hd__.error.space.button.wrapperVerticalPadding
|
|
23805
23806
|
};
|
|
23806
23807
|
});
|
|
23807
|
-
var
|
|
23808
|
+
var StyledErrorButtonSecondary = index$c(CompoundButton)(function (_ref4) {
|
|
23808
23809
|
var theme = _ref4.theme;
|
|
23809
23810
|
return {
|
|
23810
|
-
|
|
23811
|
+
marginTop: theme.__hd__.error.space.button.margin
|
|
23811
23812
|
};
|
|
23812
23813
|
});
|
|
23813
|
-
var
|
|
23814
|
+
var StyledErrorImageContainer = index$c(reactNative.View)(function (_ref5) {
|
|
23814
23815
|
var theme = _ref5.theme;
|
|
23815
|
-
return {
|
|
23816
|
-
marginTop: theme.__hd__.error.space.button.margin,
|
|
23817
|
-
padding: theme.__hd__.error.space.button.padding
|
|
23818
|
-
};
|
|
23819
|
-
});
|
|
23820
|
-
var StyledErrorImageContainer = index$c(reactNative.View)(function (_ref6) {
|
|
23821
|
-
var theme = _ref6.theme;
|
|
23822
23816
|
return {
|
|
23823
23817
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23824
23818
|
width: theme.__hd__.error.sizes.image,
|
|
@@ -23826,8 +23820,8 @@ var StyledErrorImageContainer = index$c(reactNative.View)(function (_ref6) {
|
|
|
23826
23820
|
alignItems: 'center'
|
|
23827
23821
|
};
|
|
23828
23822
|
});
|
|
23829
|
-
var StyledErrorIconContainer = index$c(reactNative.View)(function (
|
|
23830
|
-
var theme =
|
|
23823
|
+
var StyledErrorIconContainer = index$c(reactNative.View)(function (_ref6) {
|
|
23824
|
+
var theme = _ref6.theme;
|
|
23831
23825
|
return {
|
|
23832
23826
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23833
23827
|
width: theme.__hd__.error.sizes.icon,
|
|
@@ -23835,8 +23829,8 @@ var StyledErrorIconContainer = index$c(reactNative.View)(function (_ref7) {
|
|
|
23835
23829
|
alignItems: 'center'
|
|
23836
23830
|
};
|
|
23837
23831
|
});
|
|
23838
|
-
var StyledErrorImage = index$c(Image)(function (
|
|
23839
|
-
var theme =
|
|
23832
|
+
var StyledErrorImage = index$c(Image)(function (_ref7) {
|
|
23833
|
+
var theme = _ref7.theme;
|
|
23840
23834
|
return {
|
|
23841
23835
|
marginBottom: theme.__hd__.error.space.imageMarginBottom,
|
|
23842
23836
|
width: theme.__hd__.error.sizes.image,
|
|
@@ -23844,16 +23838,16 @@ var StyledErrorImage = index$c(Image)(function (_ref8) {
|
|
|
23844
23838
|
resizeMode: 'contain'
|
|
23845
23839
|
};
|
|
23846
23840
|
});
|
|
23847
|
-
var StyledErrorTitle = index$c(Typography.Title)(function (
|
|
23848
|
-
var theme =
|
|
23841
|
+
var StyledErrorTitle = index$c(Typography.Title)(function (_ref8) {
|
|
23842
|
+
var theme = _ref8.theme;
|
|
23849
23843
|
return {
|
|
23850
23844
|
textAlign: 'center',
|
|
23851
23845
|
marginBottom: theme.__hd__.error.space.titleMarginBottom,
|
|
23852
23846
|
color: theme.__hd__.error.colors.title
|
|
23853
23847
|
};
|
|
23854
23848
|
});
|
|
23855
|
-
var StyledErrorDescription = index$c(Typography.Body)(function (
|
|
23856
|
-
var theme =
|
|
23849
|
+
var StyledErrorDescription = index$c(Typography.Body)(function (_ref9) {
|
|
23850
|
+
var theme = _ref9.theme;
|
|
23857
23851
|
return {
|
|
23858
23852
|
textAlign: 'center',
|
|
23859
23853
|
color: theme.__hd__.error.colors.description
|
|
@@ -23916,7 +23910,7 @@ var ErrorPage = function ErrorPage(_ref2) {
|
|
|
23916
23910
|
typeface: "playful"
|
|
23917
23911
|
}, title), description && /*#__PURE__*/React__namespace.default.createElement(StyledErrorDescription, {
|
|
23918
23912
|
typeface: "playful"
|
|
23919
|
-
}, description)), showButtonContainer && /*#__PURE__*/React__namespace.default.createElement(StyledErrorButtonContainer, null, showCta && /*#__PURE__*/React__namespace.default.createElement(
|
|
23913
|
+
}, description)), showButtonContainer && /*#__PURE__*/React__namespace.default.createElement(StyledErrorButtonContainer, null, showCta && /*#__PURE__*/React__namespace.default.createElement(CompoundButton, {
|
|
23920
23914
|
variant: "filled",
|
|
23921
23915
|
text: ctaText,
|
|
23922
23916
|
onPress: onCtaPress
|
|
@@ -24047,8 +24041,9 @@ var StyledIcon$3 = index$c(Icon)(function (_ref3) {
|
|
|
24047
24041
|
var AnimatedTouchableHighlight = reactNative.Animated.createAnimatedComponent(reactNative.TouchableOpacity);
|
|
24048
24042
|
var StyledFAB$2 = index$c(AnimatedTouchableHighlight)(function (_ref) {
|
|
24049
24043
|
var theme = _ref.theme,
|
|
24050
|
-
themeActive = _ref.themeActive
|
|
24051
|
-
|
|
24044
|
+
themeActive = _ref.themeActive,
|
|
24045
|
+
themeIconOnly = _ref.themeIconOnly;
|
|
24046
|
+
return _objectSpread2(_objectSpread2({
|
|
24052
24047
|
backgroundColor: themeActive ? theme.__hd__.fab.colors.buttonActiveBackground : theme.__hd__.fab.colors.buttonBackground,
|
|
24053
24048
|
borderRadius: theme.radii.rounded,
|
|
24054
24049
|
alignItems: 'center',
|
|
@@ -24057,7 +24052,9 @@ var StyledFAB$2 = index$c(AnimatedTouchableHighlight)(function (_ref) {
|
|
|
24057
24052
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
24058
24053
|
flexDirection: 'row',
|
|
24059
24054
|
height: theme.__hd__.fab.sizes.height
|
|
24060
|
-
},
|
|
24055
|
+
}, themeIconOnly && {
|
|
24056
|
+
width: theme.__hd__.fab.sizes.width
|
|
24057
|
+
}), theme.__hd__.fab.shadows["default"]);
|
|
24061
24058
|
});
|
|
24062
24059
|
var StyledFABIcon = index$c(Icon)(function (_ref2) {
|
|
24063
24060
|
var theme = _ref2.theme;
|
|
@@ -24185,12 +24182,15 @@ var IconOnlyContent = function IconOnlyContent(_ref) {
|
|
|
24185
24182
|
};
|
|
24186
24183
|
var IconWithTextContent = function IconWithTextContent(_ref2) {
|
|
24187
24184
|
var icon = _ref2.icon,
|
|
24188
|
-
title = _ref2.title
|
|
24185
|
+
title = _ref2.title,
|
|
24186
|
+
titleStyle = _ref2.titleStyle;
|
|
24189
24187
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(StyledIconContainer$1, null, /*#__PURE__*/React__namespace.default.createElement(StyledFABIcon, {
|
|
24190
24188
|
size: "xsmall",
|
|
24191
24189
|
icon: icon,
|
|
24192
24190
|
testID: "styled-fab-icon"
|
|
24193
|
-
})), /*#__PURE__*/React__namespace.default.createElement(StyledFABText,
|
|
24191
|
+
})), /*#__PURE__*/React__namespace.default.createElement(StyledFABText, {
|
|
24192
|
+
style: titleStyle
|
|
24193
|
+
}, title));
|
|
24194
24194
|
};
|
|
24195
24195
|
var animateWidth = function animateWidth() {
|
|
24196
24196
|
reactNative.LayoutAnimation.configureNext({
|
|
@@ -24201,7 +24201,9 @@ var animateWidth = function animateWidth() {
|
|
|
24201
24201
|
}
|
|
24202
24202
|
});
|
|
24203
24203
|
};
|
|
24204
|
-
|
|
24204
|
+
// Full implementation — accepts InternalFABProps including titleStyle.
|
|
24205
|
+
// Exported as FABInternal for use by sibling HD components (e.g. FAB.Pair).
|
|
24206
|
+
var FABWithTitleStyle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
24205
24207
|
var _StyleSheet$flatten, _StyleSheet$flatten2;
|
|
24206
24208
|
var onPress = _ref3.onPress,
|
|
24207
24209
|
title = _ref3.title,
|
|
@@ -24209,7 +24211,8 @@ var FAB$1 = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
24209
24211
|
iconAnimated = _ref3.animated,
|
|
24210
24212
|
testID = _ref3.testID,
|
|
24211
24213
|
active = _ref3.active,
|
|
24212
|
-
style = _ref3.style
|
|
24214
|
+
style = _ref3.style,
|
|
24215
|
+
titleStyle = _ref3.titleStyle;
|
|
24213
24216
|
var theme = useTheme();
|
|
24214
24217
|
var _React$useState = React__namespace.default.useState({
|
|
24215
24218
|
hideTitle: false,
|
|
@@ -24314,6 +24317,7 @@ var FAB$1 = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
24314
24317
|
},
|
|
24315
24318
|
activeOpacity: 0.8,
|
|
24316
24319
|
onPress: onPress,
|
|
24320
|
+
themeIconOnly: isIconOnly,
|
|
24317
24321
|
style: [style, {
|
|
24318
24322
|
bottom: displayState.hideButton ? -(marginBottom + theme.__hd__.fab.sizes.height * 2) : (_StyleSheet$flatten2 = reactNative.StyleSheet.flatten(style)) === null || _StyleSheet$flatten2 === void 0 ? void 0 : _StyleSheet$flatten2.bottom,
|
|
24319
24323
|
transform: [{
|
|
@@ -24339,9 +24343,18 @@ var FAB$1 = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
24339
24343
|
icon: active ? 'add' : icon
|
|
24340
24344
|
}) : /*#__PURE__*/React__namespace.default.createElement(IconWithTextContent, {
|
|
24341
24345
|
icon: icon,
|
|
24342
|
-
title: title
|
|
24346
|
+
title: title,
|
|
24347
|
+
titleStyle: titleStyle
|
|
24343
24348
|
})));
|
|
24344
24349
|
});
|
|
24350
|
+
FABWithTitleStyle.displayName = 'FAB';
|
|
24351
|
+
// Public export — clean FABProps, no internal props exposed.
|
|
24352
|
+
// Docgen reads this component and sees only FABProps.
|
|
24353
|
+
var FAB$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24354
|
+
return /*#__PURE__*/React__namespace.default.createElement(FABWithTitleStyle, _extends$1({}, props, {
|
|
24355
|
+
ref: ref
|
|
24356
|
+
}));
|
|
24357
|
+
});
|
|
24345
24358
|
FAB$1.displayName = 'FAB';
|
|
24346
24359
|
|
|
24347
24360
|
var StyledContainer$5 = index$c(reactNative.View)({
|
|
@@ -24510,7 +24523,7 @@ var StyledFABPairWrapper = index$c(Box)({
|
|
|
24510
24523
|
justifyContent: 'center',
|
|
24511
24524
|
alignItems: 'center'
|
|
24512
24525
|
});
|
|
24513
|
-
var StyledFAB = index$c(
|
|
24526
|
+
var StyledFAB = index$c(FABWithTitleStyle)(function (_ref) {
|
|
24514
24527
|
var theme = _ref.theme,
|
|
24515
24528
|
_ref$iconOnly = _ref.iconOnly,
|
|
24516
24529
|
iconOnly = _ref$iconOnly === void 0 ? false : _ref$iconOnly,
|
|
@@ -24532,6 +24545,7 @@ var Pair = function Pair(_ref) {
|
|
|
24532
24545
|
title = fabConfig.title,
|
|
24533
24546
|
onPress = fabConfig.onPress,
|
|
24534
24547
|
testID = fabConfig.testID;
|
|
24548
|
+
var theme = useTheme();
|
|
24535
24549
|
return /*#__PURE__*/React__namespace.default.createElement(StyledFABPairWrapper, props, /*#__PURE__*/React__namespace.default.createElement(StyledFAB, {
|
|
24536
24550
|
icon: "cancel",
|
|
24537
24551
|
onPress: onCancel,
|
|
@@ -24543,7 +24557,11 @@ var Pair = function Pair(_ref) {
|
|
|
24543
24557
|
onPress: onPress,
|
|
24544
24558
|
testID: testID,
|
|
24545
24559
|
iconOnly: !title,
|
|
24546
|
-
isLast: true
|
|
24560
|
+
isLast: true,
|
|
24561
|
+
titleStyle: {
|
|
24562
|
+
fontSize: theme.fontSizes.medium,
|
|
24563
|
+
fontFamily: theme.fonts.neutral.regular
|
|
24564
|
+
}
|
|
24547
24565
|
}));
|
|
24548
24566
|
};
|
|
24549
24567
|
|
|
@@ -27568,16 +27586,9 @@ var StyledSuccessButtonContainer = index$c(reactNative.View)(function (_ref8) {
|
|
|
27568
27586
|
paddingVertical: theme.__hd__.success.space.button.wrapperVerticalPadding
|
|
27569
27587
|
};
|
|
27570
27588
|
});
|
|
27571
|
-
var
|
|
27589
|
+
var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref9) {
|
|
27572
27590
|
var theme = _ref9.theme;
|
|
27573
27591
|
return {
|
|
27574
|
-
padding: theme.__hd__.success.space.button.padding
|
|
27575
|
-
};
|
|
27576
|
-
});
|
|
27577
|
-
var StyledSuccessButtonSecondary = index$c(CompoundButton)(function (_ref10) {
|
|
27578
|
-
var theme = _ref10.theme;
|
|
27579
|
-
return {
|
|
27580
|
-
padding: theme.__hd__.success.space.button.padding,
|
|
27581
27592
|
marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop
|
|
27582
27593
|
};
|
|
27583
27594
|
});
|
|
@@ -27638,7 +27649,7 @@ var SuccessPage = function SuccessPage(_ref2) {
|
|
|
27638
27649
|
}), /*#__PURE__*/React__namespace.default.createElement(StyledSuccessTitle, {
|
|
27639
27650
|
level: "h4",
|
|
27640
27651
|
typeface: "playful"
|
|
27641
|
-
}, title), typeof description === 'string' ? /*#__PURE__*/React__namespace.default.createElement(StyledSuccessDescription, null, description) : description), !!ctaText && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__namespace.default.createElement(
|
|
27652
|
+
}, title), typeof description === 'string' ? /*#__PURE__*/React__namespace.default.createElement(StyledSuccessDescription, null, description) : description), !!ctaText && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonContainer, null, /*#__PURE__*/React__namespace.default.createElement(CompoundButton, {
|
|
27642
27653
|
text: ctaText,
|
|
27643
27654
|
onPress: onCtaPress
|
|
27644
27655
|
}), !!showSecondaryButton && /*#__PURE__*/React__namespace.default.createElement(StyledSuccessButtonSecondary, {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
Animated,
|
|
5
5
|
LayoutAnimation,
|
|
@@ -67,6 +67,11 @@ export interface FABProps {
|
|
|
67
67
|
testID?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// Extends FABProps with internal-only props. Not part of the public API.
|
|
71
|
+
type InternalFABProps = FABProps & {
|
|
72
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
73
|
+
};
|
|
74
|
+
|
|
70
75
|
const IconOnlyContent = ({
|
|
71
76
|
icon,
|
|
72
77
|
animated,
|
|
@@ -98,15 +103,17 @@ const IconOnlyContent = ({
|
|
|
98
103
|
const IconWithTextContent = ({
|
|
99
104
|
icon,
|
|
100
105
|
title,
|
|
106
|
+
titleStyle,
|
|
101
107
|
}: {
|
|
102
108
|
icon: IconName;
|
|
103
109
|
title?: string;
|
|
110
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
104
111
|
}) => (
|
|
105
112
|
<>
|
|
106
113
|
<StyledIconContainer>
|
|
107
114
|
<StyledFABIcon size="xsmall" icon={icon} testID="styled-fab-icon" />
|
|
108
115
|
</StyledIconContainer>
|
|
109
|
-
<StyledFABText>{title}</StyledFABText>
|
|
116
|
+
<StyledFABText style={titleStyle}>{title}</StyledFABText>
|
|
110
117
|
</>
|
|
111
118
|
);
|
|
112
119
|
|
|
@@ -120,9 +127,20 @@ const animateWidth = () => {
|
|
|
120
127
|
});
|
|
121
128
|
};
|
|
122
129
|
|
|
123
|
-
|
|
130
|
+
// Full implementation — accepts InternalFABProps including titleStyle.
|
|
131
|
+
// Exported as FABInternal for use by sibling HD components (e.g. FAB.Pair).
|
|
132
|
+
const FABWithTitleStyle = forwardRef<FABHandles, InternalFABProps>(
|
|
124
133
|
(
|
|
125
|
-
{
|
|
134
|
+
{
|
|
135
|
+
onPress,
|
|
136
|
+
title,
|
|
137
|
+
icon,
|
|
138
|
+
animated: iconAnimated,
|
|
139
|
+
testID,
|
|
140
|
+
active,
|
|
141
|
+
style,
|
|
142
|
+
titleStyle,
|
|
143
|
+
},
|
|
126
144
|
ref
|
|
127
145
|
) => {
|
|
128
146
|
const theme = useTheme();
|
|
@@ -237,6 +255,7 @@ const FAB = forwardRef<FABHandles, FABProps>(
|
|
|
237
255
|
}
|
|
238
256
|
activeOpacity={0.8}
|
|
239
257
|
onPress={onPress}
|
|
258
|
+
themeIconOnly={isIconOnly}
|
|
240
259
|
style={[
|
|
241
260
|
style,
|
|
242
261
|
{
|
|
@@ -276,7 +295,11 @@ const FAB = forwardRef<FABHandles, FABProps>(
|
|
|
276
295
|
icon={active ? 'add' : icon}
|
|
277
296
|
/>
|
|
278
297
|
) : (
|
|
279
|
-
<IconWithTextContent
|
|
298
|
+
<IconWithTextContent
|
|
299
|
+
icon={icon}
|
|
300
|
+
title={title}
|
|
301
|
+
titleStyle={titleStyle}
|
|
302
|
+
/>
|
|
280
303
|
)}
|
|
281
304
|
</Animated.View>
|
|
282
305
|
</StyledFAB>
|
|
@@ -284,6 +307,15 @@ const FAB = forwardRef<FABHandles, FABProps>(
|
|
|
284
307
|
}
|
|
285
308
|
);
|
|
286
309
|
|
|
310
|
+
FABWithTitleStyle.displayName = 'FAB';
|
|
311
|
+
|
|
312
|
+
// Public export — clean FABProps, no internal props exposed.
|
|
313
|
+
// Docgen reads this component and sees only FABProps.
|
|
314
|
+
const FAB = forwardRef<FABHandles, FABProps>((props, ref) => (
|
|
315
|
+
<FABWithTitleStyle {...props} ref={ref} />
|
|
316
|
+
));
|
|
317
|
+
|
|
287
318
|
FAB.displayName = 'FAB';
|
|
288
319
|
|
|
320
|
+
export { FABWithTitleStyle as FABInternal };
|
|
289
321
|
export default FAB;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import
|
|
2
|
+
import { FABInternal } from '../FAB';
|
|
3
3
|
import Box from '../../Box';
|
|
4
4
|
|
|
5
5
|
const StyledFABPairWrapper = styled(Box)({
|
|
@@ -8,7 +8,7 @@ const StyledFABPairWrapper = styled(Box)({
|
|
|
8
8
|
alignItems: 'center',
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const StyledFAB = styled(
|
|
11
|
+
const StyledFAB = styled(FABInternal)<{ iconOnly?: boolean; isLast?: boolean }>(
|
|
12
12
|
({ theme, iconOnly = false, isLast = false }) => ({
|
|
13
13
|
height: theme.__hd__.fab.sizes.fabPairHeight,
|
|
14
14
|
width: iconOnly ? theme.__hd__.fab.sizes.fabPairIconOnlyWidth : undefined,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../theme';
|
|
3
4
|
import type { FABProps } from '../FAB';
|
|
4
5
|
import { StyledFAB, StyledFABPairWrapper } from './StyledFAB';
|
|
5
6
|
|
|
@@ -21,6 +22,7 @@ export interface FABPairProps extends ViewProps {
|
|
|
21
22
|
|
|
22
23
|
const Pair = ({ fabConfig, onCancel, ...props }: FABPairProps) => {
|
|
23
24
|
const { icon, title, onPress, testID } = fabConfig;
|
|
25
|
+
const theme = useTheme();
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<StyledFABPairWrapper {...props}>
|
|
@@ -38,6 +40,10 @@ const Pair = ({ fabConfig, onCancel, ...props }: FABPairProps) => {
|
|
|
38
40
|
testID={testID}
|
|
39
41
|
iconOnly={!title}
|
|
40
42
|
isLast
|
|
43
|
+
titleStyle={{
|
|
44
|
+
fontSize: theme.fontSizes.medium,
|
|
45
|
+
fontFamily: theme.fonts.neutral.regular,
|
|
46
|
+
}}
|
|
41
47
|
/>
|
|
42
48
|
</StyledFABPairWrapper>
|
|
43
49
|
);
|
|
@@ -11,7 +11,8 @@ const AnimatedTouchableHighlight =
|
|
|
11
11
|
|
|
12
12
|
const StyledFAB = styled(AnimatedTouchableHighlight)<{
|
|
13
13
|
themeActive?: boolean;
|
|
14
|
-
|
|
14
|
+
themeIconOnly?: boolean;
|
|
15
|
+
}>(({ theme, themeActive, themeIconOnly }) => ({
|
|
15
16
|
backgroundColor: themeActive
|
|
16
17
|
? theme.__hd__.fab.colors.buttonActiveBackground
|
|
17
18
|
: theme.__hd__.fab.colors.buttonBackground,
|
|
@@ -22,6 +23,7 @@ const StyledFAB = styled(AnimatedTouchableHighlight)<{
|
|
|
22
23
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
23
24
|
flexDirection: 'row',
|
|
24
25
|
height: theme.__hd__.fab.sizes.height,
|
|
26
|
+
...(themeIconOnly && { width: theme.__hd__.fab.sizes.width }),
|
|
25
27
|
...theme.__hd__.fab.shadows.default,
|
|
26
28
|
}));
|
|
27
29
|
|
|
@@ -42,13 +42,8 @@ const StyledErrorButtonContainer = styled(View)(({ theme }) => ({
|
|
|
42
42
|
paddingVertical: theme.__hd__.error.space.button.wrapperVerticalPadding,
|
|
43
43
|
}));
|
|
44
44
|
|
|
45
|
-
const StyledErrorButtonPrimary = styled(Button)(({ theme }) => ({
|
|
46
|
-
padding: theme.__hd__.error.space.button.padding,
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
45
|
const StyledErrorButtonSecondary = styled(Button)(({ theme }) => ({
|
|
50
46
|
marginTop: theme.__hd__.error.space.button.margin,
|
|
51
|
-
padding: theme.__hd__.error.space.button.padding,
|
|
52
47
|
}));
|
|
53
48
|
|
|
54
49
|
const StyledErrorImageContainer = styled(View)(({ theme }) => ({
|
|
@@ -88,7 +83,6 @@ export {
|
|
|
88
83
|
StyledErrorImage,
|
|
89
84
|
StyledErrorContainer,
|
|
90
85
|
StyledErrorButtonContainer,
|
|
91
|
-
StyledErrorButtonPrimary,
|
|
92
86
|
StyledErrorButtonSecondary,
|
|
93
87
|
StyledErrorContent,
|
|
94
88
|
StyledErrorTitle,
|
|
@@ -8,7 +8,6 @@ import type {
|
|
|
8
8
|
import type { ErrorVariant } from './StyledError';
|
|
9
9
|
import {
|
|
10
10
|
StyledErrorButtonContainer,
|
|
11
|
-
StyledErrorButtonPrimary,
|
|
12
11
|
StyledErrorButtonSecondary,
|
|
13
12
|
StyledErrorContainer,
|
|
14
13
|
StyledErrorContent,
|
|
@@ -23,6 +22,7 @@ import { useDeprecation } from '../../../utils/hooks';
|
|
|
23
22
|
import type { ImageProps } from '../../Image/index';
|
|
24
23
|
import Illustration from '../../Illustration';
|
|
25
24
|
import type { IllustrationName } from '../../Illustration';
|
|
25
|
+
import Button from '../../Button';
|
|
26
26
|
|
|
27
27
|
interface ErrorProps extends ViewProps {
|
|
28
28
|
/**
|
|
@@ -164,11 +164,7 @@ const ErrorPage = ({
|
|
|
164
164
|
{showButtonContainer && (
|
|
165
165
|
<StyledErrorButtonContainer>
|
|
166
166
|
{showCta && (
|
|
167
|
-
<
|
|
168
|
-
variant="filled"
|
|
169
|
-
text={ctaText}
|
|
170
|
-
onPress={onCtaPress}
|
|
171
|
-
/>
|
|
167
|
+
<Button variant="filled" text={ctaText} onPress={onCtaPress} />
|
|
172
168
|
)}
|
|
173
169
|
{showSecondaryCta && (
|
|
174
170
|
<StyledErrorButtonSecondary
|
|
@@ -69,12 +69,7 @@ const StyledSuccessButtonContainer = styled(View)(({ theme }) => ({
|
|
|
69
69
|
paddingVertical: theme.__hd__.success.space.button.wrapperVerticalPadding,
|
|
70
70
|
}));
|
|
71
71
|
|
|
72
|
-
const StyledSuccessButtonPrimary = styled(Button)(({ theme }) => ({
|
|
73
|
-
padding: theme.__hd__.success.space.button.padding,
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
72
|
const StyledSuccessButtonSecondary = styled(Button)(({ theme }) => ({
|
|
77
|
-
padding: theme.__hd__.success.space.button.padding,
|
|
78
73
|
marginTop: theme.__hd__.success.space.button.secondaryCTAMarginTop,
|
|
79
74
|
}));
|
|
80
75
|
|
|
@@ -93,7 +88,6 @@ export {
|
|
|
93
88
|
StyledSuccessTitle,
|
|
94
89
|
StyledSuccessDescription,
|
|
95
90
|
StyledSuccessButtonContainer,
|
|
96
|
-
StyledSuccessButtonPrimary,
|
|
97
91
|
StyledSuccessButtonSecondary,
|
|
98
92
|
StyledSuccessModal,
|
|
99
93
|
};
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
StyledSuccessTitle,
|
|
15
15
|
StyledSuccessDescription,
|
|
16
16
|
StyledSuccessButtonContainer,
|
|
17
|
-
StyledSuccessButtonPrimary,
|
|
18
17
|
StyledSuccessModal,
|
|
19
18
|
StyledSuccessIconContainer,
|
|
20
19
|
StyledSuccessButtonSecondary,
|
|
@@ -23,6 +22,7 @@ import type { ImageProps } from '../../Image';
|
|
|
23
22
|
import { noop } from '../../../utils/functions';
|
|
24
23
|
import type { IllustrationName } from '../../Illustration';
|
|
25
24
|
import Illustration from '../../Illustration';
|
|
25
|
+
import Button from '../../Button';
|
|
26
26
|
|
|
27
27
|
interface SuccessProps extends ViewProps {
|
|
28
28
|
/**
|
|
@@ -152,7 +152,7 @@ const SuccessPage = ({
|
|
|
152
152
|
|
|
153
153
|
{!!ctaText && (
|
|
154
154
|
<StyledSuccessButtonContainer>
|
|
155
|
-
<
|
|
155
|
+
<Button text={ctaText} onPress={onCtaPress} />
|
|
156
156
|
{!!showSecondaryButton && (
|
|
157
157
|
<StyledSuccessButtonSecondary
|
|
158
158
|
variant="text"
|
|
@@ -2,20 +2,20 @@ import type { GlobalTheme } from '../global';
|
|
|
2
2
|
|
|
3
3
|
const getFABTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
|
-
buttonBackground: theme.colors.
|
|
6
|
-
buttonPressedBackground: theme.colors.
|
|
7
|
-
buttonActiveBackground: theme.colors.
|
|
5
|
+
buttonBackground: theme.colors.primary,
|
|
6
|
+
buttonPressedBackground: theme.colors.primary,
|
|
7
|
+
buttonActiveBackground: theme.colors.primary,
|
|
8
8
|
icon: theme.colors.onDarkGlobalSurface,
|
|
9
|
-
actionItemBackground: theme.colors.
|
|
10
|
-
actionItemPressedBackground: theme.colors.
|
|
9
|
+
actionItemBackground: theme.colors.defaultGlobalSurface,
|
|
10
|
+
actionItemPressedBackground: theme.colors.defaultGlobalSurface,
|
|
11
11
|
backdropBackground: theme.colors.black,
|
|
12
12
|
titleText: theme.colors.onDarkGlobalSurface,
|
|
13
|
-
actionItemText: theme.colors.
|
|
13
|
+
actionItemText: theme.colors.onDefaultGlobalSurface,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const sizes = {
|
|
17
|
-
width: theme.sizes.
|
|
18
|
-
height: theme.sizes.
|
|
17
|
+
width: theme.sizes.xxxlarge,
|
|
18
|
+
height: theme.sizes.xxxlarge,
|
|
19
19
|
iconContainerWidth: theme.sizes.large,
|
|
20
20
|
iconContainerHeight: theme.sizes.large,
|
|
21
21
|
fabPairHeight: theme.sizes.xxxlarge,
|
|
@@ -24,12 +24,12 @@ const getFABTheme = (theme: GlobalTheme) => {
|
|
|
24
24
|
|
|
25
25
|
const fonts = {
|
|
26
26
|
actionItemText: theme.fonts.neutral.regular,
|
|
27
|
-
title: theme.fonts.neutral.
|
|
27
|
+
title: theme.fonts.neutral.regular,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const fontSizes = {
|
|
31
31
|
actionItemText: theme.fontSizes.large,
|
|
32
|
-
title: theme.fontSizes.
|
|
32
|
+
title: theme.fontSizes.medium,
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const lineHeights = {
|
|
@@ -49,7 +49,7 @@ const getFABTheme = (theme: GlobalTheme) => {
|
|
|
49
49
|
actionItemTextPaddingLeft: theme.space.xsmall,
|
|
50
50
|
buttonMarginTop: theme.space.large,
|
|
51
51
|
buttonMarginRight: theme.space.large,
|
|
52
|
-
containerPadding: theme.space.
|
|
52
|
+
containerPadding: theme.space.smallMedium,
|
|
53
53
|
titleMarginHorizontal: theme.space.small,
|
|
54
54
|
fabPairMarginRight: theme.space.small,
|
|
55
55
|
};
|
|
@@ -69,6 +69,7 @@ const getFABTheme = (theme: GlobalTheme) => {
|
|
|
69
69
|
space,
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
+
|
|
72
73
|
type GetFABThemeReturnType = ReturnType<typeof getFABTheme>;
|
|
73
74
|
export interface FABThemeType extends GetFABThemeReturnType {
|
|
74
75
|
/**
|
|
@@ -3,7 +3,7 @@ import type { SystemPalette, BrandSystemPalette } from './types';
|
|
|
3
3
|
import swagLightGlobalPalette from './swagLightGlobal';
|
|
4
4
|
|
|
5
5
|
const ehWorkBrandSystemPalette: BrandSystemPalette = {
|
|
6
|
-
primary: '#
|
|
6
|
+
primary: '#7622d7',
|
|
7
7
|
onPrimary: '#fdfbff',
|
|
8
8
|
secondary: '#b382fd',
|
|
9
9
|
onSecondary: palette.white,
|
|
@@ -32,7 +32,7 @@ export declare const StyledCheckMark: import("@emotion/native").StyledComponent<
|
|
|
32
32
|
as?: React.ElementType;
|
|
33
33
|
} & {
|
|
34
34
|
themeSize: "small" | "xsmall" | "medium" | "large" | "xlarge" | "xxxsmall";
|
|
35
|
-
themeIntent: "
|
|
35
|
+
themeIntent: "primary" | "secondary" | "text" | "warning" | "info" | "danger" | "success" | "disabled-text" | "text-inverted" | "muted" | "inactive";
|
|
36
36
|
} & {
|
|
37
37
|
ref?: import("react").Ref<import("react-native-vector-icons/Icon").Icon> | undefined;
|
|
38
38
|
} & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
import type { IconName } from '../Icon';
|
|
5
5
|
export type FABHandles = {
|
|
@@ -37,5 +37,9 @@ export interface FABProps {
|
|
|
37
37
|
*/
|
|
38
38
|
testID?: string;
|
|
39
39
|
}
|
|
40
|
+
declare const FABWithTitleStyle: React.ForwardRefExoticComponent<FABProps & {
|
|
41
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
42
|
+
} & React.RefAttributes<FABHandles>>;
|
|
40
43
|
declare const FAB: React.ForwardRefExoticComponent<FABProps & React.RefAttributes<FABHandles>>;
|
|
44
|
+
export { FABWithTitleStyle as FABInternal };
|
|
41
45
|
export default FAB;
|
|
@@ -2,7 +2,9 @@ declare const StyledFABPairWrapper: import("@emotion/native").StyledComponent<im
|
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
}, {}, {}>;
|
|
5
|
-
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps &
|
|
5
|
+
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps & {
|
|
6
|
+
titleStyle?: import("react-native").StyleProp<import("react-native").TextStyle>;
|
|
7
|
+
} & import("react").RefAttributes<import("../FAB").FABHandles> & {
|
|
6
8
|
theme?: import("@emotion/react").Theme;
|
|
7
9
|
as?: React.ElementType;
|
|
8
10
|
} & {
|
|
@@ -6,6 +6,7 @@ declare const StyledFAB: import("@emotion/native").StyledComponent<Animated.Anim
|
|
|
6
6
|
as?: React.ElementType;
|
|
7
7
|
} & {
|
|
8
8
|
themeActive?: boolean;
|
|
9
|
+
themeIconOnly?: boolean;
|
|
9
10
|
}, {}, {}>;
|
|
10
11
|
declare const StyledFABIcon: import("@emotion/native").StyledComponent<IconProps & {
|
|
11
12
|
theme?: import("@emotion/react").Theme;
|
|
@@ -24,10 +24,6 @@ declare const StyledErrorButtonContainer: import("@emotion/native").StyledCompon
|
|
|
24
24
|
}, {}, {
|
|
25
25
|
ref?: import("react").Ref<View> | undefined;
|
|
26
26
|
}>;
|
|
27
|
-
declare const StyledErrorButtonPrimary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
28
|
-
theme?: import("@emotion/react").Theme;
|
|
29
|
-
as?: React.ElementType;
|
|
30
|
-
}, {}, {}>;
|
|
31
27
|
declare const StyledErrorButtonSecondary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
32
28
|
theme?: import("@emotion/react").Theme;
|
|
33
29
|
as?: React.ElementType;
|
|
@@ -56,4 +52,4 @@ declare const StyledErrorDescription: import("@emotion/native").StyledComponent<
|
|
|
56
52
|
theme?: import("@emotion/react").Theme;
|
|
57
53
|
as?: React.ElementType;
|
|
58
54
|
}, {}, {}>;
|
|
59
|
-
export { ErrorVariant, StyledErrorModal, StyledErrorImage, StyledErrorContainer, StyledErrorButtonContainer,
|
|
55
|
+
export { ErrorVariant, StyledErrorModal, StyledErrorImage, StyledErrorContainer, StyledErrorButtonContainer, StyledErrorButtonSecondary, StyledErrorContent, StyledErrorTitle, StyledErrorDescription, StyledErrorImageContainer, StyledErrorIconContainer, };
|
|
@@ -44,10 +44,6 @@ declare const StyledSuccessButtonContainer: import("@emotion/native").StyledComp
|
|
|
44
44
|
}, {}, {
|
|
45
45
|
ref?: import("react").Ref<View> | undefined;
|
|
46
46
|
}>;
|
|
47
|
-
declare const StyledSuccessButtonPrimary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
48
|
-
theme?: import("@emotion/react").Theme;
|
|
49
|
-
as?: React.ElementType;
|
|
50
|
-
}, {}, {}>;
|
|
51
47
|
declare const StyledSuccessButtonSecondary: import("@emotion/native").StyledComponent<import("../../Button/Button").ButtonProps & {
|
|
52
48
|
theme?: import("@emotion/react").Theme;
|
|
53
49
|
as?: React.ElementType;
|
|
@@ -56,4 +52,4 @@ declare const StyledSuccessModal: import("@emotion/native").StyledComponent<impo
|
|
|
56
52
|
theme?: import("@emotion/react").Theme;
|
|
57
53
|
as?: React.ElementType;
|
|
58
54
|
}, {}, {}>;
|
|
59
|
-
export { SuccessVariant, StyledSuccessImage, StyledSuccessContainer, StyledSuccessContent, StyledSuccessImageContainer, StyledSuccessIconContainer, StyledSuccessTitle, StyledSuccessDescription, StyledSuccessButtonContainer,
|
|
55
|
+
export { SuccessVariant, StyledSuccessImage, StyledSuccessContainer, StyledSuccessContent, StyledSuccessImageContainer, StyledSuccessIconContainer, StyledSuccessTitle, StyledSuccessDescription, StyledSuccessButtonContainer, StyledSuccessButtonSecondary, StyledSuccessModal, };
|