@code0-tech/pictor 1.0.0 → 1.1.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 (459) hide show
  1. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +6 -0
  2. package/dist/_virtual/rolldown_runtime.js +18 -0
  3. package/dist/assets/Alert.style.css +1 -0
  4. package/dist/assets/Aurora.style.css +1 -0
  5. package/dist/assets/Avatar.style.css +1 -0
  6. package/dist/assets/Badge.style.css +1 -0
  7. package/dist/assets/Breadcrumb.style.css +1 -0
  8. package/dist/assets/Button.style.css +1 -0
  9. package/dist/assets/ButtonGroup.style.css +1 -0
  10. package/dist/assets/Card.style.css +1 -0
  11. package/dist/assets/Chart.style.css +1 -0
  12. package/dist/assets/Col.style.css +1 -0
  13. package/dist/assets/ColorInput.style.css +1 -0
  14. package/dist/assets/Command.style.css +1 -0
  15. package/dist/assets/Container.style.css +1 -0
  16. package/dist/assets/ContextMenu.style.css +1 -0
  17. package/dist/assets/DataTable.style.css +1 -0
  18. package/dist/assets/DateInput.style.css +1 -0
  19. package/dist/assets/Dialog.style.css +1 -0
  20. package/dist/assets/Editor.styles.css +1 -0
  21. package/dist/assets/EditorInput.style.css +1 -0
  22. package/dist/assets/FileInput.style.css +1 -0
  23. package/dist/assets/FileTabs.style.css +1 -0
  24. package/dist/assets/FullScreen.style.css +1 -0
  25. package/dist/assets/Gantt.style.css +1 -0
  26. package/dist/assets/Icon.style.css +1 -0
  27. package/dist/assets/Input.style.css +1 -0
  28. package/dist/assets/InputWrapper.style.css +1 -0
  29. package/dist/assets/JsonView.style.css +1 -0
  30. package/dist/assets/Layout.style.css +1 -0
  31. package/dist/assets/Menu.style.css +1 -0
  32. package/dist/assets/Progress.style.css +1 -0
  33. package/dist/assets/Quote.style.css +1 -0
  34. package/dist/assets/Resizable.style.css +1 -0
  35. package/dist/assets/Row.style.css +1 -0
  36. package/dist/assets/ScrollArea.style.css +1 -0
  37. package/dist/assets/SegmentedControl.style.css +1 -0
  38. package/dist/assets/SelectInput.style.css +1 -0
  39. package/dist/assets/Tab.style.css +1 -0
  40. package/dist/assets/Text.style.css +1 -0
  41. package/dist/assets/Toast.style.css +1 -0
  42. package/dist/assets/Tooltip.style.css +1 -0
  43. package/dist/components/alert/Alert.js +34 -41
  44. package/dist/components/aurora/Aurora.js +27 -22
  45. package/dist/components/avatar/Avatar.js +57 -55
  46. package/dist/components/badge/Badge.js +58 -64
  47. package/dist/components/breadcrumb/Breadcrumb.js +16 -21
  48. package/dist/components/button/Button.js +24 -31
  49. package/dist/components/button-group/ButtonGroup.js +29 -31
  50. package/dist/components/card/Card.js +30 -44
  51. package/dist/components/card/CardSection.js +21 -29
  52. package/dist/components/chart/Chart.js +138 -153
  53. package/dist/components/chart/LineChart.js +75 -74
  54. package/dist/components/chart/index.js +3 -8
  55. package/dist/components/col/Col.js +19 -29
  56. package/dist/components/command/Command.js +101 -134
  57. package/dist/components/container/Container.js +19 -23
  58. package/dist/components/context-menu/ContextMenu.js +119 -112
  59. package/dist/components/data-table/DataTable.js +53 -64
  60. package/dist/components/data-table/DataTableColumn.js +18 -22
  61. package/dist/components/data-table/DataTableFilterInput.js +208 -205
  62. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +59 -48
  63. package/dist/components/data-table/DataTableHeader.js +34 -38
  64. package/dist/components/data-table/DataTablePagination.js +62 -74
  65. package/dist/components/data-table/index.js +7 -22
  66. package/dist/components/dialog/Dialog.js +107 -97
  67. package/dist/components/editor/Editor.js +352 -323
  68. package/dist/components/file-tabs/FileTabs.js +78 -73
  69. package/dist/components/file-tabs/FileTabs.service.js +85 -87
  70. package/dist/components/file-tabs/FileTabs.view.js +0 -1
  71. package/dist/components/file-tabs/index.js +3 -9
  72. package/dist/components/flex/Flex.js +19 -23
  73. package/dist/components/form/CheckboxInput.js +73 -76
  74. package/dist/components/form/ColorInput.js +378 -353
  75. package/dist/components/form/DateInput.js +315 -265
  76. package/dist/components/form/EditorInput.js +597 -579
  77. package/dist/components/form/EmailInput.js +30 -23
  78. package/dist/components/form/FileInput.js +93 -123
  79. package/dist/components/form/Input.js +64 -58
  80. package/dist/components/form/Input.utils.js +25 -37
  81. package/dist/components/form/InputDescription.js +11 -11
  82. package/dist/components/form/InputLabel.js +18 -22
  83. package/dist/components/form/InputMessage.js +17 -17
  84. package/dist/components/form/InputWrapper.js +56 -65
  85. package/dist/components/form/NumberInput.js +41 -20
  86. package/dist/components/form/PasswordInput.js +71 -54
  87. package/dist/components/form/PinInput.js +50 -65
  88. package/dist/components/form/RadioGroup.js +42 -50
  89. package/dist/components/form/RadioInput.js +31 -29
  90. package/dist/components/form/SelectInput.js +69 -92
  91. package/dist/components/form/SwitchInput.js +17 -18
  92. package/dist/components/form/TagInput.js +108 -122
  93. package/dist/components/form/TextAreaInput.js +24 -21
  94. package/dist/components/form/TextInput.js +30 -22
  95. package/dist/components/form/index.js +22 -87
  96. package/dist/components/form/useForm.js +87 -88
  97. package/dist/components/fullscreen/FullScreen.js +28 -27
  98. package/dist/components/gantt/Gantt.js +100 -98
  99. package/dist/components/gantt/GanttGroup.js +210 -195
  100. package/dist/components/gantt/GanttHeader.js +79 -81
  101. package/dist/components/gantt/GanttItem.js +19 -22
  102. package/dist/components/icon/Icon.d.ts +6 -4
  103. package/dist/components/icon/Icon.js +53 -42
  104. package/dist/components/icon/codezero/codezero.js +10 -0
  105. package/dist/components/icon/codezero/gls.js +9 -0
  106. package/dist/components/icon/codezero/index.js +17 -13
  107. package/dist/components/json-view/JsonView.js +120 -109
  108. package/dist/components/layout/Layout.js +101 -78
  109. package/dist/components/menu/Menu.js +135 -128
  110. package/dist/components/progress/ProgressCircle.js +60 -49
  111. package/dist/components/progress/ProgressLinear.js +39 -43
  112. package/dist/components/quote/Quote.js +52 -43
  113. package/dist/components/resizable/Resizable.js +36 -33
  114. package/dist/components/row/Row.js +19 -23
  115. package/dist/components/scroll-area/ScrollArea.js +66 -76
  116. package/dist/components/segmented-control/SegmentedControl.js +46 -50
  117. package/dist/components/spacing/Spacing.js +16 -23
  118. package/dist/components/tab/Tab.js +73 -66
  119. package/dist/components/text/Text.js +19 -25
  120. package/dist/components/toast/Toast.js +104 -82
  121. package/dist/components/tooltip/Tooltip.js +66 -55
  122. package/dist/index.js +76 -272
  123. package/dist/node_modules/@lezer/common/dist/index.js +778 -143
  124. package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
  125. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +55 -55
  126. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -32
  127. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +57 -46
  128. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -16
  129. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +8 -11
  130. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +4 -5
  131. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +4 -5
  132. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +7 -8
  133. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -11
  134. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +4 -5
  135. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +12 -14
  136. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +4 -5
  137. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +4 -5
  138. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +5 -7
  139. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +8 -13
  140. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +252 -281
  141. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +19 -21
  142. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +57 -67
  143. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +24 -27
  144. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +16 -19
  145. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -124
  146. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +39 -42
  147. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +22 -27
  148. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +36 -44
  149. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +22 -32
  150. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +6 -12
  151. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +47 -37
  152. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +12 -16
  153. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +10 -20
  154. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +58 -59
  155. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +7 -11
  156. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -13
  157. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +42 -43
  158. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +19 -18
  159. package/dist/node_modules/framer-motion/dist/es/motion/index.js +64 -58
  160. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +2 -4
  161. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -20
  162. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +53 -62
  163. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +45 -49
  164. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +4 -38
  165. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +7 -17
  166. package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +3 -0
  167. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +10 -12
  168. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +5 -7
  169. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -10
  170. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +18 -15
  171. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +14 -18
  172. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +4 -23
  173. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +8 -9
  174. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +20 -23
  175. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +6 -8
  176. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +27 -29
  177. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +23 -21
  178. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +8 -9
  179. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +5 -7
  180. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +5 -8
  181. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +2 -4
  182. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +2 -4
  183. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +3 -5
  184. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +10 -11
  185. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +20 -25
  186. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +6 -7
  187. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +5 -6
  188. package/dist/node_modules/motion/dist/es/react.js +196 -0
  189. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +104 -111
  190. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +126 -143
  191. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +81 -105
  192. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +25 -37
  193. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +7 -9
  194. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +10 -16
  195. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +29 -36
  196. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +18 -28
  197. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +156 -170
  198. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +6 -12
  199. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -12
  200. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +3 -5
  201. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +6 -8
  202. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +42 -45
  203. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +52 -57
  204. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +22 -27
  205. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +18 -21
  206. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +58 -67
  207. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +61 -70
  208. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +5 -7
  209. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +5 -7
  210. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +9 -11
  211. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +3 -5
  212. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +3 -6
  213. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +4 -6
  214. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +15 -15
  215. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +32 -35
  216. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +3 -6
  217. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +4 -6
  218. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +19 -26
  219. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +4 -6
  220. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +14 -21
  221. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +21 -29
  222. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +25 -22
  223. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +5 -7
  224. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +3 -7
  225. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +4 -8
  226. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +15 -19
  227. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +3 -5
  228. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +12 -14
  229. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -9
  230. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +2 -4
  231. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +8 -11
  232. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +32 -14
  233. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +16 -20
  234. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +21 -32
  235. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +7 -11
  236. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +5 -7
  237. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +5 -9
  238. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +5 -9
  239. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +12 -14
  240. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +3 -5
  241. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -26
  242. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +4 -9
  243. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +3 -5
  244. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +10 -20
  245. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +29 -42
  246. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +11 -13
  247. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +6 -9
  248. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +8 -10
  249. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +32 -36
  250. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +32 -32
  251. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +16 -15
  252. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +23 -24
  253. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +2 -4
  254. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +2 -4
  255. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +2 -4
  256. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +13 -11
  257. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +20 -29
  258. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +34 -22
  259. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +7 -11
  260. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +41 -53
  261. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +28 -38
  262. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +23 -21
  263. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +15 -17
  264. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +18 -26
  265. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +10 -12
  266. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +19 -24
  267. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +554 -592
  268. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +4 -14
  269. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +48 -52
  270. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +10 -20
  271. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +11 -16
  272. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +14 -20
  273. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +9 -12
  274. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +2 -4
  275. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +3 -5
  276. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +16 -18
  277. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +11 -15
  278. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +8 -11
  279. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +6 -9
  280. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +198 -260
  281. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +25 -27
  282. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +2 -4
  283. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +49 -60
  284. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +4 -6
  285. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +3 -5
  286. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +35 -35
  287. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +25 -28
  288. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +33 -37
  289. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +5 -11
  290. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +8 -12
  291. package/dist/node_modules/motion-dom/dist/es/render/store.js +2 -4
  292. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +37 -39
  293. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +18 -30
  294. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +25 -27
  295. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +2 -4
  296. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +11 -13
  297. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +6 -10
  298. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +11 -14
  299. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +128 -138
  300. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +16 -19
  301. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +3 -5
  302. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +8 -11
  303. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +5 -8
  304. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +2 -4
  305. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +3 -5
  306. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +10 -12
  307. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +20 -23
  308. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +18 -24
  309. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +8 -14
  310. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +2 -5
  311. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +5 -7
  312. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +16 -18
  313. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +14 -18
  314. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +7 -13
  315. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +10 -13
  316. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +31 -35
  317. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +18 -21
  318. package/dist/node_modules/motion-dom/dist/es/resize/index.js +5 -7
  319. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +5 -0
  320. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +7 -0
  321. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +9 -11
  322. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +29 -40
  323. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +4 -6
  324. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +4 -6
  325. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +4 -6
  326. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +26 -27
  327. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +44 -45
  328. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +3 -5
  329. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +5 -7
  330. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +2 -4
  331. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +4 -7
  332. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +11 -14
  333. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +2 -4
  334. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +9 -11
  335. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +6 -8
  336. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +3 -5
  337. package/dist/node_modules/motion-dom/dist/es/value/index.js +89 -211
  338. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +4 -6
  339. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +15 -17
  340. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +17 -20
  341. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +9 -11
  342. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +12 -14
  343. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +12 -15
  344. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +13 -17
  345. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +22 -22
  346. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +43 -44
  347. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -10
  348. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +14 -9
  349. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +5 -7
  350. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +22 -27
  351. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +61 -69
  352. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +29 -36
  353. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +12 -16
  354. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +10 -17
  355. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +2 -4
  356. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +9 -11
  357. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +2 -4
  358. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +10 -8
  359. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +2 -4
  360. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +2 -4
  361. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +3 -5
  362. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +2 -4
  363. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +2 -4
  364. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +2 -4
  365. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +4 -6
  366. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +10 -13
  367. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +4 -6
  368. package/dist/node_modules/motion-utils/dist/es/array.js +6 -9
  369. package/dist/node_modules/motion-utils/dist/es/clamp.js +2 -4
  370. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +3 -5
  371. package/dist/node_modules/motion-utils/dist/es/easing/back.js +5 -9
  372. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +4 -8
  373. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +14 -17
  374. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +3 -7
  375. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +2 -4
  376. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +2 -4
  377. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +2 -4
  378. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +2 -4
  379. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +28 -31
  380. package/dist/node_modules/motion-utils/dist/es/errors.js +7 -13
  381. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +3 -5
  382. package/dist/node_modules/motion-utils/dist/es/global-config.js +2 -4
  383. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +2 -4
  384. package/dist/node_modules/motion-utils/dist/es/is-object.js +2 -4
  385. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +2 -4
  386. package/dist/node_modules/motion-utils/dist/es/memo.js +5 -7
  387. package/dist/node_modules/motion-utils/dist/es/noop.js +2 -4
  388. package/dist/node_modules/motion-utils/dist/es/pipe.js +2 -4
  389. package/dist/node_modules/motion-utils/dist/es/progress.js +4 -6
  390. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +23 -28
  391. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +2 -5
  392. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +2 -4
  393. package/dist/node_modules/motion-utils/dist/es/warn-once.js +5 -7
  394. package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
  395. package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
  396. package/dist/node_modules/prettier/standalone.js +3444 -2415
  397. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -21
  398. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +18 -14
  399. package/dist/node_modules/react/compiler-runtime.js +8 -10
  400. package/dist/utils/arrayService.js +0 -1
  401. package/dist/utils/color.js +46 -41
  402. package/dist/utils/component.js +60 -129
  403. package/dist/utils/contextStore.js +48 -58
  404. package/dist/utils/index.js +7 -29
  405. package/dist/utils/motion.js +85 -113
  406. package/dist/utils/reactiveArrayService.js +80 -76
  407. package/dist/utils/size.js +14 -26
  408. package/dist/utils/utils.js +0 -1
  409. package/dist/utils/view.js +27 -24
  410. package/dist/vite-env.d.js +0 -1
  411. package/package.json +25 -20
  412. package/dist/_virtual/compiler-runtime.js +0 -5
  413. package/dist/_virtual/compiler-runtime2.js +0 -4
  414. package/dist/_virtual/react-compiler-runtime.development.js +0 -4
  415. package/dist/_virtual/react-compiler-runtime.production.js +0 -4
  416. package/dist/assets/components/alert/Alert.style.css +0 -1
  417. package/dist/assets/components/aurora/Aurora.style.css +0 -1
  418. package/dist/assets/components/avatar/Avatar.style.css +0 -1
  419. package/dist/assets/components/badge/Badge.style.css +0 -1
  420. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
  421. package/dist/assets/components/button/Button.style.css +0 -1
  422. package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
  423. package/dist/assets/components/card/Card.style.css +0 -1
  424. package/dist/assets/components/chart/Chart.style.css +0 -1
  425. package/dist/assets/components/col/Col.style.css +0 -1
  426. package/dist/assets/components/command/Command.style.css +0 -1
  427. package/dist/assets/components/container/Container.style.css +0 -1
  428. package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
  429. package/dist/assets/components/data-table/DataTable.style.css +0 -1
  430. package/dist/assets/components/dialog/Dialog.style.css +0 -1
  431. package/dist/assets/components/editor/Editor.styles.css +0 -1
  432. package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
  433. package/dist/assets/components/form/ColorInput.style.css +0 -1
  434. package/dist/assets/components/form/DateInput.style.css +0 -1
  435. package/dist/assets/components/form/EditorInput.style.css +0 -1
  436. package/dist/assets/components/form/FileInput.style.css +0 -1
  437. package/dist/assets/components/form/Input.style.css +0 -1
  438. package/dist/assets/components/form/InputWrapper.style.css +0 -1
  439. package/dist/assets/components/form/SelectInput.style.css +0 -1
  440. package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
  441. package/dist/assets/components/gantt/Gantt.style.css +0 -1
  442. package/dist/assets/components/icon/Icon.style.css +0 -1
  443. package/dist/assets/components/json-view/JsonView.style.css +0 -1
  444. package/dist/assets/components/layout/Layout.style.css +0 -1
  445. package/dist/assets/components/menu/Menu.style.css +0 -1
  446. package/dist/assets/components/progress/Progress.style.css +0 -1
  447. package/dist/assets/components/quote/Quote.style.css +0 -1
  448. package/dist/assets/components/resizable/Resizable.style.css +0 -1
  449. package/dist/assets/components/row/Row.style.css +0 -1
  450. package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
  451. package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
  452. package/dist/assets/components/tab/Tab.style.css +0 -1
  453. package/dist/assets/components/text/Text.style.css +0 -1
  454. package/dist/assets/components/toast/Toast.style.css +0 -1
  455. package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
  456. package/dist/components/icon/codezero/codezero.svg.js +0 -5
  457. package/dist/components/icon/codezero/gls.svg.js +0 -5
  458. /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
  459. /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
@@ -1,37 +1,30 @@
1
- import { spring as L } from "./spring.js";
2
- import { getGeneratorVelocity as R } from "./utils/velocity.js";
3
- function $({ keyframes: v, velocity: B = 0, power: M = 0.8, timeConstant: b = 325, bounceDamping: k = 10, bounceStiffness: F = 500, modifyTarget: l, min: t, max: a, restDelta: f = 0.5, restSpeed: O }) {
4
- const s = v[0], n = {
5
- done: !1,
6
- value: s
7
- }, C = (e) => t !== void 0 && e < t || a !== void 0 && e > a, D = (e) => t === void 0 ? a : a === void 0 || Math.abs(t - e) < Math.abs(a - e) ? t : a;
8
- let d = M * B;
9
- const i = s + d, u = l === void 0 ? i : l(i);
10
- u !== i && (d = u - s);
11
- const p = (e) => -d * Math.exp(-e / b), h = (e) => u + p(e), y = (e) => {
12
- const o = p(e), G = h(e);
13
- n.done = Math.abs(o) <= f, n.value = n.done ? u : G;
14
- };
15
- let r, c;
16
- const g = (e) => {
17
- C(n.value) && (r = e, c = L({
18
- keyframes: [n.value, D(n.value)],
19
- velocity: R(h, e, n.value),
20
- // TODO: This should be passing * 1000
21
- damping: k,
22
- stiffness: F,
23
- restDelta: f,
24
- restSpeed: O
25
- }));
26
- };
27
- return g(0), {
28
- calculatedDuration: null,
29
- next: (e) => {
30
- let o = !1;
31
- return !c && r === void 0 && (o = !0, y(e), g(e)), r !== void 0 && e >= r ? c.next(e - r) : (!o && y(e), n);
32
- }
33
- };
1
+ import { spring } from "./spring.js";
2
+ import { getGeneratorVelocity } from "./utils/velocity.js";
3
+ function inertia({ keyframes: n, velocity: r = 0, power: i = .8, timeConstant: a = 325, bounceDamping: o = 10, bounceStiffness: s = 500, modifyTarget: c, min: l, max: u, restDelta: d = .5, restSpeed: f }) {
4
+ let p = n[0], m = {
5
+ done: !1,
6
+ value: p
7
+ }, h = (e) => l !== void 0 && e < l || u !== void 0 && e > u, g = (e) => l === void 0 ? u : u === void 0 || Math.abs(l - e) < Math.abs(u - e) ? l : u, _ = i * r, v = p + _, y = c === void 0 ? v : c(v);
8
+ y !== v && (_ = y - p);
9
+ let b = (e) => -_ * Math.exp(-e / a), x = (e) => y + b(e), S = (e) => {
10
+ let t = b(e), n = x(e);
11
+ m.done = Math.abs(t) <= d, m.value = m.done ? y : n;
12
+ }, C, w, T = (n) => {
13
+ h(m.value) && (C = n, w = spring({
14
+ keyframes: [m.value, g(m.value)],
15
+ velocity: getGeneratorVelocity(x, n, m.value),
16
+ damping: o,
17
+ stiffness: s,
18
+ restDelta: d,
19
+ restSpeed: f
20
+ }));
21
+ };
22
+ return T(0), {
23
+ calculatedDuration: null,
24
+ next: (e) => {
25
+ let t = !1;
26
+ return !w && C === void 0 && (t = !0, S(e), T(e)), C !== void 0 && e >= C ? w.next(e - C) : (!t && S(e), m);
27
+ }
28
+ };
34
29
  }
35
- export {
36
- $ as inertia
37
- };
30
+ export { inertia };
@@ -1,30 +1,20 @@
1
- import { interpolate as c } from "../../utils/interpolate.js";
2
- import { defaultOffset as p } from "../keyframes/offsets/default.js";
3
- import { convertOffsetToTimes as u } from "../keyframes/offsets/time.js";
4
- import { isEasingArray as l } from "../../../../../motion-utils/dist/es/easing/utils/is-easing-array.js";
5
- import { easingDefinitionToFunction as m } from "../../../../../motion-utils/dist/es/easing/utils/map.js";
6
- import { easeInOut as g } from "../../../../../motion-utils/dist/es/easing/ease.js";
7
- function T(n, t) {
8
- return n.map(() => t || g).splice(0, n.length - 1);
1
+ import { easeInOut } from "../../../../../motion-utils/dist/es/easing/ease.js";
2
+ import { isEasingArray } from "../../../../../motion-utils/dist/es/easing/utils/is-easing-array.js";
3
+ import { easingDefinitionToFunction } from "../../../../../motion-utils/dist/es/easing/utils/map.js";
4
+ import { interpolate } from "../../utils/interpolate.js";
5
+ import { defaultOffset } from "../keyframes/offsets/default.js";
6
+ import { convertOffsetToTimes } from "../keyframes/offsets/time.js";
7
+ function defaultEasing(a, o) {
8
+ return a.map(() => o || easeInOut).splice(0, a.length - 1);
9
9
  }
10
- function y({ duration: n = 300, keyframes: t, times: o, ease: r = "easeInOut" }) {
11
- const e = l(r) ? r.map(m) : m(r), i = {
12
- done: !1,
13
- value: t[0]
14
- }, s = u(
15
- // Only use the provided offsets if they're the correct length
16
- // TODO Maybe we should warn here if there's a length mismatch
17
- o && o.length === t.length ? o : p(t),
18
- n
19
- ), a = c(s, t, {
20
- ease: Array.isArray(e) ? e : T(t, e)
21
- });
22
- return {
23
- calculatedDuration: n,
24
- next: (f) => (i.value = a(f), i.done = f >= n, i)
25
- };
10
+ function keyframes({ duration: e = 300, keyframes: s, times: c, ease: l = "easeInOut" }) {
11
+ let u = isEasingArray(l) ? l.map(easingDefinitionToFunction) : easingDefinitionToFunction(l), d = {
12
+ done: !1,
13
+ value: s[0]
14
+ }, f = interpolate(convertOffsetToTimes(c && c.length === s.length ? c : defaultOffset(s), e), s, { ease: Array.isArray(u) ? u : defaultEasing(s, u) });
15
+ return {
16
+ calculatedDuration: e,
17
+ next: (a) => (d.value = f(a), d.done = a >= e, d)
18
+ };
26
19
  }
27
- export {
28
- T as defaultEasing,
29
- y as keyframes
30
- };
20
+ export { defaultEasing, keyframes };
@@ -1,178 +1,164 @@
1
- import { generateLinearEasing as L } from "../waapi/utils/linear.js";
2
- import { calcGeneratorDuration as z, maxGeneratorDuration as B } from "./utils/calc-duration.js";
3
- import { createGeneratorEasing as H } from "./utils/create-generator-easing.js";
4
- import { millisecondsToSeconds as K, secondsToMilliseconds as q } from "../../../../../motion-utils/dist/es/time-conversion.js";
5
- import { clamp as N } from "../../../../../motion-utils/dist/es/clamp.js";
6
- import { warning as J } from "../../../../../motion-utils/dist/es/errors.js";
7
- const n = {
8
- // Default spring physics
9
- stiffness: 100,
10
- damping: 10,
11
- mass: 1,
12
- velocity: 0,
13
- // Default duration/bounce-based options
14
- duration: 800,
15
- // in ms
16
- bounce: 0.3,
17
- visualDuration: 0.3,
18
- // in seconds
19
- // Rest thresholds
20
- restSpeed: {
21
- granular: 0.01,
22
- default: 2
23
- },
24
- restDelta: {
25
- granular: 5e-3,
26
- default: 0.5
27
- },
28
- // Limits
29
- minDuration: 0.01,
30
- // in seconds
31
- maxDuration: 10,
32
- // in seconds
33
- minDamping: 0.05,
34
- maxDamping: 1
1
+ import { clamp } from "../../../../../motion-utils/dist/es/clamp.js";
2
+ import { warning } from "../../../../../motion-utils/dist/es/errors.js";
3
+ import { millisecondsToSeconds, secondsToMilliseconds } from "../../../../../motion-utils/dist/es/time-conversion.js";
4
+ import { generateLinearEasing } from "../waapi/utils/linear.js";
5
+ import { calcGeneratorDuration, maxGeneratorDuration } from "./utils/calc-duration.js";
6
+ import { createGeneratorEasing } from "./utils/create-generator-easing.js";
7
+ var springDefaults = {
8
+ stiffness: 100,
9
+ damping: 10,
10
+ mass: 1,
11
+ velocity: 0,
12
+ duration: 800,
13
+ bounce: .3,
14
+ visualDuration: .3,
15
+ restSpeed: {
16
+ granular: .01,
17
+ default: 2
18
+ },
19
+ restDelta: {
20
+ granular: .005,
21
+ default: .5
22
+ },
23
+ minDuration: .01,
24
+ maxDuration: 10,
25
+ minDamping: .05,
26
+ maxDamping: 1
35
27
  };
36
- function O(e, s) {
37
- return e * Math.sqrt(1 - s * s);
28
+ function calcAngularFreq(n, i) {
29
+ return n * Math.sqrt(1 - i * i);
38
30
  }
39
- const Q = 12;
40
- function U(e, s, a) {
41
- let l = a;
42
- for (let f = 1; f < Q; f++)
43
- l = l - e(l) / s(l);
44
- return l;
31
+ var rootIterations = 12;
32
+ function approximateRoot(n, i, a) {
33
+ let o = a;
34
+ for (let a = 1; a < rootIterations; a++) o -= n(o) / i(o);
35
+ return o;
45
36
  }
46
- const I = 1e-3;
47
- function W({ duration: e = n.duration, bounce: s = n.bounce, velocity: a = n.velocity, mass: l = n.mass }) {
48
- let f, v;
49
- J(e <= q(n.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
50
- let r = 1 - s;
51
- r = N(n.minDamping, n.maxDamping, r), e = N(n.minDuration, n.maxDuration, K(e)), r < 1 ? (f = (c) => {
52
- const g = c * r, h = g * e, k = g - a, x = O(c, r), M = Math.exp(-h);
53
- return I - k / x * M;
54
- }, v = (c) => {
55
- const h = c * r * e, k = h * a + a, x = Math.pow(r, 2) * Math.pow(c, 2) * e, M = Math.exp(-h), o = O(Math.pow(c, 2), r);
56
- return (-f(c) + I > 0 ? -1 : 1) * ((k - x) * M) / o;
57
- }) : (f = (c) => {
58
- const g = Math.exp(-c * e), h = (c - a) * e + 1;
59
- return -I + g * h;
60
- }, v = (c) => {
61
- const g = Math.exp(-c * e), h = (a - c) * (e * e);
62
- return g * h;
63
- });
64
- const p = 5 / e, T = U(f, v, p);
65
- if (e = q(e), isNaN(T))
66
- return {
67
- stiffness: n.stiffness,
68
- damping: n.damping,
69
- duration: e
70
- };
71
- {
72
- const c = Math.pow(T, 2) * l;
73
- return {
74
- stiffness: c,
75
- damping: r * 2 * Math.sqrt(l * c),
76
- duration: e
77
- };
78
- }
37
+ var safeMin = .001;
38
+ function findSpring({ duration: s = springDefaults.duration, bounce: c = springDefaults.bounce, velocity: l = springDefaults.velocity, mass: u = springDefaults.mass }) {
39
+ let d, m;
40
+ warning(s <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
41
+ let h = 1 - c;
42
+ h = clamp(springDefaults.minDamping, springDefaults.maxDamping, h), s = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(s)), h < 1 ? (d = (n) => {
43
+ let i = n * h, a = i * s, o = i - l, c = calcAngularFreq(n, h), u = Math.exp(-a);
44
+ return safeMin - o / c * u;
45
+ }, m = (n) => {
46
+ let i = n * h * s, a = i * l + l, o = h ** 2 * n ** 2 * s, c = Math.exp(-i), u = calcAngularFreq(n ** 2, h);
47
+ return (-d(n) + safeMin > 0 ? -1 : 1) * ((a - o) * c) / u;
48
+ }) : (d = (n) => {
49
+ let i = Math.exp(-n * s), a = (n - l) * s + 1;
50
+ return -safeMin + i * a;
51
+ }, m = (n) => Math.exp(-n * s) * ((l - n) * (s * s)));
52
+ let g = 5 / s, _ = approximateRoot(d, m, g);
53
+ if (s = secondsToMilliseconds(s), isNaN(_)) return {
54
+ stiffness: springDefaults.stiffness,
55
+ damping: springDefaults.damping,
56
+ duration: s
57
+ };
58
+ {
59
+ let n = _ ** 2 * u;
60
+ return {
61
+ stiffness: n,
62
+ damping: h * 2 * Math.sqrt(u * n),
63
+ duration: s
64
+ };
65
+ }
79
66
  }
80
- const X = ["duration", "bounce"], Y = ["stiffness", "damping", "mass"];
81
- function V(e, s) {
82
- return s.some((a) => e[a] !== void 0);
67
+ var durationKeys = ["duration", "bounce"], physicsKeys = [
68
+ "stiffness",
69
+ "damping",
70
+ "mass"
71
+ ];
72
+ function isSpringType(n, i) {
73
+ return i.some((i) => n[i] !== void 0);
83
74
  }
84
- function Z(e) {
85
- let s = {
86
- velocity: n.velocity,
87
- stiffness: n.stiffness,
88
- damping: n.damping,
89
- mass: n.mass,
90
- isResolvedFromDuration: !1,
91
- ...e
92
- };
93
- if (!V(e, Y) && V(e, X))
94
- if (s.velocity = 0, e.visualDuration) {
95
- const a = e.visualDuration, l = 2 * Math.PI / (a * 1.2), f = l * l, v = 2 * N(0.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(f);
96
- s = {
97
- ...s,
98
- mass: n.mass,
99
- stiffness: f,
100
- damping: v
101
- };
102
- } else {
103
- const a = W({ ...e, velocity: 0 });
104
- s = {
105
- ...s,
106
- ...a,
107
- mass: n.mass
108
- }, s.isResolvedFromDuration = !0;
109
- }
110
- return s;
75
+ function getSpringOptions(i) {
76
+ let a = {
77
+ velocity: springDefaults.velocity,
78
+ stiffness: springDefaults.stiffness,
79
+ damping: springDefaults.damping,
80
+ mass: springDefaults.mass,
81
+ isResolvedFromDuration: !1,
82
+ ...i
83
+ };
84
+ if (!isSpringType(i, physicsKeys) && isSpringType(i, durationKeys)) if (a.velocity = 0, i.visualDuration) {
85
+ let o = i.visualDuration, s = 2 * Math.PI / (o * 1.2), c = s * s, l = 2 * clamp(.05, 1, 1 - (i.bounce || 0)) * Math.sqrt(c);
86
+ a = {
87
+ ...a,
88
+ mass: springDefaults.mass,
89
+ stiffness: c,
90
+ damping: l
91
+ };
92
+ } else {
93
+ let n = findSpring({
94
+ ...i,
95
+ velocity: 0
96
+ });
97
+ a = {
98
+ ...a,
99
+ ...n,
100
+ mass: springDefaults.mass
101
+ }, a.isResolvedFromDuration = !0;
102
+ }
103
+ return a;
111
104
  }
112
- function j(e = n.visualDuration, s = n.bounce) {
113
- const a = typeof e != "object" ? {
114
- visualDuration: e,
115
- keyframes: [0, 1],
116
- bounce: s
117
- } : e;
118
- let { restSpeed: l, restDelta: f } = a;
119
- const v = a.keyframes[0], r = a.keyframes[a.keyframes.length - 1], p = { done: !1, value: v }, { stiffness: T, damping: c, mass: g, duration: h, velocity: k, isResolvedFromDuration: x } = Z({
120
- ...a,
121
- velocity: -K(a.velocity || 0)
122
- }), M = k || 0, o = c / (2 * Math.sqrt(T * g)), m = r - v, i = K(Math.sqrt(T / g)), P = Math.abs(m) < 5;
123
- l || (l = P ? n.restSpeed.granular : n.restSpeed.default), f || (f = P ? n.restDelta.granular : n.restDelta.default);
124
- let G, w, d, C, A, F;
125
- if (o < 1)
126
- d = O(i, o), C = (M + o * i * m) / d, G = (t) => {
127
- const u = Math.exp(-o * i * t);
128
- return r - u * (C * Math.sin(d * t) + m * Math.cos(d * t));
129
- }, A = o * i * C + m * d, F = o * i * m - C * d, w = (t) => Math.exp(-o * i * t) * (A * Math.sin(d * t) + F * Math.cos(d * t));
130
- else if (o === 1) {
131
- G = (u) => r - Math.exp(-i * u) * (m + (M + i * m) * u);
132
- const t = M + i * m;
133
- w = (u) => Math.exp(-i * u) * (i * t * u - M);
134
- } else {
135
- const t = i * Math.sqrt(o * o - 1);
136
- G = (y) => {
137
- const S = Math.exp(-o * i * y), b = Math.min(t * y, 300);
138
- return r - S * ((M + o * i * m) * Math.sinh(b) + t * m * Math.cosh(b)) / t;
139
- };
140
- const u = (M + o * i * m) / t, D = o * i * u - m * t, R = o * i * m - u * t;
141
- w = (y) => {
142
- const S = Math.exp(-o * i * y), b = Math.min(t * y, 300);
143
- return S * (D * Math.sinh(b) + R * Math.cosh(b));
144
- };
145
- }
146
- const E = {
147
- calculatedDuration: x && h || null,
148
- velocity: (t) => q(w(t)),
149
- next: (t) => {
150
- if (!x && o < 1) {
151
- const D = Math.exp(-o * i * t), R = Math.sin(d * t), y = Math.cos(d * t), S = r - D * (C * R + m * y), b = q(D * (A * R + F * y));
152
- return p.done = Math.abs(b) <= l && Math.abs(r - S) <= f, p.value = p.done ? r : S, p;
153
- }
154
- const u = G(t);
155
- if (x)
156
- p.done = t >= h;
157
- else {
158
- const D = q(w(t));
159
- p.done = Math.abs(D) <= l && Math.abs(r - u) <= f;
160
- }
161
- return p.value = p.done ? r : u, p;
162
- },
163
- toString: () => {
164
- const t = Math.min(z(E), B), u = L((D) => E.next(t * D).value, t, 30);
165
- return t + "ms " + u;
166
- },
167
- toTransition: () => {
168
- }
169
- };
170
- return E;
105
+ function spring(n = springDefaults.visualDuration, i = springDefaults.bounce) {
106
+ let u = typeof n == "object" ? n : {
107
+ visualDuration: n,
108
+ keyframes: [0, 1],
109
+ bounce: i
110
+ }, { restSpeed: d, restDelta: f } = u, p = u.keyframes[0], m = u.keyframes[u.keyframes.length - 1], h = {
111
+ done: !1,
112
+ value: p
113
+ }, { stiffness: g, damping: _, mass: v, duration: y, velocity: b, isResolvedFromDuration: x } = getSpringOptions({
114
+ ...u,
115
+ velocity: -millisecondsToSeconds(u.velocity || 0)
116
+ }), S = b || 0, C = _ / (2 * Math.sqrt(g * v)), w = m - p, T = millisecondsToSeconds(Math.sqrt(g / v)), E = Math.abs(w) < 5;
117
+ d ||= E ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default, f ||= E ? springDefaults.restDelta.granular : springDefaults.restDelta.default;
118
+ let D, O, k, A, j, M;
119
+ if (C < 1) k = calcAngularFreq(T, C), A = (S + C * T * w) / k, D = (n) => m - Math.exp(-C * T * n) * (A * Math.sin(k * n) + w * Math.cos(k * n)), j = C * T * A + w * k, M = C * T * w - A * k, O = (n) => Math.exp(-C * T * n) * (j * Math.sin(k * n) + M * Math.cos(k * n));
120
+ else if (C === 1) {
121
+ D = (n) => m - Math.exp(-T * n) * (w + (S + T * w) * n);
122
+ let n = S + T * w;
123
+ O = (i) => Math.exp(-T * i) * (T * n * i - S);
124
+ } else {
125
+ let n = T * Math.sqrt(C * C - 1);
126
+ D = (i) => {
127
+ let a = Math.exp(-C * T * i), o = Math.min(n * i, 300);
128
+ return m - a * ((S + C * T * w) * Math.sinh(o) + n * w * Math.cosh(o)) / n;
129
+ };
130
+ let i = (S + C * T * w) / n, a = C * T * i - w * n, o = C * T * w - i * n;
131
+ O = (i) => {
132
+ let s = Math.exp(-C * T * i), c = Math.min(n * i, 300);
133
+ return s * (a * Math.sinh(c) + o * Math.cosh(c));
134
+ };
135
+ }
136
+ let N = {
137
+ calculatedDuration: x && y || null,
138
+ velocity: (n) => secondsToMilliseconds(O(n)),
139
+ next: (n) => {
140
+ if (!x && C < 1) {
141
+ let i = Math.exp(-C * T * n), a = Math.sin(k * n), s = Math.cos(k * n), c = m - i * (A * a + w * s), l = secondsToMilliseconds(i * (j * a + M * s));
142
+ return h.done = Math.abs(l) <= d && Math.abs(m - c) <= f, h.value = h.done ? m : c, h;
143
+ }
144
+ let i = D(n);
145
+ if (x) h.done = n >= y;
146
+ else {
147
+ let a = secondsToMilliseconds(O(n));
148
+ h.done = Math.abs(a) <= d && Math.abs(m - i) <= f;
149
+ }
150
+ return h.value = h.done ? m : i, h;
151
+ },
152
+ toString: () => {
153
+ let n = Math.min(calcGeneratorDuration(N), maxGeneratorDuration), i = generateLinearEasing((i) => N.next(n * i).value, n, 30);
154
+ return n + "ms " + i;
155
+ },
156
+ toTransition: () => {}
157
+ };
158
+ return N;
171
159
  }
172
- j.applyToOptions = (e) => {
173
- const s = H(e, 100, j);
174
- return e.ease = s.ease, e.duration = q(s.duration), e.type = "keyframes", e;
175
- };
176
- export {
177
- j as spring
160
+ spring.applyToOptions = (n) => {
161
+ let i = createGeneratorEasing(n, 100, spring);
162
+ return n.ease = i.ease, n.duration = secondsToMilliseconds(i.duration), n.type = "keyframes", n;
178
163
  };
164
+ export { spring };
@@ -1,13 +1,7 @@
1
- const a = 2e4;
2
- function o(n) {
3
- let t = 0;
4
- const r = 50;
5
- let e = n.next(t);
6
- for (; !e.done && t < 2e4; )
7
- t += r, e = n.next(t);
8
- return t >= 2e4 ? 1 / 0 : t;
1
+ var maxGeneratorDuration = 2e4;
2
+ function calcGeneratorDuration(e) {
3
+ let t = 0, n = e.next(t);
4
+ for (; !n.done && t < 2e4;) t += 50, n = e.next(t);
5
+ return t >= 2e4 ? Infinity : t;
9
6
  }
10
- export {
11
- o as calcGeneratorDuration,
12
- a as maxGeneratorDuration
13
- };
7
+ export { calcGeneratorDuration, maxGeneratorDuration };
@@ -1,13 +1,14 @@
1
- import { calcGeneratorDuration as i, maxGeneratorDuration as m } from "./calc-duration.js";
2
- import { millisecondsToSeconds as s } from "../../../../../../motion-utils/dist/es/time-conversion.js";
3
- function f(n, r = 100, o) {
4
- const e = o({ ...n, keyframes: [0, r] }), t = Math.min(i(e), m);
5
- return {
6
- type: "keyframes",
7
- ease: (a) => e.next(t * a).value / r,
8
- duration: s(t)
9
- };
1
+ import { millisecondsToSeconds } from "../../../../../../motion-utils/dist/es/time-conversion.js";
2
+ import { calcGeneratorDuration, maxGeneratorDuration } from "./calc-duration.js";
3
+ function createGeneratorEasing(r, i = 100, a) {
4
+ let o = a({
5
+ ...r,
6
+ keyframes: [0, i]
7
+ }), s = Math.min(calcGeneratorDuration(o), maxGeneratorDuration);
8
+ return {
9
+ type: "keyframes",
10
+ ease: (e) => o.next(s * e).value / i,
11
+ duration: millisecondsToSeconds(s)
12
+ };
10
13
  }
11
- export {
12
- f as createGeneratorEasing
13
- };
14
+ export { createGeneratorEasing };
@@ -1,6 +1,4 @@
1
- function o(n) {
2
- return typeof n == "function" && "applyToOptions" in n;
1
+ function isGenerator(e) {
2
+ return typeof e == "function" && "applyToOptions" in e;
3
3
  }
4
- export {
5
- o as isGenerator
6
- };
4
+ export { isGenerator };
@@ -1,9 +1,7 @@
1
- import { velocityPerSecond as n } from "../../../../../../motion-utils/dist/es/velocity-per-second.js";
2
- const c = 5;
3
- function a(t, e, r) {
4
- const o = Math.max(e - c, 0);
5
- return n(r - t(o), e - o);
1
+ import { velocityPerSecond } from "../../../../../../motion-utils/dist/es/velocity-per-second.js";
2
+ var velocitySampleDuration = 5;
3
+ function getGeneratorVelocity(n, r, i) {
4
+ let a = Math.max(r - velocitySampleDuration, 0);
5
+ return velocityPerSecond(i - n(a), r - a);
6
6
  }
7
- export {
8
- a as getGeneratorVelocity
9
- };
7
+ export { getGeneratorVelocity };