frontile 0.18.0-beta.5 → 0.18.1

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 (70) hide show
  1. package/declarations/components/buttons/chip.d.ts +1 -1
  2. package/declarations/components/buttons/chip.d.ts.map +1 -1
  3. package/declarations/components/collections/dropdown/menu-context.d.ts +10 -0
  4. package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -1
  5. package/declarations/components/collections/dropdown/sub.d.ts +34 -0
  6. package/declarations/components/collections/dropdown/sub.d.ts.map +1 -1
  7. package/declarations/components/forms/autocomplete.d.ts +12 -12
  8. package/declarations/components/forms/date-input/clipboard.d.ts +34 -0
  9. package/declarations/components/forms/date-input/clipboard.d.ts.map +1 -0
  10. package/declarations/components/forms/date-input/date-input.d.ts +91 -0
  11. package/declarations/components/forms/date-input/date-input.d.ts.map +1 -0
  12. package/declarations/components/forms/date-input/segment-group.d.ts +130 -0
  13. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -0
  14. package/declarations/components/forms/date-input/segments.d.ts +137 -0
  15. package/declarations/components/forms/date-input/segments.d.ts.map +1 -0
  16. package/declarations/components/forms/date-input/types.d.ts +134 -0
  17. package/declarations/components/forms/date-input/types.d.ts.map +1 -0
  18. package/declarations/components/forms/date-input.d.ts +6 -0
  19. package/declarations/components/forms/date-input.d.ts.map +1 -0
  20. package/declarations/components/forms/date-picker/date-picker.d.ts +248 -15
  21. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  22. package/declarations/components/forms/date-picker/end-content.d.ts +33 -3
  23. package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -1
  24. package/declarations/components/forms/date-picker/types.d.ts +30 -1
  25. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  26. package/declarations/components/forms/field.d.ts +3 -0
  27. package/declarations/components/forms/field.d.ts.map +1 -1
  28. package/declarations/components/forms/index.d.ts +1 -0
  29. package/declarations/components/forms/index.d.ts.map +1 -1
  30. package/declarations/components/forms/input.d.ts +11 -11
  31. package/declarations/components/forms/native-select.d.ts +8 -8
  32. package/declarations/components/forms/select/select.d.ts +16 -16
  33. package/declarations/components/forms/textarea.d.ts +7 -7
  34. package/declarations/components/utilities/avatar.d.ts +35 -2
  35. package/declarations/components/utilities/avatar.d.ts.map +1 -1
  36. package/declarations/test-support.d.ts +30 -0
  37. package/declarations/test-support.d.ts.map +1 -1
  38. package/dist/components/buttons/chip.js.map +1 -1
  39. package/dist/components/collections/dropdown/menu-context.js.map +1 -1
  40. package/dist/components/collections/dropdown/sub.js +76 -11
  41. package/dist/components/collections/dropdown/sub.js.map +1 -1
  42. package/dist/components/forms/date-input/clipboard.js +162 -0
  43. package/dist/components/forms/date-input/clipboard.js.map +1 -0
  44. package/dist/components/forms/date-input/date-input.js +194 -0
  45. package/dist/components/forms/date-input/date-input.js.map +1 -0
  46. package/dist/components/forms/date-input/segment-group.js +271 -0
  47. package/dist/components/forms/date-input/segment-group.js.map +1 -0
  48. package/dist/components/forms/date-input/segments.js +379 -0
  49. package/dist/components/forms/date-input/segments.js.map +1 -0
  50. package/dist/components/forms/date-input/types.js +2 -0
  51. package/dist/components/forms/date-input/types.js.map +1 -0
  52. package/dist/components/forms/date-input.js +4 -0
  53. package/dist/components/forms/date-input.js.map +1 -0
  54. package/dist/components/forms/date-picker/date-picker.js +301 -14
  55. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  56. package/dist/components/forms/date-picker/end-content.js +17 -4
  57. package/dist/components/forms/date-picker/end-content.js.map +1 -1
  58. package/dist/components/forms/field.js +4 -1
  59. package/dist/components/forms/field.js.map +1 -1
  60. package/dist/components/forms/index.js +3 -0
  61. package/dist/components/forms/index.js.map +1 -1
  62. package/dist/components/utilities/avatar.js +30 -5
  63. package/dist/components/utilities/avatar.js.map +1 -1
  64. package/dist/forms.js +3 -0
  65. package/dist/forms.js.map +1 -1
  66. package/dist/index.js +3 -0
  67. package/dist/index.js.map +1 -1
  68. package/dist/test-support.js +480 -1
  69. package/dist/test-support.js.map +1 -1
  70. package/package.json +3 -3
@@ -25,7 +25,7 @@ interface ChipSignature {
25
25
  *
26
26
  * @defaultValue 'md'
27
27
  */
28
- size?: 'sm' | 'md' | 'lg';
28
+ size?: 'xs' | 'sm' | 'md' | 'lg';
29
29
  /**
30
30
  * The border radius of the chip
31
31
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/chip.gts"],"names":[],"mappings":"AAuLA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,UAAU,aAAa;IACrB,IAAI,EAAE;QACJ;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAEvC;;;WAGG;QACH,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;QAE9C;;WAEG;QACH,KAAK,CAAC,EACF,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;WAEG;QACH,MAAM,CAAC,EACH,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;;;WAIG;QACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QAE1B;;;;WAIG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;QAEvC;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QAErB;;;;;;WAMG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAE1B;;;;;;;;;WASG;QACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAEtC;;;;WAIG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,KA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AAC;QAEtC;;;;WAIG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzC,IAAI,UAAU;;;;;MAuCb;CA8DF;AAED,OAAO,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { SelectionMode } from '../../../utils/listManager';
2
+ import type { Point } from '../../../utils/safe-area';
2
3
  import type { ListboxItemSignature } from '../listbox/item';
3
4
  /**
4
5
  * How a submenu was asked to open.
@@ -21,6 +22,15 @@ type OpenSource = 'pointer' | 'keyboard';
21
22
  interface SubHandle {
22
23
  open: (source: OpenSource) => void;
23
24
  close: () => void;
25
+ /**
26
+ * Whether this submenu is open and the pointer is somewhere that should
27
+ * keep it that way -- its own safe area, or one of its own descendants'.
28
+ *
29
+ * A level asks this of its children before closing itself. A third level
30
+ * sits outside the second level's safe area entirely, so without it the
31
+ * whole chain unwinds the moment the pointer goes deeper than one level.
32
+ */
33
+ isPointSafe: (point: Point) => boolean;
24
34
  }
25
35
  interface MenuContext extends MenuSelectionContext {
26
36
  /** 0 for the root menu, 1 for a submenu, and so on. */
@@ -1 +1 @@
1
- {"version":3,"file":"menu-context.d.ts","sourceRoot":"","sources":["../../../../src/components/collections/dropdown/menu-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;;;;;;;GAQG;AACH,KAAK,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEzC;;;;;;;GAOG;AACH,UAAU,SAAS;I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,IAAI,CACxC,WAAW,EACX,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CACtE;IACC,2EAA2E;IAC3E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAiBD,iBAAS,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CAWrE;AAED,iBAAS,sBAAsB,CAC7B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CAAE,GAC/D,WAAW,CAUb;AAED;;;;;;;;;GASG;AACH,iBAAS,2BAA2B,CAClC,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,oBAAoB,GACxB,WAAW,CAkBb;AAED,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,CAAC"}
1
+ {"version":3,"file":"menu-context.d.ts","sourceRoot":"","sources":["../../../../src/components/collections/dropdown/menu-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;;;;;;;GAQG;AACH,KAAK,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEzC;;;;;;;GAOG;AACH,UAAU,SAAS;IACjB,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;;;;;OAOG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CACxC;AAED,UAAU,WAAY,SA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M,IAAI,CAAC;CACnB;AAiBD,iBAAS,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,WAAW,CAWrE;AAED,iBAAS,sBAAsB,CAC7B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CAAE,GAC/D,WAAW,CAUb;AAED;;;;;;;;;GASG;AACH,iBAAS,2BAA2B,CAClC,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,oBAAoB,GACxB,WAAW,CAkBb;AAED,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,CAAC"}
@@ -6,6 +6,7 @@ import type Owner from '@ember/owner';
6
6
  import type { WithBoundArgs } from '@glint/template';
7
7
  import type { ModifierLike } from '@glint/template';
8
8
  import type { Menu } from './dropdown';
9
+ import { type Point } from '../../../utils/safe-area';
9
10
  /**
10
11
  * The raw, unbound `Menu` component, handed in rather than imported.
11
12
  *
@@ -96,6 +97,17 @@ declare class Sub extends Component<SubSignature> {
96
97
  willDestroy(): void;
97
98
  handle: SubHandle;
98
99
  open: (source?: OpenSource) => void;
100
+ /**
101
+ * Close every other submenu at this level.
102
+ *
103
+ * Two sub-triggers next to each other would otherwise both stay on screen:
104
+ * the abandoned level's own close is on a timer, and the pointer moving
105
+ * toward the new one keeps re-arming it. A level's siblings are exactly the
106
+ * other entries in the parent's registry, so closing them as this one opens
107
+ * makes the two states mutually exclusive in a single render -- there is no
108
+ * frame in which both are painted.
109
+ */
110
+ closeSiblings: () => void;
99
111
  close: () => void;
100
112
  /**
101
113
  * Keeps the submenu open while the pointer is heading for it.
@@ -110,9 +122,31 @@ declare class Sub extends Component<SubSignature> {
110
122
  * is outside the safe area, so moving onto one closes the submenu.
111
123
  */
112
124
  trackPointer: (event: PointerEvent) => void;
125
+ /**
126
+ * Whether the pointer is somewhere that should keep this level open.
127
+ *
128
+ * Its own safe area, or -- recursively -- any open descendant's. A third
129
+ * level opens to the right of the second, well outside the polygon that
130
+ * runs from *this* trigger to *this* content, so a level that only
131
+ * consulted its own area would close the instant the pointer went deeper,
132
+ * taking every level below it along. Asking the children means the chain
133
+ * survives exactly as long as the pointer is still somewhere in it.
134
+ */
135
+ isPointSafe: (point: Point) => boolean;
113
136
  startTracking: () => void;
114
137
  stopTracking: () => void;
115
138
  scheduleOpen: () => void;
139
+ /**
140
+ * Arm the close, but never re-arm one already pending.
141
+ *
142
+ * This runs from every `pointermove` that lands outside the safe area, so
143
+ * cancelling and re-scheduling here would let a pointer that simply keeps
144
+ * moving -- across a sibling row, into a sibling's submenu, anywhere on the
145
+ * page -- push the close out indefinitely and strand the level open. Once
146
+ * the pointer has left, the countdown is from that moment and nothing
147
+ * outside the safe area extends it; only `cancelClose` (the pointer coming
148
+ * back inside) stops it.
149
+ */
116
150
  scheduleClose: () => void;
117
151
  cancelClose: () => void;
118
152
  hoverTrigger: import("ember-modifier").FunctionBasedModifier<{
@@ -1 +1 @@
1
- {"version":3,"file":"sub.d.ts","sourceRoot":"","sources":["../../../../src/components/collections/dropdown/sub.gts"],"names":[],"mappings":"AAmbA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAA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;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,cAAM,UAAW,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACrD;;;;;;OAMG;IACH,IAAI,GAAG,IAAI,MAAM,CAOhB;CAuBF;AAED,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC"}
@@ -301,101 +301,101 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
301
301
  get classes(): {
302
302
  base: (slotProps?: ({
303
303
  size?: "sm" | "md" | "lg" | undefined;
304
- endContentPointerEvents?: "none" | "auto" | undefined;
305
304
  hasStartContent?: boolean | undefined;
306
305
  hasEndContent?: boolean | undefined;
307
306
  hasChips?: boolean | undefined;
308
307
  startContentPointerEvents?: "none" | "auto" | undefined;
308
+ endContentPointerEvents?: "none" | "auto" | undefined;
309
309
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
310
310
  innerContainer: (slotProps?: ({
311
311
  size?: "sm" | "md" | "lg" | undefined;
312
- endContentPointerEvents?: "none" | "auto" | undefined;
313
312
  hasStartContent?: boolean | undefined;
314
313
  hasEndContent?: boolean | undefined;
315
314
  hasChips?: boolean | undefined;
316
315
  startContentPointerEvents?: "none" | "auto" | undefined;
316
+ endContentPointerEvents?: "none" | "auto" | undefined;
317
317
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
318
318
  startContent: (slotProps?: ({
319
319
  size?: "sm" | "md" | "lg" | undefined;
320
- endContentPointerEvents?: "none" | "auto" | undefined;
321
320
  hasStartContent?: boolean | undefined;
322
321
  hasEndContent?: boolean | undefined;
323
322
  hasChips?: boolean | undefined;
324
323
  startContentPointerEvents?: "none" | "auto" | undefined;
324
+ endContentPointerEvents?: "none" | "auto" | undefined;
325
325
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
326
326
  endContent: (slotProps?: ({
327
327
  size?: "sm" | "md" | "lg" | undefined;
328
- endContentPointerEvents?: "none" | "auto" | undefined;
329
328
  hasStartContent?: boolean | undefined;
330
329
  hasEndContent?: boolean | undefined;
331
330
  hasChips?: boolean | undefined;
332
331
  startContentPointerEvents?: "none" | "auto" | undefined;
332
+ endContentPointerEvents?: "none" | "auto" | undefined;
333
333
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
334
334
  input: (slotProps?: ({
335
335
  size?: "sm" | "md" | "lg" | undefined;
336
- endContentPointerEvents?: "none" | "auto" | undefined;
337
336
  hasStartContent?: boolean | undefined;
338
337
  hasEndContent?: boolean | undefined;
339
338
  hasChips?: boolean | undefined;
340
339
  startContentPointerEvents?: "none" | "auto" | undefined;
340
+ endContentPointerEvents?: "none" | "auto" | undefined;
341
341
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
342
342
  } & {
343
343
  base: (slotProps?: ({
344
344
  size?: "sm" | "md" | "lg" | undefined;
345
- endContentPointerEvents?: "none" | "auto" | undefined;
346
345
  hasStartContent?: boolean | undefined;
347
346
  hasEndContent?: boolean | undefined;
348
347
  hasChips?: boolean | undefined;
349
348
  startContentPointerEvents?: "none" | "auto" | undefined;
349
+ endContentPointerEvents?: "none" | "auto" | undefined;
350
350
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
351
351
  listbox: (slotProps?: ({
352
352
  size?: "sm" | "md" | "lg" | undefined;
353
- endContentPointerEvents?: "none" | "auto" | undefined;
354
353
  hasStartContent?: boolean | undefined;
355
354
  hasEndContent?: boolean | undefined;
356
355
  hasChips?: boolean | undefined;
357
356
  startContentPointerEvents?: "none" | "auto" | undefined;
357
+ endContentPointerEvents?: "none" | "auto" | undefined;
358
358
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
359
359
  icon: (slotProps?: ({
360
360
  size?: "sm" | "md" | "lg" | undefined;
361
- endContentPointerEvents?: "none" | "auto" | undefined;
362
361
  hasStartContent?: boolean | undefined;
363
362
  hasEndContent?: boolean | undefined;
364
363
  hasChips?: boolean | undefined;
365
364
  startContentPointerEvents?: "none" | "auto" | undefined;
365
+ endContentPointerEvents?: "none" | "auto" | undefined;
366
366
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
367
367
  clearButton: (slotProps?: ({
368
368
  size?: "sm" | "md" | "lg" | undefined;
369
- endContentPointerEvents?: "none" | "auto" | undefined;
370
369
  hasStartContent?: boolean | undefined;
371
370
  hasEndContent?: boolean | undefined;
372
371
  hasChips?: boolean | undefined;
373
372
  startContentPointerEvents?: "none" | "auto" | undefined;
373
+ endContentPointerEvents?: "none" | "auto" | undefined;
374
374
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
375
375
  input: (slotProps?: ({
376
376
  size?: "sm" | "md" | "lg" | undefined;
377
- endContentPointerEvents?: "none" | "auto" | undefined;
378
377
  hasStartContent?: boolean | undefined;
379
378
  hasEndContent?: boolean | undefined;
380
379
  hasChips?: boolean | undefined;
381
380
  startContentPointerEvents?: "none" | "auto" | undefined;
381
+ endContentPointerEvents?: "none" | "auto" | undefined;
382
382
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
383
383
  emptyContent: (slotProps?: ({
384
384
  size?: "sm" | "md" | "lg" | undefined;
385
- endContentPointerEvents?: "none" | "auto" | undefined;
386
385
  hasStartContent?: boolean | undefined;
387
386
  hasEndContent?: boolean | undefined;
388
387
  hasChips?: boolean | undefined;
389
388
  startContentPointerEvents?: "none" | "auto" | undefined;
389
+ endContentPointerEvents?: "none" | "auto" | undefined;
390
390
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
391
391
  } & {
392
392
  base: (slotProps?: ({
393
393
  size?: "sm" | "md" | "lg" | undefined;
394
- endContentPointerEvents?: "none" | "auto" | undefined;
395
394
  hasStartContent?: boolean | undefined;
396
395
  hasEndContent?: boolean | undefined;
397
396
  hasChips?: boolean | undefined;
398
397
  startContentPointerEvents?: "none" | "auto" | undefined;
398
+ endContentPointerEvents?: "none" | "auto" | undefined;
399
399
  } & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
400
400
  };
401
401
  /**
@@ -0,0 +1,34 @@
1
+ import type { Part } from './types';
2
+ /**
3
+ * Reads pasted text into the segments, trying each strategy in turn and
4
+ * stopping at the first that works.
5
+ *
6
+ * Every strategy lands in `fill`, so all three share one bounds policy. There
7
+ * is deliberately no `new Date(text)` fallback: it parses differently in every
8
+ * engine, and a date field that silently guesses wrong is worse than one that
9
+ * declines.
10
+ */
11
+ declare function parsePasted(text: string, parts: Part[]): Part[] | null;
12
+ /**
13
+ * The field as it reads on screen, literals included. Copying the display
14
+ * rather than an ISO string means the text round-trips through `parsePasted`
15
+ * and still reads naturally when pasted into a document.
16
+ *
17
+ * Delegates each segment to `displaySegment`, the same function the group
18
+ * renders from, so a mid-entry year (buffer `26`, uncommitted) copies as
19
+ * `26` rather than being padded to `0026` -- padding would claim digits the
20
+ * user never typed and would contradict what is on screen.
21
+ */
22
+ declare function formatForClipboard(parts: Part[]): string;
23
+ /**
24
+ * Splits pasted text into the two dates of a range, or returns `null` when it
25
+ * does not read as two.
26
+ *
27
+ * Only the shape is decided here; neither half is parsed. The caller runs each
28
+ * through {@link parsePasted} and keeps the result only when both halves are
29
+ * dates -- so text that merely contains a dash falls through to the ordinary
30
+ * single-date handling rather than being consumed.
31
+ */
32
+ declare function splitRange(text: string): [string, string] | null;
33
+ export { parsePasted, formatForClipboard, splitRange };
34
+ //# sourceMappingURL=clipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-input/clipboard.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,SAAS,CAAC;AAkE1D;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAwC/D;AAED;;;;;;;;;GASG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAIjD;AAaD;;;;;;;;GAQG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAczD;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,91 @@
1
+ import Component from '@glimmer/component';
2
+ import type { Part, DateInputArgs, DateInputClasses } from './types';
3
+ interface DateInputSignature {
4
+ Args: DateInputArgs;
5
+ Element: HTMLDivElement;
6
+ }
7
+ /**
8
+ * A date typed into segments rather than picked from a grid. `DatePicker`
9
+ * renders the same segments and adds a calendar.
10
+ */
11
+ declare class DateInput extends Component<DateInputSignature> {
12
+ #private;
13
+ containerRef: import("../../utilities").Ref<HTMLElement>;
14
+ /**
15
+ * The segments are the state, not the value: mid-entry they hold digits that
16
+ * compose to no date at all, which no `Date` can represent.
17
+ */
18
+ private trackedParts;
19
+ constructor(owner: unknown, args: DateInputArgs);
20
+ get parts(): Part[];
21
+ private setParts;
22
+ get locale(): string;
23
+ get formatOptions(): Intl.DateTimeFormatOptions | undefined;
24
+ /**
25
+ * The composed value, or null while any segment is empty.
26
+ *
27
+ * Cached because `wireValue`, `isOutOfRange` and the template all read it
28
+ * independently, and each `toDate` walks the parts three times over.
29
+ */
30
+ get value(): Date | null;
31
+ get wireValue(): string;
32
+ get isEmpty(): boolean;
33
+ get placeholderValue(): Date;
34
+ /**
35
+ * Whether the composed value is outside the allowed range. Never blocks a
36
+ * keystroke -- typing toward 2020 passes through 2, 20 and 202 on the way,
37
+ * and a field that refused those could not be typed into at all.
38
+ */
39
+ get isOutOfRange(): boolean;
40
+ get isInvalid(): boolean;
41
+ /**
42
+ * Pushes `@value` into the segments when the argument changes. `undefined`
43
+ * is ignored, so a field bound by `Field` before the form holds anything for
44
+ * it keeps what the user typed -- the rule `DatePicker` documents.
45
+ */
46
+ syncValue: import("ember-modifier").FunctionBasedModifier<{
47
+ Args: {
48
+ Positional: [string | Date | null | undefined];
49
+ Named: import("ember-modifier/-private/signature").EmptyObject;
50
+ };
51
+ Element: HTMLElement;
52
+ }>;
53
+ /**
54
+ * Rebuilds the segment order when the locale or format changes, carrying
55
+ * each segment's own state across so switching en-US to en-GB reorders the
56
+ * field without emptying it -- half-typed digits included, which is why
57
+ * this goes segment by segment rather than through the composed value.
58
+ */
59
+ syncLocale: import("ember-modifier").FunctionBasedModifier<{
60
+ Args: {
61
+ Positional: [string, Intl.DateTimeFormatOptions | undefined];
62
+ Named: import("ember-modifier/-private/signature").EmptyObject;
63
+ };
64
+ Element: HTMLElement;
65
+ }>;
66
+ handlePartsChange: (parts: Part[]) => void;
67
+ /**
68
+ * `@onBlur` means "the user left the field", not "the user left a segment",
69
+ * so a move between segments is filtered out by asking whether focus landed
70
+ * inside the container. `DatePicker` needs `ControlBlurTracker` for this
71
+ * because its focus can legitimately be in a popover outside its own DOM;
72
+ * this field has no popover, so containment is the whole question.
73
+ */
74
+ handleFocusOut: (event: FocusEvent) => void;
75
+ /**
76
+ * A disabled or read-only field never offers it: it carries no disabled
77
+ * state of its own and would be a live button clearing a field the user may
78
+ * not change.
79
+ */
80
+ get isClearable(): boolean;
81
+ /**
82
+ * Clearing removes the clear button from the DOM (`isClearable` flips
83
+ * false the instant the value is gone), so focus must be handed somewhere
84
+ * explicitly or it falls to `<body>` and a keyboard user loses their place.
85
+ */
86
+ clear: () => void;
87
+ get classes(): DateInputClasses;
88
+ }
89
+ export { DateInput, type DateInputSignature };
90
+ export default DateInput;
91
+ //# sourceMappingURL=date-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-input/date-input.gts"],"names":[],"mappings":"AA4SA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAoB3C,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAErE,UAAU,kBAAkB;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;GAGG;AACH,cAAM,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;;IACnD,YAAY,6CAAsB;IAElC;;;OAGG;IACM,OAAO,CAAC,YAAY,CAAc;gBAW/B,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa;IAY/C,IAAI,KAAK,IAAI,IAAI,EAAE,CAElB;IAED,OAAO,CAAC,QAAQ;IAKhB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,aAAa,IAAI,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAW1D;IAED;;;;;OAKG;IACH,IACI,KAAK,IAAI,IAAI,GAAG,IAAI,CAEvB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,gBAAgB,IAAI,IAAI,CAE3B;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,OAAO,CAO1B;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;OAIG;IACH,SAAS;;;;;;OAgBP;IAEF;;;;;OAKG;IACH,UAAU;;;;;;OAOR;IAEF,iBAAiB,GAAI,OAAO,IAAI,EAAE,KAAG,IAAI,CAWvC;IAEF;;;;;;OAMG;IACH,cAAc,GAAI,OAAO,UAAU,KAAG,IAAI,CAOxC;IAEF;;;;OAIG;IACH,IAAI,WAAW,IAAI,OAAO,CAOzB;IAED;;;;OAIG;IACH,KAAK,QAAO,IAAI,CAKd;IAEF,IACI,OAAO,IAAI,gBAAgB,CAG9B;CA+GF;AAED,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,130 @@
1
+ import Component from '@glimmer/component';
2
+ import type { Part, Segment, SegmentType, SegmentGroupClasses, SegmentGroupUserClasses } from './types';
3
+ interface SegmentGroupSignature {
4
+ Args: {
5
+ parts: Part[];
6
+ /** Hands the whole list back; the group holds no state of its own. */
7
+ onPartsChange: (parts: Part[]) => void;
8
+ /**
9
+ * Offered text that reads as two dates rather than one. Only `DatePicker`
10
+ * in `@mode="range"` supplies it, and only to its *start* group: pasting
11
+ * a range into the end of a field and having it rewrite the start would
12
+ * be surprising. Without it, such text is simply declined.
13
+ */
14
+ onRangePaste?: (start: Part[], end: Part[]) => void;
15
+ locale: string;
16
+ placeholderValue: Date;
17
+ isDisabled?: boolean;
18
+ isReadOnly?: boolean;
19
+ isInvalid?: boolean;
20
+ /** Rendered as the group's own id, so a `<label for>` can target it. */
21
+ id?: string;
22
+ /**
23
+ * The field's name. A `role="group"` is not a labelable element, so a
24
+ * sibling `<label for>` does not name it on its own -- this does.
25
+ */
26
+ label?: string;
27
+ labelledBy?: string;
28
+ describedBy?: string;
29
+ segmentLabels?: Partial<Record<SegmentType, string>>;
30
+ /**
31
+ * Only the three slots this group renders, so that `DateInput`'s
32
+ * `dateInput` recipe and `DatePicker`'s `datePicker` recipe both satisfy
33
+ * it. See {@link SegmentGroupClasses}.
34
+ */
35
+ classes: SegmentGroupClasses;
36
+ userClasses?: SegmentGroupUserClasses;
37
+ };
38
+ Element: HTMLDivElement;
39
+ }
40
+ /**
41
+ * Everything one rendered part needs, resolved to primitives.
42
+ *
43
+ * The template cannot narrow the `Part` union -- `eq` is unavailable and Glint
44
+ * does not carry a type predicate through `{{#if}}` -- so the narrowing happens
45
+ * here, in TypeScript, and the template only ever reads optional primitives.
46
+ * That keeps `part.type` off a `LiteralPart` without a cast anywhere.
47
+ */
48
+ interface Cell {
49
+ index: number;
50
+ isSegment: boolean;
51
+ /** The segment's display text, or the literal's text. */
52
+ text: string;
53
+ type?: SegmentType;
54
+ isEmpty: boolean;
55
+ label?: string;
56
+ valueNow?: number;
57
+ valueMin?: number;
58
+ valueMax?: number;
59
+ valueText?: string;
60
+ }
61
+ /**
62
+ * One row of date segments. Private: `DateInput` and `DatePicker` both render
63
+ * it, and neither wants the other's `FormControl` wrapper.
64
+ */
65
+ declare class SegmentGroup extends Component<SegmentGroupSignature> {
66
+ get isEditable(): boolean;
67
+ labelFor: (type: SegmentType) => string;
68
+ /**
69
+ * Built once per locale rather than inside {@link valueTextFor}: `cells`
70
+ * recomputes on every keystroke, and an `Intl` constructor is expensive
71
+ * enough that building one per keypress is the costliest thing this
72
+ * component would otherwise do.
73
+ */
74
+ get monthNames(): Intl.DateTimeFormat;
75
+ /**
76
+ * What a screen reader reads instead of the raw number. A month is read by
77
+ * name -- "January", not "1" -- which is the whole point of `aria-valuetext`.
78
+ */
79
+ valueTextFor: (segment: Segment) => string | undefined;
80
+ get cells(): Cell[];
81
+ /** The segment elements, in document order -- the focus order too. */
82
+ private segmentElements;
83
+ /**
84
+ * Left and right are *visual* directions, so in an RTL locale they run
85
+ * against document order: pressing the left arrow in `yyyy/mm/dd` laid out
86
+ * right-to-left should move to the segment drawn to the left, which is the
87
+ * later one in the DOM.
88
+ */
89
+ private focusSibling;
90
+ private isRtl;
91
+ private focusEdge;
92
+ /** Replaces one segment by index and reports the new list. */
93
+ private replace;
94
+ handleKeyDown: (index: number, event: KeyboardEvent) => void;
95
+ /**
96
+ * Leaving a segment finishes it: the digits in it stop being something the
97
+ * user is still typing and become their answer, which is what turns a typed
98
+ * `26` into 2026. Tab, arrow-key navigation and a click elsewhere all arrive
99
+ * here, because moving focus is the one thing they have in common.
100
+ */
101
+ handleFocusOut: (index: number) => void;
102
+ /**
103
+ * `contenteditable`'s hazard: anything not handled above arrives here and
104
+ * would be written into the span's DOM, desynchronising the display from the
105
+ * model. Every input type is refused; the model is the only writer.
106
+ */
107
+ handleBeforeInput: (event: Event) => void;
108
+ /**
109
+ * Always `preventDefault`: the browser would otherwise write the pasted text
110
+ * into the contenteditable span, and the model would no longer describe what
111
+ * is on screen. Unparseable text is dropped silently -- a date field that
112
+ * guessed would be worse than one that declined.
113
+ */
114
+ handlePaste: (event: ClipboardEvent) => void;
115
+ /**
116
+ * A second reading of text a single date could not be made of.
117
+ *
118
+ * Both halves are parsed against *this* group's parts, which is sound
119
+ * because the two groups of a range are built from the same locale and
120
+ * format and so have identical shape, and because a half only counts when
121
+ * it parses in full -- nothing of this group's own state survives into the
122
+ * list handed to the other one.
123
+ */
124
+ private tryRangePaste;
125
+ handleCopy: (event: ClipboardEvent) => void;
126
+ handleCut: (event: ClipboardEvent) => void;
127
+ }
128
+ export { SegmentGroup, type SegmentGroupSignature };
129
+ export default SegmentGroup;
130
+ //# sourceMappingURL=segment-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-input/segment-group.gts"],"names":[],"mappings":"AA4ZA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAc3C,OAAO,KAAK,EACV,IAAI,EACJ,OAAO,EACP,WAAW,EACX,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,UAAU,qBAAqB;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,IAAI,EAAE,CAAC;QACd,sEAAsE;QACtE,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;QACvC;;;;;WAKG;QACH,YAAY,CAAC,EAAE,CA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,CAEpC;IAED;;;OAGG;IACH,YAAY,GAAI,SAAS,OAAO,KAAG,MAAM,GAAG,SAAS,CAMnD;IAEF,IACI,KAAK,IAAI,IAAI,EAAE,CAqBlB;IAED,sEAAsE;IACtE,OAAO,CAAC,eAAe;IAOvB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,SAAS;IAKjB,8DAA8D;IAC9D,OAAO,CAAC,OAAO;IAOf,aAAa,GAAI,OAAO,MAAM,EAAE,OAAO,aAAa,KAAG,IAAI,CAyEzD;IAEF;;;;;OAKG;IACH,cAAc,GAAI,OAAO,MAAM,KAAG,IAAI,CASpC;IAEF;;;;OAIG;IACH,iBAAiB,GAAI,OAAO,KAAK,KAAG,IAAI,CAEtC;IAEF;;;;;OAKG;IACH,WAAW,GAAI,OAAO,cAAc,KAAG,IAAI,CAYzC;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;IAYrB,UAAU,GAAI,OAAO,cAAc,KAAG,IAAI,CAMxC;IAEF,SAAS,GAAI,OAAO,cAAc,KAAG,IAAI,CAOvC;CAoIH;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,qBAAqB,EAAE,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,137 @@
1
+ import type { Part, Segment, SegmentType } from './types';
2
+ /**
3
+ * The format an editable field uses when the consumer supplies none.
4
+ * Deliberately not `{ dateStyle: 'medium' }` -- DatePicker's button default --
5
+ * which renders a month name and has no numeric segment to type into.
6
+ */
7
+ declare const DEFAULT_FORMAT: Intl.DateTimeFormatOptions;
8
+ declare const BOUNDS: Record<SegmentType, {
9
+ min: number;
10
+ max: number;
11
+ width: number;
12
+ placeholder: string;
13
+ }>;
14
+ declare function isSegment(part: Part): part is Segment;
15
+ declare function emptySegment(type: SegmentType): Segment;
16
+ /**
17
+ * Derives the segments and their separators from the locale, so `mm/dd/yyyy`,
18
+ * `dd/mm/yyyy` and `yyyy年mm月dd日` all fall out of `Intl` rather than being
19
+ * hardcoded.
20
+ *
21
+ * A format producing a textual month ('Jan') has no editable numeric
22
+ * representation, so that part becomes a numeric month segment anyway. The
23
+ * component warns; this function stays pure.
24
+ */
25
+ declare function buildParts(locale: string, formatOptions?: Intl.DateTimeFormatOptions): Part[];
26
+ /**
27
+ * A bare `yy` resolves into the hundred years running from 80 back to 19
28
+ * forward -- so a birth date reaches the past while a card expiry reaches the
29
+ * near future. Three or four digits are a year the user spelled out and are
30
+ * taken literally.
31
+ */
32
+ declare function resolveTwoDigitYear(digits: string, now?: Date): number;
33
+ /**
34
+ * Appends one typed digit.
35
+ *
36
+ * `isFull` is the signal to advance focus. It is true when the segment cannot
37
+ * take another digit -- either it has reached its width, or any further digit
38
+ * would exceed `max`. That is what makes typing `5` into a month jump straight
39
+ * to the day, while typing `1` waits to see whether `12` is coming.
40
+ */
41
+ declare function applyDigit(segment: Segment, digit: string): {
42
+ segment: Segment;
43
+ isFull: boolean;
44
+ };
45
+ /**
46
+ * Marks a segment as the user's finished answer, expanding a one- or
47
+ * two-digit year through the sliding window on the way: typing `26` and
48
+ * moving on means 2026, while `0026` typed in full means the year 26.
49
+ *
50
+ * An empty segment has nothing to commit and stays uncommitted, so leaving a
51
+ * blank field does not invent a value for it.
52
+ */
53
+ declare function commitSegment(segment: Segment): Segment;
54
+ /**
55
+ * A segment holding `value` as a finished answer.
56
+ *
57
+ * The zero-padded buffer is the paired invariant of `displaySegment`, which
58
+ * reads the buffer back out -- so every path that sets a value goes through
59
+ * here rather than restating the padding and risking the two drifting.
60
+ */
61
+ declare function withValue(segment: Segment, value: number): Segment;
62
+ /** Clears both the value and the digits behind it. */
63
+ declare function clearSegment(segment: Segment): Segment;
64
+ /** Drops the last digit typed, for Backspace. */
65
+ declare function deleteDigit(segment: Segment): Segment;
66
+ /**
67
+ * Arrow and page keys. An empty segment does not step from zero -- it adopts
68
+ * `placeholderValue`, so ArrowUp on a blank year offers this year rather than
69
+ * the year 1.
70
+ */
71
+ declare function step(segment: Segment, delta: number, placeholderValue: Date): Segment;
72
+ /**
73
+ * The segment's display text: the digits behind it, or its placeholder when
74
+ * empty. A year still being typed shows exactly what has been typed --
75
+ * `26` on the way to `2026` -- because padding it would claim digits the
76
+ * user has not entered. Every other segment, and a committed year, is padded
77
+ * to its full width.
78
+ *
79
+ * This is the single source of truth for "what does this segment read as
80
+ * right now" -- both the rendered cell text and `formatForClipboard` call
81
+ * it, so a mid-entry copy always matches what is on screen.
82
+ */
83
+ declare function displaySegment(segment: Segment): string;
84
+ declare function findSegment(parts: Part[], type: SegmentType): Segment | undefined;
85
+ /** Days in a month, via the zeroth day of the next one. */
86
+ declare function daysInMonth(year: number, month: number): number;
87
+ /**
88
+ * The composed value, or `null` while any segment is still empty or still
89
+ * being typed. The day is clamped to the chosen month's real length: a 31 left
90
+ * over from January must resolve to the 28th in February, not roll forward
91
+ * into March the way the `Date` constructor would.
92
+ */
93
+ declare function toDate(parts: Part[]): Date | null;
94
+ /**
95
+ * Carries the segments' state onto a freshly built list, matching by type.
96
+ *
97
+ * Used when the locale or the format changes under a field that is already
98
+ * holding something. Going via `toDate` instead would discard a half-typed
99
+ * entry, because a partial entry composes no date -- and losing the user's
100
+ * digits to a locale switch is exactly the failure this component exists to
101
+ * avoid. A segment the new format has no place for is simply dropped.
102
+ */
103
+ declare function carryOver(next: Part[], previous: Part[]): Part[];
104
+ /**
105
+ * Whether a format would render a month no one can type into -- either a
106
+ * textual month outright, or a `dateStyle` preset, which picks its own and
107
+ * cannot be reasoned about field by field.
108
+ */
109
+ declare function hasTextualMonth(options: Intl.DateTimeFormatOptions): boolean;
110
+ /**
111
+ * The nearest typeable format to the one asked for.
112
+ *
113
+ * A textual month is swapped for a numeric one and *everything else is left
114
+ * alone*: a format asking for month and day keeps exactly those two segments
115
+ * rather than growing a year the consumer never requested. A `dateStyle`
116
+ * preset names no fields at all, so there is nothing to preserve and the
117
+ * default numeric format stands in for the whole thing.
118
+ */
119
+ declare function toNumericFormat(options: Intl.DateTimeFormatOptions): Intl.DateTimeFormatOptions;
120
+ /**
121
+ * The format the segments should actually be built from, warning when that is
122
+ * not the one asked for.
123
+ *
124
+ * Both hosts need the identical policy and differ only in what they call
125
+ * themselves, so the message is passed in rather than the rule being written
126
+ * out twice and left to drift.
127
+ */
128
+ declare function resolveSegmentFormat(given: Intl.DateTimeFormatOptions | undefined, warning: {
129
+ message: string;
130
+ id: string;
131
+ }): Intl.DateTimeFormatOptions | undefined;
132
+ /** Whether two composed values differ -- `null` (no date) included. */
133
+ declare function hasDateChanged(before: Date | null, after: Date | null): boolean;
134
+ /** Writes a value across the segments, leaving literals untouched. */
135
+ declare function fromDate(parts: Part[], date: Date | null): Part[];
136
+ export { buildParts, isSegment, emptySegment, DEFAULT_FORMAT, BOUNDS, applyDigit, commitSegment, clearSegment, deleteDigit, step, toDate, fromDate, findSegment, resolveTwoDigitYear, daysInMonth, displaySegment, withValue, carryOver, hasTextualMonth, toNumericFormat, resolveSegmentFormat, hasDateChanged };
137
+ //# sourceMappingURL=segments.d.ts.map