@orioncactuscorp/ui 1.0.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 (454) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +273 -0
  3. package/dist/components/Accordion/Accordion.css +1 -0
  4. package/dist/components/Accordion/Accordion.js +320 -0
  5. package/dist/components/Accordion/Accordion.module.scss.js +31 -0
  6. package/dist/components/Accordion.d.ts +6 -0
  7. package/dist/components/Accordion.js +9 -0
  8. package/dist/components/ActionArea/ActionArea.css +1 -0
  9. package/dist/components/ActionArea/ActionArea.js +158 -0
  10. package/dist/components/ActionArea/ActionArea.module.scss.js +9 -0
  11. package/dist/components/ActionArea.d.ts +6 -0
  12. package/dist/components/ActionArea.js +6 -0
  13. package/dist/components/Alert/Alert.css +1 -0
  14. package/dist/components/Alert/Alert.js +293 -0
  15. package/dist/components/Alert/Alert.module.scss.js +21 -0
  16. package/dist/components/Alert.d.ts +6 -0
  17. package/dist/components/Alert.js +10 -0
  18. package/dist/components/Background/Background.css +1 -0
  19. package/dist/components/Background/Background.js +45 -0
  20. package/dist/components/Background/Background.module.scss.js +21 -0
  21. package/dist/components/Background.d.ts +6 -0
  22. package/dist/components/Background.js +4 -0
  23. package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -0
  24. package/dist/components/BackgroundIconButton/BackgroundIconButton.js +61 -0
  25. package/dist/components/BackgroundIconButton/BackgroundIconButton.module.scss.js +13 -0
  26. package/dist/components/BackgroundIconButton.d.ts +6 -0
  27. package/dist/components/BackgroundIconButton.js +4 -0
  28. package/dist/components/Badge/Badge.css +1 -0
  29. package/dist/components/Badge/Badge.js +34 -0
  30. package/dist/components/Badge/Badge.module.scss.js +17 -0
  31. package/dist/components/Badge.d.ts +6 -0
  32. package/dist/components/Badge.js +4 -0
  33. package/dist/components/Button/Button.css +1 -0
  34. package/dist/components/Button/Button.js +151 -0
  35. package/dist/components/Button/Button.module.scss.js +29 -0
  36. package/dist/components/Button.d.ts +6 -0
  37. package/dist/components/Button.js +4 -0
  38. package/dist/components/Cell/Cell.css +1 -0
  39. package/dist/components/Cell/Cell.js +129 -0
  40. package/dist/components/Cell/Cell.module.scss.js +17 -0
  41. package/dist/components/Cell.d.ts +6 -0
  42. package/dist/components/Cell.js +5 -0
  43. package/dist/components/CheckMark/CheckMark.css +1 -0
  44. package/dist/components/CheckMark/CheckMark.js +44 -0
  45. package/dist/components/CheckMark/CheckMark.module.scss.js +7 -0
  46. package/dist/components/CheckMark.d.ts +6 -0
  47. package/dist/components/CheckMark.js +4 -0
  48. package/dist/components/Checkbox/Checkbox.css +1 -0
  49. package/dist/components/Checkbox/Checkbox.js +82 -0
  50. package/dist/components/Checkbox/Checkbox.module.scss.js +11 -0
  51. package/dist/components/Checkbox.d.ts +6 -0
  52. package/dist/components/Checkbox.js +4 -0
  53. package/dist/components/Divider/Divider.css +1 -0
  54. package/dist/components/Divider/Divider.js +41 -0
  55. package/dist/components/Divider/Divider.module.scss.js +17 -0
  56. package/dist/components/Divider.d.ts +6 -0
  57. package/dist/components/Divider.js +4 -0
  58. package/dist/components/Field/Field.css +1 -0
  59. package/dist/components/Field/Field.js +179 -0
  60. package/dist/components/Field/Field.module.scss.js +17 -0
  61. package/dist/components/Field/useFieldControlOverlayMetrics.js +44 -0
  62. package/dist/components/Field.d.ts +6 -0
  63. package/dist/components/Field.js +10 -0
  64. package/dist/components/Fieldset/Fieldset.css +1 -0
  65. package/dist/components/Fieldset/Fieldset.js +97 -0
  66. package/dist/components/Fieldset/Fieldset.module.scss.js +11 -0
  67. package/dist/components/Fieldset.d.ts +6 -0
  68. package/dist/components/Fieldset.js +8 -0
  69. package/dist/components/IconButton/IconButton.css +1 -0
  70. package/dist/components/IconButton/IconButton.js +49 -0
  71. package/dist/components/IconButton/IconButton.module.scss.js +11 -0
  72. package/dist/components/IconButton.d.ts +6 -0
  73. package/dist/components/IconButton.js +4 -0
  74. package/dist/components/Interaction/Interaction.css +1 -0
  75. package/dist/components/Interaction/Interaction.js +23 -0
  76. package/dist/components/Interaction/Interaction.module.scss.js +11 -0
  77. package/dist/components/Interaction.d.ts +6 -0
  78. package/dist/components/Interaction.js +4 -0
  79. package/dist/components/Loading/Loading.css +1 -0
  80. package/dist/components/Loading/Loading.js +47 -0
  81. package/dist/components/Loading/Loading.module.scss.js +21 -0
  82. package/dist/components/Loading.d.ts +6 -0
  83. package/dist/components/Loading.js +4 -0
  84. package/dist/components/Menu/Menu.css +1 -0
  85. package/dist/components/Menu/Menu.js +238 -0
  86. package/dist/components/Menu/Menu.module.scss.js +31 -0
  87. package/dist/components/Menu.d.ts +6 -0
  88. package/dist/components/Menu.js +9 -0
  89. package/dist/components/Modal/Modal.css +1 -0
  90. package/dist/components/Modal/Modal.js +628 -0
  91. package/dist/components/Modal/Modal.module.scss.js +48 -0
  92. package/dist/components/Modal/contexts.js +14 -0
  93. package/dist/components/Modal/modalScrollArbitration.js +134 -0
  94. package/dist/components/Modal/snapPoints.js +79 -0
  95. package/dist/components/Modal/useControllableState.js +17 -0
  96. package/dist/components/Modal/useElementSize.js +23 -0
  97. package/dist/components/Modal/useModalDrag.js +1498 -0
  98. package/dist/components/Modal/useModalPlacement.js +26 -0
  99. package/dist/components/Modal/useModalStackDepth.js +41 -0
  100. package/dist/components/Modal.d.ts +6 -0
  101. package/dist/components/Modal.js +11 -0
  102. package/dist/components/Radio/Radio.css +1 -0
  103. package/dist/components/Radio/Radio.js +68 -0
  104. package/dist/components/Radio/Radio.module.scss.js +11 -0
  105. package/dist/components/Radio.d.ts +6 -0
  106. package/dist/components/Radio.js +4 -0
  107. package/dist/components/ScrollArea/ScrollArea.css +1 -0
  108. package/dist/components/ScrollArea/ScrollArea.js +541 -0
  109. package/dist/components/ScrollArea/ScrollArea.module.scss.js +17 -0
  110. package/dist/components/ScrollArea/contexts.js +7 -0
  111. package/dist/components/ScrollArea.d.ts +6 -0
  112. package/dist/components/ScrollArea.js +8 -0
  113. package/dist/components/SectionHeader/SectionHeader.css +1 -0
  114. package/dist/components/SectionHeader/SectionHeader.js +48 -0
  115. package/dist/components/SectionHeader/SectionHeader.module.scss.js +7 -0
  116. package/dist/components/SectionHeader.d.ts +6 -0
  117. package/dist/components/SectionHeader.js +4 -0
  118. package/dist/components/Select/Select.css +1 -0
  119. package/dist/components/Select/Select.js +67 -0
  120. package/dist/components/Select/Select.module.scss.js +9 -0
  121. package/dist/components/Select/SelectContent.css +1 -0
  122. package/dist/components/Select/SelectContent.js +26 -0
  123. package/dist/components/Select/SelectContent.module.scss.js +15 -0
  124. package/dist/components/Select.d.ts +6 -0
  125. package/dist/components/Select.js +6 -0
  126. package/dist/components/SvgIcon.d.ts +6 -0
  127. package/dist/components/SvgIcon.js +4 -0
  128. package/dist/components/Switch/Switch.css +1 -0
  129. package/dist/components/Switch/Switch.js +46 -0
  130. package/dist/components/Switch/Switch.module.scss.js +8 -0
  131. package/dist/components/Switch.d.ts +6 -0
  132. package/dist/components/Switch.js +4 -0
  133. package/dist/components/TextArea/TextArea.css +1 -0
  134. package/dist/components/TextArea/TextArea.js +105 -0
  135. package/dist/components/TextArea/TextArea.module.scss.js +9 -0
  136. package/dist/components/TextArea/TextAreaContent.css +1 -0
  137. package/dist/components/TextArea/TextAreaContent.js +26 -0
  138. package/dist/components/TextArea/TextAreaContent.module.scss.js +15 -0
  139. package/dist/components/TextArea.d.ts +6 -0
  140. package/dist/components/TextArea.js +6 -0
  141. package/dist/components/TextButton/TextButton.css +1 -0
  142. package/dist/components/TextButton/TextButton.js +74 -0
  143. package/dist/components/TextButton/TextButton.module.scss.js +15 -0
  144. package/dist/components/TextButton.d.ts +6 -0
  145. package/dist/components/TextButton.js +4 -0
  146. package/dist/components/TextInput/TextInput.css +1 -0
  147. package/dist/components/TextInput/TextInput.js +69 -0
  148. package/dist/components/TextInput/TextInput.module.scss.js +9 -0
  149. package/dist/components/TextInput/TextInputContent.css +1 -0
  150. package/dist/components/TextInput/TextInputContent.js +26 -0
  151. package/dist/components/TextInput/TextInputContent.module.scss.js +15 -0
  152. package/dist/components/TextInput.d.ts +6 -0
  153. package/dist/components/TextInput.js +6 -0
  154. package/dist/components/Tooltip/Tooltip.css +1 -0
  155. package/dist/components/Tooltip/Tooltip.js +123 -0
  156. package/dist/components/Tooltip/Tooltip.module.scss.js +9 -0
  157. package/dist/components/Tooltip.d.ts +6 -0
  158. package/dist/components/Tooltip.js +8 -0
  159. package/dist/components/internal/slot.js +10 -0
  160. package/dist/foundations/atomic.css +1 -0
  161. package/dist/foundations/breakpoint.css +1 -0
  162. package/dist/foundations/color.global.css +1 -0
  163. package/dist/foundations/color.theme.dark.css +1 -0
  164. package/dist/foundations/color.theme.light.css +1 -0
  165. package/dist/foundations/motion.css +1 -0
  166. package/dist/foundations/reset.css +1 -0
  167. package/dist/foundations/space.css +1 -0
  168. package/dist/foundations/typo.css +1 -0
  169. package/dist/foundations/zindex.css +1 -0
  170. package/dist/foundations.css +11 -0
  171. package/dist/index.d.ts +2 -0
  172. package/dist/index.js +102 -0
  173. package/dist/react/motion.d.ts +6 -0
  174. package/dist/react/motion.js +176 -0
  175. package/dist/react/spring.d.ts +2 -0
  176. package/dist/react/spring.js +87 -0
  177. package/dist/reset.css +2 -0
  178. package/dist/styles.css +41 -0
  179. package/dist/ui/src/components/Accordion/Accordion.d.ts +9 -0
  180. package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -0
  181. package/dist/ui/src/components/Accordion/index.d.ts +3 -0
  182. package/dist/ui/src/components/Accordion/index.d.ts.map +1 -0
  183. package/dist/ui/src/components/Accordion/types.d.ts +39 -0
  184. package/dist/ui/src/components/Accordion/types.d.ts.map +1 -0
  185. package/dist/ui/src/components/ActionArea/ActionArea.d.ts +8 -0
  186. package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -0
  187. package/dist/ui/src/components/ActionArea/index.d.ts +3 -0
  188. package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -0
  189. package/dist/ui/src/components/ActionArea/types.d.ts +34 -0
  190. package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -0
  191. package/dist/ui/src/components/Alert/Alert.d.ts +17 -0
  192. package/dist/ui/src/components/Alert/Alert.d.ts.map +1 -0
  193. package/dist/ui/src/components/Alert/index.d.ts +3 -0
  194. package/dist/ui/src/components/Alert/index.d.ts.map +1 -0
  195. package/dist/ui/src/components/Alert/types.d.ts +43 -0
  196. package/dist/ui/src/components/Alert/types.d.ts.map +1 -0
  197. package/dist/ui/src/components/Background/Background.d.ts +4 -0
  198. package/dist/ui/src/components/Background/Background.d.ts.map +1 -0
  199. package/dist/ui/src/components/Background/index.d.ts +3 -0
  200. package/dist/ui/src/components/Background/index.d.ts.map +1 -0
  201. package/dist/ui/src/components/Background/types.d.ts +17 -0
  202. package/dist/ui/src/components/Background/types.d.ts.map +1 -0
  203. package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts +4 -0
  204. package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts.map +1 -0
  205. package/dist/ui/src/components/BackgroundIconButton/index.d.ts +3 -0
  206. package/dist/ui/src/components/BackgroundIconButton/index.d.ts.map +1 -0
  207. package/dist/ui/src/components/BackgroundIconButton/types.d.ts +16 -0
  208. package/dist/ui/src/components/BackgroundIconButton/types.d.ts.map +1 -0
  209. package/dist/ui/src/components/Badge/Badge.d.ts +4 -0
  210. package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -0
  211. package/dist/ui/src/components/Badge/index.d.ts +3 -0
  212. package/dist/ui/src/components/Badge/index.d.ts.map +1 -0
  213. package/dist/ui/src/components/Badge/types.d.ts +9 -0
  214. package/dist/ui/src/components/Badge/types.d.ts.map +1 -0
  215. package/dist/ui/src/components/Button/Button.d.ts +4 -0
  216. package/dist/ui/src/components/Button/Button.d.ts.map +1 -0
  217. package/dist/ui/src/components/Button/index.d.ts +3 -0
  218. package/dist/ui/src/components/Button/index.d.ts.map +1 -0
  219. package/dist/ui/src/components/Button/types.d.ts +30 -0
  220. package/dist/ui/src/components/Button/types.d.ts.map +1 -0
  221. package/dist/ui/src/components/Cell/Cell.d.ts +5 -0
  222. package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -0
  223. package/dist/ui/src/components/Cell/index.d.ts +3 -0
  224. package/dist/ui/src/components/Cell/index.d.ts.map +1 -0
  225. package/dist/ui/src/components/Cell/types.d.ts +23 -0
  226. package/dist/ui/src/components/Cell/types.d.ts.map +1 -0
  227. package/dist/ui/src/components/CheckMark/CheckMark.d.ts +4 -0
  228. package/dist/ui/src/components/CheckMark/CheckMark.d.ts.map +1 -0
  229. package/dist/ui/src/components/CheckMark/index.d.ts +3 -0
  230. package/dist/ui/src/components/CheckMark/index.d.ts.map +1 -0
  231. package/dist/ui/src/components/CheckMark/types.d.ts +6 -0
  232. package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -0
  233. package/dist/ui/src/components/Checkbox/Checkbox.d.ts +4 -0
  234. package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -0
  235. package/dist/ui/src/components/Checkbox/index.d.ts +3 -0
  236. package/dist/ui/src/components/Checkbox/index.d.ts.map +1 -0
  237. package/dist/ui/src/components/Checkbox/types.d.ts +11 -0
  238. package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -0
  239. package/dist/ui/src/components/Divider/Divider.d.ts +4 -0
  240. package/dist/ui/src/components/Divider/Divider.d.ts.map +1 -0
  241. package/dist/ui/src/components/Divider/index.d.ts +3 -0
  242. package/dist/ui/src/components/Divider/index.d.ts.map +1 -0
  243. package/dist/ui/src/components/Divider/types.d.ts +10 -0
  244. package/dist/ui/src/components/Divider/types.d.ts.map +1 -0
  245. package/dist/ui/src/components/Field/Field.d.ts +9 -0
  246. package/dist/ui/src/components/Field/Field.d.ts.map +1 -0
  247. package/dist/ui/src/components/Field/index.d.ts +3 -0
  248. package/dist/ui/src/components/Field/index.d.ts.map +1 -0
  249. package/dist/ui/src/components/Field/types.d.ts +30 -0
  250. package/dist/ui/src/components/Field/types.d.ts.map +1 -0
  251. package/dist/ui/src/components/Field/useFieldControlOverlayMetrics.d.ts +14 -0
  252. package/dist/ui/src/components/Field/useFieldControlOverlayMetrics.d.ts.map +1 -0
  253. package/dist/ui/src/components/Fieldset/Fieldset.d.ts +9 -0
  254. package/dist/ui/src/components/Fieldset/Fieldset.d.ts.map +1 -0
  255. package/dist/ui/src/components/Fieldset/index.d.ts +3 -0
  256. package/dist/ui/src/components/Fieldset/index.d.ts.map +1 -0
  257. package/dist/ui/src/components/Fieldset/types.d.ts +7 -0
  258. package/dist/ui/src/components/Fieldset/types.d.ts.map +1 -0
  259. package/dist/ui/src/components/IconButton/IconButton.d.ts +4 -0
  260. package/dist/ui/src/components/IconButton/IconButton.d.ts.map +1 -0
  261. package/dist/ui/src/components/IconButton/index.d.ts +3 -0
  262. package/dist/ui/src/components/IconButton/index.d.ts.map +1 -0
  263. package/dist/ui/src/components/IconButton/types.d.ts +16 -0
  264. package/dist/ui/src/components/IconButton/types.d.ts.map +1 -0
  265. package/dist/ui/src/components/Interaction/Interaction.d.ts +4 -0
  266. package/dist/ui/src/components/Interaction/Interaction.d.ts.map +1 -0
  267. package/dist/ui/src/components/Interaction/index.d.ts +3 -0
  268. package/dist/ui/src/components/Interaction/index.d.ts.map +1 -0
  269. package/dist/ui/src/components/Interaction/types.d.ts +6 -0
  270. package/dist/ui/src/components/Interaction/types.d.ts.map +1 -0
  271. package/dist/ui/src/components/Loading/Loading.d.ts +4 -0
  272. package/dist/ui/src/components/Loading/Loading.d.ts.map +1 -0
  273. package/dist/ui/src/components/Loading/index.d.ts +3 -0
  274. package/dist/ui/src/components/Loading/index.d.ts.map +1 -0
  275. package/dist/ui/src/components/Loading/types.d.ts +8 -0
  276. package/dist/ui/src/components/Loading/types.d.ts.map +1 -0
  277. package/dist/ui/src/components/Menu/Menu.d.ts +12 -0
  278. package/dist/ui/src/components/Menu/Menu.d.ts.map +1 -0
  279. package/dist/ui/src/components/Menu/index.d.ts +3 -0
  280. package/dist/ui/src/components/Menu/index.d.ts.map +1 -0
  281. package/dist/ui/src/components/Menu/types.d.ts +52 -0
  282. package/dist/ui/src/components/Menu/types.d.ts.map +1 -0
  283. package/dist/ui/src/components/Modal/Modal.d.ts +19 -0
  284. package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -0
  285. package/dist/ui/src/components/Modal/contexts.d.ts +33 -0
  286. package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -0
  287. package/dist/ui/src/components/Modal/index.d.ts +3 -0
  288. package/dist/ui/src/components/Modal/index.d.ts.map +1 -0
  289. package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts +33 -0
  290. package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -0
  291. package/dist/ui/src/components/Modal/snapPoints.d.ts +38 -0
  292. package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -0
  293. package/dist/ui/src/components/Modal/types.d.ts +117 -0
  294. package/dist/ui/src/components/Modal/types.d.ts.map +1 -0
  295. package/dist/ui/src/components/Modal/useControllableState.d.ts +6 -0
  296. package/dist/ui/src/components/Modal/useControllableState.d.ts.map +1 -0
  297. package/dist/ui/src/components/Modal/useElementSize.d.ts +6 -0
  298. package/dist/ui/src/components/Modal/useElementSize.d.ts.map +1 -0
  299. package/dist/ui/src/components/Modal/useModalDrag.d.ts +37 -0
  300. package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -0
  301. package/dist/ui/src/components/Modal/useModalPlacement.d.ts +3 -0
  302. package/dist/ui/src/components/Modal/useModalPlacement.d.ts.map +1 -0
  303. package/dist/ui/src/components/Modal/useModalStackDepth.d.ts +2 -0
  304. package/dist/ui/src/components/Modal/useModalStackDepth.d.ts.map +1 -0
  305. package/dist/ui/src/components/Radio/Radio.d.ts +4 -0
  306. package/dist/ui/src/components/Radio/Radio.d.ts.map +1 -0
  307. package/dist/ui/src/components/Radio/index.d.ts +3 -0
  308. package/dist/ui/src/components/Radio/index.d.ts.map +1 -0
  309. package/dist/ui/src/components/Radio/types.d.ts +10 -0
  310. package/dist/ui/src/components/Radio/types.d.ts.map +1 -0
  311. package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts +6 -0
  312. package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -0
  313. package/dist/ui/src/components/ScrollArea/contexts.d.ts +3 -0
  314. package/dist/ui/src/components/ScrollArea/contexts.d.ts.map +1 -0
  315. package/dist/ui/src/components/ScrollArea/index.d.ts +4 -0
  316. package/dist/ui/src/components/ScrollArea/index.d.ts.map +1 -0
  317. package/dist/ui/src/components/ScrollArea/types.d.ts +21 -0
  318. package/dist/ui/src/components/ScrollArea/types.d.ts.map +1 -0
  319. package/dist/ui/src/components/SectionHeader/SectionHeader.d.ts +4 -0
  320. package/dist/ui/src/components/SectionHeader/SectionHeader.d.ts.map +1 -0
  321. package/dist/ui/src/components/SectionHeader/index.d.ts +3 -0
  322. package/dist/ui/src/components/SectionHeader/index.d.ts.map +1 -0
  323. package/dist/ui/src/components/SectionHeader/types.d.ts +13 -0
  324. package/dist/ui/src/components/SectionHeader/types.d.ts.map +1 -0
  325. package/dist/ui/src/components/Select/Select.d.ts +4 -0
  326. package/dist/ui/src/components/Select/Select.d.ts.map +1 -0
  327. package/dist/ui/src/components/Select/SelectContent.d.ts +4 -0
  328. package/dist/ui/src/components/Select/SelectContent.d.ts.map +1 -0
  329. package/dist/ui/src/components/Select/index.d.ts +4 -0
  330. package/dist/ui/src/components/Select/index.d.ts.map +1 -0
  331. package/dist/ui/src/components/Select/types.d.ts +12 -0
  332. package/dist/ui/src/components/Select/types.d.ts.map +1 -0
  333. package/dist/ui/src/components/SvgIcon/SvgIcon.d.ts +2 -0
  334. package/dist/ui/src/components/SvgIcon/SvgIcon.d.ts.map +1 -0
  335. package/dist/ui/src/components/SvgIcon/index.d.ts +3 -0
  336. package/dist/ui/src/components/SvgIcon/index.d.ts.map +1 -0
  337. package/dist/ui/src/components/SvgIcon/types.d.ts +2 -0
  338. package/dist/ui/src/components/SvgIcon/types.d.ts.map +1 -0
  339. package/dist/ui/src/components/Switch/Switch.d.ts +4 -0
  340. package/dist/ui/src/components/Switch/Switch.d.ts.map +1 -0
  341. package/dist/ui/src/components/Switch/index.d.ts +3 -0
  342. package/dist/ui/src/components/Switch/index.d.ts.map +1 -0
  343. package/dist/ui/src/components/Switch/types.d.ts +8 -0
  344. package/dist/ui/src/components/Switch/types.d.ts.map +1 -0
  345. package/dist/ui/src/components/TextArea/TextArea.d.ts +4 -0
  346. package/dist/ui/src/components/TextArea/TextArea.d.ts.map +1 -0
  347. package/dist/ui/src/components/TextArea/TextAreaContent.d.ts +4 -0
  348. package/dist/ui/src/components/TextArea/TextAreaContent.d.ts.map +1 -0
  349. package/dist/ui/src/components/TextArea/index.d.ts +4 -0
  350. package/dist/ui/src/components/TextArea/index.d.ts.map +1 -0
  351. package/dist/ui/src/components/TextArea/types.d.ts +15 -0
  352. package/dist/ui/src/components/TextArea/types.d.ts.map +1 -0
  353. package/dist/ui/src/components/TextButton/TextButton.d.ts +4 -0
  354. package/dist/ui/src/components/TextButton/TextButton.d.ts.map +1 -0
  355. package/dist/ui/src/components/TextButton/index.d.ts +3 -0
  356. package/dist/ui/src/components/TextButton/index.d.ts.map +1 -0
  357. package/dist/ui/src/components/TextButton/types.d.ts +25 -0
  358. package/dist/ui/src/components/TextButton/types.d.ts.map +1 -0
  359. package/dist/ui/src/components/TextInput/TextInput.d.ts +4 -0
  360. package/dist/ui/src/components/TextInput/TextInput.d.ts.map +1 -0
  361. package/dist/ui/src/components/TextInput/TextInputContent.d.ts +4 -0
  362. package/dist/ui/src/components/TextInput/TextInputContent.d.ts.map +1 -0
  363. package/dist/ui/src/components/TextInput/index.d.ts +4 -0
  364. package/dist/ui/src/components/TextInput/index.d.ts.map +1 -0
  365. package/dist/ui/src/components/TextInput/types.d.ts +12 -0
  366. package/dist/ui/src/components/TextInput/types.d.ts.map +1 -0
  367. package/dist/ui/src/components/Tooltip/Tooltip.d.ts +8 -0
  368. package/dist/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -0
  369. package/dist/ui/src/components/Tooltip/index.d.ts +3 -0
  370. package/dist/ui/src/components/Tooltip/index.d.ts.map +1 -0
  371. package/dist/ui/src/components/Tooltip/types.d.ts +21 -0
  372. package/dist/ui/src/components/Tooltip/types.d.ts.map +1 -0
  373. package/dist/ui/src/components/internal/slot.d.ts +3 -0
  374. package/dist/ui/src/components/internal/slot.d.ts.map +1 -0
  375. package/dist/ui/src/components/types.d.ts +2 -0
  376. package/dist/ui/src/components/types.d.ts.map +1 -0
  377. package/dist/ui/src/index.d.ts +59 -0
  378. package/dist/ui/src/index.d.ts.map +1 -0
  379. package/dist/ui/src/react/motion/index.d.ts +27 -0
  380. package/dist/ui/src/react/motion/index.d.ts.map +1 -0
  381. package/dist/ui/src/react/spring/index.d.ts +33 -0
  382. package/dist/ui/src/react/spring/index.d.ts.map +1 -0
  383. package/dist/ui/src/utils/breakpoints.d.ts +6 -0
  384. package/dist/ui/src/utils/breakpoints.d.ts.map +1 -0
  385. package/dist/ui/src/utils/css.d.ts +3 -0
  386. package/dist/ui/src/utils/css.d.ts.map +1 -0
  387. package/dist/ui/src/utils/motion.d.ts +80 -0
  388. package/dist/ui/src/utils/motion.d.ts.map +1 -0
  389. package/dist/ui/src/utils/spring/animator.d.ts +3 -0
  390. package/dist/ui/src/utils/spring/animator.d.ts.map +1 -0
  391. package/dist/ui/src/utils/spring/constants.d.ts +13 -0
  392. package/dist/ui/src/utils/spring/constants.d.ts.map +1 -0
  393. package/dist/ui/src/utils/spring/format.d.ts +5 -0
  394. package/dist/ui/src/utils/spring/format.d.ts.map +1 -0
  395. package/dist/ui/src/utils/spring/model.d.ts +18 -0
  396. package/dist/ui/src/utils/spring/model.d.ts.map +1 -0
  397. package/dist/ui/src/utils/spring/solver.d.ts +6 -0
  398. package/dist/ui/src/utils/spring/solver.d.ts.map +1 -0
  399. package/dist/ui/src/utils/spring/static.d.ts +5 -0
  400. package/dist/ui/src/utils/spring/static.d.ts.map +1 -0
  401. package/dist/ui/src/utils/spring/types.d.ts +141 -0
  402. package/dist/ui/src/utils/spring/types.d.ts.map +1 -0
  403. package/dist/ui/src/utils/spring/validation.d.ts +5 -0
  404. package/dist/ui/src/utils/spring/validation.d.ts.map +1 -0
  405. package/dist/ui/src/utils/spring/value.d.ts +5 -0
  406. package/dist/ui/src/utils/spring/value.d.ts.map +1 -0
  407. package/dist/ui/src/utils/spring.d.ts +12 -0
  408. package/dist/ui/src/utils/spring.d.ts.map +1 -0
  409. package/dist/utils/breakpoints.d.ts +2 -0
  410. package/dist/utils/breakpoints.js +26 -0
  411. package/dist/utils/css.js +7 -0
  412. package/dist/utils/motion.d.ts +2 -0
  413. package/dist/utils/motion.js +343 -0
  414. package/dist/utils/spring/animator.js +179 -0
  415. package/dist/utils/spring/constants.js +15 -0
  416. package/dist/utils/spring/format.js +10 -0
  417. package/dist/utils/spring/model.js +120 -0
  418. package/dist/utils/spring/solver.js +78 -0
  419. package/dist/utils/spring/static.js +76 -0
  420. package/dist/utils/spring/validation.js +19 -0
  421. package/dist/utils/spring/value.js +65 -0
  422. package/dist/utils/spring.d.ts +2 -0
  423. package/dist/utils/spring.js +14 -0
  424. package/dist/vscode/oc-ui-vars.css +468 -0
  425. package/package.json +128 -0
  426. package/src/scss/foundations/_color.config.scss +14 -0
  427. package/src/scss/foundations/_responsive.config.scss +6 -0
  428. package/src/scss/foundations/atomic.scss +24 -0
  429. package/src/scss/foundations/breakpoint.scss +3 -0
  430. package/src/scss/foundations/color-theme.test.ts +99 -0
  431. package/src/scss/foundations/color.global.scss +210 -0
  432. package/src/scss/foundations/color.theme.dark.scss +80 -0
  433. package/src/scss/foundations/color.theme.light.scss +72 -0
  434. package/src/scss/foundations/motion.scss +46 -0
  435. package/src/scss/foundations/reset.scss +129 -0
  436. package/src/scss/foundations/responsive.test.ts +294 -0
  437. package/src/scss/foundations/space.scss +206 -0
  438. package/src/scss/foundations/typo.scss +381 -0
  439. package/src/scss/foundations/zindex.scss +12 -0
  440. package/src/scss/index.scss +18 -0
  441. package/src/scss/mixins/_breakpoint.scss +115 -0
  442. package/src/scss/mixins/_color.scss +29 -0
  443. package/src/scss/mixins/_color.test.ts +35 -0
  444. package/src/scss/mixins/_element.scss +52 -0
  445. package/src/scss/mixins/_element.test.ts +44 -0
  446. package/src/scss/mixins/_motion.scss +450 -0
  447. package/src/scss/mixins/_motion.test.ts +336 -0
  448. package/src/scss/mixins/_responsive.scss +366 -0
  449. package/src/scss/mixins/_spring.scss +396 -0
  450. package/src/scss/mixins/_spring.test.ts +128 -0
  451. package/src/scss/mixins/_typo.scss +67 -0
  452. package/src/scss/mixins/_typo.test.ts +28 -0
  453. package/src/scss/mixins/_utils.scss +26 -0
  454. package/src/scss/spring.scss +1 -0
@@ -0,0 +1,343 @@
1
+ import { ocSpring as M } from "./spring.js";
2
+ const p = [
3
+ "feedback",
4
+ "reject",
5
+ "reveal",
6
+ "move",
7
+ "gesture",
8
+ "ambient"
9
+ ], k = [
10
+ "change",
11
+ "enter",
12
+ "exit",
13
+ "settle",
14
+ "loop"
15
+ ], E = ["quick", "normal", "slow"], x = [
16
+ "auto",
17
+ "preserve",
18
+ "fade",
19
+ "static",
20
+ "feedback"
21
+ ], o = {
22
+ durationScale: 1,
23
+ durationScaleReduced: 0.75,
24
+ durationScalePreserve: 1,
25
+ paceScale: {
26
+ quick: 0.75,
27
+ normal: 1,
28
+ slow: 1.35
29
+ },
30
+ durationByIntent: {
31
+ feedback: 0.2,
32
+ reject: 0.32,
33
+ reveal: 0.3,
34
+ move: 0.3,
35
+ gesture: 0.2,
36
+ ambient: 1.2
37
+ },
38
+ durationByPhase: {
39
+ reveal: {
40
+ exit: 0.125
41
+ },
42
+ gesture: {
43
+ settle: 0.52
44
+ }
45
+ },
46
+ timingByIntent: {
47
+ feedback: "ease",
48
+ reject: "ease",
49
+ reveal: "ease",
50
+ move: "cubic-bezier(0.32, 0.72, 0, 1)",
51
+ gesture: "ease",
52
+ ambient: "linear"
53
+ },
54
+ timingByPhase: {
55
+ reveal: {
56
+ exit: "ease-in"
57
+ },
58
+ gesture: {
59
+ settle: "cubic-bezier(0.32, 0.72, 0, 1)"
60
+ }
61
+ }
62
+ }, q = o, A = {
63
+ feedback: "feedback",
64
+ reject: "feedback",
65
+ reveal: "fade",
66
+ move: "static",
67
+ gesture: "feedback",
68
+ ambient: "static"
69
+ }, C = /* @__PURE__ */ new Set([
70
+ "opacity",
71
+ "color",
72
+ "background-color",
73
+ "border-color",
74
+ "box-shadow",
75
+ "outline-color",
76
+ "fill",
77
+ "stroke"
78
+ ]), L = {
79
+ reveal: { preset: "smooth" },
80
+ move: { preset: "smooth" }
81
+ }, V = {
82
+ reject: {
83
+ change: { preset: "smooth" },
84
+ enter: { preset: "smooth" }
85
+ },
86
+ feedback: {
87
+ settle: { preset: "snappy" }
88
+ },
89
+ gesture: {
90
+ settle: { preset: "snappy" }
91
+ },
92
+ reveal: {
93
+ change: {
94
+ preset: "snappy",
95
+ propertyPreset: { opacity: "smooth", transform: "snappy" },
96
+ propertyExtraBounce: { transform: 0.1 }
97
+ },
98
+ enter: {
99
+ preset: "snappy",
100
+ propertyPreset: { opacity: "smooth", transform: "snappy" },
101
+ propertyExtraBounce: { transform: 0.1 }
102
+ }
103
+ },
104
+ ambient: {
105
+ loop: { preset: "smooth" }
106
+ }
107
+ }, Y = V, U = (t, e) => e.includes(t), m = (t, e, n) => {
108
+ if (!U(e, n))
109
+ throw new Error(`Unknown oc-motion ${t}: ${e}.`);
110
+ return e;
111
+ }, $ = (t) => {
112
+ if (!Number.isFinite(t) || t < 0)
113
+ throw new Error("oc-motion durationScale must be a non-negative number.");
114
+ return t;
115
+ }, l = (t, e) => {
116
+ const n = Number.parseFloat(t.trim());
117
+ return Number.isFinite(n) ? n : e;
118
+ }, c = (t, e) => {
119
+ const i = t.trim().match(/^(-?\d*\.?\d+)(ms|s)?$/);
120
+ if (!i) return e;
121
+ const a = Number.parseFloat(i[1]);
122
+ return !Number.isFinite(a) || a < 0 ? e : i[2] === "ms" ? a / 1e3 : a;
123
+ }, r = (t, e) => typeof t?.getPropertyValue == "function" ? t.getPropertyValue(e).trim() : "", h = (t, e) => {
124
+ const n = { ...t };
125
+ for (const i of p) {
126
+ const a = e?.[i];
127
+ a && (n[i] = {
128
+ ...t[i],
129
+ ...a
130
+ });
131
+ }
132
+ return n;
133
+ }, z = (t) => ({
134
+ durationScale: t?.durationScale ?? o.durationScale,
135
+ durationScaleReduced: t?.durationScaleReduced ?? o.durationScaleReduced,
136
+ durationScalePreserve: t?.durationScalePreserve ?? o.durationScalePreserve,
137
+ paceScale: {
138
+ ...o.paceScale,
139
+ ...t?.paceScale
140
+ },
141
+ durationByIntent: {
142
+ ...o.durationByIntent,
143
+ ...t?.durationByIntent
144
+ },
145
+ durationByPhase: h(
146
+ o.durationByPhase,
147
+ t?.durationByPhase
148
+ ),
149
+ timingByIntent: {
150
+ ...o.timingByIntent,
151
+ ...t?.timingByIntent
152
+ },
153
+ timingByPhase: h(
154
+ o.timingByPhase,
155
+ t?.timingByPhase
156
+ )
157
+ });
158
+ function O(t) {
159
+ const e = t && typeof getComputedStyle == "function" ? getComputedStyle(t) : null;
160
+ return {
161
+ durationScale: l(
162
+ r(e, "--oc-motion-duration-scale"),
163
+ o.durationScale
164
+ ),
165
+ durationScaleReduced: l(
166
+ r(e, "--oc-motion-duration-scale-reduced"),
167
+ o.durationScaleReduced
168
+ ),
169
+ durationScalePreserve: l(
170
+ r(e, "--oc-motion-duration-scale-preserve"),
171
+ o.durationScalePreserve
172
+ ),
173
+ paceScale: {
174
+ quick: l(
175
+ r(e, "--oc-motion-pace-quick"),
176
+ o.paceScale.quick
177
+ ),
178
+ normal: l(
179
+ r(e, "--oc-motion-pace-normal"),
180
+ o.paceScale.normal
181
+ ),
182
+ slow: l(
183
+ r(e, "--oc-motion-pace-slow"),
184
+ o.paceScale.slow
185
+ )
186
+ },
187
+ durationByIntent: {
188
+ feedback: c(
189
+ r(e, "--oc-motion-duration-feedback"),
190
+ o.durationByIntent.feedback
191
+ ),
192
+ reject: c(
193
+ r(e, "--oc-motion-duration-reject"),
194
+ o.durationByIntent.reject
195
+ ),
196
+ reveal: c(
197
+ r(e, "--oc-motion-duration-reveal"),
198
+ o.durationByIntent.reveal
199
+ ),
200
+ move: c(
201
+ r(e, "--oc-motion-duration-move"),
202
+ o.durationByIntent.move
203
+ ),
204
+ gesture: c(
205
+ r(e, "--oc-motion-duration-gesture"),
206
+ o.durationByIntent.gesture
207
+ ),
208
+ ambient: c(
209
+ r(e, "--oc-motion-duration-ambient"),
210
+ o.durationByIntent.ambient
211
+ )
212
+ },
213
+ durationByPhase: {
214
+ reveal: {
215
+ exit: c(
216
+ r(e, "--oc-motion-duration-reveal-exit"),
217
+ o.durationByPhase.reveal?.exit ?? o.durationByIntent.reveal
218
+ )
219
+ },
220
+ gesture: {
221
+ settle: c(
222
+ r(e, "--oc-motion-duration-gesture-settle"),
223
+ o.durationByPhase.gesture?.settle ?? o.durationByIntent.gesture
224
+ )
225
+ }
226
+ },
227
+ timingByIntent: {
228
+ feedback: r(e, "--oc-motion-timing-feedback") || o.timingByIntent.feedback,
229
+ reject: r(e, "--oc-motion-timing-reject") || o.timingByIntent.reject,
230
+ reveal: r(e, "--oc-motion-timing-reveal") || o.timingByIntent.reveal,
231
+ move: r(e, "--oc-motion-timing-move") || o.timingByIntent.move,
232
+ gesture: r(e, "--oc-motion-timing-gesture") || o.timingByIntent.gesture,
233
+ ambient: r(e, "--oc-motion-timing-ambient") || o.timingByIntent.ambient
234
+ },
235
+ timingByPhase: {
236
+ reveal: {
237
+ exit: r(e, "--oc-motion-timing-reveal-exit") || o.timingByPhase.reveal?.exit
238
+ },
239
+ gesture: {
240
+ settle: r(e, "--oc-motion-timing-gesture-settle") || o.timingByPhase.gesture?.settle
241
+ }
242
+ }
243
+ };
244
+ }
245
+ function R(t, e = "auto") {
246
+ return m("intent", t, p), m("reduced policy", e, x), e === "auto" ? A[t] : e;
247
+ }
248
+ function T(t) {
249
+ return C.has(t);
250
+ }
251
+ function N({
252
+ property: t,
253
+ reducedMotion: e,
254
+ reducedPolicy: n
255
+ }) {
256
+ return !e || n === "preserve" ? !0 : n === "static" || t === void 0 ? !1 : T(t);
257
+ }
258
+ const I = (t, e, n, i) => t[e]?.[n] ?? i, G = (t, e, n) => {
259
+ const a = Y[t]?.[e] ?? L[t];
260
+ if (a === void 0) return null;
261
+ const u = n === void 0 ? void 0 : a.propertyExtraBounce?.[n];
262
+ return {
263
+ preset: (n === void 0 ? void 0 : a.propertyPreset?.[n]) ?? a.preset,
264
+ extraBounce: u ?? a.extraBounce
265
+ };
266
+ };
267
+ function H({
268
+ intent: t,
269
+ phase: e = "change",
270
+ pace: n = "normal",
271
+ durationScale: i = 1,
272
+ reduced: a = "auto",
273
+ reducedMotion: u = !1,
274
+ property: d,
275
+ element: F,
276
+ tokens: _
277
+ }) {
278
+ m("intent", t, p), m("phase", e, k), m("pace", n, E);
279
+ const v = $(i), s = z(
280
+ _ ?? O(F)
281
+ ), g = R(t, a), P = N({
282
+ property: d,
283
+ reducedMotion: u,
284
+ reducedPolicy: g
285
+ }), B = u && g === "preserve" ? s.durationScalePreserve : u ? s.durationScaleReduced : s.durationScale, S = I(
286
+ s.durationByPhase,
287
+ t,
288
+ e,
289
+ s.durationByIntent[t]
290
+ ), b = s.paceScale[n], y = P ? S * B * b * v : 0, w = I(
291
+ s.timingByPhase,
292
+ t,
293
+ e,
294
+ s.timingByIntent[t]
295
+ ), f = G(t, e, d), j = f !== null, D = y > 0 ? y : S;
296
+ return {
297
+ intent: t,
298
+ phase: e,
299
+ pace: n,
300
+ reduced: a,
301
+ reducedPolicy: g,
302
+ reducedMotion: u,
303
+ property: d,
304
+ durationScale: v,
305
+ durationScaleToken: B,
306
+ paceScale: b,
307
+ durationSeconds: y,
308
+ timingFunction: w,
309
+ animate: P,
310
+ springBacked: j,
311
+ spring: M[f?.preset ?? "smooth"]({
312
+ duration: D,
313
+ extraBounce: f?.extraBounce
314
+ })
315
+ };
316
+ }
317
+ const J = {
318
+ intents: p,
319
+ phases: k,
320
+ paces: E,
321
+ reducedPolicies: x,
322
+ defaultTokens: q,
323
+ parseDuration: c,
324
+ readTokens: O,
325
+ resolve: H,
326
+ resolveReducedPolicy: R,
327
+ isFeedbackSafeProperty: T,
328
+ shouldAnimateProperty: N
329
+ };
330
+ export {
331
+ T as isOcMotionFeedbackSafeProperty,
332
+ J as ocMotion,
333
+ q as ocMotionDefaultTokens,
334
+ p as ocMotionIntents,
335
+ E as ocMotionPaces,
336
+ k as ocMotionPhases,
337
+ x as ocMotionReducedPolicies,
338
+ c as parseOcMotionDuration,
339
+ O as readOcMotionTokens,
340
+ H as resolveOcMotion,
341
+ R as resolveOcMotionReducedPolicy,
342
+ N as shouldAnimateOcMotionProperty
343
+ };
@@ -0,0 +1,179 @@
1
+ import { DEFAULT_EPSILON as d, DEFAULT_SETTLING_STEP as y, DEFAULT_STABILITY_WINDOW as V, DEFAULT_RUNTIME_BLEND_STEP as S } from "./constants.js";
2
+ import { resolveRuntimeSpring as p, blendRuntimeSprings as A } from "./model.js";
3
+ import { resolveSpringState as B } from "./solver.js";
4
+ import { createValueAdapter as E, createZeroVector as h, cloneVector as T } from "./value.js";
5
+ import { assertPositive as g, assertNonNegative as u, assertFinite as w } from "./validation.js";
6
+ const D = () => {
7
+ const s = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() / 1e3 : Date.now() / 1e3;
8
+ return {
9
+ now: s,
10
+ request: (t) => typeof requestAnimationFrame == "function" ? requestAnimationFrame((e) => t(e / 1e3)) : setTimeout(() => t(s()), 1e3 / 60),
11
+ cancel: (t) => {
12
+ typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(t) : clearTimeout(t);
13
+ }
14
+ };
15
+ };
16
+ class b {
17
+ adapter;
18
+ scheduler;
19
+ onUpdate;
20
+ onComplete;
21
+ epsilon;
22
+ velocityEpsilon;
23
+ stabilityWindow;
24
+ defaultBlendDuration;
25
+ currentValue;
26
+ currentVelocity;
27
+ targetValue;
28
+ spring;
29
+ springBlend = null;
30
+ frameHandle = null;
31
+ running = !1;
32
+ lastTime;
33
+ restStartedAt = null;
34
+ constructor(t) {
35
+ this.adapter = E(t.value), this.scheduler = t.scheduler ?? D(), this.onUpdate = t.onUpdate, this.onComplete = t.onComplete, this.currentValue = this.adapter.toVector(t.value, "value"), this.targetValue = this.adapter.toVector(
36
+ t.target ?? t.value,
37
+ "target"
38
+ ), this.currentVelocity = t.velocity === void 0 ? h(this.adapter.dimension) : this.adapter.toVector(t.velocity, "velocity"), this.spring = p(t.spring), this.epsilon = t.epsilon ?? d, this.velocityEpsilon = t.velocityEpsilon ?? d / y, this.stabilityWindow = t.stabilityWindow ?? V, this.defaultBlendDuration = t.blendDuration ?? 0, this.lastTime = this.scheduler.now(), g("epsilon", this.epsilon), g("velocityEpsilon", this.velocityEpsilon), u("stabilityWindow", this.stabilityWindow), u("blendDuration", this.defaultBlendDuration), t.autoplay !== !1 && !this.isAtRest() && this.start();
39
+ }
40
+ get value() {
41
+ return this.adapter.fromVector(this.currentValue);
42
+ }
43
+ get target() {
44
+ return this.adapter.fromVector(this.targetValue);
45
+ }
46
+ get velocity() {
47
+ return this.adapter.fromVector(this.currentVelocity);
48
+ }
49
+ get isRunning() {
50
+ return this.running;
51
+ }
52
+ start = () => {
53
+ this.running || this.isAtRest() || (this.running = !0, this.lastTime = this.scheduler.now(), this.requestNextFrame());
54
+ };
55
+ stop = () => {
56
+ this.running = !1, this.frameHandle !== null && (this.scheduler.cancel(this.frameHandle), this.frameHandle = null);
57
+ };
58
+ destroy = () => {
59
+ this.stop();
60
+ };
61
+ sample = (t = this.scheduler.now()) => {
62
+ w("time", t), t > this.lastTime && (this.advance(t), this.lastTime = t);
63
+ const e = this.resolveRest(t);
64
+ return this.createFrame(t, e);
65
+ };
66
+ setTarget = (t, e = {}) => {
67
+ const r = this.scheduler.now();
68
+ this.sample(r), this.targetValue = this.adapter.toVector(t, "target"), e.velocity !== void 0 && (this.currentVelocity = this.adapter.toVector(
69
+ e.velocity,
70
+ "velocity"
71
+ )), e.spring !== void 0 && this.setRuntimeSpring(e.spring, r, e.blendDuration), this.restStartedAt = null, e.start !== !1 && this.start();
72
+ };
73
+ setSpring = (t, e = {}) => {
74
+ const r = this.scheduler.now();
75
+ this.sample(r), this.setRuntimeSpring(t, r, e.blendDuration), this.restStartedAt = null, e.start !== !1 && this.start();
76
+ };
77
+ jumpTo = (t, e = {}) => {
78
+ this.stop(), this.currentValue = this.adapter.toVector(t, "value"), this.targetValue = this.adapter.toVector(e.target ?? t, "target"), this.currentVelocity = e.velocity === void 0 ? h(this.adapter.dimension) : this.adapter.toVector(e.velocity, "velocity"), this.lastTime = this.scheduler.now(), this.restStartedAt = null, e.start !== !1 && this.start();
79
+ };
80
+ requestNextFrame() {
81
+ this.frameHandle = this.scheduler.request((t) => {
82
+ if (this.frameHandle = null, !this.running)
83
+ return;
84
+ const e = this.sample(t);
85
+ if (e.settled && (this.running = !1), this.onUpdate(e.value, e), e.settled) {
86
+ this.onComplete?.(e.value, e);
87
+ return;
88
+ }
89
+ this.running && this.requestNextFrame();
90
+ });
91
+ }
92
+ advance(t) {
93
+ let e = this.lastTime;
94
+ for (; e < t; ) {
95
+ const r = this.resolveAdvanceSegmentEnd(
96
+ e,
97
+ t
98
+ ), i = this.resolveStepCount(e, r);
99
+ this.advanceSegment(e, r, i), e = r;
100
+ }
101
+ }
102
+ advanceSegment(t, e, r) {
103
+ const i = e - t;
104
+ let o = t;
105
+ for (let n = 1; n <= r; n += 1) {
106
+ const a = t + i * n / r, f = a - o, m = this.resolveEffectiveSpring(a);
107
+ this.currentValue = this.currentValue.map((v, l) => {
108
+ const c = B(
109
+ f,
110
+ m.parameters,
111
+ v,
112
+ this.targetValue[l],
113
+ this.currentVelocity[l]
114
+ );
115
+ return this.currentVelocity[l] = c.velocity, c.value;
116
+ }), o = a;
117
+ }
118
+ }
119
+ resolveAdvanceSegmentEnd(t, e) {
120
+ if (this.springBlend === null)
121
+ return e;
122
+ const r = this.springBlend.startedAt + this.springBlend.duration;
123
+ return t < r && e > r ? r : e;
124
+ }
125
+ resolveStepCount(t, e) {
126
+ if (this.springBlend === null)
127
+ return 1;
128
+ const r = this.springBlend.startedAt + this.springBlend.duration;
129
+ if (t >= r || e <= this.springBlend.startedAt)
130
+ return 1;
131
+ const i = Math.min(e, r) - Math.max(t, this.springBlend.startedAt);
132
+ return Math.max(1, Math.ceil(i / S));
133
+ }
134
+ resolveEffectiveSpring(t) {
135
+ if (this.springBlend === null)
136
+ return this.spring;
137
+ const e = this.springBlend.startedAt + this.springBlend.duration;
138
+ return t >= e ? (this.spring = this.springBlend.to, this.springBlend = null, this.spring) : A(
139
+ this.springBlend.from,
140
+ this.springBlend.to,
141
+ (t - this.springBlend.startedAt) / this.springBlend.duration
142
+ );
143
+ }
144
+ setRuntimeSpring(t, e, r = this.defaultBlendDuration) {
145
+ u("blendDuration", r);
146
+ const i = p(t);
147
+ if (r === 0) {
148
+ this.spring = i, this.springBlend = null;
149
+ return;
150
+ }
151
+ this.springBlend = {
152
+ from: this.resolveEffectiveSpring(e),
153
+ to: i,
154
+ startedAt: e,
155
+ duration: r
156
+ };
157
+ }
158
+ isAtRest() {
159
+ return this.currentValue.every(
160
+ (t, e) => Math.abs(t - this.targetValue[e]) < this.epsilon && Math.abs(this.currentVelocity[e]) < this.velocityEpsilon
161
+ );
162
+ }
163
+ resolveRest(t) {
164
+ return this.isAtRest() ? (this.restStartedAt ??= t, t - this.restStartedAt < this.stabilityWindow ? !1 : (this.currentValue = T(this.targetValue), this.currentVelocity = h(this.adapter.dimension), !0)) : (this.restStartedAt = null, !1);
165
+ }
166
+ createFrame(t, e) {
167
+ return {
168
+ value: this.value,
169
+ velocity: this.velocity,
170
+ target: this.target,
171
+ time: t,
172
+ settled: e
173
+ };
174
+ }
175
+ }
176
+ const W = (s) => new b(s);
177
+ export {
178
+ W as createSpringAnimator
179
+ };
@@ -0,0 +1,15 @@
1
+ const E = {
2
+ smooth: 0,
3
+ snappy: 0.15,
4
+ bouncy: 0.3
5
+ }, T = 1e-4, _ = 0.1, A = 1e-3, L = 20, o = 64, S = 240, n = 1 / 60;
6
+ export {
7
+ T as DEFAULT_EPSILON,
8
+ L as DEFAULT_MAX_DURATION,
9
+ S as DEFAULT_MAX_SAMPLES,
10
+ n as DEFAULT_RUNTIME_BLEND_STEP,
11
+ o as DEFAULT_SAMPLES_PER_RESPONSE,
12
+ A as DEFAULT_SETTLING_STEP,
13
+ _ as DEFAULT_STABILITY_WINDOW,
14
+ E as PRESET_BOUNCE
15
+ };
@@ -0,0 +1,10 @@
1
+ const n = (o, t) => {
2
+ const r = Number(o.toFixed(t));
3
+ return Object.is(r, -0) ? 0 : r;
4
+ }, e = (o, t) => String(n(o, t)), s = (o) => `${e(o, 4)}s`, c = (o) => typeof o == "number" ? s(o) : o;
5
+ export {
6
+ c as formatDelay,
7
+ e as formatNumber,
8
+ s as formatSeconds,
9
+ n as round
10
+ };
@@ -0,0 +1,120 @@
1
+ import { PRESET_BOUNCE as m } from "./constants.js";
2
+ import { assertPositive as c, assertFinite as p, validateBounce as D } from "./validation.js";
3
+ const f = (e) => e > 0 ? 1 - e : 1 / (e + 1), l = (e, t) => {
4
+ c("duration", e), D(t);
5
+ const a = 1, n = 4 * Math.PI * Math.PI * a / (e * e), i = f(t) * 2 * Math.sqrt(a * n);
6
+ return { mass: a, stiffness: n, damping: i };
7
+ }, v = ({
8
+ mass: e,
9
+ stiffness: t,
10
+ damping: a
11
+ }) => a / (2 * Math.sqrt(t * e)), M = ({
12
+ mass: e,
13
+ stiffness: t
14
+ }) => 2 * Math.PI / Math.sqrt(t / e), u = ({
15
+ parameters: e,
16
+ initialVelocity: t,
17
+ bounce: a,
18
+ perceptualDuration: n
19
+ }) => (c("mass", e.mass), c("stiffness", e.stiffness), c("damping", e.damping), p("initialVelocity", t), {
20
+ parameters: e,
21
+ initialVelocity: t,
22
+ bounce: a,
23
+ perceptualDuration: n,
24
+ response: M(e),
25
+ dampingRatio: v(e)
26
+ }), d = (e, t, a) => u({
27
+ parameters: l(e, t),
28
+ initialVelocity: a,
29
+ bounce: t,
30
+ perceptualDuration: e
31
+ }), g = (e, t) => {
32
+ const a = t.extraBounce ?? 0;
33
+ return p("extraBounce", a), d(
34
+ t.duration,
35
+ m[e] + a,
36
+ t.initialVelocity ?? 0
37
+ );
38
+ }, b = (e) => d(
39
+ e.duration,
40
+ e.bounce,
41
+ e.initialVelocity ?? 0
42
+ ), R = (e) => u({
43
+ parameters: {
44
+ mass: e.mass,
45
+ stiffness: e.stiffness,
46
+ damping: e.damping
47
+ },
48
+ initialVelocity: e.initialVelocity ?? 0
49
+ }), h = (e) => "settlingDurationSeconds" in e && typeof e.transition == "function", r = ({
50
+ parameters: e,
51
+ bounce: t,
52
+ perceptualDuration: a
53
+ }) => ({
54
+ parameters: e,
55
+ bounce: t,
56
+ perceptualDuration: a
57
+ }), x = (e) => h(e) ? r(
58
+ u({
59
+ parameters: {
60
+ mass: e.mass,
61
+ stiffness: e.stiffness,
62
+ damping: e.damping
63
+ },
64
+ initialVelocity: 0,
65
+ bounce: e.bounce,
66
+ perceptualDuration: e.perceptualDurationSeconds
67
+ })
68
+ ) : "preset" in e ? r(g(e.preset, e)) : "mass" in e ? r(R(e)) : r(b(e)), s = (e, t, a) => e + (t - e) * a, P = (e, t, a) => Math.min(a, Math.max(t, e)), B = (e, t, a) => {
69
+ const n = P(a, 0, 1);
70
+ if (e.perceptualDuration !== void 0 && e.bounce !== void 0 && t.perceptualDuration !== void 0 && t.bounce !== void 0) {
71
+ const o = s(
72
+ e.perceptualDuration,
73
+ t.perceptualDuration,
74
+ n
75
+ ), i = s(e.bounce, t.bounce, n);
76
+ return {
77
+ parameters: l(o, i),
78
+ perceptualDuration: o,
79
+ bounce: i
80
+ };
81
+ }
82
+ return {
83
+ parameters: {
84
+ mass: s(
85
+ e.parameters.mass,
86
+ t.parameters.mass,
87
+ n
88
+ ),
89
+ stiffness: s(
90
+ e.parameters.stiffness,
91
+ t.parameters.stiffness,
92
+ n
93
+ ),
94
+ damping: s(
95
+ e.parameters.damping,
96
+ t.parameters.damping,
97
+ n
98
+ )
99
+ },
100
+ perceptualDuration: e.perceptualDuration !== void 0 && t.perceptualDuration !== void 0 ? s(
101
+ e.perceptualDuration,
102
+ t.perceptualDuration,
103
+ n
104
+ ) : void 0,
105
+ bounce: e.bounce !== void 0 && t.bounce !== void 0 ? s(e.bounce, t.bounce, n) : void 0
106
+ };
107
+ };
108
+ export {
109
+ B as blendRuntimeSprings,
110
+ d as createDurationModel,
111
+ u as createModel,
112
+ R as createPhysicalModel,
113
+ g as createPresetModel,
114
+ b as createSpringModel,
115
+ v as getDampingRatio,
116
+ M as getNaturalResponseDuration,
117
+ x as resolveRuntimeSpring,
118
+ f as toDampingRatio,
119
+ l as toDurationParameters
120
+ };