@mks2508/mks-ui 0.5.7 → 0.6.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 (271) hide show
  1. package/dist/react-ui/index.js +2 -2
  2. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +2 -0
  3. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -1
  4. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +1 -1
  5. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
  6. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +173 -43
  7. package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts.map +1 -1
  8. package/dist/react-ui/ui/Dialog/Dialog.styles.js +1 -0
  9. package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +20 -1
  10. package/dist/react-ui/ui/Dialog/Dialog.types.d.ts.map +1 -1
  11. package/dist/react-ui/ui/Dialog/index.d.ts +28 -7
  12. package/dist/react-ui/ui/Dialog/index.d.ts.map +1 -1
  13. package/dist/react-ui/ui/Dialog/index.js +32 -5
  14. package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-DOR3Ld-k.css → DynamicToggle-DJLwEkHr.css} +12 -19
  15. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +12 -20
  16. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -0
  17. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
  18. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +7 -1
  19. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +55 -31
  20. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
  21. package/dist/react-ui/ui/DynamicToggle/index.d.ts +9 -3
  22. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
  23. package/dist/react-ui/ui/DynamicToggle/index.js +47 -34
  24. package/dist/react-ui/ui/index.js +1 -1
  25. package/package.json +52 -13
  26. package/src/assets/react.svg +0 -1
  27. package/src/core/index.ts +0 -7
  28. package/src/core/types.ts +0 -82
  29. package/src/css.d.ts +0 -7
  30. package/src/index.css +0 -129
  31. package/src/index.ts +0 -29
  32. package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +0 -278
  33. package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +0 -97
  34. package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +0 -155
  35. package/src/react-ui/blocks/Terminal/Terminal.theme.ts +0 -80
  36. package/src/react-ui/blocks/Terminal/Terminal.types.ts +0 -438
  37. package/src/react-ui/blocks/Terminal/TerminalDisplay.styles.ts +0 -38
  38. package/src/react-ui/blocks/Terminal/TerminalDisplay.tsx +0 -254
  39. package/src/react-ui/blocks/Terminal/TerminalDisplay.types.ts +0 -73
  40. package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +0 -269
  41. package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +0 -326
  42. package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +0 -230
  43. package/src/react-ui/blocks/Terminal/XTermAdapter.ts +0 -163
  44. package/src/react-ui/blocks/Terminal/chrome.ts +0 -25
  45. package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +0 -316
  46. package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +0 -218
  47. package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +0 -386
  48. package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +0 -67
  49. package/src/react-ui/blocks/Terminal/components/index.ts +0 -10
  50. package/src/react-ui/blocks/Terminal/display.ts +0 -46
  51. package/src/react-ui/blocks/Terminal/hooks/index.ts +0 -22
  52. package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +0 -229
  53. package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +0 -292
  54. package/src/react-ui/blocks/Terminal/index.ts +0 -111
  55. package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +0 -330
  56. package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +0 -242
  57. package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +0 -202
  58. package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +0 -140
  59. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +0 -68
  60. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +0 -85
  61. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +0 -383
  62. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +0 -439
  63. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +0 -550
  64. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +0 -259
  65. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.ts +0 -75
  66. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +0 -266
  67. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +0 -82
  68. package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +0 -112
  69. package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +0 -178
  70. package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +0 -203
  71. package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +0 -252
  72. package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +0 -334
  73. package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +0 -261
  74. package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +0 -248
  75. package/src/react-ui/blocks/Terminal/panel/index.ts +0 -72
  76. package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +0 -59
  77. package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +0 -59
  78. package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +0 -180
  79. package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +0 -248
  80. package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +0 -283
  81. package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +0 -686
  82. package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +0 -466
  83. package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +0 -343
  84. package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +0 -167
  85. package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +0 -348
  86. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +0 -251
  87. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +0 -390
  88. package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +0 -320
  89. package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +0 -20
  90. package/src/react-ui/blocks/Terminal/parsing/index.ts +0 -69
  91. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +0 -68
  92. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +0 -436
  93. package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +0 -14
  94. package/src/react-ui/blocks/index.ts +0 -11
  95. package/src/react-ui/components/MorphingPopover/MorphingPopover.types.ts +0 -49
  96. package/src/react-ui/components/MorphingPopover/index.tsx +0 -186
  97. package/src/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -153
  98. package/src/react-ui/components/index.ts +0 -9
  99. package/src/react-ui/hooks/Animation/UseAutoHeight.tsx +0 -123
  100. package/src/react-ui/hooks/DOM/UseIsInView.tsx +0 -44
  101. package/src/react-ui/hooks/Formatting/UseListFormat.ts +0 -134
  102. package/src/react-ui/hooks/State/UseControlledState.tsx +0 -57
  103. package/src/react-ui/hooks/State/UseDataState.tsx +0 -76
  104. package/src/react-ui/hooks/index.ts +0 -20
  105. package/src/react-ui/icons/index.ts +0 -12
  106. package/src/react-ui/icons/lucide-animated/activity.tsx +0 -109
  107. package/src/react-ui/icons/lucide-animated/arrow-down-to-line.tsx +0 -51
  108. package/src/react-ui/icons/lucide-animated/arrow-up.tsx +0 -50
  109. package/src/react-ui/icons/lucide-animated/bell-electric.tsx +0 -124
  110. package/src/react-ui/icons/lucide-animated/bell.tsx +0 -93
  111. package/src/react-ui/icons/lucide-animated/bot.tsx +0 -122
  112. package/src/react-ui/icons/lucide-animated/box.tsx +0 -117
  113. package/src/react-ui/icons/lucide-animated/check.tsx +0 -21
  114. package/src/react-ui/icons/lucide-animated/circle-check.tsx +0 -107
  115. package/src/react-ui/icons/lucide-animated/delete.tsx +0 -133
  116. package/src/react-ui/icons/lucide-animated/download.tsx +0 -99
  117. package/src/react-ui/icons/lucide-animated/edit-2.tsx +0 -21
  118. package/src/react-ui/icons/lucide-animated/globe.tsx +0 -23
  119. package/src/react-ui/icons/lucide-animated/home.tsx +0 -103
  120. package/src/react-ui/icons/lucide-animated/index.ts +0 -38
  121. package/src/react-ui/icons/lucide-animated/layers.tsx +0 -23
  122. package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +0 -143
  123. package/src/react-ui/icons/lucide-animated/list.tsx +0 -54
  124. package/src/react-ui/icons/lucide-animated/package.tsx +0 -24
  125. package/src/react-ui/icons/lucide-animated/palette.tsx +0 -25
  126. package/src/react-ui/icons/lucide-animated/plus.tsx +0 -92
  127. package/src/react-ui/icons/lucide-animated/refresh-cw.tsx +0 -24
  128. package/src/react-ui/icons/lucide-animated/rocket.tsx +0 -24
  129. package/src/react-ui/icons/lucide-animated/save.tsx +0 -23
  130. package/src/react-ui/icons/lucide-animated/search.tsx +0 -94
  131. package/src/react-ui/icons/lucide-animated/settings.tsx +0 -92
  132. package/src/react-ui/icons/lucide-animated/terminal.tsx +0 -46
  133. package/src/react-ui/icons/lucide-animated/trash-2.tsx +0 -25
  134. package/src/react-ui/icons/lucide-animated/trending-down.tsx +0 -151
  135. package/src/react-ui/icons/lucide-animated/trending-up.tsx +0 -150
  136. package/src/react-ui/icons/lucide-animated/type.tsx +0 -23
  137. package/src/react-ui/icons/lucide-animated/upload.tsx +0 -23
  138. package/src/react-ui/icons/lucide-animated/x.tsx +0 -102
  139. package/src/react-ui/index.ts +0 -30
  140. package/src/react-ui/lib/get-strict-context.tsx +0 -56
  141. package/src/react-ui/lib/icon-wrapper.tsx +0 -70
  142. package/src/react-ui/lib/index.ts +0 -9
  143. package/src/react-ui/lib/utils.ts +0 -24
  144. package/src/react-ui/primitives/AutoHeight/index.tsx +0 -74
  145. package/src/react-ui/primitives/CountingNumber/index.tsx +0 -147
  146. package/src/react-ui/primitives/Highlight/Highlight.types.ts +0 -136
  147. package/src/react-ui/primitives/Highlight/index.tsx +0 -577
  148. package/src/react-ui/primitives/Slot/index.tsx +0 -128
  149. package/src/react-ui/primitives/index.ts +0 -16
  150. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +0 -141
  151. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +0 -217
  152. package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +0 -77
  153. package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +0 -58
  154. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +0 -253
  155. package/src/react-ui/primitives/waapi/Gooey/index.ts +0 -50
  156. package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +0 -48
  157. package/src/react-ui/primitives/waapi/Morph/Morph.types.ts +0 -106
  158. package/src/react-ui/primitives/waapi/Morph/MorphContext.tsx +0 -21
  159. package/src/react-ui/primitives/waapi/Morph/index.tsx +0 -56
  160. package/src/react-ui/primitives/waapi/Morph/techniques/index.ts +0 -12
  161. package/src/react-ui/primitives/waapi/Morph/techniques/useCSSGridMorph.ts +0 -89
  162. package/src/react-ui/primitives/waapi/Morph/techniques/useFLIPClipPath.ts +0 -176
  163. package/src/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.ts +0 -87
  164. package/src/react-ui/primitives/waapi/Morph/useMorph.ts +0 -101
  165. package/src/react-ui/primitives/waapi/Reorder/Reorder.types.ts +0 -177
  166. package/src/react-ui/primitives/waapi/Reorder/index.tsx +0 -260
  167. package/src/react-ui/primitives/waapi/Reorder/useReorder.ts +0 -47
  168. package/src/react-ui/primitives/waapi/Reorder/useReorderPresence.ts +0 -209
  169. package/src/react-ui/primitives/waapi/Reorder/utils/separatorCoordination.ts +0 -104
  170. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.ts +0 -14
  171. package/src/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.types.ts +0 -84
  172. package/src/react-ui/primitives/waapi/SlidingNumber/index.tsx +0 -474
  173. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.styles.ts +0 -32
  174. package/src/react-ui/primitives/waapi/SlidingText/SlidingText.types.ts +0 -69
  175. package/src/react-ui/primitives/waapi/SlidingText/index.tsx +0 -140
  176. package/src/react-ui/primitives/waapi/core/animationConstants.ts +0 -215
  177. package/src/react-ui/primitives/waapi/core/index.ts +0 -53
  178. package/src/react-ui/primitives/waapi/core/types.ts +0 -200
  179. package/src/react-ui/primitives/waapi/core/useAnimationOrchestrator.ts +0 -430
  180. package/src/react-ui/primitives/waapi/core/useElementRegistry.ts +0 -81
  181. package/src/react-ui/primitives/waapi/core/useFLIPAnimation.ts +0 -138
  182. package/src/react-ui/primitives/waapi/core/usePositionCapture.ts +0 -106
  183. package/src/react-ui/primitives/waapi/index.ts +0 -139
  184. package/src/react-ui/styles/animations.css +0 -369
  185. package/src/react-ui/ui/Accordion/Accordion.styles.ts +0 -72
  186. package/src/react-ui/ui/Accordion/Accordion.types.ts +0 -199
  187. package/src/react-ui/ui/Accordion/index.tsx +0 -362
  188. package/src/react-ui/ui/AlertDialog/AlertDialog.styles.ts +0 -38
  189. package/src/react-ui/ui/AlertDialog/AlertDialog.types.ts +0 -296
  190. package/src/react-ui/ui/AlertDialog/index.tsx +0 -540
  191. package/src/react-ui/ui/Badge/Badge.styles.ts +0 -43
  192. package/src/react-ui/ui/Badge/Badge.types.ts +0 -26
  193. package/src/react-ui/ui/Badge/index.tsx +0 -34
  194. package/src/react-ui/ui/Button/Button.styles.ts +0 -57
  195. package/src/react-ui/ui/Button/Button.types.ts +0 -63
  196. package/src/react-ui/ui/Button/index.tsx +0 -155
  197. package/src/react-ui/ui/Card/Card.styles.ts +0 -32
  198. package/src/react-ui/ui/Card/Card.types.ts +0 -39
  199. package/src/react-ui/ui/Card/index.tsx +0 -130
  200. package/src/react-ui/ui/Checkbox/Checkbox.styles.ts +0 -40
  201. package/src/react-ui/ui/Checkbox/Checkbox.types.ts +0 -98
  202. package/src/react-ui/ui/Checkbox/index.tsx +0 -233
  203. package/src/react-ui/ui/Combobox/Combobox.styles.ts +0 -34
  204. package/src/react-ui/ui/Combobox/Combobox.types.ts +0 -89
  205. package/src/react-ui/ui/Combobox/index.tsx +0 -331
  206. package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +0 -38
  207. package/src/react-ui/ui/CornerBracket/CornerBracket.types.ts +0 -15
  208. package/src/react-ui/ui/CornerBracket/index.tsx +0 -49
  209. package/src/react-ui/ui/DataCard/DataCard.styles.ts +0 -94
  210. package/src/react-ui/ui/DataCard/DataCard.types.ts +0 -125
  211. package/src/react-ui/ui/DataCard/index.tsx +0 -340
  212. package/src/react-ui/ui/Dialog/Dialog.styles.ts +0 -59
  213. package/src/react-ui/ui/Dialog/Dialog.types.ts +0 -284
  214. package/src/react-ui/ui/Dialog/index.tsx +0 -452
  215. package/src/react-ui/ui/DropdownMenu/DropdownMenu.styles.ts +0 -35
  216. package/src/react-ui/ui/DropdownMenu/DropdownMenu.types.ts +0 -81
  217. package/src/react-ui/ui/DropdownMenu/index.tsx +0 -300
  218. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -376
  219. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +0 -85
  220. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +0 -180
  221. package/src/react-ui/ui/DynamicToggle/index.tsx +0 -316
  222. package/src/react-ui/ui/DynamicToggle/prototype-v7-ios.html +0 -413
  223. package/src/react-ui/ui/DynamicToggle/prototype-v7.html +0 -615
  224. package/src/react-ui/ui/DynamicToggle/prototype-v8-gooey-safari.html +0 -560
  225. package/src/react-ui/ui/DynamicToggle/prototype-v8b-react-structure.html +0 -227
  226. package/src/react-ui/ui/DynamicToggle/prototype.html +0 -419
  227. package/src/react-ui/ui/Field/Field.styles.ts +0 -47
  228. package/src/react-ui/ui/Field/Field.types.ts +0 -60
  229. package/src/react-ui/ui/Field/index.tsx +0 -254
  230. package/src/react-ui/ui/Input/Input.styles.ts +0 -11
  231. package/src/react-ui/ui/Input/Input.types.ts +0 -10
  232. package/src/react-ui/ui/Input/index.tsx +0 -32
  233. package/src/react-ui/ui/InputGroup/InputGroup.styles.ts +0 -53
  234. package/src/react-ui/ui/InputGroup/InputGroup.types.ts +0 -44
  235. package/src/react-ui/ui/InputGroup/index.tsx +0 -149
  236. package/src/react-ui/ui/Label/Label.styles.ts +0 -10
  237. package/src/react-ui/ui/Label/Label.types.ts +0 -9
  238. package/src/react-ui/ui/Label/index.tsx +0 -27
  239. package/src/react-ui/ui/Menu/Menu.styles.ts +0 -71
  240. package/src/react-ui/ui/Menu/Menu.types.ts +0 -425
  241. package/src/react-ui/ui/Menu/index.tsx +0 -900
  242. package/src/react-ui/ui/Popover/Popover.styles.ts +0 -55
  243. package/src/react-ui/ui/Popover/Popover.types.ts +0 -261
  244. package/src/react-ui/ui/Popover/index.tsx +0 -422
  245. package/src/react-ui/ui/Progress/Progress.styles.ts +0 -36
  246. package/src/react-ui/ui/Progress/Progress.types.ts +0 -162
  247. package/src/react-ui/ui/Progress/index.tsx +0 -254
  248. package/src/react-ui/ui/Select/Select.styles.ts +0 -30
  249. package/src/react-ui/ui/Select/Select.types.ts +0 -51
  250. package/src/react-ui/ui/Select/index.tsx +0 -225
  251. package/src/react-ui/ui/Separator/Separator.styles.ts +0 -10
  252. package/src/react-ui/ui/Separator/Separator.types.ts +0 -10
  253. package/src/react-ui/ui/Separator/index.tsx +0 -37
  254. package/src/react-ui/ui/Switch/Switch.styles.ts +0 -50
  255. package/src/react-ui/ui/Switch/Switch.types.ts +0 -155
  256. package/src/react-ui/ui/Switch/index.tsx +0 -253
  257. package/src/react-ui/ui/Tabs/Tabs.css +0 -39
  258. package/src/react-ui/ui/Tabs/Tabs.styles.ts +0 -148
  259. package/src/react-ui/ui/Tabs/Tabs.types.ts +0 -255
  260. package/src/react-ui/ui/Tabs/index.tsx +0 -529
  261. package/src/react-ui/ui/TextFlow/TextFlow.styles.ts +0 -36
  262. package/src/react-ui/ui/TextFlow/TextFlow.types.ts +0 -118
  263. package/src/react-ui/ui/TextFlow/index.tsx +0 -276
  264. package/src/react-ui/ui/Textarea/Textarea.styles.ts +0 -10
  265. package/src/react-ui/ui/Textarea/Textarea.types.ts +0 -9
  266. package/src/react-ui/ui/Textarea/index.tsx +0 -27
  267. package/src/react-ui/ui/Tooltip/Tooltip.styles.ts +0 -43
  268. package/src/react-ui/ui/Tooltip/Tooltip.types.ts +0 -253
  269. package/src/react-ui/ui/Tooltip/index.tsx +0 -394
  270. package/src/react-ui/ui/index.ts +0 -41
  271. package/src/types/css-modules.d.ts +0 -18
@@ -1,106 +0,0 @@
1
- 'use client';
2
- import { useRef, useCallback } from 'react';
3
- import { TIMING } from './animationConstants';
4
- import type { IPositionCaptureAPI, IFLIPDelta, IPositionCaptureOptions } from './types';
5
-
6
- const DEFAULT_MIN_DELTA_PX = TIMING.MIN_DELTA_PX;
7
-
8
- /**
9
- * Hook for capturing element positions and calculating FLIP deltas.
10
- * Extracted from the WAAPI animation system's position capture logic.
11
- *
12
- * @param getElements - Function that returns the current element map
13
- * @param options - Optional configuration (e.g. minimum delta threshold)
14
- * @returns Position capture API with capture, delta calculation, and cache
15
- *
16
- * @example
17
- * ```tsx
18
- * const registry = useElementRegistry();
19
- * const positions = usePositionCapture(registry.getAll);
20
- *
21
- * // Before layout change:
22
- * const before = positions.capture();
23
- *
24
- * // After layout change:
25
- * const after = positions.capture();
26
- * const deltas = positions.calculateDeltas(before, after);
27
- * ```
28
- */
29
- export function usePositionCapture(
30
- getElements: () => Map<string, HTMLElement>,
31
- options?: IPositionCaptureOptions
32
- ): IPositionCaptureAPI {
33
- const lastCaptureRef = useRef<Map<string, DOMRect>>(new Map());
34
- const minDeltaPx = options?.minDeltaPx ?? DEFAULT_MIN_DELTA_PX;
35
-
36
- const capture = useCallback((excludeIds?: Set<string>): Map<string, DOMRect> => {
37
- const positions = new Map<string, DOMRect>();
38
- const elements = getElements();
39
-
40
- elements.forEach((el, id) => {
41
- if (excludeIds?.has(id)) return;
42
-
43
- const rect = el.getBoundingClientRect();
44
- if (rect.width > 0 && rect.height > 0) {
45
- positions.set(id, rect);
46
- }
47
- });
48
-
49
- lastCaptureRef.current = positions;
50
- return positions;
51
- }, [getElements]);
52
-
53
- const getPosition = useCallback((id: string): DOMRect | undefined => {
54
- return lastCaptureRef.current.get(id);
55
- }, []);
56
-
57
- const calculateDeltas = useCallback((
58
- before: Map<string, DOMRect>,
59
- after: Map<string, DOMRect>
60
- ): Map<string, IFLIPDelta> => {
61
- const deltas = new Map<string, IFLIPDelta>();
62
-
63
- after.forEach((newRect, id) => {
64
- const prevRect = before.get(id);
65
- if (!prevRect) return;
66
-
67
- const deltaX = prevRect.left - newRect.left;
68
- const deltaY = prevRect.top - newRect.top;
69
- const deltaWidth = prevRect.width - newRect.width;
70
- const deltaHeight = prevRect.height - newRect.height;
71
-
72
- const isSignificant =
73
- Math.abs(deltaX) >= minDeltaPx ||
74
- Math.abs(deltaY) >= minDeltaPx ||
75
- Math.abs(deltaWidth) >= minDeltaPx ||
76
- Math.abs(deltaHeight) >= minDeltaPx;
77
-
78
- deltas.set(id, {
79
- id,
80
- deltaX,
81
- deltaY,
82
- deltaWidth,
83
- deltaHeight,
84
- isSignificant
85
- });
86
- });
87
-
88
- return deltas;
89
- }, [minDeltaPx]);
90
-
91
- const getLastCapture = useCallback((): Map<string, DOMRect> => {
92
- return new Map(lastCaptureRef.current);
93
- }, []);
94
-
95
- const clear = useCallback(() => {
96
- lastCaptureRef.current.clear();
97
- }, []);
98
-
99
- return {
100
- capture,
101
- getPosition,
102
- calculateDeltas,
103
- getLastCapture,
104
- clear
105
- };
106
- }
@@ -1,139 +0,0 @@
1
- /**
2
- * WAAPI Animation Primitives
3
- *
4
- * Lightweight, performant React animation components built on the Web Animations API (WAAPI).
5
- *
6
- * @example
7
- * ```tsx
8
- * import { SlidingNumber, SlidingText, Reorder, Morph } from '@mks2508/mks-ui/react/primitives/waapi';
9
- * ```
10
- */
11
-
12
- // ============================================================
13
- // Core — FLIP animation infrastructure
14
- // ============================================================
15
-
16
- // Constants (SSOT)
17
- export {
18
- TIMING,
19
- TRANSFORMS,
20
- EFFECTS,
21
- EASINGS,
22
- RESPONSIVE_CONFIGS,
23
- ANIMATION_CONFIGS,
24
- ANIMATION_DEFAULTS,
25
- PRESETS,
26
- getResponsiveDuration,
27
- getResponsiveStagger,
28
- } from './core';
29
-
30
- // Core hooks
31
- export { useElementRegistry } from './core';
32
- export { usePositionCapture } from './core';
33
- export { useFLIPAnimation } from './core';
34
- export { useAnimationOrchestrator } from './core';
35
-
36
- // Core types
37
- export type {
38
- IFLIPDelta,
39
- IAnimationTiming,
40
- IPositionRect,
41
- IElementRegistryAPI,
42
- IElementRegistryCallbacks,
43
- IPositionCaptureAPI,
44
- IPositionCaptureOptions,
45
- IFLIPAnimationAPI,
46
- IFLIPAnimationOptions,
47
- IExitOptions,
48
- IEnterOptions,
49
- IAnimationOrchestratorConfig,
50
- IAnimationOrchestratorAPI,
51
- IOrchestratorState,
52
- IAnimationEvent,
53
- FLIPBehavior,
54
- ExitPositionStrategy,
55
- AnimationPhase,
56
- } from './core';
57
-
58
- // ============================================================
59
- // SlidingNumber - Animated number transitions
60
- // ============================================================
61
- export { SlidingNumber } from './SlidingNumber';
62
- export type {
63
- ISlidingNumberProps,
64
- IFormatOptions,
65
- } from './SlidingNumber/SlidingNumber.types';
66
-
67
- // ============================================================
68
- // SlidingText - Character/word text animations
69
- // ============================================================
70
- export { SlidingText } from './SlidingText';
71
- export type { ISlidingTextProps } from './SlidingText/SlidingText.types';
72
-
73
- // ============================================================
74
- // Reorder - FLIP list reordering
75
- // ============================================================
76
- export { Reorder } from './Reorder';
77
- export type {
78
- IReorderProps,
79
- ReorderLayout,
80
- DurationConfig,
81
- StaggerConfig,
82
- IUseReorderReturn,
83
- IUseReorderConfig,
84
- IReorderItemState,
85
- IReorderContextValue,
86
- IUseReorderPresenceConfig,
87
- IUseReorderPresenceReturn,
88
- } from './Reorder/Reorder.types';
89
- export { useReorder } from './Reorder/useReorder';
90
- export { useReorderPresence } from './Reorder/useReorderPresence';
91
- export { calculateSeparatorCoordination, shouldShowSeparator } from './Reorder/utils/separatorCoordination';
92
-
93
- // ============================================================
94
- // Morph - Morphing animations
95
- // ============================================================
96
- export { Morph } from './Morph';
97
- export type {
98
- IMorphProps,
99
- IMorphContextValue,
100
- IUseMorphConfig,
101
- IUseMorphReturn,
102
- MorphTechnique,
103
- IFLIPClipPathOptions,
104
- IFLIPClipPathAPI,
105
- ICSSGridMorphOptions,
106
- ICSSGridMorphAPI,
107
- IViewTransitionsOptions,
108
- IViewTransitionsAPI,
109
- } from './Morph/Morph.types';
110
- export { useMorph } from './Morph/useMorph';
111
- export { useMorphContext } from './Morph/MorphContext';
112
-
113
- // Morph techniques (individual)
114
- export { useFLIPClipPath } from './Morph/techniques/useFLIPClipPath';
115
- export { useCSSGridMorph } from './Morph/techniques/useCSSGridMorph';
116
- export { useViewTransitions } from './Morph/techniques/useViewTransitions';
117
-
118
- // ============================================================
119
- // Gooey — SVG-based shape morphing (filter + parametric path)
120
- // ============================================================
121
-
122
- export {
123
- GooeyFilter,
124
- GooeyCanvas,
125
- MorphPath,
126
- useMorphPath,
127
- GOOEY_DEFAULTS,
128
- computeBlur,
129
- buildColorMatrixValues,
130
- buildFilterString,
131
- morphPathDown,
132
- morphPathUp,
133
- } from './Gooey';
134
- export type {
135
- IGooeyFilterProps,
136
- IGooeyCanvasProps,
137
- IMorphPathProps,
138
- IUseMorphPathOptions,
139
- } from './Gooey';
@@ -1,369 +0,0 @@
1
- /* ============================================
2
- WAAPI Animation Primitives - CSS-First Architecture
3
-
4
- RESPONSIBILITIES:
5
- - CSS: Structure, final states, accessibility
6
- - WAAPI: Dynamic animations, FLIP, timing
7
-
8
- GOLDEN RULE: CSS does NOT animate what WAAPI controls
9
- ============================================ */
10
-
11
- /* ============================================
12
- CSS Variables for WAAPI Animations
13
- These can be overridden by consumers
14
- ============================================ */
15
- :root {
16
- /* Timing */
17
- --waapi-duration-enter: 200ms;
18
- --waapi-duration-exit: 180ms;
19
- --waapi-duration-collapse: 200ms;
20
- --waapi-duration-flip: 300ms;
21
- --waapi-stagger-enter: 15ms;
22
- --waapi-stagger-exit: 0ms;
23
-
24
- /* Transforms */
25
- --waapi-offset-y-enter: 8px;
26
- --waapi-offset-y-exit: -8px;
27
- --waapi-offset-x: 16px;
28
- --waapi-scale-exit: 0.85;
29
-
30
- /* Effects */
31
- --waapi-blur-enter: 4px;
32
- --waapi-blur-exit: 2px;
33
-
34
- /* Easings */
35
- --waapi-ease-enter: cubic-bezier(0.33, 1, 0.68, 1);
36
- --waapi-ease-exit: cubic-bezier(0.32, 0, 0.67, 0);
37
- --waapi-ease-collapse: cubic-bezier(0.42, 0, 0.58, 1);
38
- --waapi-ease-flip: cubic-bezier(0.2, 0, 0.2, 1);
39
- }
40
-
41
- /* ===========================================
42
- REORDER CONTAINER
43
- =========================================== */
44
- .waapi-reorder-container {
45
- position: relative;
46
- }
47
-
48
- /* ===========================================
49
- REORDER ITEM - Base State
50
- [data-reorder-state] marks elements controlled by the orchestrator
51
- =========================================== */
52
- [data-reorder-state] {
53
- position: relative;
54
- will-change: transform, opacity;
55
- }
56
-
57
- /* ===========================================
58
- STATE: IDLE (Default)
59
- Normal state after animation completes
60
- =========================================== */
61
- [data-reorder-state="idle"] {
62
- opacity: 1;
63
- transform: none;
64
- will-change: auto;
65
- }
66
-
67
- /* ===========================================
68
- STATE: ENTERING
69
- CSS: Starts HIDDEN - WAAPI animates to visible
70
- Prevents flicker - element is hidden BEFORE JS runs
71
- =========================================== */
72
- [data-reorder-state="entering"] {
73
- opacity: 0;
74
- transform: translateY(-8px) scale(0.95);
75
- }
76
-
77
- /* ===========================================
78
- STATE: EXITING
79
- WAAPI controls opacity and transform
80
- =========================================== */
81
- [data-reorder-state="exiting"] {
82
- pointer-events: none;
83
- }
84
-
85
- /* Exit position variant: absolute-fixed */
86
- [data-reorder-state="exiting"][data-exit-position="absolute"] {
87
- position: absolute;
88
- }
89
-
90
- /* Exit position variant: in-place */
91
- [data-reorder-state="exiting"][data-exit-position="in-place"] {
92
- position: relative;
93
- }
94
-
95
- /* ===========================================
96
- STATE: FLIPPING
97
- WAAPI controls the translate3d FLIP
98
- =========================================== */
99
- [data-reorder-state="flipping"] {
100
- /* WAAPI manages the FLIP transform */
101
- }
102
-
103
- /* ===========================================
104
- STATE: COMPLETED (Post-Animation)
105
- CSS handles final state, no animation needed
106
- =========================================== */
107
- [data-reorder-state="completed"] {
108
- position: absolute !important;
109
- opacity: 0 !important;
110
- pointer-events: none !important;
111
- visibility: hidden;
112
- width: 0;
113
- height: 0;
114
- overflow: hidden;
115
- }
116
-
117
- /* ===========================================
118
- SEPARATOR STATES
119
- =========================================== */
120
- [data-separator-state] {
121
- display: inline;
122
- white-space: pre;
123
- will-change: transform, opacity;
124
- }
125
-
126
- [data-separator-state="idle"] {
127
- /* Normal */
128
- }
129
-
130
- [data-separator-state="exiting"] {
131
- pointer-events: none;
132
- }
133
-
134
- [data-separator-state="completed"] {
135
- opacity: 0;
136
- position: absolute;
137
- pointer-events: none;
138
- width: 0;
139
- overflow: hidden;
140
- }
141
-
142
- /* ===========================================
143
- FLIP BEHAVIOR VARIANTS
144
- Controls which elements participate in FLIP
145
- =========================================== */
146
- [data-flip-behavior="all"] {
147
- /* Default: all siblings do FLIP */
148
- }
149
-
150
- [data-flip-behavior="siblings-after"] {
151
- /* Only siblings after the exiting item */
152
- }
153
-
154
- [data-flip-behavior="none"] {
155
- /* This item does not participate in FLIP */
156
- }
157
-
158
- /* ===========================================
159
- STAGGER INDEX (Progressive Enhancement)
160
- Chrome 138+, Safari TP 226+ support sibling-index()
161
- =========================================== */
162
- @supports (animation-delay: calc(sibling-index() * 1ms)) {
163
- [data-reorder-state="entering"] {
164
- --waapi-stagger-index: sibling-index();
165
- }
166
- }
167
-
168
- /* Fallback: use data-reorder-index set by JS */
169
- [data-reorder-index] {
170
- /* JS sets this for stagger calculation fallback */
171
- }
172
-
173
- /* ===========================================
174
- LEGACY CLASS SUPPORT
175
- Compatibility with existing components
176
- =========================================== */
177
-
178
- /* Token wrapper - FLIP-ready container */
179
- .waapi-token-wrapper {
180
- display: inline-flex;
181
- align-items: center;
182
- }
183
-
184
- .waapi-token-wrapper.exit-completed,
185
- .waapi-token-wrapper[data-reorder-state="completed"] {
186
- position: absolute !important;
187
- opacity: 0 !important;
188
- pointer-events: none !important;
189
- }
190
-
191
- /* Token separator - WAAPI handles animations */
192
- .waapi-token-separator {
193
- display: inline !important;
194
- white-space: pre;
195
- margin-left: 0.25em;
196
- will-change: transform, opacity;
197
- }
198
-
199
- .waapi-token-separator.exit-coordinated {
200
- /* Intentionally empty - WAAPI handles animation */
201
- }
202
-
203
- .waapi-token-separator.flip-active {
204
- will-change: transform;
205
- }
206
-
207
- .waapi-token-separator.exit-completed {
208
- opacity: 0;
209
- position: absolute;
210
- pointer-events: none;
211
- width: 0;
212
- overflow: hidden;
213
- }
214
-
215
- /* Token overflow indicator */
216
- .waapi-token-overflow {
217
- display: inline-flex;
218
- align-items: center;
219
- white-space: nowrap;
220
- }
221
-
222
- /* SlidingText container */
223
- .waapi-sliding-text-container {
224
- display: inline-flex;
225
- overflow: visible;
226
- vertical-align: bottom;
227
- will-change: width;
228
- }
229
-
230
- .waapi-sliding-text-content {
231
- display: inline-flex;
232
- white-space: pre;
233
- }
234
-
235
- /* SlidingText token */
236
- .waapi-sliding-text-token {
237
- display: inline-block;
238
- will-change: transform, opacity, filter;
239
- backface-visibility: hidden;
240
- font-weight: 500;
241
- }
242
-
243
- .waapi-sliding-text-token.enter-from {
244
- opacity: 0;
245
- filter: blur(var(--blur-amount, 4px));
246
- }
247
-
248
- .waapi-sliding-text-token.enter-to {
249
- opacity: 1;
250
- transform: translate(0, 0);
251
- filter: blur(0);
252
- }
253
-
254
- .waapi-sliding-text-token.exit-active {
255
- opacity: 0;
256
- filter: blur(var(--blur-amount, 4px));
257
- }
258
-
259
- /* Direction variants */
260
- .waapi-direction-vertical .waapi-sliding-text-token.enter-from {
261
- transform: translateY(var(--offset, 8px));
262
- }
263
-
264
- .waapi-direction-vertical .waapi-sliding-text-token.exit-active {
265
- transform: translateY(calc(var(--offset, 8px) * -1));
266
- }
267
-
268
- .waapi-direction-horizontal .waapi-sliding-text-token.enter-from {
269
- transform: translateX(var(--offset, 16px));
270
- }
271
-
272
- .waapi-direction-horizontal .waapi-sliding-text-token.exit-active {
273
- transform: translateX(calc(var(--offset, 16px) * -1));
274
- }
275
-
276
- /* AnimatedTokens container */
277
- .waapi-animated-tokens-container {
278
- display: flex;
279
- flex-wrap: wrap;
280
- align-items: center;
281
- gap: 0;
282
- }
283
-
284
- .waapi-animated-tokens-container.waapi-animated-tokens-container--inline {
285
- display: inline-flex;
286
- flex-wrap: nowrap;
287
- overflow: hidden;
288
- text-overflow: ellipsis;
289
- white-space: nowrap;
290
- }
291
-
292
- /* Placeholder styling */
293
- .waapi-token-placeholder {
294
- color: var(--muted-foreground, #888) !important;
295
- font-style: italic;
296
- }
297
-
298
- /* Sliding Number Styles */
299
- .waapi-sliding-number {
300
- display: inline-flex;
301
- align-items: center;
302
- font-variant-numeric: tabular-nums;
303
- }
304
-
305
- /* ===========================================
306
- ACCESSIBILITY - Reduced Motion
307
- =========================================== */
308
- @media (prefers-reduced-motion: reduce) {
309
- [data-reorder-state],
310
- [data-separator-state],
311
- .waapi-token-separator,
312
- .waapi-sliding-text-token,
313
- .waapi-token-wrapper {
314
- will-change: auto;
315
- transition: none !important;
316
- animation: none !important;
317
- }
318
- }
319
-
320
- /* ===========================================
321
- ACCESSIBILITY - High Contrast
322
- =========================================== */
323
- @media (prefers-contrast: high) {
324
- .waapi-sliding-text-token.enter-from,
325
- .waapi-sliding-text-token.exit-active {
326
- filter: none;
327
- }
328
- }
329
-
330
- /* ===========================================
331
- MOBILE - Performance Optimization
332
- =========================================== */
333
- @media (max-width: 768px) {
334
- .waapi-token-wrapper,
335
- [data-reorder-state] {
336
- transform: translateZ(0);
337
- backface-visibility: hidden;
338
- perspective: 1000px;
339
- }
340
- }
341
-
342
- /* ===========================================
343
- PRINT - Disable animations, show content
344
- =========================================== */
345
- @media print {
346
- .waapi-animated-tokens-container,
347
- .waapi-sliding-text-container,
348
- .waapi-token-separator,
349
- .waapi-token-wrapper,
350
- [data-reorder-state],
351
- [data-separator-state] {
352
- transition: none !important;
353
- animation: none !important;
354
- transform: none !important;
355
- opacity: 1 !important;
356
- }
357
-
358
- .waapi-token-separator.exit-completed,
359
- .waapi-token-wrapper.exit-completed,
360
- [data-reorder-state="completed"],
361
- [data-separator-state="completed"] {
362
- position: static !important;
363
- opacity: 1 !important;
364
- pointer-events: auto !important;
365
- visibility: visible !important;
366
- width: auto !important;
367
- height: auto !important;
368
- }
369
- }
@@ -1,72 +0,0 @@
1
- /**
2
- * Style slots and CVA variants for the Accordion component.
3
- *
4
- * Defines the visual regions (slots) and variant-based styling
5
- * using Class Variance Authority (CVA).
6
- *
7
- * @module @mks2508/mks-ui/react/ui/Accordion/Accordion.styles
8
- */
9
-
10
- import { cva, type VariantProps } from 'class-variance-authority';
11
-
12
- import type { StyleSlots } from '@/core/types';
13
- import type { AccordionSlot } from './Accordion.types';
14
-
15
- /**
16
- * Default Tailwind classes for each visual region of the Accordion.
17
- *
18
- * @example
19
- * ```typescript
20
- * import { AccordionStyles } from '@mks2508/mks-ui';
21
- *
22
- * // Access individual slot defaults
23
- * console.log(AccordionStyles.root); // base root classes
24
- * console.log(AccordionStyles.trigger); // base trigger classes
25
- * ```
26
- */
27
- export const AccordionStyles: StyleSlots<AccordionSlot> = {
28
- root: 'flex flex-col',
29
- item: 'border-b border-border',
30
- header: 'flex',
31
- trigger:
32
- 'flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-panel-open]>svg]:rotate-180',
33
- panel: 'overflow-hidden text-sm',
34
- };
35
-
36
- /**
37
- * CVA variants for the Accordion root element.
38
- *
39
- * Provides `default` and `bordered` visual variants that control
40
- * the overall appearance of the accordion container.
41
- *
42
- * @example
43
- * ```typescript
44
- * import { accordionVariants } from '@mks2508/mks-ui';
45
- *
46
- * // Get class string for bordered variant
47
- * const classes = accordionVariants({ variant: 'bordered' });
48
- * ```
49
- */
50
- export const accordionVariants = cva(AccordionStyles.root, {
51
- variants: {
52
- /**
53
- * Visual variant of the accordion container.
54
- *
55
- * - `default` - Standard accordion with bottom borders on items.
56
- * - `bordered` - Accordion with a visible outer border and rounded corners.
57
- */
58
- variant: {
59
- default: '',
60
- bordered: 'rounded-lg border border-border',
61
- },
62
- },
63
- defaultVariants: {
64
- variant: 'default',
65
- },
66
- });
67
-
68
- /**
69
- * Variant props extracted from {@link accordionVariants}.
70
- * Use this to type-check the `variant` prop on the Accordion root.
71
- */
72
- export type AccordionVariantProps = VariantProps<typeof accordionVariants>;