@spaced-out/ui-design-system 0.6.29 → 0.6.32
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 +11 -0
- package/lib/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangePicker.js +32 -12
- package/lib/components/DateRangePicker/DateRangeWrapper.d.ts.map +1 -1
- package/lib/components/DateRangePicker/DateRangeWrapper.js +3 -1
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.6.32](https://github.com/spaced-out/ui-design-system/compare/v0.6.31...v0.6.32) (2026-09-04)
|
|
6
|
+
|
|
7
|
+
### [0.6.31](https://github.com/spaced-out/ui-design-system/compare/v0.6.30...v0.6.31) (2026-08-31)
|
|
8
|
+
|
|
9
|
+
### [0.6.30](https://github.com/spaced-out/ui-design-system/compare/v0.6.29...v0.6.30) (2026-08-24)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **date-range-picker:** fixed year selection edge case behavior ([#499](https://github.com/spaced-out/ui-design-system/issues/499)) ([1bd840a](https://github.com/spaced-out/ui-design-system/commit/1bd840a70254127afe77d8e26905475395505189))
|
|
15
|
+
|
|
5
16
|
### [0.6.29](https://github.com/spaced-out/ui-design-system/compare/v0.6.28...v0.6.29) (2026-08-20)
|
|
6
17
|
|
|
7
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAA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WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAClE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAClD,oBAAoB,EACpB,cAAc,CAuQf,CAAC"}
|
|
@@ -59,19 +59,39 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/React.forwardRef(
|
|
|
59
59
|
const [rangeStartMonth, setRangeStartMonth] = React.useState(validRangeStartMonth);
|
|
60
60
|
const [rangeEndMonth, setRangeEndMonth] = React.useState(validRangeEndMonth);
|
|
61
61
|
const [isMobileSyncedToStartMonth, setIsMobileSyncedToStartMonth] = React.useState(false);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const clampMonthToBounds = date => {
|
|
63
|
+
const minMonth = (0, _utils.getMonthEndDate)(validMinDate);
|
|
64
|
+
const maxMonth = (0, _utils.getMonthEndDate)(validMaxDate);
|
|
65
|
+
if ((0, _dateRangePicker.isBefore)(date, minMonth)) {
|
|
66
|
+
return minMonth;
|
|
67
|
+
}
|
|
68
|
+
if ((0, _dateRangePicker.isAfter)(date, maxMonth)) {
|
|
69
|
+
return maxMonth;
|
|
67
70
|
}
|
|
71
|
+
return date;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// The single mobile calendar drives both month cursors at once, so it only
|
|
75
|
+
// gets the minDate/maxDate clamp — the ordering is already worked out by
|
|
76
|
+
// handleMobileCalendarMonthSelection.
|
|
77
|
+
const setRangeStartMonthInBounds = date => {
|
|
78
|
+
setRangeStartMonth(clampMonthToBounds(date));
|
|
79
|
+
};
|
|
80
|
+
const setRangeEndMonthInBounds = date => {
|
|
81
|
+
setRangeEndMonth(clampMonthToBounds(date));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// The two desktop panes must stay ordered. A month/year pick that would
|
|
85
|
+
// collide with (or overshoot) the other pane lands on the month adjacent to
|
|
86
|
+
// it rather than resetting to minDate/maxDate, so the user still arrives in
|
|
87
|
+
// the year they asked for.
|
|
88
|
+
const setRangeStartMonthValidated = date => {
|
|
89
|
+
const latestAllowed = (0, _utils.getMonthEndDate)((0, _utils.getSubtractedDate)(rangeEndMonth, 1, 'M'));
|
|
90
|
+
setRangeStartMonthInBounds((0, _dateRangePicker.isSameOrAfter)(date, rangeEndMonth, 'month') ? latestAllowed : date);
|
|
68
91
|
};
|
|
69
92
|
const setRangeEndMonthValidated = date => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else {
|
|
73
|
-
setRangeEndMonth((0, _utils.getMonthEndDate)(validMaxDate));
|
|
74
|
-
}
|
|
93
|
+
const earliestAllowed = (0, _utils.getMonthEndDate)((0, _utils.getAddedDate)(rangeStartMonth, 1, 'M'));
|
|
94
|
+
setRangeEndMonthInBounds((0, _dateRangePicker.isSameOrBefore)(date, rangeStartMonth, 'month') ? earliestAllowed : date);
|
|
75
95
|
};
|
|
76
96
|
const onMonthNavigate = (marker, action) => {
|
|
77
97
|
if (marker === _utils.MARKERS.DATE_RANGE_START) {
|
|
@@ -106,8 +126,8 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/React.forwardRef(
|
|
|
106
126
|
syncToStart = (0, _dateRangePicker.isBefore)(newMonth, rangeEndMonth);
|
|
107
127
|
[start, end] = syncToStart ? [newMonth, validMaxDate] : [(0, _utils.getSubtractedDate)(newMonth, 1, 'M'), newMonth];
|
|
108
128
|
}
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
setRangeStartMonthInBounds(start);
|
|
130
|
+
setRangeEndMonthInBounds(end);
|
|
111
131
|
setIsMobileSyncedToStartMonth(syncToStart);
|
|
112
132
|
};
|
|
113
133
|
const handleMobileMonthSelection = date => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangeWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"DateRangeWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangeWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAIrD,OAAO,KAAK,EAAC,SAAS,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAC;AAChE,OAAO,EAOL,OAAO,EACP,iBAAiB,EAClB,MAAM,WAAW,CAAC;AAmEnB,UAAU,qBAAqB;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;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B,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkSD,eAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,CACnD,qBAAqB,EACrB,cAAc,CAmHf,CAAC"}
|
|
@@ -228,7 +228,9 @@ const DateRangeWrapper = exports.DateRangeWrapper = /*#__PURE__*/React.forwardRe
|
|
|
228
228
|
locale,
|
|
229
229
|
testId
|
|
230
230
|
} = _ref4;
|
|
231
|
-
|
|
231
|
+
// True only while the panes are ordered and more than one month apart, so
|
|
232
|
+
// the chevrons can never push them into (or further past) each other.
|
|
233
|
+
const canNavigateCloser = (0, _dateRangePicker.isBefore)((0, _utils.getMonthEndDate)((0, _utils.getAddedDate)(rangeStartMonth, 1, 'M')), rangeEndMonth);
|
|
232
234
|
const handleApplyClick = () => {
|
|
233
235
|
const {
|
|
234
236
|
startDate,
|
package/mcp/package.json
CHANGED