@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,276 +0,0 @@
1
- "use client";
2
-
3
- import React, { useMemo, useCallback } from 'react';
4
- import { SlidingText } from '@/react-ui/primitives/waapi/SlidingText';
5
- import { Reorder } from '@/react-ui/primitives/waapi/Reorder';
6
- import { useListFormat } from '@/react-ui/hooks/Formatting/UseListFormat';
7
- import type {
8
- ITextFlowProps,
9
- IToken,
10
- ISeparatorConfig,
11
- IOverflowConfig,
12
- ITextAnimationConfig,
13
- SeparatorTransitionMode,
14
- ListFormatType,
15
- ListFormatStyle,
16
- } from './TextFlow.types';
17
- import { cn } from '@/react-ui/lib/utils';
18
-
19
- // Default configurations
20
- const DEFAULT_SEPARATOR: Required<Omit<ISeparatorConfig, 'value' | 'locale' | 'className'>> = {
21
- listType: 'conjunction',
22
- listStyle: 'long',
23
- transition: 'none',
24
- duration: 200,
25
- };
26
-
27
- const DEFAULT_OVERFLOW: Required<Omit<IOverflowConfig, 'separator' | 'className'>> = {
28
- prefix: '+',
29
- label: ' more',
30
- showSeparator: true,
31
- };
32
-
33
- const DEFAULT_ANIMATION: Required<ITextAnimationConfig> = {
34
- mode: 'character',
35
- direction: 'vertical',
36
- stagger: 15,
37
- duration: 200,
38
- blur: true,
39
- widthAnimation: false,
40
- };
41
-
42
- /**
43
- * TextFlow - Locale-aware animated token list component
44
- *
45
- * Built on the Reorder primitive, provides smooth FLIP animations for token lists
46
- * with proper locale-aware separators using Intl.ListFormat.
47
- *
48
- * @example
49
- * ```tsx
50
- * // Basic usage
51
- * <TextFlow tokens={tokens} />
52
- *
53
- * // Spanish multiselect with transition
54
- * <TextFlow
55
- * tokens={tokens}
56
- * maxVisible={2}
57
- * inline
58
- * separator={{ locale: 'es', transition: 'fade' }}
59
- * overflow={{ prefix: '+', label: ' más' }}
60
- * />
61
- * ```
62
- */
63
- export const TextFlow: React.FC<ITextFlowProps> = ({
64
- tokens,
65
- placeholder = 'No tokens',
66
- maxVisible,
67
- separator: separatorConfig,
68
- overflow: overflowConfig,
69
- animation: animationConfig,
70
- inline = false,
71
- className = '',
72
- tokenClassName = '',
73
- placeholderClassName = '',
74
- }) => {
75
- // Merge configs with defaults
76
- const separator: Required<Omit<ISeparatorConfig, 'value' | 'locale' | 'className'>> & Pick<ISeparatorConfig, 'value' | 'locale' | 'className'> = {
77
- ...DEFAULT_SEPARATOR,
78
- ...separatorConfig,
79
- };
80
-
81
- const overflow: Required<Omit<IOverflowConfig, 'separator' | 'className'>> & Pick<IOverflowConfig, 'separator' | 'className'> = {
82
- ...DEFAULT_OVERFLOW,
83
- ...overflowConfig,
84
- };
85
-
86
- const animation: Required<ITextAnimationConfig> = {
87
- ...DEFAULT_ANIMATION,
88
- ...animationConfig,
89
- };
90
-
91
- // Track exiting token IDs with REF
92
- const exitingIdsRef = React.useRef<Set<string>>(new Set());
93
-
94
- // Visible tokens
95
- const visibleTokens = useMemo(
96
- () => (maxVisible ? tokens.slice(0, maxVisible) : tokens),
97
- [tokens, maxVisible]
98
- );
99
-
100
- const overflowCount = useMemo(
101
- () => (maxVisible ? Math.max(0, tokens.length - maxVisible) : 0),
102
- [tokens.length, maxVisible]
103
- );
104
-
105
- // Locale-aware list formatting via useListFormat hook
106
- const listParts = useListFormat(
107
- visibleTokens.map(t => t.text),
108
- {
109
- locale: separator.locale,
110
- type: separator.listType,
111
- style: separator.listStyle,
112
- separator: separator.value,
113
- hasOverflow: overflowCount > 0,
114
- }
115
- );
116
-
117
- // Separator visibility logic
118
- const shouldShowSeparator = useCallback((tokenIndex: number): boolean => {
119
- const isLastToken = tokenIndex >= visibleTokens.length - 1;
120
- return !isLastToken;
121
- }, [visibleTokens.length]);
122
-
123
- const handleItemExit = useCallback((id: string) => {
124
- exitingIdsRef.current.add(id);
125
- }, []);
126
-
127
- const handleItemEnter = useCallback((id: string) => {
128
- // Animation triggered automatically
129
- }, []);
130
-
131
- const showPlaceholder = tokens.length === 0 && !!placeholder;
132
-
133
- // Build children from list parts
134
- const tokenElements = useMemo(() => {
135
- let elementIndex = 0;
136
-
137
- return listParts.map((part, partIndex) => {
138
- if (part.type === 'element') {
139
- const token = visibleTokens[part.index];
140
- if (!token) return null;
141
-
142
- const isExiting = exitingIdsRef.current.has(token.id);
143
- elementIndex++;
144
-
145
- return (
146
- <span
147
- key={token.id}
148
- className={cn('waapi-token-wrapper', tokenClassName)}
149
- data-reorder-id={token.id}
150
- >
151
- <SlidingText
152
- text={token.text}
153
- mode={isExiting ? 'none' : animation.mode}
154
- direction={animation.direction}
155
- staggerDelay={animation.stagger}
156
- duration={animation.duration}
157
- blur={animation.blur}
158
- widthAnimation={!isExiting && animation.widthAnimation}
159
- initial={isExiting ? false : 'initial'}
160
- animate="animate"
161
- />
162
- </span>
163
- );
164
- }
165
-
166
- // Separator (literal)
167
- const prevToken = visibleTokens[part.index];
168
- if (!prevToken) return null;
169
-
170
- const tokenIndex = part.index;
171
- const showSep = shouldShowSeparator(tokenIndex);
172
-
173
- if (!showSep) return null;
174
-
175
- const separatorKey = `sep-${prevToken.id}`;
176
-
177
- return (
178
- <span
179
- key={separatorKey}
180
- className={cn('waapi-token-separator', separator.className ?? '')}
181
- >
182
- {part.value}
183
- </span>
184
- );
185
- }).filter(Boolean);
186
- }, [listParts, visibleTokens, tokenClassName, animation, separator, shouldShowSeparator]);
187
-
188
- // Overflow element
189
- const overflowElement = useMemo(() => {
190
- if (overflowCount === 0) return null;
191
-
192
- return (
193
- <div
194
- key="overflow-counter"
195
- data-reorder-id="overflow-counter"
196
- className={cn('waapi-token-overflow', overflow.className ?? '')}
197
- >
198
- {overflow.showSeparator && overflow.separator && (
199
- <span className={cn('waapi-token-separator', separator.className ?? '')}>
200
- {overflow.separator}
201
- </span>
202
- )}
203
- {overflow.prefix !== '' && (
204
- <span className={cn('waapi-token-separator', separator.className ?? '')}>
205
- {overflow.prefix}
206
- </span>
207
- )}
208
- <SlidingText
209
- text={String(overflowCount)}
210
- mode="character"
211
- duration={animation.duration}
212
- blur={animation.blur}
213
- initial="initial"
214
- animate="animate"
215
- />
216
- {overflow.label && overflow.label !== '' && (
217
- <SlidingText
218
- text={overflow.label}
219
- mode={animation.mode}
220
- direction={animation.direction}
221
- staggerDelay={animation.stagger}
222
- duration={animation.duration}
223
- blur={animation.blur}
224
- initial="initial"
225
- animate="animate"
226
- />
227
- )}
228
- </div>
229
- );
230
- }, [overflowCount, overflow, separator, animation]);
231
-
232
- return (
233
- <div
234
- role="text"
235
- className={cn(
236
- 'waapi-animated-tokens-container',
237
- inline && 'waapi-animated-tokens-container--inline',
238
- className
239
- )}
240
- >
241
- {showPlaceholder && (
242
- <SlidingText
243
- key="placeholder"
244
- text={placeholder}
245
- mode="word"
246
- direction="vertical"
247
- blur={true}
248
- duration={150}
249
- initial="initial"
250
- animate="animate"
251
- className={cn('waapi-token-placeholder', placeholderClassName)}
252
- />
253
- )}
254
-
255
- <Reorder
256
- layout={inline ? 'inline-horizontal' : 'horizontal'}
257
- onItemExit={handleItemExit}
258
- onItemEnter={handleItemEnter}
259
- >
260
- {tokenElements}
261
- {overflowElement}
262
- </Reorder>
263
- </div>
264
- );
265
- };
266
-
267
- TextFlow.displayName = 'TextFlow';
268
-
269
- export type {
270
- ITextFlowProps,
271
- IToken,
272
- ISeparatorConfig,
273
- IOverflowConfig,
274
- ITextAnimationConfig,
275
- SeparatorTransitionMode,
276
- };
@@ -1,10 +0,0 @@
1
- import type { StyleSlots } from '@/core/types';
2
-
3
- type TextareaSlot = 'root';
4
-
5
- const textareaStyles: StyleSlots<TextareaSlot> = {
6
- root: 'border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50',
7
- };
8
-
9
- export { textareaStyles };
10
- export type { TextareaSlot };
@@ -1,9 +0,0 @@
1
- import type { SlotOverrides } from '@/core/types';
2
- import type { TextareaSlot } from './Textarea.styles';
3
-
4
- /** Props for the Textarea component. */
5
- interface ITextareaProps extends React.ComponentProps<'textarea'> {
6
- slots?: SlotOverrides<TextareaSlot>;
7
- }
8
-
9
- export type { ITextareaProps };
@@ -1,27 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { cn } from '@/react-ui/lib/utils';
4
- import { textareaStyles } from './Textarea.styles';
5
- import type { ITextareaProps } from './Textarea.types';
6
-
7
- /**
8
- * Textarea — styled multi-line text input.
9
- *
10
- * @example
11
- * ```tsx
12
- * <Textarea placeholder="Enter description..." />
13
- * ```
14
- */
15
- function Textarea({ className, slots, ...props }: ITextareaProps) {
16
- return (
17
- <textarea
18
- data-slot="textarea"
19
- className={cn(textareaStyles.root, slots?.root, className)}
20
- {...props}
21
- />
22
- );
23
- }
24
-
25
- export { Textarea };
26
- export type { ITextareaProps } from './Textarea.types';
27
- export type { TextareaSlot } from './Textarea.styles';
@@ -1,43 +0,0 @@
1
- /**
2
- * Style definitions for the Tooltip component.
3
- *
4
- * Provides StyleSlots for each visual region. Uses only CSS variable
5
- * utilities; never hard-coded color values.
6
- *
7
- * @module @mks2508/mks-ui/react/ui/Tooltip/Tooltip.styles
8
- */
9
-
10
- import type { StyleSlots } from '@/core/types';
11
- import type { TooltipSlot } from './Tooltip.types';
12
-
13
- /**
14
- * Default Tailwind classes for each Tooltip visual region.
15
- * Consumers override via the `slots` prop; the merge order is:
16
- * `base -> slots -> className`.
17
- *
18
- * @example
19
- * ```typescript
20
- * import { tooltipStyles } from './Tooltip.styles';
21
- * // tooltipStyles.popup => 'z-50 overflow-hidden rounded-md ...'
22
- * ```
23
- */
24
- export const tooltipStyles: StyleSlots<TooltipSlot> = {
25
- /** Root wrapper — no visual styling by default. */
26
- root: '',
27
-
28
- /** Popup content container. */
29
- popup: [
30
- 'z-50 overflow-hidden rounded-md',
31
- 'border border-border bg-popover px-3 py-1.5',
32
- 'text-sm text-popover-foreground shadow-md',
33
- ].join(' '),
34
-
35
- /** Trigger element — no default styling. */
36
- trigger: '',
37
-
38
- /** Positioner wrapper — handles absolute placement. */
39
- positioner: '',
40
-
41
- /** Directional arrow pointing toward the trigger. */
42
- arrow: 'fill-popover',
43
- };
@@ -1,253 +0,0 @@
1
- /**
2
- * Type definitions for the Tooltip component.
3
- *
4
- * Provides all prop interfaces, slot types, context types, and configuration
5
- * for the animated tooltip system built on Base UI and Motion.
6
- *
7
- * @module @mks2508/mks-ui/react/ui/Tooltip/Tooltip.types
8
- */
9
-
10
- import type * as React from 'react';
11
- import type { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
12
- import type { HTMLMotionProps, MotionValue, SpringOptions } from 'motion/react';
13
-
14
- import type { SlotOverrides, IBaseConfig } from '@/core/types';
15
-
16
- /* -------------------------------------------------------------------------- */
17
- /* Slot */
18
- /* -------------------------------------------------------------------------- */
19
-
20
- /**
21
- * Visual regions available for class-name overrides via the `slots` prop.
22
- *
23
- * @example
24
- * ```tsx
25
- * <TooltipPopup slots={{ popup: 'bg-primary text-primary-foreground' }} />
26
- * ```
27
- */
28
- export type TooltipSlot =
29
- | 'root'
30
- | 'popup'
31
- | 'trigger'
32
- | 'positioner'
33
- | 'arrow';
34
-
35
- /* -------------------------------------------------------------------------- */
36
- /* Config */
37
- /* -------------------------------------------------------------------------- */
38
-
39
- /**
40
- * Extended configuration for the Tooltip component.
41
- * Inherits base animation settings and adds tooltip-specific cursor-following options.
42
- *
43
- * @example
44
- * ```typescript
45
- * const config: ITooltipConfig = {
46
- * followCursor: 'x',
47
- * followCursorSpringOptions: { stiffness: 200, damping: 17 },
48
- * animation: { duration: 0.15 },
49
- * };
50
- * ```
51
- */
52
- export interface ITooltipConfig extends IBaseConfig {
53
- /**
54
- * Whether the tooltip follows the cursor position.
55
- * - `true` — follows on both axes
56
- * - `'x'` — follows only horizontal movement
57
- * - `'y'` — follows only vertical movement
58
- * - `false` — static positioning (default)
59
- *
60
- * @defaultValue false
61
- */
62
- followCursor?: boolean | 'x' | 'y';
63
-
64
- /**
65
- * Spring physics options for the cursor-following animation.
66
- * Only used when `followCursor` is enabled.
67
- *
68
- * @defaultValue `{ stiffness: 200, damping: 17 }`
69
- */
70
- followCursorSpringOptions?: SpringOptions;
71
- }
72
-
73
- /* -------------------------------------------------------------------------- */
74
- /* Context */
75
- /* -------------------------------------------------------------------------- */
76
-
77
- /**
78
- * Internal context type shared between Tooltip sub-components.
79
- * Tracks open state, cursor position motion values, and follow-cursor settings.
80
- *
81
- * @example
82
- * ```tsx
83
- * const { isOpen, x, y, followCursor } = useTooltip();
84
- * ```
85
- */
86
- export type TooltipContextType = {
87
- /** Whether the tooltip is currently open. */
88
- isOpen: boolean;
89
- /** Callback to change the open state. */
90
- setIsOpen: ITooltipProps['onOpenChange'];
91
- /** Motion value tracking horizontal cursor offset. */
92
- x: MotionValue<number>;
93
- /** Motion value tracking vertical cursor offset. */
94
- y: MotionValue<number>;
95
- /** Current follow-cursor mode. */
96
- followCursor?: boolean | 'x' | 'y';
97
- /** Spring physics options for cursor-following. */
98
- followCursorSpringOptions?: SpringOptions;
99
- };
100
-
101
- /* -------------------------------------------------------------------------- */
102
- /* Props interfaces */
103
- /* -------------------------------------------------------------------------- */
104
-
105
- /**
106
- * Props for the root `Tooltip` component.
107
- * Wraps Base UI Tooltip.Root with controlled-state support, context provider,
108
- * and cursor-following motion values.
109
- *
110
- * @example
111
- * ```tsx
112
- * <Tooltip followCursor="x">
113
- * <TooltipTrigger>Hover me</TooltipTrigger>
114
- * <TooltipPortal>
115
- * <TooltipPositioner>
116
- * <TooltipPopup>Tooltip content</TooltipPopup>
117
- * </TooltipPositioner>
118
- * </TooltipPortal>
119
- * </Tooltip>
120
- * ```
121
- */
122
- export interface ITooltipProps
123
- extends React.ComponentProps<typeof TooltipPrimitive.Root> {
124
- /**
125
- * Whether the tooltip follows the cursor position.
126
- * @defaultValue false
127
- */
128
- followCursor?: boolean | 'x' | 'y';
129
-
130
- /**
131
- * Spring physics options for the cursor-following animation.
132
- * @defaultValue `{ stiffness: 200, damping: 17 }`
133
- */
134
- followCursorSpringOptions?: SpringOptions;
135
-
136
- /** Style slot overrides. */
137
- slots?: SlotOverrides<TooltipSlot>;
138
-
139
- /** Component configuration. */
140
- config?: ITooltipConfig;
141
- }
142
-
143
- /**
144
- * Props for the `TooltipProvider` component.
145
- * Wraps Base UI Tooltip.Provider to set shared defaults for a group of tooltips.
146
- *
147
- * @example
148
- * ```tsx
149
- * <TooltipProvider delay={200}>
150
- * <Tooltip>...</Tooltip>
151
- * <Tooltip>...</Tooltip>
152
- * </TooltipProvider>
153
- * ```
154
- */
155
- export interface ITooltipProviderProps
156
- extends React.ComponentProps<typeof TooltipPrimitive.Provider> {
157
- /** Style slot overrides. */
158
- slots?: SlotOverrides<TooltipSlot>;
159
- }
160
-
161
- /**
162
- * Props for the `TooltipTrigger` component.
163
- * Renders the element that shows the tooltip on hover/focus.
164
- *
165
- * @example
166
- * ```tsx
167
- * <TooltipTrigger>
168
- * <Button>Hover me</Button>
169
- * </TooltipTrigger>
170
- * ```
171
- */
172
- export interface ITooltipTriggerProps
173
- extends React.ComponentProps<typeof TooltipPrimitive.Trigger> {
174
- /** Style slot overrides. */
175
- slots?: SlotOverrides<TooltipSlot>;
176
- }
177
-
178
- /**
179
- * Props for the `TooltipPortal` component.
180
- * Renders children into a React portal with AnimatePresence for exit animations.
181
- * The `keepMounted` prop is handled internally and cannot be overridden.
182
- *
183
- * @example
184
- * ```tsx
185
- * <TooltipPortal>
186
- * <TooltipPositioner>
187
- * <TooltipPopup>...</TooltipPopup>
188
- * </TooltipPositioner>
189
- * </TooltipPortal>
190
- * ```
191
- */
192
- export interface ITooltipPortalProps
193
- extends Omit<
194
- React.ComponentProps<typeof TooltipPrimitive.Portal>,
195
- 'keepMounted'
196
- > {
197
- /** Style slot overrides. */
198
- slots?: SlotOverrides<TooltipSlot>;
199
- }
200
-
201
- /**
202
- * Props for the `TooltipPositioner` component.
203
- * Handles automatic positioning relative to the trigger.
204
- *
205
- * @example
206
- * ```tsx
207
- * <TooltipPositioner sideOffset={4}>
208
- * <TooltipPopup>Content</TooltipPopup>
209
- * </TooltipPositioner>
210
- * ```
211
- */
212
- export interface ITooltipPositionerProps
213
- extends React.ComponentProps<typeof TooltipPrimitive.Positioner> {
214
- /** Style slot overrides. */
215
- slots?: SlotOverrides<TooltipSlot>;
216
- }
217
-
218
- /**
219
- * Props for the `TooltipPopup` component.
220
- * The main content container with scale entrance animation.
221
- * Supports cursor-following via spring-animated motion values.
222
- *
223
- * @example
224
- * ```tsx
225
- * <TooltipPopup className="px-3 py-1.5 text-sm">
226
- * Helpful information
227
- * </TooltipPopup>
228
- * ```
229
- */
230
- export interface ITooltipPopupProps
231
- extends Omit<
232
- Omit<React.ComponentProps<typeof TooltipPrimitive.Popup>, 'render'>,
233
- keyof HTMLMotionProps<'div'>
234
- >,
235
- HTMLMotionProps<'div'> {
236
- /** Style slot overrides. */
237
- slots?: SlotOverrides<TooltipSlot>;
238
- }
239
-
240
- /**
241
- * Props for the `TooltipArrow` component.
242
- * Renders a directional arrow pointing toward the trigger.
243
- *
244
- * @example
245
- * ```tsx
246
- * <TooltipArrow className="fill-primary" />
247
- * ```
248
- */
249
- export interface ITooltipArrowProps
250
- extends React.ComponentProps<typeof TooltipPrimitive.Arrow> {
251
- /** Style slot overrides. */
252
- slots?: SlotOverrides<TooltipSlot>;
253
- }