@hero-design/rn 8.91.3 → 8.91.4
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 +11 -0
- package/es/index.js +15 -42
- package/lib/index.js +15 -42
- package/package.json +1 -1
- package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +18 -18
- package/src/components/BottomSheet/StyledBottomSheet.tsx +0 -10
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +0 -16
- package/src/components/Calendar/CalendarRange.tsx +5 -1
- package/src/components/Calendar/__tests__/helper.spec.ts +20 -8
- package/src/components/Calendar/helpers.ts +6 -2
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +0 -16
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +11 -11
- package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/FAB/StyledFAB.tsx +1 -5
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +6 -6
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +0 -40
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +0 -32
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +0 -8
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +13 -18
- package/src/theme/components/bottomSheet.ts +2 -9
- package/src/theme/components/fab.ts +5 -9
- package/src/theme/global/colors/__tests__/__snapshots__/eBens.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/global.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/jobs.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/swag.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/swagLight.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/swagLightGlobal.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/swagLightJobs.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/wallet.spec.ts.snap +2 -0
- package/src/theme/global/colors/__tests__/__snapshots__/work.spec.ts.snap +2 -0
- package/src/theme/global/colors/global.ts +3 -0
- package/stats/8.91.4/rn-stats.html +4842 -0
- package/types/components/Calendar/helpers.d.ts +5 -2
- package/types/theme/components/bottomSheet.d.ts +1 -10
- package/types/theme/components/fab.d.ts +2 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(node:
|
|
1
|
+
(node:3014) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
2
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~[0m
|
|
11
11
|
[39m
|
|
12
12
|
[1m[33m(!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
13
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
13
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m55s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.91.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3699](https://github.com/Thinkei/hero-design/pull/3699) [`8e1eb77ac97e7b367b74361717772c7e15a61627`](https://github.com/Thinkei/hero-design/commit/8e1eb77ac97e7b367b74361717772c7e15a61627) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [FAB][bottomsheet] Update color
|
|
8
|
+
|
|
9
|
+
- FAB: Update button and backdrop color and shadow
|
|
10
|
+
- BottomSheet: Remove shadow and update backdrop color
|
|
11
|
+
|
|
12
|
+
- [#3704](https://github.com/Thinkei/hero-design/pull/3704) [`643421d7d76789a9bb7f65a850d1c754bed52449`](https://github.com/Thinkei/hero-design/commit/643421d7d76789a9bb7f65a850d1c754bed52449) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [Calendar.Range] Allow selecting same date
|
|
13
|
+
|
|
3
14
|
## 8.91.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/es/index.js
CHANGED
|
@@ -1910,8 +1910,10 @@ var globalPalette$1 = {
|
|
|
1910
1910
|
archived: palette$9.silverChalice,
|
|
1911
1911
|
mutedArchived: palette$9.silverChaliceLight20,
|
|
1912
1912
|
archivedSurface: palette$9.cumberlandFog,
|
|
1913
|
-
onArchivedSurface: palette$9.windsorGrey
|
|
1913
|
+
onArchivedSurface: palette$9.windsorGrey,
|
|
1914
1914
|
// End of Updated 21 / Nov / 22
|
|
1915
|
+
black: '#000000',
|
|
1916
|
+
white: '#ffffff'
|
|
1915
1917
|
};
|
|
1916
1918
|
|
|
1917
1919
|
var swagBrandSystemPallete$1 = {
|
|
@@ -2664,7 +2666,7 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2664
2666
|
var colors = {
|
|
2665
2667
|
shadow: theme.colors.primaryOutline,
|
|
2666
2668
|
background: theme.colors.defaultGlobalSurface,
|
|
2667
|
-
backdrop: theme.colors.
|
|
2669
|
+
backdrop: theme.colors.black,
|
|
2668
2670
|
floatingHeaderIconBackground: theme.colors.archivedSurface
|
|
2669
2671
|
};
|
|
2670
2672
|
var sizes = {
|
|
@@ -2681,15 +2683,6 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2681
2683
|
floatingInnerPadding: theme.space.small,
|
|
2682
2684
|
floatingHeaderIconPadding: theme.space.small
|
|
2683
2685
|
};
|
|
2684
|
-
var shadows = {
|
|
2685
|
-
offset: {
|
|
2686
|
-
width: 0,
|
|
2687
|
-
height: 3
|
|
2688
|
-
},
|
|
2689
|
-
opacity: 0.4,
|
|
2690
|
-
radius: theme.radii.xlarge,
|
|
2691
|
-
elevation: 10
|
|
2692
|
-
};
|
|
2693
2686
|
var radii = {
|
|
2694
2687
|
"default": theme.radii.xlarge,
|
|
2695
2688
|
floating: theme.radii['5xlarge'],
|
|
@@ -2697,7 +2690,6 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2697
2690
|
};
|
|
2698
2691
|
return {
|
|
2699
2692
|
colors: colors,
|
|
2700
|
-
shadows: shadows,
|
|
2701
2693
|
radii: radii,
|
|
2702
2694
|
sizes: sizes,
|
|
2703
2695
|
space: space
|
|
@@ -3141,12 +3133,12 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
3141
3133
|
buttonBackground: theme.colors.overlayGlobalSurface,
|
|
3142
3134
|
buttonPressedBackground: theme.colors.overlayGlobalSurface,
|
|
3143
3135
|
buttonActiveBackground: theme.colors.overlayGlobalSurface,
|
|
3144
|
-
icon: theme.colors.
|
|
3136
|
+
icon: theme.colors.onDarkGlobalSurface,
|
|
3145
3137
|
actionItemBackground: theme.colors.overlayGlobalSurface,
|
|
3146
3138
|
actionItemPressedBackground: theme.colors.overlayGlobalSurface,
|
|
3147
|
-
backdropBackground: theme.colors.
|
|
3148
|
-
titleText: theme.colors.
|
|
3149
|
-
actionItemText: theme.colors.
|
|
3139
|
+
backdropBackground: theme.colors.black,
|
|
3140
|
+
titleText: theme.colors.onDarkGlobalSurface,
|
|
3141
|
+
actionItemText: theme.colors.onDarkGlobalSurface
|
|
3150
3142
|
};
|
|
3151
3143
|
var sizes = {
|
|
3152
3144
|
width: theme.sizes.xxxxxlarge,
|
|
@@ -3170,11 +3162,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
3170
3162
|
icon: theme.lineHeights.large
|
|
3171
3163
|
};
|
|
3172
3164
|
var shadows = {
|
|
3173
|
-
|
|
3174
|
-
opacity: theme.shadows["default"].shadowOpacity,
|
|
3175
|
-
radius: theme.shadows["default"].shadowRadius,
|
|
3176
|
-
elevation: theme.shadows["default"].elevation,
|
|
3177
|
-
color: theme.shadows["default"].shadowColor
|
|
3165
|
+
"default": theme.shadows.cardDrawer
|
|
3178
3166
|
};
|
|
3179
3167
|
var space = {
|
|
3180
3168
|
actionItemPadding: theme.space.smallMedium,
|
|
@@ -9799,11 +9787,6 @@ var StyledFloatingBottomSheet = index$a(Animated.View)(function (_ref2) {
|
|
|
9799
9787
|
var theme = _ref2.theme;
|
|
9800
9788
|
return {
|
|
9801
9789
|
width: '100%',
|
|
9802
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
9803
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
9804
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
9805
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
9806
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
9807
9790
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
9808
9791
|
borderRadius: theme.__hd__.bottomSheet.radii.floating,
|
|
9809
9792
|
maxHeight: '100%',
|
|
@@ -9817,11 +9800,6 @@ var StyledBottomSheet = index$a(AnimatedSafeAreaView)(function (_ref3) {
|
|
|
9817
9800
|
borderTopRightRadius: theme.__hd__.bottomSheet.radii["default"],
|
|
9818
9801
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
9819
9802
|
width: '100%',
|
|
9820
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
9821
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
9822
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
9823
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
9824
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
9825
9803
|
maxHeight: '94%'
|
|
9826
9804
|
};
|
|
9827
9805
|
});
|
|
@@ -13179,8 +13157,8 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
|
|
|
13179
13157
|
var date = _ref2.date,
|
|
13180
13158
|
startDate = _ref2.startDate,
|
|
13181
13159
|
endDate = _ref2.endDate;
|
|
13182
|
-
// Prevent selecting same date
|
|
13183
|
-
if (isEqDate(date, startDate) || isEqDate(date, endDate)) {
|
|
13160
|
+
// Prevent selecting same date when both dates are set
|
|
13161
|
+
if (startDate && endDate && (isEqDate(date, startDate) || isEqDate(date, endDate))) {
|
|
13184
13162
|
return {
|
|
13185
13163
|
startDate: startDate,
|
|
13186
13164
|
endDate: endDate
|
|
@@ -13349,7 +13327,7 @@ var CalendarRange = function CalendarRange(_ref) {
|
|
|
13349
13327
|
if (isEqDate(value === null || value === void 0 ? void 0 : value.startDate, date) || isEqDate(value === null || value === void 0 ? void 0 : value.endDate, date)) {
|
|
13350
13328
|
return /*#__PURE__*/React__default.createElement(SelectedDate, {
|
|
13351
13329
|
isStart: isEqDate(date, value === null || value === void 0 ? void 0 : value.startDate),
|
|
13352
|
-
showConnector: !!(value !== null && value !== void 0 && value.startDate) && !!(value !== null && value !== void 0 && value.endDate),
|
|
13330
|
+
showConnector: !!(value !== null && value !== void 0 && value.startDate) && !!(value !== null && value !== void 0 && value.endDate) && !isEqDate(value.startDate, value.endDate),
|
|
13353
13331
|
key: date.toDateString(),
|
|
13354
13332
|
date: date,
|
|
13355
13333
|
onPress: function onPress() {
|
|
@@ -16269,7 +16247,7 @@ var AnimatedTouchableHighlight = Animated.createAnimatedComponent(TouchableOpaci
|
|
|
16269
16247
|
var StyledFAB$2 = index$a(AnimatedTouchableHighlight)(function (_ref) {
|
|
16270
16248
|
var theme = _ref.theme,
|
|
16271
16249
|
themeActive = _ref.themeActive;
|
|
16272
|
-
return {
|
|
16250
|
+
return _objectSpread2({
|
|
16273
16251
|
backgroundColor: themeActive ? theme.__hd__.fab.colors.buttonActiveBackground : theme.__hd__.fab.colors.buttonBackground,
|
|
16274
16252
|
borderRadius: theme.radii.rounded,
|
|
16275
16253
|
alignItems: 'center',
|
|
@@ -16277,13 +16255,8 @@ var StyledFAB$2 = index$a(AnimatedTouchableHighlight)(function (_ref) {
|
|
|
16277
16255
|
alignSelf: 'flex-start',
|
|
16278
16256
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
16279
16257
|
flexDirection: 'row',
|
|
16280
|
-
elevation: theme.__hd__.fab.shadows.elevation,
|
|
16281
|
-
shadowColor: theme.__hd__.fab.shadows.color,
|
|
16282
|
-
shadowOffset: theme.__hd__.fab.shadows.offset,
|
|
16283
|
-
shadowRadius: theme.__hd__.fab.shadows.radius,
|
|
16284
|
-
shadowOpacity: theme.__hd__.fab.shadows.opacity,
|
|
16285
16258
|
height: theme.__hd__.fab.sizes.height
|
|
16286
|
-
};
|
|
16259
|
+
}, theme.__hd__.fab.shadows["default"]);
|
|
16287
16260
|
});
|
|
16288
16261
|
var StyledFABIcon = index$a(Icon)(function (_ref2) {
|
|
16289
16262
|
var theme = _ref2.theme;
|
|
@@ -16579,7 +16552,7 @@ var StyledBackdrop = index$a(AnimatedPressable)(function (_ref2) {
|
|
|
16579
16552
|
right: 0,
|
|
16580
16553
|
top: 0,
|
|
16581
16554
|
bottom: 0,
|
|
16582
|
-
opacity: 0.
|
|
16555
|
+
opacity: 0.4,
|
|
16583
16556
|
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
16584
16557
|
};
|
|
16585
16558
|
});
|
package/lib/index.js
CHANGED
|
@@ -1938,8 +1938,10 @@ var globalPalette$1 = {
|
|
|
1938
1938
|
archived: palette$9.silverChalice,
|
|
1939
1939
|
mutedArchived: palette$9.silverChaliceLight20,
|
|
1940
1940
|
archivedSurface: palette$9.cumberlandFog,
|
|
1941
|
-
onArchivedSurface: palette$9.windsorGrey
|
|
1941
|
+
onArchivedSurface: palette$9.windsorGrey,
|
|
1942
1942
|
// End of Updated 21 / Nov / 22
|
|
1943
|
+
black: '#000000',
|
|
1944
|
+
white: '#ffffff'
|
|
1943
1945
|
};
|
|
1944
1946
|
|
|
1945
1947
|
var swagBrandSystemPallete$1 = {
|
|
@@ -2692,7 +2694,7 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2692
2694
|
var colors = {
|
|
2693
2695
|
shadow: theme.colors.primaryOutline,
|
|
2694
2696
|
background: theme.colors.defaultGlobalSurface,
|
|
2695
|
-
backdrop: theme.colors.
|
|
2697
|
+
backdrop: theme.colors.black,
|
|
2696
2698
|
floatingHeaderIconBackground: theme.colors.archivedSurface
|
|
2697
2699
|
};
|
|
2698
2700
|
var sizes = {
|
|
@@ -2709,15 +2711,6 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2709
2711
|
floatingInnerPadding: theme.space.small,
|
|
2710
2712
|
floatingHeaderIconPadding: theme.space.small
|
|
2711
2713
|
};
|
|
2712
|
-
var shadows = {
|
|
2713
|
-
offset: {
|
|
2714
|
-
width: 0,
|
|
2715
|
-
height: 3
|
|
2716
|
-
},
|
|
2717
|
-
opacity: 0.4,
|
|
2718
|
-
radius: theme.radii.xlarge,
|
|
2719
|
-
elevation: 10
|
|
2720
|
-
};
|
|
2721
2714
|
var radii = {
|
|
2722
2715
|
"default": theme.radii.xlarge,
|
|
2723
2716
|
floating: theme.radii['5xlarge'],
|
|
@@ -2725,7 +2718,6 @@ var getBottomSheetTheme = function getBottomSheetTheme(theme) {
|
|
|
2725
2718
|
};
|
|
2726
2719
|
return {
|
|
2727
2720
|
colors: colors,
|
|
2728
|
-
shadows: shadows,
|
|
2729
2721
|
radii: radii,
|
|
2730
2722
|
sizes: sizes,
|
|
2731
2723
|
space: space
|
|
@@ -3169,12 +3161,12 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
3169
3161
|
buttonBackground: theme.colors.overlayGlobalSurface,
|
|
3170
3162
|
buttonPressedBackground: theme.colors.overlayGlobalSurface,
|
|
3171
3163
|
buttonActiveBackground: theme.colors.overlayGlobalSurface,
|
|
3172
|
-
icon: theme.colors.
|
|
3164
|
+
icon: theme.colors.onDarkGlobalSurface,
|
|
3173
3165
|
actionItemBackground: theme.colors.overlayGlobalSurface,
|
|
3174
3166
|
actionItemPressedBackground: theme.colors.overlayGlobalSurface,
|
|
3175
|
-
backdropBackground: theme.colors.
|
|
3176
|
-
titleText: theme.colors.
|
|
3177
|
-
actionItemText: theme.colors.
|
|
3167
|
+
backdropBackground: theme.colors.black,
|
|
3168
|
+
titleText: theme.colors.onDarkGlobalSurface,
|
|
3169
|
+
actionItemText: theme.colors.onDarkGlobalSurface
|
|
3178
3170
|
};
|
|
3179
3171
|
var sizes = {
|
|
3180
3172
|
width: theme.sizes.xxxxxlarge,
|
|
@@ -3198,11 +3190,7 @@ var getFABTheme = function getFABTheme(theme) {
|
|
|
3198
3190
|
icon: theme.lineHeights.large
|
|
3199
3191
|
};
|
|
3200
3192
|
var shadows = {
|
|
3201
|
-
|
|
3202
|
-
opacity: theme.shadows["default"].shadowOpacity,
|
|
3203
|
-
radius: theme.shadows["default"].shadowRadius,
|
|
3204
|
-
elevation: theme.shadows["default"].elevation,
|
|
3205
|
-
color: theme.shadows["default"].shadowColor
|
|
3193
|
+
"default": theme.shadows.cardDrawer
|
|
3206
3194
|
};
|
|
3207
3195
|
var space = {
|
|
3208
3196
|
actionItemPadding: theme.space.smallMedium,
|
|
@@ -9827,11 +9815,6 @@ var StyledFloatingBottomSheet = index$a(reactNative.Animated.View)(function (_re
|
|
|
9827
9815
|
var theme = _ref2.theme;
|
|
9828
9816
|
return {
|
|
9829
9817
|
width: '100%',
|
|
9830
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
9831
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
9832
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
9833
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
9834
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
9835
9818
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
9836
9819
|
borderRadius: theme.__hd__.bottomSheet.radii.floating,
|
|
9837
9820
|
maxHeight: '100%',
|
|
@@ -9845,11 +9828,6 @@ var StyledBottomSheet = index$a(AnimatedSafeAreaView)(function (_ref3) {
|
|
|
9845
9828
|
borderTopRightRadius: theme.__hd__.bottomSheet.radii["default"],
|
|
9846
9829
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
9847
9830
|
width: '100%',
|
|
9848
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
9849
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
9850
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
9851
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
9852
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
9853
9831
|
maxHeight: '94%'
|
|
9854
9832
|
};
|
|
9855
9833
|
});
|
|
@@ -13207,8 +13185,8 @@ var setStartOrEndDate = function setStartOrEndDate(_ref2) {
|
|
|
13207
13185
|
var date = _ref2.date,
|
|
13208
13186
|
startDate = _ref2.startDate,
|
|
13209
13187
|
endDate = _ref2.endDate;
|
|
13210
|
-
// Prevent selecting same date
|
|
13211
|
-
if (isEqDate(date, startDate) || isEqDate(date, endDate)) {
|
|
13188
|
+
// Prevent selecting same date when both dates are set
|
|
13189
|
+
if (startDate && endDate && (isEqDate(date, startDate) || isEqDate(date, endDate))) {
|
|
13212
13190
|
return {
|
|
13213
13191
|
startDate: startDate,
|
|
13214
13192
|
endDate: endDate
|
|
@@ -13377,7 +13355,7 @@ var CalendarRange = function CalendarRange(_ref) {
|
|
|
13377
13355
|
if (isEqDate(value === null || value === void 0 ? void 0 : value.startDate, date) || isEqDate(value === null || value === void 0 ? void 0 : value.endDate, date)) {
|
|
13378
13356
|
return /*#__PURE__*/React__namespace.default.createElement(SelectedDate, {
|
|
13379
13357
|
isStart: isEqDate(date, value === null || value === void 0 ? void 0 : value.startDate),
|
|
13380
|
-
showConnector: !!(value !== null && value !== void 0 && value.startDate) && !!(value !== null && value !== void 0 && value.endDate),
|
|
13358
|
+
showConnector: !!(value !== null && value !== void 0 && value.startDate) && !!(value !== null && value !== void 0 && value.endDate) && !isEqDate(value.startDate, value.endDate),
|
|
13381
13359
|
key: date.toDateString(),
|
|
13382
13360
|
date: date,
|
|
13383
13361
|
onPress: function onPress() {
|
|
@@ -16297,7 +16275,7 @@ var AnimatedTouchableHighlight = reactNative.Animated.createAnimatedComponent(re
|
|
|
16297
16275
|
var StyledFAB$2 = index$a(AnimatedTouchableHighlight)(function (_ref) {
|
|
16298
16276
|
var theme = _ref.theme,
|
|
16299
16277
|
themeActive = _ref.themeActive;
|
|
16300
|
-
return {
|
|
16278
|
+
return _objectSpread2({
|
|
16301
16279
|
backgroundColor: themeActive ? theme.__hd__.fab.colors.buttonActiveBackground : theme.__hd__.fab.colors.buttonBackground,
|
|
16302
16280
|
borderRadius: theme.radii.rounded,
|
|
16303
16281
|
alignItems: 'center',
|
|
@@ -16305,13 +16283,8 @@ var StyledFAB$2 = index$a(AnimatedTouchableHighlight)(function (_ref) {
|
|
|
16305
16283
|
alignSelf: 'flex-start',
|
|
16306
16284
|
padding: theme.__hd__.fab.space.containerPadding,
|
|
16307
16285
|
flexDirection: 'row',
|
|
16308
|
-
elevation: theme.__hd__.fab.shadows.elevation,
|
|
16309
|
-
shadowColor: theme.__hd__.fab.shadows.color,
|
|
16310
|
-
shadowOffset: theme.__hd__.fab.shadows.offset,
|
|
16311
|
-
shadowRadius: theme.__hd__.fab.shadows.radius,
|
|
16312
|
-
shadowOpacity: theme.__hd__.fab.shadows.opacity,
|
|
16313
16286
|
height: theme.__hd__.fab.sizes.height
|
|
16314
|
-
};
|
|
16287
|
+
}, theme.__hd__.fab.shadows["default"]);
|
|
16315
16288
|
});
|
|
16316
16289
|
var StyledFABIcon = index$a(Icon)(function (_ref2) {
|
|
16317
16290
|
var theme = _ref2.theme;
|
|
@@ -16607,7 +16580,7 @@ var StyledBackdrop = index$a(AnimatedPressable)(function (_ref2) {
|
|
|
16607
16580
|
right: 0,
|
|
16608
16581
|
top: 0,
|
|
16609
16582
|
bottom: 0,
|
|
16610
|
-
opacity: 0.
|
|
16583
|
+
opacity: 0.4,
|
|
16611
16584
|
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
16612
16585
|
};
|
|
16613
16586
|
});
|
package/package.json
CHANGED
package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap
CHANGED
|
@@ -807,7 +807,7 @@ exports[`Scrollables With FAB [Function ExampleFlatListWithFAB] renders ActionGr
|
|
|
807
807
|
"backgroundColor": "#000000",
|
|
808
808
|
"borderRadius": 999,
|
|
809
809
|
"bottom": undefined,
|
|
810
|
-
"elevation":
|
|
810
|
+
"elevation": 6,
|
|
811
811
|
"flexDirection": "row",
|
|
812
812
|
"height": 64,
|
|
813
813
|
"justifyContent": "center",
|
|
@@ -815,13 +815,13 @@ exports[`Scrollables With FAB [Function ExampleFlatListWithFAB] renders ActionGr
|
|
|
815
815
|
"marginTop": 24,
|
|
816
816
|
"opacity": 1,
|
|
817
817
|
"padding": 20,
|
|
818
|
-
"shadowColor": "#
|
|
818
|
+
"shadowColor": "#001f23",
|
|
819
819
|
"shadowOffset": {
|
|
820
820
|
"height": 2,
|
|
821
821
|
"width": 0,
|
|
822
822
|
},
|
|
823
823
|
"shadowOpacity": 0.12,
|
|
824
|
-
"shadowRadius":
|
|
824
|
+
"shadowRadius": 2,
|
|
825
825
|
"transform": [
|
|
826
826
|
{
|
|
827
827
|
"translateY": 0,
|
|
@@ -1721,19 +1721,19 @@ exports[`Scrollables With FAB [Function ExampleFlatListWithFAB] renders FAB corr
|
|
|
1721
1721
|
"backgroundColor": "#000000",
|
|
1722
1722
|
"borderRadius": 999,
|
|
1723
1723
|
"bottom": undefined,
|
|
1724
|
-
"elevation":
|
|
1724
|
+
"elevation": 6,
|
|
1725
1725
|
"flexDirection": "row",
|
|
1726
1726
|
"height": 64,
|
|
1727
1727
|
"justifyContent": "center",
|
|
1728
1728
|
"opacity": 1,
|
|
1729
1729
|
"padding": 20,
|
|
1730
|
-
"shadowColor": "#
|
|
1730
|
+
"shadowColor": "#001f23",
|
|
1731
1731
|
"shadowOffset": {
|
|
1732
1732
|
"height": 2,
|
|
1733
1733
|
"width": 0,
|
|
1734
1734
|
},
|
|
1735
1735
|
"shadowOpacity": 0.12,
|
|
1736
|
-
"shadowRadius":
|
|
1736
|
+
"shadowRadius": 2,
|
|
1737
1737
|
"transform": [
|
|
1738
1738
|
{
|
|
1739
1739
|
"translateY": 0,
|
|
@@ -1991,7 +1991,7 @@ exports[`Scrollables With FAB [Function ExampleScrollViewWithFAB] renders Action
|
|
|
1991
1991
|
"backgroundColor": "#000000",
|
|
1992
1992
|
"borderRadius": 999,
|
|
1993
1993
|
"bottom": undefined,
|
|
1994
|
-
"elevation":
|
|
1994
|
+
"elevation": 6,
|
|
1995
1995
|
"flexDirection": "row",
|
|
1996
1996
|
"height": 64,
|
|
1997
1997
|
"justifyContent": "center",
|
|
@@ -1999,13 +1999,13 @@ exports[`Scrollables With FAB [Function ExampleScrollViewWithFAB] renders Action
|
|
|
1999
1999
|
"marginTop": 24,
|
|
2000
2000
|
"opacity": 1,
|
|
2001
2001
|
"padding": 20,
|
|
2002
|
-
"shadowColor": "#
|
|
2002
|
+
"shadowColor": "#001f23",
|
|
2003
2003
|
"shadowOffset": {
|
|
2004
2004
|
"height": 2,
|
|
2005
2005
|
"width": 0,
|
|
2006
2006
|
},
|
|
2007
2007
|
"shadowOpacity": 0.12,
|
|
2008
|
-
"shadowRadius":
|
|
2008
|
+
"shadowRadius": 2,
|
|
2009
2009
|
"transform": [
|
|
2010
2010
|
{
|
|
2011
2011
|
"translateY": 0,
|
|
@@ -2245,19 +2245,19 @@ exports[`Scrollables With FAB [Function ExampleScrollViewWithFAB] renders FAB co
|
|
|
2245
2245
|
"backgroundColor": "#000000",
|
|
2246
2246
|
"borderRadius": 999,
|
|
2247
2247
|
"bottom": undefined,
|
|
2248
|
-
"elevation":
|
|
2248
|
+
"elevation": 6,
|
|
2249
2249
|
"flexDirection": "row",
|
|
2250
2250
|
"height": 64,
|
|
2251
2251
|
"justifyContent": "center",
|
|
2252
2252
|
"opacity": 1,
|
|
2253
2253
|
"padding": 20,
|
|
2254
|
-
"shadowColor": "#
|
|
2254
|
+
"shadowColor": "#001f23",
|
|
2255
2255
|
"shadowOffset": {
|
|
2256
2256
|
"height": 2,
|
|
2257
2257
|
"width": 0,
|
|
2258
2258
|
},
|
|
2259
2259
|
"shadowOpacity": 0.12,
|
|
2260
|
-
"shadowRadius":
|
|
2260
|
+
"shadowRadius": 2,
|
|
2261
2261
|
"transform": [
|
|
2262
2262
|
{
|
|
2263
2263
|
"translateY": 0,
|
|
@@ -2822,7 +2822,7 @@ exports[`Scrollables With FAB [Function ExampleSectionListWithFAB] renders Actio
|
|
|
2822
2822
|
"backgroundColor": "#000000",
|
|
2823
2823
|
"borderRadius": 999,
|
|
2824
2824
|
"bottom": undefined,
|
|
2825
|
-
"elevation":
|
|
2825
|
+
"elevation": 6,
|
|
2826
2826
|
"flexDirection": "row",
|
|
2827
2827
|
"height": 64,
|
|
2828
2828
|
"justifyContent": "center",
|
|
@@ -2830,13 +2830,13 @@ exports[`Scrollables With FAB [Function ExampleSectionListWithFAB] renders Actio
|
|
|
2830
2830
|
"marginTop": 24,
|
|
2831
2831
|
"opacity": 1,
|
|
2832
2832
|
"padding": 20,
|
|
2833
|
-
"shadowColor": "#
|
|
2833
|
+
"shadowColor": "#001f23",
|
|
2834
2834
|
"shadowOffset": {
|
|
2835
2835
|
"height": 2,
|
|
2836
2836
|
"width": 0,
|
|
2837
2837
|
},
|
|
2838
2838
|
"shadowOpacity": 0.12,
|
|
2839
|
-
"shadowRadius":
|
|
2839
|
+
"shadowRadius": 2,
|
|
2840
2840
|
"transform": [
|
|
2841
2841
|
{
|
|
2842
2842
|
"translateY": 0,
|
|
@@ -3383,19 +3383,19 @@ exports[`Scrollables With FAB [Function ExampleSectionListWithFAB] renders FAB c
|
|
|
3383
3383
|
"backgroundColor": "#000000",
|
|
3384
3384
|
"borderRadius": 999,
|
|
3385
3385
|
"bottom": undefined,
|
|
3386
|
-
"elevation":
|
|
3386
|
+
"elevation": 6,
|
|
3387
3387
|
"flexDirection": "row",
|
|
3388
3388
|
"height": 64,
|
|
3389
3389
|
"justifyContent": "center",
|
|
3390
3390
|
"opacity": 1,
|
|
3391
3391
|
"padding": 20,
|
|
3392
|
-
"shadowColor": "#
|
|
3392
|
+
"shadowColor": "#001f23",
|
|
3393
3393
|
"shadowOffset": {
|
|
3394
3394
|
"height": 2,
|
|
3395
3395
|
"width": 0,
|
|
3396
3396
|
},
|
|
3397
3397
|
"shadowOpacity": 0.12,
|
|
3398
|
-
"shadowRadius":
|
|
3398
|
+
"shadowRadius": 2,
|
|
3399
3399
|
"transform": [
|
|
3400
3400
|
{
|
|
3401
3401
|
"translateY": 0,
|
|
@@ -33,11 +33,6 @@ const StyledFloatingWrapper = styled(AnimatedSafeAreaView)(({ theme }) => ({
|
|
|
33
33
|
|
|
34
34
|
const StyledFloatingBottomSheet = styled(Animated.View)(({ theme }) => ({
|
|
35
35
|
width: '100%',
|
|
36
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
37
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
38
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
39
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
40
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
41
36
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
42
37
|
borderRadius: theme.__hd__.bottomSheet.radii.floating,
|
|
43
38
|
maxHeight: '100%',
|
|
@@ -51,11 +46,6 @@ const StyledBottomSheet = styled(AnimatedSafeAreaView)<
|
|
|
51
46
|
borderTopRightRadius: theme.__hd__.bottomSheet.radii.default,
|
|
52
47
|
backgroundColor: theme.__hd__.bottomSheet.colors.background,
|
|
53
48
|
width: '100%',
|
|
54
|
-
shadowColor: theme.__hd__.bottomSheet.colors.shadow,
|
|
55
|
-
shadowOffset: theme.__hd__.bottomSheet.shadows.offset,
|
|
56
|
-
shadowOpacity: theme.__hd__.bottomSheet.shadows.opacity,
|
|
57
|
-
shadowRadius: theme.__hd__.bottomSheet.shadows.radius,
|
|
58
|
-
elevation: theme.__hd__.bottomSheet.shadows.elevation,
|
|
59
49
|
maxHeight: '94%',
|
|
60
50
|
}));
|
|
61
51
|
|
|
@@ -163,15 +163,7 @@ exports[`BottomSheet renders correctly with open state 1`] = `
|
|
|
163
163
|
"backgroundColor": "#ffffff",
|
|
164
164
|
"borderTopLeftRadius": 16,
|
|
165
165
|
"borderTopRightRadius": 16,
|
|
166
|
-
"elevation": 10,
|
|
167
166
|
"maxHeight": "94%",
|
|
168
|
-
"shadowColor": "#001f23",
|
|
169
|
-
"shadowOffset": {
|
|
170
|
-
"height": 3,
|
|
171
|
-
"width": 0,
|
|
172
|
-
},
|
|
173
|
-
"shadowOpacity": 0.4,
|
|
174
|
-
"shadowRadius": 16,
|
|
175
167
|
"transform": [
|
|
176
168
|
{
|
|
177
169
|
"scaleY": 1,
|
|
@@ -507,16 +499,8 @@ exports[`BottomSheet renders floating BottomSheet correctly 1`] = `
|
|
|
507
499
|
{
|
|
508
500
|
"backgroundColor": "#ffffff",
|
|
509
501
|
"borderRadius": 32,
|
|
510
|
-
"elevation": 10,
|
|
511
502
|
"maxHeight": "100%",
|
|
512
503
|
"padding": 8,
|
|
513
|
-
"shadowColor": "#001f23",
|
|
514
|
-
"shadowOffset": {
|
|
515
|
-
"height": 3,
|
|
516
|
-
"width": 0,
|
|
517
|
-
},
|
|
518
|
-
"shadowOpacity": 0.4,
|
|
519
|
-
"shadowRadius": 16,
|
|
520
504
|
"transform": [
|
|
521
505
|
{
|
|
522
506
|
"scaleY": 1,
|
|
@@ -191,7 +191,11 @@ const CalendarRange = ({
|
|
|
191
191
|
return (
|
|
192
192
|
<SelectedDate
|
|
193
193
|
isStart={isEqDate(date, value?.startDate)}
|
|
194
|
-
showConnector={
|
|
194
|
+
showConnector={
|
|
195
|
+
!!value?.startDate &&
|
|
196
|
+
!!value?.endDate &&
|
|
197
|
+
!isEqDate(value.startDate, value.endDate)
|
|
198
|
+
}
|
|
195
199
|
key={date.toDateString()}
|
|
196
200
|
date={date}
|
|
197
201
|
onPress={() => onDateChange(date)}
|
|
@@ -73,8 +73,8 @@ describe('isDateInRange', () => {
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
describe('setStartOrEndDate', () => {
|
|
76
|
-
// Test case 1:
|
|
77
|
-
it('should not change dates when selecting same date as start date', () => {
|
|
76
|
+
// Test case 1: Prevent selecting same date when both dates are set
|
|
77
|
+
it('should not change dates when selecting same date as start date and both dates are set', () => {
|
|
78
78
|
const date = new Date('2024-03-15');
|
|
79
79
|
const startDate = new Date('2024-03-15');
|
|
80
80
|
const endDate = new Date('2024-03-20');
|
|
@@ -83,7 +83,19 @@ describe('setStartOrEndDate', () => {
|
|
|
83
83
|
expect(result).toEqual({ startDate, endDate });
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
// Test case 2:
|
|
86
|
+
// Test case 2: Allow selecting same date as start date when only start date is set
|
|
87
|
+
it('should allow selecting same date as start date when only start date is set', () => {
|
|
88
|
+
const date = new Date('2024-03-15');
|
|
89
|
+
const startDate = new Date('2024-03-15');
|
|
90
|
+
|
|
91
|
+
const result = setStartOrEndDate({ date, startDate });
|
|
92
|
+
expect(result).toEqual({
|
|
93
|
+
startDate: new Date('2024-03-15'),
|
|
94
|
+
endDate: new Date('2024-03-15'),
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Test case 3: Initial selection (no start date)
|
|
87
99
|
it('should set start date when no dates are selected', () => {
|
|
88
100
|
const date = new Date('2024-03-15');
|
|
89
101
|
|
|
@@ -94,7 +106,7 @@ describe('setStartOrEndDate', () => {
|
|
|
94
106
|
});
|
|
95
107
|
});
|
|
96
108
|
|
|
97
|
-
// Test case
|
|
109
|
+
// Test case 4: Setting end date after start date
|
|
98
110
|
it('should set end date when start date exists and selected date is after', () => {
|
|
99
111
|
const date = new Date('2024-03-20');
|
|
100
112
|
const startDate = new Date('2024-03-15');
|
|
@@ -106,7 +118,7 @@ describe('setStartOrEndDate', () => {
|
|
|
106
118
|
});
|
|
107
119
|
});
|
|
108
120
|
|
|
109
|
-
// Test case
|
|
121
|
+
// Test case 5: Setting end date before start date (should reorder)
|
|
110
122
|
it('should reorder dates when end date is selected before start date', () => {
|
|
111
123
|
const date = new Date('2024-03-10');
|
|
112
124
|
const startDate = new Date('2024-03-15');
|
|
@@ -118,7 +130,7 @@ describe('setStartOrEndDate', () => {
|
|
|
118
130
|
});
|
|
119
131
|
});
|
|
120
132
|
|
|
121
|
-
// Test case
|
|
133
|
+
// Test case 6: Clicking within existing range
|
|
122
134
|
it('should start new selection when clicking within existing range', () => {
|
|
123
135
|
const date = new Date('2024-03-17');
|
|
124
136
|
const startDate = new Date('2024-03-15');
|
|
@@ -131,7 +143,7 @@ describe('setStartOrEndDate', () => {
|
|
|
131
143
|
});
|
|
132
144
|
});
|
|
133
145
|
|
|
134
|
-
// Test case
|
|
146
|
+
// Test case 7: Extending range before start date
|
|
135
147
|
it('should extend range when clicking before start date', () => {
|
|
136
148
|
const date = new Date('2024-03-10');
|
|
137
149
|
const startDate = new Date('2024-03-15');
|
|
@@ -144,7 +156,7 @@ describe('setStartOrEndDate', () => {
|
|
|
144
156
|
});
|
|
145
157
|
});
|
|
146
158
|
|
|
147
|
-
// Test case
|
|
159
|
+
// Test case 8: Extending range after end date
|
|
148
160
|
it('should extend range when clicking after end date', () => {
|
|
149
161
|
const date = new Date('2024-03-25');
|
|
150
162
|
const startDate = new Date('2024-03-15');
|
|
@@ -54,8 +54,12 @@ export const setStartOrEndDate = ({
|
|
|
54
54
|
startDate?: Date;
|
|
55
55
|
endDate?: Date;
|
|
56
56
|
}) => {
|
|
57
|
-
// Prevent selecting same date
|
|
58
|
-
if (
|
|
57
|
+
// Prevent selecting same date when both dates are set
|
|
58
|
+
if (
|
|
59
|
+
startDate &&
|
|
60
|
+
endDate &&
|
|
61
|
+
(isEqDate(date, startDate) || isEqDate(date, endDate))
|
|
62
|
+
) {
|
|
59
63
|
return {
|
|
60
64
|
startDate,
|
|
61
65
|
endDate,
|