jenosize-ui 0.1.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.
Files changed (182) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +100 -0
  3. package/THIRD-PARTY-NOTICES.md +163 -0
  4. package/dist/Button-Bt7pzM4R.d.ts +82 -0
  5. package/dist/PaymentInput-CKPIPNWH.d.ts +141 -0
  6. package/dist/Select-CVbEQ2Ep.d.ts +118 -0
  7. package/dist/TagInput-CTJYOB4J.d.ts +90 -0
  8. package/dist/avatar.d.ts +161 -0
  9. package/dist/avatar.js +11 -0
  10. package/dist/badge.d.ts +109 -0
  11. package/dist/badge.js +10 -0
  12. package/dist/breadcrumb.d.ts +58 -0
  13. package/dist/breadcrumb.js +7 -0
  14. package/dist/button.d.ts +54 -0
  15. package/dist/button.js +14 -0
  16. package/dist/calendar.d.ts +368 -0
  17. package/dist/calendar.js +21 -0
  18. package/dist/callout.d.ts +70 -0
  19. package/dist/callout.js +16 -0
  20. package/dist/card-nWicloNi.d.ts +80 -0
  21. package/dist/card.d.ts +2 -0
  22. package/dist/card.js +7 -0
  23. package/dist/checkbox.d.ts +133 -0
  24. package/dist/checkbox.js +11 -0
  25. package/dist/chunk-24TO7E32.js +42 -0
  26. package/dist/chunk-3Y5X7B5C.js +146 -0
  27. package/dist/chunk-4OLULPQG.js +202 -0
  28. package/dist/chunk-4P2NBLBW.js +103 -0
  29. package/dist/chunk-52IFGFTL.js +11 -0
  30. package/dist/chunk-5FATN5YD.js +115 -0
  31. package/dist/chunk-5NOBSXJN.js +297 -0
  32. package/dist/chunk-5RAPA22E.js +106 -0
  33. package/dist/chunk-7EUAMHMU.js +16 -0
  34. package/dist/chunk-7EWQKTNQ.js +1336 -0
  35. package/dist/chunk-7HOIZ3UO.js +110 -0
  36. package/dist/chunk-7IU5TMFL.js +452 -0
  37. package/dist/chunk-7JBNLEJ7.js +29 -0
  38. package/dist/chunk-7S2TBALK.js +23 -0
  39. package/dist/chunk-BJUZVYQC.js +188 -0
  40. package/dist/chunk-BVJWBYIG.js +66 -0
  41. package/dist/chunk-CME4DIML.js +65 -0
  42. package/dist/chunk-CYPPEUX5.js +73 -0
  43. package/dist/chunk-D5BTFSL7.js +71 -0
  44. package/dist/chunk-D6TPWNRK.js +387 -0
  45. package/dist/chunk-DJSXIAFH.js +66 -0
  46. package/dist/chunk-DRZCJCBO.js +46 -0
  47. package/dist/chunk-DWKILXHE.js +17 -0
  48. package/dist/chunk-E7ZSWBAK.js +70 -0
  49. package/dist/chunk-EDSK6FEH.js +8 -0
  50. package/dist/chunk-F2K7VJUV.js +114 -0
  51. package/dist/chunk-F6NLE6XJ.js +40 -0
  52. package/dist/chunk-FHHAPGCR.js +32 -0
  53. package/dist/chunk-FXIBGTS5.js +14 -0
  54. package/dist/chunk-GCVA3OIV.js +72 -0
  55. package/dist/chunk-GFOAJVW5.js +336 -0
  56. package/dist/chunk-GRLSUQQE.js +136 -0
  57. package/dist/chunk-GTHJWR3Q.js +77 -0
  58. package/dist/chunk-HMUZE6EK.js +67 -0
  59. package/dist/chunk-I7WU4GTY.js +503 -0
  60. package/dist/chunk-J2BCKBHC.js +151 -0
  61. package/dist/chunk-J36M3KRX.js +1315 -0
  62. package/dist/chunk-J7ZQQFPT.js +113 -0
  63. package/dist/chunk-JP26LPCY.js +234 -0
  64. package/dist/chunk-JTNFJLIY.js +1046 -0
  65. package/dist/chunk-JVJRHBTD.js +50 -0
  66. package/dist/chunk-JYGR44ZC.js +133 -0
  67. package/dist/chunk-KDLPXXD2.js +173 -0
  68. package/dist/chunk-KMSYEE23.js +224 -0
  69. package/dist/chunk-KNYKWUYX.js +52 -0
  70. package/dist/chunk-LME57Z6J.js +138 -0
  71. package/dist/chunk-MFJP5FA7.js +20 -0
  72. package/dist/chunk-MKC5HNA7.js +1692 -0
  73. package/dist/chunk-MQGD2OUF.js +39 -0
  74. package/dist/chunk-MUFHLP4S.js +566 -0
  75. package/dist/chunk-O2LG3PNI.js +74 -0
  76. package/dist/chunk-O4GRKO3I.js +66 -0
  77. package/dist/chunk-OHUFNYGN.js +791 -0
  78. package/dist/chunk-PWKWNDBS.js +243 -0
  79. package/dist/chunk-QA74ITR4.js +103 -0
  80. package/dist/chunk-R6RGJF4L.js +170 -0
  81. package/dist/chunk-S7NNXWIN.js +7 -0
  82. package/dist/chunk-SV56BSUQ.js +162 -0
  83. package/dist/chunk-T7FCG7XV.js +435 -0
  84. package/dist/chunk-THC2ISYP.js +57 -0
  85. package/dist/chunk-VWC72TR3.js +115 -0
  86. package/dist/chunk-W46K56XU.js +216 -0
  87. package/dist/chunk-W5GGOUUI.js +75 -0
  88. package/dist/chunk-WEUJYDCV.js +269 -0
  89. package/dist/chunk-WFY7DKQD.js +279 -0
  90. package/dist/chunk-WZQFC7ZN.js +448 -0
  91. package/dist/chunk-Z3ETJN5G.js +136 -0
  92. package/dist/chunk-ZOOX3TUB.js +192 -0
  93. package/dist/chunk-ZSNJ6UA3.js +42 -0
  94. package/dist/chunk-ZZA2LUTL.js +130 -0
  95. package/dist/chunk-ZZT2E5VT.js +24 -0
  96. package/dist/color-CtSxc1Rh.d.ts +6 -0
  97. package/dist/combobox.d.ts +184 -0
  98. package/dist/combobox.js +21 -0
  99. package/dist/date-input.d.ts +83 -0
  100. package/dist/date-input.js +16 -0
  101. package/dist/date-picker.d.ts +249 -0
  102. package/dist/date-picker.js +29 -0
  103. package/dist/date-utils-7hTFTXNK.d.ts +34 -0
  104. package/dist/date-vMJBKAFK.d.ts +22 -0
  105. package/dist/dialog.d.ts +86 -0
  106. package/dist/dialog.js +15 -0
  107. package/dist/drawer.d.ts +77 -0
  108. package/dist/drawer.js +14 -0
  109. package/dist/dropdown-menu.d.ts +218 -0
  110. package/dist/dropdown-menu.js +10 -0
  111. package/dist/file-trigger.d.ts +42 -0
  112. package/dist/file-trigger.js +3 -0
  113. package/dist/form.d.ts +487 -0
  114. package/dist/form.js +1179 -0
  115. package/dist/header-navigation.d.ts +74 -0
  116. package/dist/header-navigation.js +23 -0
  117. package/dist/icons/app.d.ts +48 -0
  118. package/dist/icons/app.js +282 -0
  119. package/dist/icons/flag.d.ts +817 -0
  120. package/dist/icons/flag.js +58336 -0
  121. package/dist/icons/integration.d.ts +36 -0
  122. package/dist/icons/integration.js +531 -0
  123. package/dist/icons/payment.d.ts +116 -0
  124. package/dist/icons/payment.js +2418 -0
  125. package/dist/icons.d.ts +2013 -0
  126. package/dist/icons.js +2012 -0
  127. package/dist/illustration.d.ts +48 -0
  128. package/dist/illustration.js +4 -0
  129. package/dist/index.d.ts +68 -0
  130. package/dist/index.js +73 -0
  131. package/dist/indicator.d.ts +51 -0
  132. package/dist/indicator.js +7 -0
  133. package/dist/input.d.ts +66 -0
  134. package/dist/input.js +15 -0
  135. package/dist/multi-value-CJb_tnvi.d.ts +8 -0
  136. package/dist/nav-Bla0o_-1.d.ts +98 -0
  137. package/dist/number-input.d.ts +80 -0
  138. package/dist/number-input.js +15 -0
  139. package/dist/options-CPEIgjtd.d.ts +68 -0
  140. package/dist/overflow-Df0h42Oi.d.ts +29 -0
  141. package/dist/pagination.d.ts +77 -0
  142. package/dist/pagination.js +17 -0
  143. package/dist/payment-input.d.ts +7 -0
  144. package/dist/payment-input.js +15 -0
  145. package/dist/popover.d.ts +60 -0
  146. package/dist/popover.js +14 -0
  147. package/dist/progress.d.ts +87 -0
  148. package/dist/progress.js +5 -0
  149. package/dist/radio.d.ts +77 -0
  150. package/dist/radio.js +12 -0
  151. package/dist/select.d.ts +68 -0
  152. package/dist/select.js +24 -0
  153. package/dist/shared-BNXAdgh2.d.ts +9 -0
  154. package/dist/shared-BYXJPnsN.d.ts +11 -0
  155. package/dist/shared-Dc-GgA16.d.ts +42 -0
  156. package/dist/sidebar-navigation.d.ts +129 -0
  157. package/dist/sidebar-navigation.js +15 -0
  158. package/dist/styles.css +2 -0
  159. package/dist/switch.d.ts +23 -0
  160. package/dist/switch.js +7 -0
  161. package/dist/table.d.ts +692 -0
  162. package/dist/table.js +44 -0
  163. package/dist/tabs.d.ts +111 -0
  164. package/dist/tabs.js +8 -0
  165. package/dist/tag-input.d.ts +12 -0
  166. package/dist/tag-input.js +19 -0
  167. package/dist/tag.d.ts +98 -0
  168. package/dist/tag.js +9 -0
  169. package/dist/textarea.d.ts +40 -0
  170. package/dist/textarea.js +12 -0
  171. package/dist/theme-script.d.ts +29 -0
  172. package/dist/theme-script.js +15 -0
  173. package/dist/theme.css +929 -0
  174. package/dist/theme.d.ts +71 -0
  175. package/dist/theme.js +15 -0
  176. package/dist/toast.d.ts +242 -0
  177. package/dist/toast.js +15 -0
  178. package/dist/tooltip.d.ts +70 -0
  179. package/dist/tooltip.js +6 -0
  180. package/dist/tree.d.ts +308 -0
  181. package/dist/tree.js +11 -0
  182. package/package.json +352 -0
@@ -0,0 +1,368 @@
1
+ import * as React from 'react';
2
+ import { S as SemanticColor } from './color-CtSxc1Rh.js';
3
+ import { W as WeekStart } from './date-vMJBKAFK.js';
4
+ import { Locale } from 'date-fns';
5
+ import { E as Era } from './date-utils-7hTFTXNK.js';
6
+
7
+ type CalendarView = "month" | "week" | "day" | "agenda";
8
+ type CalendarSize = "sm" | "md" | "lg";
9
+ /**
10
+ * Snap granularity, in minutes — **one knob for three things**: the vertical snap step, the range
11
+ * `onSlotClick` emits, and the grab-mode arrow step. A closed set rather than a `number`, because
12
+ * each member also fixes how many rows an hour draws; an arbitrary 7 would render 8.57 rows.
13
+ */
14
+ type SlotDuration = 15 | 30 | 60;
15
+ /**
16
+ * The layout contract an event must satisfy. **Extend it** with your own payload and the generic
17
+ * carries that payload through every callback:
18
+ *
19
+ * ```ts
20
+ * interface Booking extends CalendarEvent { guestId: string }
21
+ * const cal = useCalendar<Booking>({ events, onEventClick: (e) => e.guestId });
22
+ * ```
23
+ *
24
+ * An extensible interface plus a generic rather than Table-style accessor props (`getEventStart`),
25
+ * because a calendar genuinely *requires* these four fields — there is no calendar without a start
26
+ * and an end — so there is nothing for an accessor to make optional.
27
+ */
28
+ interface CalendarEvent {
29
+ id: string;
30
+ title: string;
31
+ /**
32
+ * When it starts. A **UTC instant** — except when `allDay`, where it carries DATE semantics
33
+ * instead. See `serialize.ts`; the two are serialized differently and mixing them ships the
34
+ * wrong day.
35
+ */
36
+ start: Date;
37
+ /** When it ends. Same semantics as {@link CalendarEvent.start}. */
38
+ end: Date;
39
+ /**
40
+ * A whole-day event: `start`/`end` carry **date** semantics, not instants, and it renders in the
41
+ * all-day row rather than the timed grid. See `serialize.ts`.
42
+ */
43
+ allDay?: boolean;
44
+ /** Chip colour, from the library's six-tone axis. @default "brand" */
45
+ color?: SemanticColor;
46
+ /** Leading chip node — an `<Indicator>` status dot, an `<Avatar>`. Keeps its own a11y semantics. */
47
+ leading?: React.ReactNode;
48
+ /** Trailing chip node — a `<Badge seamless>` count. Keeps its own a11y semantics. */
49
+ trailing?: React.ReactNode;
50
+ /** Not draggable, not resizable, and rendered muted. */
51
+ disabled?: boolean;
52
+ }
53
+ /**
54
+ * The resolved config **every geometry function takes**, assembled once by the hook.
55
+ *
56
+ * One object rather than six parameters so a new axis is a field, not a signature change across
57
+ * fifteen call sites — and so the memo key is one identity.
58
+ */
59
+ interface CalendarConfig {
60
+ /** A validated IANA zone (never `undefined` — the hook resolves it). */
61
+ timeZone: string;
62
+ locale: Locale;
63
+ /** The resolved week start — a concrete member, never `undefined`. */
64
+ weekStartsOn: WeekStart;
65
+ era: Era;
66
+ /** The visible hour window, `[startHour, endHour)`. */
67
+ hours: [number, number];
68
+ slotDuration: SlotDuration;
69
+ /** "Now", pinned by the hook so SSR, stories and baselines are deterministic. */
70
+ now: Date;
71
+ }
72
+ /** One day cell of a grid. `key` is the `dayKey` bucket; `date` is that day's local midnight. */
73
+ interface CalendarDay {
74
+ key: string;
75
+ date: Date;
76
+ /** Outside the focused month — month view greys these. Always `false` in week/day. */
77
+ outside: boolean;
78
+ /** Same `dayKey` as `config.now`. */
79
+ today: boolean;
80
+ }
81
+ /** A timed event positioned in a week/day column by {@link packOverlaps}. */
82
+ interface PositionedEvent<E extends CalendarEvent> {
83
+ event: E;
84
+ /** Minutes from the window start, clamped to the visible window. */
85
+ startMinutes: number;
86
+ endMinutes: number;
87
+ /** Column index within its overlap cluster, and the cluster's width. */
88
+ column: number;
89
+ columns: number;
90
+ /** `dayKey` of the column it belongs to. */
91
+ dayKey: string;
92
+ }
93
+ /**
94
+ * One horizontal run of a multi-day (or all-day) event within one week row.
95
+ *
96
+ * An event spanning Tue → next Mon becomes **two** segments, which is what lets a bar render as one
97
+ * element per week instead of N day-chips. `isStart`/`isEnd` drive which end gets a rounded corner
98
+ * and which gets a continuation chevron.
99
+ */
100
+ interface LaneSegment<E extends CalendarEvent> {
101
+ event: E;
102
+ /**
103
+ * Which of the `rows` this segment belongs to.
104
+ *
105
+ * Emitted rather than left implicit in the output order. The view has to place each bar in its own
106
+ * row's grid, and recovering the row by matching day indices afterwards is not actually possible —
107
+ * two rows can hold the same `dayIndex` for the same event id in different weeks.
108
+ */
109
+ rowIndex: number;
110
+ /** Index of the first day it covers, within that week row. */
111
+ dayIndex: number;
112
+ /** How many days it covers in this row (≥ 1). */
113
+ span: number;
114
+ /** Vertical lane, so bars in one week don't collide. */
115
+ lane: number;
116
+ /** This segment holds the event's real start / real end (vs a week-boundary cut). */
117
+ isStart: boolean;
118
+ isEnd: boolean;
119
+ }
120
+ /** {@link laneMultiDay}'s result: the placeable segments, plus what didn't fit, per day. */
121
+ interface LaneResult<E extends CalendarEvent> {
122
+ segments: readonly LaneSegment<E>[];
123
+ /** Count of events hidden by the lane budget, keyed by `dayKey` — month view's "+N more". */
124
+ overflow: ReadonlyMap<string, number>;
125
+ /** The events behind that count, keyed by `dayKey`, so the popover can list them. */
126
+ hidden: ReadonlyMap<string, readonly E[]>;
127
+ /** Highest lane actually used, so a row can size itself. `-1` when there are no segments. */
128
+ maxLane: number;
129
+ }
130
+ /** A day's events, for agenda view. */
131
+ interface DayGroup<E extends CalendarEvent> {
132
+ key: string;
133
+ date: Date;
134
+ events: readonly E[];
135
+ }
136
+ /** A drag in progress: the snapped range, and the event being moved (`null` while creating). */
137
+ interface CalendarDraft<E extends CalendarEvent> {
138
+ kind: "move" | "resize" | "create";
139
+ event: E | null;
140
+ start: Date;
141
+ end: Date;
142
+ allDay: boolean;
143
+ /** False while `canPlace` refuses this position — the ghost renders invalid and the drop is refused. */
144
+ valid: boolean;
145
+ }
146
+
147
+ /** Everything a view needs to draw, derived per view. One object so the memo has one identity. */
148
+ interface CalendarLayout<E extends CalendarEvent> {
149
+ /** Month view's 6 × 7 rows. Empty for the other views. */
150
+ monthRows: readonly (readonly CalendarDay[])[];
151
+ /** The day columns week/day view draws, in order. */
152
+ days: readonly CalendarDay[];
153
+ /** Timed events, packed into overlap columns, keyed by `dayKey`. */
154
+ timed: ReadonlyMap<string, readonly PositionedEvent<E>[]>;
155
+ /** Multi-day / all-day bars — month's spanning bars AND week/day's all-day row, from ONE call. */
156
+ lanes: LaneResult<E>;
157
+ /** Agenda view's day groups. Empty for the other views. */
158
+ groups: readonly DayGroup<E>[];
159
+ }
160
+ interface UseCalendarOptions<E extends CalendarEvent> {
161
+ /** The events to draw. Extend `CalendarEvent` and the generic carries your payload everywhere. */
162
+ events: readonly E[];
163
+ /** Controlled view. @default "month" */
164
+ view?: CalendarView;
165
+ /** Uncontrolled initial view. @default "month" */
166
+ defaultView?: CalendarView;
167
+ /** Fires whenever the view changes. */
168
+ onViewChange?: (view: CalendarView) => void;
169
+ /** Controlled focused date — the period the grid draws. */
170
+ focusedDate?: Date;
171
+ /** Uncontrolled initial focused date. @default `now` */
172
+ defaultFocusedDate?: Date;
173
+ /** Fires whenever the focused date changes (prev / next / today / setFocusedDate). */
174
+ onFocusedDateChange?: (date: Date) => void;
175
+ /** IANA zone the grid draws in. @default the resolved local zone */
176
+ timeZone?: string;
177
+ /** date-fns locale object — drives the weekday names, the month caption and the printed formats.
178
+ * It does **not** drive the week start; that is {@link weekStartsOn}. @default enUS */
179
+ locale?: Locale;
180
+ /** Which day the week grid starts on. `"locale"` defers to the date-fns locale's own week start
181
+ * (Sunday for `enUS`, `ja` and `th`; Monday for `enGB` and `de`). @default "monday" */
182
+ weekStartsOn?: WeekStart;
183
+ /** Display era. `"be"` shifts only the PRINTED year; every emitted `Date` stays CE. @default "ce" */
184
+ era?: Era;
185
+ /**
186
+ * Pin "now" for SSR determinism, a deterministic story, or a visual baseline. A pinned value is
187
+ * **frozen**; left unset, "now" is captured once per mount and then advances every minute.
188
+ * @default new Date(), ticking each minute
189
+ */
190
+ now?: Date;
191
+ /** The visible hour window, `[startHour, endHour)`. @default [0, 24] */
192
+ hours?: [number, number];
193
+ /** Snap granularity in minutes — the snap step, the `onSlotClick` range, and the grab step. @default 30 */
194
+ slotDuration?: SlotDuration;
195
+ /** A chip was activated. Receives your own event type. */
196
+ onEventClick?: (event: E) => void;
197
+ /** An empty slot / day cell was activated, or a create sweep was released. Bounds are snapped. */
198
+ onSlotClick?: (range: {
199
+ start: Date;
200
+ end: Date;
201
+ allDay: boolean;
202
+ }) => void;
203
+ /** A drag or grab-mode move committed. `next` is the snapped destination. */
204
+ onEventChange?: (event: E, next: {
205
+ start: Date;
206
+ end: Date;
207
+ }) => void;
208
+ /** Veto a destination. While it returns `false` the ghost renders invalid and the drop is refused. */
209
+ canPlace?: (draft: {
210
+ event: E | null;
211
+ start: Date;
212
+ end: Date;
213
+ allDay: boolean;
214
+ }) => boolean;
215
+ }
216
+ interface UseCalendarResult<E extends CalendarEvent> {
217
+ view: CalendarView;
218
+ setView: (view: CalendarView) => void;
219
+ focusedDate: Date;
220
+ setFocusedDate: (date: Date) => void;
221
+ prev: () => void;
222
+ next: () => void;
223
+ today: () => void;
224
+ /** Locale-, era- and zone-aware, and different per view. `"August 2026"` · `"Aug 3 – 9, 2026"`. */
225
+ periodLabel: string;
226
+ /**
227
+ * The same period as an explicit **span**, both ends spelled in full —
228
+ * `"Aug 1, 2026 – Aug 31, 2026"`. The second line of a two-line toolbar heading.
229
+ *
230
+ * Month view spans the MONTH, not the 6×7 grid the month is drawn on. Here for the same reason
231
+ * `periodLabel` is: it needs date-fns, the configured zone and era handling, none of which a
232
+ * caller has — `formatIn` is not a public export.
233
+ */
234
+ rangeLabel: string;
235
+ /**
236
+ * The focused date's **month**, in every view — `"August 2026"`.
237
+ *
238
+ * The heading line above `rangeLabel`. Distinct from `periodLabel`, which names the period in
239
+ * month/day view but spans it in week/agenda — so a week-view heading built from `periodLabel`
240
+ * plus `rangeLabel` said the same thing twice. This one is always the name.
241
+ */
242
+ monthLabel: string;
243
+ /** Which week of its month the focused date is in — `"Week 1"`. Days 1–7 are week 1, and so on. */
244
+ weekLabel: string;
245
+ /**
246
+ * **Today**, split for a two-line date chip — `{ month: "Aug", day: "6" }`.
247
+ *
248
+ * Always `now`, never the focused date, so the chip stays a fixed "you are here" marker while you
249
+ * navigate. Pair it with `today()`.
250
+ */
251
+ todayLabel: {
252
+ month: string;
253
+ day: string;
254
+ };
255
+ visibleRange: {
256
+ start: Date;
257
+ end: Date;
258
+ };
259
+ visibleEvents: readonly E[];
260
+ /** The resolved timeZone / locale / era / hours / slotDuration / now. */
261
+ config: CalendarConfig;
262
+ layout: CalendarLayout<E>;
263
+ draft: CalendarDraft<E> | null;
264
+ setDraft: (draft: CalendarDraft<E> | null) => void;
265
+ grabbed: E | null;
266
+ setGrabbed: (event: E | null) => void;
267
+ /** Whether a destination is allowed. Always answerable — `true` when no `canPlace` was given. */
268
+ canPlace: (draft: {
269
+ event: E | null;
270
+ start: Date;
271
+ end: Date;
272
+ allDay: boolean;
273
+ }) => boolean;
274
+ /** The caller's handlers, always callable (no-ops when not supplied), so views need no guards. */
275
+ onEventClick: (event: E) => void;
276
+ onSlotClick: (range: {
277
+ start: Date;
278
+ end: Date;
279
+ allDay: boolean;
280
+ }) => void;
281
+ commit: (event: E, next: {
282
+ start: Date;
283
+ end: Date;
284
+ }) => void;
285
+ }
286
+ declare function useCalendar<E extends CalendarEvent>(options: UseCalendarOptions<E>): UseCalendarResult<E>;
287
+
288
+ /** What an event's dates look like on the wire. */
289
+ interface WireDates {
290
+ start: string;
291
+ end: string;
292
+ }
293
+ /**
294
+ * An event's dates, in the correct wire form for **its own** semantics.
295
+ *
296
+ * `allDay` → `"YYYY-MM-DD"` from the local calendar fields. Timed → `toISOString()`.
297
+ */
298
+ declare function serializeEvent<E extends CalendarEvent>(event: E): WireDates;
299
+ /**
300
+ * The inverse: wire strings → `Date`s carrying the matching semantics.
301
+ *
302
+ * A **date-only** string (`"2026-08-05"`, no `T`) is parsed as **local midnight**, deliberately — the
303
+ * one thing `new Date("2026-08-05")` gets wrong, because the JS spec parses a bare date-only ISO
304
+ * string as **UTC** midnight. In Bangkok that is 07:00 local, and in Honolulu it is 14:00 the previous
305
+ * day, so the round trip through `serializeEvent` would come back a day early exactly where it
306
+ * matters. An instant string goes through `new Date` untouched.
307
+ */
308
+ declare function parseEvent<T extends WireDates>(raw: T): {
309
+ start: Date;
310
+ end: Date;
311
+ };
312
+ /** True when a wire string carries DATE semantics rather than instant semantics. */ declare function isWireDate(value: string): boolean;
313
+
314
+ interface CalendarProps<E extends CalendarEvent> {
315
+ /**
316
+ * The `useCalendar()` instance — **required and exclusive.**
317
+ *
318
+ * There is no `events` / `view` / `focusedDate` / `timeZone` prop beside it, and that is the point:
319
+ * a second channel means props that are silently dead (whichever half is not driving reads them and
320
+ * nothing happens) and duplicates that can disagree. The instance echoes back everything a view
321
+ * needs, so there is nothing to reconcile. Same posture `<Table>` holds with `useTable()`; see
322
+ * `docs/api-policy.md` § one state owner, enforced by `pnpm state:check`.
323
+ */
324
+ instance: UseCalendarResult<E>;
325
+ /** The house size ladder — slot height, cell height, chip type scale. @default "md" */
326
+ size?: CalendarSize;
327
+ /** Draw the current-time rule in week and day view. @default true */
328
+ showNowLine?: boolean;
329
+ /** Layout/spacing only, merged via `cn()`. Cannot restyle a chip or a grid line. */
330
+ className?: string;
331
+ /** Accessible name for the grid. */
332
+ "aria-label"?: string;
333
+ }
334
+ /**
335
+ * An event calendar: **month · week · day · agenda**, on a `useCalendar()` instance.
336
+ *
337
+ * ```tsx
338
+ * const cal = useCalendar({ events });
339
+ * <Calendar instance={cal} />
340
+ * ```
341
+ *
342
+ * ## The caller owns the toolbar
343
+ *
344
+ * There is no built-in header. The instance echoes `periodLabel` / `prev()` / `next()` / `today()` /
345
+ * `view` / `setView`, so a caller composes the toolbar out of the library's own `Button`, `Tabs` and
346
+ * `ButtonUtility` and needs no date-fns of its own. That is what earns the hook its keep.
347
+ *
348
+ * ## No box of its own
349
+ *
350
+ * The root carries type and layout only. The surface is the caller's — usually a `<Card>` — because a
351
+ * calendar is dropped into a page shell whose edge and elevation are already decided. Note that in
352
+ * week/day view the SCROLLER is a child of this root, never the Card: a full-bleed Card that is
353
+ * itself the scroller slides its `::after` hairline across the content.
354
+ *
355
+ * ## Responsive is pure CSS, and `cal.view` is never mutated
356
+ *
357
+ * The `@container` query lives on a wrapper `<div>` — an element can never match a container query
358
+ * against its own container, which is the bug that left `Pagination`'s `density` dead at the desktop
359
+ * tier for a week with every gate passing. Because it is CSS-only there is no `ResizeObserver`, no
360
+ * first-paint flash, no hydration mismatch, no `effectiveView`, and a caller's view switcher never
361
+ * visibly jumps to "Day".
362
+ */
363
+ declare function Calendar<E extends CalendarEvent>(props: CalendarProps<E>): React.JSX.Element;
364
+ declare namespace Calendar {
365
+ var displayName: string;
366
+ }
367
+
368
+ export { Calendar, type CalendarConfig, type CalendarDay, type CalendarEvent, type CalendarLayout, type CalendarProps, type CalendarSize, type CalendarView, Era, type SlotDuration, type UseCalendarOptions, type UseCalendarResult, WeekStart, type WireDates, isWireDate, parseEvent, serializeEvent, useCalendar };
@@ -0,0 +1,21 @@
1
+ "use client";export { Calendar, isWireDate, parseEvent, serializeEvent, useCalendar } from './chunk-J36M3KRX.js';
2
+ import './chunk-KMSYEE23.js';
3
+ import './chunk-5RAPA22E.js';
4
+ import './chunk-DRZCJCBO.js';
5
+ import './chunk-3Y5X7B5C.js';
6
+ import './chunk-CYPPEUX5.js';
7
+ import './chunk-J7ZQQFPT.js';
8
+ import './chunk-MFJP5FA7.js';
9
+ import './chunk-GFOAJVW5.js';
10
+ import './chunk-CME4DIML.js';
11
+ import './chunk-MQGD2OUF.js';
12
+ import './chunk-S7NNXWIN.js';
13
+ import './chunk-52IFGFTL.js';
14
+ import './chunk-O2LG3PNI.js';
15
+ import './chunk-EDSK6FEH.js';
16
+ import './chunk-24TO7E32.js';
17
+ import './chunk-O4GRKO3I.js';
18
+ import './chunk-GCVA3OIV.js';
19
+ import './chunk-ZSNJ6UA3.js';
20
+ //# sourceMappingURL=calendar.js.map
21
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1,70 @@
1
+ import * as React from 'react';
2
+ import { S as SemanticColor } from './color-CtSxc1Rh.js';
3
+ import { IllustrationType } from './illustration.js';
4
+
5
+ /**
6
+ * A full-panel state block: the final, intended UI for a region that has no content.
7
+ *
8
+ * It covers four situations that look identical and read differently — nothing matched a search,
9
+ * there is no data yet, a request failed, you are offline — so the component is one shape with a
10
+ * `tone` and a caller-supplied `icon`/copy rather than four components.
11
+ *
12
+ * **Naming.** `Callout` here is the FULL-PANEL block. An inline banner/alert (a form-level notice,
13
+ * a docs admonition) is a different component and must take a different name — `Banner` or
14
+ * `Notice`. Do not overload this one.
15
+ *
16
+ * Drop it into a `<Table empty>`, an empty tab, an empty list, a 404 body — anywhere a region
17
+ * would otherwise render nothing and leave the user wondering whether it broke.
18
+ */
19
+ interface CalloutAction {
20
+ label: string;
21
+ onClick?: () => void;
22
+ href?: string;
23
+ /**
24
+ * A node placed before the label — an icon, usually. It is handed straight to the `Button`'s own
25
+ * `leading` slot, so the caller owns its size AND its a11y semantics (a bare `<svg>` has no
26
+ * accessible name; anything that speaks keeps its voice). This file never renders it.
27
+ */
28
+ leading?: React.ReactNode;
29
+ /** `primary` is the one thing you want pressed; everything else is `secondary`. @default "secondary" */
30
+ variant?: "primary" | "secondary";
31
+ }
32
+ type CalloutSize = "sm" | "md" | "lg";
33
+ interface CalloutBaseProps {
34
+ /** The headline. Say what is true, not what is missing — "No approvals waiting" beats "Empty". */
35
+ title: React.ReactNode;
36
+ /** One line explaining what would put content here, or what to do next. */
37
+ description?: React.ReactNode;
38
+ /** @default "md" */
39
+ size?: CalloutSize;
40
+ /**
41
+ * Bounded action rows — a label plus a handler or an href. Deliberately not a node slot: an
42
+ * empty state offers a next step, it is not a layout surface.
43
+ */
44
+ actions?: readonly CalloutAction[];
45
+ /** Layout/spacing only. Never restyles internals. */
46
+ className?: string;
47
+ }
48
+ type CalloutVisual = {
49
+ /** A glyph, shown in a raised rounded-square container. Sized and tinted by the component. */
50
+ icon?: React.ReactNode;
51
+ /** Tints the icon container's GLYPH. The container itself is one treatment for every tone.
52
+ * @default "neutral" */
53
+ tone?: SemanticColor;
54
+ illustration?: never;
55
+ } | {
56
+ /**
57
+ * A full line-art drawing instead of a glyph — the page-scale visual. Sized from the
58
+ * Callout's own `size`, and always the reference gray, so there is no `tone` on this branch.
59
+ */
60
+ illustration: IllustrationType;
61
+ icon?: never;
62
+ tone?: never;
63
+ };
64
+ type CalloutProps = CalloutBaseProps & CalloutVisual;
65
+ declare function Callout({ title, description, icon, illustration, tone, size, actions, className }: CalloutProps): React.JSX.Element;
66
+ declare namespace Callout {
67
+ var displayName: string;
68
+ }
69
+
70
+ export { Callout, type CalloutAction, type CalloutProps, type CalloutSize, type CalloutVisual };
@@ -0,0 +1,16 @@
1
+ "use client";export { Callout } from './chunk-BVJWBYIG.js';
2
+ import './chunk-OHUFNYGN.js';
3
+ import './chunk-W46K56XU.js';
4
+ import './chunk-CME4DIML.js';
5
+ import './chunk-MQGD2OUF.js';
6
+ import './chunk-JVJRHBTD.js';
7
+ import './chunk-DWKILXHE.js';
8
+ import './chunk-KNYKWUYX.js';
9
+ import './chunk-52IFGFTL.js';
10
+ import './chunk-24TO7E32.js';
11
+ import './chunk-ZZA2LUTL.js';
12
+ import './chunk-O4GRKO3I.js';
13
+ import './chunk-GCVA3OIV.js';
14
+ import './chunk-ZSNJ6UA3.js';
15
+ //# sourceMappingURL=callout.js.map
16
+ //# sourceMappingURL=callout.js.map
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * The **in-flow card surface** — one recipe for every bordered/rounded panel that sits in the
5
+ * document flow, so the library stops shipping three spellings of the same box.
6
+ *
7
+ * Before this table there were three, and they disagreed on the edge technique alone:
8
+ * `table/shared.ts` used `ring-1 ring-secondary` + `shadow-xs`, `field/option-row.tsx` used
9
+ * `border border-secondary` + no shadow, and the playground had ~88 distinct strings approximating
10
+ * both. Each `SURFACE_VARIANT` member below reproduces one of those, so the axis is derived from
11
+ * what already shipped rather than invented.
12
+ *
13
+ * **Ring, never border.** `lib/color.ts`'s `OUTLINE` table already commits to `ring-1 ring-inset`
14
+ * for exactly this reason: a `border` adds to the box, so a bordered card renders 2px larger than a
15
+ * ringed sibling in the same row — the defect that got `Badge`'s `modern` variant deleted. Measured
16
+ * on the `bordered` option row: the old `border` recipe boxed 200×50, the inset-ring one 200×48.
17
+ * An inset ring paints *inside* the border-box, so a surface never changes size when its edge
18
+ * changes weight — and a heavier selected edge cannot bleed onto whatever sits next to it.
19
+ *
20
+ * **Not the overlay family.** Dialog / Drawer / Toast / the four listbox popups are a separate,
21
+ * already-consistent recipe — `ring-1 ring-secondary_alt ring-inset` + `shadow-lg`/`xl`, where the
22
+ * alpha `border-alt` hairline reads correctly over whatever the popup floats above. Floating
23
+ * elevation is a different concern from an in-flow card; do not merge them into this table.
24
+ *
25
+ * This module lives in `src/lib/` (not `src/components/`) so it is invisible to the dependency-graph
26
+ * gate — `field/` is FOUNDATION and may import only foundation, so it could not reach a
27
+ * `components/card/` module at all. Same reason `cn`, `slot` and `seamless` live here.
28
+ */
29
+ /** Which edge + fill the surface wears. */
30
+ type SurfaceVariant = "elevated" | "outlined" | "subtle";
31
+ /** The inner gutter. `none` means the caller owns all spacing (full-bleed content, e.g. a table). */
32
+ type SurfacePadding = "none" | "sm" | "md" | "lg";
33
+ declare const SURFACE_VARIANTS: readonly SurfaceVariant[];
34
+ declare const SURFACE_PADDINGS: readonly SurfacePadding[];
35
+
36
+ type CardVariant = SurfaceVariant;
37
+ type CardPadding = SurfacePadding;
38
+ /** `title` is a `ReactNode` here, which collides with the DOM's `title?: string` tooltip attribute. */
39
+ interface CardProps extends Omit<React.ComponentPropsWithoutRef<"div">, "title"> {
40
+ /**
41
+ * Edge + fill. Every member differs from its neighbours by FILL — `elevated` is a raised surface
42
+ * (+ `shadow-sm` in light, where a shadow can be seen) · `outlined` sits flush with the page,
43
+ * for a card nested in an already-elevated surface or repeated in a dense list · `subtle` is a
44
+ * sunken well that reads as background rather than as an object. @default "elevated"
45
+ */
46
+ variant?: CardVariant;
47
+ /**
48
+ * Inner gutter. `none` hands ALL spacing to the caller — use it for full-bleed content that must
49
+ * reach the radius (a table, a media header). @default "md"
50
+ */
51
+ padding?: CardPadding;
52
+ /**
53
+ * Draw a full-bleed hairline between the header and the body, and the body and the footer.
54
+ * @default false
55
+ */
56
+ dividers?: boolean;
57
+ /**
58
+ * The card's headline. A `ReactNode`, so pass a heading element (`<h3>`) when the card should sit
59
+ * in the document outline — the wrapper is a `<div>` precisely so that stays valid HTML.
60
+ */
61
+ title?: React.ReactNode;
62
+ /** One supporting line under the title. */
63
+ description?: React.ReactNode;
64
+ /** Leading header node — an `<Avatar>`, an icon. The node keeps its own a11y semantics. */
65
+ leading?: React.ReactNode;
66
+ /** Trailing header node — a `<Badge>`, a `<DropdownMenu>` trigger, an action `<Button>`. */
67
+ trailing?: React.ReactNode;
68
+ /** Footer row, below the body. */
69
+ footer?: React.ReactNode;
70
+ /** **Layout/spacing only** (width, margin, grid/flex), merged via `cn()`. Never restyles the surface. */
71
+ className?: string;
72
+ /** The body. */
73
+ children?: React.ReactNode;
74
+ }
75
+ declare function Card({ variant, padding, dividers, title, description, leading, trailing, footer, className, children, ...rest }: CardProps): React.JSX.Element;
76
+ declare namespace Card {
77
+ var displayName: string;
78
+ }
79
+
80
+ export { Card as C, SURFACE_PADDINGS as S, type CardPadding as a, type CardProps as b, type CardVariant as c, SURFACE_VARIANTS as d, type SurfacePadding as e, type SurfaceVariant as f };
package/dist/card.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { C as Card, a as CardPadding, b as CardProps, c as CardVariant } from './card-nWicloNi.js';
2
+ import 'react';
package/dist/card.js ADDED
@@ -0,0 +1,7 @@
1
+ "use client";export { Card } from './chunk-DRZCJCBO.js';
2
+ import './chunk-J7ZQQFPT.js';
3
+ import './chunk-MFJP5FA7.js';
4
+ import './chunk-52IFGFTL.js';
5
+ import './chunk-ZSNJ6UA3.js';
6
+ //# sourceMappingURL=card.js.map
7
+ //# sourceMappingURL=card.js.map