chrona-react 0.3.4 → 0.3.6

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/AGENTS.md CHANGED
@@ -11,10 +11,11 @@ https://github.com/devlinduldulao/chrona#readme
11
11
  `temporal-spec/global`, so `Temporal.PlainDate` resolves as an ambient global
12
12
  in any file that imports from Chrona. A file that uses Temporal types without
13
13
  importing Chrona needs `import "temporal-spec/global"` of its own.
14
- 3. **Server Components.** These components hold state: mark their module
15
- `"use client"`. The polyfill import is a side effect, so it must reach the
16
- client bundle put it at the top of a `"use client"` module that always
17
- loads (a providers file), not in a Server Component. That covers hydration.
14
+ 3. **Server Components.** The package carries a `"use client"` directive, so
15
+ *importing* it from a Server Component is safe; the module that **renders**
16
+ it still has to be a client module. The polyfill import is a side effect and
17
+ must reach the client bundle put it at the top of a `"use client"` module
18
+ that always loads (a providers file), not in a Server Component.
18
19
  4. **SSR module init.** The providers import does not order Node module
19
20
  evaluation. If another `"use client"` file reads `Temporal` at module scope
20
21
  (`const reference = Temporal.PlainDate.from(...)` at the top of `page.tsx`),
@@ -49,17 +50,53 @@ what the field and calendar open on before a value exists.
49
50
  - Typed digits are literal, stepping clamps. 29 February is reachable before the
50
51
  year is typed; a finished date that cannot exist reports
51
52
  `onInvalid("nonexistent")` rather than clamping to the 28th.
52
- - Validation waits for a segment to finish. A half-typed year emits nothing
53
- until it is complete or the field blurs.
53
+ - A segment is a draft until its last digit lands, and a draft reports nothing:
54
+ typing `2026` calls `onChange` once with that year, not four times through
55
+ 2, 20 and 202. Blur settles a draft literally — `20` becomes the year 20.
54
56
  - Empty fields are `null`. Partial drafts stay internal; `onChange` only sees
55
57
  complete, valid values.
58
+ - Segments accept input from soft keyboards, which send no usable `key` and
59
+ often arrive as a composition. The AM/PM segment also accepts its locale's own
60
+ label, so it can be set without a hardware keyboard — but it has no pointer
61
+ affordance, so leave readers a keyboard path to it.
62
+ - A segment announces `aria-valuemin`/`aria-valuemax` narrowed to
63
+ `minValue`/`maxValue` where that is certain, while still accepting
64
+ out-of-range input so it can be reported rather than silently refused.
56
65
 
57
66
  ## SSR determinism
58
67
 
59
- Pass the same reference date, value, locale, and `timeZone` on server and
60
- client — today is resolved at render time. Segment literals are normalized
61
- (U+202F and U+00A0 collapse to a plain space), so a 12-hour `TimeField` hydrates
62
- cleanly across differing ICU versions; `hourCycle="h23"` is not a requirement.
68
+ Pass the same reference date, value, locale and `timeZone` on server and client.
69
+
70
+ **`today` is resolved on the client, not at render time.** A server cannot know
71
+ the reader's day it may be in another zone, and a prerendered page can be
72
+ served days after it was built — so `data-today` and `aria-current="date"` are
73
+ absent from the server HTML and appear just after hydration. Pass `today`
74
+ yourself to put the marker in the server HTML.
75
+
76
+ **Give every server-rendered calendar a reference date.** With no `value`,
77
+ `defaultValue`, `focusedValue`, `defaultFocusedValue` or `placeholderValue`, a
78
+ calendar opens on whichever day the renderer thinks it is, and React will not
79
+ patch up the mismatch that follows. A development build warns once about this
80
+ from the server render.
81
+
82
+ **Keep values in `iso8601` unless the server is known to manage more.** Node's
83
+ native Temporal cannot do arithmetic on other calendars — `gregory` included —
84
+ so `calendar="gregory"`, or a value carrying that calendar, renders in the
85
+ browser and raises `CALENDAR_UNSUPPORTED` during SSR.
86
+
87
+ Segment literals are normalized (U+202F and U+00A0 collapse to a plain space),
88
+ so a 12-hour `TimeField` hydrates cleanly across differing ICU versions;
89
+ `hourCycle="h23"` is not a requirement. Two things that normalization cannot
90
+ cover: dates before 1582, which ICU renders through the Julian calendar and
91
+ runtimes disagree about, and `dateStyle` in `ja-JP`/`zh-CN`, where V8 and
92
+ `temporal-polyfill` differ — which only shows when the two sides of a page run
93
+ different implementations.
94
+
95
+ ## Styling
96
+
97
+ No CSS ships. Style through `data-scope`, `data-part` and state attributes.
98
+ `docs/starter.css` in the repository is a copy-and-edit stylesheet covering every
99
+ part these components emit.
63
100
 
64
101
  ## Not implemented
65
102
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ values, no free-form date parsing, and no CSS — you own every pixel.
6
6
  Part of [Chrona](https://github.com/devlinduldulao/chrona). Built on
7
7
  [`chrona-core`](https://www.npmjs.com/package/chrona-core).
8
8
 
9
- > **Status: experimental 0.3.4.** Public APIs and styling attributes are not
9
+ > **Status: experimental 0.3.6.** Public APIs and styling attributes are not
10
10
  > frozen for v1. 0.3.0 changes when a field reports a value and leaves `today`
11
11
  > to the client; 0.2.0 changed the Calendar cell anatomy. See the
12
12
  > [changelog](./CHANGELOG.md). Automated axe checks pass, but no screen-reader
@@ -120,7 +120,7 @@ return focus to the trigger.
120
120
  | `DateField` | `chrona-react/date-field` | Locale-ordered segments; ISO/Gregorian years 1–9999 |
121
121
  | `TimeField` | `chrona-react/time-field` | `hourCycle` h11/h12/h23/h24, minute or second granularity |
122
122
  | `DatePicker` | `chrona-react/date-picker` | Field plus calendar in a native dialog |
123
- | `ChronaProvider` | — | Ambient `locale` and `timeZone` |
123
+ | `ChronaProvider` | — | Ambient `locale`, `timeZone`, `dir` and `translations` |
124
124
 
125
125
  A barrel export is also available. Matching hooks — `useCalendar`,
126
126
  `useRangeCalendar`, `useDateField`, `useTimeField`, `useDatePicker` — expose
@@ -154,6 +154,12 @@ Hidden inputs serialize with `.toString()` and are never read back.
154
154
  inputs do not take part in browser constraint validation — validate required,
155
155
  incomplete, or invalid values in your form layer before submission.
156
156
 
157
+ Every failure is a `ChronaError` carrying a stable `code`, listed in
158
+ [`chrona-core`'s README](https://www.npmjs.com/package/chrona-core#errors).
159
+ `TEMPORAL_MISSING`, `TEMPORAL_MISMATCH` and `CALENDAR_UNSUPPORTED` are the three
160
+ worth handling: each means the page's Temporal runtime is not what the component
161
+ needs, and each usually shows up only on the server.
162
+
157
163
  ## With shadcn/ui
158
164
 
159
165
  Chrona does not replace shadcn. Keep `Button`, `Popover`, `Label`, and `cn`.
@@ -420,6 +426,9 @@ focused cell, and at a month boundary the whole grid, will not match, and React
420
426
  reports a hydration mismatch it cannot patch up. Supply `placeholderValue` (or
421
427
  a value) on any calendar that is server-rendered.
422
428
 
429
+ A development build says so once, from the server render, rather than letting
430
+ the mismatch ship quietly. A client-rendered app never sees it.
431
+
423
432
  ### Segments report once
424
433
 
425
434
  A `DateField` segment is a draft until its last digit lands. Typing `2026` calls
package/dist/calendar.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  CalendarRoot,
5
5
  CalendarSurface,
6
6
  useCalendar
7
- } from "./chunk-I46LC4EZ.js";
7
+ } from "./chunk-OXTZ4Q67.js";
8
8
  import "./chunk-SDDSKOYU.js";
9
9
  export {
10
10
  Calendar,
@@ -3,7 +3,7 @@ import {
3
3
  Calendar,
4
4
  CalendarSurface,
5
5
  useCalendar
6
- } from "./chunk-I46LC4EZ.js";
6
+ } from "./chunk-OXTZ4Q67.js";
7
7
  import {
8
8
  Part,
9
9
  composeEvent,
@@ -117,4 +117,4 @@ export {
117
117
  useRangeCalendar,
118
118
  RangeCalendar
119
119
  };
120
- //# sourceMappingURL=chunk-GXQA645Q.js.map
120
+ //# sourceMappingURL=chunk-46JUKHI4.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-RTDRFDYG.js";
5
5
  import {
6
6
  Calendar
7
- } from "./chunk-I46LC4EZ.js";
7
+ } from "./chunk-OXTZ4Q67.js";
8
8
  import {
9
9
  Part,
10
10
  composeEvent,
@@ -217,4 +217,4 @@ export {
217
217
  useDatePicker,
218
218
  DatePicker
219
219
  };
220
- //# sourceMappingURL=chunk-YMCXDNWB.js.map
220
+ //# sourceMappingURL=chunk-GKDS2FHE.js.map
@@ -17,8 +17,20 @@ function useToday(options) {
17
17
  const iso = React.useSyncExternalStore(noStoreUpdates, () => temporal().Now.plainDateISO(options.timeZone).toString(), noServerToday);
18
18
  return options.today ?? (iso === null ? void 0 : temporal().PlainDate.from(iso));
19
19
  }
20
+ var warnedAboutAnchor = false;
21
+ function warnWithoutAnchor(anchored) {
22
+ if (anchored || warnedAboutAnchor || typeof window !== "undefined") return;
23
+ if (typeof process === "undefined" || process.env?.NODE_ENV === "production") return;
24
+ warnedAboutAnchor = true;
25
+ console.warn(
26
+ "[chrona] A server-rendered Calendar has no value, defaultValue, focusedValue, defaultFocusedValue or placeholderValue, so it opens on whichever day the renderer thinks it is. The server and the reader can disagree, and React will not patch that up. Give it a placeholderValue."
27
+ );
28
+ }
20
29
  function useCalendar(props = {}) {
21
30
  const options = useChronaConfig(props);
31
+ warnWithoutAnchor(
32
+ props.value !== void 0 || props.defaultValue !== void 0 || props.focusedValue !== void 0 || props.defaultFocusedValue !== void 0 || options.placeholderValue !== void 0
33
+ );
22
34
  const generatedId = React.useId();
23
35
  const id = props.id ?? generatedId;
24
36
  const [store] = React.useState(() => createStore(createCalendar({ ...options, value: props.value !== void 0 ? props.value : props.defaultValue, focusedValue: props.focusedValue ?? props.defaultFocusedValue })));
@@ -174,4 +186,4 @@ export {
174
186
  CalendarSurface,
175
187
  Calendar
176
188
  };
177
- //# sourceMappingURL=chunk-I46LC4EZ.js.map
189
+ //# sourceMappingURL=chunk-OXTZ4Q67.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/calendar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { calendarKeys, connectCalendar, createCalendar, createStore, formatDate, getNumberFormatter, resolveWeekStart, sameDate, syncCalendar, temporal, transitionCalendar, translations, weeksInMonthView, type CalendarEvent, type CalendarOptions, type PlainDate } from \"chrona-core\";\nimport { Part, composeEvent, type PartProps } from \"./part\";\nimport { useChronaConfig } from \"./provider\";\nimport { useFormReset, type HiddenInputProps } from \"./form\";\n\nexport interface CalendarProps extends CalendarOptions {\n defaultValue?: PlainDate | null;\n defaultFocusedValue?: PlainDate;\n onChange?: (value: PlainDate | null) => void;\n onSelect?: (value: PlainDate) => void;\n onFocusedValueChange?: (value: PlainDate) => void;\n id?: string;\n}\n\n/**\n * `today` depends on when and where the page is rendered, so a server render — including a page\n * prerendered at build time and served days later — cannot know the reader's. Resolving it through\n * `useSyncExternalStore` keeps the hydrating markup identical to the server's (no marker) and lets\n * React correct it right after, instead of leaving the server's day marked for good. Applications\n * that need the marker in the server HTML pass `today` themselves.\n */\nconst noStoreUpdates = () => () => {};\nconst noServerToday = () => null;\nfunction useToday(options: CalendarOptions): PlainDate | undefined {\n const iso = React.useSyncExternalStore(noStoreUpdates, () => temporal().Now.plainDateISO(options.timeZone).toString(), noServerToday);\n return options.today ?? (iso === null ? undefined : temporal().PlainDate.from(iso));\n}\n\n/**\n * A calendar with nothing to anchor on opens on the month of *its own* today —\n * the server's on the server, the reader's in the browser — and React cannot\n * patch up the mismatch that follows when those differ. Nothing in the library\n * can fix that; only a reference date can. So say so, once, on the server, where\n * it is actually a problem: a client-rendered app never sees this.\n */\nlet warnedAboutAnchor = false;\n\nfunction warnWithoutAnchor(anchored: boolean): void {\n if (anchored || warnedAboutAnchor || typeof window !== \"undefined\") return;\n if (typeof process === \"undefined\" || process.env?.NODE_ENV === \"production\") return;\n warnedAboutAnchor = true;\n console.warn(\n \"[chrona] A server-rendered Calendar has no value, defaultValue, focusedValue, defaultFocusedValue or placeholderValue, so it opens on whichever day the renderer thinks it is. The server and the reader can disagree, and React will not patch that up. Give it a placeholderValue.\",\n );\n}\n\nexport function useCalendar(props: CalendarProps = {}) {\n const options = useChronaConfig(props);\n warnWithoutAnchor(\n props.value !== undefined || props.defaultValue !== undefined || props.focusedValue !== undefined\n || props.defaultFocusedValue !== undefined || options.placeholderValue !== undefined,\n );\n const generatedId = React.useId();\n const id = props.id ?? generatedId;\n const [store] = React.useState(() => createStore(createCalendar({ ...options, value: props.value !== undefined ? props.value : props.defaultValue, focusedValue: props.focusedValue ?? props.defaultFocusedValue })));\n const snapshot = React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);\n // The store is the single source of truth; controlled props are reconciled into it by syncCalendar.\n const state = syncCalendar(snapshot, { ...options, value: props.value, focusedValue: props.focusedValue });\n React.useEffect(() => { store.setState(state); });\n const today = useToday(options);\n const rootRef = React.useRef<HTMLElement | null>(null);\n const pendingFocus = React.useRef(false);\n const [announcement, setAnnouncement] = React.useState(\"\");\n\n React.useEffect(() => {\n if (pendingFocus.current) {\n pendingFocus.current = false;\n rootRef.current?.querySelector<HTMLElement>('[data-part=\"cell-trigger\"][tabindex=\"0\"]')?.focus();\n }\n });\n\n function send(event: CalendarEvent) {\n const dir = options.dir ?? (rootRef.current?.closest(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\" ? \"rtl\" : \"ltr\");\n const result = transitionCalendar(state, event, { ...options, dir });\n store.setState(result.state);\n for (const effect of result.effects) {\n if (effect.type === \"focus\") {\n pendingFocus.current = true;\n if (!sameDate(effect.value, state.focusedValue)) props.onFocusedValueChange?.(effect.value);\n } else if (effect.type === \"change\") {\n props.onChange?.(effect.value);\n setAnnouncement(effect.value ? (options.translations?.selected ?? translations.selected)(formatDate(effect.value, options.locale, { dateStyle: \"full\" })) : \"\");\n } else {\n props.onSelect?.(effect.value);\n }\n }\n }\n\n return {\n state, options, send, rootRef, announcement,\n api: connectCalendar(state, { ...options, id, today }),\n months: Array.from({ length: options.numberOfMonths ?? 1 }, (_, index) => state.visibleMonth.add({ months: index })),\n };\n}\n\ntype CalendarContextValue = ReturnType<typeof useCalendar>;\nconst Context = React.createContext<CalendarContextValue | null>(null);\nconst MonthContext = React.createContext<PlainDate | null>(null);\n\nfunction useContext() {\n const value = React.useContext(Context);\n if (!value) throw new Error(\"Calendar parts must be inside Calendar.Root.\");\n return value;\n}\n\nexport function CalendarRoot({ children, asChild, className, style, ...props }: CalendarProps & Pick<PartProps, \"children\" | \"asChild\" | \"className\" | \"style\">) {\n const calendar = useCalendar(props);\n return <CalendarSurface calendar={calendar} id={props.id} asChild={asChild} className={className} style={style}>{children}</CalendarSurface>;\n}\n\nexport function CalendarSurface({ calendar, ...props }: PartProps & { calendar: CalendarContextValue }) {\n return <Context.Provider value={calendar}><Part {...calendar.api.getRootProps()} {...props} ref={calendar.rootRef} /></Context.Provider>;\n}\n\nconst Header = React.forwardRef<HTMLElement, PartProps>(function Header(props, ref) {\n return <Part {...props} ref={ref} data-scope=\"calendar\" data-part=\"header\" />;\n});\n\nconst Heading = React.forwardRef<HTMLElement, PartProps>(function Heading({ children, ...props }, ref) {\n const { months, options } = useContext();\n const month = React.useContext(MonthContext);\n return <Part as=\"h2\" {...props} ref={ref} data-scope=\"calendar\" data-part=\"heading\" aria-live=\"polite\" aria-atomic=\"true\">{children ?? (month ? [month] : months).map((date) => formatDate(date, options.locale, { month: \"long\", year: \"numeric\" })).join(options.translations?.rangeSeparator ?? translations.rangeSeparator)}</Part>;\n});\n\ntype ButtonProps = React.ComponentPropsWithoutRef<\"button\"> & { asChild?: boolean };\n\n/**\n * Paging buttons carry an `aria-label` but no text, so without a default they render as blank\n * chrome for sighted users. The arrow points the way the button pages in the resolved direction.\n */\nfunction Chevron({ towards }: { towards: \"start\" | \"end\" }) {\n const points = towards === \"start\" ? \"15 4 7 12 15 20\" : \"9 4 17 12 9 20\";\n return <svg aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 24 24\" width=\"1em\" height=\"1em\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" data-scope=\"calendar\" data-part=\"chevron\"><polyline points={points} /></svg>;\n}\n\nconst PrevButton = React.forwardRef<HTMLElement, ButtonProps>(function PrevButton({ onClick, children, ...props }, ref) {\n const { api, send, options } = useContext();\n return <Part as=\"button\" {...props} {...api.getPrevButtonProps()} ref={ref} onClick={composeEvent(onClick, () => send({ type: \"PAGE\", direction: -1 }))}>{children ?? <Chevron towards={options.dir === \"rtl\" ? \"end\" : \"start\"} />}</Part>;\n});\n\nconst NextButton = React.forwardRef<HTMLElement, ButtonProps>(function NextButton({ onClick, children, ...props }, ref) {\n const { api, send, options } = useContext();\n return <Part as=\"button\" {...props} {...api.getNextButtonProps()} ref={ref} onClick={composeEvent(onClick, () => send({ type: \"PAGE\", direction: 1 }))}>{children ?? <Chevron towards={options.dir === \"rtl\" ? \"start\" : \"end\"} />}</Part>;\n});\n\nconst Grid = React.forwardRef<HTMLElement, PartProps & { monthIndex?: number }>(function Grid({ monthIndex = 0, children, ...props }, ref) {\n const { api, months } = useContext();\n const month = months[monthIndex];\n if (!month) throw new Error(\"Calendar.Grid monthIndex is outside numberOfMonths.\");\n return <MonthContext.Provider value={month}><Part {...props} {...api.getGridProps(month)} ref={ref}>{children}</Part></MonthContext.Provider>;\n});\n\nfunction useMonth() {\n const context = useContext();\n const month = React.useContext(MonthContext) ?? context.state.visibleMonth;\n return { ...context, month, weeks: weeksInMonthView(month.toPlainYearMonth(), resolveWeekStart(context.options.locale, context.options.firstDayOfWeek), context.options.fixedWeeks) };\n}\n\nexport interface Weekday { date: PlainDate; label: string }\n\nconst GridHeader = React.forwardRef<HTMLElement, Omit<PartProps, \"children\"> & { children?: (day: Weekday) => React.ReactNode }>(function GridHeader({ children, ...props }, ref) {\n const { weeks, options } = useMonth();\n return <Part {...props} ref={ref} role=\"row\" data-scope=\"calendar\" data-part=\"grid-header\">{weeks[0]!.map((date) => {\n const day = { date, label: formatDate(date, options.locale, { weekday: \"short\" }) };\n return <React.Fragment key={date.toString()}>{children ? children(day) : <HeaderCell day={day} />}</React.Fragment>;\n })}</Part>;\n});\n\nconst HeaderCell = React.forwardRef<HTMLElement, PartProps & { day: Weekday }>(function HeaderCell({ day, children, ...props }, ref) {\n const { options } = useContext();\n return <Part {...props} ref={ref} role=\"columnheader\" aria-label={formatDate(day.date, options.locale, { weekday: \"long\" })} data-scope=\"calendar\" data-part=\"header-cell\">{children ?? day.label}</Part>;\n});\n\nconst GridBody = React.forwardRef<HTMLElement, Omit<PartProps, \"children\"> & { children?: (date: PlainDate) => React.ReactNode }>(function GridBody({ children, ...props }, ref) {\n const { weeks } = useMonth();\n return <Part {...props} ref={ref} role=\"rowgroup\" data-scope=\"calendar\" data-part=\"grid-body\">{weeks.map((week) => <div key={week[0]!.toString()} role=\"row\" data-scope=\"calendar\" data-part=\"row\">{week.map((date) => <React.Fragment key={date.toString()}>{children ? children(date) : <Cell date={date} />}</React.Fragment>)}</div>)}</Part>;\n});\n\nconst CellContext = React.createContext<PlainDate | null>(null);\n\nconst CellTrigger = React.forwardRef<HTMLElement, ButtonProps>(function CellTrigger({ children, onClick, onKeyDown, onFocus, ...props }, ref) {\n const { api, send, month, options } = useMonth();\n const date = React.useContext(CellContext);\n if (!date) throw new Error(\"Calendar.CellTrigger must be inside Calendar.Cell.\");\n // aria-disabled instead of native disabled keeps out-of-range dates discoverable by screen readers.\n return <Part as=\"button\" {...props} {...api.getCellTriggerProps(date, month)} ref={ref}\n onFocus={composeEvent(onFocus, () => { if (!options.disabled) send({ type: \"FOCUS\", date }); })}\n onClick={composeEvent(onClick, () => send({ type: \"SELECT\", date }))}\n onKeyDown={composeEvent(onKeyDown, (event) => {\n if (!calendarKeys.has(event.key) || event.altKey || event.ctrlKey || event.metaKey) return;\n event.preventDefault();\n send({ type: \"KEY_DOWN\", key: event.key, shiftKey: event.shiftKey });\n })}>{children ?? getNumberFormatter(options.locale, { useGrouping: false }).format(date.day)}</Part>;\n});\n\n/** The grid semantics live on the cell; the button inside it stays a button. */\nconst Cell = React.forwardRef<HTMLElement, PartProps & { date: PlainDate }>(function Cell({ date, children, ...props }, ref) {\n const { api, month } = useMonth();\n return <CellContext.Provider value={date}><Part {...props} {...api.getCellProps(date, month)} ref={ref}>{children ?? <CellTrigger />}</Part></CellContext.Provider>;\n});\n\nconst LiveRegion = React.forwardRef<HTMLElement, PartProps>(function LiveRegion(props, ref) {\n const { announcement } = useContext();\n return <Part {...props} ref={ref} role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-scope=\"calendar\" data-part=\"live-region\">{announcement}</Part>;\n});\n\nconst ClearButton = React.forwardRef<HTMLElement, ButtonProps>(function ClearButton({ onClick, ...props }, ref) {\n const { options, send, state } = useContext();\n return <Part as=\"button\" {...props} ref={ref} type=\"button\" data-scope=\"calendar\" data-part=\"clear-button\" aria-label={options.translations?.clear ?? translations.clear} disabled={options.disabled || options.readOnly || state.value === null} onClick={composeEvent(onClick, () => send({ type: \"CLEAR\" }))} />;\n});\n\nfunction HiddenInput(props: HiddenInputProps) {\n const { state, options, send } = useContext();\n const input = React.useRef<HTMLInputElement>(null);\n useFormReset(input, props.form, () => send({ type: \"RESET\", value: options.defaultValue ?? null }));\n return <input {...props} ref={input} type=\"hidden\" disabled={options.disabled || props.disabled} value={state.value?.toString() ?? \"\"} data-scope=\"calendar\" data-part=\"hidden-input\" />;\n}\n\nexport const Calendar = { Root: CalendarRoot, Header, Heading, PrevButton, NextButton, Grid, GridHeader, HeaderCell, GridBody, Cell, CellTrigger, LiveRegion, ClearButton, HiddenInput };"],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,cAAc,iBAAiB,gBAAgB,aAAa,YAAY,oBAAoB,kBAAkB,UAAU,cAAc,UAAU,oBAAoB,cAAc,wBAAkF;AA2GlQ;AAtFX,IAAM,iBAAiB,MAAM,MAAM;AAAC;AACpC,IAAM,gBAAgB,MAAM;AAC5B,SAAS,SAAS,SAAiD;AAC/D,QAAM,MAAY,2BAAqB,gBAAgB,MAAM,SAAS,EAAE,IAAI,aAAa,QAAQ,QAAQ,EAAE,SAAS,GAAG,aAAa;AACpI,SAAO,QAAQ,UAAU,QAAQ,OAAO,SAAY,SAAS,EAAE,UAAU,KAAK,GAAG;AACrF;AASA,IAAI,oBAAoB;AAExB,SAAS,kBAAkB,UAAyB;AAChD,MAAI,YAAY,qBAAqB,OAAO,WAAW,YAAa;AACpE,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,aAAa,aAAc;AAC9E,sBAAoB;AACpB,UAAQ;AAAA,IACJ;AAAA,EACJ;AACJ;AAEO,SAAS,YAAY,QAAuB,CAAC,GAAG;AACnD,QAAM,UAAU,gBAAgB,KAAK;AACrC;AAAA,IACI,MAAM,UAAU,UAAa,MAAM,iBAAiB,UAAa,MAAM,iBAAiB,UACrF,MAAM,wBAA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AAU,MAAK,UAAS,cAAW,YAAW,aAAU,gBAAe,cAAY,QAAQ,cAAc,SAAS,aAAa,OAAO,UAAU,QAAQ,YAAY,QAAQ,YAAY,MAAM,UAAU,MAAM,SAAS,aAAa,SAAS,MAAM,KAAK,EAAE,MAAM,QAAQ,CAAC,CAAC,GAAG;AACrT,CAAC;AAED,SAAS,YAAY,OAAyB;AAC1C,QAAM,EAAE,OAAO,SAAS,KAAK,IAAIA,YAAW;AAC5C,QAAM,QAAc,aAAyB,IAAI;AACjD,eAAa,OAAO,MAAM,MAAM,MAAM,KAAK,EAAE,MAAM,SAAS,OAAO,QAAQ,gBAAgB,KAAK,CAAC,CAAC;AAClG,SAAO,oBAAC,WAAO,GAAG,OAAO,KAAK,OAAO,MAAK,UAAS,UAAU,QAAQ,YAAY,MAAM,UAAU,OAAO,MAAM,OAAO,SAAS,KAAK,IAAI,cAAW,YAAW,aAAU,gBAAe;AAC1L;AAEO,IAAM,WAAW,EAAE,MAAM,cAAc,QAAQ,SAAS,YAAY,YAAY,MAAM,YAAY,YAAY,UAAU,MAAM,aAAa,YAAY,aAAa,YAAY;","names":["useContext","Header","Heading","PrevButton","NextButton","Grid","GridHeader","HeaderCell","GridBody","CellTrigger","Cell","LiveRegion","ClearButton"]}
@@ -5,14 +5,14 @@ import { F as FieldProps } from './field-DayikvR6.js';
5
5
 
6
6
  type DateFieldProps = FieldProps<"date">;
7
7
  declare const DateField: {
8
- Root: ({ children, asChild, className, style, ...props }: FieldProps<"date"> & Pick<PartProps, "children" | "asChild" | "className" | "style">) => React.JSX.Element;
8
+ Root: ({ children, asChild, className, style, ...props }: FieldProps<"date"> & Pick<PartProps, "className" | "style" | "children" | "asChild">) => React.JSX.Element;
9
9
  Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
10
10
  asChild?: boolean;
11
11
  } & React.RefAttributes<HTMLElement>>;
12
12
  Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
13
13
  asChild?: boolean;
14
14
  } & React.RefAttributes<HTMLElement>>;
15
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
15
+ Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "defaultValue" | "children" | "onChange" | "type" | "value"> & {
16
16
  type: chrona_core.SegmentType;
17
17
  } & React.RefAttributes<HTMLInputElement>>;
18
18
  HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
@@ -47,7 +47,7 @@ declare const DatePicker: {
47
47
  Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
48
48
  asChild?: boolean;
49
49
  } & React.RefAttributes<HTMLElement>>;
50
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
50
+ Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "defaultValue" | "children" | "onChange" | "type" | "value"> & {
51
51
  type: chrona_core.SegmentType;
52
52
  } & React.RefAttributes<HTMLInputElement>>;
53
53
  HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  DatePicker,
4
4
  useDatePicker
5
- } from "./chunk-YMCXDNWB.js";
5
+ } from "./chunk-GKDS2FHE.js";
6
6
  import "./chunk-RTDRFDYG.js";
7
- import "./chunk-I46LC4EZ.js";
7
+ import "./chunk-OXTZ4Q67.js";
8
8
  import "./chunk-27APJXNX.js";
9
9
  import "./chunk-SDDSKOYU.js";
10
10
  export {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  DatePicker,
4
4
  useDatePicker
5
- } from "./chunk-YMCXDNWB.js";
5
+ } from "./chunk-GKDS2FHE.js";
6
6
  import {
7
7
  DateField,
8
8
  useDateField
@@ -10,12 +10,12 @@ import {
10
10
  import {
11
11
  RangeCalendar,
12
12
  useRangeCalendar
13
- } from "./chunk-GXQA645Q.js";
13
+ } from "./chunk-46JUKHI4.js";
14
14
  import {
15
15
  Calendar,
16
16
  CalendarRoot,
17
17
  useCalendar
18
- } from "./chunk-I46LC4EZ.js";
18
+ } from "./chunk-OXTZ4Q67.js";
19
19
  import {
20
20
  TimeField,
21
21
  useTimeField
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  RangeCalendar,
4
4
  useRangeCalendar
5
- } from "./chunk-GXQA645Q.js";
6
- import "./chunk-I46LC4EZ.js";
5
+ } from "./chunk-46JUKHI4.js";
6
+ import "./chunk-OXTZ4Q67.js";
7
7
  import "./chunk-SDDSKOYU.js";
8
8
  export {
9
9
  RangeCalendar,
@@ -5,14 +5,14 @@ import { F as FieldProps } from './field-DayikvR6.js';
5
5
 
6
6
  type TimeFieldProps = FieldProps<"time">;
7
7
  declare const TimeField: {
8
- Root: ({ children, asChild, className, style, ...props }: FieldProps<"time"> & Pick<PartProps, "children" | "asChild" | "className" | "style">) => React.JSX.Element;
8
+ Root: ({ children, asChild, className, style, ...props }: FieldProps<"time"> & Pick<PartProps, "className" | "style" | "children" | "asChild">) => React.JSX.Element;
9
9
  Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
10
10
  asChild?: boolean;
11
11
  } & React.RefAttributes<HTMLElement>>;
12
12
  Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
13
13
  asChild?: boolean;
14
14
  } & React.RefAttributes<HTMLElement>>;
15
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
15
+ Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "defaultValue" | "children" | "onChange" | "type" | "value"> & {
16
16
  type: chrona_core.SegmentType;
17
17
  } & React.RefAttributes<HTMLInputElement>>;
18
18
  HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chrona-react",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Headless Temporal-native React date and time primitives",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "chrona-core": "^0.3.4"
64
+ "chrona-core": "^0.3.6"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "react": ">=18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/calendar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { calendarKeys, connectCalendar, createCalendar, createStore, formatDate, getNumberFormatter, resolveWeekStart, sameDate, syncCalendar, temporal, transitionCalendar, translations, weeksInMonthView, type CalendarEvent, type CalendarOptions, type PlainDate } from \"chrona-core\";\nimport { Part, composeEvent, type PartProps } from \"./part\";\nimport { useChronaConfig } from \"./provider\";\nimport { useFormReset, type HiddenInputProps } from \"./form\";\n\nexport interface CalendarProps extends CalendarOptions {\n defaultValue?: PlainDate | null;\n defaultFocusedValue?: PlainDate;\n onChange?: (value: PlainDate | null) => void;\n onSelect?: (value: PlainDate) => void;\n onFocusedValueChange?: (value: PlainDate) => void;\n id?: string;\n}\n\n/**\n * `today` depends on when and where the page is rendered, so a server render — including a page\n * prerendered at build time and served days later — cannot know the reader's. Resolving it through\n * `useSyncExternalStore` keeps the hydrating markup identical to the server's (no marker) and lets\n * React correct it right after, instead of leaving the server's day marked for good. Applications\n * that need the marker in the server HTML pass `today` themselves.\n */\nconst noStoreUpdates = () => () => {};\nconst noServerToday = () => null;\nfunction useToday(options: CalendarOptions): PlainDate | undefined {\n const iso = React.useSyncExternalStore(noStoreUpdates, () => temporal().Now.plainDateISO(options.timeZone).toString(), noServerToday);\n return options.today ?? (iso === null ? undefined : temporal().PlainDate.from(iso));\n}\n\nexport function useCalendar(props: CalendarProps = {}) {\n const options = useChronaConfig(props);\n const generatedId = React.useId();\n const id = props.id ?? generatedId;\n const [store] = React.useState(() => createStore(createCalendar({ ...options, value: props.value !== undefined ? props.value : props.defaultValue, focusedValue: props.focusedValue ?? props.defaultFocusedValue })));\n const snapshot = React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);\n // The store is the single source of truth; controlled props are reconciled into it by syncCalendar.\n const state = syncCalendar(snapshot, { ...options, value: props.value, focusedValue: props.focusedValue });\n React.useEffect(() => { store.setState(state); });\n const today = useToday(options);\n const rootRef = React.useRef<HTMLElement | null>(null);\n const pendingFocus = React.useRef(false);\n const [announcement, setAnnouncement] = React.useState(\"\");\n\n React.useEffect(() => {\n if (pendingFocus.current) {\n pendingFocus.current = false;\n rootRef.current?.querySelector<HTMLElement>('[data-part=\"cell-trigger\"][tabindex=\"0\"]')?.focus();\n }\n });\n\n function send(event: CalendarEvent) {\n const dir = options.dir ?? (rootRef.current?.closest(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\" ? \"rtl\" : \"ltr\");\n const result = transitionCalendar(state, event, { ...options, dir });\n store.setState(result.state);\n for (const effect of result.effects) {\n if (effect.type === \"focus\") {\n pendingFocus.current = true;\n if (!sameDate(effect.value, state.focusedValue)) props.onFocusedValueChange?.(effect.value);\n } else if (effect.type === \"change\") {\n props.onChange?.(effect.value);\n setAnnouncement(effect.value ? (options.translations?.selected ?? translations.selected)(formatDate(effect.value, options.locale, { dateStyle: \"full\" })) : \"\");\n } else {\n props.onSelect?.(effect.value);\n }\n }\n }\n\n return {\n state, options, send, rootRef, announcement,\n api: connectCalendar(state, { ...options, id, today }),\n months: Array.from({ length: options.numberOfMonths ?? 1 }, (_, index) => state.visibleMonth.add({ months: index })),\n };\n}\n\ntype CalendarContextValue = ReturnType<typeof useCalendar>;\nconst Context = React.createContext<CalendarContextValue | null>(null);\nconst MonthContext = React.createContext<PlainDate | null>(null);\n\nfunction useContext() {\n const value = React.useContext(Context);\n if (!value) throw new Error(\"Calendar parts must be inside Calendar.Root.\");\n return value;\n}\n\nexport function CalendarRoot({ children, asChild, className, style, ...props }: CalendarProps & Pick<PartProps, \"children\" | \"asChild\" | \"className\" | \"style\">) {\n const calendar = useCalendar(props);\n return <CalendarSurface calendar={calendar} id={props.id} asChild={asChild} className={className} style={style}>{children}</CalendarSurface>;\n}\n\nexport function CalendarSurface({ calendar, ...props }: PartProps & { calendar: CalendarContextValue }) {\n return <Context.Provider value={calendar}><Part {...calendar.api.getRootProps()} {...props} ref={calendar.rootRef} /></Context.Provider>;\n}\n\nconst Header = React.forwardRef<HTMLElement, PartProps>(function Header(props, ref) {\n return <Part {...props} ref={ref} data-scope=\"calendar\" data-part=\"header\" />;\n});\n\nconst Heading = React.forwardRef<HTMLElement, PartProps>(function Heading({ children, ...props }, ref) {\n const { months, options } = useContext();\n const month = React.useContext(MonthContext);\n return <Part as=\"h2\" {...props} ref={ref} data-scope=\"calendar\" data-part=\"heading\" aria-live=\"polite\" aria-atomic=\"true\">{children ?? (month ? [month] : months).map((date) => formatDate(date, options.locale, { month: \"long\", year: \"numeric\" })).join(options.translations?.rangeSeparator ?? translations.rangeSeparator)}</Part>;\n});\n\ntype ButtonProps = React.ComponentPropsWithoutRef<\"button\"> & { asChild?: boolean };\n\n/**\n * Paging buttons carry an `aria-label` but no text, so without a default they render as blank\n * chrome for sighted users. The arrow points the way the button pages in the resolved direction.\n */\nfunction Chevron({ towards }: { towards: \"start\" | \"end\" }) {\n const points = towards === \"start\" ? \"15 4 7 12 15 20\" : \"9 4 17 12 9 20\";\n return <svg aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 24 24\" width=\"1em\" height=\"1em\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" data-scope=\"calendar\" data-part=\"chevron\"><polyline points={points} /></svg>;\n}\n\nconst PrevButton = React.forwardRef<HTMLElement, ButtonProps>(function PrevButton({ onClick, children, ...props }, ref) {\n const { api, send, options } = useContext();\n return <Part as=\"button\" {...props} {...api.getPrevButtonProps()} ref={ref} onClick={composeEvent(onClick, () => send({ type: \"PAGE\", direction: -1 }))}>{children ?? <Chevron towards={options.dir === \"rtl\" ? \"end\" : \"start\"} />}</Part>;\n});\n\nconst NextButton = React.forwardRef<HTMLElement, ButtonProps>(function NextButton({ onClick, children, ...props }, ref) {\n const { api, send, options } = useContext();\n return <Part as=\"button\" {...props} {...api.getNextButtonProps()} ref={ref} onClick={composeEvent(onClick, () => send({ type: \"PAGE\", direction: 1 }))}>{children ?? <Chevron towards={options.dir === \"rtl\" ? \"start\" : \"end\"} />}</Part>;\n});\n\nconst Grid = React.forwardRef<HTMLElement, PartProps & { monthIndex?: number }>(function Grid({ monthIndex = 0, children, ...props }, ref) {\n const { api, months } = useContext();\n const month = months[monthIndex];\n if (!month) throw new Error(\"Calendar.Grid monthIndex is outside numberOfMonths.\");\n return <MonthContext.Provider value={month}><Part {...props} {...api.getGridProps(month)} ref={ref}>{children}</Part></MonthContext.Provider>;\n});\n\nfunction useMonth() {\n const context = useContext();\n const month = React.useContext(MonthContext) ?? context.state.visibleMonth;\n return { ...context, month, weeks: weeksInMonthView(month.toPlainYearMonth(), resolveWeekStart(context.options.locale, context.options.firstDayOfWeek), context.options.fixedWeeks) };\n}\n\nexport interface Weekday { date: PlainDate; label: string }\n\nconst GridHeader = React.forwardRef<HTMLElement, Omit<PartProps, \"children\"> & { children?: (day: Weekday) => React.ReactNode }>(function GridHeader({ children, ...props }, ref) {\n const { weeks, options } = useMonth();\n return <Part {...props} ref={ref} role=\"row\" data-scope=\"calendar\" data-part=\"grid-header\">{weeks[0]!.map((date) => {\n const day = { date, label: formatDate(date, options.locale, { weekday: \"short\" }) };\n return <React.Fragment key={date.toString()}>{children ? children(day) : <HeaderCell day={day} />}</React.Fragment>;\n })}</Part>;\n});\n\nconst HeaderCell = React.forwardRef<HTMLElement, PartProps & { day: Weekday }>(function HeaderCell({ day, children, ...props }, ref) {\n const { options } = useContext();\n return <Part {...props} ref={ref} role=\"columnheader\" aria-label={formatDate(day.date, options.locale, { weekday: \"long\" })} data-scope=\"calendar\" data-part=\"header-cell\">{children ?? day.label}</Part>;\n});\n\nconst GridBody = React.forwardRef<HTMLElement, Omit<PartProps, \"children\"> & { children?: (date: PlainDate) => React.ReactNode }>(function GridBody({ children, ...props }, ref) {\n const { weeks } = useMonth();\n return <Part {...props} ref={ref} role=\"rowgroup\" data-scope=\"calendar\" data-part=\"grid-body\">{weeks.map((week) => <div key={week[0]!.toString()} role=\"row\" data-scope=\"calendar\" data-part=\"row\">{week.map((date) => <React.Fragment key={date.toString()}>{children ? children(date) : <Cell date={date} />}</React.Fragment>)}</div>)}</Part>;\n});\n\nconst CellContext = React.createContext<PlainDate | null>(null);\n\nconst CellTrigger = React.forwardRef<HTMLElement, ButtonProps>(function CellTrigger({ children, onClick, onKeyDown, onFocus, ...props }, ref) {\n const { api, send, month, options } = useMonth();\n const date = React.useContext(CellContext);\n if (!date) throw new Error(\"Calendar.CellTrigger must be inside Calendar.Cell.\");\n // aria-disabled instead of native disabled keeps out-of-range dates discoverable by screen readers.\n return <Part as=\"button\" {...props} {...api.getCellTriggerProps(date, month)} ref={ref}\n onFocus={composeEvent(onFocus, () => { if (!options.disabled) send({ type: \"FOCUS\", date }); })}\n onClick={composeEvent(onClick, () => send({ type: \"SELECT\", date }))}\n onKeyDown={composeEvent(onKeyDown, (event) => {\n if (!calendarKeys.has(event.key) || event.altKey || event.ctrlKey || event.metaKey) return;\n event.preventDefault();\n send({ type: \"KEY_DOWN\", key: event.key, shiftKey: event.shiftKey });\n })}>{children ?? getNumberFormatter(options.locale, { useGrouping: false }).format(date.day)}</Part>;\n});\n\n/** The grid semantics live on the cell; the button inside it stays a button. */\nconst Cell = React.forwardRef<HTMLElement, PartProps & { date: PlainDate }>(function Cell({ date, children, ...props }, ref) {\n const { api, month } = useMonth();\n return <CellContext.Provider value={date}><Part {...props} {...api.getCellProps(date, month)} ref={ref}>{children ?? <CellTrigger />}</Part></CellContext.Provider>;\n});\n\nconst LiveRegion = React.forwardRef<HTMLElement, PartProps>(function LiveRegion(props, ref) {\n const { announcement } = useContext();\n return <Part {...props} ref={ref} role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-scope=\"calendar\" data-part=\"live-region\">{announcement}</Part>;\n});\n\nconst ClearButton = React.forwardRef<HTMLElement, ButtonProps>(function ClearButton({ onClick, ...props }, ref) {\n const { options, send, state } = useContext();\n return <Part as=\"button\" {...props} ref={ref} type=\"button\" data-scope=\"calendar\" data-part=\"clear-button\" aria-label={options.translations?.clear ?? translations.clear} disabled={options.disabled || options.readOnly || state.value === null} onClick={composeEvent(onClick, () => send({ type: \"CLEAR\" }))} />;\n});\n\nfunction HiddenInput(props: HiddenInputProps) {\n const { state, options, send } = useContext();\n const input = React.useRef<HTMLInputElement>(null);\n useFormReset(input, props.form, () => send({ type: \"RESET\", value: options.defaultValue ?? null }));\n return <input {...props} ref={input} type=\"hidden\" disabled={options.disabled || props.disabled} value={state.value?.toString() ?? \"\"} data-scope=\"calendar\" data-part=\"hidden-input\" />;\n}\n\nexport const Calendar = { Root: CalendarRoot, Header, Heading, PrevButton, NextButton, Grid, GridHeader, HeaderCell, GridBody, Cell, CellTrigger, LiveRegion, ClearButton, HiddenInput };"],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,cAAc,iBAAiB,gBAAgB,aAAa,YAAY,oBAAoB,kBAAkB,UAAU,cAAc,UAAU,oBAAoB,cAAc,wBAAkF;AAqFlQ;AAhEX,IAAM,iBAAiB,MAAM,MAAM;AAAC;AACpC,IAAM,gBAAgB,MAAM;AAC5B,SAAS,SAAS,SAAiD;AAC/D,QAAM,MAAY,2B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