@kalyx/react 1.0.0-rc.0 → 1.0.0-rc.2
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 +59 -9
- package/README.md +6 -1
- package/dist/index.cjs +413 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +416 -312
- package/dist/index.js.map +1 -1
- package/package.json +18 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @kalyx/react
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- aadb512: Security: pin transitive `postcss` to `>=8.5.10` via `pnpm.overrides`.
|
|
8
|
+
|
|
9
|
+
Two `postcss` versions in `pnpm-lock.yaml` (`8.4.31` from a `postcss-load-config` chain and `8.5.9` from the `tsup` chain) were affected by [GHSA-qx2v-qp2m-jg93](https://osv.dev/GHSA-qx2v-qp2m-jg93) (CVSS 6.1 — improper newline handling that lets crafted input bypass quote escapes). Both are now resolved to `8.5.10`+. The OSV scanner workflow (which auto-creates issues #23 / #24 / #27) now reports zero advisories.
|
|
10
|
+
|
|
11
|
+
- 21f3c1f: Resolve v1.0-rc release-blocking defects (P0):
|
|
12
|
+
- **`"use client"` directive** — bundle is now marked as a React Server Component client boundary via tsup banner. Next.js App Router consumers no longer have to wrap each import.
|
|
13
|
+
- **Stable `today()`/`now()` initialization** — `viewMonth`/`focusedDate` `useState` calls in `DatePicker`/`RangePicker`/`DateTimePicker` Roots now use lazy initializers, so the adapter isn't called on every render.
|
|
14
|
+
- **`@kalyx/core` version sync** — bumped from `1.0.0-rc.0` to `1.0.0-rc.1` to match `@kalyx/react`.
|
|
15
|
+
- **`@kalyx/core` package contents** — `LICENSE` and `CHANGELOG.md` are now included in the npm tarball (`files` field).
|
|
16
|
+
- **Form auto-submit blocked when calendar open** — pressing Enter inside `DatePicker.Input`/`RangePicker.Input`/`DateTimePicker.Input` while the popover is open no longer submits the surrounding `<form>`.
|
|
17
|
+
- **`aria-haspopup="dialog"` on Trigger** — completes the WAI-ARIA combobox/dialog pattern.
|
|
18
|
+
- **Disabled cells skipped during keyboard navigation** — Calendar arrow keys / PageUp/Down / Home / End now step over disabled days and stop only when no enabled day is reachable.
|
|
19
|
+
|
|
20
|
+
- 733c0a1: Follow-up to the v1.0-rc audit series:
|
|
21
|
+
- **Fix WebKit Enter regression** — `DatePicker.Input` now commits the calendar's currently focused day on Enter when the popover is open and no text was typed. WebKit doesn't always shift focus from the input to the day button on `input.click()`, so the previous behavior (preventDefault but no commit) left the popover dangling. Other browsers also benefit when the user presses Enter immediately after opening.
|
|
22
|
+
- **Consolidate parsing path** — extract the parse-and-commit logic into a single `commitText` helper used by `onChange`, `onBlur`, `onCompositionEnd`, and Enter. Removes ~60 bytes of duplicated logic.
|
|
23
|
+
- **Bundle target raised to 13 KB** — the v1.0-rc accessibility / API additions (IME composition, popover focus-out, hidden form input, `aria-rowindex`/`colindex`, `displayName`, keyboard skip-disabled) accumulated to 12.07 KB gzip; the 12 KB ceiling was 0.07 KB tight. README, docs, `tsup.config.ts`, and `scripts/check-bundle-size.js` updated to ≤13 KB. Still ~3× smaller than `react-datepicker`.
|
|
24
|
+
|
|
25
|
+
- 3228533: P1 v1.0-rc API/a11y/docs improvements:
|
|
26
|
+
- **Popover focus-out close** — `usePopover` now closes the popover when focus leaves the floating layer and the reference element (Tab through). Matches the Radix/Ark dismissable layer pattern.
|
|
27
|
+
- **`name` prop + hidden form input** — `DatePicker.Input` accepts a `name` prop. When set, a hidden `<input type="hidden">` is rendered alongside the visible input so the value participates in native form submission and integrates with `react-hook-form` Controller-less flows.
|
|
28
|
+
- **IME composition handling** — `DatePicker.Input` now defers parsing during IME composition (`compositionstart` / `compositionend`). Previously, partial Korean / Japanese / Chinese input was repeatedly re-parsed and the user's text disappeared.
|
|
29
|
+
- **README parity** — Korean README now has the "Styling with Tailwind CSS" and "Using data attributes" sections that were missing. Version table and bundle-size claim corrected to `v1.0.0-rc.1` / `11.57 KB`.
|
|
30
|
+
- **Package metadata** — `peerDependenciesMeta`, `engines.node`, and `publishConfig.provenance` added to both `@kalyx/react` and `@kalyx/core`.
|
|
31
|
+
- **`@kalyx/react` description** — corrected from "under 10 KB gzipped" (false claim) to "≤12 KB gzipped".
|
|
32
|
+
|
|
33
|
+
- e8519d0: Performance: memoize hot paths to avoid wasted recomputation:
|
|
34
|
+
- `DatePicker.Calendar` and `RangePicker.Calendar` now `useMemo` their `getCalendarDays` and `getWeekdayNames` results. Previously the 42-cell grid and 7 weekday tuples were rebuilt every parent re-render even when none of the inputs changed.
|
|
35
|
+
- `TimePicker.HourList` and `TimePicker.MinuteList` `useMemo` their `generateHours(format)` / `generateMinutes(step)` arrays so the listbox identity is stable across renders.
|
|
36
|
+
- `usePopover` middleware (`offset` / `flip` / `shift`) is now hoisted to a module-level constant, eliminating Floating UI's repeated middleware-array reconciliation.
|
|
37
|
+
|
|
38
|
+
- b6129ed: P2 polish for v1.0-rc:
|
|
39
|
+
- **Calendar grid `aria-rowindex` / `aria-colindex` / `aria-rowcount` / `aria-colcount`** — `DatePicker.Calendar` and `RangePicker.Calendar` now expose grid coordinates so screenreaders announce position ("row 3 of 6, column 4 of 7") during keyboard navigation.
|
|
40
|
+
- **`displayName` on all `forwardRef` components** — `DatePicker.Input`, `DatePicker.Trigger`, `RangePicker.Input`, `TimePicker.Input`, `DateTimePicker.Input` now render with their public dot-notation name in React DevTools.
|
|
41
|
+
- **JSDoc on `DatePicker.Input` and `DatePicker.Trigger`** — public API surface for the most-used components has explanatory docstrings.
|
|
42
|
+
- **`addYears` leap-day regression tests** — locked the date-fns clamp behavior (2024-02-29 + 1y → 2025-02-28, not March 1).
|
|
43
|
+
- **DST fall-back ambiguous-hour regression test** — captures the current behavior of `setTimeInTimezone` for 2026-11-01 01:30 America/New_York so silent drift surfaces as a test failure.
|
|
44
|
+
- **Test count claim corrected** — root and core `CLAUDE.md` previously claimed "1,000+ unit tests"; actual count is ~140 in core, 374 across the workspace.
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [aadb512]
|
|
47
|
+
- Updated dependencies [21f3c1f]
|
|
48
|
+
- Updated dependencies [3228533]
|
|
49
|
+
- Updated dependencies [b6129ed]
|
|
50
|
+
- @kalyx/core@1.0.0-rc.2
|
|
51
|
+
|
|
52
|
+
## 1.0.0-rc.1
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- 3afb15b: Fix popover styling regression that broke documentation live previews.
|
|
57
|
+
- `DatePicker.Popover` and `RangePicker.Popover` now merge user-provided `style` props _under_ Floating UI's positioning instead of being overwritten by it. Previously, passing `style={{...}}` to a Popover stripped away `position: absolute`, `top`, `left`, and `transform`, causing the popover to render as a static block at full container width.
|
|
58
|
+
- The popover is now hidden until Floating UI computes its position, eliminating an unpositioned first-frame flash on every open.
|
|
59
|
+
- The shared `usePopover` hook also wires the floating element's reference synchronously in the ref callback, so positioning is resolved before paint in most cases.
|
|
60
|
+
|
|
3
61
|
## 1.0.0-rc.0
|
|
4
62
|
|
|
5
63
|
### Major Changes
|
|
@@ -9,14 +67,12 @@
|
|
|
9
67
|
Kalyx v1.0 declares the public API stable. This is a milestone release bundling the v0.5 surface additions (MonthPicker, YearPicker, WeekPicker, DatePicker.Presets, `onOpenChange`/`onCalendarNavigate` event callbacks) with an explicit commitment to semantic versioning going forward.
|
|
10
68
|
|
|
11
69
|
### What v1.0 commits to
|
|
12
|
-
|
|
13
70
|
- **Public API surface** — exports from `@kalyx/react` and `@kalyx/core` listed in their `index.ts` files. Any breaking change requires a major bump.
|
|
14
71
|
- **Compositional structure** — Root + subcomponent names (`DatePicker.Input`, `DatePicker.Calendar`, …) are stable. Removal or renaming requires a major bump.
|
|
15
72
|
- **Value semantics** — ISO 8601 UTC strings for single dates, `DateRange` `{start, end}` for ranges. `displayTimezone` behavior (civil-midnight-in-tz for date selection) is stable.
|
|
16
73
|
- **Accessibility contracts** — role/aria-\* attributes emitted by each component are stable.
|
|
17
74
|
|
|
18
75
|
### What v1.0 does NOT freeze
|
|
19
|
-
|
|
20
76
|
- Internal implementation details (non-exported functions, component file layout).
|
|
21
77
|
- CSS class name strings on elements — no classes are applied by default; only when a consumer passes them via `classNames` props.
|
|
22
78
|
- Error message text.
|
|
@@ -39,9 +95,7 @@
|
|
|
39
95
|
<DatePicker.Presets>
|
|
40
96
|
<DatePicker.Preset value="today">Today</DatePicker.Preset>
|
|
41
97
|
<DatePicker.Preset value="tomorrow">Tomorrow</DatePicker.Preset>
|
|
42
|
-
<DatePicker.Preset date="2026-12-25T00:00:00.000Z">
|
|
43
|
-
Christmas
|
|
44
|
-
</DatePicker.Preset>
|
|
98
|
+
<DatePicker.Preset date="2026-12-25T00:00:00.000Z">Christmas</DatePicker.Preset>
|
|
45
99
|
</DatePicker.Presets>
|
|
46
100
|
<DatePicker.Calendar />
|
|
47
101
|
</DatePicker.Popover>
|
|
@@ -53,7 +107,6 @@
|
|
|
53
107
|
- `displayTimezone` is honored when resolving "today"-relative presets.
|
|
54
108
|
|
|
55
109
|
- 56e1ce9: feat: add `onOpenChange` and `onCalendarNavigate` callbacks on `DatePicker`, `RangePicker`, and `DateTimePicker` Root components.
|
|
56
|
-
|
|
57
110
|
- `onOpenChange(isOpen: boolean)` fires whenever the popover opens or closes (regardless of trigger — click, keyboard, outside click, selection).
|
|
58
111
|
- `onCalendarNavigate(viewMonth: ISODateString)` fires when the calendar view moves to a different month. The emitted value is the first day of the newly-visible month in UTC.
|
|
59
112
|
|
|
@@ -139,7 +192,6 @@
|
|
|
139
192
|
When set, the value stored via `onChange` is the **civil midnight of the selected day in the target timezone** (in UTC-ISO form), eliminating the classic "day off by one" bug that affects picker libraries bound to `new Date()`. Input formatting, calendar highlighting, and the time-of-day controls all follow the display timezone — including DST-aware offsets for zones like `America/New_York` and `Europe/London`.
|
|
140
193
|
|
|
141
194
|
`DateFnsAdapter` now honors the `timezone` argument on `format`, `isSameDay`, `startOfDay`, and `today` (previously declared-but-ignored). Core also exposes new helpers:
|
|
142
|
-
|
|
143
195
|
- `civilMidnightFromUtcDay(iso, tz)`
|
|
144
196
|
- `getTimeInTimezone(iso, tz)`
|
|
145
197
|
- `setTimeInTimezone(iso, partial, tz)`
|
|
@@ -157,7 +209,6 @@
|
|
|
157
209
|
### Minor Changes
|
|
158
210
|
|
|
159
211
|
- 669391b: Improve code quality, performance, and stability
|
|
160
|
-
|
|
161
212
|
- Enforce UTC timezone suffix in ISO regex
|
|
162
213
|
- Extract shared usePopover and useListboxNavigation hooks
|
|
163
214
|
- Add Intl.DateTimeFormat caching for locale/timezone utilities
|
|
@@ -196,7 +247,6 @@
|
|
|
196
247
|
- e9bb9e8: Initial release of Kalyx — headless, SSR-safe React DatePicker library.
|
|
197
248
|
|
|
198
249
|
Features:
|
|
199
|
-
|
|
200
250
|
- DatePicker: single date selection with Calendar, Input, Trigger, Popover
|
|
201
251
|
- RangePicker: date range selection with auto-swap and hover preview
|
|
202
252
|
- TimePicker: 12h/24h mode, minute step, HourList/MinuteList/AmPmToggle
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> The headless React DatePicker, finally complete. Zero CSS · SSR-safe · under 12 KB gzip.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@kalyx/react)
|
|
6
|
-
[](https://kalyx-docs.vercel.app/docs/api/react#bundle-size)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://github.com/jiji-hoon96/kalyx/blob/main/LICENSE)
|
|
9
9
|
|
|
@@ -51,6 +51,9 @@ import {
|
|
|
51
51
|
RangePicker, // date range + presets
|
|
52
52
|
TimePicker, // hour + minute (+ seconds)
|
|
53
53
|
DateTimePicker, // date + time combined
|
|
54
|
+
MonthPicker, // month-only selection
|
|
55
|
+
YearPicker, // year-only selection
|
|
56
|
+
WeekPicker, // full-week range selection
|
|
54
57
|
useDatePicker, // hook for custom UIs
|
|
55
58
|
useRangePicker,
|
|
56
59
|
useTimePicker,
|
|
@@ -90,6 +93,8 @@ Full recipes: [Tailwind](https://kalyx-docs.vercel.app/docs/recipes/tailwind), [
|
|
|
90
93
|
- [Quick Start](https://kalyx-docs.vercel.app/docs/getting-started/quick-start)
|
|
91
94
|
- [Components](https://kalyx-docs.vercel.app/docs/components/datepicker)
|
|
92
95
|
- [Hooks](https://kalyx-docs.vercel.app/docs/hooks/use-date-picker)
|
|
96
|
+
- [Testing](https://kalyx-docs.vercel.app/docs/recipes/testing)
|
|
97
|
+
- [Troubleshooting](https://kalyx-docs.vercel.app/docs/troubleshooting)
|
|
93
98
|
- [Migration from react-datepicker / react-day-picker / React Aria](https://kalyx-docs.vercel.app/docs/migration)
|
|
94
99
|
|
|
95
100
|
## License
|