@astryxdesign/core 0.7.16-canary.ge95b87c → 0.7.16

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 (183) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  3. package/dist/BottomSheet/BottomSheet.js +38 -88
  4. package/dist/BottomSheet/BottomSheetPanel.d.ts +14 -6
  5. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  6. package/dist/BottomSheet/BottomSheetPanel.js +26 -14
  7. package/dist/Button/Button.d.ts.map +1 -1
  8. package/dist/Button/Button.js +78 -3
  9. package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
  10. package/dist/Chat/ChatComposerInput.js +1 -1
  11. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  12. package/dist/ContextMenu/ContextMenu.js +3 -0
  13. package/dist/DateInput/DateInput.d.ts +24 -0
  14. package/dist/DateInput/DateInput.d.ts.map +1 -1
  15. package/dist/DateInput/DateInput.js +12 -5
  16. package/dist/DateInput/index.d.ts +1 -1
  17. package/dist/DateInput/index.d.ts.map +1 -1
  18. package/dist/DateInput/useTypedDate.d.ts +12 -5
  19. package/dist/DateInput/useTypedDate.d.ts.map +1 -1
  20. package/dist/DateInput/useTypedDate.js +18 -16
  21. package/dist/DateTimeInput/DateTimeInput.d.ts +25 -0
  22. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  23. package/dist/DateTimeInput/DateTimeInput.js +10 -3
  24. package/dist/DateTimeInput/NativeTimeSegment.d.ts +3 -1
  25. package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
  26. package/dist/DateTimeInput/NativeTimeSegment.js +10 -1
  27. package/dist/DateTimeInput/index.d.ts +1 -1
  28. package/dist/DateTimeInput/index.d.ts.map +1 -1
  29. package/dist/Dialog/Dialog.d.ts.map +1 -1
  30. package/dist/Dialog/Dialog.js +3 -2
  31. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  32. package/dist/DropdownMenu/DropdownMenuSubMenu.js +3 -0
  33. package/dist/Field/useEntryErrorBehavior.d.ts +8 -0
  34. package/dist/Field/useEntryErrorBehavior.d.ts.map +1 -0
  35. package/dist/Field/useEntryErrorBehavior.js +30 -0
  36. package/dist/FormLayout/FormLayout.d.ts +21 -2
  37. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  38. package/dist/FormLayout/FormLayout.js +5 -2
  39. package/dist/FormLayout/FormLayoutContext.d.ts +18 -2
  40. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  41. package/dist/FormLayout/FormLayoutContext.js +22 -4
  42. package/dist/FormLayout/index.d.ts +1 -1
  43. package/dist/FormLayout/index.d.ts.map +1 -1
  44. package/dist/Layer/inputHold.d.ts +11 -1
  45. package/dist/Layer/inputHold.d.ts.map +1 -1
  46. package/dist/Layer/inputHold.js +114 -2
  47. package/dist/Layer/layerEntranceSide.d.ts.map +1 -1
  48. package/dist/Layer/layerEntranceSide.js +2 -1
  49. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  50. package/dist/Lightbox/Lightbox.js +63 -148
  51. package/dist/Lightbox/useZoomCore.d.ts +2 -13
  52. package/dist/Lightbox/useZoomCore.d.ts.map +1 -1
  53. package/dist/Lightbox/useZoomCore.js +7 -33
  54. package/dist/Lightbox/useZoomStage.d.ts.map +1 -1
  55. package/dist/Lightbox/useZoomStage.js +3 -9
  56. package/dist/Markdown/Markdown.d.ts.map +1 -1
  57. package/dist/Markdown/Markdown.js +7 -0
  58. package/dist/MetadataList/MetadataList.d.ts +2 -1
  59. package/dist/MetadataList/MetadataList.d.ts.map +1 -1
  60. package/dist/MetadataList/MetadataList.js +1 -1
  61. package/dist/NumberInput/NumberInput.d.ts +20 -2
  62. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  63. package/dist/NumberInput/NumberInput.js +4 -1
  64. package/dist/NumberInput/index.d.ts +1 -1
  65. package/dist/NumberInput/index.d.ts.map +1 -1
  66. package/dist/Outline/useOutlineFromDOM.d.ts.map +1 -1
  67. package/dist/Outline/useOutlineFromDOM.js +1 -0
  68. package/dist/Pagination/Pagination.d.ts.map +1 -1
  69. package/dist/Pagination/Pagination.js +1 -0
  70. package/dist/Popover/popoverSurfaceFrame.d.ts +4 -16
  71. package/dist/Popover/popoverSurfaceFrame.d.ts.map +1 -1
  72. package/dist/Popover/popoverSurfaceFrame.js +16 -31
  73. package/dist/Popover/usePopover.d.ts.map +1 -1
  74. package/dist/Popover/usePopover.js +3 -0
  75. package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
  76. package/dist/PowerSearch/PowerSearchValueEditor.js +4 -0
  77. package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
  78. package/dist/SegmentedControl/useSegmentedTouchTracking.js +18 -0
  79. package/dist/Selector/Selector.d.ts.map +1 -1
  80. package/dist/Selector/Selector.js +0 -2
  81. package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
  82. package/dist/Table/plugins/filtering/useTableFiltering.js +2 -0
  83. package/dist/Thumbnail/Thumbnail.d.ts +2 -2
  84. package/dist/TimeInput/TimeInput.d.ts +24 -4
  85. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  86. package/dist/TimeInput/TimeInput.js +10 -4
  87. package/dist/TimeInput/index.d.ts +1 -1
  88. package/dist/TimeInput/index.d.ts.map +1 -1
  89. package/dist/TimeInput/useTypedTime.d.ts +17 -6
  90. package/dist/TimeInput/useTypedTime.d.ts.map +1 -1
  91. package/dist/TimeInput/useTypedTime.js +41 -18
  92. package/dist/Toast/Toast.d.ts +6 -1
  93. package/dist/Toast/Toast.d.ts.map +1 -1
  94. package/dist/Toast/Toast.js +17 -1
  95. package/dist/Toast/ToastViewport.d.ts.map +1 -1
  96. package/dist/Toast/ToastViewport.js +10 -9
  97. package/dist/astryx.css +36 -6
  98. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
  99. package/dist/hooks/containerReveal.stylex.js +18 -15
  100. package/dist/hooks/useAnnounceRenderedText.d.ts +9 -3
  101. package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
  102. package/dist/hooks/useAnnounceRenderedText.js +9 -7
  103. package/dist/hooks/useContainerReveal.d.ts +8 -5
  104. package/dist/hooks/useContainerReveal.d.ts.map +1 -1
  105. package/dist/hooks/useContainerReveal.js +2 -1
  106. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  107. package/dist/i18n/generated-locales/en.generated.js +1 -0
  108. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  109. package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
  110. package/dist/internal/shared-context.d.ts +15 -0
  111. package/dist/internal/shared-context.d.ts.map +1 -0
  112. package/dist/internal/shared-context.js +15 -0
  113. package/dist/motion/animatedLayout.d.ts.map +1 -1
  114. package/dist/motion/animatedLayout.js +2 -17
  115. package/dist/motion/linearEasing.d.ts +9 -0
  116. package/dist/motion/linearEasing.d.ts.map +1 -0
  117. package/dist/motion/linearEasing.js +32 -0
  118. package/dist/motion/resolveMotion.d.ts +16 -0
  119. package/dist/motion/resolveMotion.d.ts.map +1 -1
  120. package/dist/motion/resolveMotion.js +40 -1
  121. package/locales/en.json +15 -11
  122. package/locales/pseudo.json +3 -0
  123. package/package.json +10 -5
  124. package/src/BottomSheet/BottomSheet.tsx +43 -101
  125. package/src/BottomSheet/BottomSheetPanel.tsx +46 -23
  126. package/src/Button/Button.tsx +132 -5
  127. package/src/Chat/ChatComposerInput.tsx +4 -0
  128. package/src/ContextMenu/ContextMenu.tsx +13 -0
  129. package/src/DateInput/DateInput.doc.mjs +18 -0
  130. package/src/DateInput/DateInput.tsx +35 -3
  131. package/src/DateInput/index.ts +1 -0
  132. package/src/DateInput/useTypedDate.ts +50 -12
  133. package/src/DateTimeInput/DateTimeInput.doc.mjs +18 -0
  134. package/src/DateTimeInput/DateTimeInput.tsx +38 -2
  135. package/src/DateTimeInput/NativeTimeSegment.tsx +16 -1
  136. package/src/DateTimeInput/index.ts +1 -0
  137. package/src/Dialog/Dialog.tsx +13 -2
  138. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +13 -0
  139. package/src/Field/useEntryErrorBehavior.ts +34 -0
  140. package/src/FormLayout/FormLayout.doc.mjs +14 -0
  141. package/src/FormLayout/FormLayout.tsx +24 -2
  142. package/src/FormLayout/FormLayoutContext.ts +24 -4
  143. package/src/FormLayout/index.ts +5 -1
  144. package/src/Layer/inputHold.ts +137 -2
  145. package/src/Layer/layerEntranceSide.ts +2 -1
  146. package/src/Lightbox/Lightbox.doc.mjs +1 -1
  147. package/src/Lightbox/Lightbox.tsx +226 -357
  148. package/src/Lightbox/useZoomCore.ts +6 -49
  149. package/src/Lightbox/useZoomStage.ts +7 -17
  150. package/src/Markdown/Markdown.tsx +6 -0
  151. package/src/MetadataList/MetadataList.doc.mjs +16 -0
  152. package/src/MetadataList/MetadataList.tsx +3 -2
  153. package/src/NumberInput/NumberInput.doc.mjs +18 -0
  154. package/src/NumberInput/NumberInput.tsx +22 -1
  155. package/src/NumberInput/index.ts +1 -0
  156. package/src/Outline/useOutlineFromDOM.doc.mjs +99 -0
  157. package/src/Outline/useOutlineFromDOM.ts +1 -0
  158. package/src/Pagination/Pagination.tsx +1 -0
  159. package/src/Popover/popoverSurfaceFrame.ts +18 -41
  160. package/src/Popover/usePopover.tsx +13 -0
  161. package/src/PowerSearch/PowerSearchValueEditor.tsx +4 -0
  162. package/src/SegmentedControl/useSegmentedTouchTracking.ts +15 -0
  163. package/src/Selector/Selector.tsx +0 -1
  164. package/src/Table/plugins/filtering/useTableFiltering.tsx +2 -0
  165. package/src/Thumbnail/Thumbnail.doc.mjs +2 -2
  166. package/src/Thumbnail/Thumbnail.tsx +2 -2
  167. package/src/TimeInput/TimeInput.doc.mjs +21 -3
  168. package/src/TimeInput/TimeInput.tsx +38 -8
  169. package/src/TimeInput/index.ts +1 -0
  170. package/src/TimeInput/useTypedTime.ts +60 -18
  171. package/src/Toast/Toast.tsx +33 -2
  172. package/src/Toast/ToastViewport.tsx +14 -9
  173. package/src/hooks/containerReveal.stylex.ts +17 -15
  174. package/src/hooks/useAnnounceRenderedText.ts +18 -6
  175. package/src/hooks/useContainerReveal.doc.mjs +3 -3
  176. package/src/hooks/useContainerReveal.ts +8 -5
  177. package/src/i18n/generated-locales/en.generated.ts +1 -0
  178. package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
  179. package/src/internal/shared-context.ts +15 -0
  180. package/src/motion/README.md +1 -0
  181. package/src/motion/animatedLayout.ts +6 -21
  182. package/src/motion/linearEasing.ts +35 -0
  183. package/src/motion/resolveMotion.ts +42 -1
@@ -1,4 +1,5 @@
1
1
  import type { InputStatus } from '../Field/types.js';
2
+ import type { EntryErrorBehavior } from '../FormLayout/FormLayoutContext.js';
2
3
  import { type ISOTimeString } from '../utils/timeParser.js';
3
4
  import { type HourFormat } from '../utils/timeFormat.js';
4
5
  /**
@@ -36,22 +37,32 @@ export interface UseTypedTimeOptions {
36
37
  /** The caller's status. */
37
38
  status?: InputStatus;
38
39
  onEntryErrorChange?: (error: TimeInputEntryError | null) => void;
40
+ /**
41
+ * Under `'blur-or-enter'`, typing and native edits reveal no rejection:
42
+ * only Enter or blur does. An edit that the field accepts or empties still
43
+ * clears a revealed rejection at once.
44
+ */
45
+ entryErrorBehavior: EntryErrorBehavior;
39
46
  }
40
47
  /**
41
- * The typed draft of a time field and its rejection. A rejection shows once
42
- * the draft is complete, or at Enter or blur, and stays through edits that
43
- * leave the draft rejected or unfinished. A native control's rejection, set
44
- * through `setSurfaceRejected`, shows the same way and is never reported.
48
+ * The typed draft of a time field and its rejection. A rejection shows at
49
+ * Enter or blur, or under `'complete'` once the draft is complete, and stays
50
+ * through edits that leave the draft rejected or unfinished. A native
51
+ * control's rejection, set through `setSurfaceRejected`, shows at once under
52
+ * `'complete'` and at `commitSurface` under `'blur-or-enter'`. It is never
53
+ * reported.
45
54
  * `handleChange` and `commit` return the time for the owner to commit:
46
55
  * `undefined` for emptied text, null for none.
47
56
  */
48
- export declare function useTypedTime({ value, hourFormat, hasSeconds, min, max, isDisabled, isLocked, hasTypedField, errorMessage, isStatusAnnounced, status, onEntryErrorChange, }: UseTypedTimeOptions): {
57
+ export declare function useTypedTime({ value, hourFormat, hasSeconds, min, max, isDisabled, isLocked, hasTypedField, errorMessage, isStatusAnnounced, status, onEntryErrorChange, entryErrorBehavior, }: UseTypedTimeOptions): {
49
58
  pendingInput: string | null;
50
59
  /** A rejection is revealed: it sets `aria-invalid`. */
51
60
  isRejected: boolean;
52
61
  /** A native control's rejection shows: a locked field hides it. */
53
62
  isSurfaceRejectionShown: boolean;
54
- setSurfaceRejected: import("react").Dispatch<import("react").SetStateAction<boolean>>;
63
+ setSurfaceRejected: (isRejected: boolean) => void;
64
+ /** Shows a native control's rejection that waits, at Enter or blur. */
65
+ commitSurface: () => void;
55
66
  fieldStatus: InputStatus | undefined;
56
67
  /** The rejection message that no shown status announces. */
57
68
  alertMessage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useTypedTime.d.ts","sourceRoot":"","sources":["../../src/TimeInput/useTypedTime.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAOhD,OAAO,EAAgB,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC;IAClC,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAYD,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;CAClE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,UAAU,EACV,UAAU,EACV,GAAG,EACH,GAAG,EACH,UAAU,EACV,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,kBAAkB,GACnB,EAAE,mBAAmB;;IAwLlB,uDAAuD;;IAEvD,mEAAmE;;;;IAInE,4DAA4D;;IAE5D,2EAA2E;;yBA5DpE,MAAM;sBAyBH,OAAO,GAAG,MAAM;IAuC1B,yDAAyD;;EAG5D"}
1
+ {"version":3,"file":"useTypedTime.d.ts","sourceRoot":"","sources":["../../src/TimeInput/useTypedTime.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAOxE,OAAO,EAAgB,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC;IAClC,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAeD,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;IAC/B,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE;;;;OAIG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAKD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,UAAU,EACV,UAAU,EACV,GAAG,EACH,GAAG,EACH,UAAU,EACV,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,kBAAkB,EAClB,kBAAkB,GACnB,EAAE,mBAAmB;;IA+MlB,uDAAuD;;IAEvD,mEAAmE;;qCAnBtD,OAAO;IAsBpB,uEAAuE;;;IAGvE,4DAA4D;;IAE5D,2EAA2E;;yBA/EpE,MAAM;sBAyBH,OAAO,GAAG,MAAM;IA0D1B,yDAAyD;;EAG5D"}
@@ -6,8 +6,9 @@
6
6
  * @file useTypedTime.ts
7
7
  * @input Provider locale, a time field's hour format, seconds, bounds, the
8
8
  * caller's status, the shared time parser, Field/useEntryErrorReport for
9
- * the rejection status, alert and report, and Field/useValueReplacesEntry
10
- * for when a new value replaces the kept draft
9
+ * the rejection status, alert and report, Field/useValueReplacesEntry for
10
+ * when a new value replaces the kept draft, and the field's resolved entry
11
+ * error behavior
11
12
  * @output useTypedTime, the typed-time draft and its rejection that TimeInput
12
13
  * and DateTimeInput's time segment share, and TimeInputEntryError
13
14
  * @position TimeInput helper hook; used by TimeInput and DateTimeInput
@@ -29,11 +30,16 @@ const EMPTY_DRAFT = {
29
30
  rejection: null,
30
31
  isComplete: false
31
32
  };
33
+
34
+ /** The rejection of a native control: none, waiting for a commit, or shown. */
35
+
32
36
  /**
33
- * The typed draft of a time field and its rejection. A rejection shows once
34
- * the draft is complete, or at Enter or blur, and stays through edits that
35
- * leave the draft rejected or unfinished. A native control's rejection, set
36
- * through `setSurfaceRejected`, shows the same way and is never reported.
37
+ * The typed draft of a time field and its rejection. A rejection shows at
38
+ * Enter or blur, or under `'complete'` once the draft is complete, and stays
39
+ * through edits that leave the draft rejected or unfinished. A native
40
+ * control's rejection, set through `setSurfaceRejected`, shows at once under
41
+ * `'complete'` and at `commitSurface` under `'blur-or-enter'`. It is never
42
+ * reported.
37
43
  * `handleChange` and `commit` return the time for the owner to commit:
38
44
  * `undefined` for emptied text, null for none.
39
45
  */
@@ -49,8 +55,10 @@ export function useTypedTime({
49
55
  errorMessage,
50
56
  isStatusAnnounced,
51
57
  status,
52
- onEntryErrorChange
58
+ onEntryErrorChange,
59
+ entryErrorBehavior
53
60
  }) {
61
+ const revealsComplete = entryErrorBehavior === 'complete';
54
62
  const locale = useLocale();
55
63
  const [pendingInput, setPendingInput] = useState(null);
56
64
  // How the draft was last committed. After blur, a hidden input carries the
@@ -61,7 +69,7 @@ export function useTypedTime({
61
69
  // The rejection last revealed. An edit that leaves the draft rejected but
62
70
  // not complete keeps it.
63
71
  const [keptRejection, setKeptRejection] = useState(null);
64
- const [isSurfaceRejected, setSurfaceRejected] = useState(false);
72
+ const [surfaceRejection, setSurfaceRejection] = useState('none');
65
73
  // The time that typing last committed, so its echo through `value` keeps
66
74
  // the draft.
67
75
  const [lastCommitted, setLastCommitted] = useState(null);
@@ -108,8 +116,8 @@ export function useTypedTime({
108
116
  // of a time that typing committed keeps the draft.
109
117
  const isNewValue = useValueReplacesEntry(value, keptCommits);
110
118
  const isEcho = lastCommitted !== null && value === lastCommitted.time;
111
- if (isNewValue && isSurfaceRejected) {
112
- setSurfaceRejected(false);
119
+ if (isNewValue && surfaceRejection !== 'none') {
120
+ setSurfaceRejection('none');
113
121
  }
114
122
  if (isNewValue && !isEcho) {
115
123
  setLastCommitted(null);
@@ -123,8 +131,8 @@ export function useTypedTime({
123
131
  if (isDisabled && pendingInput !== null) {
124
132
  drop();
125
133
  }
126
- if (isDisabled && isSurfaceRejected) {
127
- setSurfaceRejected(false);
134
+ if (isDisabled && surfaceRejection !== 'none') {
135
+ setSurfaceRejection('none');
128
136
  }
129
137
  }
130
138
  // A rejection belongs to the surface that showed it. A switch between the
@@ -132,15 +140,15 @@ export function useTypedTime({
132
140
  const [hadTypedField, setHadTypedField] = useState(hasTypedField);
133
141
  if (hasTypedField !== hadTypedField) {
134
142
  setHadTypedField(hasTypedField);
135
- if (isSurfaceRejected) {
136
- setSurfaceRejected(false);
143
+ if (surfaceRejection !== 'none') {
144
+ setSurfaceRejection('none');
137
145
  }
138
146
  }
139
147
  if (!hasTypedField && pendingInput !== null) {
140
148
  drop();
141
149
  }
142
150
  const draft = pendingInput !== null ? readDraft(pendingInput) : EMPTY_DRAFT;
143
- const freshRejection = draft.rejection != null && (committedBy != null || draft.isComplete) ? draft.rejection : null;
151
+ const freshRejection = draft.rejection != null && (committedBy != null || revealsComplete && draft.isComplete) ? draft.rejection : null;
144
152
  if (draft.rejection == null) {
145
153
  if (keptRejection != null) {
146
154
  setKeptRejection(null);
@@ -149,7 +157,7 @@ export function useTypedTime({
149
157
  setKeptRejection(freshRejection);
150
158
  }
151
159
  const entryError = isLocked || draft.rejection == null ? null : freshRejection ?? keptRejection;
152
- const isSurfaceRejectionShown = !isLocked && isSurfaceRejected;
160
+ const isSurfaceRejectionShown = !isLocked && (surfaceRejection === 'shown' || revealsComplete && surfaceRejection === 'held');
153
161
  const isRejected = entryError != null || isSurfaceRejectionShown;
154
162
 
155
163
  // A caller error with a message always shows in place of the field's own
@@ -176,7 +184,7 @@ export function useTypedTime({
176
184
  setPendingInput(text);
177
185
  setCommittedBy(null);
178
186
  const next = readDraft(text);
179
- if (next.rejection == null || next.isComplete) {
187
+ if (next.rejection == null || revealsComplete && next.isComplete) {
180
188
  reportIfEditable(next.rejection);
181
189
  }
182
190
  if (next.time == null || next.time === value) {
@@ -186,7 +194,7 @@ export function useTypedTime({
186
194
  time: next.time
187
195
  });
188
196
  return next.time;
189
- }, [isDisabled, readDraft, reportIfEditable, value]);
197
+ }, [isDisabled, readDraft, revealsComplete, reportIfEditable, value]);
190
198
  const reset = useCallback(() => {
191
199
  drop();
192
200
  reportEntryError(null);
@@ -215,6 +223,19 @@ export function useTypedTime({
215
223
  });
216
224
  return time;
217
225
  }, [pendingInput, isDisabled, readDraft, reportIfEditable, value, reset]);
226
+
227
+ // An edit that stays rejected keeps a shown rejection.
228
+ const setSurfaceRejected = useCallback(isRejected => setSurfaceRejection(prev => {
229
+ if (!isRejected) {
230
+ return 'none';
231
+ }
232
+ return revealsComplete || prev === 'shown' ? 'shown' : 'held';
233
+ }), [revealsComplete]);
234
+ const commitSurface = useCallback(() => {
235
+ if (!isDisabled) {
236
+ setSurfaceRejection(prev => prev === 'held' ? 'shown' : prev);
237
+ }
238
+ }, [isDisabled]);
218
239
  return {
219
240
  pendingInput,
220
241
  /** A rejection is revealed: it sets `aria-invalid`. */
@@ -222,6 +243,8 @@ export function useTypedTime({
222
243
  /** A native control's rejection shows: a locked field hides it. */
223
244
  isSurfaceRejectionShown,
224
245
  setSurfaceRejected,
246
+ /** Shows a native control's rejection that waits, at Enter or blur. */
247
+ commitSurface,
225
248
  fieldStatus,
226
249
  /** The rejection message that no shown status announces. */
227
250
  alertMessage,
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { AnnounceFn } from '../hooks/useAnnounce.js';
2
3
  import type { ToastType, ToastDismissReason, ToastContentRenderFn } from './types.js';
3
4
  import { type ToastGestureDirection } from './useToastGesture.js';
4
5
  export interface ToastProps {
@@ -18,6 +19,10 @@ export interface ToastProps {
18
19
  }
19
20
  interface ToastSurfaceProps extends ToastProps {
20
21
  gestureDirection: ToastGestureDirection;
22
+ /** The viewport's modal-aware announcement channel. */
23
+ announce?: AnnounceFn;
24
+ /** Read the body after render when its text comes from a child component. */
25
+ isRenderedBodyAnnouncement?: boolean;
21
26
  /**
22
27
  * Changes when a uniqueID overwrite updates this card in place: the new
23
28
  * toast's auto-hide timer starts over.
@@ -58,7 +63,7 @@ export declare function Toast(props: ToastProps): import("react").JSX.Element;
58
63
  export declare namespace Toast {
59
64
  var displayName: string;
60
65
  }
61
- export declare function ToastSurface({ type, body, endContent, isAutoHide, autoHideDuration, isExiting, onDismiss, renderContent, gestureDirection, timerKey, isLiveRegion, hasEntryStarted, ...rest }: ToastSurfaceProps): import("react").JSX.Element;
66
+ export declare function ToastSurface({ type, body, endContent, isAutoHide, autoHideDuration, isExiting, onDismiss, renderContent, gestureDirection, timerKey, isLiveRegion, announce, isRenderedBodyAnnouncement, hasEntryStarted, ...rest }: ToastSurfaceProps): import("react").JSX.Element;
62
67
  export declare namespace ToastSurface {
63
68
  var displayName: string;
64
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAa,SAAS,EAAY,MAAM,OAAO,CAAC;AAkB5D,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAkB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAkG9E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAChD;;;;OAIG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,UAAU,iBAAkB,SAAQ,UAAU;IAC5C,gBAAgB,EAAE,qBAAqB,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAEtC;yBAFe,KAAK;;;AAOrB,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,YAAmB,EACnB,eAAuB,EACvB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAuOnB;yBArPe,YAAY"}
1
+ {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/Toast/Toast.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAa,SAAS,EAAY,MAAM,OAAO,CAAC;AAiB5D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAGrD,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAkB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAqG9E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAChD;;;;OAIG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,UAAU,iBAAkB,SAAQ,UAAU;IAC5C,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,6EAA6E;IAC7E,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAEtC;yBAFe,KAAK;;;AAOrB,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAiB,EACjB,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,YAAmB,EACnB,QAAQ,EACR,0BAAkC,EAClC,eAAuB,EACvB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BA2PnB;yBA3Qe,YAAY"}
@@ -24,6 +24,7 @@ import "../theme/tokens.stylex.js";
24
24
  import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars, typographyVars, typeScaleDefaults } from "../theme/tokens.stylex.js";
25
25
  import { mergeProps } from "../utils/index.js";
26
26
  import { INTERACTIVE_SELECTORS } from "../hooks/useClickableContainer.js";
27
+ import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
27
28
  import { useTheme } from "../theme/index.js";
28
29
  import { MediaTheme } from "../theme/MediaTheme.js";
29
30
  import { pickDataAttributes, themeProps } from "../utils/themeProps.js";
@@ -33,6 +34,7 @@ import english from "../i18n/generated-english/Toast/Toast.generated.js";
33
34
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
35
  registerEnglishFallback(english);
35
36
  const SWIPE_INTERACTIVE_TARGET_SELECTOR = `${INTERACTIVE_SELECTORS},[tabindex],[contenteditable]:not([contenteditable="false"])`;
37
+ const TOAST_ANNOUNCEMENT_EXCLUDED_SELECTOR = 'button, input, select, textarea, a[href], [role="button"], [role="link"], [tabindex], [contenteditable]:not([contenteditable="false"]), svg, [role="img"]';
36
38
  function isInteractiveTarget(target, root) {
37
39
  if (!(target instanceof Element)) {
38
40
  return false;
@@ -88,10 +90,14 @@ export function ToastSurface({
88
90
  gestureDirection,
89
91
  timerKey,
90
92
  isLiveRegion = true,
93
+ announce,
94
+ isRenderedBodyAnnouncement = false,
91
95
  hasEntryStarted = false,
92
96
  ...rest
93
97
  }) {
94
98
  const t = useComponentTranslator();
99
+ const isError = type === 'error';
100
+ const bodyRef = useRef(null);
95
101
  const timerRef = useRef(null);
96
102
  // Every condition that holds the auto-hide timer (pointer over the card,
97
103
  // focus inside it, a touch or pen gesture, the window blurred) is tracked on
@@ -228,10 +234,19 @@ export function ToastSurface({
228
234
  shouldIgnoreTarget: isInteractiveTarget
229
235
  });
230
236
  cardRootRef.current = rootRef;
237
+
238
+ // The viewport announces a plain-text body when it dispatches the toast.
239
+ // This reads a component body or a custom layout after commit. A body is
240
+ // read whole, links included. A custom layout leaves out its controls.
241
+ useAnnounceRenderedText(renderContent != null ? rootRef : bodyRef, !isLiveRegion && (renderContent != null || isRenderedBodyAnnouncement), timerKey ?? '', {
242
+ politeness: isError ? 'assertive' : 'polite',
243
+ announce,
244
+ exclude: renderContent != null ? TOAST_ANNOUNCEMENT_EXCLUDED_SELECTOR : undefined
245
+ });
231
246
  const handleDismiss = useCallback(() => {
232
247
  onDismiss('manual');
233
248
  }, [onDismiss]);
234
- const isError = type === 'error';
249
+
235
250
  // The surface is *usually* dark in light mode and light in dark mode, but a
236
251
  // theme can define --color-background-inverted as anything — so the mode is
237
252
  // measured, not assumed. This is only the pre-measurement fallback.
@@ -293,6 +308,7 @@ export function ToastSurface({
293
308
  className: "x78zum5 x1cy8zhl xozqiw3 xjcht0a xh8yej3"
294
309
  },
295
310
  children: [/*#__PURE__*/_jsx("div", {
311
+ ref: bodyRef,
296
312
  ...{
297
313
  className: "x98rzlu xeuugli xj0a0fe x5ujdhh"
298
314
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAa,aAAa,EAAqB,MAAM,SAAS,CAAC;AAG3E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AA4JtD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA2JD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAsB,EACtB,UAAc,EACd,KAAK,EACL,UAAU,EACV,UAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,+BAknBpB;yBAznBe,aAAa"}
1
+ {"version":3,"file":"ToastViewport.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastViewport.tsx"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAa,aAAa,EAAqB,MAAM,SAAS,CAAC;AAG3E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AA4JtD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACtE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAiKD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAsB,EACtB,UAAc,EACd,KAAK,EACL,UAAU,EACV,UAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,+BAgnBpB;yBAvnBe,aAAa"}
@@ -139,6 +139,7 @@ function ToastRow({
139
139
  isReversed,
140
140
  onExited,
141
141
  onDismiss,
142
+ announce,
142
143
  isLiveRegion
143
144
  }) {
144
145
  const o = entry.options;
@@ -266,6 +267,8 @@ function ToastRow({
266
267
  renderContent: o.renderContent,
267
268
  timerKey: entry.id,
268
269
  isLiveRegion: isLiveRegion,
270
+ announce: announce,
271
+ isRenderedBodyAnnouncement: o.renderContent == null && getNodeText(o.body) === '',
269
272
  hasEntryStarted: hasEntryStarted
270
273
  })
271
274
  })
@@ -378,13 +381,10 @@ export function ToastViewport({
378
381
 
379
382
  // Announce toasts through the persistent singleton live regions. They are
380
383
  // mounted empty and only mutated afterwards, which screen readers announce
381
- // (see useAnnounce.ts). The announcement happens in addToast — the imperative
382
- // dispatch path invoked once per useToast() call from an event handler,
383
- // never from render — so each toast is announced exactly once by
384
- // construction, independent of the React render lifecycle (StrictMode
385
- // double-render/double-effect, viewport remounts, and unrelated list
386
- // re-renders never re-announce). It is client-only (addToast never runs
387
- // during SSR), so it is SSR-safe.
384
+ // (see useAnnounce.ts). Plain React text is announced in addToast — the
385
+ // event-driven dispatch path. ToastSurface reads a component body or a
386
+ // custom layout after commit. getNodeText cannot see what a component
387
+ // renders. Both paths use this modal-aware writer.
388
388
  // The viewport is each toast's only announcement owner; the card carries no
389
389
  // live role. A top-layer viewport's host moves into the latest open native
390
390
  // modal, where the page's shared channel is not exposed, so it writes
@@ -394,7 +394,7 @@ export function ToastViewport({
394
394
  const announceShared = useAnnounce();
395
395
  // The top-layer host (below), read at write time for the modal it sits in.
396
396
  const hostRef = useRef(null);
397
- const announce = useCallback((text, politeness) => {
397
+ const announce = useCallback((text, politeness = 'polite') => {
398
398
  const modal = isTopLayer ? enclosingModalDialog(hostRef.current) : null;
399
399
  if (modal != null) {
400
400
  announceInModal(modal, text, politeness);
@@ -422,7 +422,7 @@ export function ToastViewport({
422
422
  }
423
423
  // Only text is announced; interactive endContent is reachable via F6.
424
424
  const text = getNodeText(entry.options.body);
425
- if (text) {
425
+ if (text && entry.options.renderContent == null) {
426
426
  // Error toasts map to the assertive region (role="alert"); everything
427
427
  // else to the polite region (role="status") — mirrors Toast.tsx.
428
428
  announce(text, entry.options.type === 'error' ? 'assertive' : 'polite');
@@ -824,6 +824,7 @@ export function ToastViewport({
824
824
  isReversed: isReversed,
825
825
  onExited: handleExited,
826
826
  onDismiss: removeToast,
827
+ announce: announce,
827
828
  isLiveRegion: false
828
829
  }, entry.rowKey ?? entry.id))
829
830
  })
package/dist/astryx.css CHANGED
@@ -201,6 +201,7 @@
201
201
  .x18jk3ff{--_segmented-control-padding:var(--spacing-0-5)}
202
202
  .x9icjy1{--_segmented-control-radius:var(--radius-element)}
203
203
  .x1jx3mzq{--_sheet-scrim-duration:initial}
204
+ .x1pfqsku{--_sheet-scrim-easing:initial}
204
205
  .xnvc5mv{--_sheet-scrim-opacity:initial}
205
206
  .x69vvuq{--_spinner-box-size:calc(var(--_spinner-ring-diameter) + var(--_spinner-ring-stroke) * 2)}
206
207
  .x2lq4xu{--_spinner-ring-diameter:var(--spinner-diameter)}
@@ -516,13 +517,13 @@
516
517
  .xpl7j7d:has(> [data-container-corner]:last-child):has(> * [data-container-corner]){--container-corner-end-start:0px}
517
518
  .x1fj5z48:has(> [data-container-corner]:first-child):has(> * [data-container-corner]){--container-corner-start-end:0px}
518
519
  .x1x9b3rp:has(> [data-container-corner]:first-child):has(> * [data-container-corner]){--container-corner-start-start:0px}
519
- @media (any-pointer: coarse){.x1hl81f0.x1hl81f0{--_fade-delay:0s}}
520
+ @media (pointer: coarse){.x4pvm7e.x4pvm7e{--_fade-delay:0s}}
520
521
  @media (pointer: coarse){.x73lxwv.x73lxwv{--_power-search-sheet-hit-content:""}}
521
522
  @media (pointer: coarse){.xhx5icg.xhx5icg{--_power-search-sheet-hit-inset:min(0px,calc((100% - 44px) / 2))}}
522
- @media (any-pointer: coarse){.x1pn63d7.x1pn63d7{--_reveal-delay:0s,0s}}
523
- @media (any-pointer: coarse){.xm1aeao.xm1aeao{--_reveal-delay-reduced:0s,0s}}
524
- @media (any-pointer: coarse){.xi7d7de.xi7d7de{--_reveal-opacity:1}}
525
- @media (any-pointer: coarse){.xarvkxi.xarvkxi{--_reveal-position:static}}
523
+ @media (pointer: coarse){.x1humlf3.x1humlf3{--_reveal-delay:0s,0s}}
524
+ @media (pointer: coarse){.x63b2yw.x63b2yw{--_reveal-delay-reduced:0s,0s}}
525
+ @media (pointer: coarse){.xakbj2a.xakbj2a{--_reveal-opacity:1}}
526
+ @media (pointer: coarse){.xe5pbq5.xe5pbq5{--_reveal-position:static}}
526
527
  @media (pointer: coarse){.x1h9khjt.x1h9khjt{--_thumbnail-hit-inset:-2px}}
527
528
  @media (hover: hover){.x1m110vg.x1m110vg{--resize-hint:transparent}}
528
529
  .xb8awce.xb8awce:active:where(:not(:disabled,[aria-disabled="true"])){--_press-overlay:var(--color-overlay-pressed)}
@@ -764,6 +765,7 @@
764
765
  .xomzh7y:focus:not(#\#):not(#\#){overflow:visible}
765
766
  .xh2mrf5:focus:not(#\#):not(#\#){padding-block:var(--spacing-2)}
766
767
  .x1cf3d6k:focus:not(#\#):not(#\#){padding-inline:var(--spacing-4)}
768
+ @media (forced-colors: active){.x1ylmb6m.x1ylmb6m:not(#\#):not(#\#){border-color:ButtonText}}
767
769
  @media (forced-colors: active){.x1w1tqly.x1w1tqly:not(#\#):not(#\#){border-color:CanvasText}}
768
770
  @media (forced-colors: active){.xmnqt3w.xmnqt3w:not(#\#):not(#\#){border-color:GrayText}}
769
771
  @media (forced-colors: active){.xx61lck.xx61lck:not(#\#):not(#\#){border-style:solid}}
@@ -1853,6 +1855,14 @@
1853
1855
  @media (forced-colors: active){.x1jzqe4.x1jzqe4:not(#\#):not(#\#):not(#\#){background-color:Highlight}}
1854
1856
  @media (forced-colors: active){.x1sir5s4.x1sir5s4:not(#\#):not(#\#):not(#\#){background-color:HighlightText}}
1855
1857
  @media (hover: hover){.x150ydqw.x150ydqw:not(#\#):not(#\#):not(#\#){background-color:transparent}}
1858
+ @media (forced-colors: active){.xhdp0qd.xhdp0qd:not(#\#):not(#\#):not(#\#){border-inline-end-color:ButtonText}}
1859
+ @media (forced-colors: active){.x1x0u81l.x1x0u81l:not(#\#):not(#\#):not(#\#){border-inline-end-color:CanvasText}}
1860
+ @media (forced-colors: active){.xf1j0q2.xf1j0q2:not(#\#):not(#\#):not(#\#){border-inline-end-style:solid}}
1861
+ @media (forced-colors: active){.xmzn1mo.xmzn1mo:not(#\#):not(#\#):not(#\#){border-inline-end-width:1px}}
1862
+ @media (forced-colors: active){.x1hbxdp3.x1hbxdp3:not(#\#):not(#\#):not(#\#){border-inline-start-color:ButtonText}}
1863
+ @media (forced-colors: active){.xjslfuv.xjslfuv:not(#\#):not(#\#):not(#\#){border-inline-start-color:CanvasText}}
1864
+ @media (forced-colors: active){.x1gbqego.x1gbqego:not(#\#):not(#\#):not(#\#){border-inline-start-style:solid}}
1865
+ @media (forced-colors: active){.xjg5lhu.xjg5lhu:not(#\#):not(#\#):not(#\#){border-inline-start-width:1px}}
1856
1866
  @media (hover: none) and (update: slow){.xgrch5n.xgrch5n:not(#\#):not(#\#):not(#\#){color:blue}}
1857
1867
  @media (forced-colors: active){.xs5hli.xs5hli:not(#\#):not(#\#):not(#\#){color:CanvasText}}
1858
1868
  @media (forced-colors: active){.x1xt8qih.x1xt8qih:not(#\#):not(#\#):not(#\#){color:currentColor}}
@@ -1984,6 +1994,12 @@
1984
1994
  @media (forced-colors: active){.xjml3p3.xjml3p3:dir(rtl):not(#\#):not(#\#):not(#\#){mask-image:none}}
1985
1995
  @media (forced-colors: active){.x1xwfpud.x1xwfpud:dir(rtl):not(#\#):not(#\#):not(#\#){transform:none}}
1986
1996
  @media (pointer: coarse) and (not (forced-colors: active)){.x1rvio82.x1rvio82:dir(rtl):not(#\#):not(#\#):not(#\#){transform:translateX(calc(min(calc(100% - var(--_progress-bar-fill,0%)),calc(100% - var(--_progress-bar-min,0px))) - var(--_progress-bar-flip,0) * .01px))}}
1997
+ @media (forced-colors: active){.x1jd14un.x1jd14un:first-child:not(#\#):not(#\#):not(#\#){border-inline-start-style:solid}}
1998
+ @media (forced-colors: active){.xnvtw6h.xnvtw6h:first-child:not(#\#):not(#\#):not(#\#){border-inline-start-width:1px}}
1999
+ @media (forced-colors: active){.xcy1b24.xcy1b24:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#){border-inline-end-color:ButtonText}}
2000
+ @media (forced-colors: active){.x1nw5ucf.x1nw5ucf:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#){border-inline-end-color:CanvasText}}
2001
+ @media (forced-colors: active){.x1nzwmfm.x1nzwmfm:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#){border-inline-end-style:solid}}
2002
+ @media (forced-colors: active){.x1s1fdp0.x1s1fdp0:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#){border-inline-end-width:1px}}
1987
2003
  @container (max-width: 399px){.x1alyx8p.x1alyx8p:not(#\#):not(#\#):not(#\#){flex-wrap:wrap}}
1988
2004
  @media (forced-colors: active){.x1vo6n7o.x1vo6n7o:active:not(#\#):not(#\#):not(#\#){background-color:Highlight}}
1989
2005
  @media (hover: hover){.x1otsd3y.x1otsd3y.x1otsd3y:hover:where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#){background-image:linear-gradient(var(--color-overlay-hover),var(--color-overlay-hover)),linear-gradient(var(--color-neutral),var(--color-neutral))}}
@@ -2431,6 +2447,14 @@
2431
2447
  .x1rw3289:focus:not(#\#):not(#\#):not(#\#):not(#\#){top:var(--spacing-2)}
2432
2448
  .x1jqxupm:focus:not(#\#):not(#\#):not(#\#):not(#\#){width:auto}
2433
2449
  .xjkv29o:focus:not(#\#):not(#\#):not(#\#):not(#\#){width:fit-content}
2450
+ @media (forced-colors: active){.xaj2e6u.xaj2e6u:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:ButtonText}}
2451
+ @media (forced-colors: active){.xszdk7l.xszdk7l:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:CanvasText}}
2452
+ @media (forced-colors: active){.xe3zi7u.xe3zi7u:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-style:solid}}
2453
+ @media (forced-colors: active){.x15anc7y.x15anc7y:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-width:1px}}
2454
+ @media (forced-colors: active){.xnvbotg.xnvbotg:not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:ButtonText}}
2455
+ @media (forced-colors: active){.x19dwuzr.x19dwuzr:not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:CanvasText}}
2456
+ @media (forced-colors: active){.x4z998w.x4z998w:not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:solid}}
2457
+ @media (forced-colors: active){.x1lym3mf.x1lym3mf:not(#\#):not(#\#):not(#\#):not(#\#){border-top-width:1px}}
2434
2458
  @media (any-pointer: coarse){.x1d3wnk4.x1d3wnk4:not(#\#):not(#\#):not(#\#):not(#\#){height:24px}}
2435
2459
  @media (pointer: coarse){.xgjkl26.xgjkl26:not(#\#):not(#\#):not(#\#):not(#\#){height:calc(100% + var(--astryx-hit-inset-top,0px) + var(--astryx-hit-inset-bottom,0px))}}
2436
2460
  @media (pointer: coarse){.x80b3aj.x80b3aj:not(#\#):not(#\#):not(#\#):not(#\#){min-height:24px}}
@@ -2446,6 +2470,12 @@
2446
2470
  @media (pointer: coarse){.x1uj43hb.x1uj43hb:not(#\#):not(#\#):not(#\#):not(#\#){width:calc(100% + var(--astryx-hit-inset-left,0px) + var(--astryx-hit-inset-right,0px))}}
2447
2471
  @media (forced-colors: active){.xtyencx.xtyencx:not(#\#):not(#\#):not(#\#):not(#\#){width:var(--_progress-bar-fill,0%)}}
2448
2472
  @supports (-webkit-touch-callout: none){@media (pointer: coarse){.x9w4715.x9w4715.x9w4715:not(#\#):not(#\#):not(#\#):not(#\#){height:calc(max(1rem,var(--text-body-size)) * var(--text-body-leading));height:1lh}}}
2473
+ @media (forced-colors: active){.xz5oem8.xz5oem8:first-child:not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:solid}}
2474
+ @media (forced-colors: active){.x1qvjua.x1qvjua:first-child:not(#\#):not(#\#):not(#\#):not(#\#){border-top-width:1px}}
2475
+ @media (forced-colors: active){.xlkh95r.xlkh95r:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:ButtonText}}
2476
+ @media (forced-colors: active){.x2ab8f3.x2ab8f3:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:CanvasText}}
2477
+ @media (forced-colors: active){.xoqbfsn.xoqbfsn:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-style:solid}}
2478
+ @media (forced-colors: active){.x12u9vjp.x12u9vjp:nth-last-child(1 of :not([popover]):not(template):not(dialog)):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-width:1px}}
2449
2479
  @media (pointer: coarse){@media (forced-colors: active){.x1j61smm.x1j61smm.x1j61smm:not(#\#):not(#\#):not(#\#):not(#\#){width:calc(max(var(--_progress-bar-fill,0%),var(--_progress-bar-min,0px)) + var(--_progress-bar-flip,0) * .01px)}}}
2450
2480
  .x1tadims:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{--_hit-border-bottom:var(--border-width)}
2451
2481
  .x1vz82uj:last-child:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{--_hit-border-bottom:0px}
@@ -2655,8 +2685,8 @@
2655
2685
  .xc0dz0a:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-property:opacity,display}
2656
2686
  .x167zut7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-property:opacity}
2657
2687
  .x1hu8v7x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{transition-property:transform}
2658
- .x1cz9k3x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-timing-function:linear}
2659
2688
  .xyt8op7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{transition-timing-function:linear}
2689
+ .x1w553ls:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-timing-function:var(--_sheet-scrim-easing,linear)}
2660
2690
  .x15h3t91:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{transition-timing-function:var(--ease-standard)}
2661
2691
  .x1dlmc9c:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-timing-function:var(--ease-standard)}
2662
2692
  .xa5v58t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{transition-timing-function:var(--ease-standard)}
@@ -1 +1 @@
1
- {"version":3,"file":"containerReveal.stylex.d.ts","sourceRoot":"","sources":["../../src/hooks/containerReveal.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+OjB,CAAC"}
1
+ {"version":3,"file":"containerReveal.stylex.d.ts","sourceRoot":"","sources":["../../src/hooks/containerReveal.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAY3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+OjB,CAAC"}
@@ -26,33 +26,36 @@ const REST_DELAY = '0s, ' + durationVars['--duration-fast'];
26
26
  // branch takes effect. Declared on every container so a nested one never
27
27
  // inherits its ancestor's dwell.
28
28
  const HOVER_DELAY = 'var(--_hover-delay, 0s)';
29
+
30
+ // The touch branch keys on the primary pointer (TOUCH_QUERY). A touchscreen
31
+ // laptop used with a mouse or trackpad can hover, so it keeps the hover reveal.
29
32
  export const styles = {
30
33
  container: {
31
34
  "--_hover-delay": "xhg274n",
32
- "--_reveal-opacity": "xct0gwe x2xrgwu xi33vf3 xi7d7de",
33
- "--_reveal-position": "xp0pj8v x1or4zte xoa21yc xarvkxi",
34
- "--_reveal-delay": "x1xiarpw xi1ebb6 x1mjsb9v x1pn63d7",
35
- "--_reveal-delay-reduced": "xdjmrzf xvd8mm8 x1z42dm xm1aeao",
35
+ "--_reveal-opacity": "xct0gwe x2xrgwu xi33vf3 xakbj2a",
36
+ "--_reveal-position": "xp0pj8v x1or4zte xoa21yc xe5pbq5",
37
+ "--_reveal-delay": "x1xiarpw xi1ebb6 x1mjsb9v x1humlf3",
38
+ "--_reveal-delay-reduced": "xdjmrzf xvd8mm8 x1z42dm x63b2yw",
36
39
  "--_conceal-opacity": "x1kgmhs9 x1316hva",
37
- "--_fade-delay": "x13l1x9d x14nxqze x1wfyzv7 x1hl81f0",
40
+ "--_fade-delay": "x13l1x9d x14nxqze x1wfyzv7 x4pvm7e",
38
41
  $$css: true
39
42
  },
40
43
  stateInactive: {
41
- "--_reveal-opacity": "xct0gwe xfqgg65 xi33vf3 xi7d7de",
42
- "--_reveal-position": "xp0pj8v x17ock8y xoa21yc xarvkxi",
43
- "--_reveal-delay": "x1xiarpw x1tx49wl x1mjsb9v x1pn63d7",
44
- "--_reveal-delay-reduced": "xdjmrzf xap96qf x1z42dm xm1aeao",
44
+ "--_reveal-opacity": "xct0gwe xfqgg65 xi33vf3 xakbj2a",
45
+ "--_reveal-position": "xp0pj8v x17ock8y xoa21yc xe5pbq5",
46
+ "--_reveal-delay": "x1xiarpw x1tx49wl x1mjsb9v x1humlf3",
47
+ "--_reveal-delay-reduced": "xdjmrzf xap96qf x1z42dm x63b2yw",
45
48
  "--_conceal-opacity": "x1kgmhs9 xuzfaso",
46
- "--_fade-delay": "x13l1x9d xq03417 x1wfyzv7 x1hl81f0",
49
+ "--_fade-delay": "x13l1x9d xq03417 x1wfyzv7 x4pvm7e",
47
50
  $$css: true
48
51
  },
49
52
  stateActive: {
50
- "--_reveal-opacity": "x5setjs x2xrgwu xi33vf3 xi7d7de",
51
- "--_reveal-position": "x1r6s5ct x1or4zte xoa21yc xarvkxi",
52
- "--_reveal-delay": "x1dejzja x1t6fdr0 x1mjsb9v x1pn63d7",
53
- "--_reveal-delay-reduced": "xdjmrzf xap96qf x1z42dm xm1aeao",
53
+ "--_reveal-opacity": "x5setjs x2xrgwu xi33vf3 xakbj2a",
54
+ "--_reveal-position": "x1r6s5ct x1or4zte xoa21yc xe5pbq5",
55
+ "--_reveal-delay": "x1dejzja x1t6fdr0 x1mjsb9v x1humlf3",
56
+ "--_reveal-delay-reduced": "xdjmrzf xap96qf x1z42dm x63b2yw",
54
57
  "--_conceal-opacity": "x9pmotm x1316hva",
55
- "--_fade-delay": "x13l1x9d xq03417 x1wfyzv7 x1hl81f0",
58
+ "--_fade-delay": "x13l1x9d xq03417 x1wfyzv7 x4pvm7e",
56
59
  $$css: true
57
60
  },
58
61
  hoverDelay: delay => [{
@@ -32,15 +32,21 @@ export interface AnnounceRenderedTextOptions {
32
32
  * while not yet exposed. Defaults to this hook's own instance.
33
33
  */
34
34
  announce?: AnnounceFn;
35
+ /**
36
+ * A selector for subtrees to leave out of the text, such as the controls in
37
+ * a custom layout. Applied to the element's descendants.
38
+ */
39
+ exclude?: string;
35
40
  }
36
41
  /**
37
42
  * The rendered text an assistive technology would read from `element`. Block
38
43
  * boxes read apart: a block tag, an element whose computed display is not
39
44
  * inline, and any child of a flex or grid container (which the layout
40
45
  * blockifies), so two stacked `Text` spans never run together. Hidden parts
41
- * are skipped; nothing on screen changes.
46
+ * are skipped, and so are descendants that match `exclude`; nothing on screen
47
+ * changes. Reads the live element, so computed display resolves.
42
48
  */
43
- export declare function renderedText(element: HTMLElement): string;
49
+ export declare function renderedText(element: HTMLElement, exclude?: string): string;
44
50
  /**
45
51
  * Announce the text of a rendered element through the shared polite live
46
52
  * region, once per occasion.
@@ -61,5 +67,5 @@ export declare function renderedText(element: HTMLElement): string;
61
67
  * useAnnounceRenderedText(emptyStateRef, isPanelEmpty, searchQuery);
62
68
  * ```
63
69
  */
64
- export declare function useAnnounceRenderedText(ref: RefObject<HTMLElement | null>, isShown: boolean, occasion: string, { skipFirstRender, politeness, fallbackText, announce: ownerAnnounce, }?: AnnounceRenderedTextOptions): void;
70
+ export declare function useAnnounceRenderedText(ref: RefObject<HTMLElement | null>, isShown: boolean, occasion: string, { skipFirstRender, politeness, fallbackText, announce: ownerAnnounce, exclude, }?: AnnounceRenderedTextOptions): void;
65
71
  //# sourceMappingURL=useAnnounceRenderedText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAnnounceRenderedText.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnounceRenderedText.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAcH,OAAO,EAA8B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAgCvB,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAmCzD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,EACE,eAAuB,EACvB,UAAqB,EACrB,YAAY,EACZ,QAAQ,EAAE,aAAa,GACxB,GAAE,2BAAgC,GAClC,IAAI,CAmEN"}
1
+ {"version":3,"file":"useAnnounceRenderedText.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnounceRenderedText.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAcH,OAAO,EAA8B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAmCvB,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAmC3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,EACE,eAAuB,EACvB,UAAqB,EACrB,YAAY,EACZ,QAAQ,EAAE,aAAa,EACvB,OAAO,GACR,GAAE,2BAAgC,GAClC,IAAI,CAqEN"}
@@ -36,7 +36,7 @@ const BLOCKS = 'p, div, li, br, h1, h2, h3, h4, h5, h6';
36
36
  * placed directly in the element, beside its child elements, counts as a block
37
37
  * too (a status bar is an icon followed by its bare message).
38
38
  */
39
- function blockText(element) {
39
+ function blockText(element, exclude) {
40
40
  return Array.from(element.childNodes).map(child => {
41
41
  if (child.nodeType === Node.TEXT_NODE) {
42
42
  return (child.textContent ?? '').replace(/\s+/g, ' ').trim();
@@ -46,7 +46,7 @@ function blockText(element) {
46
46
  // constructor checks.
47
47
  if (child.nodeType === Node.ELEMENT_NODE) {
48
48
  const part = child;
49
- return part.matches(HIDDEN) ? '' : renderedText(part);
49
+ return part.matches(HIDDEN) || exclude != null && part.matches(exclude) ? '' : renderedText(part, exclude);
50
50
  }
51
51
  return '';
52
52
  }).filter(part => part !== '').join(' ');
@@ -56,9 +56,10 @@ function blockText(element) {
56
56
  * boxes read apart: a block tag, an element whose computed display is not
57
57
  * inline, and any child of a flex or grid container (which the layout
58
58
  * blockifies), so two stacked `Text` spans never run together. Hidden parts
59
- * are skipped; nothing on screen changes.
59
+ * are skipped, and so are descendants that match `exclude`; nothing on screen
60
+ * changes. Reads the live element, so computed display resolves.
60
61
  */
61
- export function renderedText(element) {
62
+ export function renderedText(element, exclude) {
62
63
  const view = element.ownerDocument.defaultView;
63
64
  const displayOf = node => view?.getComputedStyle(node).display ?? '';
64
65
  const parts = [];
@@ -71,7 +72,7 @@ export function renderedText(element) {
71
72
  return;
72
73
  }
73
74
  const part = node;
74
- if (part.matches(HIDDEN)) {
75
+ if (part.matches(HIDDEN) || exclude != null && part.matches(exclude)) {
75
76
  return;
76
77
  }
77
78
  const display = displayOf(part);
@@ -113,7 +114,8 @@ export function useAnnounceRenderedText(ref, isShown, occasion, {
113
114
  skipFirstRender = false,
114
115
  politeness = 'polite',
115
116
  fallbackText,
116
- announce: ownerAnnounce
117
+ announce: ownerAnnounce,
118
+ exclude
117
119
  } = {}) {
118
120
  const ownAnnounce = useAnnounce();
119
121
  const announce = ownerAnnounce ?? ownAnnounce;
@@ -142,7 +144,7 @@ export function useAnnounceRenderedText(ref, isShown, occasion, {
142
144
  if (skipFirstRender && element.parentElement?.closest(LIVE_CONTAINER)) {
143
145
  return;
144
146
  }
145
- let text = skipFirstRender ? blockText(element) : renderedText(element);
147
+ let text = skipFirstRender ? blockText(element, exclude) : renderedText(element, exclude);
146
148
  if (text === '' && fallbackText !== undefined) {
147
149
  text = (element.getAttribute('aria-labelledby') ?? '').split(/\s+/).map(id => {
148
150
  // Each referenced element as read: its hidden parts dropped, as