@kalyx/core 1.0.0-rc.10 → 1.0.0-rc.11
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 +19 -0
- package/dist/index.cjs +5 -3
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @kalyx/core
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.11
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c8a6609: fix(rangepicker): announce next selection target and final range to screen readers
|
|
8
|
+
|
|
9
|
+
`<RangePicker.Calendar>` now announces context-aware messages through its existing `role="status"` live region:
|
|
10
|
+
- After the first click (start), it announces `<formatted-date>. Now select end date.` so screen-reader users know the next click commits the other endpoint.
|
|
11
|
+
- After the second click (end), it announces `Range selected: <start> – <end>` instead of just the bare date — matching the swap-if-before behaviour so the announcement always reflects what was committed.
|
|
12
|
+
- Week-mode commits now share the same `Range selected: ...` prefix for consistency.
|
|
13
|
+
|
|
14
|
+
The two new strings are wired through `RangePickerLabels.selectingEnd` and `RangePickerLabels.rangeSelected` with English defaults, and they are fully overridable via the existing `labels` prop for i18n. `@kalyx/core` gets a `minor` bump because `RangePickerLabels` gained required fields (with defaults supplied by `DEFAULT_RANGEPICKER_LABELS`); any consumer constructing a literal `RangePickerLabels` from scratch will need to add the two keys.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 19ac1c0: fix(core): allow `generateMinutes` step values up to 60
|
|
19
|
+
|
|
20
|
+
`generateMinutes(step)` rejected any step above 30, which prevented legitimate cases like `step=45` (quarter-and-three-quarters past the hour) and `step=60` (on-the-hour only). The slot-generation loop already works for any 1–60 integer, so the upper bound is now 60 with the same error message format. Steps `0`, `61+`, and negative values still throw. No callers in `@kalyx/react` relied on the previous narrower bound.
|
|
21
|
+
|
|
3
22
|
## 1.0.0-rc.10
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -495,8 +495,8 @@ function generateHours(format = "24h") {
|
|
|
495
495
|
return Array.from({ length: 24 }, (_, i) => i);
|
|
496
496
|
}
|
|
497
497
|
function generateMinutes(step = 1) {
|
|
498
|
-
if (step < 1 || step >
|
|
499
|
-
throw new Error(`[generateMinutes] step must be between 1 and
|
|
498
|
+
if (step < 1 || step > 60) {
|
|
499
|
+
throw new Error(`[generateMinutes] step must be between 1 and 60, got ${step}`);
|
|
500
500
|
}
|
|
501
501
|
const result = [];
|
|
502
502
|
for (let i = 0; i < 60; i += step) {
|
|
@@ -590,7 +590,9 @@ var DEFAULT_RANGEPICKER_LABELS = {
|
|
|
590
590
|
popoverLabel: "Choose date range",
|
|
591
591
|
startInput: "Start date",
|
|
592
592
|
endInput: "End date",
|
|
593
|
-
presetsGroup: "Date range presets"
|
|
593
|
+
presetsGroup: "Date range presets",
|
|
594
|
+
selectingEnd: "Now select end date",
|
|
595
|
+
rangeSelected: "Range selected"
|
|
594
596
|
};
|
|
595
597
|
var DEFAULT_TIMEPICKER_LABELS = {
|
|
596
598
|
timeInput: "Time",
|
package/dist/index.d.cts
CHANGED
|
@@ -234,9 +234,15 @@ declare function to24Hour(hours12: number, period: 'AM' | 'PM'): number;
|
|
|
234
234
|
declare function generateHours(format?: '12h' | '24h'): number[];
|
|
235
235
|
/**
|
|
236
236
|
* Builds a minutes list at the given step.
|
|
237
|
-
*
|
|
238
|
-
* step=
|
|
239
|
-
* step=
|
|
237
|
+
*
|
|
238
|
+
* - `step=1` → `[0, 1, 2, ..., 59]`
|
|
239
|
+
* - `step=15` → `[0, 15, 30, 45]`
|
|
240
|
+
* - `step=5` → `[0, 5, 10, ..., 55]`
|
|
241
|
+
* - `step=45` → `[0, 45]`
|
|
242
|
+
* - `step=60` → `[0]` (on-the-hour only)
|
|
243
|
+
*
|
|
244
|
+
* Steps above 60 are rejected because they always collapse to `[0]` — useful UX
|
|
245
|
+
* is impossible past that point.
|
|
240
246
|
*/
|
|
241
247
|
declare function generateMinutes(step?: number): number[];
|
|
242
248
|
/**
|
|
@@ -399,6 +405,16 @@ interface RangePickerLabels extends DatePickerLabels {
|
|
|
399
405
|
startInput: string;
|
|
400
406
|
endInput: string;
|
|
401
407
|
presetsGroup: string;
|
|
408
|
+
/**
|
|
409
|
+
* Screen-reader prompt appended after the start date is picked, telling the user
|
|
410
|
+
* the next click commits the end of the range.
|
|
411
|
+
*/
|
|
412
|
+
selectingEnd: string;
|
|
413
|
+
/**
|
|
414
|
+
* Screen-reader prefix announced when both endpoints are committed, e.g.
|
|
415
|
+
* `"Range selected: Jan 5, 2026 – Jan 12, 2026"`.
|
|
416
|
+
*/
|
|
417
|
+
rangeSelected: string;
|
|
402
418
|
}
|
|
403
419
|
interface TimePickerLabels {
|
|
404
420
|
timeInput: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -234,9 +234,15 @@ declare function to24Hour(hours12: number, period: 'AM' | 'PM'): number;
|
|
|
234
234
|
declare function generateHours(format?: '12h' | '24h'): number[];
|
|
235
235
|
/**
|
|
236
236
|
* Builds a minutes list at the given step.
|
|
237
|
-
*
|
|
238
|
-
* step=
|
|
239
|
-
* step=
|
|
237
|
+
*
|
|
238
|
+
* - `step=1` → `[0, 1, 2, ..., 59]`
|
|
239
|
+
* - `step=15` → `[0, 15, 30, 45]`
|
|
240
|
+
* - `step=5` → `[0, 5, 10, ..., 55]`
|
|
241
|
+
* - `step=45` → `[0, 45]`
|
|
242
|
+
* - `step=60` → `[0]` (on-the-hour only)
|
|
243
|
+
*
|
|
244
|
+
* Steps above 60 are rejected because they always collapse to `[0]` — useful UX
|
|
245
|
+
* is impossible past that point.
|
|
240
246
|
*/
|
|
241
247
|
declare function generateMinutes(step?: number): number[];
|
|
242
248
|
/**
|
|
@@ -399,6 +405,16 @@ interface RangePickerLabels extends DatePickerLabels {
|
|
|
399
405
|
startInput: string;
|
|
400
406
|
endInput: string;
|
|
401
407
|
presetsGroup: string;
|
|
408
|
+
/**
|
|
409
|
+
* Screen-reader prompt appended after the start date is picked, telling the user
|
|
410
|
+
* the next click commits the end of the range.
|
|
411
|
+
*/
|
|
412
|
+
selectingEnd: string;
|
|
413
|
+
/**
|
|
414
|
+
* Screen-reader prefix announced when both endpoints are committed, e.g.
|
|
415
|
+
* `"Range selected: Jan 5, 2026 – Jan 12, 2026"`.
|
|
416
|
+
*/
|
|
417
|
+
rangeSelected: string;
|
|
402
418
|
}
|
|
403
419
|
interface TimePickerLabels {
|
|
404
420
|
timeInput: string;
|
package/dist/index.js
CHANGED
|
@@ -444,8 +444,8 @@ function generateHours(format = "24h") {
|
|
|
444
444
|
return Array.from({ length: 24 }, (_, i) => i);
|
|
445
445
|
}
|
|
446
446
|
function generateMinutes(step = 1) {
|
|
447
|
-
if (step < 1 || step >
|
|
448
|
-
throw new Error(`[generateMinutes] step must be between 1 and
|
|
447
|
+
if (step < 1 || step > 60) {
|
|
448
|
+
throw new Error(`[generateMinutes] step must be between 1 and 60, got ${step}`);
|
|
449
449
|
}
|
|
450
450
|
const result = [];
|
|
451
451
|
for (let i = 0; i < 60; i += step) {
|
|
@@ -539,7 +539,9 @@ var DEFAULT_RANGEPICKER_LABELS = {
|
|
|
539
539
|
popoverLabel: "Choose date range",
|
|
540
540
|
startInput: "Start date",
|
|
541
541
|
endInput: "End date",
|
|
542
|
-
presetsGroup: "Date range presets"
|
|
542
|
+
presetsGroup: "Date range presets",
|
|
543
|
+
selectingEnd: "Now select end date",
|
|
544
|
+
rangeSelected: "Range selected"
|
|
543
545
|
};
|
|
544
546
|
var DEFAULT_TIMEPICKER_LABELS = {
|
|
545
547
|
timeInput: "Time",
|
package/package.json
CHANGED