@sentry/scraps 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +95 -3
  2. package/dist/alert/alert.js +10 -7
  3. package/dist/badge/tag.js +4 -2
  4. package/dist/button/button.js +1 -0
  5. package/dist/button/linkButton.js +1 -0
  6. package/dist/button/styles.js +157 -152
  7. package/dist/codeBlock/codeBlock.js +1 -0
  8. package/dist/compactSelect/compactSelect.d.ts +2 -2
  9. package/dist/compactSelect/compactSelect.js +37 -23
  10. package/dist/compactSelect/control.js +14 -10
  11. package/dist/compactSelect/gridList/index.js +35 -36
  12. package/dist/compactSelect/gridList/option.d.ts +4 -1
  13. package/dist/compactSelect/gridList/option.js +4 -3
  14. package/dist/compactSelect/gridList/section.d.ts +10 -3
  15. package/dist/compactSelect/gridList/section.js +16 -33
  16. package/dist/compactSelect/listBox/index.d.ts +1 -1
  17. package/dist/compactSelect/listBox/index.js +46 -58
  18. package/dist/compactSelect/listBox/section.d.ts +10 -8
  19. package/dist/compactSelect/listBox/section.js +11 -30
  20. package/dist/compactSelect/styles.d.ts +6 -7
  21. package/dist/compactSelect/styles.js +1 -23
  22. package/dist/compactSelect/utils.js +2 -6
  23. package/dist/dateTime/config.d.ts +23 -0
  24. package/dist/dateTime/config.js +50 -0
  25. package/dist/dateTime/context.d.ts +18 -0
  26. package/dist/dateTime/context.js +46 -0
  27. package/dist/dateTime/dateTime.d.ts +6 -0
  28. package/dist/dateTime/dateTime.js +30 -0
  29. package/dist/dateTime/format.d.ts +24 -0
  30. package/dist/dateTime/format.js +45 -0
  31. package/dist/dateTime/index.d.ts +6 -0
  32. package/dist/dateTime/index.js +6 -0
  33. package/dist/dateTime/intlFormatter.d.ts +9 -0
  34. package/dist/dateTime/intlFormatter.js +16 -0
  35. package/dist/dateTime/parseDate.d.ts +3 -0
  36. package/dist/dateTime/parseDate.js +12 -0
  37. package/dist/diagnostics/context.d.ts +12 -0
  38. package/dist/diagnostics/context.js +11 -0
  39. package/dist/diagnostics/index.d.ts +2 -0
  40. package/dist/diagnostics/index.js +1 -0
  41. package/dist/disclosure/disclosure.js +1 -1
  42. package/dist/dragHandle/dragHandle.js +3 -5
  43. package/dist/dropdownMenu/context.d.ts +36 -11
  44. package/dist/dropdownMenu/context.js +2 -1
  45. package/dist/dropdownMenu/dropdownMenu.d.ts +2 -2
  46. package/dist/dropdownMenu/dropdownMenu.js +9 -3
  47. package/dist/dropdownMenu/item.d.ts +7 -8
  48. package/dist/dropdownMenu/item.js +43 -77
  49. package/dist/dropdownMenu/list.d.ts +31 -5
  50. package/dist/dropdownMenu/list.js +154 -133
  51. package/dist/dropdownMenu/useDropdownMenuKeyboard.d.ts +5 -241
  52. package/dist/dropdownMenu/useDropdownMenuKeyboard.js +5 -29
  53. package/dist/dropdownMenu/useDropdownMenuRowLayout.js +6 -14
  54. package/dist/dropdownMenu/useDropdownRootMenuState.d.ts +13 -0
  55. package/dist/dropdownMenu/useDropdownRootMenuState.js +30 -0
  56. package/dist/dropdownMenu/useDropdownSubmenuState.d.ts +19 -0
  57. package/dist/dropdownMenu/useDropdownSubmenuState.js +25 -0
  58. package/dist/dropdownMenu/utils.js +5 -7
  59. package/dist/duration/formatElapsedDuration.d.ts +4 -0
  60. package/dist/duration/formatElapsedDuration.js +10 -0
  61. package/dist/duration/getDuration.d.ts +68 -0
  62. package/dist/duration/getDuration.js +80 -0
  63. package/dist/duration/index.d.ts +2 -0
  64. package/dist/duration/index.js +2 -0
  65. package/dist/form/field/radioGroupField.d.ts +7 -0
  66. package/dist/form/field/radioGroupField.js +14 -0
  67. package/dist/form/field/selectField.d.ts +3 -4
  68. package/dist/form/field/selectField.js +16 -24
  69. package/dist/{compactSelect/fzf.d.ts → fzf.d.ts} +1 -0
  70. package/dist/{compactSelect/fzf.js → fzf.js} +5 -1
  71. package/dist/layout/container.d.ts +24 -7
  72. package/dist/layout/container.js +9 -12
  73. package/dist/layout/flex.js +1 -1
  74. package/dist/layout/grid.js +2 -2
  75. package/dist/layout/index.d.ts +1 -1
  76. package/dist/layout/index.js +1 -1
  77. package/dist/layout/stack.js +1 -1
  78. package/dist/layout/styles.d.ts +28 -7
  79. package/dist/layout/styles.js +76 -16
  80. package/dist/layout/surface.d.ts +2 -2
  81. package/dist/layout/surface.js +6 -3
  82. package/dist/legacyDatetime.d.ts +21 -0
  83. package/dist/legacyDatetime.js +13 -0
  84. package/dist/link/index.d.ts +1 -1
  85. package/dist/link/index.js +1 -1
  86. package/dist/link/linkBehaviorContext.d.ts +9 -0
  87. package/dist/link/linkBehaviorContext.js +37 -7
  88. package/dist/menu/menu.d.ts +1 -3
  89. package/dist/menu/menu.js +5 -6
  90. package/dist/menu/selectValue.d.ts +2 -6
  91. package/dist/modal/components.js +2 -2
  92. package/dist/overlayArrow.js +2 -2
  93. package/dist/relativeTime/getRelativeDate.d.ts +14 -0
  94. package/dist/relativeTime/getRelativeDate.js +107 -0
  95. package/dist/relativeTime/index.d.ts +3 -0
  96. package/dist/relativeTime/index.js +3 -0
  97. package/dist/relativeTime/relativeTime.d.ts +55 -0
  98. package/dist/relativeTime/relativeTime.js +102 -0
  99. package/dist/relativeTime/useRelativeTimeFormatter.d.ts +2 -0
  100. package/dist/relativeTime/useRelativeTimeFormatter.js +10 -0
  101. package/dist/select/chips.d.ts +14 -0
  102. package/dist/select/chips.js +45 -0
  103. package/dist/select/filter.js +7 -11
  104. package/dist/select/index.d.ts +1 -1
  105. package/dist/select/indicators.d.ts +11 -0
  106. package/dist/select/indicators.js +61 -0
  107. package/dist/select/menu.d.ts +44 -0
  108. package/dist/select/menu.js +103 -0
  109. package/dist/select/option.d.ts +23 -15
  110. package/dist/select/option.js +66 -58
  111. package/dist/select/options.d.ts +31 -0
  112. package/dist/select/options.js +74 -0
  113. package/dist/select/select.d.ts +24 -11
  114. package/dist/select/select.js +527 -429
  115. package/dist/select/styles.d.ts +148 -2
  116. package/dist/select/styles.js +156 -1
  117. package/dist/select/types.d.ts +6 -7
  118. package/dist/select/types.js +4 -0
  119. package/dist/select/utils.d.ts +2 -0
  120. package/dist/select/utils.js +4 -0
  121. package/dist/separator/separator.d.ts +2 -2
  122. package/dist/separator/separator.js +4 -3
  123. package/dist/slot/slot.js +16 -12
  124. package/dist/tabs/context.d.ts +9 -0
  125. package/dist/tabs/context.js +9 -0
  126. package/dist/tabs/index.d.ts +2 -4
  127. package/dist/tabs/index.js +1 -3
  128. package/dist/tabs/item.d.ts +16 -5
  129. package/dist/tabs/tab.js +9 -4
  130. package/dist/tabs/tabList.d.ts +5 -5
  131. package/dist/tabs/tabList.js +8 -6
  132. package/dist/tabs/tabPanels.d.ts +2 -3
  133. package/dist/tabs/tabPanels.js +1 -1
  134. package/dist/tabs/tabs.d.ts +46 -31
  135. package/dist/tabs/tabs.js +38 -35
  136. package/dist/text/prose.d.ts +2 -2
  137. package/dist/theme/index.d.ts +2 -0
  138. package/dist/theme/index.js +2 -0
  139. package/dist/theme/theme.d.ts +34 -34
  140. package/dist/theme/theme.js +9 -0
  141. package/dist/theme/types.d.ts +21 -2
  142. package/dist/theme/useResolvedTheme.d.ts +12 -0
  143. package/dist/theme/useResolvedTheme.js +20 -0
  144. package/dist/theme/variables.css +1116 -0
  145. package/dist/theme/variables.d.ts +985 -0
  146. package/dist/theme/variables.js +455 -0
  147. package/dist/translation/index.d.ts +1 -0
  148. package/dist/translation/index.js +1 -0
  149. package/dist/translation/translate.d.ts +9 -0
  150. package/dist/translation/translate.js +5 -0
  151. package/dist/translation/translationContext.d.ts +2 -1
  152. package/dist/translation/translationContext.js +2 -1
  153. package/dist/useVirtualCollection.d.ts +14 -1
  154. package/dist/useVirtualCollection.js +59 -3
  155. package/fonts/OFL.txt +94 -0
  156. package/fonts/roboto-mono-variable-cyrillic-ext.woff2 +0 -0
  157. package/fonts/roboto-mono-variable-cyrillic.woff2 +0 -0
  158. package/fonts/roboto-mono-variable-greek.woff2 +0 -0
  159. package/fonts/roboto-mono-variable-latin-ext.woff2 +0 -0
  160. package/fonts/roboto-mono-variable-vietnamese.woff2 +0 -0
  161. package/fonts/roboto-mono-variable.woff2 +0 -0
  162. package/fonts/rubik-variable-cyrillic-ext.woff2 +0 -0
  163. package/fonts/rubik-variable-cyrillic.woff2 +0 -0
  164. package/fonts/rubik-variable-latin-ext.woff2 +0 -0
  165. package/fonts/rubik-variable.woff2 +0 -0
  166. package/fonts.css +211 -0
  167. package/package.json +39 -15
  168. package/dist/compactSelect/useVirtualizedItems.d.ts +0 -52
  169. package/dist/compactSelect/useVirtualizedItems.js +0 -74
  170. package/dist/datetime.d.ts +0 -39
  171. package/dist/datetime.js +0 -20
  172. package/dist/dropdownMenu/useSafetyTriangle.d.ts +0 -12
  173. package/dist/dropdownMenu/useSafetyTriangle.js +0 -119
  174. package/dist/select/reactSelectWrapper.d.ts +0 -8
  175. package/dist/select/reactSelectWrapper.js +0 -25
  176. package/dist/select/virtualizedMenuList.d.ts +0 -24
  177. package/dist/select/virtualizedMenuList.js +0 -123
@@ -1,7 +1,7 @@
1
1
  import type * as React from 'react';
2
2
  import type { useMenu } from '@react-aria/menu';
3
3
  import type { TreeState } from '@react-stately/tree';
4
- import type { Key, Node } from '@react-types/shared';
4
+ import type { Key } from '@react-types/shared';
5
5
  import type { MenuItemProps } from './item.js';
6
6
  interface UseDropdownMenuKeyboardOptions {
7
7
  /** The keys keyboard focus can reach, in order. */
@@ -11,250 +11,14 @@ interface UseDropdownMenuKeyboardOptions {
11
11
  menuRef: React.RefObject<HTMLUListElement | null>;
12
12
  searchRef: React.RefObject<HTMLInputElement | null>;
13
13
  state: TreeState<MenuItemProps>;
14
- /** Top-level nodes of the menu, in order. */
15
- stateCollection: Array<Node<MenuItemProps>>;
16
- /** Menu state of the parent menu, if this menu is a submenu. */
17
- parentMenuState?: TreeState<MenuItemProps>;
18
14
  }
19
15
  /**
20
16
  * Keyboard navigation of a menu: moves focus between the search field and the
21
- * items, closes a submenu with ArrowLeft, and ignores key events unless this
22
- * menu is the focused (leaf) one.
17
+ * items. Opening and closing submenus with the arrow keys is handled by
18
+ * `useSubmenuTrigger`.
23
19
  */
24
- export declare function useDropdownMenuKeyboard({ focusableKeys, menuProps, menuRef, parentMenuState, searchRef, state, stateCollection, }: UseDropdownMenuKeyboardOptions): {
20
+ export declare function useDropdownMenuKeyboard({ focusableKeys, menuProps, menuRef, searchRef, state, }: UseDropdownMenuKeyboardOptions): {
25
21
  focusItem: (key: Key | undefined) => void;
26
- hasFocus: boolean;
27
- menuProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement> & {
28
- onKeyUp?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
29
- onKeyDown?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
30
- id?: string | undefined;
31
- role?: React.AriaRole | undefined;
32
- tabIndex?: number | undefined;
33
- style?: React.CSSProperties | undefined;
34
- className?: string | undefined;
35
- "aria-activedescendant"?: string | undefined;
36
- "aria-atomic"?: (boolean | "true" | "false") | undefined;
37
- "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
38
- "aria-braillelabel"?: string | undefined;
39
- "aria-brailleroledescription"?: string | undefined;
40
- "aria-busy"?: (boolean | "true" | "false") | undefined;
41
- "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
42
- "aria-colcount"?: number | undefined;
43
- "aria-colindex"?: number | undefined;
44
- "aria-colindextext"?: string | undefined;
45
- "aria-colspan"?: number | undefined;
46
- "aria-controls"?: string | undefined;
47
- "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
48
- "aria-describedby"?: string | undefined;
49
- "aria-description"?: string | undefined;
50
- "aria-details"?: string | undefined;
51
- "aria-disabled"?: (boolean | "true" | "false") | undefined;
52
- "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
53
- "aria-errormessage"?: string | undefined;
54
- "aria-expanded"?: (boolean | "true" | "false") | undefined;
55
- "aria-flowto"?: string | undefined;
56
- "aria-grabbed"?: (boolean | "true" | "false") | undefined;
57
- "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
58
- "aria-hidden"?: (boolean | "true" | "false") | undefined;
59
- "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
60
- "aria-keyshortcuts"?: string | undefined;
61
- "aria-label"?: string | undefined;
62
- "aria-labelledby"?: string | undefined;
63
- "aria-level"?: number | undefined;
64
- "aria-live"?: "off" | "assertive" | "polite" | undefined;
65
- "aria-modal"?: (boolean | "true" | "false") | undefined;
66
- "aria-multiline"?: (boolean | "true" | "false") | undefined;
67
- "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
68
- "aria-orientation"?: "horizontal" | "vertical" | undefined;
69
- "aria-owns"?: string | undefined;
70
- "aria-placeholder"?: string | undefined;
71
- "aria-posinset"?: number | undefined;
72
- "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
73
- "aria-readonly"?: (boolean | "true" | "false") | undefined;
74
- "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
75
- "aria-required"?: (boolean | "true" | "false") | undefined;
76
- "aria-roledescription"?: string | undefined;
77
- "aria-rowcount"?: number | undefined;
78
- "aria-rowindex"?: number | undefined;
79
- "aria-rowindextext"?: string | undefined;
80
- "aria-rowspan"?: number | undefined;
81
- "aria-selected"?: (boolean | "true" | "false") | undefined;
82
- "aria-setsize"?: number | undefined;
83
- "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
84
- "aria-valuemax"?: number | undefined;
85
- "aria-valuemin"?: number | undefined;
86
- "aria-valuenow"?: number | undefined;
87
- "aria-valuetext"?: string | undefined;
88
- children?: React.ReactNode | undefined;
89
- dangerouslySetInnerHTML?: {
90
- __html: string | TrustedHTML;
91
- } | undefined;
92
- onCopy?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
93
- onCopyCapture?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
94
- onCut?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
95
- onCutCapture?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
96
- onPaste?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
97
- onPasteCapture?: React.ClipboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
98
- onCompositionEnd?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
99
- onCompositionEndCapture?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
100
- onCompositionStart?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
101
- onCompositionStartCapture?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
102
- onCompositionUpdate?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
103
- onCompositionUpdateCapture?: React.CompositionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
104
- onFocus?: React.FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
105
- onFocusCapture?: React.FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
106
- onBlur?: React.FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
107
- onBlurCapture?: React.FocusEventHandler<import("@react-types/shared").FocusableElement> | undefined;
108
- onChange?: React.ChangeEventHandler<import("@react-types/shared").FocusableElement, Element> | undefined;
109
- onChangeCapture?: React.ChangeEventHandler<import("@react-types/shared").FocusableElement, Element> | undefined;
110
- onBeforeInput?: React.InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
111
- onBeforeInputCapture?: React.InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
112
- onInput?: React.InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
113
- onInputCapture?: React.InputEventHandler<import("@react-types/shared").FocusableElement> | undefined;
114
- onReset?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
115
- onResetCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
116
- onSubmit?: React.SubmitEventHandler<import("@react-types/shared").FocusableElement> | undefined;
117
- onSubmitCapture?: React.SubmitEventHandler<import("@react-types/shared").FocusableElement> | undefined;
118
- onInvalid?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
119
- onInvalidCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
120
- onLoad?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
121
- onLoadCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
122
- onError?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
123
- onErrorCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
124
- onKeyDownCapture?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
125
- onKeyPress?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
126
- onKeyPressCapture?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
127
- onKeyUpCapture?: React.KeyboardEventHandler<import("@react-types/shared").FocusableElement> | undefined;
128
- onAbort?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
129
- onAbortCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
130
- onCanPlay?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
131
- onCanPlayCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
132
- onCanPlayThrough?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
133
- onCanPlayThroughCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
134
- onDurationChange?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
135
- onDurationChangeCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
136
- onEmptied?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
137
- onEmptiedCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
138
- onEncrypted?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
139
- onEncryptedCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
140
- onEnded?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
141
- onEndedCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
142
- onLoadedData?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
143
- onLoadedDataCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
144
- onLoadedMetadata?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
145
- onLoadedMetadataCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
146
- onLoadStart?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
147
- onLoadStartCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
148
- onPause?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
149
- onPauseCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
150
- onPlay?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
151
- onPlayCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
152
- onPlaying?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
153
- onPlayingCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
154
- onProgress?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
155
- onProgressCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
156
- onRateChange?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
157
- onRateChangeCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
158
- onSeeked?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
159
- onSeekedCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
160
- onSeeking?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
161
- onSeekingCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
162
- onStalled?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
163
- onStalledCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
164
- onSuspend?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
165
- onSuspendCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
166
- onTimeUpdate?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
167
- onTimeUpdateCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
168
- onVolumeChange?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
169
- onVolumeChangeCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
170
- onWaiting?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
171
- onWaitingCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
172
- onAuxClick?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
173
- onAuxClickCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
174
- onClick?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
175
- onClickCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
176
- onContextMenu?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
177
- onContextMenuCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
178
- onDoubleClick?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
179
- onDoubleClickCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
180
- onDrag?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
181
- onDragCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
182
- onDragEnd?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
183
- onDragEndCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
184
- onDragEnter?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
185
- onDragEnterCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
186
- onDragExit?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
187
- onDragExitCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
188
- onDragLeave?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
189
- onDragLeaveCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
190
- onDragOver?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
191
- onDragOverCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
192
- onDragStart?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
193
- onDragStartCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
194
- onDrop?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
195
- onDropCapture?: React.DragEventHandler<import("@react-types/shared").FocusableElement> | undefined;
196
- onMouseDown?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
197
- onMouseDownCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
198
- onMouseEnter?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
199
- onMouseLeave?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
200
- onMouseMove?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
201
- onMouseMoveCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
202
- onMouseOut?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
203
- onMouseOutCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
204
- onMouseOver?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
205
- onMouseOverCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
206
- onMouseUp?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
207
- onMouseUpCapture?: React.MouseEventHandler<import("@react-types/shared").FocusableElement> | undefined;
208
- onSelect?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
209
- onSelectCapture?: React.ReactEventHandler<import("@react-types/shared").FocusableElement> | undefined;
210
- onTouchCancel?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
211
- onTouchCancelCapture?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
212
- onTouchEnd?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
213
- onTouchEndCapture?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
214
- onTouchMove?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
215
- onTouchMoveCapture?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
216
- onTouchStart?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
217
- onTouchStartCapture?: React.TouchEventHandler<import("@react-types/shared").FocusableElement> | undefined;
218
- onPointerDown?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
219
- onPointerDownCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
220
- onPointerMove?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
221
- onPointerMoveCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
222
- onPointerUp?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
223
- onPointerUpCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
224
- onPointerCancel?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
225
- onPointerCancelCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
226
- onPointerEnter?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
227
- onPointerLeave?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
228
- onPointerOver?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
229
- onPointerOverCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
230
- onPointerOut?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
231
- onPointerOutCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
232
- onGotPointerCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
233
- onGotPointerCaptureCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
234
- onLostPointerCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
235
- onLostPointerCaptureCapture?: React.PointerEventHandler<import("@react-types/shared").FocusableElement> | undefined;
236
- onScroll?: React.UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
237
- onScrollCapture?: React.UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
238
- onScrollEnd?: React.UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
239
- onScrollEndCapture?: React.UIEventHandler<import("@react-types/shared").FocusableElement> | undefined;
240
- onWheel?: React.WheelEventHandler<import("@react-types/shared").FocusableElement> | undefined;
241
- onWheelCapture?: React.WheelEventHandler<import("@react-types/shared").FocusableElement> | undefined;
242
- onAnimationStart?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
243
- onAnimationStartCapture?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
244
- onAnimationEnd?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
245
- onAnimationEndCapture?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
246
- onAnimationIteration?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
247
- onAnimationIterationCapture?: React.AnimationEventHandler<import("@react-types/shared").FocusableElement> | undefined;
248
- onToggle?: React.ToggleEventHandler<import("@react-types/shared").FocusableElement> | undefined;
249
- onBeforeToggle?: React.ToggleEventHandler<import("@react-types/shared").FocusableElement> | undefined;
250
- onTransitionCancel?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
251
- onTransitionCancelCapture?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
252
- onTransitionEnd?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
253
- onTransitionEndCapture?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
254
- onTransitionRun?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
255
- onTransitionRunCapture?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
256
- onTransitionStart?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
257
- onTransitionStartCapture?: React.TransitionEventHandler<import("@react-types/shared").FocusableElement> | undefined;
258
- };
22
+ menuProps: import("@react-types/shared").DOMAttributes<import("@react-types/shared").FocusableElement>;
259
23
  };
260
24
  export {};
@@ -1,8 +1,7 @@
1
- import { useMemo } from "react";
2
1
  import { useKeyboard } from "@react-aria/interactions";
3
2
  import { mergeProps } from "@react-aria/utils";
4
3
  import { getMenuItemKey } from "./utils.js";
5
- function useDropdownMenuKeyboard({ focusableKeys, menuProps, menuRef, parentMenuState, searchRef, state, stateCollection }) {
4
+ function useDropdownMenuKeyboard({ focusableKeys, menuProps, menuRef, searchRef, state }) {
6
5
  const focusItem = (key)=>{
7
6
  if (void 0 === key) return;
8
7
  const element = menuRef.current?.querySelector(`[data-key="${CSS.escape(String(key))}"]`);
@@ -12,44 +11,21 @@ function useDropdownMenuKeyboard({ focusableKeys, menuProps, menuRef, parentMenu
12
11
  };
13
12
  const { keyboardProps } = useKeyboard({
14
13
  onKeyDown: (e)=>{
14
+ if (!menuRef.current?.contains(e.target)) return void e.continuePropagation();
15
15
  const targetKey = getMenuItemKey(e.target);
16
- if ('ArrowDown' === e.key && searchRef.current && menuRef.current && void 0 !== targetKey && targetKey === focusableKeys.at(-1)) menuRef.current.scrollTop = 0;
17
- if ('ArrowUp' === e.key && searchRef.current && menuRef.current && void 0 !== targetKey && targetKey === focusableKeys[0]) {
16
+ if ('ArrowDown' === e.key && searchRef.current && void 0 !== targetKey && targetKey === focusableKeys.at(-1)) menuRef.current.scrollTop = 0;
17
+ if ('ArrowUp' === e.key && searchRef.current && void 0 !== targetKey && targetKey === focusableKeys[0]) {
18
18
  e.preventDefault();
19
19
  menuRef.current.scrollTop = 0;
20
20
  searchRef.current.focus();
21
21
  return;
22
22
  }
23
- if ('ArrowLeft' === e.key && parentMenuState) return void parentMenuState.selectionManager.clearSelection();
24
23
  e.continuePropagation();
25
24
  }
26
25
  });
27
- const hasFocus = useMemo(()=>{
28
- const isLeafSubmenu = !stateCollection.some((node)=>{
29
- const isSection = node.hasChildNodes && !node.value?.submenu;
30
- return isSection ? [
31
- ...node.childNodes
32
- ].some((child)=>state.selectionManager.isSelected(`${child.key}`)) : state.selectionManager.isSelected(`${node.key}`);
33
- });
34
- return isLeafSubmenu;
35
- }, [
36
- stateCollection,
37
- state.selectionManager
38
- ]);
39
- const modifiedMenuProps = useMemo(()=>({
40
- ...menuProps,
41
- ...!hasFocus && {
42
- onKeyUp: ()=>null,
43
- onKeyDown: ()=>null
44
- }
45
- }), [
46
- menuProps,
47
- hasFocus
48
- ]);
49
26
  return {
50
27
  focusItem,
51
- hasFocus,
52
- menuProps: mergeProps(modifiedMenuProps, keyboardProps)
28
+ menuProps: mergeProps(menuProps, keyboardProps)
53
29
  };
54
30
  }
55
31
  export { useDropdownMenuKeyboard };
@@ -1,7 +1,7 @@
1
- import { useCallback, useLayoutEffect, useMemo } from "react";
1
+ import { useCallback, useMemo } from "react";
2
2
  import { useTheme } from "@emotion/react";
3
3
  import { SECTION_ITEM_SPACE } from "../menu/index.js";
4
- import { estimateRowHeight, useVirtualCollection } from "../useVirtualCollection.js";
4
+ import { estimateRowHeight, useVirtualCollection, useVirtualMenuWidth } from "../useVirtualCollection.js";
5
5
  import { SEPARATOR_HEIGHT } from "./separator.js";
6
6
  function useDropdownMenuRowLayout({ collection, focusedKey, isWidthLocked, menuRef, onLockWidth, size, virtualized, widestKey }) {
7
7
  const theme = useTheme();
@@ -41,21 +41,13 @@ function useDropdownMenuRowLayout({ collection, focusedKey, isWidthLocked, menuR
41
41
  size,
42
42
  widestKey
43
43
  });
44
- const isWidestRowMounted = virtual.rows.some((row)=>row.node.key === widestKey);
45
- useLayoutEffect(()=>{
46
- const menu = menuRef.current;
47
- if (!virtualized || !isWidestRowMounted || isWidthLocked || !menu) return;
48
- const { width } = menu.style;
49
- menu.style.width = 'max-content';
50
- onLockWidth(Math.ceil(menu.getBoundingClientRect().width));
51
- menu.style.width = width;
52
- }, [
53
- virtualized,
54
- isWidestRowMounted,
44
+ useVirtualMenuWidth({
45
+ enabled: virtualized,
46
+ isWidthCandidateMounted: virtual.rows.some((row)=>row.node.key === widestKey),
55
47
  isWidthLocked,
56
48
  menuRef,
57
49
  onLockWidth
58
- ]);
50
+ });
59
51
  return {
60
52
  itemsAfterSections,
61
53
  virtual
@@ -0,0 +1,13 @@
1
+ import type { RootMenuTriggerState } from '@react-stately/menu';
2
+ import type { OverlayTriggerState } from '@react-stately/overlays';
3
+ /**
4
+ * State for the root menu, matching react-stately's `useMenuTriggerState`.
5
+ *
6
+ * `useOverlay` keeps owning the open state and positioning, so this wraps its
7
+ * overlay state instead of creating another one, and adds the stack of open
8
+ * submenus that `useSubmenuTrigger` reads.
9
+ *
10
+ * A root menu rendered inside another menu starts its own tree, but closing
11
+ * it, for example by selecting one of its items, also closes the outer menu.
12
+ */
13
+ export declare function useDropdownRootMenuState(overlayState: OverlayTriggerState, parentMenuState?: RootMenuTriggerState): RootMenuTriggerState;
@@ -0,0 +1,30 @@
1
+ import { useState } from "react";
2
+ function useDropdownRootMenuState(overlayState, parentMenuState) {
3
+ const [expandedKeysStack, setExpandedKeysStack] = useState([]);
4
+ const [wasOpen, setWasOpen] = useState(overlayState.isOpen);
5
+ if (wasOpen !== overlayState.isOpen) {
6
+ setWasOpen(overlayState.isOpen);
7
+ if (!overlayState.isOpen) setExpandedKeysStack([]);
8
+ }
9
+ const { isOpen, setOpen, open, close, toggle } = overlayState;
10
+ const closeParentMenu = parentMenuState?.close;
11
+ return {
12
+ isOpen,
13
+ setOpen,
14
+ focusStrategy: 'first',
15
+ open: ()=>open(),
16
+ toggle: ()=>toggle(),
17
+ close: ()=>{
18
+ setExpandedKeysStack([]);
19
+ close();
20
+ closeParentMenu?.();
21
+ },
22
+ expandedKeysStack,
23
+ openSubmenu: (triggerKey, level)=>setExpandedKeysStack((stack)=>level > stack.length ? stack : [
24
+ ...stack.slice(0, level),
25
+ triggerKey
26
+ ]),
27
+ closeSubmenu: (triggerKey, level)=>setExpandedKeysStack((stack)=>stack[level] === triggerKey ? stack.slice(0, level) : stack)
28
+ };
29
+ }
30
+ export { useDropdownRootMenuState };
@@ -0,0 +1,19 @@
1
+ import type { RootMenuTriggerState, SubmenuTriggerState } from '@react-stately/menu';
2
+ import type { Key } from '@react-types/shared';
3
+ interface UseDropdownSubmenuStateOptions {
4
+ /** How deep the submenu sits in the menu tree, starting at 0. */
5
+ level: number;
6
+ rootMenuState: RootMenuTriggerState;
7
+ /** Key of the item that opens the submenu. */
8
+ triggerKey: Key;
9
+ }
10
+ /**
11
+ * State for a submenu trigger, matching react-stately's `useSubmenuTriggerState`.
12
+ *
13
+ * react-stately takes the submenu level from the number of open submenus when
14
+ * the trigger mounts. A virtualized menu mounts triggers as they scroll into
15
+ * view, possibly while a sibling submenu is open, which would place the
16
+ * trigger one level too deep. The level comes from the menu tree instead.
17
+ */
18
+ export declare function useDropdownSubmenuState({ level, rootMenuState, triggerKey, }: UseDropdownSubmenuStateOptions): SubmenuTriggerState;
19
+ export {};
@@ -0,0 +1,25 @@
1
+ import { useState } from "react";
2
+ function useDropdownSubmenuState({ level, rootMenuState, triggerKey }) {
3
+ const { expandedKeysStack, openSubmenu, closeSubmenu, close: closeAll } = rootMenuState;
4
+ const isOpen = expandedKeysStack[level] === triggerKey;
5
+ const [focusStrategy, setFocusStrategy] = useState(null);
6
+ const open = (strategy)=>{
7
+ setFocusStrategy(strategy ?? null);
8
+ openSubmenu(triggerKey, level);
9
+ };
10
+ const close = ()=>{
11
+ setFocusStrategy(null);
12
+ closeSubmenu(triggerKey, level);
13
+ };
14
+ return {
15
+ focusStrategy,
16
+ isOpen,
17
+ open,
18
+ close,
19
+ closeAll,
20
+ submenuLevel: level,
21
+ setOpen: ()=>{},
22
+ toggle: (strategy)=>isOpen ? close() : open(strategy)
23
+ };
24
+ }
25
+ export { useDropdownSubmenuState };
@@ -1,3 +1,4 @@
1
+ import { getSearchScore } from "../fzf.js";
1
2
  function removeHiddenItemsAndSetHref(source, resolveHref) {
2
3
  return source.filter((item)=>!item.hidden).map((item)=>{
3
4
  const href = item.to ? resolveHref(item.to) : item.externalHref;
@@ -12,15 +13,11 @@ function removeHiddenItemsAndSetHref(source, resolveHref) {
12
13
  };
13
14
  });
14
15
  }
15
- function isMenuItemHidden(search, label, textValue) {
16
- const text = textValue ?? ('string' == typeof label ? label : '');
17
- return Boolean(search && !text.toLocaleLowerCase().includes(search.trim().toLocaleLowerCase()));
18
- }
19
16
  function isMenuSection(item) {
20
17
  return Boolean(item.children && item.children.length > 0 && !item.submenu);
21
18
  }
22
19
  function filterMenuItems(items, search) {
23
- const query = search.trim().toLocaleLowerCase();
20
+ const query = search.trim();
24
21
  if (!query) return items;
25
22
  return items.flatMap((item)=>{
26
23
  if (item.children && !item.submenu) {
@@ -32,9 +29,10 @@ function filterMenuItems(items, search) {
32
29
  }
33
30
  ] : [];
34
31
  }
35
- return isMenuItemHidden(query, item.label, item.textValue) ? [] : [
32
+ const text = item.textValue ?? ('string' == typeof item.label ? item.label : '');
33
+ return getSearchScore(text, query) > 0 ? [
36
34
  item
37
- ];
35
+ ] : [];
38
36
  });
39
37
  }
40
38
  function countMenuItems(items) {
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Formats elapsed ms as "5.3s" under a minute, else "1m 30s" or "1h 2m 3s".
3
+ */
4
+ export declare function formatElapsedDuration(ms: number): string;
@@ -0,0 +1,10 @@
1
+ function formatElapsedDuration(ms) {
2
+ const tenths = Math.floor(ms / 100);
3
+ if (tenths < 600) return `${(tenths / 10).toFixed(1)}s`;
4
+ const totalSeconds = Math.floor(ms / 1000);
5
+ const hours = Math.floor(totalSeconds / 3600);
6
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
7
+ const seconds = totalSeconds % 60;
8
+ return hours > 0 ? `${hours}h ${minutes}m ${seconds}s` : `${minutes}m ${seconds}s`;
9
+ }
10
+ export { formatElapsedDuration };
@@ -0,0 +1,68 @@
1
+ import type { Translation } from '../translation/translate.js';
2
+ export interface DurationOptions {
3
+ absolute?: boolean;
4
+ /** Smallest display unit. Defaults to milliseconds. */
5
+ minimumUnit?: DurationUnit;
6
+ precision?: number;
7
+ style?: 'long' | 'short' | 'narrow';
8
+ }
9
+ declare const units: readonly [{
10
+ readonly unit: "year";
11
+ readonly size: 31536000000;
12
+ readonly long: (count: number, { tn }: Translation) => string;
13
+ readonly short: ({ t }: Translation) => string;
14
+ readonly narrow: ({ t }: Translation) => string;
15
+ }, {
16
+ readonly unit: "month";
17
+ readonly size: 2629800000;
18
+ readonly long: (count: number, { tn }: Translation) => string;
19
+ readonly short: ({ t }: Translation) => string;
20
+ readonly narrow: ({ pgettext }: Translation) => string;
21
+ }, {
22
+ readonly unit: "week";
23
+ readonly size: 604800000;
24
+ readonly long: (count: number, { tn }: Translation) => string;
25
+ readonly short: ({ t }: Translation) => string;
26
+ readonly narrow: ({ t }: Translation) => string;
27
+ }, {
28
+ readonly unit: "day";
29
+ readonly size: 86400000;
30
+ readonly long: (count: number, { tn }: Translation) => string;
31
+ readonly short: ({ t }: Translation) => string;
32
+ readonly narrow: ({ t }: Translation) => string;
33
+ }, {
34
+ readonly unit: "hour";
35
+ readonly size: 3600000;
36
+ readonly long: (count: number, { tn }: Translation) => string;
37
+ readonly short: ({ t }: Translation) => string;
38
+ readonly narrow: ({ t }: Translation) => string;
39
+ }, {
40
+ readonly unit: "minute";
41
+ readonly size: 60000;
42
+ readonly long: (count: number, { tn }: Translation) => string;
43
+ readonly short: ({ t }: Translation) => string;
44
+ readonly narrow: ({ pgettext }: Translation) => string;
45
+ }, {
46
+ readonly unit: "second";
47
+ readonly size: 1000;
48
+ readonly long: (count: number, { tn }: Translation) => string;
49
+ readonly short: ({ t }: Translation) => string;
50
+ readonly narrow: ({ t }: Translation) => string;
51
+ }, {
52
+ readonly unit: "millisecond";
53
+ readonly size: 1;
54
+ readonly long: (count: number, { tn }: Translation) => string;
55
+ readonly short: ({ t }: Translation) => string;
56
+ readonly narrow: ({ t }: Translation) => string;
57
+ }, {
58
+ readonly unit: "microsecond";
59
+ readonly size: 0.001;
60
+ readonly long: (count: number, { tn }: Translation) => string;
61
+ readonly short: () => string;
62
+ readonly narrow: () => string;
63
+ }];
64
+ export type DurationUnit = (typeof units)[number]['unit'];
65
+ /** Format seconds using the shared application translations. */
66
+ export declare function getDuration(seconds: number, options?: DurationOptions): string;
67
+ export declare function getDurationWithMessages(seconds: number, { precision, style, absolute, minimumUnit, }: DurationOptions, messages: Translation): string;
68
+ export {};