@fibrae/semi-foundation 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/dist/anchor/foundation.d.ts +1 -4
  2. package/dist/anchor/foundation.js +21 -22
  3. package/dist/audio-player/foundation.d.ts +10 -13
  4. package/dist/audio-player/foundation.js +19 -20
  5. package/dist/auto-complete/foundation.d.ts +12 -14
  6. package/dist/auto-complete/foundation.js +51 -52
  7. package/dist/avatar/foundation.d.ts +5 -6
  8. package/dist/avatar/foundation.js +16 -16
  9. package/dist/avatar/variables.scss +0 -1
  10. package/dist/backtop/foundation.d.ts +2 -5
  11. package/dist/backtop/foundation.js +7 -8
  12. package/dist/banner/foundation.d.ts +1 -1
  13. package/dist/banner/foundation.js +4 -4
  14. package/dist/base/auto-close-foundation.d.ts +8 -9
  15. package/dist/base/auto-close-foundation.js +15 -15
  16. package/dist/base/foundation.d.ts +4 -4
  17. package/dist/base/foundation.js +12 -11
  18. package/dist/base/list-store.d.ts +0 -1
  19. package/dist/breadcrumb/foundation.d.ts +5 -5
  20. package/dist/breadcrumb/foundation.js +9 -10
  21. package/dist/breadcrumb/item-foundation.d.ts +3 -3
  22. package/dist/breadcrumb/item-foundation.js +6 -6
  23. package/dist/calendar/event-util.d.ts +0 -10
  24. package/dist/calendar/event-util.js +1 -11
  25. package/dist/calendar/foundation.d.ts +1 -6
  26. package/dist/calendar/foundation.js +5 -9
  27. package/dist/calendar/month-foundation.d.ts +2 -3
  28. package/dist/calendar/month-foundation.js +6 -7
  29. package/dist/carousel/foundation.d.ts +17 -19
  30. package/dist/carousel/foundation.js +51 -51
  31. package/dist/cascader/foundation.d.ts +36 -32
  32. package/dist/cascader/foundation.js +145 -132
  33. package/dist/cascader/util.d.ts +1 -8
  34. package/dist/cascader/util.js +1 -8
  35. package/dist/checkbox/checkbox-foundation.d.ts +3 -7
  36. package/dist/checkbox/checkbox-foundation.js +15 -17
  37. package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
  38. package/dist/checkbox/checkbox-group-foundation.js +8 -8
  39. package/dist/code-highlight/index.d.ts +1 -2
  40. package/dist/code-highlight/index.js +3 -3
  41. package/dist/collapse/foundation.d.ts +2 -2
  42. package/dist/collapse/foundation.js +7 -7
  43. package/dist/collapsible/foundation.d.ts +3 -3
  44. package/dist/collapsible/foundation.js +8 -8
  45. package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
  46. package/dist/color-picker/alpha-slider-foundation.js +10 -10
  47. package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
  48. package/dist/color-picker/color-choose-area-foundation.js +14 -14
  49. package/dist/color-picker/color-picker.scss +0 -2
  50. package/dist/color-picker/color-slider-foundation.d.ts +2 -4
  51. package/dist/color-picker/color-slider-foundation.js +10 -10
  52. package/dist/color-picker/data-part-foundation.d.ts +5 -5
  53. package/dist/color-picker/data-part-foundation.js +11 -11
  54. package/dist/color-picker/foundation.d.ts +4 -4
  55. package/dist/color-picker/foundation.js +10 -10
  56. package/dist/color-picker/interface.d.ts +0 -1
  57. package/dist/config-provider/breakpoint-observer.d.ts +3 -3
  58. package/dist/config-provider/breakpoint-observer.js +6 -6
  59. package/dist/config-provider/responsive-types.d.ts +0 -16
  60. package/dist/cropper/foundation.d.ts +15 -16
  61. package/dist/cropper/foundation.js +26 -24
  62. package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
  63. package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
  64. package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
  65. package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
  66. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
  67. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
  68. package/dist/date-picker/_utils/parser.d.ts +0 -3
  69. package/dist/date-picker/_utils/parser.js +0 -7
  70. package/dist/date-picker/_utils/picker-type.d.ts +1 -3
  71. package/dist/date-picker/_utils/picker-type.js +0 -2
  72. package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
  73. package/dist/date-picker/_utils/to-callback-args.js +0 -1
  74. package/dist/date-picker/date-picker.scss +0 -3
  75. package/dist/date-picker/foundation.d.ts +39 -58
  76. package/dist/date-picker/foundation.js +126 -153
  77. package/dist/date-picker/input-foundation.d.ts +10 -16
  78. package/dist/date-picker/input-foundation.js +28 -30
  79. package/dist/date-picker/month-foundation.d.ts +0 -3
  80. package/dist/date-picker/month-foundation.js +0 -2
  81. package/dist/date-picker/months-grid-foundation.d.ts +17 -26
  82. package/dist/date-picker/months-grid-foundation.js +65 -75
  83. package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
  84. package/dist/date-picker/year-and-month-foundation.js +11 -11
  85. package/dist/drag-move/foundation.d.ts +2 -3
  86. package/dist/drag-move/foundation.js +15 -13
  87. package/dist/dropdown/foundation.d.ts +8 -7
  88. package/dist/dropdown/foundation.js +32 -28
  89. package/dist/dropdown/menu-foundation.d.ts +1 -2
  90. package/dist/dropdown/menu-foundation.js +11 -11
  91. package/dist/feedback/foundation.d.ts +9 -10
  92. package/dist/feedback/foundation.js +33 -33
  93. package/dist/feedback/variables.scss +1 -5
  94. package/dist/float-button/float-button.css +0 -1
  95. package/dist/float-button/float-button.scss +0 -2
  96. package/dist/form/form-api-proxy.d.ts +8 -7
  97. package/dist/form/form-api-proxy.js +25 -25
  98. package/dist/form/form.scss +0 -12
  99. package/dist/form/foundation.d.ts +5 -5
  100. package/dist/form/foundation.js +60 -76
  101. package/dist/form/interface.d.ts +2 -15
  102. package/dist/form/utils.d.ts +0 -8
  103. package/dist/form/utils.js +0 -7
  104. package/dist/form/variables.scss +1 -4
  105. package/dist/grid/variables.scss +0 -10
  106. package/dist/highlight/foundation.d.ts +0 -2
  107. package/dist/highlight/foundation.js +1 -3
  108. package/dist/hot-keys/foundation.d.ts +2 -3
  109. package/dist/hot-keys/foundation.js +5 -5
  110. package/dist/image/image-foundation.d.ts +4 -6
  111. package/dist/image/image-foundation.js +10 -10
  112. package/dist/image/preview-footer-foundation.d.ts +3 -4
  113. package/dist/image/preview-footer-foundation.js +10 -10
  114. package/dist/image/preview-foundation.d.ts +0 -3
  115. package/dist/image/preview-foundation.js +7 -6
  116. package/dist/image/preview-image-foundation.d.ts +6 -9
  117. package/dist/image/preview-image-foundation.js +14 -14
  118. package/dist/image/preview-inner-foundation.d.ts +9 -10
  119. package/dist/image/preview-inner-foundation.js +38 -38
  120. package/dist/input/foundation.d.ts +10 -11
  121. package/dist/input/foundation.js +47 -49
  122. package/dist/input/text-entry-foundation.d.ts +3 -5
  123. package/dist/input/text-entry-foundation.js +14 -15
  124. package/dist/input/textarea-foundation.d.ts +7 -8
  125. package/dist/input/textarea-foundation.js +36 -36
  126. package/dist/input-number/caret.d.ts +0 -1
  127. package/dist/input-number/caret.js +0 -1
  128. package/dist/input-number/foundation.d.ts +16 -19
  129. package/dist/input-number/foundation.js +54 -58
  130. package/dist/json-viewer/foundation.d.ts +8 -10
  131. package/dist/json-viewer/foundation.js +23 -24
  132. package/dist/locale/interface.d.ts +0 -3
  133. package/dist/lottie/foundation.d.ts +1 -1
  134. package/dist/lottie/foundation.js +4 -4
  135. package/dist/markdown-render/foundation.d.ts +2 -7
  136. package/dist/markdown-render/foundation.js +5 -9
  137. package/dist/modal/modal-content-foundation.d.ts +7 -7
  138. package/dist/modal/modal-content-foundation.js +20 -20
  139. package/dist/modal/modal-foundation.d.ts +6 -6
  140. package/dist/modal/modal-foundation.js +24 -24
  141. package/dist/navigation/foundation.d.ts +1 -8
  142. package/dist/navigation/foundation.js +14 -20
  143. package/dist/navigation/item-foundation.d.ts +1 -1
  144. package/dist/navigation/item-foundation.js +8 -8
  145. package/dist/navigation/sub-nav-foundation.d.ts +3 -4
  146. package/dist/navigation/sub-nav-foundation.js +17 -17
  147. package/dist/notification/notification-list-foundation.d.ts +7 -8
  148. package/dist/notification/notification-list-foundation.js +12 -13
  149. package/dist/notification/variables.scss +0 -1
  150. package/dist/overflow-list/foundation.d.ts +4 -6
  151. package/dist/overflow-list/foundation.js +18 -19
  152. package/dist/pagination/foundation.d.ts +8 -10
  153. package/dist/pagination/foundation.js +28 -28
  154. package/dist/pincode/foundation.d.ts +6 -9
  155. package/dist/pincode/foundation.js +23 -26
  156. package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
  157. package/dist/popconfirm/popconfirm-foundation.js +26 -26
  158. package/dist/progress/generates.d.ts +1 -4
  159. package/dist/progress/generates.js +1 -4
  160. package/dist/progress/utils.d.ts +1 -1
  161. package/dist/progress/utils.js +1 -1
  162. package/dist/radio/radio-foundation.d.ts +5 -9
  163. package/dist/radio/radio-foundation.js +15 -16
  164. package/dist/radio/radio-group-foundation.d.ts +2 -3
  165. package/dist/radio/radio-group-foundation.js +9 -9
  166. package/dist/rating/foundation.d.ts +10 -15
  167. package/dist/rating/foundation.js +35 -38
  168. package/dist/resizable/group/index.d.ts +6 -10
  169. package/dist/resizable/group/index.js +40 -44
  170. package/dist/resizable/resizable.scss +0 -1
  171. package/dist/resizable/single/index.d.ts +3 -7
  172. package/dist/resizable/single/index.js +10 -13
  173. package/dist/scroll-list/item-foundation.d.ts +7 -9
  174. package/dist/scroll-list/item-foundation.js +35 -36
  175. package/dist/scroll-list/variables.scss +1 -6
  176. package/dist/select/foundation.d.ts +42 -57
  177. package/dist/select/foundation.js +214 -279
  178. package/dist/select/option-foundation.d.ts +23 -28
  179. package/dist/select/option-foundation.js +10 -19
  180. package/dist/select/variables.scss +1 -8
  181. package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
  182. package/dist/side-sheet/side-sheet-foundation.js +23 -27
  183. package/dist/side-sheet/variables.scss +1 -3
  184. package/dist/slider/foundation.d.ts +17 -28
  185. package/dist/slider/foundation.js +47 -59
  186. package/dist/slider/variables.scss +1 -5
  187. package/dist/sortable/accessibility.d.ts +1 -1
  188. package/dist/sortable/accessibility.js +2 -2
  189. package/dist/spin/foundation.d.ts +2 -4
  190. package/dist/spin/foundation.js +6 -7
  191. package/dist/spin/variables.scss +1 -3
  192. package/dist/steps/utils.d.ts +1 -1
  193. package/dist/switch/foundation.d.ts +2 -3
  194. package/dist/switch/foundation.js +7 -7
  195. package/dist/switch/switch.scss +1 -1
  196. package/dist/switch/variables.scss +1 -5
  197. package/dist/table/foundation.d.ts +24 -33
  198. package/dist/table/foundation.js +144 -108
  199. package/dist/table/table.scss +0 -1
  200. package/dist/table/utils.d.ts +2 -10
  201. package/dist/table/utils.js +0 -13
  202. package/dist/table/variables.scss +1 -5
  203. package/dist/tabs/foundation.d.ts +5 -14
  204. package/dist/tabs/foundation.js +17 -21
  205. package/dist/tabs/tabs.scss +1 -1
  206. package/dist/tag/focus.js +0 -1
  207. package/dist/tag-input/foundation.d.ts +11 -13
  208. package/dist/tag-input/foundation.js +52 -53
  209. package/dist/tag-input/tag-input.scss +0 -1
  210. package/dist/tag-input/utils/tag-focus.d.ts +0 -1
  211. package/dist/tag-input/utils/tag-focus.js +0 -1
  212. package/dist/time-picker/combox-foundation.d.ts +3 -11
  213. package/dist/time-picker/combox-foundation.js +3 -10
  214. package/dist/time-picker/foundation.d.ts +13 -23
  215. package/dist/time-picker/foundation.js +39 -48
  216. package/dist/time-picker/input-foundation.d.ts +4 -4
  217. package/dist/time-picker/input-foundation.js +13 -13
  218. package/dist/time-picker/utils/index.d.ts +0 -11
  219. package/dist/time-picker/utils/index.js +0 -11
  220. package/dist/toast/toast-list-foundation.d.ts +7 -7
  221. package/dist/toast/toast-list-foundation.js +14 -14
  222. package/dist/tooltip/adjust-position.d.ts +1 -2
  223. package/dist/tooltip/constants.d.ts +0 -3
  224. package/dist/tooltip/constants.js +0 -3
  225. package/dist/tooltip/foundation.d.ts +9 -12
  226. package/dist/tooltip/foundation.js +67 -63
  227. package/dist/tooltip/position.scss +0 -1
  228. package/dist/transfer/foundation.d.ts +22 -13
  229. package/dist/transfer/foundation.js +38 -24
  230. package/dist/tree/foundation.d.ts +14 -16
  231. package/dist/tree/foundation.js +61 -62
  232. package/dist/tree/shared.d.ts +2 -4
  233. package/dist/tree/shared.js +0 -2
  234. package/dist/tree/tree-util.d.ts +0 -5
  235. package/dist/tree/tree-util.js +0 -5
  236. package/dist/tree-select/foundation.d.ts +26 -22
  237. package/dist/tree-select/foundation.js +91 -86
  238. package/dist/typography/ellipsis.d.ts +5 -7
  239. package/dist/typography/ellipsis.js +8 -10
  240. package/dist/typography/format-numeral.d.ts +1 -1
  241. package/dist/typography/format-numeral.js +2 -2
  242. package/dist/typography/typography.scss +0 -1
  243. package/dist/upload/constants.d.ts +1 -1
  244. package/dist/upload/foundation.d.ts +17 -23
  245. package/dist/upload/foundation.js +93 -103
  246. package/dist/upload/utils.d.ts +3 -8
  247. package/dist/upload/utils.js +6 -11
  248. package/dist/user-guide/foundation.d.ts +3 -5
  249. package/dist/user-guide/foundation.js +19 -19
  250. package/dist/utils/a11y.d.ts +2 -6
  251. package/dist/utils/a11y.js +1 -4
  252. package/dist/utils/announcer.d.ts +2 -2
  253. package/dist/utils/announcer.js +4 -4
  254. package/dist/utils/array.d.ts +0 -6
  255. package/dist/utils/array.js +0 -6
  256. package/dist/utils/date-fns-extra.js +1 -5
  257. package/dist/utils/dom.d.ts +0 -1
  258. package/dist/utils/dom.js +0 -1
  259. package/dist/utils/escape-html.js +0 -3
  260. package/dist/utils/field-sizing.d.ts +0 -2
  261. package/dist/utils/field-sizing.js +0 -2
  262. package/dist/utils/focus-handle.d.ts +1 -2
  263. package/dist/utils/focus-handle.js +1 -3
  264. package/dist/utils/focus-scope.d.ts +5 -6
  265. package/dist/utils/focus-scope.js +10 -11
  266. package/dist/utils/is-promise.d.ts +1 -1
  267. package/dist/utils/release-holder.d.ts +2 -2
  268. package/dist/utils/release-holder.js +4 -4
  269. package/dist/utils/scroll-lock.d.ts +3 -4
  270. package/dist/utils/scroll-lock.js +3 -4
  271. package/dist/utils/tween.d.ts +0 -1
  272. package/dist/utils/tween.js +0 -1
  273. package/dist/utils/uuid.d.ts +0 -1
  274. package/dist/utils/uuid.js +0 -1
  275. package/dist/utils/warning.d.ts +0 -1
  276. package/dist/utils/warning.js +0 -1
  277. package/dist/video-player/foundation.d.ts +15 -15
  278. package/dist/video-player/foundation.js +89 -89
  279. package/dist/video-player/progress-foundation.d.ts +2 -3
  280. package/dist/video-player/progress-foundation.js +12 -13
  281. package/dist/video-player/variables.scss +1 -1
  282. package/package.json +2 -2
@@ -147,10 +147,7 @@ var Typeahead = class {
147
147
  return -1;
148
148
  }
149
149
  };
150
- /**
151
- * Development-only: warns when a dialog has no accessible name, which screen readers would announce as just
152
- * "dialog". The name comes from `aria-label` or from the element `aria-labelledby` points at (usually the title).
153
- */
150
+ /** Development-only: warns when a dialog has no accessible name, which screen readers would announce as just "dialog" */
154
151
  function warnIfDialogUnnamed(dialog, component) {
155
152
  if (!isDev() || !dialog) return;
156
153
  const labelledBy = dialog.getAttribute("aria-labelledby");
@@ -30,6 +30,6 @@ export default class Announcer {
30
30
  * `read` runs at write time, when the message elements are in the document. Messages queued together are read as one;
31
31
  * a later call with the same `key` replaces the earlier one, so an in-place update is announced once.
32
32
  */
33
- announce(key: string, read: () => string): void;
34
- dispose(): void;
33
+ announce: (key: string, read: () => string) => void;
34
+ dispose: () => void;
35
35
  }
@@ -36,7 +36,7 @@ var Announcer = class {
36
36
  * `read` runs at write time, when the message elements are in the document. Messages queued together are read as one;
37
37
  * a later call with the same `key` replaces the earlier one, so an in-place update is announced once.
38
38
  */
39
- announce(key, read) {
39
+ announce = (key, read) => {
40
40
  this.#pending.set(key, read);
41
41
  clearTimeout(this.#timer);
42
42
  this.#timer = setTimeout(() => {
@@ -45,10 +45,10 @@ var Announcer = class {
45
45
  this.#write(text);
46
46
  this.#timer = setTimeout(() => this.#write(""), ANNOUNCE_HOLD);
47
47
  }, 100);
48
- }
49
- dispose() {
48
+ };
49
+ dispose = () => {
50
50
  clearTimeout(this.#timer);
51
51
  this.#pending.clear();
52
- }
52
+ };
53
53
  };
54
54
  export { ANNOUNCE_DELAY, ANNOUNCE_HOLD, Announcer as default, isAlertType, pickFreshAnnouncements, readNoticeText };
@@ -1,10 +1,4 @@
1
- /**
2
- * A new array of the unique items of source that are not in removed
3
- *
4
- * differenceUnique(['a', 'b', 'c', 'a', 'b', 'c'], ['a', 'c']) => ['b']
5
- */
6
1
  export declare function differenceUnique<T>(source: T[], removed: T[]): T[];
7
2
  type CompareFn<T> = (a: T, b: T, sortOrder: 'ascend' | 'descend') => number;
8
- /** Wraps a compare function so that `descend` flips its sign */
9
3
  export declare function withOrderSort<T = any>(fn: CompareFn<T>, order?: 'ascend' | 'descend'): (a: T, b: T) => number;
10
4
  export {};
@@ -1,14 +1,8 @@
1
1
  import { difference, uniq } from "es-toolkit";
2
2
  // src/utils/array.ts
3
- /**
4
- * A new array of the unique items of source that are not in removed
5
- *
6
- * differenceUnique(['a', 'b', 'c', 'a', 'b', 'c'], ['a', 'c']) => ['b']
7
- */
8
3
  function differenceUnique(source, removed) {
9
4
  return difference(uniq(source), removed);
10
5
  }
11
- /** Wraps a compare function so that `descend` flips its sign */
12
6
  function withOrderSort(fn, order = "ascend") {
13
7
  switch (order) {
14
8
  case "descend": return (a, b) => {
@@ -29,10 +29,7 @@ function isValidTimezoneIANAString(timeZoneString) {
29
29
  }
30
30
  const MILLISECONDS_IN_MINUTE = 6e4;
31
31
  const MILLISECONDS_IN_DAY = 864e5;
32
- /**
33
- * UTC offset of `timeZone` (IANA name or ±HH[:MM]) at the instant `time` in milliseconds, positive east of UTC. No
34
- * zone or Z means UTC; an unknown zone gives NaN.
35
- */
32
+ /** UTC offset of `timeZone` (IANA name or ±HH[:MM]) at the instant `time` in milliseconds, positive east of UTC */
36
33
  function zoneOffset(timeZone, time) {
37
34
  if (!timeZone || timeZone === "Z") return 0;
38
35
  if (!isValidTimezoneIANAString(timeZone)) return NaN;
@@ -48,7 +45,6 @@ function wallTimeToInstant(wallTime, timeZone) {
48
45
  const offsetAfter = zoneOffset(timeZone, wallTime + MILLISECONDS_IN_DAY);
49
46
  return [wallTime - Math.max(offsetBefore, offsetAfter), wallTime - Math.min(offsetBefore, offsetAfter)].find((time) => time + zoneOffset(timeZone, time) === wallTime) ?? wallTime - offsetBefore;
50
47
  }
51
- /** Wall-clock fields of a system-local Date read as UTC */
52
48
  function wallTimeAsUtc(date) {
53
49
  const utc = /* @__PURE__ */ new Date(0);
54
50
  utc.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());
@@ -11,7 +11,6 @@ export interface RegisterMediaQueryOption {
11
11
  unmatch?: (e: MediaQueryList | MediaQueryListEvent) => void;
12
12
  callInInit?: boolean;
13
13
  }
14
- /** Returns the function that removes the listener */
15
14
  export declare function registerMediaQuery(media: string, { match, unmatch, callInInit }: RegisterMediaQueryOption): () => void;
16
15
  /**
17
16
  * Whether an overlay rendered through `getPopupContainer` covers the page: no container, or one that resolves to body.
package/dist/utils/dom.js CHANGED
@@ -11,7 +11,6 @@ function isEventInside(e, ...nodes) {
11
11
  const path = e.composedPath();
12
12
  return nodes.some((node) => node != null && path.includes(node));
13
13
  }
14
- /** Returns the function that removes the listener */
15
14
  function registerMediaQuery(media, { match, unmatch, callInInit = true }) {
16
15
  if (typeof window !== "undefined") {
17
16
  const mediaQueryList = window.matchMedia(media);
@@ -29,9 +29,6 @@ function escapeHtmlInMarkdown(text) {
29
29
  }
30
30
  return result.join("\n");
31
31
  }
32
- /**
33
- * Escape `<` to `&lt;` in a single line, but preserve content inside inline code spans.
34
- */
35
32
  function escapeAngleBracketsOutsideInlineCode(line) {
36
33
  const parts = [];
37
34
  let i = 0;
@@ -9,7 +9,5 @@ export declare function supportsFieldSizing(): boolean;
9
9
  * min-block-size and max-block-size clamp the height.
10
10
  */
11
11
  export declare function fitTextareaHeight(textarea: HTMLTextAreaElement): number;
12
- /** Sets the input's inline width to fit its value, or its placeholder while empty. */
13
12
  export declare function fitInputWidth(input: HTMLInputElement): number;
14
- /** Calls `refit` when web fonts finish loading, which changes text metrics after the first measurement. */
15
13
  export declare function onFontsLoaded(refit: () => void, signal: AbortSignal): void;
@@ -20,7 +20,6 @@ function fitTextareaHeight(textarea) {
20
20
  textarea.scrollTop = scrollTop;
21
21
  return height;
22
22
  }
23
- /** Sets the input's inline width to fit its value, or its placeholder while empty. */
24
23
  function fitInputWidth(input) {
25
24
  const style = getComputedStyle(input);
26
25
  const mirror = document.createElement("span");
@@ -45,7 +44,6 @@ function fitInputWidth(input) {
45
44
  input.style.width = `${width}px`;
46
45
  return width;
47
46
  }
48
- /** Calls `refit` when web fonts finish loading, which changes text metrics after the first measurement. */
49
47
  function onFontsLoaded(refit, signal) {
50
48
  document.fonts.addEventListener("loadingdone", refit, { signal });
51
49
  }
@@ -23,7 +23,6 @@ export default class FocusTrapHandle {
23
23
  static shouldRestoreFocus(container: HTMLElement | null | undefined, modal: boolean): boolean;
24
24
  /** Whether focus is inside `container` and was moved there by the keyboard, so closing it should hand focus back */
25
25
  static isFocusVisibleWithin(container?: HTMLElement | null): boolean;
26
- /** Focuses the first focusable element in `container`, or the container itself when it holds none */
27
26
  static focusFirstOrSelf(container?: HTMLElement | null, options?: FocusOptions): void;
28
27
  /** The first focusable element marked autofocus; neither the browser nor Vue focuses one that is inserted later */
29
28
  static findAutofocus(container: HTMLElement): FocusableElement | undefined;
@@ -31,7 +30,7 @@ export default class FocusTrapHandle {
31
30
  * Where a dialog puts focus on open when nothing inside has it: the element focused on the first open, the
32
31
  * autofocus element when `autofocus` is set, the footer button named by `initialFocus`, else the first focusable.
33
32
  */
34
- static pickInitialFocus(dialog: HTMLElement, options: {
33
+ static pickInitialFocus(dialog: HTMLElement, { remembered, footer, initialFocus, autofocus }: {
35
34
  remembered?: HTMLElement | null;
36
35
  footer?: Element | null;
37
36
  initialFocus?: string;
@@ -63,7 +63,6 @@ var FocusTrapHandle = class FocusTrapHandle {
63
63
  const active = FocusTrapHandle.getActiveElement(container);
64
64
  return Boolean(container && active && container.contains(active) && active.matches(":focus-visible"));
65
65
  }
66
- /** Focuses the first focusable element in `container`, or the container itself when it holds none */
67
66
  static focusFirstOrSelf(container, options) {
68
67
  (container ? FocusTrapHandle.getFocusableElements(container)[0] ?? container : void 0)?.focus(options);
69
68
  }
@@ -75,8 +74,7 @@ var FocusTrapHandle = class FocusTrapHandle {
75
74
  * Where a dialog puts focus on open when nothing inside has it: the element focused on the first open, the
76
75
  * autofocus element when `autofocus` is set, the footer button named by `initialFocus`, else the first focusable.
77
76
  */
78
- static pickInitialFocus(dialog, options) {
79
- const { remembered, footer, initialFocus, autofocus } = options;
77
+ static pickInitialFocus(dialog, { remembered, footer, initialFocus, autofocus }) {
80
78
  const button = initialFocus ? footer?.querySelector(`[data-type="${initialFocus}"]`) : null;
81
79
  return (remembered?.isConnected ? remembered : null) ?? (autofocus ? FocusTrapHandle.findAutofocus(dialog) : null) ?? button ?? FocusTrapHandle.getFocusableElements(dialog)[0];
82
80
  }
@@ -7,19 +7,18 @@
7
7
  export default class FocusScope {
8
8
  #private;
9
9
  /** Remembers the focused element to return to; a re-activation finds the focus already inside and keeps the first */
10
- record(): void;
10
+ record: () => void;
11
11
  /** Traps Tab in `container` and focuses it, unless an element inside already took focus */
12
12
  activate(container: HTMLElement, preventScroll?: boolean): void;
13
13
  /** Focuses `container` without trapping Tab, for a non-modal overlay; an element inside may already have focus */
14
14
  enter(container: HTMLElement, preventScroll?: boolean): void;
15
- /** `activate` for a modal overlay, `enter` for a non-modal one */
16
- engage(container: HTMLElement, modal: boolean, preventScroll?: boolean): void;
17
- deactivate(): void;
15
+ engage: (container: HTMLElement, modal: boolean, preventScroll?: boolean) => void;
16
+ deactivate: () => void;
18
17
  /** Focuses the recorded element again; call it after the inert around the overlay is released */
19
- restore(preventScroll?: boolean): void;
18
+ restore: (preventScroll?: boolean) => void;
20
19
  /**
21
20
  * `restore` unless the user moved focus out of a non-modal `container` (see `FocusTrapHandle.shouldRestoreFocus`).
22
21
  * `container` is passed in rather than read from `enter`, which may not have run for this close.
23
22
  */
24
- restoreIfAllowed(container: HTMLElement | null | undefined, modal: boolean, preventScroll?: boolean): void;
23
+ restoreIfAllowed: (container: HTMLElement | null | undefined, modal: boolean, preventScroll?: boolean) => void;
25
24
  }
@@ -35,13 +35,13 @@ var FocusScope = class {
35
35
  #previous = null;
36
36
  #fallbacks = [];
37
37
  /** Remembers the focused element to return to; a re-activation finds the focus already inside and keeps the first */
38
- record() {
38
+ record = () => {
39
39
  const active = FocusTrapHandle.getDeepActiveElement();
40
40
  if (!this.#container?.contains(FocusTrapHandle.getActiveElement(this.#container))) {
41
41
  this.#previous = active;
42
42
  this.#fallbacks = popupTriggers(active);
43
43
  }
44
- }
44
+ };
45
45
  /** Traps Tab in `container` and focuses it, unless an element inside already took focus */
46
46
  activate(container, preventScroll) {
47
47
  this.#trap?.destroy();
@@ -54,25 +54,24 @@ var FocusScope = class {
54
54
  if (!container.contains(FocusTrapHandle.getActiveElement(container))) container.focus({ preventScroll });
55
55
  if (!container.contains(FocusTrapHandle.getActiveElement(container))) FocusTrapHandle.getFocusableElements(container)[0]?.focus({ preventScroll });
56
56
  }
57
- /** `activate` for a modal overlay, `enter` for a non-modal one */
58
- engage(container, modal, preventScroll) {
57
+ engage = (container, modal, preventScroll) => {
59
58
  if (modal) this.activate(container, preventScroll);
60
59
  else this.enter(container, preventScroll);
61
- }
62
- deactivate() {
60
+ };
61
+ deactivate = () => {
63
62
  this.#trap?.destroy();
64
63
  this.#trap = null;
65
- }
64
+ };
66
65
  /** Focuses the recorded element again; call it after the inert around the overlay is released */
67
- restore(preventScroll) {
66
+ restore = (preventScroll) => {
68
67
  [this.#previous, ...this.#fallbacks].find(canTakeFocus)?.focus({ preventScroll });
69
- }
68
+ };
70
69
  /**
71
70
  * `restore` unless the user moved focus out of a non-modal `container` (see `FocusTrapHandle.shouldRestoreFocus`).
72
71
  * `container` is passed in rather than read from `enter`, which may not have run for this close.
73
72
  */
74
- restoreIfAllowed(container, modal, preventScroll) {
73
+ restoreIfAllowed = (container, modal, preventScroll) => {
75
74
  if (FocusTrapHandle.shouldRestoreFocus(container, modal)) this.restore(preventScroll);
76
- }
75
+ };
77
76
  };
78
77
  export { FocusScope as default };
@@ -1 +1 @@
1
- export default function isPromise(value: any): boolean;
1
+ export default function isPromise(value: unknown): value is PromiseLike<unknown>;
@@ -4,6 +4,6 @@
4
4
  */
5
5
  export default class ReleaseHolder {
6
6
  #private;
7
- hold(acquire: () => () => void): void;
8
- release(): void;
7
+ hold: (acquire: () => () => void) => void;
8
+ release: () => void;
9
9
  }
@@ -5,14 +5,14 @@
5
5
  */
6
6
  var ReleaseHolder = class {
7
7
  #release = null;
8
- hold(acquire) {
8
+ hold = (acquire) => {
9
9
  this.release();
10
10
  this.#release = acquire();
11
- }
12
- release() {
11
+ };
12
+ release = () => {
13
13
  const release = this.#release;
14
14
  this.#release = null;
15
15
  release?.();
16
- }
16
+ };
17
17
  };
18
18
  export { ReleaseHolder as default };
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Stops the page from scrolling behind an overlay and returns the function that releases this lock. Locks are
3
- * counted, so stacked overlays release the page only when the last one closes. The body's end padding grows by the
4
- * scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width keeps
5
- * the body's own margin and any width set by the page's stylesheet.
2
+ * Locks are counted, so stacked overlays release the page only when the last one closes. The body's end padding grows
3
+ * by the scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width
4
+ * keeps the body's own margin and any width set by the page's stylesheet.
6
5
  */
7
6
  export declare function lockBodyScroll(): () => void;
@@ -2,10 +2,9 @@
2
2
  let lockCount = 0;
3
3
  let restore = null;
4
4
  /**
5
- * Stops the page from scrolling behind an overlay and returns the function that releases this lock. Locks are
6
- * counted, so stacked overlays release the page only when the last one closes. The body's end padding grows by the
7
- * scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width keeps
8
- * the body's own margin and any width set by the page's stylesheet.
5
+ * Locks are counted, so stacked overlays release the page only when the last one closes. The body's end padding grows
6
+ * by the scrollbar width, so the page does not shift sideways when its scrollbar disappears; padding rather than width
7
+ * keeps the body's own margin and any width set by the page's stylesheet.
9
8
  */
10
9
  function lockBodyScroll() {
11
10
  if (lockCount === 0) {
@@ -10,5 +10,4 @@ export interface TweenOptions {
10
10
  onFrame: (value: number) => void;
11
11
  onEnd?: () => void;
12
12
  }
13
- /** Animates a number from `from` to `to` once per frame; returns a function that cancels it */
14
13
  export declare function tween({ from, to, duration, easing, onFrame, onEnd }: TweenOptions): () => void;
@@ -1,7 +1,6 @@
1
1
  // src/utils/tween.ts
2
2
  const linear = (t) => t;
3
3
  const easeInOutCubic = (t) => t < .5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2;
4
- /** Animates a number from `from` to `to` once per frame; returns a function that cancels it */
5
4
  function tween({ from, to, duration, easing = linear, onFrame, onEnd }) {
6
5
  let start;
7
6
  let frame = requestAnimationFrame(function step(now) {
@@ -1,2 +1 @@
1
- /** Random unique id, as `${prefix}-${uuid}` when a prefix is given */
2
1
  export declare function createId(prefix?: string): string;
@@ -1,5 +1,4 @@
1
1
  // src/utils/uuid.ts
2
- /** Random unique id, as `${prefix}-${uuid}` when a prefix is given */
3
2
  function createId(prefix) {
4
3
  const id = crypto.randomUUID();
5
4
  return prefix ? `${prefix}-${id}` : id;
@@ -4,5 +4,4 @@
4
4
  * false in the browser, silencing every check.
5
5
  */
6
6
  export declare function isDev(): boolean;
7
- /** Prints `info` as a development-time warning when `flag` holds; production builds print nothing */
8
7
  export default function warning(flag: boolean, info: string): void;
@@ -7,7 +7,6 @@
7
7
  function isDev() {
8
8
  return process.env.NODE_ENV !== "production";
9
9
  }
10
- /** Prints `info` as a development-time warning when `flag` holds; production builds print nothing */
11
10
  function warning(flag, info) {
12
11
  if (flag && isDev()) console.warn(`Warning: ${info}`);
13
12
  }
@@ -55,39 +55,39 @@ export default class VideoPlayerFoundation<P extends VideoPlayerBaseProps = Vide
55
55
  protected checkFullScreen(): boolean;
56
56
  init(): void;
57
57
  destroy(): void;
58
- handleTimeChange(value: number): void;
59
- handleTimeUpdate(): void;
60
- handleDurationChange(): void;
61
- handleError(): void;
58
+ handleTimeChange: (value: number) => void;
59
+ handleTimeUpdate: () => void;
60
+ handleDurationChange: () => void;
61
+ handleError: () => void;
62
62
  handleLoadStart: () => void;
63
- handlePlayOrPause(): void;
63
+ handlePlayOrPause: () => void;
64
64
  handlePlay(): void;
65
65
  handlePause(): void;
66
66
  handleVideoPlay: () => void;
67
67
  handleVideoPause: () => void;
68
68
  handleCanPlay: () => void;
69
- handleWaiting(locale: VideoPlayerNotificationLocale): void;
70
- handleStalled(locale: VideoPlayerNotificationLocale): void;
69
+ handleWaiting: (locale: VideoPlayerNotificationLocale) => void;
70
+ handleStalled: (locale: VideoPlayerNotificationLocale) => void;
71
71
  handleProgress: () => void;
72
72
  handleEnded: () => void;
73
73
  /** From the user (the slider); init applies the initial volume without notifying */
74
- handleVolumeChange(value: number): void;
74
+ handleVolumeChange: (value: number) => void;
75
75
  /** Mutes, or unmutes to the volume before muting; to half volume when that was 0 */
76
76
  handleVolumeSilent: () => void;
77
77
  handleFullscreen: () => void;
78
- handleRateChange(rate: {
78
+ handleRateChange: (rate: {
79
79
  label: string;
80
80
  value: number;
81
- }, locale: VideoPlayerNotificationLocale): void;
82
- handleQualityChange(quality: {
81
+ }, locale: VideoPlayerNotificationLocale) => void;
82
+ handleQualityChange: (quality: {
83
83
  label: string;
84
84
  value: string;
85
- }, locale: VideoPlayerNotificationLocale): void;
86
- handleRouteChange(route: {
85
+ }, locale: VideoPlayerNotificationLocale) => void;
86
+ handleRouteChange: (route: {
87
87
  label: string;
88
88
  value: string;
89
- }, locale: VideoPlayerNotificationLocale): void;
90
- handleMirror(locale: VideoPlayerNotificationLocale): void;
89
+ }, locale: VideoPlayerNotificationLocale) => void;
90
+ handleMirror: (locale: VideoPlayerNotificationLocale) => void;
91
91
  handlePictureInPicture: () => void;
92
92
  handleMouseEnterWrapper: () => void;
93
93
  handleMouseLeaveWrapper: () => void;