@fusion.dev/helix-headless 0.159.0 → 0.161.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 (61) hide show
  1. package/custom-elements.json +2980 -189
  2. package/dist/canvas/root/canvas-root.d.ts +59 -2
  3. package/dist/canvas/root/canvas-root.js +123 -8
  4. package/dist/chat/message/chat-message.d.ts +8 -0
  5. package/dist/chat/message/chat-message.js +11 -0
  6. package/dist/chat/root/chat-root.d.ts +47 -1
  7. package/dist/chat/root/chat-root.js +130 -4
  8. package/dist/code-block/lines.d.ts +12 -0
  9. package/dist/code-block/lines.js +41 -0
  10. package/dist/code-block/root/code-block-root.d.ts +88 -5
  11. package/dist/code-block/root/code-block-root.js +154 -10
  12. package/dist/date-input/root/date-input-root.d.ts +108 -19
  13. package/dist/date-input/root/date-input-root.js +112 -13
  14. package/dist/date-picker/root/date-picker-root.d.ts +81 -16
  15. package/dist/date-picker/root/date-picker-root.js +140 -36
  16. package/dist/element-events.generated.js +6 -0
  17. package/dist/format-date/fields.js +1 -0
  18. package/dist/format-date/options.d.ts +3 -1
  19. package/dist/format-date/options.js +4 -1
  20. package/dist/format-date/root/format-date-root.d.ts +27 -11
  21. package/dist/format-date/root/format-date-root.js +6 -0
  22. package/dist/listbox/root/listbox-root.js +5 -0
  23. package/dist/notifications/notification/notification.d.ts +1 -0
  24. package/dist/notifications/notification/notification.js +2 -1
  25. package/dist/slider/root/slider-root.d.ts +54 -3
  26. package/dist/slider/root/slider-root.js +124 -2
  27. package/dist/splitter/root/splitter-root.d.ts +15 -0
  28. package/dist/splitter/root/splitter-root.js +16 -2
  29. package/dist/table/grid-controller.d.ts +7 -1
  30. package/dist/table/grid-controller.js +9 -1
  31. package/dist/table/root/table-root.d.ts +122 -0
  32. package/dist/table/root/table-root.js +293 -17
  33. package/dist/table/row/table-row.d.ts +41 -0
  34. package/dist/table/row/table-row.js +56 -2
  35. package/dist/time-input/root/time-input-root.d.ts +55 -7
  36. package/dist/time-input/root/time-input-root.js +70 -10
  37. package/dist/time-picker/root/time-picker-root.d.ts +27 -5
  38. package/dist/time-picker/root/time-picker-root.js +52 -13
  39. package/dist/timeline/item/timeline-item.d.ts +47 -10
  40. package/dist/timeline/item/timeline-item.js +36 -4
  41. package/dist/toggle/group/toggle-group.d.ts +18 -1
  42. package/dist/toggle/group/toggle-group.js +8 -2
  43. package/dist/toggle/root/toggle-root.d.ts +2 -2
  44. package/dist/toggle/root/toggle-root.js +2 -1
  45. package/dist/video-playlist/item/video-playlist-item.d.ts +11 -0
  46. package/dist/video-playlist/item/video-playlist-item.js +5 -0
  47. package/dist/video-playlist/menu/video-playlist-menu.d.ts +6 -0
  48. package/dist/video-playlist/menu/video-playlist-menu.js +11 -0
  49. package/dist/video-playlist/root/video-playlist-root.d.ts +59 -5
  50. package/dist/video-playlist/root/video-playlist-root.js +82 -10
  51. package/dist/virtual-list/fill.d.ts +6 -1
  52. package/dist/virtual-list/fill.js +1 -1
  53. package/dist/virtual-list/keys.d.ts +8 -0
  54. package/dist/virtual-list/keys.js +20 -0
  55. package/dist/virtual-list/root/virtual-list-root.d.ts +98 -13
  56. package/dist/virtual-list/root/virtual-list-root.js +195 -20
  57. package/lint.json +1 -1
  58. package/package.json +5 -5
  59. package/types/jsx.d.ts +1596 -224
  60. package/types/vue.d.ts +404 -49
  61. package/types/words.d.ts +151 -0
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { AriaForwardController, valueAsDate as asDate, barredBy, calendarLocale, customElement, formatWords, dateAsValue as fromDate, HelixFormElement, handedLocale, isDateValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, words, wordsLocale, } from '@fusion.dev/helix-core';
8
- import { calendarBlank } from '@fusion.dev/helix-icons';
7
+ import { AriaForwardController, valueAsDate as asDate, barredBy, calendarLocale, customElement, drawIcon, formatWords, dateAsValue as fromDate, HelixClearEvent, HelixFormElement, handedLocale, isDateValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, MONTH_CALENDARS, monthSystem, readWrittenDate, words, wordsLocale, } from '@fusion.dev/helix-core';
8
+ import { calendarBlank, x } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
11
11
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
@@ -25,6 +25,8 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
25
25
  });
26
26
  this.autocomplete = '';
27
27
  this.calendarLabel = 'Date Picker';
28
+ this.clearable = false;
29
+ this.clearLabel = 'Clear';
28
30
  this.announcesInput = true;
29
31
  this.dateStyle = 'long';
30
32
  this.disableDates = '';
@@ -47,8 +49,10 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
47
49
  this.rangeOverflowMessage = 'Choose a date on or before {max}.';
48
50
  this.rangeUnderflowMessage = 'Choose a date on or after {min}.';
49
51
  this.removeLabel = 'Remove {name}';
52
+ this.selectionLabel = '{kind, select, date {Selected date: {start}} start {Range starts {start}. Choose the day it ends.} range {Selected range: {start} to {end}} other {{count, plural, one {# date selected} other {# dates selected}}}}';
50
53
  this.step = 1;
51
54
  this.stepMismatchMessage = 'Choose one of the dates the calendar offers.';
55
+ this.timeZone = '';
52
56
  this.triggerLabel = 'Choose a date';
53
57
  this.draft = '';
54
58
  this.handleInput = (event) => {
@@ -64,15 +68,28 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
64
68
  this.requestValue(whole ? held.join(',') : typed);
65
69
  this.restore();
66
70
  };
71
+ this.handleTextCommit = (event) => {
72
+ if (this.mode !== 'multiple') {
73
+ const held = this.mode === 'range' && /\s[–-]\s/.test(this.value)
74
+ ? this.value.split(/\s+[–-]\s+/).map((one) => one.trim())
75
+ : dates(this.value);
76
+ const read = held.map((one) => this.read(one));
77
+ if (held.length > 0 && !held.every(isDateValue) && read.every(Boolean)) {
78
+ this.requestValue(read.join(','));
79
+ }
80
+ }
81
+ this.handleCommit(event);
82
+ };
67
83
  this.handleDraftKey = (event) => {
68
84
  if (this.mode !== 'multiple') {
69
85
  return;
70
86
  }
71
87
  const held = dates(this.value);
72
- if (event.key === 'Enter' && isDateValue(this.draft)) {
88
+ const draft = this.read(this.draft.trim());
89
+ if (event.key === 'Enter' && draft !== '') {
73
90
  event.preventDefault();
74
- if (!held.includes(this.draft)) {
75
- this.requestPicked([...held, this.draft].join(','));
91
+ if (!held.includes(draft)) {
92
+ this.requestPicked([...held, draft].join(','));
76
93
  }
77
94
  this.draft = '';
78
95
  }
@@ -100,10 +117,24 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
100
117
  }
101
118
  };
102
119
  this.unavailableMessage = 'Choose a date that is available.';
120
+ this.unreadableMessage = '{mode, select, single {Enter a date as YYYY-MM-DD.} other {Enter dates as YYYY-MM-DD, separated by commas.}}';
103
121
  this.yearViewLabel = '{heading}. Choose a year';
104
122
  this.handleIconChange = () => {
105
123
  this.requestUpdate();
106
124
  };
125
+ this.handleAutofill = (event) => {
126
+ const filled = event.currentTarget.value;
127
+ if (isDateValue(filled)) {
128
+ this.requestPicked(filled);
129
+ }
130
+ };
131
+ this.handleClear = () => {
132
+ if (this.value !== '' && this.requestValue('')) {
133
+ this.announceChange();
134
+ this.dispatchEvent(new HelixClearEvent());
135
+ }
136
+ void this.updateComplete.then(() => this.returnFocus());
137
+ };
107
138
  }
108
139
  static { this.words = 'helix-date-input'; }
109
140
  get language() {
@@ -125,24 +156,34 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
125
156
  }
126
157
  willUpdate(changed) {
127
158
  super.willUpdate(changed);
159
+ this.toggleState('blank', this.value === '');
128
160
  if (changed.has('months') || changed.has('locale') || changed.has('calendar')) {
129
161
  this.fitted = undefined;
130
162
  this.wide = undefined;
131
163
  }
164
+ if (changed.has('open') && this.open) {
165
+ this.partNamed('picker')?.showChosen?.();
166
+ }
132
167
  }
133
168
  get picked() {
134
169
  const held = dates(this.value);
135
170
  return held.length > 0 && held.every(isDateValue) ? held.join(',') : '';
136
171
  }
137
172
  get segmentable() {
138
- return this.mode === undefined;
173
+ return this.mode !== 'multiple';
174
+ }
175
+ get segmentGroups() {
176
+ return this.mode === 'range' ? 2 : 1;
139
177
  }
140
178
  get segmentedKind() {
141
179
  return 'date';
142
180
  }
143
181
  get segmentLocale() {
144
182
  const tag = calendarLocale(this.language, this.calendar);
145
- return tag.includes('-ca-iso8601') ? tag : calendarLocale(tag, 'gregory');
183
+ return tag.includes('-ca-iso8601') || this.segmentSystem ? tag : calendarLocale(tag, 'gregory');
184
+ }
185
+ get segmentSystem() {
186
+ return MONTH_CALENDARS.includes(this.calendar ?? '') ? monthSystem(this.calendar) : undefined;
146
187
  }
147
188
  written(date) {
148
189
  if (this.dateStyle === 'iso' || !isDateValue(date)) {
@@ -167,6 +208,9 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
167
208
  const written = held.map((one) => this.written(one));
168
209
  return this.mode === 'range' ? written.join(' – ') : written.join(', ');
169
210
  }
211
+ read(text) {
212
+ return isDateValue(text) ? text : readWrittenDate(text, this.segmentLocale, this.segmentSystem);
213
+ }
170
214
  get shownDates() {
171
215
  const held = dates(this.value);
172
216
  return this.shownLimit > 0 ? held.slice(0, this.shownLimit) : held;
@@ -185,9 +229,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
185
229
  const held = dates(this.value);
186
230
  if (held.length > 0 && !held.every(isDateValue)) {
187
231
  return (this.badInputMessage ||
188
- (this.mode === undefined
189
- ? 'Enter a date as YYYY-MM-DD.'
190
- : 'Enter dates as YYYY-MM-DD, separated by commas.'));
232
+ formatWords(this, 'unreadableMessage', { mode: this.mode ?? 'single' }));
191
233
  }
192
234
  if (this.min !== '' && held.some((one) => one < this.min)) {
193
235
  return [
@@ -230,7 +272,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
230
272
  period-disabled: picker-period-disabled, period-row: picker-period-row,
231
273
  period-selected: picker-period-selected, periods: picker-periods,
232
274
  previous: picker-previous, previous-mark: picker-previous-mark,
233
- week: picker-week, weekday: picker-weekday"
275
+ selection: picker-selection, week: picker-week, weekday: picker-weekday"
234
276
  ?invalid=${this.resolvedFeedback !== ''}
235
277
  mode=${this.mode ?? nothing}
236
278
  months=${this.fitted ?? this.months}
@@ -251,7 +293,9 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
251
293
  previous-label=${this.previousLabel}
252
294
  previous-year-label=${this.previousYearLabel}
253
295
  previous-years-label=${this.previousYearsLabel}
296
+ selection-label=${this.selectionLabel}
254
297
  step=${this.step}
298
+ time-zone=${this.timeZone || nothing}
255
299
  year-view-label=${this.yearViewLabel}
256
300
  .dayContent=${this.dayContent}
257
301
  .isDateUnavailable=${this.isDateUnavailable}
@@ -290,6 +334,29 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
290
334
  ${unsafeSVG(calendarBlank.content)}
291
335
  </svg></slot>`;
292
336
  }
337
+ renderAutofill() {
338
+ if (this.autocomplete === '' || this.autocomplete === 'off') {
339
+ return nothing;
340
+ }
341
+ return html `<input
342
+ type="date"
343
+ aria-hidden="true"
344
+ autocomplete=${this.autocomplete}
345
+ name=${this.name || nothing}
346
+ style="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none"
347
+ tabindex="-1"
348
+ .value=${isDateValue(this.value) ? this.value : ''}
349
+ ?disabled=${this.isDisabled}
350
+ @change=${this.handleAutofill}
351
+ @input=${this.stopInner}
352
+ />`;
353
+ }
354
+ get showsClear() {
355
+ return this.clearable && this.value !== '' && !this.isDisabled && !this.readOnly;
356
+ }
357
+ renderClearIcon() {
358
+ return html `<slot name="clear-icon">${drawIcon(x)}</slot>`;
359
+ }
293
360
  renderControl() {
294
361
  return html `<input
295
362
  part="control"
@@ -300,6 +367,10 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
300
367
  placeholder=${this.mode === 'multiple' && dates(this.value).length > 0
301
368
  ? nothing
302
369
  : this.placeholder || nothing}
370
+ role="combobox"
371
+ aria-controls="surface"
372
+ aria-expanded=${this.open ? 'true' : 'false'}
373
+ aria-haspopup="dialog"
303
374
  autocomplete=${this.autocomplete || nothing}
304
375
  inputmode="numeric"
305
376
  aria-describedby=${this.describedBy ?? nothing}
@@ -308,7 +379,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
308
379
  ?readonly=${this.readOnly}
309
380
  ?required=${this.required}
310
381
  @blur=${this.handleBlur}
311
- @change=${this.handleCommit}
382
+ @change=${this.handleTextCommit}
312
383
  @focus=${this.handleFocus}
313
384
  @input=${this.handleInput}
314
385
  @keydown=${this.handleDraftKey}
@@ -322,8 +393,18 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
322
393
  ${this.mode === 'multiple'
323
394
  ? this.renderTokenRow(this.shownDates.map((date) => this.renderTag(date)), this.restCount)
324
395
  : nothing}
325
- ${this.segmentsShown ? this.renderSegments() : this.renderControl()}
396
+ ${this.segmentsShown ? html `${this.renderSegments()}${this.renderAutofill()}` : this.renderControl()}
326
397
  <slot name="end"></slot>
398
+ ${this.showsClear
399
+ ? html `<button
400
+ part="clear"
401
+ type="button"
402
+ aria-label=${this.clearLabel}
403
+ @click=${this.handleClear}
404
+ >
405
+ ${this.renderClearIcon()}
406
+ </button>`
407
+ : nothing}
327
408
  <button
328
409
  part="trigger"
329
410
  type="button"
@@ -377,6 +458,13 @@ __decorate([
377
458
  words,
378
459
  property({ attribute: 'calendar-label' })
379
460
  ], HelixHeadlessDateInput.prototype, "calendarLabel", void 0);
461
+ __decorate([
462
+ property({ type: Boolean })
463
+ ], HelixHeadlessDateInput.prototype, "clearable", void 0);
464
+ __decorate([
465
+ words,
466
+ property({ attribute: 'clear-label' })
467
+ ], HelixHeadlessDateInput.prototype, "clearLabel", void 0);
380
468
  __decorate([
381
469
  property({ attribute: 'date-style' })
382
470
  ], HelixHeadlessDateInput.prototype, "dateStyle", void 0);
@@ -464,6 +552,10 @@ __decorate([
464
552
  words,
465
553
  property({ attribute: 'remove-label' })
466
554
  ], HelixHeadlessDateInput.prototype, "removeLabel", void 0);
555
+ __decorate([
556
+ words,
557
+ property({ attribute: 'selection-label' })
558
+ ], HelixHeadlessDateInput.prototype, "selectionLabel", void 0);
467
559
  __decorate([
468
560
  property({ type: Number })
469
561
  ], HelixHeadlessDateInput.prototype, "step", void 0);
@@ -471,6 +563,9 @@ __decorate([
471
563
  words,
472
564
  property({ attribute: 'step-mismatch-message' })
473
565
  ], HelixHeadlessDateInput.prototype, "stepMismatchMessage", void 0);
566
+ __decorate([
567
+ property({ attribute: 'time-zone' })
568
+ ], HelixHeadlessDateInput.prototype, "timeZone", void 0);
474
569
  __decorate([
475
570
  words,
476
571
  property({ attribute: 'trigger-label' })
@@ -482,6 +577,10 @@ __decorate([
482
577
  words,
483
578
  property({ attribute: 'unavailable-message' })
484
579
  ], HelixHeadlessDateInput.prototype, "unavailableMessage", void 0);
580
+ __decorate([
581
+ words,
582
+ property({ attribute: 'unreadable-message' })
583
+ ], HelixHeadlessDateInput.prototype, "unreadableMessage", void 0);
485
584
  __decorate([
486
585
  words,
487
586
  property({ attribute: 'year-view-label' })
@@ -1,4 +1,4 @@
1
- import { type CalendarView, type DateCalendar, HelixFormElement, type MonthCalendar } from '@fusion.dev/helix-core';
1
+ import { type CalendarView, type DateCalendar, HelixFormElement, type MonthCalendar, type PickerFailure } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinPickerFeedbackInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
4
4
  /**
@@ -15,9 +15,11 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
15
15
  * **Dates are `YYYY-MM-DD` strings, and every calculation is in UTC**, because
16
16
  * a local-time `Date` shifts across a time zone or daylight-saving boundary.
17
17
  *
18
- * **The days are the Gregorian calendar's**, written in `calendar`: the
19
- * locale's own where its months are the Gregorian months, as `th-TH` writes
20
- * 2569 for 2026, and `gregory` where they are not, as for `fa-IR`.
18
+ * **The months are the ones `calendar` counts**: the Gregorian months for the
19
+ * locale's own calendar where its months are the Gregorian months, as `th-TH`
20
+ * writes 2569 for 2026, and `gregory` where they are not, as for `fa-IR`
21
+ * with no `calendar`. Name a calendar with months of its own, such as
22
+ * `persian`, and every view counts its days, months, and years from `Intl`.
21
23
  *
22
24
  * `month` sets which month the grid shows, separately from `value`, so paging
23
25
  * selects nothing and you can control the view. When unset, it follows the
@@ -25,7 +27,14 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
25
27
  *
26
28
  * `mode` sets how many dates are held. Unset holds one, `range` holds two and
27
29
  * marks the dates between them, and `multiple` toggles each date. All three
28
- * read and write the same comma-separated `value`.
30
+ * read and write the same comma-separated `value`. With a `mode`, the grid
31
+ * carries `aria-multiselectable`. While a range holds one end, the grid draws
32
+ * the range to the day under the pointer or the focus, marking those cells
33
+ * `data-range-preview`.
34
+ *
35
+ * The chosen date, range, or count of dates is the grid's description, in a
36
+ * region screen readers announce when it changes, as React Aria's calendars
37
+ * do. `selection-label` words it.
29
38
  *
30
39
  * `max-view` makes the heading a button that steps back to the months of the
31
40
  * year, and with `year` to a page of years, as Zag's date picker does. The
@@ -58,7 +67,7 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
58
67
  * @event {Event} input - Fired after the value changes.
59
68
  *
60
69
  * @csspart cell - One column of a week row. A range is painted on the cells.
61
- * @csspart cell-range-end - The cell of a range's last day, beside `cell`.
70
+ * @csspart cell-range-end - The cell of a range's last day, beside `cell`, or of the day a waiting range is drawn to.
62
71
  * @csspart cell-range-middle - A cell between a range's ends, beside `cell`.
63
72
  * @csspart cell-range-start - The cell of a range's first day, beside `cell`.
64
73
  * @csspart day - The shape inside a cell. A single chosen date is painted on it.
@@ -84,12 +93,17 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
84
93
  * @csspart periods - The grid of months or years.
85
94
  * @csspart previous - The control that moves to the previous month.
86
95
  * @csspart previous-mark - The glyph on the previous month control, where none is slotted.
96
+ * @csspart selection - The chosen date or range in words, which screen readers hear when it changes. Drawn for screen readers only.
87
97
  * @csspart week - One row of days.
88
98
  * @csspart weekday - A column header naming a day of the week. It shows the short name and says the full one.
89
99
  *
90
100
  * @cssproperty --date-picker-column-count - How many month columns are drawn, capped at two. `--date-picker-columns` overrides it.
91
101
  *
92
- * @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
102
+ * @cssstate blank - While no date is chosen.
103
+ * @cssstate invalid - While `invalid` is set, `feedback` says what is wrong, the picker holds a date outside `min` and `max` or one it bars, or it is `required`, holds no date, and the reader has answered once or a form has refused it.
104
+ * @cssstate month-view - While the months of a year are shown, where `max-view` is set.
105
+ * @cssstate range-pending - While a `range` holds its first end and waits for the second.
106
+ * @cssstate year-view - While a page of years is shown, where `max-view` is `year`.
93
107
  */
94
108
  export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_base {
95
109
  /**
@@ -116,14 +130,16 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
116
130
  * `ja-JP-u-ca-japanese`, and `gregory` for every other, such as `persian`
117
131
  * for `fa-IR`.
118
132
  *
119
- * `persian`, `hebrew`, `islamic-umalqura`, `islamic-civil`, `ethiopic`,
120
- * `coptic`, and `indian` draw a calendar with months of its own, as React
121
- * Aria's calendars do: each grid is one of that calendar's months, the
122
- * Hebrew leap month and Ethiopia's five-day thirteenth month included, and
123
- * Previous, Next and the page keys move by those months. `month` and
133
+ * `persian`, `hebrew`, `islamic`, `islamic-umalqura`, `islamic-civil`,
134
+ * `islamic-tbla`, `islamic-rgsa`, `ethiopic`, `ethioaa`, `coptic`,
135
+ * `indian`, `chinese`, and `dangi` draw a calendar with months of its own,
136
+ * as React Aria's calendars do: each grid is one of that calendar's months,
137
+ * the Hebrew and Chinese leap months and Ethiopia's five-day thirteenth
138
+ * month included, and Previous, Next and the page keys move by those
139
+ * months. With `max-view`, the months view shows that calendar's year, of
140
+ * twelve or thirteen months, and the years view its years. `month` and
124
141
  * `helix-navigate` then name a month by its first day, `YYYY-MM-DD`. The
125
- * heading stays text, as the months and years views are drawn in Gregorian
126
- * months only. The value is `YYYY-MM-DD` in every calendar.
142
+ * value is `YYYY-MM-DD` in every calendar.
127
143
  */
128
144
  calendar?: DateCalendar | MonthCalendar;
129
145
  /**
@@ -207,6 +223,8 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
207
223
  mode?: 'range' | 'multiple';
208
224
  /** The month on show, whoever set it, and `undefined` until somebody has. */
209
225
  private monthState;
226
+ /** Whether the month on show is one the reader paged to, which `showChosen` forgets. */
227
+ private browsed;
210
228
  /**
211
229
  * The month shown, as `YYYY-MM`, or as its first day, `YYYY-MM-DD`, under a
212
230
  * `calendar` with months of its own. When it is not set, it follows
@@ -284,6 +302,21 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
284
302
  private choosing;
285
303
  /** The range's ends, when there are two and the mode asks for them. */
286
304
  private get range();
305
+ /**
306
+ * The day a reader points at or moves to while a range holds one end, which
307
+ * the grid draws the range to before it is chosen.
308
+ */
309
+ private previewed;
310
+ /** Whether a range holds its first end and waits for the second. */
311
+ private get pending();
312
+ /**
313
+ * The range the grid draws: the chosen one, or, while one end waits for
314
+ * the other, the run to the day under the pointer or the focus.
315
+ */
316
+ private get drawnRange();
317
+ /** Draws a waiting range to the day the pointer is on. */
318
+ private preview;
319
+ private readonly handleGridLeave;
287
320
  private isSelected;
288
321
  /** The month being shown, resolved from `month`, then `value`, then today. */
289
322
  private get shown();
@@ -292,8 +325,6 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
292
325
  * months of its own, and the Gregorian months otherwise.
293
326
  */
294
327
  private get system();
295
- /** Whether `calendar` names a calendar with months of its own. */
296
- private get ownMonths();
297
328
  /**
298
329
  * The month to open on when nothing has declared one.
299
330
  *
@@ -407,6 +438,16 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
407
438
  * plain `focus()` on it did nothing and focus stayed on the trigger.
408
439
  */
409
440
  focus(options?: FocusOptions): void;
441
+ /**
442
+ * Shows the days again, on the month of the chosen date, with the tab stop
443
+ * on that date, forgetting the month and the day the reader browsed to.
444
+ *
445
+ * Date Input calls it each time its panel opens, which is where the APG
446
+ * date picker dialog puts focus. Measured before this: from August 4, two
447
+ * presses of Page Down, Escape, and Down again opened on October 4.
448
+ * A `month` you set stays until the reader pages away from it.
449
+ */
450
+ showChosen(): void;
410
451
  connectedCallback(): void;
411
452
  disconnectedCallback(): void;
412
453
  /**
@@ -434,6 +475,23 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
434
475
  * Stops the form from submitting while no date is chosen.
435
476
  */
436
477
  required: boolean;
478
+ /**
479
+ * What a screen reader hears about the chosen dates: the grid's
480
+ * description, said again whenever the dates change. `{kind}` is `date`,
481
+ * `start` while a range holds one end, `range`, or `dates` for `multiple`.
482
+ * `{start}` and `{end}` are dates written in `locale`, and `{count}` is how
483
+ * many dates are chosen.
484
+ */
485
+ selectionLabel: string;
486
+ /**
487
+ * `selectionLabel` for the dates chosen now, or nothing while there are none.
488
+ *
489
+ * React Aria's calendars describe the grid by the chosen date or range and
490
+ * announce it when it changes. Measured before this: a range of seven days
491
+ * was seven cells with `aria-selected` in a grid that said nothing of a
492
+ * range, and choosing its end was heard as one more selected cell.
493
+ */
494
+ private get selectionWords();
437
495
  /**
438
496
  * How far apart the selectable dates are, in days.
439
497
  *
@@ -505,6 +563,13 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
505
563
  * browser points its bubble at.
506
564
  */
507
565
  private reportRequired;
566
+ /**
567
+ * What is wrong with the answer, as validity flags and a message, or nothing.
568
+ * `reportRequired` hands it to the form, and `failure` to the mark.
569
+ */
570
+ private get problem();
571
+ /** A missing date waits for the reader; a refused one is marked at once. */
572
+ protected get failure(): PickerFailure | undefined;
508
573
  protected willUpdate(changed: PropertyValues): void;
509
574
  /**
510
575
  * Reports validity after render, because the bubble needs somewhere to point.