@helpdice/ui 1.7.5 → 1.7.8

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 (304) hide show
  1. package/dist/CurrencyInput/index.js +2981 -0
  2. package/dist/LinearProgress/index.d.ts +2 -0
  3. package/dist/{css-baseline → LinearProgress}/index.js +25 -317
  4. package/dist/LinearProgress/linear-progress.d.ts +9 -0
  5. package/dist/Loadable/index.js +570 -0
  6. package/dist/PhoneInput/index.js +2136 -314
  7. package/dist/Placeholder/index.js +2116 -254
  8. package/dist/auto-complete/index.js +2145 -652
  9. package/dist/avatar/index.js +2119 -333
  10. package/dist/badge/index.js +2117 -331
  11. package/dist/breadcrumbs/index.js +2126 -340
  12. package/dist/button/button.compact.d.ts +2 -0
  13. package/dist/button/index.js +2214 -342
  14. package/dist/button-dropdown/index.js +2120 -291
  15. package/dist/button-group/index.js +2117 -331
  16. package/dist/capacity/index.js +2117 -331
  17. package/dist/card/index.js +2127 -298
  18. package/dist/checkbox/index.js +2119 -290
  19. package/dist/code/index.js +2116 -297
  20. package/dist/collapse/index.js +2117 -475
  21. package/dist/description/index.js +2117 -331
  22. package/dist/display/index.js +2117 -331
  23. package/dist/divider/index.js +2118 -332
  24. package/dist/dot/index.js +2117 -331
  25. package/dist/drawer/index.js +2129 -439
  26. package/dist/fieldset/index.js +2121 -354
  27. package/dist/grid/index.js +2119 -333
  28. package/dist/image/index.js +2122 -336
  29. package/dist/index.d.ts +2 -14
  30. package/dist/index.js +3175 -1879
  31. package/dist/input/index.js +2125 -296
  32. package/dist/keyboard/index.js +2116 -297
  33. package/dist/link/index.js +2117 -331
  34. package/dist/list/index.js +2119 -333
  35. package/dist/loading/index.js +2117 -331
  36. package/dist/menu/index.js +77 -45
  37. package/dist/modal/index.js +2145 -452
  38. package/dist/note/index.js +2117 -331
  39. package/dist/page/index.js +2117 -331
  40. package/dist/pagination/index.js +2118 -351
  41. package/dist/popover/index.js +2123 -354
  42. package/dist/progress/index.js +2117 -331
  43. package/dist/radio/index.js +2120 -334
  44. package/dist/rating/index.js +2118 -332
  45. package/dist/row/index.js +2115 -296
  46. package/dist/select/index.js +2151 -688
  47. package/dist/slider/index.js +2123 -356
  48. package/dist/snippet/index.js +2118 -421
  49. package/dist/spacer/index.js +2115 -296
  50. package/dist/spinner/index.js +2117 -331
  51. package/dist/table/index.js +2341 -754
  52. package/dist/tabs/index.js +2123 -344
  53. package/dist/tag/index.js +2116 -254
  54. package/dist/text/index.js +2116 -297
  55. package/dist/textarea/index.js +2117 -288
  56. package/dist/toggle/index.js +2117 -331
  57. package/dist/tooltip/index.js +2120 -351
  58. package/dist/tree/index.js +2123 -459
  59. package/dist/use-input/index.js +2122 -24
  60. package/dist/use-modal/index.js +2122 -24
  61. package/dist/use-network-status/index.d.ts +2 -0
  62. package/dist/{use-current-state → use-network-status}/index.js +22 -15
  63. package/dist/use-network-status/use-netowork-status.d.ts +4 -0
  64. package/dist/use-scale/index.js +2115 -296
  65. package/dist/use-tabs/index.js +2122 -24
  66. package/dist/user/index.js +2123 -337
  67. package/esm/CurrencyInput/components/CurrencyInput.js +342 -0
  68. package/esm/CurrencyInput/components/CurrencyInputProps.js +1 -0
  69. package/esm/CurrencyInput/components/utils/addSeparators.js +7 -0
  70. package/esm/CurrencyInput/components/utils/cleanValue.js +69 -0
  71. package/esm/CurrencyInput/components/utils/escapeRegExp.js +8 -0
  72. package/esm/CurrencyInput/components/utils/fixedDecimalValue.js +29 -0
  73. package/esm/CurrencyInput/components/utils/formatValue.js +124 -0
  74. package/esm/CurrencyInput/components/utils/getLocaleConfig.js +47 -0
  75. package/esm/CurrencyInput/components/utils/getSuffix.js +10 -0
  76. package/esm/CurrencyInput/components/utils/index.js +8 -0
  77. package/esm/CurrencyInput/components/utils/isNumber.js +3 -0
  78. package/esm/CurrencyInput/components/utils/padTrimValue.js +27 -0
  79. package/esm/CurrencyInput/components/utils/parseAbbrValue.js +43 -0
  80. package/esm/CurrencyInput/components/utils/removeInvalidChars.js +10 -0
  81. package/esm/CurrencyInput/components/utils/removeSeparators.js +10 -0
  82. package/esm/CurrencyInput/components/utils/repositionCursor.js +35 -0
  83. package/esm/CurrencyInput/index.js +4 -0
  84. package/esm/LinearProgress/index.d.ts +2 -0
  85. package/esm/LinearProgress/index.js +2 -0
  86. package/esm/LinearProgress/linear-progress.d.ts +9 -0
  87. package/esm/LinearProgress/linear-progress.js +28 -0
  88. package/esm/Loadable/index.js +2 -0
  89. package/esm/PhoneInput/phone.js +22 -19
  90. package/esm/auto-complete/auto-complete-dropdown.js +1 -3
  91. package/esm/auto-complete/auto-complete-item.js +1 -3
  92. package/esm/auto-complete/auto-complete-searching.js +1 -1
  93. package/esm/auto-complete/auto-complete.js +1 -1
  94. package/esm/avatar/avatar-group.js +1 -2
  95. package/esm/avatar/avatar.js +1 -2
  96. package/esm/badge/badge.js +1 -2
  97. package/esm/breadcrumbs/breadcrumbs-item.js +1 -1
  98. package/esm/breadcrumbs/breadcrumbs-separator.js +1 -1
  99. package/esm/breadcrumbs/breadcrumbs.js +1 -1
  100. package/esm/button/button-icon.js +1 -1
  101. package/esm/button/button.compact.d.ts +2 -0
  102. package/esm/button/button.compact.js +94 -50
  103. package/esm/button/button.js +1 -2
  104. package/esm/button/utils.js +1 -1
  105. package/esm/button-dropdown/button-dropdown-item.js +1 -1
  106. package/esm/button-dropdown/button-dropdown.js +1 -2
  107. package/esm/button-group/button-group.js +1 -2
  108. package/esm/capacity/capacity.js +1 -2
  109. package/esm/card/card-content.js +1 -1
  110. package/esm/card/card-footer.js +1 -2
  111. package/esm/card/card.js +1 -2
  112. package/esm/carousal/Arrow.js +18 -0
  113. package/esm/carousal/Indicator.js +20 -0
  114. package/esm/carousal/Thumbs.js +302 -0
  115. package/esm/carousal/animations.js +162 -0
  116. package/esm/carousal/index.js +683 -0
  117. package/esm/carousal/types.js +1 -0
  118. package/esm/carousal/utils.js +49 -0
  119. package/esm/checkbox/checkbox-group.js +1 -1
  120. package/esm/checkbox/checkbox.icon.js +1 -1
  121. package/esm/checkbox/checkbox.js +1 -2
  122. package/esm/code/code.js +1 -1
  123. package/esm/collapse/collapse-group.js +1 -2
  124. package/esm/collapse/collapse.js +1 -4
  125. package/esm/description/description.js +1 -2
  126. package/esm/display/display.js +1 -2
  127. package/esm/divider/divider.js +1 -2
  128. package/esm/dot/dot.js +1 -2
  129. package/esm/drawer/drawer-wrapper.js +1 -3
  130. package/esm/drawer/drawer.js +1 -1
  131. package/esm/fieldset/fieldset-content.js +1 -1
  132. package/esm/fieldset/fieldset-footer.js +1 -1
  133. package/esm/fieldset/fieldset-group.js +1 -3
  134. package/esm/fieldset/fieldset-title.js +1 -1
  135. package/esm/fieldset/fieldset.js +1 -2
  136. package/esm/grid/basic-item.js +1 -2
  137. package/esm/grid/grid-container.js +1 -1
  138. package/esm/grid/grid.js +1 -1
  139. package/esm/image/image-browser.js +1 -2
  140. package/esm/image/image.js +1 -2
  141. package/esm/image/image.skeleton.js +1 -1
  142. package/esm/index.d.ts +2 -14
  143. package/esm/index.js +5 -9
  144. package/esm/input/input-block-label.js +1 -1
  145. package/esm/input/input-icon-clear.js +1 -2
  146. package/esm/input/input-label.js +1 -1
  147. package/esm/input/input.js +1 -2
  148. package/esm/keyboard/keyboard.js +1 -1
  149. package/esm/link/link.js +1 -2
  150. package/esm/list/list-item.js +1 -2
  151. package/esm/loading/loading.js +1 -2
  152. package/esm/modal/modal-action.js +1 -2
  153. package/esm/modal/modal-actions.js +1 -1
  154. package/esm/modal/modal-content.js +1 -1
  155. package/esm/modal/modal-subtitle.js +1 -1
  156. package/esm/modal/modal-title.js +1 -1
  157. package/esm/modal/modal-wrapper.js +1 -3
  158. package/esm/modal/modal.js +1 -1
  159. package/esm/note/note.js +1 -2
  160. package/esm/page/page-header.js +1 -1
  161. package/esm/page/page.js +1 -1
  162. package/esm/pagination/pagination-item.js +1 -2
  163. package/esm/pagination/pagination.js +1 -1
  164. package/esm/popover/popover-item.js +1 -2
  165. package/esm/popover/popover.js +1 -1
  166. package/esm/progress/progress.js +1 -2
  167. package/esm/radio/radio-description.js +1 -1
  168. package/esm/radio/radio-group.js +1 -1
  169. package/esm/radio/radio.js +1 -2
  170. package/esm/rating/rating.js +1 -2
  171. package/esm/row/row.js +1 -1
  172. package/esm/select/select-dropdown.js +1 -3
  173. package/esm/select/select-icon-clear.js +1 -1
  174. package/esm/select/select-multiple-value.js +1 -1
  175. package/esm/select/select-option.js +1 -3
  176. package/esm/select/select.js +9 -12
  177. package/esm/slider/slider-dot.js +1 -2
  178. package/esm/slider/slider-mark.js +1 -1
  179. package/esm/slider/slider.js +1 -3
  180. package/esm/snippet/snippet.js +1 -3
  181. package/esm/spinner/spinner.js +1 -2
  182. package/esm/table/table-body.js +1 -2
  183. package/esm/table/table-head.js +3 -2
  184. package/esm/tabs/tabs-item.js +1 -2
  185. package/esm/tabs/tabs.js +1 -3
  186. package/esm/tag/tag.js +1 -1
  187. package/esm/text/child.js +1 -1
  188. package/esm/textarea/textarea.js +1 -2
  189. package/esm/toggle/toggle.js +1 -2
  190. package/esm/tooltip/tooltip-content.js +1 -3
  191. package/esm/tooltip/tooltip-icon.js +1 -1
  192. package/esm/tooltip/tooltip.js +1 -1
  193. package/esm/tree/tree-file-icon.js +1 -1
  194. package/esm/tree/tree-file.js +1 -2
  195. package/esm/tree/tree-folder-icon.js +1 -1
  196. package/esm/tree/tree-folder.js +1 -3
  197. package/esm/tree/tree-status-icon.js +1 -1
  198. package/esm/tree/tree.js +1 -1
  199. package/esm/use-input/use-input.js +1 -1
  200. package/esm/use-modal/use-modal.js +1 -1
  201. package/esm/use-network-status/index.d.ts +2 -0
  202. package/esm/use-network-status/index.js +2 -0
  203. package/esm/use-network-status/use-netowork-status.d.ts +4 -0
  204. package/esm/use-network-status/use-netowork-status.js +29 -0
  205. package/esm/use-scale/with-scale.js +1 -1
  206. package/esm/use-tabs/use-tabs.js +1 -1
  207. package/esm/user/user.js +1 -2
  208. package/esm/utils/use-context-state/use-context-state.js +1 -1
  209. package/esm/utils/use-drag.js +1 -1
  210. package/package.json +12 -4
  211. package/dist/css-baseline/css-baseline.d.ts +0 -9
  212. package/dist/css-baseline/index.d.ts +0 -1
  213. package/dist/shared/backdrop.d.ts +0 -14
  214. package/dist/shared/css-transition.d.ts +0 -13
  215. package/dist/shared/dropdown.d.ts +0 -9
  216. package/dist/shared/ellipsis.d.ts +0 -6
  217. package/dist/shared/expand.d.ts +0 -7
  218. package/dist/shared/highlight.d.ts +0 -13
  219. package/dist/ui-provider/index.d.ts +0 -3
  220. package/dist/ui-provider/index.js +0 -2186
  221. package/dist/ui-provider/theme-provider.d.ts +0 -8
  222. package/dist/ui-provider/ui-provider.d.ts +0 -8
  223. package/dist/use-all-themes/all-themes-context.d.ts +0 -7
  224. package/dist/use-all-themes/index.d.ts +0 -3
  225. package/dist/use-all-themes/index.js +0 -311
  226. package/dist/use-classes/index.d.ts +0 -2
  227. package/dist/use-classes/index.js +0 -48
  228. package/dist/use-classes/use-classes.d.ts +0 -4
  229. package/dist/use-current-state/index.d.ts +0 -2
  230. package/dist/use-current-state/use-current-state.d.ts +0 -4
  231. package/dist/use-media-query/index.d.ts +0 -3
  232. package/dist/use-media-query/index.js +0 -444
  233. package/dist/use-media-query/use-media-query.d.ts +0 -12
  234. package/dist/use-theme/index.d.ts +0 -2
  235. package/dist/use-theme/index.js +0 -309
  236. package/dist/use-theme/theme-context.d.ts +0 -4
  237. package/dist/use-toasts/helpers.d.ts +0 -18
  238. package/dist/use-toasts/index.d.ts +0 -3
  239. package/dist/use-toasts/index.js +0 -204
  240. package/dist/use-toasts/toast-container.d.ts +0 -3
  241. package/dist/use-toasts/toast-item.d.ts +0 -8
  242. package/dist/use-toasts/use-toast.d.ts +0 -40
  243. package/dist/utils/use-current-state.d.ts +0 -2
  244. package/dist/utils/use-dom-observer.d.ts +0 -3
  245. package/dist/utils/use-hd-ui-context.d.ts +0 -16
  246. package/dist/utils/use-previous.d.ts +0 -2
  247. package/esm/captcha/index.js +0 -128
  248. package/esm/css-baseline/css-baseline.d.ts +0 -9
  249. package/esm/css-baseline/css-baseline.js +0 -23
  250. package/esm/css-baseline/index.d.ts +0 -1
  251. package/esm/css-baseline/index.js +0 -2
  252. package/esm/shared/backdrop.d.ts +0 -14
  253. package/esm/shared/backdrop.js +0 -66
  254. package/esm/shared/css-transition.d.ts +0 -13
  255. package/esm/shared/css-transition.js +0 -65
  256. package/esm/shared/dropdown.d.ts +0 -9
  257. package/esm/shared/dropdown.js +0 -99
  258. package/esm/shared/ellipsis.d.ts +0 -6
  259. package/esm/shared/ellipsis.js +0 -13
  260. package/esm/shared/expand.d.ts +0 -7
  261. package/esm/shared/expand.js +0 -86
  262. package/esm/shared/highlight.d.ts +0 -13
  263. package/esm/shared/highlight.js +0 -46
  264. package/esm/ui-provider/index.d.ts +0 -3
  265. package/esm/ui-provider/index.js +0 -4
  266. package/esm/ui-provider/theme-provider.d.ts +0 -8
  267. package/esm/ui-provider/theme-provider.js +0 -45
  268. package/esm/ui-provider/ui-provider.d.ts +0 -8
  269. package/esm/ui-provider/ui-provider.js +0 -55
  270. package/esm/use-all-themes/all-themes-context.d.ts +0 -7
  271. package/esm/use-all-themes/all-themes-context.js +0 -11
  272. package/esm/use-all-themes/index.d.ts +0 -3
  273. package/esm/use-all-themes/index.js +0 -2
  274. package/esm/use-classes/index.d.ts +0 -2
  275. package/esm/use-classes/index.js +0 -2
  276. package/esm/use-classes/use-classes.d.ts +0 -4
  277. package/esm/use-classes/use-classes.js +0 -34
  278. package/esm/use-current-state/index.d.ts +0 -2
  279. package/esm/use-current-state/index.js +0 -2
  280. package/esm/use-current-state/use-current-state.d.ts +0 -4
  281. package/esm/use-current-state/use-current-state.js +0 -23
  282. package/esm/use-media-query/index.d.ts +0 -3
  283. package/esm/use-media-query/index.js +0 -2
  284. package/esm/use-media-query/use-media-query.d.ts +0 -12
  285. package/esm/use-media-query/use-media-query.js +0 -81
  286. package/esm/use-theme/index.d.ts +0 -2
  287. package/esm/use-theme/index.js +0 -2
  288. package/esm/use-theme/theme-context.d.ts +0 -4
  289. package/esm/use-theme/theme-context.js +0 -9
  290. package/esm/use-toasts/helpers.d.ts +0 -18
  291. package/esm/use-toasts/helpers.js +0 -68
  292. package/esm/use-toasts/index.d.ts +0 -3
  293. package/esm/use-toasts/index.js +0 -2
  294. package/esm/use-toasts/toast-container.d.ts +0 -3
  295. package/esm/use-toasts/toast-container.js +0 -120
  296. package/esm/use-toasts/toast-item.d.ts +0 -8
  297. package/esm/use-toasts/toast-item.js +0 -45
  298. package/esm/use-toasts/use-toast.d.ts +0 -40
  299. package/esm/use-toasts/use-toast.js +0 -103
  300. package/esm/utils/use-current-state.d.ts +0 -2
  301. package/esm/utils/use-current-state.js +0 -2
  302. package/esm/utils/use-dom-observer.d.ts +0 -3
  303. package/esm/utils/use-hd-ui-context.d.ts +0 -16
  304. package/esm/utils/use-previous.d.ts +0 -2
@@ -2635,6 +2635,11 @@ function canAnimate(keyframes, name, type, velocity) {
2635
2635
  ((type === "spring" || isGenerator(type)) && velocity));
2636
2636
  }
2637
2637
 
2638
+ function makeAnimationInstant(options) {
2639
+ options.duration = 0;
2640
+ options.type === "keyframes";
2641
+ }
2642
+
2638
2643
  /**
2639
2644
  * A list of values that can be hardware-accelerated.
2640
2645
  */
@@ -2727,7 +2732,7 @@ class AsyncMotionValueAnimation extends WithPromise {
2727
2732
  onUpdate?.(getFinalKeyframe$1(keyframes, options, finalKeyframe));
2728
2733
  }
2729
2734
  keyframes[0] = keyframes[keyframes.length - 1];
2730
- options.duration = 0;
2735
+ makeAnimationInstant(options);
2731
2736
  options.repeat = 0;
2732
2737
  }
2733
2738
  /**
@@ -3272,7 +3277,7 @@ class MotionValue {
3272
3277
  * An object containing a SubscriptionManager for each active event.
3273
3278
  */
3274
3279
  this.events = {};
3275
- this.updateAndNotify = (v, render = true) => {
3280
+ this.updateAndNotify = (v) => {
3276
3281
  const currentTime = time.now();
3277
3282
  /**
3278
3283
  * If we're updating the value during another frame or eventloop
@@ -3293,10 +3298,6 @@ class MotionValue {
3293
3298
  }
3294
3299
  }
3295
3300
  }
3296
- // Update render subscribers
3297
- if (render) {
3298
- this.events.renderRequest?.notify(this.current);
3299
- }
3300
3301
  };
3301
3302
  this.hasAnimated = false;
3302
3303
  this.setCurrent(init);
@@ -3407,9 +3408,9 @@ class MotionValue {
3407
3408
  *
3408
3409
  * @public
3409
3410
  */
3410
- set(v, render = true) {
3411
- if (!render || !this.passiveEffect) {
3412
- this.updateAndNotify(v, render);
3411
+ set(v) {
3412
+ if (!this.passiveEffect) {
3413
+ this.updateAndNotify(v);
3413
3414
  }
3414
3415
  else {
3415
3416
  this.passiveEffect(v, this.updateAndNotify);
@@ -5045,6 +5046,11 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
5045
5046
  });
5046
5047
  wantsHandoff.current = false;
5047
5048
  }
5049
+ /**
5050
+ * Now we've finished triggering animations for this element we
5051
+ * can wipe the enteringChildren set for the next render.
5052
+ */
5053
+ visualElement.enteringChildren = undefined;
5048
5054
  });
5049
5055
  return visualElement;
5050
5056
  }
@@ -5603,7 +5609,7 @@ class VisualElement {
5603
5609
  for (const key in initialMotionValues) {
5604
5610
  const value = initialMotionValues[key];
5605
5611
  if (latestValues[key] !== undefined && isMotionValue(value)) {
5606
- value.set(latestValues[key], false);
5612
+ value.set(latestValues[key]);
5607
5613
  }
5608
5614
  }
5609
5615
  }
@@ -5629,8 +5635,7 @@ class VisualElement {
5629
5635
  if (process.env.NODE_ENV !== "production") {
5630
5636
  warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
5631
5637
  }
5632
- if (this.parent)
5633
- this.parent.children.add(this);
5638
+ this.parent?.addChild(this);
5634
5639
  this.update(this.props, this.presenceContext);
5635
5640
  }
5636
5641
  unmount() {
@@ -5640,7 +5645,7 @@ class VisualElement {
5640
5645
  this.valueSubscriptions.forEach((remove) => remove());
5641
5646
  this.valueSubscriptions.clear();
5642
5647
  this.removeFromVariantTree && this.removeFromVariantTree();
5643
- this.parent && this.parent.children.delete(this);
5648
+ this.parent?.removeChild(this);
5644
5649
  for (const key in this.events) {
5645
5650
  this.events[key].clear();
5646
5651
  }
@@ -5653,6 +5658,15 @@ class VisualElement {
5653
5658
  }
5654
5659
  this.current = null;
5655
5660
  }
5661
+ addChild(child) {
5662
+ this.children.add(child);
5663
+ this.enteringChildren ?? (this.enteringChildren = new Set());
5664
+ this.enteringChildren.add(child);
5665
+ }
5666
+ removeChild(child) {
5667
+ this.children.delete(child);
5668
+ this.enteringChildren && this.enteringChildren.delete(child);
5669
+ }
5656
5670
  bindToMotionValue(key, value) {
5657
5671
  if (this.valueSubscriptions.has(key)) {
5658
5672
  this.valueSubscriptions.get(key)();
@@ -5667,15 +5681,14 @@ class VisualElement {
5667
5681
  if (valueIsTransform && this.projection) {
5668
5682
  this.projection.isTransformDirty = true;
5669
5683
  }
5684
+ this.scheduleRender();
5670
5685
  });
5671
- const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
5672
5686
  let removeSyncCheck;
5673
5687
  if (window.MotionCheckAppearSync) {
5674
5688
  removeSyncCheck = window.MotionCheckAppearSync(this, key, value);
5675
5689
  }
5676
5690
  this.valueSubscriptions.set(key, () => {
5677
5691
  removeOnChange();
5678
- removeOnRenderRequest();
5679
5692
  if (removeSyncCheck)
5680
5693
  removeSyncCheck();
5681
5694
  if (value.owner)
@@ -6270,7 +6283,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
6270
6283
  let shouldSkip = false;
6271
6284
  if (options.type === false ||
6272
6285
  (options.duration === 0 && !options.repeatDelay)) {
6273
- options.duration = 0;
6286
+ makeAnimationInstant(options);
6274
6287
  if (options.delay === 0) {
6275
6288
  shouldSkip = true;
6276
6289
  }
@@ -6278,7 +6291,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
6278
6291
  if (MotionGlobalConfig.instantAnimations ||
6279
6292
  MotionGlobalConfig.skipAnimations) {
6280
6293
  shouldSkip = true;
6281
- options.duration = 0;
6294
+ makeAnimationInstant(options);
6282
6295
  options.delay = 0;
6283
6296
  }
6284
6297
  /**
@@ -6382,6 +6395,20 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
6382
6395
  return animations;
6383
6396
  }
6384
6397
 
6398
+ function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {
6399
+ const index = Array.from(children)
6400
+ .sort((a, b) => a.sortNodePosition(b))
6401
+ .indexOf(child);
6402
+ const numChildren = children.size;
6403
+ const maxStaggerDuration = (numChildren - 1) * staggerChildren;
6404
+ const delayIsFunction = typeof delayChildren === "function";
6405
+ return delayIsFunction
6406
+ ? delayChildren(index, numChildren)
6407
+ : staggerDirection === 1
6408
+ ? index * staggerChildren
6409
+ : maxStaggerDuration - index * staggerChildren;
6410
+ }
6411
+
6385
6412
  function animateVariant(visualElement, variant, options = {}) {
6386
6413
  const resolved = resolveVariant(visualElement, variant, options.type === "exit"
6387
6414
  ? visualElement.presenceContext?.custom
@@ -6424,31 +6451,17 @@ function animateVariant(visualElement, variant, options = {}) {
6424
6451
  }
6425
6452
  function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
6426
6453
  const animations = [];
6427
- const numChildren = visualElement.variantChildren.size;
6428
- const maxStaggerDuration = (numChildren - 1) * staggerChildren;
6429
- const delayIsFunction = typeof delayChildren === "function";
6430
- const generateStaggerDuration = delayIsFunction
6431
- ? (i) => delayChildren(i, numChildren)
6432
- : // Support deprecated staggerChildren
6433
- staggerDirection === 1
6434
- ? (i = 0) => i * staggerChildren
6435
- : (i = 0) => maxStaggerDuration - i * staggerChildren;
6436
- Array.from(visualElement.variantChildren)
6437
- .sort(sortByTreeOrder)
6438
- .forEach((child, i) => {
6454
+ for (const child of visualElement.variantChildren) {
6439
6455
  child.notify("AnimationStart", variant);
6440
6456
  animations.push(animateVariant(child, variant, {
6441
6457
  ...options,
6442
6458
  delay: delay +
6443
- (delayIsFunction ? 0 : delayChildren) +
6444
- generateStaggerDuration(i),
6459
+ (typeof delayChildren === "function" ? 0 : delayChildren) +
6460
+ calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),
6445
6461
  }).then(() => child.notify("AnimationComplete", variant)));
6446
- });
6462
+ }
6447
6463
  return Promise.all(animations);
6448
6464
  }
6449
- function sortByTreeOrder(a, b) {
6450
- return a.sortNodePosition(b);
6451
- }
6452
6465
 
6453
6466
  function animateVisualElement(visualElement, definition, options = {}) {
6454
6467
  visualElement.notify("AnimationStart", definition);
@@ -6601,9 +6614,6 @@ function createAnimationState(visualElement) {
6601
6614
  let isInherited = prop === context[type] &&
6602
6615
  prop !== props[type] &&
6603
6616
  propIsVariant;
6604
- /**
6605
- *
6606
- */
6607
6617
  if (isInherited &&
6608
6618
  isInitialRender &&
6609
6619
  visualElement.manuallyAnimateOnMount) {
@@ -6724,9 +6734,6 @@ function createAnimationState(visualElement) {
6724
6734
  */
6725
6735
  typeState.prevProp = prop;
6726
6736
  typeState.prevResolvedValues = resolvedValues;
6727
- /**
6728
- *
6729
- */
6730
6737
  if (typeState.isActive) {
6731
6738
  encounteredKeys = { ...encounteredKeys, ...resolvedValues };
6732
6739
  }
@@ -6740,10 +6747,30 @@ function createAnimationState(visualElement) {
6740
6747
  const willAnimateViaParent = isInherited && variantDidChange;
6741
6748
  const needsAnimating = !willAnimateViaParent || handledRemovedValues;
6742
6749
  if (shouldAnimateType && needsAnimating) {
6743
- animations.push(...definitionList.map((animation) => ({
6744
- animation: animation,
6745
- options: { type },
6746
- })));
6750
+ animations.push(...definitionList.map((animation) => {
6751
+ const options = { type };
6752
+ /**
6753
+ * If we're performing the initial animation, but we're not
6754
+ * rendering at the same time as the variant-controlling parent,
6755
+ * we want to use the parent's transition to calculate the stagger.
6756
+ */
6757
+ if (typeof animation === "string" &&
6758
+ isInitialRender &&
6759
+ !willAnimateViaParent &&
6760
+ visualElement.manuallyAnimateOnMount &&
6761
+ visualElement.parent) {
6762
+ const { parent } = visualElement;
6763
+ const parentVariant = resolveVariant(parent, animation);
6764
+ if (parent.enteringChildren && parentVariant) {
6765
+ const { delayChildren } = parentVariant.transition || {};
6766
+ options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);
6767
+ }
6768
+ }
6769
+ return {
6770
+ animation: animation,
6771
+ options,
6772
+ };
6773
+ }));
6747
6774
  }
6748
6775
  }
6749
6776
  /**
@@ -7917,6 +7944,10 @@ const correctBoxShadow = {
7917
7944
  /**
7918
7945
  * Track whether we've taken any snapshots yet. If not,
7919
7946
  * we can safely skip notification of didUpdate.
7947
+ *
7948
+ * Difficult to capture in a test but to prevent flickering
7949
+ * we must set this to true either on update or unmount.
7950
+ * Running `next-env/layout-id` in Safari will show this behaviour if broken.
7920
7951
  */
7921
7952
  let hasTakenAnySnapshot = false;
7922
7953
  class MeasureLayoutWithContext extends React.Component {
@@ -8005,6 +8036,7 @@ class MeasureLayoutWithContext extends React.Component {
8005
8036
  componentWillUnmount() {
8006
8037
  const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;
8007
8038
  const { projection } = visualElement;
8039
+ hasTakenAnySnapshot = true;
8008
8040
  if (projection) {
8009
8041
  projection.scheduleCheckAfterUnmount();
8010
8042
  if (layoutGroup && layoutGroup.group)