chrona-react 0.2.0 → 0.3.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 (34) hide show
  1. package/AGENTS.md +8 -2
  2. package/README.md +230 -7
  3. package/dist/calendar.js +3 -2
  4. package/dist/{chunk-JNQXKZO3.js → chunk-27APJXNX.js} +23 -9
  5. package/dist/chunk-27APJXNX.js.map +1 -0
  6. package/dist/{chunk-QQANBK5G.js → chunk-GXQA645Q.js} +9 -5
  7. package/dist/chunk-GXQA645Q.js.map +1 -0
  8. package/dist/{chunk-RCWVBOO6.js → chunk-I46LC4EZ.js} +12 -3
  9. package/dist/chunk-I46LC4EZ.js.map +1 -0
  10. package/dist/{chunk-2GZMCFFY.js → chunk-RTDRFDYG.js} +3 -2
  11. package/dist/{chunk-2GZMCFFY.js.map → chunk-RTDRFDYG.js.map} +1 -1
  12. package/dist/{chunk-GN2YCKFZ.js → chunk-SDDSKOYU.js} +3 -1
  13. package/dist/{chunk-GN2YCKFZ.js.map → chunk-SDDSKOYU.js.map} +1 -1
  14. package/dist/{chunk-ROJQDSGQ.js → chunk-WMHLPJBG.js} +3 -2
  15. package/dist/{chunk-ROJQDSGQ.js.map → chunk-WMHLPJBG.js.map} +1 -1
  16. package/dist/{chunk-U4LLSRIH.js → chunk-YMCXDNWB.js} +5 -4
  17. package/dist/{chunk-U4LLSRIH.js.map → chunk-YMCXDNWB.js.map} +1 -1
  18. package/dist/date-field.js +4 -3
  19. package/dist/date-picker.js +6 -5
  20. package/dist/index.js +8 -7
  21. package/dist/range-calendar.js +4 -3
  22. package/dist/time-field.js +4 -3
  23. package/package.json +3 -3
  24. package/dist/calendar.d.ts +0 -142
  25. package/dist/chunk-JNQXKZO3.js.map +0 -1
  26. package/dist/chunk-QQANBK5G.js.map +0 -1
  27. package/dist/chunk-RCWVBOO6.js.map +0 -1
  28. package/dist/date-field.d.ts +0 -74
  29. package/dist/date-picker.d.ts +0 -69
  30. package/dist/field-DayikvR6.d.ts +0 -11
  31. package/dist/form-BCAGbNh-.d.ts +0 -20
  32. package/dist/index.d.ts +0 -10
  33. package/dist/range-calendar.d.ts +0 -233
  34. package/dist/time-field.d.ts +0 -74
@@ -1,74 +0,0 @@
1
- import { P as PartProps, H as HiddenInputProps, C as ChronaConfig } from './form-BCAGbNh-.js';
2
- import * as chrona_core from 'chrona-core';
3
- import * as React from 'react';
4
- import { F as FieldProps } from './field-DayikvR6.js';
5
-
6
- type DateFieldProps = FieldProps<"date">;
7
- declare const DateField: {
8
- Root: ({ children, asChild, className, style, ...props }: FieldProps<"date"> & Pick<PartProps, "children" | "asChild" | "className" | "style">) => React.JSX.Element;
9
- Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
10
- asChild?: boolean;
11
- } & React.RefAttributes<HTMLElement>>;
12
- Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
13
- asChild?: boolean;
14
- } & React.RefAttributes<HTMLElement>>;
15
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
16
- type: chrona_core.SegmentType;
17
- } & React.RefAttributes<HTMLInputElement>>;
18
- HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
19
- ClearButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
20
- asChild?: boolean;
21
- } & React.RefAttributes<HTMLElement>>;
22
- LiveRegion: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
23
- asChild?: boolean;
24
- } & React.RefAttributes<HTMLElement>>;
25
- };
26
- declare function useDateField(props?: DateFieldProps): {
27
- id: string;
28
- state: chrona_core.FieldState<"date">;
29
- options: FieldProps<"date"> & ChronaConfig;
30
- send: (event: chrona_core.FieldEvent) => void;
31
- reset: () => void;
32
- moveFocus: (segment: chrona_core.SegmentType, offset: number) => void;
33
- groupRef: React.RefObject<HTMLElement | null>;
34
- announcement: string;
35
- registerLabel: React.Dispatch<React.SetStateAction<boolean>>;
36
- api: {
37
- segments: {
38
- type: chrona_core.SegmentType | "literal";
39
- value: string;
40
- }[];
41
- getGroupProps: () => {
42
- role: "group";
43
- "aria-labelledby": string | undefined;
44
- "aria-describedby": string | undefined;
45
- "aria-invalid": true | undefined;
46
- "data-scope": string;
47
- "data-part": string;
48
- "data-invalid": string | undefined;
49
- "data-disabled": string | undefined;
50
- "data-readonly": string | undefined;
51
- dir: "ltr" | "rtl" | undefined;
52
- };
53
- getSegmentProps: (segment: chrona_core.SegmentType) => {
54
- role: "spinbutton";
55
- "aria-label": string;
56
- "aria-valuemin": number;
57
- "aria-valuemax": number;
58
- "aria-valuenow": number | undefined;
59
- "aria-valuetext": string;
60
- "aria-required": true | undefined;
61
- "aria-invalid": true | undefined;
62
- "aria-describedby": string | undefined;
63
- "aria-readonly": true | undefined;
64
- "data-scope": string;
65
- "data-part": string;
66
- "data-segment": chrona_core.SegmentName;
67
- "data-placeholder": string | undefined;
68
- "data-invalid": string | undefined;
69
- display: string;
70
- };
71
- };
72
- };
73
-
74
- export { DateField, type DateFieldProps, useDateField };
@@ -1,69 +0,0 @@
1
- import { P as PartProps, H as HiddenInputProps } from './form-BCAGbNh-.js';
2
- import * as chrona_core from 'chrona-core';
3
- import { PlainDate, PickerEvent } from 'chrona-core';
4
- import * as React from 'react';
5
- import { CalendarProps } from './calendar.js';
6
- import { DateFieldProps } from './date-field.js';
7
- import 'temporal-spec';
8
- import './field-DayikvR6.js';
9
-
10
- interface DatePickerProps extends DateFieldProps {
11
- open?: boolean;
12
- defaultOpen?: boolean;
13
- onOpenChange?: (open: boolean) => void;
14
- modal?: boolean;
15
- timeZone?: string;
16
- firstDayOfWeek?: number;
17
- fixedWeeks?: boolean;
18
- numberOfMonths?: number;
19
- pagedNavigation?: boolean;
20
- }
21
- interface PickerContext {
22
- props: DatePickerProps;
23
- options: DatePickerProps;
24
- state: {
25
- value: PlainDate | null;
26
- open: boolean;
27
- };
28
- id: string;
29
- value: PlainDate | null;
30
- change: (value: PlainDate | null) => void;
31
- open: boolean;
32
- send: (event: PickerEvent) => void;
33
- trigger: {
34
- current: HTMLElement | null;
35
- };
36
- labelled: boolean;
37
- registerLabel: (present: boolean) => void;
38
- }
39
- declare function Root({ children, asChild, className, style, ...input }: DatePickerProps & Pick<PartProps, "children" | "asChild" | "className" | "style">): React.JSX.Element;
40
- declare function useDatePicker(input?: DatePickerProps): PickerContext;
41
- declare function PickerCalendar({ children, ...props }: Omit<CalendarProps, "value" | "defaultValue" | "onChange"> & Pick<PartProps, "children" | "className" | "style">): React.JSX.Element;
42
- declare const DatePicker: {
43
- Root: typeof Root;
44
- Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
45
- asChild?: boolean;
46
- } & React.RefAttributes<HTMLElement>>;
47
- Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
48
- asChild?: boolean;
49
- } & React.RefAttributes<HTMLElement>>;
50
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
51
- type: chrona_core.SegmentType;
52
- } & React.RefAttributes<HTMLInputElement>>;
53
- HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
54
- ClearButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
55
- asChild?: boolean;
56
- } & React.RefAttributes<HTMLElement>>;
57
- LiveRegion: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
58
- asChild?: boolean;
59
- } & React.RefAttributes<HTMLElement>>;
60
- Trigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
61
- asChild?: boolean;
62
- } & React.RefAttributes<HTMLElement>>;
63
- Popover: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref">, "open"> & {
64
- anchored?: boolean;
65
- } & React.RefAttributes<HTMLDialogElement>>;
66
- Calendar: typeof PickerCalendar;
67
- };
68
-
69
- export { DatePicker, type DatePickerProps, useDatePicker };
@@ -1,11 +0,0 @@
1
- import { FieldKind, FieldOptions, FieldValue, FieldInvalidReason } from 'chrona-core';
2
-
3
- interface FieldProps<Kind extends FieldKind> extends FieldOptions<Kind> {
4
- defaultValue?: FieldValue<Kind> | null;
5
- onChange?: (value: FieldValue<Kind> | null) => void;
6
- onInvalid?: (reason: FieldInvalidReason) => void;
7
- id?: string;
8
- describedBy?: string;
9
- }
10
-
11
- export type { FieldProps as F };
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import { Translations } from 'chrona-core';
3
-
4
- interface ChronaConfig {
5
- locale?: string;
6
- timeZone?: string;
7
- dir?: "ltr" | "rtl";
8
- translations?: Partial<Translations>;
9
- }
10
- declare function ChronaProvider({ children, ...config }: ChronaConfig & {
11
- children: React.ReactNode;
12
- }): React.JSX.Element;
13
-
14
- type PartProps = React.HTMLAttributes<HTMLElement> & {
15
- asChild?: boolean;
16
- };
17
-
18
- type HiddenInputProps = Omit<React.ComponentPropsWithoutRef<"input">, "type" | "value" | "defaultValue" | "onChange">;
19
-
20
- export { type ChronaConfig as C, type HiddenInputProps as H, type PartProps as P, ChronaProvider as a };
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export { Calendar, CalendarProps, CalendarRoot, Weekday, useCalendar } from './calendar.js';
2
- export { C as ChronaConfig, a as ChronaProvider } from './form-BCAGbNh-.js';
3
- export { DateField, DateFieldProps, useDateField } from './date-field.js';
4
- export { TimeField, TimeFieldProps, useTimeField } from './time-field.js';
5
- export { DatePicker, DatePickerProps, useDatePicker } from './date-picker.js';
6
- export { RangeCalendar, RangeCalendarProps, useRangeCalendar } from './range-calendar.js';
7
- import 'temporal-spec';
8
- import 'chrona-core';
9
- import 'react';
10
- import './field-DayikvR6.js';
@@ -1,233 +0,0 @@
1
- import { CalendarProps, Weekday } from './calendar.js';
2
- import * as chrona_core from 'chrona-core';
3
- import { DateRange, PlainDate, RangeEvent } from 'chrona-core';
4
- import * as temporal_spec from 'temporal-spec';
5
- import { P as PartProps, H as HiddenInputProps, C as ChronaConfig } from './form-BCAGbNh-.js';
6
- import * as React from 'react';
7
-
8
- interface RangeCalendarProps extends Omit<CalendarProps, "value" | "defaultValue" | "onChange"> {
9
- value?: DateRange | null;
10
- defaultValue?: DateRange | null;
11
- onChange?: (value: DateRange | null) => void;
12
- onRangeStartChange?: (value: PlainDate | null) => void;
13
- onInvalid?: () => void;
14
- }
15
- declare function useRangeCalendar(input?: RangeCalendarProps): {
16
- state: {
17
- value: DateRange | null;
18
- anchor: PlainDate | null;
19
- preview: PlainDate | null;
20
- invalid: boolean;
21
- };
22
- send: (event: RangeEvent) => void;
23
- announcement: string;
24
- props: RangeCalendarProps & ChronaConfig;
25
- options: RangeCalendarProps & ChronaConfig;
26
- api: {
27
- getCellProps: (date: PlainDate, month?: PlainDate) => {
28
- "data-scope": string;
29
- "data-selected": string | undefined;
30
- "data-in-range": string | undefined;
31
- "data-range-start": string | undefined;
32
- "data-range-end": string | undefined;
33
- "data-preview": string | undefined;
34
- "data-invalid": string | undefined;
35
- "aria-selected": boolean;
36
- "data-date": string;
37
- "data-focused": string | undefined;
38
- "data-disabled": string | undefined;
39
- "data-unavailable": string | undefined;
40
- "data-outside-month": string | undefined;
41
- "data-today": string | undefined;
42
- role: "gridcell";
43
- "aria-disabled": true | undefined;
44
- "data-part": string;
45
- };
46
- getCellTriggerProps: (date: PlainDate, month?: PlainDate) => {
47
- "data-scope": string;
48
- "data-selected": string | undefined;
49
- "data-in-range": string | undefined;
50
- "data-range-start": string | undefined;
51
- "data-range-end": string | undefined;
52
- "data-preview": string | undefined;
53
- "data-invalid": string | undefined;
54
- "data-date": string;
55
- "data-focused": string | undefined;
56
- "data-disabled": string | undefined;
57
- "data-unavailable": string | undefined;
58
- "data-outside-month": string | undefined;
59
- "data-today": string | undefined;
60
- id: string;
61
- type: "button";
62
- tabIndex: number;
63
- "aria-label": string;
64
- "aria-disabled": true | undefined;
65
- "aria-current": "date" | undefined;
66
- "data-part": string;
67
- };
68
- getRootProps: () => {
69
- dir: "ltr" | "rtl" | undefined;
70
- "data-disabled": string | undefined;
71
- "data-readonly": string | undefined;
72
- "data-scope": string;
73
- "data-part": string;
74
- };
75
- getGridProps: (month?: temporal_spec.Temporal.PlainDate) => {
76
- role: "grid";
77
- "aria-label": string;
78
- "aria-readonly": true | undefined;
79
- "aria-disabled": true | undefined;
80
- "data-scope": string;
81
- "data-part": string;
82
- };
83
- getPrevButtonProps: () => {
84
- type: "button";
85
- "aria-label": string;
86
- disabled: boolean;
87
- "data-scope": string;
88
- "data-part": string;
89
- };
90
- getNextButtonProps: () => {
91
- type: "button";
92
- "aria-label": string;
93
- disabled: boolean;
94
- "data-scope": string;
95
- "data-part": string;
96
- };
97
- };
98
- rootRef: React.RefObject<HTMLElement | null>;
99
- months: temporal_spec.Temporal.PlainDate[];
100
- reset(): void;
101
- calendar: {
102
- api: {
103
- getCellProps: (date: PlainDate, month?: PlainDate) => {
104
- "data-scope": string;
105
- "data-selected": string | undefined;
106
- "data-in-range": string | undefined;
107
- "data-range-start": string | undefined;
108
- "data-range-end": string | undefined;
109
- "data-preview": string | undefined;
110
- "data-invalid": string | undefined;
111
- "aria-selected": boolean;
112
- "data-date": string;
113
- "data-focused": string | undefined;
114
- "data-disabled": string | undefined;
115
- "data-unavailable": string | undefined;
116
- "data-outside-month": string | undefined;
117
- "data-today": string | undefined;
118
- role: "gridcell";
119
- "aria-disabled": true | undefined;
120
- "data-part": string;
121
- };
122
- getCellTriggerProps: (date: PlainDate, month?: PlainDate) => {
123
- "data-scope": string;
124
- "data-selected": string | undefined;
125
- "data-in-range": string | undefined;
126
- "data-range-start": string | undefined;
127
- "data-range-end": string | undefined;
128
- "data-preview": string | undefined;
129
- "data-invalid": string | undefined;
130
- "data-date": string;
131
- "data-focused": string | undefined;
132
- "data-disabled": string | undefined;
133
- "data-unavailable": string | undefined;
134
- "data-outside-month": string | undefined;
135
- "data-today": string | undefined;
136
- id: string;
137
- type: "button";
138
- tabIndex: number;
139
- "aria-label": string;
140
- "aria-disabled": true | undefined;
141
- "aria-current": "date" | undefined;
142
- "data-part": string;
143
- };
144
- getRootProps: () => {
145
- dir: "ltr" | "rtl" | undefined;
146
- "data-disabled": string | undefined;
147
- "data-readonly": string | undefined;
148
- "data-scope": string;
149
- "data-part": string;
150
- };
151
- getGridProps: (month?: temporal_spec.Temporal.PlainDate) => {
152
- role: "grid";
153
- "aria-label": string;
154
- "aria-readonly": true | undefined;
155
- "aria-disabled": true | undefined;
156
- "data-scope": string;
157
- "data-part": string;
158
- };
159
- getPrevButtonProps: () => {
160
- type: "button";
161
- "aria-label": string;
162
- disabled: boolean;
163
- "data-scope": string;
164
- "data-part": string;
165
- };
166
- getNextButtonProps: () => {
167
- type: "button";
168
- "aria-label": string;
169
- disabled: boolean;
170
- "data-scope": string;
171
- "data-part": string;
172
- };
173
- };
174
- state: chrona_core.CalendarState;
175
- options: CalendarProps & ChronaConfig;
176
- send: (event: chrona_core.CalendarEvent) => void;
177
- rootRef: React.RefObject<HTMLElement | null>;
178
- announcement: string;
179
- months: temporal_spec.Temporal.PlainDate[];
180
- };
181
- };
182
- declare function Root({ children, asChild, className, style, ...props }: RangeCalendarProps & Pick<PartProps, "children" | "asChild" | "className" | "style">): React.JSX.Element;
183
- declare function HiddenInput({ name, form, id, disabled, ...inputProps }: HiddenInputProps & {
184
- name: string;
185
- }): React.JSX.Element;
186
- declare const RangeCalendar: {
187
- Root: typeof Root;
188
- Cell: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement> & {
189
- asChild?: boolean;
190
- } & {
191
- date: PlainDate;
192
- } & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
193
- GridBody: React.ForwardRefExoticComponent<Omit<Omit<PartProps, "children"> & {
194
- children?: (date: PlainDate) => React.ReactNode;
195
- } & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
196
- LiveRegion: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
197
- asChild?: boolean;
198
- } & React.RefAttributes<HTMLElement>>;
199
- ClearButton: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
200
- asChild?: boolean;
201
- } & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
202
- HiddenInput: typeof HiddenInput;
203
- Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
204
- asChild?: boolean;
205
- } & React.RefAttributes<HTMLElement>>;
206
- Heading: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
207
- asChild?: boolean;
208
- } & React.RefAttributes<HTMLElement>>;
209
- PrevButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
210
- asChild?: boolean;
211
- } & React.RefAttributes<HTMLElement>>;
212
- NextButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
213
- asChild?: boolean;
214
- } & React.RefAttributes<HTMLElement>>;
215
- Grid: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
216
- asChild?: boolean;
217
- } & {
218
- monthIndex?: number;
219
- } & React.RefAttributes<HTMLElement>>;
220
- GridHeader: React.ForwardRefExoticComponent<Omit<PartProps, "children"> & {
221
- children?: (day: Weekday) => React.ReactNode;
222
- } & React.RefAttributes<HTMLElement>>;
223
- HeaderCell: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
224
- asChild?: boolean;
225
- } & {
226
- day: Weekday;
227
- } & React.RefAttributes<HTMLElement>>;
228
- CellTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
229
- asChild?: boolean;
230
- } & React.RefAttributes<HTMLElement>>;
231
- };
232
-
233
- export { RangeCalendar, type RangeCalendarProps, useRangeCalendar };
@@ -1,74 +0,0 @@
1
- import { P as PartProps, H as HiddenInputProps, C as ChronaConfig } from './form-BCAGbNh-.js';
2
- import * as chrona_core from 'chrona-core';
3
- import * as React from 'react';
4
- import { F as FieldProps } from './field-DayikvR6.js';
5
-
6
- type TimeFieldProps = FieldProps<"time">;
7
- declare const TimeField: {
8
- Root: ({ children, asChild, className, style, ...props }: FieldProps<"time"> & Pick<PartProps, "children" | "asChild" | "className" | "style">) => React.JSX.Element;
9
- Label: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
10
- asChild?: boolean;
11
- } & React.RefAttributes<HTMLElement>>;
12
- Field: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
13
- asChild?: boolean;
14
- } & React.RefAttributes<HTMLElement>>;
15
- Segment: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "value" | "type"> & {
16
- type: chrona_core.SegmentType;
17
- } & React.RefAttributes<HTMLInputElement>>;
18
- HiddenInput: (props: HiddenInputProps) => React.JSX.Element;
19
- ClearButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
20
- asChild?: boolean;
21
- } & React.RefAttributes<HTMLElement>>;
22
- LiveRegion: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
23
- asChild?: boolean;
24
- } & React.RefAttributes<HTMLElement>>;
25
- };
26
- declare function useTimeField(props?: TimeFieldProps): {
27
- id: string;
28
- state: chrona_core.FieldState<"time">;
29
- options: FieldProps<"time"> & ChronaConfig;
30
- send: (event: chrona_core.FieldEvent) => void;
31
- reset: () => void;
32
- moveFocus: (segment: chrona_core.SegmentType, offset: number) => void;
33
- groupRef: React.RefObject<HTMLElement | null>;
34
- announcement: string;
35
- registerLabel: React.Dispatch<React.SetStateAction<boolean>>;
36
- api: {
37
- segments: {
38
- type: chrona_core.SegmentType | "literal";
39
- value: string;
40
- }[];
41
- getGroupProps: () => {
42
- role: "group";
43
- "aria-labelledby": string | undefined;
44
- "aria-describedby": string | undefined;
45
- "aria-invalid": true | undefined;
46
- "data-scope": string;
47
- "data-part": string;
48
- "data-invalid": string | undefined;
49
- "data-disabled": string | undefined;
50
- "data-readonly": string | undefined;
51
- dir: "ltr" | "rtl" | undefined;
52
- };
53
- getSegmentProps: (segment: chrona_core.SegmentType) => {
54
- role: "spinbutton";
55
- "aria-label": string;
56
- "aria-valuemin": number;
57
- "aria-valuemax": number;
58
- "aria-valuenow": number | undefined;
59
- "aria-valuetext": string;
60
- "aria-required": true | undefined;
61
- "aria-invalid": true | undefined;
62
- "aria-describedby": string | undefined;
63
- "aria-readonly": true | undefined;
64
- "data-scope": string;
65
- "data-part": string;
66
- "data-segment": chrona_core.SegmentName;
67
- "data-placeholder": string | undefined;
68
- "data-invalid": string | undefined;
69
- display: string;
70
- };
71
- };
72
- };
73
-
74
- export { TimeField, type TimeFieldProps, useTimeField };