@hero-design/rn 8.120.1 → 8.121.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/CHANGELOG.md +18 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +281 -32
- package/jest.config.js +1 -1
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +280 -30
- package/package.json +5 -1
- package/rollup.config.mjs +2 -0
- package/src/components/Icon/AnimatedIcon.tsx +7 -40
- package/src/components/Icon/GradientIcon/index.tsx +71 -0
- package/src/components/Icon/SpinWrapper.tsx +39 -0
- package/src/components/Icon/index.tsx +22 -1
- package/src/components/Toolbar/StyledToolbar.tsx +2 -2
- package/src/components/Typography/Body/StyledBody.tsx +2 -2
- package/src/components/Typography/Body/index.tsx +20 -2
- package/src/components/Typography/Caption/StyledCaption.tsx +2 -2
- package/src/components/Typography/Caption/index.tsx +20 -2
- package/src/components/Typography/GradientText/index.tsx +85 -0
- package/src/components/Typography/Label/StyledLabel.tsx +2 -2
- package/src/components/Typography/Label/index.tsx +20 -2
- package/src/components/Typography/Title/StyledTitle.tsx +2 -2
- package/src/components/Typography/Title/index.tsx +32 -13
- package/src/components/Typography/types.ts +3 -1
- package/src/components/Typography/utils.ts +31 -0
- package/src/theme/global/colors/gradients.ts +78 -0
- package/src/theme/global/colors/types.ts +22 -0
- package/src/theme/global/index.ts +5 -2
- package/testUtils/setup.tsx +34 -0
- package/types/components/Icon/GradientIcon/index.d.ts +12 -0
- package/types/components/Icon/SpinWrapper.d.ts +9 -0
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +1 -1
- package/types/components/Toolbar/StyledToolbar.d.ts +4 -4
- package/types/components/Typography/Body/StyledBody.d.ts +2 -2
- package/types/components/Typography/Body/index.d.ts +1 -1
- package/types/components/Typography/Caption/StyledCaption.d.ts +2 -2
- package/types/components/Typography/Caption/index.d.ts +1 -1
- package/types/components/Typography/GradientText/index.d.ts +7 -0
- package/types/components/Typography/Label/StyledLabel.d.ts +2 -2
- package/types/components/Typography/Label/index.d.ts +1 -1
- package/types/components/Typography/Title/StyledTitle.d.ts +2 -2
- package/types/components/Typography/Title/index.d.ts +1 -1
- package/types/components/Typography/types.d.ts +2 -1
- package/types/components/Typography/utils.d.ts +2 -0
- package/types/theme/global/colors/gradients.d.ts +3 -0
- package/types/theme/global/colors/types.d.ts +21 -0
- package/types/theme/global/index.d.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.121.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4963](https://github.com/Thinkei/hero-design/pull/4963) [`8921509e3c0271abe2c0df377316fc5ded154a05`](https://github.com/Thinkei/hero-design/commit/8921509e3c0271abe2c0df377316fc5ded154a05) Thanks [@ttkien](https://github.com/ttkien)! - [Icon] add 'ai' intent
|
|
8
|
+
|
|
9
|
+
- [#4968](https://github.com/Thinkei/hero-design/pull/4968) [`654135e5178e2ab74dc6e9d80edb7bdab60275d7`](https://github.com/Thinkei/hero-design/commit/654135e5178e2ab74dc6e9d80edb7bdab60275d7) Thanks [@ttkien](https://github.com/ttkien)! - [PS-2754] Add ai intent to RN Typography components
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#4972](https://github.com/Thinkei/hero-design/pull/4972) [`4caa323ce232ef982bab8e3845aadc6b493a3804`](https://github.com/Thinkei/hero-design/commit/4caa323ce232ef982bab8e3845aadc6b493a3804) Thanks [@ttkien](https://github.com/ttkien)! - Fix GradientText cross-axis stretch in row containers
|
|
14
|
+
|
|
15
|
+
## 8.120.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#4962](https://github.com/Thinkei/hero-design/pull/4962) [`78197ad0e210611eedab518bf088e7ee1c872fc3`](https://github.com/Thinkei/hero-design/commit/78197ad0e210611eedab518bf088e7ee1c872fc3) Thanks [@phucdph](https://github.com/phucdph)! - Update sparkle outlined icon
|
|
20
|
+
|
|
3
21
|
## 8.120.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
Binary file
|
package/es/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import * as reactNative from 'react-native';
|
|
|
2
2
|
import { StyleSheet as StyleSheet$1, Platform, Dimensions, Keyboard, Animated, View, UIManager, LayoutAnimation, TouchableOpacity, Text as Text$1, Easing, useWindowDimensions, TouchableWithoutFeedback, Modal as Modal$1, Image as Image$1, Pressable, SafeAreaView, KeyboardAvoidingView, TouchableHighlight, ScrollView, FlatList, TextInput as TextInput$1, PanResponder, BackHandler, InteractionManager, SectionList, RefreshControl as RefreshControl$1 } from 'react-native';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, useEffect, useMemo, useCallback, useRef, useLayoutEffect, createContext, forwardRef, useContext, memo, useReducer, isValidElement, useImperativeHandle } from 'react';
|
|
5
|
+
import MaskedView from '@react-native-masked-view/masked-view';
|
|
6
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
7
|
import { createIconSet } from 'react-native-vector-icons';
|
|
6
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
9
|
import { MonthYearPickerViewIOS, MonthYearPickerDialogueAndroid } from '@hero-design/react-native-month-year-picker';
|
|
@@ -10,7 +12,7 @@ import DateTimePicker from '@react-native-community/datetimepicker';
|
|
|
10
12
|
import RnSlider from '@react-native-community/slider';
|
|
11
13
|
import MultiSlider from '@ptomasroos/react-native-multi-slider';
|
|
12
14
|
import { RectButton, GestureHandlerRootView, Swipeable as Swipeable$1 } from 'react-native-gesture-handler';
|
|
13
|
-
import LinearGradient from 'react-native-linear-gradient';
|
|
15
|
+
import LinearGradient$1 from 'react-native-linear-gradient';
|
|
14
16
|
import PagerView from 'react-native-pager-view';
|
|
15
17
|
import { EventEmitter } from 'events';
|
|
16
18
|
import { WebView } from 'react-native-webview';
|
|
@@ -5426,6 +5428,76 @@ var getShadows = function getShadows(palette) {
|
|
|
5426
5428
|
}
|
|
5427
5429
|
};
|
|
5428
5430
|
|
|
5431
|
+
var DIAGONAL_ANGLE = 282;
|
|
5432
|
+
var HORIZONTAL_ANGLE = 90;
|
|
5433
|
+
var DIAGONAL_LOCATIONS = [0, 0.2931, 0.993];
|
|
5434
|
+
var HORIZONTAL_LOCATIONS = [0, 0.25, 0.75];
|
|
5435
|
+
// Convert CSS gradient angle (degrees) to expo-linear-gradient start/end points.
|
|
5436
|
+
// Follows CSS convention: 0° = bottom→top, 90° = left→right,
|
|
5437
|
+
// 180° = top→bottom, 270° = right→left.
|
|
5438
|
+
var angleToPoints = function angleToPoints(angleDeg) {
|
|
5439
|
+
var rad = (angleDeg - 90) * Math.PI / 180;
|
|
5440
|
+
var x = Math.cos(rad);
|
|
5441
|
+
var y = Math.sin(rad);
|
|
5442
|
+
// Normalize so both components are in [0, 1]
|
|
5443
|
+
var start = {
|
|
5444
|
+
x: Math.round((1 - x) / 2 * 100) / 100,
|
|
5445
|
+
y: Math.round((1 - y) / 2 * 100) / 100
|
|
5446
|
+
};
|
|
5447
|
+
var end = {
|
|
5448
|
+
x: Math.round((1 + x) / 2 * 100) / 100,
|
|
5449
|
+
y: Math.round((1 + y) / 2 * 100) / 100
|
|
5450
|
+
};
|
|
5451
|
+
return {
|
|
5452
|
+
start: start,
|
|
5453
|
+
end: end
|
|
5454
|
+
};
|
|
5455
|
+
};
|
|
5456
|
+
var getGradients = function getGradients(systemPalette) {
|
|
5457
|
+
var blueMedium = palette$9.blueMedium;
|
|
5458
|
+
var pinkMedium = palette$9.pinkMedium;
|
|
5459
|
+
var brandPrimary = systemPalette.primary;
|
|
5460
|
+
var backgroundFallback = systemPalette.defaultGlobalSurface;
|
|
5461
|
+
return {
|
|
5462
|
+
aiDiagonal: _objectSpread2(_objectSpread2({
|
|
5463
|
+
angle: DIAGONAL_ANGLE
|
|
5464
|
+
}, angleToPoints(DIAGONAL_ANGLE)), {}, {
|
|
5465
|
+
colors: [blueMedium, brandPrimary, pinkMedium],
|
|
5466
|
+
locations: DIAGONAL_LOCATIONS
|
|
5467
|
+
}),
|
|
5468
|
+
aiDiagonal8: _objectSpread2(_objectSpread2({
|
|
5469
|
+
angle: DIAGONAL_ANGLE
|
|
5470
|
+
}, angleToPoints(DIAGONAL_ANGLE)), {}, {
|
|
5471
|
+
colors: [blueMedium, brandPrimary, pinkMedium],
|
|
5472
|
+
locations: DIAGONAL_LOCATIONS,
|
|
5473
|
+
opacity: 0.08,
|
|
5474
|
+
backgroundFallback: backgroundFallback
|
|
5475
|
+
}),
|
|
5476
|
+
aiDiagonal16: _objectSpread2(_objectSpread2({
|
|
5477
|
+
angle: DIAGONAL_ANGLE
|
|
5478
|
+
}, angleToPoints(DIAGONAL_ANGLE)), {}, {
|
|
5479
|
+
colors: [blueMedium, brandPrimary, pinkMedium],
|
|
5480
|
+
locations: DIAGONAL_LOCATIONS,
|
|
5481
|
+
opacity: 0.16,
|
|
5482
|
+
backgroundFallback: backgroundFallback
|
|
5483
|
+
}),
|
|
5484
|
+
aiDiagonal24: _objectSpread2(_objectSpread2({
|
|
5485
|
+
angle: DIAGONAL_ANGLE
|
|
5486
|
+
}, angleToPoints(DIAGONAL_ANGLE)), {}, {
|
|
5487
|
+
colors: [blueMedium, brandPrimary, pinkMedium],
|
|
5488
|
+
locations: DIAGONAL_LOCATIONS,
|
|
5489
|
+
opacity: 0.24,
|
|
5490
|
+
backgroundFallback: backgroundFallback
|
|
5491
|
+
}),
|
|
5492
|
+
aiHorizontal: _objectSpread2(_objectSpread2({
|
|
5493
|
+
angle: HORIZONTAL_ANGLE
|
|
5494
|
+
}, angleToPoints(HORIZONTAL_ANGLE)), {}, {
|
|
5495
|
+
colors: [brandPrimary, pinkMedium, brandPrimary],
|
|
5496
|
+
locations: HORIZONTAL_LOCATIONS
|
|
5497
|
+
})
|
|
5498
|
+
};
|
|
5499
|
+
};
|
|
5500
|
+
|
|
5429
5501
|
var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
5430
5502
|
var fonts = getFonts(scale.font);
|
|
5431
5503
|
var fontSizes = getFontSizes(scale.fontSize);
|
|
@@ -5435,8 +5507,11 @@ var getGlobalTheme = function getGlobalTheme(scale, systemPalette) {
|
|
|
5435
5507
|
var sizes = getSizes(scale.size);
|
|
5436
5508
|
var radii = getRadii(scale.radius);
|
|
5437
5509
|
var shadows = getShadows(systemPalette);
|
|
5510
|
+
var gradients = getGradients(systemPalette);
|
|
5438
5511
|
return {
|
|
5439
|
-
colors: _objectSpread2({}, systemPalette),
|
|
5512
|
+
colors: _objectSpread2(_objectSpread2({}, systemPalette), {}, {
|
|
5513
|
+
gradients: gradients
|
|
5514
|
+
}),
|
|
5440
5515
|
fonts: fonts,
|
|
5441
5516
|
fontSizes: fontSizes,
|
|
5442
5517
|
lineHeights: lineHeights,
|
|
@@ -8066,7 +8141,7 @@ var StyledText$4 = index$c(Text$1)(function (_ref) {
|
|
|
8066
8141
|
});
|
|
8067
8142
|
});
|
|
8068
8143
|
|
|
8069
|
-
var _excluded$
|
|
8144
|
+
var _excluded$Q = ["children", "fontSize", "fontWeight", "intent", "typeface", "allowFontScaling"];
|
|
8070
8145
|
/**
|
|
8071
8146
|
* @deprecated Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.
|
|
8072
8147
|
*/
|
|
@@ -8082,7 +8157,7 @@ var Text = function Text(_ref) {
|
|
|
8082
8157
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8083
8158
|
_ref$allowFontScaling = _ref.allowFontScaling,
|
|
8084
8159
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8085
|
-
nativeProps = _objectWithoutProperties(_ref, _excluded$
|
|
8160
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$Q);
|
|
8086
8161
|
useDeprecation('Typography.Text is deprecated and will be removed in the next major release, please refer to https://design.employmenthero.com/mobile/Components/typography for the appropriate alternatives.');
|
|
8087
8162
|
return /*#__PURE__*/React__default.createElement(StyledText$4, _extends$1({}, nativeProps, {
|
|
8088
8163
|
themeFontSize: fontSize,
|
|
@@ -8115,7 +8190,79 @@ var StyledCaption = index$c(Text$1)(function (_ref) {
|
|
|
8115
8190
|
};
|
|
8116
8191
|
});
|
|
8117
8192
|
|
|
8118
|
-
var
|
|
8193
|
+
var ACCESSIBILITY_KEYS = ['accessible', 'accessibilityActions', 'accessibilityLabel', 'accessibilityRole', 'accessibilityState', 'accessibilityHint', 'accessibilityValue', 'onAccessibilityAction',
|
|
8194
|
+
// Android
|
|
8195
|
+
'accessibilityLabelledBy', 'accessibilityLiveRegion', 'importantForAccessibility',
|
|
8196
|
+
// iOS
|
|
8197
|
+
'accessibilityElementsHidden', 'accessibilityLanguage', 'accessibilityIgnoresInvertColors', 'accessibilityViewIsModal', 'onAccessibilityEscape', 'onAccessibilityTap', 'onMagicTap', 'accessibilityIgnoresInvertColors'];
|
|
8198
|
+
var pickAccessibilityProps = function pickAccessibilityProps(props) {
|
|
8199
|
+
return ACCESSIBILITY_KEYS.filter(function (key) {
|
|
8200
|
+
return key in props;
|
|
8201
|
+
}).reduce(function (acc, key) {
|
|
8202
|
+
return Object.assign(acc, _defineProperty({}, key, props[key]));
|
|
8203
|
+
}, {});
|
|
8204
|
+
};
|
|
8205
|
+
|
|
8206
|
+
var _excluded$P = ["children"];
|
|
8207
|
+
var GradientText = function GradientText(_ref) {
|
|
8208
|
+
var children = _ref.children,
|
|
8209
|
+
accessibilityProps = _objectWithoutProperties(_ref, _excluded$P);
|
|
8210
|
+
var theme = useTheme();
|
|
8211
|
+
var gradient = theme.colors.gradients.aiDiagonal;
|
|
8212
|
+
var _useState = useState(null),
|
|
8213
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
8214
|
+
size = _useState2[0],
|
|
8215
|
+
setSize = _useState2[1];
|
|
8216
|
+
var onLayout = useCallback(function (event) {
|
|
8217
|
+
var _event$nativeEvent$la = event.nativeEvent.layout,
|
|
8218
|
+
width = _event$nativeEvent$la.width,
|
|
8219
|
+
height = _event$nativeEvent$la.height;
|
|
8220
|
+
setSize(function (prevSize) {
|
|
8221
|
+
if (prevSize && prevSize.width === width && prevSize.height === height) {
|
|
8222
|
+
return prevSize;
|
|
8223
|
+
}
|
|
8224
|
+
return {
|
|
8225
|
+
width: width,
|
|
8226
|
+
height: height
|
|
8227
|
+
};
|
|
8228
|
+
});
|
|
8229
|
+
}, []);
|
|
8230
|
+
return /*#__PURE__*/React__default.createElement(View, accessibilityProps, /*#__PURE__*/React__default.createElement(MaskedView, {
|
|
8231
|
+
style: {
|
|
8232
|
+
alignSelf: 'stretch'
|
|
8233
|
+
},
|
|
8234
|
+
accessibilityElementsHidden: true,
|
|
8235
|
+
importantForAccessibility: "no-hide-descendants",
|
|
8236
|
+
maskElement: /*#__PURE__*/React__default.createElement(View, {
|
|
8237
|
+
onLayout: onLayout,
|
|
8238
|
+
style: {
|
|
8239
|
+
backgroundColor: 'transparent'
|
|
8240
|
+
},
|
|
8241
|
+
testID: "gradient-text-mask"
|
|
8242
|
+
}, children)
|
|
8243
|
+
}, size ? /*#__PURE__*/React__default.createElement(LinearGradient, {
|
|
8244
|
+
start: gradient.start,
|
|
8245
|
+
end: gradient.end,
|
|
8246
|
+
colors: gradient.colors,
|
|
8247
|
+
locations: gradient.locations,
|
|
8248
|
+
style: {
|
|
8249
|
+
width: size.width,
|
|
8250
|
+
height: size.height
|
|
8251
|
+
}
|
|
8252
|
+
}) :
|
|
8253
|
+
// Render children as fallback until layout is measured, so text
|
|
8254
|
+
// is visible immediately rather than blank on the first frame.
|
|
8255
|
+
children), /*#__PURE__*/React__default.createElement(View, {
|
|
8256
|
+
style: {
|
|
8257
|
+
position: 'absolute',
|
|
8258
|
+
opacity: 0
|
|
8259
|
+
},
|
|
8260
|
+
importantForAccessibility: "yes",
|
|
8261
|
+
accessibilityElementsHidden: false
|
|
8262
|
+
}, children));
|
|
8263
|
+
};
|
|
8264
|
+
|
|
8265
|
+
var _excluded$O = ["children", "fontWeight", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
|
|
8119
8266
|
var Caption = function Caption(_ref) {
|
|
8120
8267
|
var children = _ref.children,
|
|
8121
8268
|
_ref$fontWeight = _ref.fontWeight,
|
|
@@ -8126,13 +8273,22 @@ var Caption = function Caption(_ref) {
|
|
|
8126
8273
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8127
8274
|
_ref$fontStyle = _ref.fontStyle,
|
|
8128
8275
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8129
|
-
|
|
8130
|
-
|
|
8276
|
+
style = _ref.style,
|
|
8277
|
+
testID = _ref.testID,
|
|
8278
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$O);
|
|
8279
|
+
var isAi = intent === 'ai';
|
|
8280
|
+
var styledText = /*#__PURE__*/React__default.createElement(StyledCaption, _extends$1({}, nativeProps, {
|
|
8131
8281
|
themeFontWeight: fontWeight,
|
|
8132
|
-
themeIntent: intent,
|
|
8282
|
+
themeIntent: isAi ? 'body' : intent,
|
|
8133
8283
|
themeIsItalic: fontStyle === 'italic',
|
|
8134
|
-
allowFontScaling: allowFontScaling
|
|
8284
|
+
allowFontScaling: allowFontScaling,
|
|
8285
|
+
style: style,
|
|
8286
|
+
testID: testID
|
|
8135
8287
|
}), children);
|
|
8288
|
+
if (isAi) {
|
|
8289
|
+
return /*#__PURE__*/React__default.createElement(GradientText, pickAccessibilityProps(nativeProps), styledText);
|
|
8290
|
+
}
|
|
8291
|
+
return styledText;
|
|
8136
8292
|
};
|
|
8137
8293
|
|
|
8138
8294
|
var StyledLabel$1 = index$c(Text$1)(function (_ref) {
|
|
@@ -8151,7 +8307,7 @@ var StyledLabel$1 = index$c(Text$1)(function (_ref) {
|
|
|
8151
8307
|
};
|
|
8152
8308
|
});
|
|
8153
8309
|
|
|
8154
|
-
var _excluded$
|
|
8310
|
+
var _excluded$N = ["children", "intent", "allowFontScaling", "fontStyle", "style", "testID"];
|
|
8155
8311
|
var Label = function Label(_ref) {
|
|
8156
8312
|
var children = _ref.children,
|
|
8157
8313
|
_ref$intent = _ref.intent,
|
|
@@ -8160,12 +8316,21 @@ var Label = function Label(_ref) {
|
|
|
8160
8316
|
allowFontScaling = _ref$allowFontScaling === void 0 ? false : _ref$allowFontScaling,
|
|
8161
8317
|
_ref$fontStyle = _ref.fontStyle,
|
|
8162
8318
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8319
|
+
style = _ref.style,
|
|
8320
|
+
testID = _ref.testID,
|
|
8321
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$N);
|
|
8322
|
+
var isAi = intent === 'ai';
|
|
8323
|
+
var styledText = /*#__PURE__*/React__default.createElement(StyledLabel$1, _extends$1({}, nativeProps, {
|
|
8324
|
+
themeIntent: isAi ? 'body' : intent,
|
|
8166
8325
|
themeIsItalic: fontStyle === 'italic',
|
|
8167
|
-
allowFontScaling: allowFontScaling
|
|
8326
|
+
allowFontScaling: allowFontScaling,
|
|
8327
|
+
style: style,
|
|
8328
|
+
testID: testID
|
|
8168
8329
|
}), children);
|
|
8330
|
+
if (isAi) {
|
|
8331
|
+
return /*#__PURE__*/React__default.createElement(GradientText, pickAccessibilityProps(nativeProps), styledText);
|
|
8332
|
+
}
|
|
8333
|
+
return styledText;
|
|
8169
8334
|
};
|
|
8170
8335
|
|
|
8171
8336
|
var StyledTitle$1 = index$c(Text$1)(function (_ref) {
|
|
@@ -8183,7 +8348,7 @@ var StyledTitle$1 = index$c(Text$1)(function (_ref) {
|
|
|
8183
8348
|
};
|
|
8184
8349
|
});
|
|
8185
8350
|
|
|
8186
|
-
var _excluded$
|
|
8351
|
+
var _excluded$M = ["children", "intent", "allowFontScaling", "level", "typeface", "fontStyle", "style", "testID"];
|
|
8187
8352
|
var Title = function Title(_ref) {
|
|
8188
8353
|
var children = _ref.children,
|
|
8189
8354
|
_ref$intent = _ref.intent,
|
|
@@ -8196,14 +8361,23 @@ var Title = function Title(_ref) {
|
|
|
8196
8361
|
typeface = _ref$typeface === void 0 ? 'neutral' : _ref$typeface,
|
|
8197
8362
|
_ref$fontStyle = _ref.fontStyle,
|
|
8198
8363
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8199
|
-
|
|
8200
|
-
|
|
8364
|
+
style = _ref.style,
|
|
8365
|
+
testID = _ref.testID,
|
|
8366
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$M);
|
|
8367
|
+
var isAi = intent === 'ai';
|
|
8368
|
+
var styledText = /*#__PURE__*/React__default.createElement(StyledTitle$1, _extends$1({}, nativeProps, {
|
|
8201
8369
|
themeLevel: level,
|
|
8202
8370
|
themeTypeface: typeface,
|
|
8203
|
-
themeIntent: intent,
|
|
8371
|
+
themeIntent: isAi ? 'body' : intent,
|
|
8204
8372
|
themeIsItalic: fontStyle === 'italic',
|
|
8205
|
-
allowFontScaling: allowFontScaling
|
|
8373
|
+
allowFontScaling: allowFontScaling,
|
|
8374
|
+
style: style,
|
|
8375
|
+
testID: testID
|
|
8206
8376
|
}), children);
|
|
8377
|
+
if (isAi) {
|
|
8378
|
+
return /*#__PURE__*/React__default.createElement(GradientText, pickAccessibilityProps(nativeProps), styledText);
|
|
8379
|
+
}
|
|
8380
|
+
return styledText;
|
|
8207
8381
|
};
|
|
8208
8382
|
|
|
8209
8383
|
var FONTWEIGHT_MAP = {
|
|
@@ -8235,7 +8409,7 @@ var StyledBody$2 = index$c(Text$1)(function (_ref) {
|
|
|
8235
8409
|
};
|
|
8236
8410
|
});
|
|
8237
8411
|
|
|
8238
|
-
var _excluded$
|
|
8412
|
+
var _excluded$L = ["children", "intent", "allowFontScaling", "typeface", "variant", "fontStyle", "style", "testID"];
|
|
8239
8413
|
var Body = function Body(_ref) {
|
|
8240
8414
|
var children = _ref.children,
|
|
8241
8415
|
_ref$intent = _ref.intent,
|
|
@@ -8248,14 +8422,23 @@ var Body = function Body(_ref) {
|
|
|
8248
8422
|
variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
|
|
8249
8423
|
_ref$fontStyle = _ref.fontStyle,
|
|
8250
8424
|
fontStyle = _ref$fontStyle === void 0 ? 'normal' : _ref$fontStyle,
|
|
8251
|
-
|
|
8252
|
-
|
|
8425
|
+
style = _ref.style,
|
|
8426
|
+
testID = _ref.testID,
|
|
8427
|
+
nativeProps = _objectWithoutProperties(_ref, _excluded$L);
|
|
8428
|
+
var isAi = intent === 'ai';
|
|
8429
|
+
var styledText = /*#__PURE__*/React__default.createElement(StyledBody$2, _extends$1({}, nativeProps, {
|
|
8253
8430
|
themeTypeface: typeface,
|
|
8254
|
-
themeIntent: intent,
|
|
8431
|
+
themeIntent: isAi ? 'body' : intent,
|
|
8255
8432
|
themeVariant: variant,
|
|
8256
8433
|
themeIsItalic: fontStyle === 'italic',
|
|
8257
|
-
allowFontScaling: allowFontScaling
|
|
8434
|
+
allowFontScaling: allowFontScaling,
|
|
8435
|
+
style: style,
|
|
8436
|
+
testID: testID
|
|
8258
8437
|
}), children);
|
|
8438
|
+
if (isAi) {
|
|
8439
|
+
return /*#__PURE__*/React__default.createElement(GradientText, pickAccessibilityProps(nativeProps), styledText);
|
|
8440
|
+
}
|
|
8441
|
+
return styledText;
|
|
8259
8442
|
};
|
|
8260
8443
|
|
|
8261
8444
|
var Typography = {
|
|
@@ -8865,10 +9048,10 @@ var StyledHeroIcon = index$c(HeroIcon)(function (_ref) {
|
|
|
8865
9048
|
};
|
|
8866
9049
|
});
|
|
8867
9050
|
|
|
8868
|
-
var
|
|
8869
|
-
var
|
|
8870
|
-
|
|
8871
|
-
|
|
9051
|
+
var SpinWrapper = function SpinWrapper(_ref) {
|
|
9052
|
+
var children = _ref.children,
|
|
9053
|
+
style = _ref.style,
|
|
9054
|
+
testID = _ref.testID;
|
|
8872
9055
|
var rotateAnimation = useRef(new Animated.Value(0));
|
|
8873
9056
|
useEffect(function () {
|
|
8874
9057
|
var animation = Animated.loop(Animated.timing(rotateAnimation.current, {
|
|
@@ -8879,22 +9062,74 @@ var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
|
8879
9062
|
}));
|
|
8880
9063
|
animation.start();
|
|
8881
9064
|
return function () {
|
|
8882
|
-
animation.stop();
|
|
9065
|
+
return animation.stop();
|
|
8883
9066
|
};
|
|
8884
9067
|
}, []);
|
|
8885
|
-
var
|
|
9068
|
+
var rotate = rotateAnimation.current.interpolate({
|
|
8886
9069
|
inputRange: [0, 1],
|
|
8887
9070
|
outputRange: ['0deg', '360deg']
|
|
8888
9071
|
});
|
|
8889
9072
|
return /*#__PURE__*/React__default.createElement(Animated.View, {
|
|
9073
|
+
testID: testID,
|
|
8890
9074
|
style: [{
|
|
8891
9075
|
transform: [{
|
|
8892
|
-
rotate:
|
|
9076
|
+
rotate: rotate
|
|
8893
9077
|
}]
|
|
8894
9078
|
}, style]
|
|
9079
|
+
}, children);
|
|
9080
|
+
};
|
|
9081
|
+
|
|
9082
|
+
var _excluded$K = ["style"];
|
|
9083
|
+
var AnimatedIcon = function AnimatedIcon(_ref) {
|
|
9084
|
+
var style = _ref.style,
|
|
9085
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$K);
|
|
9086
|
+
return /*#__PURE__*/React__default.createElement(SpinWrapper, {
|
|
9087
|
+
style: style
|
|
8895
9088
|
}, /*#__PURE__*/React__default.createElement(StyledHeroIcon, otherProps));
|
|
8896
9089
|
};
|
|
8897
9090
|
|
|
9091
|
+
var _excluded$J = ["name", "themeSize", "testID", "style"];
|
|
9092
|
+
var GradientIcon = function GradientIcon(_ref) {
|
|
9093
|
+
var name = _ref.name,
|
|
9094
|
+
themeSize = _ref.themeSize,
|
|
9095
|
+
testID = _ref.testID,
|
|
9096
|
+
style = _ref.style,
|
|
9097
|
+
accessibilityProps = _objectWithoutProperties(_ref, _excluded$J);
|
|
9098
|
+
var theme = useTheme();
|
|
9099
|
+
var gradient = theme.colors.gradients.aiDiagonal;
|
|
9100
|
+
var size = theme.__hd__.icon.sizes[themeSize];
|
|
9101
|
+
return /*#__PURE__*/React__default.createElement(MaskedView, _extends$1({
|
|
9102
|
+
testID: testID,
|
|
9103
|
+
style: [{
|
|
9104
|
+
width: size,
|
|
9105
|
+
height: size
|
|
9106
|
+
}, style]
|
|
9107
|
+
}, accessibilityProps, {
|
|
9108
|
+
maskElement: /*#__PURE__*/React__default.createElement(View, {
|
|
9109
|
+
style: {
|
|
9110
|
+
backgroundColor: 'transparent',
|
|
9111
|
+
width: size,
|
|
9112
|
+
height: size,
|
|
9113
|
+
alignItems: 'center',
|
|
9114
|
+
justifyContent: 'center'
|
|
9115
|
+
}
|
|
9116
|
+
}, /*#__PURE__*/React__default.createElement(StyledHeroIcon, {
|
|
9117
|
+
name: name,
|
|
9118
|
+
themeIntent: "text",
|
|
9119
|
+
themeSize: themeSize
|
|
9120
|
+
}))
|
|
9121
|
+
}), /*#__PURE__*/React__default.createElement(LinearGradient, {
|
|
9122
|
+
start: gradient.start,
|
|
9123
|
+
end: gradient.end,
|
|
9124
|
+
colors: gradient.colors,
|
|
9125
|
+
locations: gradient.locations,
|
|
9126
|
+
style: {
|
|
9127
|
+
width: size,
|
|
9128
|
+
height: size
|
|
9129
|
+
}
|
|
9130
|
+
}));
|
|
9131
|
+
};
|
|
9132
|
+
|
|
8898
9133
|
var Icon = function Icon(_ref) {
|
|
8899
9134
|
var icon = _ref.icon,
|
|
8900
9135
|
style = _ref.style,
|
|
@@ -8930,6 +9165,20 @@ var Icon = function Icon(_ref) {
|
|
|
8930
9165
|
accessibilityViewIsModal: accessibilityViewIsModal,
|
|
8931
9166
|
accessibilityActions: accessibilityActions
|
|
8932
9167
|
};
|
|
9168
|
+
if (intent === 'ai') {
|
|
9169
|
+
var gradientIcon = /*#__PURE__*/React__default.createElement(GradientIcon, _extends$1({
|
|
9170
|
+
name: icon,
|
|
9171
|
+
themeSize: size,
|
|
9172
|
+
testID: testID,
|
|
9173
|
+
style: spin ? undefined : style
|
|
9174
|
+
}, accessibilityProps));
|
|
9175
|
+
if (spin) {
|
|
9176
|
+
return /*#__PURE__*/React__default.createElement(SpinWrapper, {
|
|
9177
|
+
style: style
|
|
9178
|
+
}, gradientIcon);
|
|
9179
|
+
}
|
|
9180
|
+
return gradientIcon;
|
|
9181
|
+
}
|
|
8933
9182
|
return spin ? /*#__PURE__*/React__default.createElement(AnimatedIcon, _extends$1({
|
|
8934
9183
|
name: icon,
|
|
8935
9184
|
themeIntent: intent,
|
|
@@ -27013,7 +27262,7 @@ var StyledGradientContainer = index$c(Box)(function (_ref2) {
|
|
|
27013
27262
|
});
|
|
27014
27263
|
|
|
27015
27264
|
var _excluded$b = ["intent", "variant", "style", "onLayout"];
|
|
27016
|
-
var AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);
|
|
27265
|
+
var AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient$1);
|
|
27017
27266
|
var gradientPositions = {
|
|
27018
27267
|
start: {
|
|
27019
27268
|
x: 0,
|
package/jest.config.js
CHANGED
|
@@ -19,6 +19,6 @@ module.exports = {
|
|
|
19
19
|
roots: ['<rootDir>/src'],
|
|
20
20
|
snapshotSerializers: ['@emotion/jest/serializer'],
|
|
21
21
|
transformIgnorePatterns: [
|
|
22
|
-
'node_modules/(?!((jest-)?@react-native|@emotion/.*|react-native|react-native-linear-gradient|react-native-pager-view|@react-native-community|nanoid|d3|d3-.*|internmap|delaunator|robust-predicates)/)',
|
|
22
|
+
'node_modules/(?!((jest-)?@react-native|@emotion/.*|react-native|react-native-linear-gradient|react-native-pager-view|@react-native-community|@react-native-masked-view|expo-linear-gradient|nanoid|d3|d3-.*|internmap|delaunator|robust-predicates)/)',
|
|
23
23
|
],
|
|
24
24
|
};
|
|
Binary file
|