ionbase-ui 0.59.0 → 0.69.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 (102) hide show
  1. package/dist/components/AgentActivity.d.ts +2 -1
  2. package/dist/components/AgentActivity.d.ts.map +1 -1
  3. package/dist/components/AgentActivity.js +4 -17
  4. package/dist/components/AgentActivity.js.map +1 -1
  5. package/dist/components/Calendar.d.ts +20 -0
  6. package/dist/components/Calendar.d.ts.map +1 -0
  7. package/dist/components/Calendar.js +151 -0
  8. package/dist/components/Calendar.js.map +1 -0
  9. package/dist/components/CalendarPopover.d.ts +26 -0
  10. package/dist/components/CalendarPopover.d.ts.map +1 -0
  11. package/dist/components/CalendarPopover.js +45 -0
  12. package/dist/components/CalendarPopover.js.map +1 -0
  13. package/dist/components/DateField.d.ts +15 -0
  14. package/dist/components/DateField.d.ts.map +1 -0
  15. package/dist/components/DateField.js +74 -0
  16. package/dist/components/DateField.js.map +1 -0
  17. package/dist/components/DatePicker.d.ts +81 -0
  18. package/dist/components/DatePicker.d.ts.map +1 -0
  19. package/dist/components/DatePicker.js +102 -0
  20. package/dist/components/DatePicker.js.map +1 -0
  21. package/dist/components/DateRangePicker.d.ts +117 -0
  22. package/dist/components/DateRangePicker.d.ts.map +1 -0
  23. package/dist/components/DateRangePicker.js +152 -0
  24. package/dist/components/DateRangePicker.js.map +1 -0
  25. package/dist/components/Header.d.ts +10 -0
  26. package/dist/components/Header.d.ts.map +1 -1
  27. package/dist/components/Header.js +18 -3
  28. package/dist/components/Header.js.map +1 -1
  29. package/dist/components/NumberInput.d.ts +63 -0
  30. package/dist/components/NumberInput.d.ts.map +1 -0
  31. package/dist/components/NumberInput.js +102 -0
  32. package/dist/components/NumberInput.js.map +1 -0
  33. package/dist/components/PromptInput.d.ts +89 -0
  34. package/dist/components/PromptInput.d.ts.map +1 -0
  35. package/dist/components/PromptInput.js +130 -0
  36. package/dist/components/PromptInput.js.map +1 -0
  37. package/dist/components/SegmentedControl.d.ts +63 -0
  38. package/dist/components/SegmentedControl.d.ts.map +1 -0
  39. package/dist/components/SegmentedControl.js +79 -0
  40. package/dist/components/SegmentedControl.js.map +1 -0
  41. package/dist/components/Sidebar.d.ts +109 -0
  42. package/dist/components/Sidebar.d.ts.map +1 -0
  43. package/dist/components/Sidebar.js +106 -0
  44. package/dist/components/Sidebar.js.map +1 -0
  45. package/dist/components/Stepper.d.ts +73 -0
  46. package/dist/components/Stepper.d.ts.map +1 -0
  47. package/dist/components/Stepper.js +82 -0
  48. package/dist/components/Stepper.js.map +1 -0
  49. package/dist/components/ToolCall.d.ts +66 -0
  50. package/dist/components/ToolCall.d.ts.map +1 -0
  51. package/dist/components/ToolCall.js +78 -0
  52. package/dist/components/ToolCall.js.map +1 -0
  53. package/dist/components/agent-status.d.ts +14 -0
  54. package/dist/components/agent-status.d.ts.map +1 -0
  55. package/dist/components/agent-status.js +16 -0
  56. package/dist/components/agent-status.js.map +1 -0
  57. package/dist/components/index.d.ts +17 -0
  58. package/dist/components/index.d.ts.map +1 -1
  59. package/dist/components/index.js +8 -0
  60. package/dist/components/index.js.map +1 -1
  61. package/dist/components/iso-date.d.ts +53 -0
  62. package/dist/components/iso-date.d.ts.map +1 -0
  63. package/dist/components/iso-date.js +102 -0
  64. package/dist/components/iso-date.js.map +1 -0
  65. package/dist/figma-descriptions.json +107 -52
  66. package/dist/figma-map.json +735 -2
  67. package/dist/meta/AgentActivityStep.json +2 -2
  68. package/dist/meta/DatePicker.json +270 -0
  69. package/dist/meta/DateRangePicker.json +284 -0
  70. package/dist/meta/Header.json +32 -2
  71. package/dist/meta/NumberInput.json +407 -0
  72. package/dist/meta/PromptInput.json +212 -0
  73. package/dist/meta/SegmentedControl.json +217 -0
  74. package/dist/meta/SegmentedControlItem.json +122 -0
  75. package/dist/meta/Sidebar.json +150 -0
  76. package/dist/meta/SidebarItem.json +184 -0
  77. package/dist/meta/SidebarSection.json +131 -0
  78. package/dist/meta/Stepper.json +135 -0
  79. package/dist/meta/StepperStep.json +148 -0
  80. package/dist/meta/Tabs.json +5 -0
  81. package/dist/meta/ToolCall.json +192 -0
  82. package/dist/meta/components.json +5784 -3297
  83. package/dist/meta/contrast.json +7776 -2478
  84. package/dist/meta/index.json +139 -2
  85. package/dist/meta/patterns/AgentRun.json +27 -0
  86. package/dist/meta/patterns/Form.json +9 -0
  87. package/dist/meta/patterns/PageShell.json +43 -3
  88. package/dist/meta/patterns/Wizard.json +20 -1
  89. package/dist/meta/patterns/index.json +10 -1
  90. package/dist/styles/date-picker.css +420 -0
  91. package/dist/styles/date-range-picker.css +280 -0
  92. package/dist/styles/header.css +26 -0
  93. package/dist/styles/index.css +15 -0
  94. package/dist/styles/number-input.css +83 -0
  95. package/dist/styles/prompt-input.css +127 -0
  96. package/dist/styles/segmented-control.css +182 -0
  97. package/dist/styles/sidebar.css +307 -0
  98. package/dist/styles/stepper.css +250 -0
  99. package/dist/styles/tool-call.css +202 -0
  100. package/llms.txt +2 -2
  101. package/package.json +20 -19
  102. package/LICENSE +0 -21
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- export type AgentActivityStatus = 'pending' | 'active' | 'done' | 'failed' | 'skipped';
2
+ import type { AgentActivityStatus } from './agent-status.js';
3
+ export type { AgentActivityStatus } from './agent-status.js';
3
4
  export interface AgentActivityProps extends React.HTMLAttributes<HTMLOListElement> {
4
5
  children?: React.ReactNode;
5
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AgentActivity.d.ts","sourceRoot":"","sources":["../../src/components/AgentActivity.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAC7B,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAChF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CA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use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React, { forwardRef, useEffect, useRef, useState } from 'react';
4
- const STATUS_TEXT = {
5
- pending: 'Not started',
6
- active: 'In progress',
7
- done: 'Done',
8
- failed: 'Failed',
9
- skipped: 'Skipped',
10
- };
11
- const Glyphs = {
12
- pending: () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }) })),
13
- active: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2", opacity: "0.3" }), _jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
14
- done: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "m8.5 12 2.5 2.5 4.5-5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] })),
15
- failed: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "m9 9 6 6M15 9l-6 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
16
- skipped: () => (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M8.5 12h7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })] })),
17
- };
4
+ import { STATUS_GLYPHS, STATUS_TEXT } from './agent-status.js';
18
5
  /**
19
6
  * AgentActivity — what the agent is doing, in plain language.
20
7
  *
@@ -71,14 +58,14 @@ export const AgentActivity = forwardRef(({ children, announceActive = true, clas
71
58
  });
72
59
  AgentActivity.displayName = 'AgentActivity';
73
60
  export const AgentActivityStep = forwardRef(({ children, status = 'pending', detail, className, ...rest }, ref) => {
74
- const Glyph = Glyphs[status];
61
+ const Glyph = STATUS_GLYPHS[status];
75
62
  return (_jsxs("li", { ...rest, ref: ref, "data-status": status, className: [
76
63
  'ion-agent-activity__step',
77
64
  `ion-agent-activity__step--${status}`,
78
65
  className || '',
79
66
  ]
80
67
  .filter(Boolean)
81
- .join(' '), children: [_jsx("span", { className: "ion-agent-activity__glyph", "aria-hidden": "true", children: _jsx(Glyph, {}) }), _jsxs("span", { className: "ion-agent-activity__body", children: [_jsx("span", { className: "ion-agent-activity__label", children: children }), detail && _jsx("span", { className: "ion-agent-activity__detail", children: detail })] }), _jsx("span", { className: "ion-visually-hidden", children: STATUS_TEXT[status] })] }));
68
+ .join(' '), children: [_jsx("span", { className: "ion-agent-activity__glyph", "aria-hidden": "true", children: _jsx(Glyph, {}) }), _jsxs("div", { className: "ion-agent-activity__body", children: [_jsx("span", { className: "ion-agent-activity__label", children: children }), detail && _jsx("div", { className: "ion-agent-activity__detail", children: detail })] }), _jsx("span", { className: "ion-visually-hidden", children: STATUS_TEXT[status] })] }));
82
69
  });
83
70
  AgentActivityStep.displayName = 'AgentActivityStep';
84
71
  //# sourceMappingURL=AgentActivity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentActivity.js","sourceRoot":"","sources":["../../src/components/AgentActivity.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBvE,MAAM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,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACtE,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,CACL,iBACM,IAAI,EACR,GAAG,EAAE,GAAG,iBACK,MAAM,EACnB,SAAS,EAAE;YACT,0BAA0B;YAC1B,6BAA6B,MAAM,EAAE;YACrC,SAAS,IAAI,EAAE;SAChB;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,aAEZ,eAAM,SAAS,EAAC,2BAA2B,iBAAa,MAAM,YAC5D,KAAC,KAAK,KAAG,GACJ,EAMP,eAAK,SAAS,EAAC,0BAA0B,aACvC,eAAM,SAAS,EAAC,2BAA2B,YAAE,QAAQ,GAAQ,EAC5D,MAAM,IAAI,cAAK,SAAS,EAAC,4BAA4B,YAAE,MAAM,GAAO,IACjE,EAEN,eAAM,SAAS,EAAC,qBAAqB,YAAE,WAAW,CAAC,MAAM,CAAC,GAAQ,IAC/D,CACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AriaCalendarProps, AriaRangeCalendarProps } from 'react-aria';
3
+ import type { DateValue } from '@internationalized/date';
4
+ /** The single-date calendar, for `DatePicker`. */
5
+ export declare function SingleCalendar(props: AriaCalendarProps<DateValue>): React.JSX.Element;
6
+ /**
7
+ * The range calendar, for `DateRangePicker`.
8
+ *
9
+ * `useRangeCalendar` takes a ref and the single-date `useCalendar` does not,
10
+ * which is not an inconsistency: the range calendar attaches a pointer-up
11
+ * listener to it so that releasing the mouse OUTSIDE the calendar still ends
12
+ * the drag. Without the ref the range would keep following the pointer after
13
+ * the button came up somewhere else on the page.
14
+ */
15
+ export declare function RangeCalendar({ visibleMonths, aside, footer, ...props }: AriaRangeCalendarProps<DateValue> & {
16
+ visibleMonths?: number;
17
+ aside?: React.ReactNode;
18
+ footer?: React.ReactNode;
19
+ }): React.JSX.Element;
20
+ //# sourceMappingURL=Calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/components/Calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAiBtC,OAAO,KAAK,EAEV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgWvE,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAgBjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,aAAiB,EACjB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,sBAAsB,CAAC,SAAS,CAAC,GAAG;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,qBA0BA"}
@@ -0,0 +1,151 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef } from 'react';
4
+ import { useButton, useCalendar, useCalendarCell, useCalendarGrid, useLocale, useRangeCalendar, } from 'react-aria';
5
+ import { useCalendarState, useRangeCalendarState } from 'react-stately';
6
+ import { createCalendar, endOfMonth, getWeeksInMonth, isSameDay, today, } from '@internationalized/date';
7
+ const ChevronLeft = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m15 18-6-6 6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
8
+ const ChevronRight = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m9 18 6-6-6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
9
+ /* -------------------------------------------------------------------- nav */
10
+ /**
11
+ * A month-step arrow.
12
+ *
13
+ * `useButton` rather than a bare `<button>` because the props react-aria hands
14
+ * back carry the disabled state for the boundary case — a `minValue` in the
15
+ * current month means there is no previous month to step to, and the arrow has
16
+ * to say so rather than silently doing nothing.
17
+ */
18
+ function NavButton({ buttonProps, children, }) {
19
+ const ref = useRef(null);
20
+ const { buttonProps: props } = useButton(buttonProps, ref);
21
+ return (_jsx("button", { ...props, ref: ref, type: "button", className: "ion-calendar__nav-button", children: children }));
22
+ }
23
+ /* ------------------------------------------------------------------- cell */
24
+ function Cell({ state, date, currentMonth, }) {
25
+ const ref = useRef(null);
26
+ const { cellProps, buttonProps, isSelected, isOutsideVisibleRange, isDisabled, isUnavailable, formattedDate, } = useCalendarCell({ date }, state, ref);
27
+ /*
28
+ * A day that belongs to the neighbouring month.
29
+ *
30
+ * `isOutsideVisibleRange` is NOT the same question and using it here is a
31
+ * bug worth naming: it is true for a date outside the whole visible RANGE,
32
+ * which for the two-month range calendar spans both grids. December's cells
33
+ * are inside that range and still do not belong to November's table, so a
34
+ * cell keyed on it would render December's first week into November's grid
35
+ * as though those days were November's.
36
+ */
37
+ const isOutsideMonth = date.month !== currentMonth.month;
38
+ /*
39
+ * The one place the two states differ.
40
+ *
41
+ * `highlightedRange` is the committed range OR the one being dragged out
42
+ * right now, which is what makes the band follow the pointer between the
43
+ * first and second click instead of appearing only once both ends exist.
44
+ */
45
+ const range = 'highlightedRange' in state ? state.highlightedRange : null;
46
+ const isRangeStart = range ? isSameDay(date, range.start) : false;
47
+ const isRangeEnd = range ? isSameDay(date, range.end) : false;
48
+ /*
49
+ * Inside the band but not an endpoint. Rendered as a flat tint with square
50
+ * sides so consecutive days join into one continuous bar; the endpoints keep
51
+ * the solid fill and the rounded outer edge.
52
+ */
53
+ const isInRange = Boolean(range) && isSelected && !isRangeStart && !isRangeEnd;
54
+ /*
55
+ * Today is marked even when it is selected — the dot moves to the on-colour
56
+ * token rather than being dropped. A "today" cue that disappears the moment
57
+ * today is picked vanishes exactly when the user is looking for confirmation
58
+ * that they picked it.
59
+ *
60
+ * The mark is VISUAL ONLY, and deliberately so. `useCalendarCell` already
61
+ * puts "today" into the cell's accessible name in the reader's own language;
62
+ * a second announcement from a hidden span would say it twice.
63
+ */
64
+ const isToday = isSameDay(date, today(state.timeZone));
65
+ return (_jsx("td", { ...cellProps, className: "ion-calendar__cell", children: _jsx("div", { ...buttonProps, ref: ref, hidden: isOutsideMonth || undefined, className: [
66
+ 'ion-calendar__day',
67
+ isSelected ? 'ion-calendar__day--selected' : '',
68
+ isInRange ? 'ion-calendar__day--in-range' : '',
69
+ isRangeStart ? 'ion-calendar__day--range-start' : '',
70
+ isRangeEnd ? 'ion-calendar__day--range-end' : '',
71
+ isDisabled ? 'ion-calendar__day--disabled' : '',
72
+ isUnavailable ? 'ion-calendar__day--unavailable' : '',
73
+ ]
74
+ .filter(Boolean)
75
+ .join(' '), "data-selected": isSelected || undefined, "data-in-range": isInRange || undefined, "data-range-start": isRangeStart || undefined, "data-range-end": isRangeEnd || undefined, "data-disabled": isDisabled || undefined, "data-unavailable": isUnavailable || undefined, "data-outside-range": isOutsideVisibleRange || undefined, "data-today": isToday || undefined, children: formattedDate }) }));
76
+ }
77
+ /* ------------------------------------------------------------------- grid */
78
+ /**
79
+ * One month's table.
80
+ *
81
+ * `offset` shifts it forward, which is how the range picker shows two months
82
+ * from one state: both grids read the same `state.visibleRange.start`, and the
83
+ * second adds a month to it. Stepping the state forward moves both together,
84
+ * which is the behaviour a two-month picker needs — a next-month arrow that
85
+ * moved only the right-hand grid would let the two overlap.
86
+ */
87
+ function MonthGrid({ state, offset = 0, }) {
88
+ const { locale } = useLocale();
89
+ const startDate = state.visibleRange.start.add({ months: offset });
90
+ const endDate = endOfMonth(startDate);
91
+ const { gridProps, headerProps, weekDays } = useCalendarGrid({ startDate, endDate }, state);
92
+ /*
93
+ * How many week rows this month needs — 4 through 6, depending on which
94
+ * weekday it starts on. Rendering a fixed 6 would pad February with a blank
95
+ * row, and rendering `Math.ceil(days / 7)` gets the common case right and the
96
+ * month that spills over a sixth week wrong.
97
+ */
98
+ const weeksInMonth = getWeeksInMonth(startDate, locale);
99
+ /*
100
+ * The month name above each grid, from the grid's own start date rather than
101
+ * from `useCalendar`'s `title`. `title` describes the whole visible range —
102
+ * "November – December 2024" for the two-month calendar — which is right for
103
+ * the header and wrong above one of the two grids.
104
+ */
105
+ const monthLabel = new Intl.DateTimeFormat(locale, {
106
+ month: 'long',
107
+ year: 'numeric',
108
+ calendar: startDate.calendar.identifier,
109
+ timeZone: state.timeZone,
110
+ }).format(startDate.toDate(state.timeZone));
111
+ return (_jsxs("div", { className: "ion-calendar__month", children: [_jsx("div", { className: "ion-calendar__month-label", "aria-hidden": "true", children: monthLabel }), _jsxs("table", { ...gridProps, className: "ion-calendar__grid", children: [_jsx("thead", { ...headerProps, children: _jsx("tr", { children: weekDays.map((day, i) => (
112
+ // The index IS the identity here: the weekday row is a fixed
113
+ // seven columns in a fixed order, and nothing reorders it.
114
+ _jsx("th", { className: "ion-calendar__weekday", children: day }, i))) }) }), _jsx("tbody", { children: [...new Array(weeksInMonth).keys()].map((weekIndex) => (_jsx("tr", { children: state.getDatesInWeek(weekIndex, startDate).map((date, i) => date ? (_jsx(Cell, { state: state, date: date, currentMonth: startDate }, date.toString())) : (
115
+ // A padding cell before the 1st or after the last —
116
+ // it has no date to key on, and its position is its identity.
117
+ _jsx("td", {}, i))) }, weekIndex))) })] })] }));
118
+ }
119
+ /* ----------------------------------------------------------------- shells */
120
+ function CalendarShell({ calendarProps, prevButtonProps, nextButtonProps, title, state, visibleMonths, aside, footer, refProp, }) {
121
+ return (_jsxs("div", { ...calendarProps, ref: refProp, className: "ion-calendar", "data-months": visibleMonths, children: [aside, _jsxs("div", { className: "ion-calendar__body", children: [_jsxs("div", { className: "ion-calendar__header", children: [_jsx(NavButton, { buttonProps: prevButtonProps, children: _jsx(ChevronLeft, {}) }), _jsx("h2", { className: "ion-visually-hidden", children: title }), _jsx("div", { className: "ion-calendar__title", "aria-hidden": "true", children: title }), _jsx(NavButton, { buttonProps: nextButtonProps, children: _jsx(ChevronRight, {}) })] }), _jsx("div", { className: "ion-calendar__months", children: [...new Array(visibleMonths).keys()].map((offset) => (_jsx(MonthGrid, { state: state, offset: offset }, offset))) }), footer] })] }));
122
+ }
123
+ /** The single-date calendar, for `DatePicker`. */
124
+ export function SingleCalendar(props) {
125
+ const { locale } = useLocale();
126
+ const state = useCalendarState({ ...props, locale, createCalendar });
127
+ const { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(props, state);
128
+ return (_jsx(CalendarShell, { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, title: title, state: state, visibleMonths: 1 }));
129
+ }
130
+ /**
131
+ * The range calendar, for `DateRangePicker`.
132
+ *
133
+ * `useRangeCalendar` takes a ref and the single-date `useCalendar` does not,
134
+ * which is not an inconsistency: the range calendar attaches a pointer-up
135
+ * listener to it so that releasing the mouse OUTSIDE the calendar still ends
136
+ * the drag. Without the ref the range would keep following the pointer after
137
+ * the button came up somewhere else on the page.
138
+ */
139
+ export function RangeCalendar({ visibleMonths = 2, aside, footer, ...props }) {
140
+ const { locale } = useLocale();
141
+ const state = useRangeCalendarState({
142
+ ...props,
143
+ locale,
144
+ createCalendar,
145
+ visibleDuration: { months: visibleMonths },
146
+ });
147
+ const ref = useRef(null);
148
+ const { calendarProps, prevButtonProps, nextButtonProps, title } = useRangeCalendar(props, state, ref);
149
+ return (_jsx(CalendarShell, { calendarProps: calendarProps, prevButtonProps: prevButtonProps, nextButtonProps: nextButtonProps, title: title, state: state, visibleMonths: visibleMonths, aside: aside, footer: footer, refProp: ref }));
150
+ }
151
+ //# sourceMappingURL=Calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/components/Calendar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,eAAe,EACf,SAAS,EACT,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EACL,cAAc,EACd,UAAU,EACV,eAAe,EACf,SAAS,EACT,KAAK,GACN,MAAM,yBAAyB,CAAC;AAiCjC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,eACE,CAAC,EAAC,gBAAgB,EAClB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AAEF,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CACzB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,eACE,CAAC,EAAC,eAAe,EACjB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AAEF,8EAA8E;AAE9E;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,EACjB,WAAW,EACX,QAAQ,GAIT;IACC,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAC5C,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC3D,OA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GAC9D,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE5B,OAAO,CACL,KAAC,aAAa,IACZ,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,CAAC,GAChB,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,aAAa,GAAG,CAAC,EACjB,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EAKT;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,qBAAqB,CAAC;QAClC,GAAG,KAAK;QACR,MAAM;QACN,cAAc;QACd,eAAe,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;KAC3C,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,GAC9D,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAEtC,OAAO,CACL,KAAC,aAAa,IACZ,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,GAAG,GACZ,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { OverlayTriggerState } from 'react-stately';
3
+ interface CalendarPopoverProps {
4
+ state: OverlayTriggerState;
5
+ triggerRef: React.RefObject<HTMLElement | null>;
6
+ /** `dialogProps` from `useDatePicker` / `useDateRangePicker`. */
7
+ dialogProps: React.HTMLAttributes<HTMLElement>;
8
+ children: React.ReactNode;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * The panel, in its own component because it is mounted only while open.
13
+ *
14
+ * `useDialog` focuses the panel and resolves the title id in effects keyed on
15
+ * the ref — effects that run when the component CALLING the hook mounts. Called
16
+ * beside `useDatePickerState` in the picker, that moment is when the field
17
+ * mounts, with the calendar not yet in the DOM: the dialog never takes focus,
18
+ * so Escape never reaches it, and `aria-labelledby` is silently dropped. Same
19
+ * split as `Popover` / `PopoverPanel` and `Drawer`, for the same reason.
20
+ */
21
+ export declare function CalendarPopover({ state, triggerRef, dialogProps, children, className, }: CalendarPopoverProps): React.JSX.Element;
22
+ export declare namespace CalendarPopover {
23
+ var displayName: string;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=CalendarPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarPopover.d.ts","sourceRoot":"","sources":["../../src/components/CalendarPopover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAmBzD,UAAU,oBAAoB;IAC5B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,iEAAiE;IACjE,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACV,EAAE,oBAAoB,qBAkDtB;yBAxDe,eAAe"}
@@ -0,0 +1,45 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef } from 'react';
4
+ import { Overlay, usePopover, useDialog, mergeProps } from 'react-aria';
5
+ /**
6
+ * The panel, in its own component because it is mounted only while open.
7
+ *
8
+ * `useDialog` focuses the panel and resolves the title id in effects keyed on
9
+ * the ref — effects that run when the component CALLING the hook mounts. Called
10
+ * beside `useDatePickerState` in the picker, that moment is when the field
11
+ * mounts, with the calendar not yet in the DOM: the dialog never takes focus,
12
+ * so Escape never reaches it, and `aria-labelledby` is silently dropped. Same
13
+ * split as `Popover` / `PopoverPanel` and `Drawer`, for the same reason.
14
+ */
15
+ export function CalendarPopover({ state, triggerRef, dialogProps, children, className, }) {
16
+ const popoverRef = useRef(null);
17
+ const { popoverProps, underlayProps } = usePopover({
18
+ triggerRef,
19
+ popoverRef,
20
+ /*
21
+ * Aligned to the START of the field rather than centred under it. The
22
+ * calendar is much wider than a small date field and narrower than a wide
23
+ * one, and a centred overlay would sit at a different offset in each —
24
+ * which reads as a positioning bug rather than a choice. Anchored left,
25
+ * the month grid and the first segment share an edge.
26
+ */
27
+ placement: 'bottom start',
28
+ offset: 8,
29
+ }, state);
30
+ /*
31
+ * MODAL, unlike Combobox's listbox, and this is the opposite call from the
32
+ * one that file makes. A combobox must not move focus, because the user is
33
+ * still typing into the input that drives the list. A calendar is the
34
+ * opposite: the grid IS the input while it is open, arrow keys belong to it,
35
+ * and the date field behind it must not be receiving the same keystrokes.
36
+ * `usePopover` contains focus and hides the rest of the page from assistive
37
+ * tech for exactly this case.
38
+ */
39
+ const { dialogProps: innerDialogProps } = useDialog({}, popoverRef);
40
+ return (_jsxs(Overlay, { children: [_jsx("div", { ...underlayProps, className: "ion-calendar-popover__underlay" }), _jsx("div", { ...mergeProps(popoverProps, innerDialogProps, dialogProps), ref: popoverRef, className: ['ion-calendar-popover', className]
41
+ .filter(Boolean)
42
+ .join(' '), children: children })] }));
43
+ }
44
+ CalendarPopover.displayName = 'CalendarPopover';
45
+ //# sourceMappingURL=CalendarPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarPopover.js","sourceRoot":"","sources":["../../src/components/CalendarPopover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA6BxE;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACY;IACrB,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEhD,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,UAAU,CAChD;QACE,UAAU;QACV,UAAU;QACV;;;;;;WAMG;QACH,SAAS,EAAE,cAAc;QACzB,MAAM,EAAE,CAAC;KACV,EACD,KAAK,CACN,CAAC;IAEF;;;;;;;;OAQG;IACH,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAEpE,OAAO,CACL,MAAC,OAAO,eAMN,iBAAS,aAAa,EAAE,SAAS,EAAC,gCAAgC,GAAG,EACrE,iBACM,UAAU,CAAC,YAAY,EAAE,gBAAgB,EAAE,WAAW,CAAC,EAC3D,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC;qBAC3C,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,GAAG,CAAC,YAEX,QAAQ,GACL,IACE,CACX,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { AriaDatePickerProps, DateValue } from 'react-aria';
3
+ interface DateFieldProps extends AriaDatePickerProps<DateValue> {
4
+ className?: string;
5
+ }
6
+ /**
7
+ * The field itself. Rendered inside the picker's `.ion-input` box, which owns
8
+ * the border, the background and the states — exactly as Combobox reuses it.
9
+ */
10
+ export declare function DateField({ className, ...props }: DateFieldProps): React.JSX.Element;
11
+ export declare namespace DateField {
12
+ var displayName: string;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=DateField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/components/DateField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4DjE,UAAU,cAAe,SAAQ,mBAAmB,CAAC,SAAS,CAAC;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyDD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,qBAqChE;yBArCe,SAAS"}
@@ -0,0 +1,74 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useRef } from 'react';
4
+ import { useDateField, useDateSegment, useLocale } from 'react-aria';
5
+ import { useDateFieldState } from 'react-stately';
6
+ import { createCalendar } from '@internationalized/date';
7
+ /**
8
+ * One segment — a month, a day, a year, or a literal separator.
9
+ *
10
+ * The literal is rendered by the same component rather than being filtered out
11
+ * before the map. `useDateSegment` returns the separator's own props, including
12
+ * the `aria-hidden` that keeps `/` and `.` out of the announcement, and
13
+ * re-deriving that here would mean re-deriving it wrongly the first time a
14
+ * locale used a separator nobody tested.
15
+ */
16
+ function Segment({ segment, state, }) {
17
+ const ref = useRef(null);
18
+ const { segmentProps } = useDateSegment(segment, state, ref);
19
+ return (_jsx("div", { ...segmentProps, ref: ref, className: [
20
+ 'ion-date-field__segment',
21
+ segment.isPlaceholder ? 'ion-date-field__segment--placeholder' : '',
22
+ segment.type === 'literal' ? 'ion-date-field__segment--literal' : '',
23
+ ]
24
+ .filter(Boolean)
25
+ .join(' '), "data-placeholder": segment.isPlaceholder || undefined, style: {
26
+ /*
27
+ * Reserves the width of the widest value this segment can hold, so the
28
+ * field does not jitter as it is filled.
29
+ *
30
+ * `maxValue` is the segment's own maximum — 31 for a day, 12 for a
31
+ * month — not a guess at digit count, which is what makes it correct
32
+ * for a locale whose year segment is two digits or whose month segment
33
+ * is a name. A literal has no maxValue and needs no reservation.
34
+ *
35
+ * `ch` rather than `em`: the digits are what is being measured, and in
36
+ * every sans-serif worth shipping the digits are tabular-width.
37
+ */
38
+ minWidth: segment.maxValue != null
39
+ ? `${String(segment.maxValue).length}ch`
40
+ : undefined,
41
+ }, children: segment.text }));
42
+ }
43
+ /**
44
+ * The field itself. Rendered inside the picker's `.ion-input` box, which owns
45
+ * the border, the background and the states — exactly as Combobox reuses it.
46
+ */
47
+ export function DateField({ className, ...props }) {
48
+ /*
49
+ * `useLocale` reads react-aria's I18nProvider, falling back to the browser's
50
+ * own locale when there is none. That fallback is why a consumer who never
51
+ * mounts a provider still gets their own date order rather than en-US.
52
+ */
53
+ const { locale } = useLocale();
54
+ const state = useDateFieldState({
55
+ ...props,
56
+ locale,
57
+ /*
58
+ * `createCalendar` is passed rather than imported by react-stately on
59
+ * purpose: it is the whole calendar-systems bundle, and a library that
60
+ * imported it directly would put every calendar in every consumer's bundle
61
+ * whether or not they render one. Handing it in is the opt-in.
62
+ */
63
+ createCalendar,
64
+ });
65
+ const ref = useRef(null);
66
+ const { fieldProps } = useDateField(props, state, ref);
67
+ return (_jsx("div", { ...fieldProps, ref: ref, className: ['ion-date-field', className].filter(Boolean).join(' '), children: state.segments.map((segment, i) => (
68
+ // Keyed by position, which is the only stable identity a segment
69
+ // has: the list is rebuilt whole when the locale changes, and two
70
+ // segments of the same type never coexist.
71
+ _jsx(Segment, { segment: segment, state: state }, i))) }));
72
+ }
73
+ DateField.displayName = 'DateField';
74
+ //# sourceMappingURL=DateField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateField.js","sourceRoot":"","sources":["../../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C;IAE/B,MAAM,KAAK,GAAG,iBAAiB,CAAC;QAC9B,GAAG,KAAK;QACR,MAAM;QACN;;;;;WAKG;QACH,cAAc;KACf,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAEvD,OAAO,CACL,iBACM,UAAU,EACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAEjE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,iEAAiE;QACjE,kEAAkE;QAClE,2CAA2C;QAC3C,KAAC,OAAO,IAAS,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,IAAjC,CAAC,CAAoC,CACpD,CAAC,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ import type { IsoDate } from './iso-date.js';
3
+ export type DatePickerSize = 'sm' | 'md' | 'lg';
4
+ export interface DatePickerProps {
5
+ /** Field label. Required for a usable control — see `a11y.requires`. */
6
+ label?: React.ReactNode;
7
+ /** Helper text below the field. */
8
+ description?: React.ReactNode;
9
+ /** Replaces the helper text when `isInvalid` is set. */
10
+ errorMessage?: React.ReactNode;
11
+ isInvalid?: boolean;
12
+ isDisabled?: boolean;
13
+ isReadOnly?: boolean;
14
+ isRequired?: boolean;
15
+ /** Matches Input's `Size` variant: Small, Medium, Large. */
16
+ size?: DatePickerSize;
17
+ /**
18
+ * The selected date as `YYYY-MM-DD`. `null` means nothing is selected.
19
+ *
20
+ * Not a `Date` and not a timestamp — a calendar date has no time and no
21
+ * timezone, so it cannot shift across midnight the way `new Date('2026-04-12')`
22
+ * does for every reader west of Greenwich. A malformed value throws rather
23
+ * than rendering an empty field.
24
+ */
25
+ value?: IsoDate | null;
26
+ /** The initial date as `YYYY-MM-DD`, for an uncontrolled picker. */
27
+ defaultValue?: IsoDate;
28
+ /** Fires with `YYYY-MM-DD`, or `null` when the field is cleared. */
29
+ onChange?: (value: IsoDate | null) => void;
30
+ /** Earliest selectable date, `YYYY-MM-DD`. Earlier dates are unreachable. */
31
+ minValue?: IsoDate;
32
+ /** Latest selectable date, `YYYY-MM-DD`. */
33
+ maxValue?: IsoDate;
34
+ /**
35
+ * Individual dates the calendar refuses — weekends, holidays, booked days.
36
+ * Receives `YYYY-MM-DD`. Use `minValue`/`maxValue` for a continuous bound;
37
+ * this is for the holes inside it.
38
+ */
39
+ isDateUnavailable?: (date: IsoDate) => boolean;
40
+ /** Posts the value under this name, for an uncontrolled form. */
41
+ name?: string;
42
+ /** Accessible label for the button that opens the calendar. */
43
+ calendarLabel?: string;
44
+ className?: string;
45
+ wrapperClassName?: string;
46
+ id?: string;
47
+ }
48
+ /**
49
+ * DatePicker — a segmented date field with a calendar attached.
50
+ *
51
+ * WHY NOT `<input type="date">`
52
+ *
53
+ * The native control is genuinely good on mobile and genuinely unusable as a
54
+ * design system component on desktop: its calendar cannot be styled at all, it
55
+ * cannot express an unavailable date that is not part of a continuous min/max
56
+ * range, and Safari on macOS renders no calendar button whatsoever. A system
57
+ * whose date field looks like a different control in every browser is not a
58
+ * design system, so this rebuilds it — and pays for that by having to rebuild
59
+ * the keyboard handling and the screen-reader semantics the native control gave
60
+ * away for free. React Aria's `useDatePicker` is what builds them back.
61
+ *
62
+ * THE VALUE IS A STRING, THE DISPLAY IS NOT
63
+ *
64
+ * `value` is always `YYYY-MM-DD` in the Gregorian calendar. What the user SEES
65
+ * is their own locale's field order and their own calendar system, resolved
66
+ * from `Intl` — so a German reader edits DD.MM.YYYY and the value still comes
67
+ * back as `2026-04-12`. See `iso-date.ts` for why the public type is not
68
+ * react-aria's `CalendarDate`.
69
+ *
70
+ * THE FIELD IS EDITABLE WITHOUT THE CALENDAR, AND THAT IS THE POINT
71
+ *
72
+ * Typing a date is faster than clicking one for anybody who knows the date they
73
+ * want, and paging a calendar back to a birth year is miserable. The segments
74
+ * take digits and arrow keys directly; the calendar is for the cases where the
75
+ * date is being chosen rather than recalled.
76
+ */
77
+ export declare function DatePicker({ label, description, errorMessage, isInvalid, isDisabled, isReadOnly, isRequired, size, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, name, calendarLabel, className, wrapperClassName, id, }: DatePickerProps): React.JSX.Element;
78
+ export declare namespace DatePicker {
79
+ var displayName: string;
80
+ }
81
+ //# sourceMappingURL=DatePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAOtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAchD,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,mCAAmC;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wDAAwD;IACxD,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,oEAAoE;IACpE,YAAY,CAAC,E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