@at5/kairo 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +138 -0
  3. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @at5/kairo
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - cad8443: Improve README with full API reference and accurate dependency description
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Minor Changes
package/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # @at5/kairo
2
+
3
+ Headless date & scheduling primitives for React. Built on top of the native `Intl` API, timescape and Floating UI — with full keyboard navigation and WAI-ARIA compliance.
4
+
5
+ ## Features
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
16
+
17
+ ```bash
18
+ npm install @at5/kairo
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)} />;
48
+ ```
49
+
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
+ ```tsx
61
+ import { DatePicker } from "@at5/kairo";
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
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@at5/kairo",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Headless date & scheduling primitives for React",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/allysontsoares/primitives",
8
+ "directory": "packages/kairo"
9
+ },
5
10
  "files": [
6
11
  "dist",
7
12
  "README.md",
@@ -19,11 +24,6 @@
19
24
  "require": "./dist/index.cjs"
20
25
  }
21
26
  },
22
- "repository": {
23
- "type": "git",
24
- "url": "https://github.com/allysontsoares/primitives",
25
- "directory": "packages/kairo"
26
- },
27
27
  "publishConfig": {
28
28
  "access": "public",
29
29
  "provenance": true