@kalyx/react 0.3.0 → 1.0.0-rc.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/CHANGELOG.md CHANGED
@@ -1,5 +1,157 @@
1
1
  # @kalyx/react
2
2
 
3
+ ## 1.0.0-rc.0
4
+
5
+ ### Major Changes
6
+
7
+ - ca7180e: chore: v1.0 milestone — API freeze.
8
+
9
+ 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
+
11
+ ### What v1.0 commits to
12
+
13
+ - **Public API surface** — exports from `@kalyx/react` and `@kalyx/core` listed in their `index.ts` files. Any breaking change requires a major bump.
14
+ - **Compositional structure** — Root + subcomponent names (`DatePicker.Input`, `DatePicker.Calendar`, …) are stable. Removal or renaming requires a major bump.
15
+ - **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
+ - **Accessibility contracts** — role/aria-\* attributes emitted by each component are stable.
17
+
18
+ ### What v1.0 does NOT freeze
19
+
20
+ - Internal implementation details (non-exported functions, component file layout).
21
+ - CSS class name strings on elements — no classes are applied by default; only when a consumer passes them via `classNames` props.
22
+ - Error message text.
23
+ - Peer dependency version ranges (may expand to cover new React majors).
24
+
25
+ ### Breaking changes vs 0.4.x
26
+
27
+ None. v1.0 is API-compatible with 0.4.x — existing code continues to work. The major bump communicates stability commitment, not breakage.
28
+
29
+ ### Minor Changes
30
+
31
+ - 3db8444: feat: add `DatePicker.Presets` and `DatePicker.Preset` for single-date quick selection.
32
+
33
+ Mirrors the existing `RangePicker.Presets` API. Pass a predefined `value` key (`today`, `tomorrow`, `yesterday`, `startOfMonth`, `endOfMonth`, `startOfYear`) or a direct ISO via `date`.
34
+
35
+ ```tsx
36
+ <DatePicker value={date} onChange={setDate}>
37
+ <DatePicker.Input />
38
+ <DatePicker.Popover>
39
+ <DatePicker.Presets>
40
+ <DatePicker.Preset value="today">Today</DatePicker.Preset>
41
+ <DatePicker.Preset value="tomorrow">Tomorrow</DatePicker.Preset>
42
+ <DatePicker.Preset date="2026-12-25T00:00:00.000Z">
43
+ Christmas
44
+ </DatePicker.Preset>
45
+ </DatePicker.Presets>
46
+ <DatePicker.Calendar />
47
+ </DatePicker.Popover>
48
+ </DatePicker>
49
+ ```
50
+
51
+ - Active preset is marked `aria-selected="true"` when its resolved date matches the current value (timezone-aware).
52
+ - Clicking a preset commits and closes the popover.
53
+ - `displayTimezone` is honored when resolving "today"-relative presets.
54
+
55
+ - 56e1ce9: feat: add `onOpenChange` and `onCalendarNavigate` callbacks on `DatePicker`, `RangePicker`, and `DateTimePicker` Root components.
56
+
57
+ - `onOpenChange(isOpen: boolean)` fires whenever the popover opens or closes (regardless of trigger — click, keyboard, outside click, selection).
58
+ - `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
+
60
+ Neither callback fires on initial mount. `TimePicker` does not expose these callbacks since it has no popover or calendar.
61
+
62
+ - 6fc7c59: feat: add `MonthPicker` — a headless month selector.
63
+
64
+ `MonthPicker` stores the selected month as the first day of that month in UTC-ISO form (e.g., `"2026-04-01T00:00:00.000Z"`). It reuses `DatePicker` infrastructure (Input, Trigger, Popover), so the only new primitive is `MonthPicker.Grid`, a 12-month commit grid with year navigation.
65
+
66
+ ```tsx
67
+ <MonthPicker value={month} onChange={setMonth}>
68
+ <MonthPicker.Input placeholder="Pick a month" />
69
+ <MonthPicker.Popover>
70
+ <MonthPicker.Grid />
71
+ </MonthPicker.Popover>
72
+ </MonthPicker>
73
+ ```
74
+
75
+ - Default `displayFormat` is `"yyyy-MM"`.
76
+ - `displayTimezone` is supported (commits map to civil midnight of month-start in the target zone).
77
+ - Month selection highlighting is timezone-aware — the grid reflects the month of the current value even when stored in zone-adjusted UTC form.
78
+ - Primary UX is click-to-select; full `yyyy-MM-dd` typed input still works via the inherited Input behavior.
79
+
80
+ - 6fdf8fe: feat: add `WeekPicker` — a headless week selector.
81
+
82
+ `WeekPicker` stores the selected week as a `DateRange` covering all seven days (based on `weekStartsOn`). Unlike `RangePicker`, a single click on any day selects the entire week containing that day.
83
+
84
+ ```tsx
85
+ <WeekPicker value={week} onChange={setWeek} weekStartsOn={1}>
86
+ <WeekPicker.Input part="start" />
87
+ <WeekPicker.Input part="end" />
88
+ <WeekPicker.Popover>
89
+ <WeekPicker.Calendar />
90
+ </WeekPicker.Popover>
91
+ </WeekPicker>
92
+ ```
93
+
94
+ - Reuses `RangePicker` Root / Input / Popover; only `WeekPicker.Calendar` is new.
95
+ - `weekStartsOn` (0=Sunday, 1=Monday) controls which seven days constitute a week.
96
+ - Enter / Space on the focused day commits the full week containing it.
97
+ - `displayTimezone`, `disabled` rules, and all other RangePicker props are supported.
98
+
99
+ - 6fc7c59: feat: add `YearPicker` — a headless year selector.
100
+
101
+ `YearPicker` stores the selected year as Jan 1 of that year in UTC-ISO form (e.g., `"2026-01-01T00:00:00.000Z"`). It reuses `DatePicker` infrastructure (Input, Trigger, Popover) and exposes `YearPicker.Grid`, a 12-year decade commit grid with decade navigation.
102
+
103
+ ```tsx
104
+ <YearPicker value={year} onChange={setYear}>
105
+ <YearPicker.Input placeholder="Pick a year" />
106
+ <YearPicker.Popover>
107
+ <YearPicker.Grid />
108
+ </YearPicker.Popover>
109
+ </YearPicker>
110
+ ```
111
+
112
+ - Default `displayFormat` is `"yyyy"`.
113
+ - `displayTimezone` is supported with timezone-aware year highlighting.
114
+ - Primary UX is click-to-select; full `yyyy-MM-dd` typed input still works via the inherited Input behavior.
115
+
116
+ ### Patch Changes
117
+
118
+ - 1ca818c: fix(react): prevent WeekPicker from mutating RangePicker.Calendar
119
+
120
+ `WeekPicker` previously called `Object.assign(RangePickerRoot, { ..., Calendar: WeekPickerCalendar })`, which mutates the shared `RangePickerRoot` function object. Because `RangePicker.Calendar` is attached to the same object (via the earlier `Object.assign` in `RangePicker/index.ts`), importing `WeekPicker` would overwrite `RangePicker.Calendar` with `WeekPickerCalendar`.
121
+
122
+ Users of `RangePicker` would then see week-selection behavior (single click commits a full week and closes the popover) instead of the documented two-click range flow — even without importing `WeekPicker` directly, because both pickers share the module graph.
123
+
124
+ Added an internal `WeekPickerRoot` wrapper that the `Object.assign` target now uses, preserving `RangePickerRoot.Calendar` intact.
125
+
126
+ Caught by the `RangePicker › select range in start-date -> end-date order` Playwright test; all existing behavior is restored.
127
+
128
+ - Updated dependencies [ca7180e]
129
+ - @kalyx/core@1.0.0-rc.0
130
+
131
+ ## 0.4.0
132
+
133
+ ### Minor Changes
134
+
135
+ - 104bbf2: feat: full `displayTimezone` support across all pickers (v0.4)
136
+
137
+ All four pickers (`DatePicker`, `RangePicker`, `TimePicker`, `DateTimePicker`) and their corresponding hooks (`useDatePicker`, `useRangePicker`, `useTimePicker`) now accept a `displayTimezone` prop/option.
138
+
139
+ 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
+
141
+ `DateFnsAdapter` now honors the `timezone` argument on `format`, `isSameDay`, `startOfDay`, and `today` (previously declared-but-ignored). Core also exposes new helpers:
142
+
143
+ - `civilMidnightFromUtcDay(iso, tz)`
144
+ - `getTimeInTimezone(iso, tz)`
145
+ - `setTimeInTimezone(iso, partial, tz)`
146
+
147
+ No breaking changes — omitting `displayTimezone` keeps the existing UTC semantics.
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [b3a8897]
152
+ - Updated dependencies [104bbf2]
153
+ - @kalyx/core@0.4.0
154
+
3
155
  ## 0.3.0
4
156
 
5
157
  ### Minor Changes