@at5/kairo 0.2.1 → 0.2.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 +16 -0
- package/README.md +5 -130
- package/dist/index.cjs +6 -1428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -297
- package/dist/index.d.ts +1 -297
- package/dist/index.js +1 -1427
- package/dist/index.js.map +1 -1
- package/package.json +6 -34
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @at5/kairo
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Axis lift-and-shift: publish DatePicker under `@at5/axis-datepicker`.
|
|
8
|
+
|
|
9
|
+
- Add `@at5/axis-datepicker` — same DatePicker API and behavior as `@at5/kairo` (migrated from `packages/kairo` to `packages/datepicker`)
|
|
10
|
+
- Add `@at5/axis` — aggregator re-exporting `DatePicker`
|
|
11
|
+
- `@at5/kairo` — deprecated; thin re-export of `@at5/axis-datepicker` for transition
|
|
12
|
+
- Docs site and playground now depend on `@at5/axis-datepicker`
|
|
13
|
+
|
|
14
|
+
**Migration:** replace `@at5/kairo` with `@at5/axis-datepicker` (or `@at5/axis`). No API changes.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @at5/axis-datepicker@0.3.0
|
|
18
|
+
|
|
3
19
|
## 0.2.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,138 +1,13 @@
|
|
|
1
1
|
# @at5/kairo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Deprecated.** Use [`@at5/axis-datepicker`](https://www.npmjs.com/package/@at5/axis-datepicker) instead.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **Calendar** — WAI-ARIA grid pattern with roving focus and full keyboard navigation
|
|
8
|
-
- **Date Picker** — Input + popover calendar, semantic HTML only
|
|
9
|
-
- **Date Range Picker** — Dual-endpoint selection with live hover preview and optional presets
|
|
10
|
-
- **Date Field** — Segmented spinbutton input (day/month/year), no calendar required
|
|
11
|
-
- Locale-aware: respects week start day, date format order, and RTL scripts
|
|
12
|
-
- Unstyled — bring your own CSS
|
|
13
|
-
- React 19+, TypeScript-first
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
5
|
+
This package re-exports `@at5/axis-datepicker` for transition only.
|
|
16
6
|
|
|
17
7
|
```bash
|
|
18
|
-
npm install @at5/
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Quick Start
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { DatePicker } from "@at5/kairo";
|
|
25
|
-
|
|
26
|
-
function App() {
|
|
27
|
-
return (
|
|
28
|
-
<DatePicker.Root>
|
|
29
|
-
<DatePicker.Trigger>Pick a date</DatePicker.Trigger>
|
|
30
|
-
<DatePicker.Content>
|
|
31
|
-
<DatePicker.Calendar />
|
|
32
|
-
</DatePicker.Content>
|
|
33
|
-
</DatePicker.Root>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Components
|
|
39
|
-
|
|
40
|
-
### Calendar
|
|
41
|
-
|
|
42
|
-
Standalone month grid with keyboard navigation.
|
|
43
|
-
|
|
44
|
-
```tsx
|
|
45
|
-
import { Calendar } from "@at5/kairo";
|
|
46
|
-
|
|
47
|
-
<Calendar.Root locale="en-US" onValueChange={(date) => console.log(date)} />;
|
|
8
|
+
npm install @at5/axis-datepicker
|
|
48
9
|
```
|
|
49
10
|
|
|
50
|
-
**Props:** `value`, `defaultValue`, `onValueChange`, `locale`, `weekStartsOn`, `min`, `max`, `isDateUnavailable`, `numberOfMonths`
|
|
51
|
-
|
|
52
|
-
**Data attributes:** `[data-selected]`, `[data-today]`, `[data-outside-range]`, `[data-disabled]`
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
### Date Picker
|
|
57
|
-
|
|
58
|
-
Text input paired with a calendar popover.
|
|
59
|
-
|
|
60
11
|
```tsx
|
|
61
|
-
import { DatePicker } from "@at5/
|
|
62
|
-
|
|
63
|
-
<DatePicker.Root locale="en-US" onValueChange={(date) => console.log(date)}>
|
|
64
|
-
<DatePicker.Trigger />
|
|
65
|
-
<DatePicker.Content>
|
|
66
|
-
<DatePicker.Calendar />
|
|
67
|
-
</DatePicker.Content>
|
|
68
|
-
</DatePicker.Root>;
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Props:** `value`, `defaultValue`, `onValueChange`, `open`, `onOpenChange`, `locale`, `format`, `closeOnSelect`, `placement`
|
|
72
|
-
|
|
73
|
-
**Keyboard:** `Enter`/`Space` opens popover, `Escape` closes, arrow keys navigate calendar.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
### Date Range Picker
|
|
78
|
-
|
|
79
|
-
Selects a start and end date with optional night presets.
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
import { DateRangePicker } from "@at5/kairo";
|
|
83
|
-
|
|
84
|
-
<DateRangePicker.Root locale="en-US" onValueChange={({ start, end }) => console.log(start, end)}>
|
|
85
|
-
<DateRangePicker.Trigger />
|
|
86
|
-
<DateRangePicker.Content>
|
|
87
|
-
<DateRangePicker.Calendar />
|
|
88
|
-
</DateRangePicker.Content>
|
|
89
|
-
</DateRangePicker.Root>;
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Props:** `value`, `defaultValue`, `onValueChange`, `minNights`, `maxNights`, `presets`, `locale`
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
### Date Field
|
|
97
|
-
|
|
98
|
-
Segmented spinbutton input — no popover, locale-aware segment order.
|
|
99
|
-
|
|
100
|
-
```tsx
|
|
101
|
-
import { DateField } from "@at5/kairo";
|
|
102
|
-
|
|
103
|
-
<DateField.Root locale="en-US" onValueChange={(date) => console.log(date)}>
|
|
104
|
-
<DateField.Segment segment="month" />
|
|
105
|
-
<DateField.Literal>/</DateField.Literal>
|
|
106
|
-
<DateField.Segment segment="day" />
|
|
107
|
-
<DateField.Literal>/</DateField.Literal>
|
|
108
|
-
<DateField.Segment segment="year" />
|
|
109
|
-
</DateField.Root>;
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Props:** `value`, `defaultValue`, `onValueChange`, `locale`, `granularity`, `min`, `max`
|
|
113
|
-
|
|
114
|
-
**Keyboard:** `↑`/`↓` increments/decrements the focused segment, `Tab` advances to next segment.
|
|
115
|
-
|
|
116
|
-
## Localization
|
|
117
|
-
|
|
118
|
-
All components accept a `locale` prop compatible with `Intl.Locale`. Week start day, month/day/year order, and calendar display adapt automatically.
|
|
119
|
-
|
|
120
|
-
```tsx
|
|
121
|
-
// Arabic RTL
|
|
122
|
-
<DatePicker.Root locale="ar" />
|
|
123
|
-
|
|
124
|
-
// Brazilian Portuguese
|
|
125
|
-
<DatePicker.Root locale="pt-BR" />
|
|
126
|
-
|
|
127
|
-
// Japanese
|
|
128
|
-
<DatePicker.Root locale="ja-JP" />
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Requirements
|
|
132
|
-
|
|
133
|
-
- React `>=19.0.0`
|
|
134
|
-
- Node.js `>=22`
|
|
135
|
-
|
|
136
|
-
## License
|
|
137
|
-
|
|
138
|
-
MIT
|
|
12
|
+
import { DatePicker } from "@at5/axis-datepicker";
|
|
13
|
+
```
|