@hero-design/rn 8.87.1 → 8.88.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 +18 -0
- package/es/index.js +119 -59
- package/lib/index.js +119 -59
- package/package.json +2 -2
- package/src/components/AppCue/StyledAppCue.tsx +27 -1
- package/src/components/AppCue/__tests__/StyledAppCue.tsx +4 -0
- package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +194 -0
- package/src/components/AppCue/__tests__/__snapshots__/index.spec.tsx.snap +260 -0
- package/src/components/AppCue/__tests__/index.spec.tsx +4 -0
- package/src/components/AppCue/__tests__/utils.spec.ts +57 -4
- package/src/components/AppCue/index.tsx +7 -4
- package/src/components/AppCue/utils.ts +60 -9
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +18 -15
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +6 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +6 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +12 -10
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Empty/index.tsx +1 -1
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +42 -35
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +36 -30
- package/src/components/TextInput/StyledTextInput.tsx +4 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +20 -0
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +446 -432
- package/src/components/TextInput/index.tsx +13 -32
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +12 -10
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +12 -10
- package/stats/8.87.2/rn-stats.html +4844 -0
- package/stats/8.88.0/rn-stats.html +4844 -0
- package/types/components/AppCue/StyledAppCue.d.ts +1 -1
- package/types/components/AppCue/utils.d.ts +6 -3
package/lib/index.js
CHANGED
|
@@ -5884,10 +5884,10 @@ function requireUnit() {
|
|
|
5884
5884
|
return unit;
|
|
5885
5885
|
}
|
|
5886
5886
|
|
|
5887
|
-
var lib$
|
|
5887
|
+
var lib$2;
|
|
5888
5888
|
var hasRequiredLib$1;
|
|
5889
5889
|
function requireLib$1() {
|
|
5890
|
-
if (hasRequiredLib$1) return lib$
|
|
5890
|
+
if (hasRequiredLib$1) return lib$2;
|
|
5891
5891
|
hasRequiredLib$1 = 1;
|
|
5892
5892
|
var parse = requireParse();
|
|
5893
5893
|
var walk = requireWalk();
|
|
@@ -5909,8 +5909,8 @@ function requireLib$1() {
|
|
|
5909
5909
|
ValueParser.unit = requireUnit();
|
|
5910
5910
|
ValueParser.walk = walk;
|
|
5911
5911
|
ValueParser.stringify = stringify;
|
|
5912
|
-
lib$
|
|
5913
|
-
return lib$
|
|
5912
|
+
lib$2 = ValueParser;
|
|
5913
|
+
return lib$2;
|
|
5914
5914
|
}
|
|
5915
5915
|
|
|
5916
5916
|
var camelize;
|
|
@@ -8386,7 +8386,7 @@ var StyledContainer$9 = index$a(reactNative.View)(function (_ref2) {
|
|
|
8386
8386
|
var StyledIconContainer$1 = index$a(reactNative.Animated.View)(function (_ref3) {
|
|
8387
8387
|
var theme = _ref3.theme,
|
|
8388
8388
|
themePlacement = _ref3.themePlacement;
|
|
8389
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
8389
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
8390
8390
|
position: 'absolute',
|
|
8391
8391
|
color: theme.__hd__.appCue.colors.background,
|
|
8392
8392
|
display: 'flex',
|
|
@@ -8413,6 +8413,24 @@ var StyledIconContainer$1 = index$a(reactNative.Animated.View)(function (_ref3)
|
|
|
8413
8413
|
rotate: '-90deg'
|
|
8414
8414
|
}],
|
|
8415
8415
|
height: '100%'
|
|
8416
|
+
}), themePlacement === 'top-left' && {
|
|
8417
|
+
bottom: -theme.__hd__.appCue.space.arrowOffset,
|
|
8418
|
+
right: theme.__hd__.appCue.space.arrowOffset
|
|
8419
|
+
}), themePlacement === 'top-right' && {
|
|
8420
|
+
bottom: -theme.__hd__.appCue.space.arrowOffset,
|
|
8421
|
+
left: theme.__hd__.appCue.space.arrowOffset
|
|
8422
|
+
}), themePlacement === 'bottom-left' && {
|
|
8423
|
+
top: -theme.__hd__.appCue.space.arrowOffset,
|
|
8424
|
+
right: theme.__hd__.appCue.space.arrowOffset,
|
|
8425
|
+
transform: [{
|
|
8426
|
+
rotate: '180deg'
|
|
8427
|
+
}]
|
|
8428
|
+
}), themePlacement === 'bottom-right' && {
|
|
8429
|
+
top: -theme.__hd__.appCue.space.arrowOffset,
|
|
8430
|
+
left: theme.__hd__.appCue.space.arrowOffset,
|
|
8431
|
+
transform: [{
|
|
8432
|
+
rotate: '180deg'
|
|
8433
|
+
}]
|
|
8416
8434
|
});
|
|
8417
8435
|
});
|
|
8418
8436
|
|
|
@@ -8439,42 +8457,79 @@ var calculatePosition = function calculatePosition(_ref) {
|
|
|
8439
8457
|
var placement = _ref.placement,
|
|
8440
8458
|
position = _ref.position,
|
|
8441
8459
|
contentSize = _ref.contentSize,
|
|
8442
|
-
offset = _ref.offset
|
|
8460
|
+
offset = _ref.offset,
|
|
8461
|
+
windowWidth = _ref.windowWidth;
|
|
8443
8462
|
switch (placement) {
|
|
8444
8463
|
case 'top':
|
|
8445
8464
|
{
|
|
8446
8465
|
return {
|
|
8447
8466
|
// The X coordinate is calculated by adding the half of the width of the target element to the X coordinate of the target element.
|
|
8448
|
-
|
|
8467
|
+
left: position.pageX + (position.width - contentSize.width) / 2,
|
|
8449
8468
|
// The Y coordinate is calculated by subtracting the height of the content and the offset from the Y coordinate of the target element
|
|
8450
|
-
|
|
8469
|
+
top: position.pageY - contentSize.height - offset
|
|
8451
8470
|
};
|
|
8452
8471
|
}
|
|
8453
8472
|
case 'bottom':
|
|
8454
8473
|
{
|
|
8455
8474
|
return {
|
|
8456
8475
|
// The X coordinate is calculated by adding the half of the width of the target element to the X coordinate of the target element.
|
|
8457
|
-
|
|
8476
|
+
left: position.pageX + (position.width - contentSize.width) / 2,
|
|
8458
8477
|
// The Y coordinate is calculated by adding the height of the target element and the offset to the Y coordinate of the target element.
|
|
8459
|
-
|
|
8478
|
+
top: position.pageY + position.height + offset
|
|
8460
8479
|
};
|
|
8461
8480
|
}
|
|
8462
8481
|
case 'right':
|
|
8463
8482
|
{
|
|
8464
8483
|
return {
|
|
8465
8484
|
// The X coordinate is calculated by adding the width of the target element and the offset to the X coordinate of the target element.
|
|
8466
|
-
|
|
8485
|
+
left: position.pageX + position.width + offset,
|
|
8467
8486
|
// The Y coordinate is calculated by adding half of the height of the target element to the Y coordinate of the target element.
|
|
8468
|
-
|
|
8487
|
+
top: position.pageY + (position.height - contentSize.height) / 2
|
|
8469
8488
|
};
|
|
8470
8489
|
}
|
|
8471
8490
|
case 'left':
|
|
8472
8491
|
{
|
|
8473
8492
|
return {
|
|
8474
8493
|
// The X coordinate is calculated by subtracting the width of the content and the offset from the X coordinate of the target element.
|
|
8475
|
-
|
|
8494
|
+
left: position.pageX - contentSize.width - offset,
|
|
8476
8495
|
// The Y coordinate is calculated by adding half of the height of the target element to the Y coordinate of the target element.
|
|
8477
|
-
|
|
8496
|
+
top: position.pageY + (position.height - contentSize.height) / 2
|
|
8497
|
+
};
|
|
8498
|
+
}
|
|
8499
|
+
case 'top-left':
|
|
8500
|
+
{
|
|
8501
|
+
return {
|
|
8502
|
+
// The X coordinate is calculated by subtracting the width of the content from the X coordinate of the target element.
|
|
8503
|
+
right: windowWidth - position.pageX - position.width,
|
|
8504
|
+
// The Y coordinate is calculated by subtracting the height of the content and the offset from the Y coordinate of the target element
|
|
8505
|
+
top: position.pageY - contentSize.height - offset
|
|
8506
|
+
};
|
|
8507
|
+
}
|
|
8508
|
+
case 'top-right':
|
|
8509
|
+
{
|
|
8510
|
+
return {
|
|
8511
|
+
// The X coordinate is calculated by adding the width of the target element to the X coordinate of the target element.
|
|
8512
|
+
left: position.pageX,
|
|
8513
|
+
// The Y coordinate is calculated by subtracting the height of the content and the offset from the Y coordinate of the target element.
|
|
8514
|
+
top: position.pageY - contentSize.height - offset
|
|
8515
|
+
};
|
|
8516
|
+
}
|
|
8517
|
+
case 'bottom-left':
|
|
8518
|
+
{
|
|
8519
|
+
return {
|
|
8520
|
+
// The X coordinate is calculated by subtracting the width of the content from the X coordinate of the target element.
|
|
8521
|
+
right: windowWidth - position.pageX - position.width,
|
|
8522
|
+
// The Y coordinate is calculated by adding the height of the target element and the offset to the Y coordinate of the target element.
|
|
8523
|
+
top: position.pageY + position.height + offset
|
|
8524
|
+
};
|
|
8525
|
+
}
|
|
8526
|
+
case 'bottom-right':
|
|
8527
|
+
{
|
|
8528
|
+
return {
|
|
8529
|
+
// The X coordinate is calculated by adding the width of the target element to the X coordinate of the target element.
|
|
8530
|
+
left: position.pageX,
|
|
8531
|
+
// The Y coordinate is calculated by adding the height of the target element and the offset to the Y coordinate of the target element.
|
|
8532
|
+
top: position.pageY + position.height + offset
|
|
8478
8533
|
};
|
|
8479
8534
|
}
|
|
8480
8535
|
}
|
|
@@ -8516,6 +8571,22 @@ var calulateContentMaxWidth = function calulateContentMaxWidth(_ref2) {
|
|
|
8516
8571
|
{
|
|
8517
8572
|
return position.pageX - offset;
|
|
8518
8573
|
}
|
|
8574
|
+
case 'top-left':
|
|
8575
|
+
{
|
|
8576
|
+
return position.pageX + position.width;
|
|
8577
|
+
}
|
|
8578
|
+
case 'top-right':
|
|
8579
|
+
{
|
|
8580
|
+
return windowWidth - position.pageX;
|
|
8581
|
+
}
|
|
8582
|
+
case 'bottom-left':
|
|
8583
|
+
{
|
|
8584
|
+
return position.pageX + position.width;
|
|
8585
|
+
}
|
|
8586
|
+
case 'bottom-right':
|
|
8587
|
+
{
|
|
8588
|
+
return windowWidth - position.pageX;
|
|
8589
|
+
}
|
|
8519
8590
|
}
|
|
8520
8591
|
};
|
|
8521
8592
|
|
|
@@ -8582,14 +8653,15 @@ var AppCue = function AppCue(_ref) {
|
|
|
8582
8653
|
height: event.nativeEvent.layout.height
|
|
8583
8654
|
});
|
|
8584
8655
|
};
|
|
8656
|
+
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
8657
|
+
windowWidth = _useWindowDimensions.width;
|
|
8585
8658
|
var pos = calculatePosition({
|
|
8586
8659
|
position: position,
|
|
8587
8660
|
contentSize: contentSize,
|
|
8588
8661
|
placement: placement,
|
|
8589
|
-
offset: offset
|
|
8662
|
+
offset: offset,
|
|
8663
|
+
windowWidth: windowWidth
|
|
8590
8664
|
});
|
|
8591
|
-
var _useWindowDimensions = reactNative.useWindowDimensions(),
|
|
8592
|
-
windowWidth = _useWindowDimensions.width;
|
|
8593
8665
|
var maxWidth = calulateContentMaxWidth({
|
|
8594
8666
|
position: position,
|
|
8595
8667
|
offset: offset,
|
|
@@ -8629,8 +8701,10 @@ var AppCue = function AppCue(_ref) {
|
|
|
8629
8701
|
}, /*#__PURE__*/React__namespace.default.createElement(StyledContainer$9, null, /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
8630
8702
|
style: reactNative.StyleSheet.flatten([{
|
|
8631
8703
|
position: 'absolute',
|
|
8632
|
-
top: pos.
|
|
8633
|
-
left: pos.
|
|
8704
|
+
top: pos.top,
|
|
8705
|
+
left: pos.left,
|
|
8706
|
+
bottom: pos.bottom,
|
|
8707
|
+
right: pos.right
|
|
8634
8708
|
}, style]),
|
|
8635
8709
|
onLayout: measureContent,
|
|
8636
8710
|
testID: testID
|
|
@@ -13998,7 +14072,11 @@ var StyledLabelInsideTextInput = index$a(Typography.Body)(function (_ref3) {
|
|
|
13998
14072
|
alignContent: 'center',
|
|
13999
14073
|
alignItems: 'center',
|
|
14000
14074
|
color: theme.__hd__.textInput.colors.labelsInsideTextInput[themeState],
|
|
14001
|
-
marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop
|
|
14075
|
+
marginTop: theme.__hd__.textInput.space.labelInsideTextInputMarginTop,
|
|
14076
|
+
position: 'absolute',
|
|
14077
|
+
zIndex: 1,
|
|
14078
|
+
left: 0,
|
|
14079
|
+
top: '50%'
|
|
14002
14080
|
};
|
|
14003
14081
|
});
|
|
14004
14082
|
var StyledAsteriskLabelInsideTextInput = index$a(Typography.Body)(function (_ref4) {
|
|
@@ -14219,18 +14297,10 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
14219
14297
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14220
14298
|
inputSize = _React$useState2[0],
|
|
14221
14299
|
setInputSize = _React$useState2[1];
|
|
14222
|
-
var _React$useState3 = React__namespace.default.useState(
|
|
14300
|
+
var _React$useState3 = React__namespace.default.useState(false),
|
|
14223
14301
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
var _React$useState5 = React__namespace.default.useState(0),
|
|
14227
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
14228
|
-
prefixWidth = _React$useState6[0],
|
|
14229
|
-
setPrefixWidth = _React$useState6[1];
|
|
14230
|
-
var _React$useState7 = React__namespace.default.useState(false),
|
|
14231
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
14232
|
-
isFocused = _React$useState8[0],
|
|
14233
|
-
setIsFocused = _React$useState8[1];
|
|
14302
|
+
isFocused = _React$useState4[0],
|
|
14303
|
+
setIsFocused = _React$useState4[1];
|
|
14234
14304
|
var state = getState$3({
|
|
14235
14305
|
disabled: disabled,
|
|
14236
14306
|
error: error,
|
|
@@ -14260,14 +14330,6 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
14260
14330
|
});
|
|
14261
14331
|
});
|
|
14262
14332
|
}, []);
|
|
14263
|
-
var onPrefixLayout = React.useCallback(function (event) {
|
|
14264
|
-
var width = event.nativeEvent.layout.width;
|
|
14265
|
-
setPrefixWidth(width);
|
|
14266
|
-
}, []);
|
|
14267
|
-
var onLabelLayout = React.useCallback(function (event) {
|
|
14268
|
-
var width = event.nativeEvent.layout.width;
|
|
14269
|
-
setLabelWidth(width);
|
|
14270
|
-
}, []);
|
|
14271
14333
|
var innerTextInput = React__namespace.default.useRef();
|
|
14272
14334
|
React__namespace.default.useImperativeHandle(ref, function () {
|
|
14273
14335
|
return {
|
|
@@ -14374,9 +14436,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
14374
14436
|
style: [{
|
|
14375
14437
|
backgroundColor: backgroundColor
|
|
14376
14438
|
}, borderStyle]
|
|
14377
|
-
}), /*#__PURE__*/React__namespace.default.createElement(reactNative.View, {
|
|
14378
|
-
onLayout: onPrefixLayout
|
|
14379
|
-
}, renderPrefix$1({
|
|
14439
|
+
}), /*#__PURE__*/React__namespace.default.createElement(reactNative.View, null, renderPrefix$1({
|
|
14380
14440
|
state: state,
|
|
14381
14441
|
prefix: prefix
|
|
14382
14442
|
})), /*#__PURE__*/React__namespace.default.createElement(StyledLabelContainerInsideTextInput, {
|
|
@@ -14388,12 +14448,12 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
14388
14448
|
transform: [{
|
|
14389
14449
|
translateY: focusAnimation.interpolate({
|
|
14390
14450
|
inputRange: [0, 1],
|
|
14391
|
-
outputRange: [variant !== 'textarea' ? inputSize.height / 2 : theme.space.large,
|
|
14451
|
+
outputRange: [variant !== 'textarea' ? inputSize.height / 2 : theme.space.large, theme.space.xsmall]
|
|
14392
14452
|
})
|
|
14393
14453
|
}, {
|
|
14394
14454
|
translateX: focusAnimation.interpolate({
|
|
14395
14455
|
inputRange: [0, 1],
|
|
14396
|
-
outputRange: [
|
|
14456
|
+
outputRange: [prefix ? theme.space.xxlarge : theme.space.medium, -theme.space.xlarge + theme.space.xsmall]
|
|
14397
14457
|
})
|
|
14398
14458
|
}, {
|
|
14399
14459
|
scale: focusAnimation.interpolate({
|
|
@@ -14402,21 +14462,20 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref8, ref) {
|
|
|
14402
14462
|
})
|
|
14403
14463
|
}]
|
|
14404
14464
|
}]
|
|
14405
|
-
},
|
|
14465
|
+
}, !!label && /*#__PURE__*/React__namespace.default.createElement(StyledLabelInsideTextInput, {
|
|
14406
14466
|
style: {
|
|
14407
14467
|
backgroundColor: backgroundColor
|
|
14408
14468
|
},
|
|
14409
|
-
|
|
14410
|
-
testID: "input-label
|
|
14411
|
-
|
|
14469
|
+
nativeID: accessibilityLabelledBy,
|
|
14470
|
+
testID: "input-label",
|
|
14471
|
+
themeState: state
|
|
14472
|
+
}, required && /*#__PURE__*/React__namespace.default.createElement(StyledAsteriskLabelInsideTextInput, {
|
|
14412
14473
|
style: {
|
|
14413
14474
|
backgroundColor: backgroundColor
|
|
14414
14475
|
},
|
|
14415
|
-
nativeID: accessibilityLabelledBy,
|
|
14416
|
-
testID: "input-label",
|
|
14417
14476
|
themeState: state,
|
|
14418
|
-
|
|
14419
|
-
}, label)), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, renderInput$1({
|
|
14477
|
+
testID: "input-label-asterisk"
|
|
14478
|
+
}, "*"), label)), /*#__PURE__*/React__namespace.default.createElement(StyledTextInputAndLabelContainer, null, renderInput$1({
|
|
14420
14479
|
variant: variant,
|
|
14421
14480
|
nativeInputProps: nativeInputProps,
|
|
14422
14481
|
renderInputValue: renderInputValue,
|
|
@@ -15139,8 +15198,8 @@ var Empty = function Empty(_ref) {
|
|
|
15139
15198
|
level: "h4",
|
|
15140
15199
|
typeface: "playful"
|
|
15141
15200
|
}, title), !!description && /*#__PURE__*/React__namespace.default.createElement(StyledDescription, {
|
|
15142
|
-
|
|
15143
|
-
|
|
15201
|
+
variant: "small",
|
|
15202
|
+
themeVariant: variant
|
|
15144
15203
|
}, description));
|
|
15145
15204
|
};
|
|
15146
15205
|
|
|
@@ -20640,7 +20699,7 @@ var MentionList = function MentionList(_ref) {
|
|
|
20640
20699
|
}));
|
|
20641
20700
|
};
|
|
20642
20701
|
|
|
20643
|
-
var lib = {exports: {}};
|
|
20702
|
+
var lib$1 = {exports: {}};
|
|
20644
20703
|
|
|
20645
20704
|
var reactDom = {exports: {}};
|
|
20646
20705
|
|
|
@@ -28068,14 +28127,15 @@ function requireReactDom() {
|
|
|
28068
28127
|
return reactDom.exports;
|
|
28069
28128
|
}
|
|
28070
28129
|
|
|
28130
|
+
var lib = lib$1.exports;
|
|
28071
28131
|
var hasRequiredLib;
|
|
28072
28132
|
function requireLib() {
|
|
28073
|
-
if (hasRequiredLib) return lib.exports;
|
|
28133
|
+
if (hasRequiredLib) return lib$1.exports;
|
|
28074
28134
|
hasRequiredLib = 1;
|
|
28075
28135
|
(function (module, exports) {
|
|
28076
28136
|
!function (e, t) {
|
|
28077
28137
|
module.exports = t(React__namespace.default, requireReactDom());
|
|
28078
|
-
}(self, function (e, t) {
|
|
28138
|
+
}("undefined" != typeof self ? self : lib, function (e, t) {
|
|
28079
28139
|
return function () {
|
|
28080
28140
|
var r = {
|
|
28081
28141
|
394: function _(e) {
|
|
@@ -39114,8 +39174,8 @@ function requireLib() {
|
|
|
39114
39174
|
}(), o;
|
|
39115
39175
|
}();
|
|
39116
39176
|
});
|
|
39117
|
-
})(lib);
|
|
39118
|
-
return lib.exports;
|
|
39177
|
+
})(lib$1);
|
|
39178
|
+
return lib$1.exports;
|
|
39119
39179
|
}
|
|
39120
39180
|
|
|
39121
39181
|
var libExports = requireLib();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.88.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@emotion/react": "^11.9.3",
|
|
25
25
|
"@hero-design/colors": "8.45.2",
|
|
26
26
|
"date-fns": "^2.16.1",
|
|
27
|
-
"hero-editor": "^1.15.
|
|
27
|
+
"hero-editor": "^1.15.5",
|
|
28
28
|
"nanoid": "^5.0.9"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
2
|
import { View, Animated } from 'react-native';
|
|
3
3
|
|
|
4
|
-
export type Placement =
|
|
4
|
+
export type Placement =
|
|
5
|
+
| 'top'
|
|
6
|
+
| 'bottom'
|
|
7
|
+
| 'right'
|
|
8
|
+
| 'left'
|
|
9
|
+
| 'top-left'
|
|
10
|
+
| 'top-right'
|
|
11
|
+
| 'bottom-left'
|
|
12
|
+
| 'bottom-right';
|
|
5
13
|
|
|
6
14
|
export const StyledContent = styled(View)(({ theme }) => ({
|
|
7
15
|
padding: theme.__hd__.appCue.space.padding,
|
|
@@ -43,4 +51,22 @@ export const StyledIconContainer = styled(Animated.View)<{
|
|
|
43
51
|
transform: [{ rotate: '-90deg' }],
|
|
44
52
|
height: '100%',
|
|
45
53
|
}),
|
|
54
|
+
...(themePlacement === 'top-left' && {
|
|
55
|
+
bottom: -theme.__hd__.appCue.space.arrowOffset,
|
|
56
|
+
right: theme.__hd__.appCue.space.arrowOffset,
|
|
57
|
+
}),
|
|
58
|
+
...(themePlacement === 'top-right' && {
|
|
59
|
+
bottom: -theme.__hd__.appCue.space.arrowOffset,
|
|
60
|
+
left: theme.__hd__.appCue.space.arrowOffset,
|
|
61
|
+
}),
|
|
62
|
+
...(themePlacement === 'bottom-left' && {
|
|
63
|
+
top: -theme.__hd__.appCue.space.arrowOffset,
|
|
64
|
+
right: theme.__hd__.appCue.space.arrowOffset,
|
|
65
|
+
transform: [{ rotate: '180deg' }],
|
|
66
|
+
}),
|
|
67
|
+
...(themePlacement === 'bottom-right' && {
|
|
68
|
+
top: -theme.__hd__.appCue.space.arrowOffset,
|
|
69
|
+
left: theme.__hd__.appCue.space.arrowOffset,
|
|
70
|
+
transform: [{ rotate: '180deg' }],
|
|
71
|
+
}),
|
|
46
72
|
}));
|
|
@@ -9,6 +9,10 @@ describe('AppCue', () => {
|
|
|
9
9
|
${'bottom'}
|
|
10
10
|
${'left'}
|
|
11
11
|
${'right'}
|
|
12
|
+
${'top-left'}
|
|
13
|
+
${'top-right'}
|
|
14
|
+
${'bottom-left'}
|
|
15
|
+
${'bottom-right'}
|
|
12
16
|
`('renders icon $placement correctly', ({ placement }) => {
|
|
13
17
|
const { toJSON } = renderWithTheme(
|
|
14
18
|
<StyledIconContainer themePlacement={placement} />
|
|
@@ -51,6 +51,108 @@ exports[`AppCue renders icon bottom correctly 1`] = `
|
|
|
51
51
|
</View>
|
|
52
52
|
`;
|
|
53
53
|
|
|
54
|
+
exports[`AppCue renders icon bottom-left correctly 1`] = `
|
|
55
|
+
<View
|
|
56
|
+
style={
|
|
57
|
+
{
|
|
58
|
+
"flex": 1,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
<View
|
|
63
|
+
collapsable={false}
|
|
64
|
+
style={
|
|
65
|
+
{
|
|
66
|
+
"alignItems": "center",
|
|
67
|
+
"color": "#001f23",
|
|
68
|
+
"display": "flex",
|
|
69
|
+
"justifyContent": "center",
|
|
70
|
+
"position": "absolute",
|
|
71
|
+
"right": 12,
|
|
72
|
+
"top": -12,
|
|
73
|
+
"transform": [
|
|
74
|
+
{
|
|
75
|
+
"rotate": "180deg",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
themePlacement="bottom-left"
|
|
81
|
+
/>
|
|
82
|
+
<View
|
|
83
|
+
pointerEvents="box-none"
|
|
84
|
+
position="bottom"
|
|
85
|
+
style={
|
|
86
|
+
[
|
|
87
|
+
{
|
|
88
|
+
"bottom": 0,
|
|
89
|
+
"elevation": 9999,
|
|
90
|
+
"flexDirection": "column-reverse",
|
|
91
|
+
"left": 0,
|
|
92
|
+
"paddingHorizontal": 24,
|
|
93
|
+
"paddingVertical": 16,
|
|
94
|
+
"position": "absolute",
|
|
95
|
+
"right": 0,
|
|
96
|
+
"top": 0,
|
|
97
|
+
},
|
|
98
|
+
undefined,
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
exports[`AppCue renders icon bottom-right correctly 1`] = `
|
|
106
|
+
<View
|
|
107
|
+
style={
|
|
108
|
+
{
|
|
109
|
+
"flex": 1,
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
<View
|
|
114
|
+
collapsable={false}
|
|
115
|
+
style={
|
|
116
|
+
{
|
|
117
|
+
"alignItems": "center",
|
|
118
|
+
"color": "#001f23",
|
|
119
|
+
"display": "flex",
|
|
120
|
+
"justifyContent": "center",
|
|
121
|
+
"left": 12,
|
|
122
|
+
"position": "absolute",
|
|
123
|
+
"top": -12,
|
|
124
|
+
"transform": [
|
|
125
|
+
{
|
|
126
|
+
"rotate": "180deg",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
themePlacement="bottom-right"
|
|
132
|
+
/>
|
|
133
|
+
<View
|
|
134
|
+
pointerEvents="box-none"
|
|
135
|
+
position="bottom"
|
|
136
|
+
style={
|
|
137
|
+
[
|
|
138
|
+
{
|
|
139
|
+
"bottom": 0,
|
|
140
|
+
"elevation": 9999,
|
|
141
|
+
"flexDirection": "column-reverse",
|
|
142
|
+
"left": 0,
|
|
143
|
+
"paddingHorizontal": 24,
|
|
144
|
+
"paddingVertical": 16,
|
|
145
|
+
"position": "absolute",
|
|
146
|
+
"right": 0,
|
|
147
|
+
"top": 0,
|
|
148
|
+
},
|
|
149
|
+
undefined,
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
154
|
+
`;
|
|
155
|
+
|
|
54
156
|
exports[`AppCue renders icon left correctly 1`] = `
|
|
55
157
|
<View
|
|
56
158
|
style={
|
|
@@ -198,3 +300,95 @@ exports[`AppCue renders icon top correctly 1`] = `
|
|
|
198
300
|
/>
|
|
199
301
|
</View>
|
|
200
302
|
`;
|
|
303
|
+
|
|
304
|
+
exports[`AppCue renders icon top-left correctly 1`] = `
|
|
305
|
+
<View
|
|
306
|
+
style={
|
|
307
|
+
{
|
|
308
|
+
"flex": 1,
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
>
|
|
312
|
+
<View
|
|
313
|
+
collapsable={false}
|
|
314
|
+
style={
|
|
315
|
+
{
|
|
316
|
+
"alignItems": "center",
|
|
317
|
+
"bottom": -12,
|
|
318
|
+
"color": "#001f23",
|
|
319
|
+
"display": "flex",
|
|
320
|
+
"justifyContent": "center",
|
|
321
|
+
"position": "absolute",
|
|
322
|
+
"right": 12,
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
themePlacement="top-left"
|
|
326
|
+
/>
|
|
327
|
+
<View
|
|
328
|
+
pointerEvents="box-none"
|
|
329
|
+
position="bottom"
|
|
330
|
+
style={
|
|
331
|
+
[
|
|
332
|
+
{
|
|
333
|
+
"bottom": 0,
|
|
334
|
+
"elevation": 9999,
|
|
335
|
+
"flexDirection": "column-reverse",
|
|
336
|
+
"left": 0,
|
|
337
|
+
"paddingHorizontal": 24,
|
|
338
|
+
"paddingVertical": 16,
|
|
339
|
+
"position": "absolute",
|
|
340
|
+
"right": 0,
|
|
341
|
+
"top": 0,
|
|
342
|
+
},
|
|
343
|
+
undefined,
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
/>
|
|
347
|
+
</View>
|
|
348
|
+
`;
|
|
349
|
+
|
|
350
|
+
exports[`AppCue renders icon top-right correctly 1`] = `
|
|
351
|
+
<View
|
|
352
|
+
style={
|
|
353
|
+
{
|
|
354
|
+
"flex": 1,
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
>
|
|
358
|
+
<View
|
|
359
|
+
collapsable={false}
|
|
360
|
+
style={
|
|
361
|
+
{
|
|
362
|
+
"alignItems": "center",
|
|
363
|
+
"bottom": -12,
|
|
364
|
+
"color": "#001f23",
|
|
365
|
+
"display": "flex",
|
|
366
|
+
"justifyContent": "center",
|
|
367
|
+
"left": 12,
|
|
368
|
+
"position": "absolute",
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
themePlacement="top-right"
|
|
372
|
+
/>
|
|
373
|
+
<View
|
|
374
|
+
pointerEvents="box-none"
|
|
375
|
+
position="bottom"
|
|
376
|
+
style={
|
|
377
|
+
[
|
|
378
|
+
{
|
|
379
|
+
"bottom": 0,
|
|
380
|
+
"elevation": 9999,
|
|
381
|
+
"flexDirection": "column-reverse",
|
|
382
|
+
"left": 0,
|
|
383
|
+
"paddingHorizontal": 24,
|
|
384
|
+
"paddingVertical": 16,
|
|
385
|
+
"position": "absolute",
|
|
386
|
+
"right": 0,
|
|
387
|
+
"top": 0,
|
|
388
|
+
},
|
|
389
|
+
undefined,
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
/>
|
|
393
|
+
</View>
|
|
394
|
+
`;
|