@kalyx/react 1.0.0-rc.11 → 1.0.0-rc.13
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 +56 -0
- package/dist/index.cjs +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @kalyx/react
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.13
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5b6c37f: Extract `@kalyx/adapter-date-fns` and make `@kalyx/core` neutral
|
|
8
|
+
|
|
9
|
+
Step 1 + 2 of the four-step adapter-extraction plan (see `.claude/skills/adapter-extraction.md`). After this change, `@kalyx/core` no longer depends on `date-fns` or `date-fns-tz`; it ships only the platform-agnostic date logic (`getCalendarDays`, `isDateDisabled`, timezone helpers, labels, the `DateAdapter` contract). The DateFnsAdapter implementation now lives in its own publishable package so dayjs / luxon / Temporal adapters can be added later without forcing every Kalyx user to bundle two date libraries.
|
|
10
|
+
|
|
11
|
+
### What changed
|
|
12
|
+
- **`@kalyx/core`** — `DateFnsAdapter` is no longer exported and `date-fns` / `date-fns-tz` are no longer listed as dependencies. `utils/timezone.ts` was the lone leak and uses native `new Date(string)` now (every caller already routes through `normalizeISO` or `DateAdapter.parse`, so the input subset is fully spec-defined).
|
|
13
|
+
- **`@kalyx/adapter-date-fns`** — new package with the full `DateFnsAdapter` implementation moved verbatim. Same UTC semantics, same timezone-aware paths, same 35 adapter tests.
|
|
14
|
+
- **`@kalyx/react`** — imports `DateFnsAdapter` from `@kalyx/adapter-date-fns` now. The default adapter is still wired up automatically — anyone using `import { DatePicker } from '@kalyx/react'` keeps the previous behaviour with zero changes. The adapter package is a direct dependency so consumers installing just `@kalyx/react` continue to get a working default.
|
|
15
|
+
|
|
16
|
+
### Migration
|
|
17
|
+
|
|
18
|
+
If you imported `DateFnsAdapter` directly from `@kalyx/core`:
|
|
19
|
+
|
|
20
|
+
```diff
|
|
21
|
+
- import { DateFnsAdapter } from '@kalyx/core';
|
|
22
|
+
+ import { DateFnsAdapter } from '@kalyx/adapter-date-fns';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`@kalyx/react` consumers don't need to change anything — the adapter is still re-exported from `@kalyx/react`.
|
|
26
|
+
|
|
27
|
+
### Next (separate PR)
|
|
28
|
+
|
|
29
|
+
The `/headless` entry point (`@kalyx/react/headless`) that lets dayjs/luxon users tree-shake date-fns out is a follow-up. The component Roots still default to the date-fns adapter inline; the entry split requires moving that fallback out of each Root and into the entry boundary.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [5b6c37f]
|
|
34
|
+
- @kalyx/core@1.0.0-rc.13
|
|
35
|
+
- @kalyx/adapter-date-fns@1.0.0-rc.1
|
|
36
|
+
|
|
37
|
+
## 1.0.0-rc.12
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- e5bd203: test(ssr): cover controlled value at a DST boundary with displayTimezone across all 7 pickers
|
|
42
|
+
|
|
43
|
+
The existing `renderToString` smoke tests only exercised the default `value=null` (or generic non-DST) path. They missed the highest-risk hydration scenario: a controlled value rendered on a DST transition day (2026-03-08 US Eastern spring-forward) while `displayTimezone="America/New_York"` forces the calendar/highlighting/time rows to map UTC ↔ civil time across the seam.
|
|
44
|
+
|
|
45
|
+
Each picker now has one new determinism test inside its `SSR safety` describe that renders the same tree twice via `renderToString` and asserts byte-identical output. Any accidental clock-read or non-deterministic `Intl` path during render would surface as a string diff.
|
|
46
|
+
- `DatePicker` — 2026-03-08 day cell + popover + calendar
|
|
47
|
+
- `RangePicker` — range straddling the DST seam
|
|
48
|
+
- `TimePicker` — value at 02:00 EST → 03:00 EDT
|
|
49
|
+
- `DateTimePicker` — full date + time tree (highest hydration surface)
|
|
50
|
+
- `MonthPicker` — March 2026 month grid
|
|
51
|
+
- `YearPicker` — 2026 decade grid
|
|
52
|
+
- `WeekPicker` — week containing the spring-forward day
|
|
53
|
+
|
|
54
|
+
No production code changed; the suite goes from 314 → 321 picker tests and locks the current SSR-deterministic behaviour against future regressions.
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [0556886]
|
|
57
|
+
- @kalyx/core@1.0.0-rc.12
|
|
58
|
+
|
|
3
59
|
## 1.0.0-rc.11
|
|
4
60
|
|
|
5
61
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var core = require('@kalyx/core');
|
|
6
|
+
var adapterDateFns = require('@kalyx/adapter-date-fns');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var react$1 = require('@floating-ui/react');
|
|
8
9
|
|
|
@@ -45,7 +46,7 @@ function DatePickerRoot({
|
|
|
45
46
|
displayFormat = "yyyy-MM-dd",
|
|
46
47
|
locale = "en-US",
|
|
47
48
|
displayTimezone,
|
|
48
|
-
adapter =
|
|
49
|
+
adapter = adapterDateFns.DateFnsAdapter,
|
|
49
50
|
labels: labelsProp,
|
|
50
51
|
children
|
|
51
52
|
}) {
|
|
@@ -1126,7 +1127,7 @@ function RangePickerRoot({
|
|
|
1126
1127
|
displayFormat = "yyyy-MM-dd",
|
|
1127
1128
|
locale = "en-US",
|
|
1128
1129
|
displayTimezone,
|
|
1129
|
-
adapter =
|
|
1130
|
+
adapter = adapterDateFns.DateFnsAdapter,
|
|
1130
1131
|
labels: labelsProp,
|
|
1131
1132
|
children
|
|
1132
1133
|
}) {
|
|
@@ -1824,7 +1825,7 @@ function TimePickerRoot({
|
|
|
1824
1825
|
const setTime = react.useCallback(
|
|
1825
1826
|
(partial) => {
|
|
1826
1827
|
if (disabled || readOnly) return;
|
|
1827
|
-
const base = currentValue ??
|
|
1828
|
+
const base = currentValue ?? adapterDateFns.DateFnsAdapter.today(displayTimezone);
|
|
1828
1829
|
const newIso = displayTimezone ? core.setTimeInTimezone(base, partial, displayTimezone) : core.setTime(base, partial);
|
|
1829
1830
|
if (!isControlled) {
|
|
1830
1831
|
setUncontrolledValue(newIso);
|
|
@@ -2207,7 +2208,7 @@ function DateTimePickerRoot({
|
|
|
2207
2208
|
displayFormat = "yyyy-MM-dd HH:mm",
|
|
2208
2209
|
locale = "en-US",
|
|
2209
2210
|
displayTimezone,
|
|
2210
|
-
adapter =
|
|
2211
|
+
adapter = adapterDateFns.DateFnsAdapter,
|
|
2211
2212
|
labels: labelsProp,
|
|
2212
2213
|
children
|
|
2213
2214
|
}) {
|
|
@@ -2745,7 +2746,7 @@ function useDatePicker(options = {}) {
|
|
|
2745
2746
|
onChange,
|
|
2746
2747
|
disabled = [],
|
|
2747
2748
|
weekStartsOn = 0,
|
|
2748
|
-
adapter =
|
|
2749
|
+
adapter = adapterDateFns.DateFnsAdapter,
|
|
2749
2750
|
displayTimezone
|
|
2750
2751
|
} = options;
|
|
2751
2752
|
const pickerId = react.useId();
|
|
@@ -2828,7 +2829,7 @@ function useRangePicker(options = {}) {
|
|
|
2828
2829
|
onChange,
|
|
2829
2830
|
disabled = [],
|
|
2830
2831
|
weekStartsOn = 0,
|
|
2831
|
-
adapter =
|
|
2832
|
+
adapter = adapterDateFns.DateFnsAdapter,
|
|
2832
2833
|
displayTimezone
|
|
2833
2834
|
} = options;
|
|
2834
2835
|
const pickerId = react.useId();
|
|
@@ -2936,7 +2937,7 @@ function useRangePicker(options = {}) {
|
|
|
2936
2937
|
};
|
|
2937
2938
|
}
|
|
2938
2939
|
function getDefaultIso() {
|
|
2939
|
-
return
|
|
2940
|
+
return adapterDateFns.DateFnsAdapter.today();
|
|
2940
2941
|
}
|
|
2941
2942
|
function useTimePicker(options = {}) {
|
|
2942
2943
|
const {
|
|
@@ -3022,7 +3023,7 @@ Object.defineProperty(exports, "DEFAULT_TIMEPICKER_LABELS", {
|
|
|
3022
3023
|
});
|
|
3023
3024
|
Object.defineProperty(exports, "DateFnsAdapter", {
|
|
3024
3025
|
enumerable: true,
|
|
3025
|
-
get: function () { return
|
|
3026
|
+
get: function () { return adapterDateFns.DateFnsAdapter; }
|
|
3026
3027
|
});
|
|
3027
3028
|
exports.DatePicker = DatePicker;
|
|
3028
3029
|
exports.DateTimePicker = DateTimePicker;
|