@mks2508/mks-ui 0.7.0 → 0.8.1

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 (214) hide show
  1. package/dist/react-ui/blocks/Terminal/TerminalDisplay.styles.d.ts +1 -1
  2. package/dist/react-ui/blocks/Terminal/TerminalDisplay.types.d.ts +1 -1
  3. package/dist/react-ui/blocks/Terminal/components/LogLineBadges/LogLineBadges.styles.d.ts +1 -1
  4. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge/TerminalLogBadge.styles.d.ts +1 -1
  5. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge/TerminalLogBadge.types.d.ts +1 -1
  6. package/dist/react-ui/blocks/Terminal/controls/TerminalActionBar/TerminalActionBar.styles.d.ts +1 -1
  7. package/dist/react-ui/blocks/Terminal/controls/TerminalActionBar/TerminalActionBar.types.d.ts +1 -1
  8. package/dist/react-ui/blocks/Terminal/controls/TerminalConnectionStatus/TerminalConnectionStatus.styles.d.ts +1 -1
  9. package/dist/react-ui/blocks/Terminal/controls/TerminalConnectionStatus/TerminalConnectionStatus.types.d.ts +1 -1
  10. package/dist/react-ui/blocks/Terminal/controls/TerminalFontControls/TerminalFontControls.styles.d.ts +1 -1
  11. package/dist/react-ui/blocks/Terminal/controls/TerminalFontControls/TerminalFontControls.types.d.ts +1 -1
  12. package/dist/react-ui/blocks/Terminal/controls/TerminalSplitButton/TerminalSplitButton.styles.d.ts +1 -1
  13. package/dist/react-ui/blocks/Terminal/controls/TerminalSplitButton/TerminalSplitButton.types.d.ts +1 -1
  14. package/dist/react-ui/blocks/Terminal/controls/TerminalStatusBar/TerminalStatusBar.styles.d.ts +1 -1
  15. package/dist/react-ui/blocks/Terminal/controls/TerminalStatusBar/TerminalStatusBar.types.d.ts +1 -1
  16. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel/TerminalDebugPanel.styles.d.ts +1 -1
  17. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel/TerminalDebugPanel.types.d.ts +1 -1
  18. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown/TerminalFilterDropdown.styles.d.ts +1 -1
  19. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown/TerminalFilterDropdown.types.d.ts +1 -1
  20. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs/TerminalFilterTabs.styles.d.ts +1 -1
  21. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs/TerminalFilterTabs.types.d.ts +1 -1
  22. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelWterm.d.ts +0 -1
  23. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelWterm.d.ts.map +1 -1
  24. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelWterm.js +56 -18
  25. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel/TerminalLogsPanel.styles.d.ts +1 -1
  26. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel/TerminalLogsPanel.types.d.ts +1 -1
  27. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.styles.d.ts +1 -1
  28. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +1 -1
  29. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter/TerminalPanelFooter.styles.d.ts +1 -1
  30. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter/TerminalPanelFooter.types.d.ts +1 -1
  31. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader/TerminalPanelHeader.styles.d.ts +1 -1
  32. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader/TerminalPanelHeader.types.d.ts +1 -1
  33. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar/TerminalPanelToolbar.styles.d.ts +1 -1
  34. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar/TerminalPanelToolbar.types.d.ts +1 -1
  35. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl/TerminalSessionControl.styles.d.ts +1 -1
  36. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl/TerminalSessionControl.types.d.ts +1 -1
  37. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs/TerminalSessionTabs.styles.d.ts +1 -1
  38. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs/TerminalSessionTabs.types.d.ts +1 -1
  39. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover/TerminalSettingsPopover.styles.d.ts +1 -1
  40. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover/TerminalSettingsPopover.types.d.ts +1 -1
  41. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector/TerminalThemeSelector.styles.d.ts +1 -1
  42. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector/TerminalThemeSelector.types.d.ts +1 -1
  43. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts +8 -3
  44. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts.map +1 -1
  45. package/dist/react-ui/index.js +24 -1
  46. package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
  47. package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
  48. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts +109 -0
  49. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts.map +1 -0
  50. package/dist/react-ui/primitives/DotMatrix/dot-matrix-B8DHjPGb.css +364 -0
  51. package/dist/react-ui/primitives/DotMatrix/dot-matrix.js +0 -0
  52. package/dist/react-ui/primitives/DotMatrix/index.d.ts +7 -0
  53. package/dist/react-ui/primitives/DotMatrix/index.d.ts.map +1 -0
  54. package/dist/react-ui/primitives/DotMatrix/index.js +185 -0
  55. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts +32 -0
  56. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts.map +1 -0
  57. package/dist/react-ui/primitives/DotMatrix/patterns.js +175 -0
  58. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts +100 -0
  59. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts.map +1 -0
  60. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.js +20 -0
  61. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing-surface-DfdjAg5U.css +112 -0
  62. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing-surface.js +0 -0
  63. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts +36 -0
  64. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts.map +1 -0
  65. package/dist/react-ui/primitives/GooeyMorphingSurface/index.js +141 -0
  66. package/dist/react-ui/primitives/index.d.ts +2 -0
  67. package/dist/react-ui/primitives/index.d.ts.map +1 -1
  68. package/dist/react-ui/primitives/index.js +4 -0
  69. package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
  70. package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
  71. package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
  72. package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
  73. package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
  74. package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
  75. package/dist/react-ui/ui/Badge/Badge.styles.d.ts +2 -2
  76. package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
  77. package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
  78. package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
  79. package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
  80. package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
  81. package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
  82. package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
  83. package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
  84. package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
  85. package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +1 -1
  86. package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
  87. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +2 -2
  88. package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
  89. package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
  90. package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
  91. package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
  92. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
  93. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
  94. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +1 -1
  95. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +1 -1
  96. package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
  97. package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
  98. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts +25 -0
  99. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts.map +1 -0
  100. package/dist/react-ui/ui/FileIcon/FileIcon.styles.js +31 -0
  101. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts +89 -0
  102. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts.map +1 -0
  103. package/dist/react-ui/ui/FileIcon/index.d.ts +46 -0
  104. package/dist/react-ui/ui/FileIcon/index.d.ts.map +1 -0
  105. package/dist/react-ui/ui/FileIcon/index.js +138 -0
  106. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts +47 -0
  107. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts.map +1 -0
  108. package/dist/react-ui/ui/FileItem/FileItem.styles.js +60 -0
  109. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts +84 -0
  110. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts.map +1 -0
  111. package/dist/react-ui/ui/FileItem/index.d.ts +48 -0
  112. package/dist/react-ui/ui/FileItem/index.d.ts.map +1 -0
  113. package/dist/react-ui/ui/FileItem/index.js +124 -0
  114. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts +34 -0
  115. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts.map +1 -0
  116. package/dist/react-ui/ui/FilePanel/FilePanel.styles.js +57 -0
  117. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts +55 -0
  118. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts.map +1 -0
  119. package/dist/react-ui/ui/FilePanel/index.d.ts +55 -0
  120. package/dist/react-ui/ui/FilePanel/index.d.ts.map +1 -0
  121. package/dist/react-ui/ui/FilePanel/index.js +107 -0
  122. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts +31 -0
  123. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts.map +1 -0
  124. package/dist/react-ui/ui/FileTree/FileTree.styles.js +45 -0
  125. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts +95 -0
  126. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts.map +1 -0
  127. package/dist/react-ui/ui/FileTree/index.d.ts +60 -0
  128. package/dist/react-ui/ui/FileTree/index.d.ts.map +1 -0
  129. package/dist/react-ui/ui/FileTree/index.js +226 -0
  130. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts +35 -0
  131. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts.map +1 -0
  132. package/dist/react-ui/ui/GooeyButton/gooey-button-8rHWiw0w.css +47 -0
  133. package/dist/react-ui/ui/GooeyButton/gooey-button.js +0 -0
  134. package/dist/react-ui/ui/GooeyButton/index.d.ts +26 -0
  135. package/dist/react-ui/ui/GooeyButton/index.d.ts.map +1 -0
  136. package/dist/react-ui/ui/GooeyButton/index.js +118 -0
  137. package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
  138. package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
  139. package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
  140. package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
  141. package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
  142. package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
  143. package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
  144. package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
  145. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts +23 -0
  146. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts.map +1 -0
  147. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.js +32 -0
  148. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts +43 -0
  149. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts.map +1 -0
  150. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts +33 -0
  151. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts.map +1 -0
  152. package/dist/react-ui/ui/MiddleTruncatePath/index.js +60 -0
  153. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts +17 -0
  154. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts.map +1 -0
  155. package/dist/react-ui/ui/OperationCard/OperationCard.context.js +27 -0
  156. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts +19 -0
  157. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts.map +1 -0
  158. package/dist/react-ui/ui/OperationCard/OperationCard.styles.js +39 -0
  159. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts +188 -0
  160. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts.map +1 -0
  161. package/dist/react-ui/ui/OperationCard/index.d.ts +45 -0
  162. package/dist/react-ui/ui/OperationCard/index.d.ts.map +1 -0
  163. package/dist/react-ui/ui/OperationCard/index.js +118 -0
  164. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts +3 -0
  165. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts.map +1 -0
  166. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.js +86 -0
  167. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts +14 -0
  168. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts.map +1 -0
  169. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.js +62 -0
  170. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts +3 -0
  171. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts.map +1 -0
  172. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.js +37 -0
  173. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts +3 -0
  174. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts.map +1 -0
  175. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.js +42 -0
  176. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts +3 -0
  177. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts.map +1 -0
  178. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.js +53 -0
  179. package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
  180. package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
  181. package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
  182. package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
  183. package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
  184. package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
  185. package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
  186. package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
  187. package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
  188. package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
  189. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +4 -4
  190. package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +3 -3
  191. package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
  192. package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
  193. package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
  194. package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
  195. package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
  196. package/dist/react-ui/ui/index.d.ts +7 -0
  197. package/dist/react-ui/ui/index.d.ts.map +1 -1
  198. package/dist/react-ui/ui/index.js +19 -0
  199. package/package.json +2 -2
  200. package/dist/index.css +0 -1059
  201. package/dist/react-ui/blocks/Sidebar/animations/tooltip.css +0 -330
  202. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown/terminal-filter-dropdown.module.css +0 -60
  203. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs/terminal-session-tabs.module.css +0 -60
  204. package/dist/react-ui/components/MorphingPopover/morphing-popover.module.css +0 -154
  205. package/dist/react-ui/primitives/waapi/Morph/techniques/useViewTransitions.module.css +0 -20
  206. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +0 -369
  207. package/dist/react-ui/ui/Tabs/Tabs.css +0 -38
  208. /package/dist/{css/blocks-Sidebar-animations-tooltip.css → react-ui/blocks/Sidebar/animations/tooltip-keyframes-DRT9W6Xj.css} +0 -0
  209. /package/dist/{css/blocks-Terminal-panel-TerminalFilterDropdown-terminal-filter-dropdown.module.css → react-ui/blocks/Terminal/panel/TerminalFilterDropdown/terminal-filter-dropdown.module-G5zpw08N.css} +0 -0
  210. /package/dist/{css/blocks-Terminal-panel-TerminalSessionTabs-terminal-session-tabs.module.css → react-ui/blocks/Terminal/panel/TerminalSessionTabs/terminal-session-tabs.module-BAOuAeiX.css} +0 -0
  211. /package/dist/{css/components-MorphingPopover-morphing-popover.module.css → react-ui/components/MorphingPopover/morphing-popover.module-T3s-wJN-.css} +0 -0
  212. /package/dist/{css/primitives-waapi-Morph-techniques-useViewTransitions.module.css → react-ui/primitives/waapi/Morph/techniques/useViewTransitions.module-DNDWYN8q.css} +0 -0
  213. /package/dist/{css/ui-DynamicToggle-DynamicToggle.css → react-ui/ui/DynamicToggle/DynamicToggle-DY2Hle7P.css} +0 -0
  214. /package/dist/{css/ui-Tabs-Tabs.css → react-ui/ui/Tabs/Tabs-DqzZRGB3.css} +0 -0
@@ -0,0 +1,185 @@
1
+ 'use client';
2
+
3
+ import { cn } from "../../lib/utils.js";
4
+ import "./dot-matrix.js";
5
+ import { DOT_MATRIX_PATTERNS, buildDelays } from "./patterns.js";
6
+ import { useEffect, useId, useMemo } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/react-ui/primitives/DotMatrix/index.tsx
10
+ /**
11
+ * DotMatrix — pattern-driven rows×cols grid with progressive-fill cycle.
12
+ *
13
+ * - Cells light up one at a time in `pattern` order (`wave-lr` fills
14
+ * left-to-right, `spiral-cw` fills outward-in, etc.). Once lit they
15
+ * stay on until the cycle resets.
16
+ * - While `status='running'` the root runs a single CSS animation
17
+ * that drives `--dm-phase` from 0 → 1 (fill) → held at 1 (hold) →
18
+ * snapped to 0 (reset/rest). Each cell computes its opacity from
19
+ * `(phase − threshold) × edgeSharpness`, where `threshold` is its
20
+ * position in the fill sequence (0..1). One animation per matrix
21
+ * regardless of cell count.
22
+ * - Status flips to `idle / success / failed / cancelled` swap to
23
+ * one-shot final keyframes that force EVERY cell to the status
24
+ * colour (all on for success, all destructive for failed, all
25
+ * muted for cancelled).
26
+ *
27
+ * @module @mks2508/mks-ui/react/primitives/DotMatrix
28
+ */
29
+ const BLOOM_SVG_ID = "dm-bloom-svg";
30
+ const DEFAULT_BLOOM = 2;
31
+ function ensureBloomSvg() {
32
+ if (typeof document === "undefined") return null;
33
+ let svg = document.getElementById(BLOOM_SVG_ID);
34
+ if (svg) return svg;
35
+ const ns = "http://www.w3.org/2000/svg";
36
+ svg = document.createElementNS(ns, "svg");
37
+ svg.setAttribute("id", BLOOM_SVG_ID);
38
+ svg.setAttribute("aria-hidden", "true");
39
+ svg.setAttribute("style", "position:absolute;width:0;height:0;overflow:hidden");
40
+ svg.appendChild(document.createElementNS(ns, "defs"));
41
+ document.body.appendChild(svg);
42
+ return svg;
43
+ }
44
+ function installBloomFilter(id, amount) {
45
+ const svg = ensureBloomSvg();
46
+ if (!svg) return;
47
+ const defs = svg.firstChild;
48
+ const existing = document.getElementById(id);
49
+ if (existing) existing.parentNode?.removeChild(existing);
50
+ const ns = "http://www.w3.org/2000/svg";
51
+ const filter = document.createElementNS(ns, "filter");
52
+ filter.setAttribute("id", id);
53
+ filter.setAttribute("x", "-100%");
54
+ filter.setAttribute("y", "-100%");
55
+ filter.setAttribute("width", "300%");
56
+ filter.setAttribute("height", "300%");
57
+ const matrix = document.createElementNS(ns, "feColorMatrix");
58
+ matrix.setAttribute("in", "SourceGraphic");
59
+ matrix.setAttribute("type", "matrix");
60
+ matrix.setAttribute("values", "2 0 0 0 -0.5 0 2 0 0 -0.5 0 0 2 0 -0.5 0 0 0 1 0");
61
+ matrix.setAttribute("result", "bright");
62
+ const blur = document.createElementNS(ns, "feGaussianBlur");
63
+ blur.setAttribute("in", "bright");
64
+ blur.setAttribute("stdDeviation", String(amount));
65
+ blur.setAttribute("result", "glow");
66
+ const blend = document.createElementNS(ns, "feBlend");
67
+ blend.setAttribute("in", "SourceGraphic");
68
+ blend.setAttribute("in2", "glow");
69
+ blend.setAttribute("mode", "screen");
70
+ filter.appendChild(matrix);
71
+ filter.appendChild(blur);
72
+ filter.appendChild(blend);
73
+ defs.appendChild(filter);
74
+ }
75
+ function removeBloomFilter(id) {
76
+ if (typeof document === "undefined") return;
77
+ const el = document.getElementById(id);
78
+ if (el) el.parentNode?.removeChild(el);
79
+ }
80
+ function computeAccentSet(rows, cols, count, row, positions) {
81
+ const set = /* @__PURE__ */ new Set();
82
+ if (positions?.length) {
83
+ for (const [r, c] of positions) if (r >= 0 && r < rows && c >= 0 && c < cols) set.add(r * cols + c);
84
+ return set;
85
+ }
86
+ const n = Math.max(0, Math.min(count, cols));
87
+ if (n === 0) return set;
88
+ const startCol = Math.floor((cols - n) / 2);
89
+ if (row === "top" || row === "both") for (let i = 0; i < n; i++) set.add(startCol + i);
90
+ if (row === "bottom" || row === "both") for (let i = 0; i < n; i++) set.add((rows - 1) * cols + startCol + i);
91
+ return set;
92
+ }
93
+ function DotMatrix({ rows = 6, cols = 18, pattern = "snake", patternStep = 120, holdSteps = 6, restSteps = 4, edgeSharpness = 50, progress, status = "running", color = "foreground", bloom = true, variant = "glow", accentCount = 0, accentRow = "top", accentPositions, slots, className, "aria-label": ariaLabel }) {
94
+ const total = rows * cols;
95
+ const reactId = useId().replace(/:/g, "");
96
+ const bloomFilterId = `dm-bloom-${reactId}`;
97
+ const kfPhaseName = `dmph-${reactId}`;
98
+ const accentSet = useMemo(() => computeAccentSet(rows, cols, accentCount, accentRow, accentPositions), [
99
+ rows,
100
+ cols,
101
+ accentCount,
102
+ accentRow,
103
+ accentPositions
104
+ ]);
105
+ useEffect(() => {
106
+ if (!bloom) {
107
+ removeBloomFilter(bloomFilterId);
108
+ return;
109
+ }
110
+ installBloomFilter(bloomFilterId, typeof bloom === "number" ? bloom : DEFAULT_BLOOM);
111
+ return () => removeBloomFilter(bloomFilterId);
112
+ }, [bloom, bloomFilterId]);
113
+ const ranks = useMemo(() => buildDelays(pattern, rows, cols, 1), [
114
+ pattern,
115
+ rows,
116
+ cols
117
+ ]);
118
+ const maxRank = ranks.length > 0 ? Math.max(...ranks) : 0;
119
+ const fillSteps = maxRank + 1;
120
+ const cycleSteps = Math.max(1, fillSteps + holdSteps + restSteps);
121
+ const cycleTotalMs = cycleSteps * patternStep;
122
+ const fillEndPct = fillSteps / cycleSteps * 100;
123
+ const holdEndPct = (fillSteps + holdSteps) / cycleSteps * 100;
124
+ const resetSnapPct = Math.min(100, holdEndPct + .05);
125
+ const keyframesCSS = useMemo(() => {
126
+ return `
127
+ @keyframes ${kfPhaseName} {
128
+ 0% { --dm-phase: 0; }
129
+ ${fillEndPct.toFixed(3)}% { --dm-phase: 1; }
130
+ ${holdEndPct.toFixed(3)}% { --dm-phase: 1; }
131
+ ${resetSnapPct.toFixed(3)}% { --dm-phase: 0; }
132
+ 100% { --dm-phase: 0; }
133
+ }`;
134
+ }, [
135
+ kfPhaseName,
136
+ fillEndPct,
137
+ holdEndPct,
138
+ resetSnapPct
139
+ ]);
140
+ const finalStagger = useMemo(() => {
141
+ if (maxRank <= 0) return new Array(ranks.length).fill(0);
142
+ const w = 220;
143
+ return ranks.map((r) => Math.round(r / maxRank * w));
144
+ }, [ranks, maxRank]);
145
+ const N = Math.max(1, maxRank + 1);
146
+ const isControlled = typeof progress === "number";
147
+ const clampedProgress = isControlled ? Math.max(0, Math.min(1, progress)) : void 0;
148
+ const effectiveSharpness = isControlled ? N : edgeSharpness;
149
+ const rootStyle = {
150
+ gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
151
+ ["--dm-cycle-total"]: `${cycleTotalMs}ms`,
152
+ ["--dm-edge-sharpness"]: String(effectiveSharpness),
153
+ ...isControlled ? { ["--dm-phase"]: String(clampedProgress) } : { ["--dm-anim-phase"]: kfPhaseName },
154
+ ...bloom ? { filter: `url(#${bloomFilterId})` } : {}
155
+ };
156
+ const paletteClass = paletteClassFor(color);
157
+ return /* @__PURE__ */ jsxs(Fragment, { children: [!isControlled && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: keyframesCSS } }), /* @__PURE__ */ jsx("div", {
158
+ className: cn("dm-root", paletteClass, slots?.root, className),
159
+ style: rootStyle,
160
+ role: "img",
161
+ "aria-label": ariaLabel,
162
+ "data-status": status,
163
+ "data-variant": variant,
164
+ "data-pattern": pattern,
165
+ children: Array.from({ length: total }).map((_, i) => {
166
+ const rank = ranks[i] ?? 0;
167
+ const threshold = isControlled ? rank / N : maxRank > 0 ? rank / maxRank : 0;
168
+ return /* @__PURE__ */ jsx("div", {
169
+ "data-accent": accentSet.has(i) ? "true" : void 0,
170
+ className: cn("dm-cell", slots?.cell),
171
+ style: {
172
+ "--dm-threshold": threshold.toFixed(4),
173
+ "--dm-stagger-delay": `${finalStagger[i] ?? 0}ms`
174
+ }
175
+ }, i);
176
+ })
177
+ })] });
178
+ }
179
+ /** @internal */
180
+ function paletteClassFor(color) {
181
+ return `dm--${color}`;
182
+ }
183
+
184
+ //#endregion
185
+ export { DotMatrix };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * DotMatrix patterns — delay-field generators that scale any 3x3
3
+ * pattern from 3-pixel-grid (MetaHeavies) to arbitrary `rows × cols`.
4
+ *
5
+ * Each generator returns a flat array of length `rows × cols` indexed
6
+ * by physical position (`r * cols + c`). Values are delays in ms that
7
+ * tell the cycle engine *when* each cell flips on/off relative to the
8
+ * start of a phase.
9
+ *
10
+ * Reference: https://github.com/MetaHeavies/3-pixel-grid
11
+ *
12
+ * @module @mks2508/mks-ui/react/primitives/DotMatrix
13
+ */
14
+ /** Available built-in patterns. */
15
+ export type DotMatrixPattern = 'wave-lr' | 'wave-rl' | 'wave-tb' | 'wave-bt' | 'spiral-cw' | 'corners-first' | 'center-out' | 'diagonal-tl' | 'snake' | 'snake-up' | 'cross' | 'checkerboard' | 'rain' | 'pinwheel' | 'converge' | 'zigzag';
16
+ /** Catalogue of all pattern names. Handy for UIs / debug labs. */
17
+ export declare const DOT_MATRIX_PATTERNS: readonly DotMatrixPattern[];
18
+ /**
19
+ * Build the delay array for `pattern` at `rows × cols`, scaled by `step`
20
+ * (ms between successive cells in simple sweep patterns).
21
+ *
22
+ * Always returns an array of exact length `rows * cols`.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const delays = buildDelays('wave-lr', 6, 18, 60);
27
+ * // delays[0]=0, delays[1]=60, ..., delays[17]=1020
28
+ * // delays[18]=0, delays[19]=60, ... (all rows identical for wave-lr)
29
+ * ```
30
+ */
31
+ export declare function buildDelays(pattern: DotMatrixPattern, rows: number, cols: number, step?: number): number[];
32
+ //# sourceMappingURL=patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/primitives/DotMatrix/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,mCAAmC;AACnC,MAAM,MAAM,gBAAgB,GACzB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,GACX,eAAe,GACf,YAAY,GACZ,aAAa,GACb,OAAO,GACP,UAAU,GACV,OAAO,GACP,cAAc,GACd,MAAM,GACN,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAEZ,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAiBjD,CAAC;AA0CX;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAC1B,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,SAAK,GACP,MAAM,EAAE,CAgJV"}
@@ -0,0 +1,175 @@
1
+ //#region src/react-ui/primitives/DotMatrix/patterns.ts
2
+ /** Catalogue of all pattern names. Handy for UIs / debug labs. */
3
+ const DOT_MATRIX_PATTERNS = [
4
+ "snake",
5
+ "snake-up",
6
+ "wave-lr",
7
+ "wave-rl",
8
+ "wave-tb",
9
+ "wave-bt",
10
+ "spiral-cw",
11
+ "corners-first",
12
+ "center-out",
13
+ "diagonal-tl",
14
+ "cross",
15
+ "checkerboard",
16
+ "rain",
17
+ "pinwheel",
18
+ "converge",
19
+ "zigzag"
20
+ ];
21
+ /** Cheap deterministic hash for `rain` — stable across renders. */
22
+ function hash(r, c, rows, cols) {
23
+ const x = r * 9301 + c * 49297 + rows * 233 + cols * 131;
24
+ return Math.abs(x * 2654435761 % 2333) / 2333;
25
+ }
26
+ /** Fill a rank table by walking the grid in clockwise spiral from (0,0). */
27
+ function spiralRanks(rows, cols) {
28
+ const total = rows * cols;
29
+ const ranks = new Array(total).fill(0);
30
+ let top = 0;
31
+ let bottom = rows - 1;
32
+ let left = 0;
33
+ let right = cols - 1;
34
+ let idx = 0;
35
+ while (top <= bottom && left <= right) {
36
+ for (let c = left; c <= right; c++) ranks[top * cols + c] = idx++;
37
+ top++;
38
+ for (let r = top; r <= bottom; r++) ranks[r * cols + right] = idx++;
39
+ right--;
40
+ if (top <= bottom) {
41
+ for (let c = right; c >= left; c--) ranks[bottom * cols + c] = idx++;
42
+ bottom--;
43
+ }
44
+ if (left <= right) {
45
+ for (let r = bottom; r >= top; r--) ranks[r * cols + left] = idx++;
46
+ left++;
47
+ }
48
+ }
49
+ return ranks;
50
+ }
51
+ /**
52
+ * Build the delay array for `pattern` at `rows × cols`, scaled by `step`
53
+ * (ms between successive cells in simple sweep patterns).
54
+ *
55
+ * Always returns an array of exact length `rows * cols`.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const delays = buildDelays('wave-lr', 6, 18, 60);
60
+ * // delays[0]=0, delays[1]=60, ..., delays[17]=1020
61
+ * // delays[18]=0, delays[19]=60, ... (all rows identical for wave-lr)
62
+ * ```
63
+ */
64
+ function buildDelays(pattern, rows, cols, step = 60) {
65
+ const total = rows * cols;
66
+ const delays = new Array(total);
67
+ if (pattern === "wave-lr") {
68
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = c * step;
69
+ return delays;
70
+ }
71
+ if (pattern === "wave-rl") {
72
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = (cols - 1 - c) * step;
73
+ return delays;
74
+ }
75
+ if (pattern === "wave-tb") {
76
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = r * step;
77
+ return delays;
78
+ }
79
+ if (pattern === "wave-bt") {
80
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = (rows - 1 - r) * step;
81
+ return delays;
82
+ }
83
+ if (pattern === "diagonal-tl") {
84
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = (r + c) * step;
85
+ return delays;
86
+ }
87
+ if (pattern === "center-out") {
88
+ const cr = (rows - 1) / 2;
89
+ const cc = (cols - 1) / 2;
90
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = Math.round(Math.hypot(r - cr, c - cc) * step);
91
+ return delays;
92
+ }
93
+ if (pattern === "converge") {
94
+ const cr = (rows - 1) / 2;
95
+ const cc = (cols - 1) / 2;
96
+ const maxDist = Math.hypot(cr, cc);
97
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = Math.round((maxDist - Math.hypot(r - cr, c - cc)) * step);
98
+ return delays;
99
+ }
100
+ if (pattern === "corners-first") {
101
+ const corners = [
102
+ [0, 0],
103
+ [0, cols - 1],
104
+ [rows - 1, 0],
105
+ [rows - 1, cols - 1]
106
+ ];
107
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
108
+ let min = Infinity;
109
+ for (const [cr, cc] of corners) {
110
+ const d = Math.hypot(r - cr, c - cc);
111
+ if (d < min) min = d;
112
+ }
113
+ delays[r * cols + c] = Math.round(min * step);
114
+ }
115
+ return delays;
116
+ }
117
+ if (pattern === "cross") {
118
+ const cr = (rows - 1) / 2;
119
+ const cc = (cols - 1) / 2;
120
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
121
+ const d = Math.min(Math.abs(r - cr), Math.abs(c - cc));
122
+ delays[r * cols + c] = Math.round(d * step);
123
+ }
124
+ return delays;
125
+ }
126
+ if (pattern === "checkerboard") {
127
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = (r + c) % 2 * step * 4;
128
+ return delays;
129
+ }
130
+ if (pattern === "rain") {
131
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) delays[r * cols + c] = Math.round(hash(r, c, rows, cols) * step * Math.max(rows, cols));
132
+ return delays;
133
+ }
134
+ if (pattern === "spiral-cw") {
135
+ const ranks = spiralRanks(rows, cols);
136
+ for (let i = 0; i < total; i++) delays[i] = ranks[i] * step;
137
+ return delays;
138
+ }
139
+ if (pattern === "snake") {
140
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
141
+ const rank = r % 2 === 0 ? r * cols + c : r * cols + (cols - 1 - c);
142
+ delays[r * cols + c] = rank * step;
143
+ }
144
+ return delays;
145
+ }
146
+ if (pattern === "snake-up") {
147
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
148
+ const invRow = rows - 1 - r;
149
+ const rank = invRow % 2 === 0 ? invRow * cols + c : invRow * cols + (cols - 1 - c);
150
+ delays[r * cols + c] = rank * step;
151
+ }
152
+ return delays;
153
+ }
154
+ if (pattern === "zigzag") {
155
+ const bands = Math.max(2, Math.floor(rows / 2));
156
+ for (let r = 0; r < rows; r++) {
157
+ const band = Math.floor(r * bands / rows);
158
+ for (let c = 0; c < cols; c++) {
159
+ const rankInBand = band % 2 === 0 ? c : cols - 1 - c;
160
+ delays[r * cols + c] = (band * cols + rankInBand) * step;
161
+ }
162
+ }
163
+ return delays;
164
+ }
165
+ const cr = (rows - 1) / 2;
166
+ const cc = (cols - 1) / 2;
167
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
168
+ const norm = (Math.atan2(r - cr, c - cc) + Math.PI) / (2 * Math.PI);
169
+ delays[r * cols + c] = Math.round(norm * total * step * .12);
170
+ }
171
+ return delays;
172
+ }
173
+
174
+ //#endregion
175
+ export { DOT_MATRIX_PATTERNS, buildDelays };
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Type surface for the GooeyMorphingSurface primitive.
3
+ *
4
+ * A headless render primitive: given `open` + slot content + a tuning config,
5
+ * it paints an SVG canvas where a pill rect (top) and a card rect (below)
6
+ * are fused by a gaussian-blur + alpha-threshold filter. The consumer owns
7
+ * open/close state — the primitive just reflects it.
8
+ *
9
+ * @module @mks2508/mks-ui/react/primitives/GooeyMorphingSurface
10
+ */
11
+ import type { ReactNode } from 'react';
12
+ /**
13
+ * Tuning knobs for the gooey shape + filter + timing.
14
+ *
15
+ * All values are independent; changing one does not imply re-tuning another.
16
+ * See `DEFAULT_GOOEY_CONFIG` for a baseline.
17
+ */
18
+ export interface IGooeyMorphConfig {
19
+ /** Pill width in px. */
20
+ pillWidth: number;
21
+ /** Pill height in px. The pill radius is derived as pillHeight / 2. */
22
+ pillHeight: number;
23
+ /** Card width in px (open state). */
24
+ cardWidth: number;
25
+ /** Card height in px (open state). */
26
+ cardHeight: number;
27
+ /** Card corner radius in px (open state). */
28
+ cardRadius: number;
29
+ /**
30
+ * Vertical overlap (px) the body rect claims on top of the pill. Tunes
31
+ * how "tight" the metaball throat looks — too small = visible gap, too
32
+ * big = fat neck. Rule of thumb: merge overlap ≥ blur × 1.2.
33
+ */
34
+ mergeOverlap: number;
35
+ /** feGaussianBlur stdDeviation. Bigger = softer, more chicle-like throat. */
36
+ blur: number;
37
+ /** feColorMatrix alpha amplification (bottom-row 4th value). Higher = crisper silhouette. */
38
+ alphaAmp: number;
39
+ /** feColorMatrix alpha offset (bottom-row 5th value). More negative = more bite out of the halo. */
40
+ alphaOffset: number;
41
+ /**
42
+ * CSS color used as the fill for BOTH rects. Must be a single paint
43
+ * source for the alpha threshold to produce a unified silhouette.
44
+ * Accepts any CSS color — tokens (`var(--card)`), hex, oklch, etc.
45
+ */
46
+ fill: string;
47
+ /** Morph duration in ms. */
48
+ durationMs: number;
49
+ /** CSS easing used for shape morph + card content crossfade. */
50
+ easing: string;
51
+ /**
52
+ * Horizontal offset of the pill relative to the card's horizontal center,
53
+ * in pixels. `0` = centered (pill sits on the card's vertical axis).
54
+ * Positive values shift the pill to the right, negative to the left.
55
+ *
56
+ * Useful when the surface is placed near a viewport edge and a centered
57
+ * card would overflow — shift the pill sideways so the card extends into
58
+ * the available space. Values are not clamped; values outside
59
+ * `±(cardWidth - pillWidth) / 2` push the pill past the card edge and the
60
+ * gooey throat will visibly break.
61
+ */
62
+ pillOffsetX: number;
63
+ }
64
+ /** Default tuning — matches the "Default" preset in the sileo-lab workbench. */
65
+ export declare const DEFAULT_GOOEY_CONFIG: IGooeyMorphConfig;
66
+ /** Named slots the consumer can target with className overrides. */
67
+ export interface IGooeyMorphSlots {
68
+ /** The outer host div. */
69
+ root?: string;
70
+ /** The morphing shell (SVG + HTML overlays live inside). */
71
+ shell?: string;
72
+ /** The HTML wrapper that sits on top of the pill SVG rect. */
73
+ pill?: string;
74
+ /** The HTML wrapper that sits on top of the body SVG rect. Receives
75
+ * `open` styling; opacity + pointer-events animate with the card. */
76
+ card?: string;
77
+ }
78
+ export interface IGooeyMorphingSurfaceProps {
79
+ /** Whether the card body is revealed. The consumer owns this state. */
80
+ open: boolean;
81
+ /** Content rendered on top of the pill rect. Typically a label + icon. */
82
+ pill: ReactNode;
83
+ /** Content rendered on top of the body rect (revealed when `open`). */
84
+ card: ReactNode;
85
+ /**
86
+ * Partial config — merged on top of `DEFAULT_GOOEY_CONFIG`. Use this
87
+ * to override a subset without restating the whole config.
88
+ */
89
+ config?: Partial<IGooeyMorphConfig>;
90
+ /** Extra className for the outer host. */
91
+ className?: string;
92
+ /** className overrides per slot. */
93
+ slots?: IGooeyMorphSlots;
94
+ /**
95
+ * `aria-hidden` for the decorative SVG. Defaults to true — content is
96
+ * the pill + card overlays, not the filter rectangles.
97
+ */
98
+ 'aria-hidden'?: boolean;
99
+ }
100
+ //# sourceMappingURL=GooeyMorphingSurface.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GooeyMorphingSurface.types.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,QAAQ,EAAE,MAAM,CAAC;IACjB,oGAAoG;IACpG,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;;;OAUG;IACH,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,EAAE,iBAclC,CAAC;AAMF,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAChC,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;yEACqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,0BAA0B;IAC1C,uEAAuE;IACvE,IAAI,EAAE,OAAO,CAAC;IACd,0EAA0E;IAC1E,IAAI,EAAE,SAAS,CAAC;IAChB,uEAAuE;IACvE,IAAI,EAAE,SAAS,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,20 @@
1
+ //#region src/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.ts
2
+ /** Default tuning — matches the "Default" preset in the sileo-lab workbench. */
3
+ const DEFAULT_GOOEY_CONFIG = {
4
+ pillWidth: 192,
5
+ pillHeight: 36,
6
+ cardWidth: 560,
7
+ cardHeight: 360,
8
+ cardRadius: 22,
9
+ mergeOverlap: 10,
10
+ blur: 8,
11
+ alphaAmp: 20,
12
+ alphaOffset: -10,
13
+ fill: "var(--card)",
14
+ durationMs: 360,
15
+ easing: "cubic-bezier(0.32, 0.72, 0, 1)",
16
+ pillOffsetX: 0
17
+ };
18
+
19
+ //#endregion
20
+ export { DEFAULT_GOOEY_CONFIG };
@@ -0,0 +1,112 @@
1
+ /* =============================================================================
2
+ * GooeyMorphingSurface — CSS layer for the SVG rect morph + HTML overlays.
3
+ *
4
+ * Classes are prefixed `.gms-*` so they act as a manual scope (mks-ui's
5
+ * rolldown build produces empty default-exports for CSS modules, so we use
6
+ * plain CSS with explicit classnames referenced as string literals from
7
+ * the component).
8
+ *
9
+ * Every tunable value comes from inline CSS custom props set by the React
10
+ * component at the root element. No hard-coded dimensions or timings here.
11
+ *
12
+ * Technique recap: two <rect>s inside a <g filter="url(#gooey)">. Body rect
13
+ * is a geometric CLONE of the pill when closed, and morphs into the card
14
+ * geometry (x, y, width, height, rx, ry all interpolate) when open. The
15
+ * gaussian-blur + alpha-threshold filter bends the overlapping silhouettes
16
+ * into a single shape with a soft metaball throat.
17
+ * ============================================================================= */
18
+
19
+ .gms-root {
20
+ position: relative;
21
+ display: inline-block;
22
+ }
23
+
24
+ .gms-shell {
25
+ position: relative;
26
+ width: var(--gms-card-w);
27
+ height: var(--gms-pill-h);
28
+ color: var(--gms-fill);
29
+ transition: height var(--gms-duration) var(--gms-ease);
30
+ /* Drop-shadow follows the fused silhouette. Chained filters = additive
31
+ * shadow layers for depth without a hard box-shadow. */
32
+ filter: drop-shadow(0 16px 38px rgb(0 0 0 / 0.35))
33
+ drop-shadow(0 4px 10px rgb(0 0 0 / 0.18));
34
+ }
35
+
36
+ .gms-shell[data-open='true'] {
37
+ height: calc(var(--gms-pill-h) + var(--gms-card-h));
38
+ }
39
+
40
+ .gms-svg {
41
+ position: absolute;
42
+ top: 0;
43
+ left: 50%;
44
+ transform: translateX(-50%);
45
+ display: block;
46
+ overflow: visible;
47
+ pointer-events: none;
48
+ }
49
+
50
+ .gms-body-rect {
51
+ will-change: x, y, width, height;
52
+ transition:
53
+ x var(--gms-duration) var(--gms-ease),
54
+ y var(--gms-duration) var(--gms-ease),
55
+ width var(--gms-duration) var(--gms-ease),
56
+ height var(--gms-duration) var(--gms-ease),
57
+ rx var(--gms-duration) var(--gms-ease),
58
+ ry var(--gms-duration) var(--gms-ease);
59
+ }
60
+
61
+ .gms-pill {
62
+ position: absolute;
63
+ top: 0;
64
+ left: var(--gms-pill-x);
65
+ width: var(--gms-pill-w);
66
+ height: var(--gms-pill-h);
67
+ display: inline-flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ gap: 0.5rem;
71
+ color: var(--card-foreground);
72
+ pointer-events: none;
73
+ z-index: 2;
74
+ }
75
+
76
+ .gms-card {
77
+ position: absolute;
78
+ top: calc(var(--gms-pill-h) - var(--gms-overlap));
79
+ left: 0;
80
+ width: var(--gms-card-w);
81
+ height: var(--gms-card-h);
82
+ color: var(--card-foreground);
83
+ opacity: 0;
84
+ transform: translateY(4px);
85
+ pointer-events: none;
86
+ z-index: 2;
87
+ overflow: hidden;
88
+ border-radius: var(--gms-card-r);
89
+ transition:
90
+ opacity calc(var(--gms-duration) * 0.35) var(--gms-ease),
91
+ transform calc(var(--gms-duration) * 0.35) var(--gms-ease);
92
+ }
93
+
94
+ .gms-shell[data-open='true'] .gms-card {
95
+ opacity: 1;
96
+ transform: translateY(0);
97
+ pointer-events: auto;
98
+ transition:
99
+ opacity calc(var(--gms-duration) * 0.55) var(--gms-ease)
100
+ calc(var(--gms-duration) * 0.45),
101
+ transform calc(var(--gms-duration) * 0.55) var(--gms-ease)
102
+ calc(var(--gms-duration) * 0.45);
103
+ }
104
+
105
+ @media (prefers-reduced-motion: reduce) {
106
+ .gms-shell,
107
+ .gms-body-rect,
108
+ .gms-card {
109
+ transition-duration: 0.01ms !important;
110
+ }
111
+ }
112
+
@@ -0,0 +1,36 @@
1
+ /**
2
+ * GooeyMorphingSurface — headless pill→card gooey morph primitive.
3
+ *
4
+ * Paints an SVG canvas where a pill-shaped rect sits on top and a card-
5
+ * shaped rect sits below (body). Both rects share a gaussian-blur +
6
+ * alpha-threshold filter that fuses them into a single silhouette with a
7
+ * soft metaball throat wherever they overlap. When `open` is false, the
8
+ * body rect is a geometric clone of the pill (same x/y/w/h/rx) — no extra
9
+ * halo, no pop. When `open` flips to true, all six SVG presentation attrs
10
+ * (x, y, width, height, rx, ry) interpolate in lock-step, producing a
11
+ * continuous morph from pill to card.
12
+ *
13
+ * The primitive is purely presentational: it does not own open state, does
14
+ * not bind click handlers, does not trap focus. Use `<GooeyButton>` for
15
+ * the ergonomic wrapper that adds those behaviours.
16
+ *
17
+ * @module @mks2508/mks-ui/react/primitives/GooeyMorphingSurface
18
+ */
19
+ import './gooey-morphing-surface.css';
20
+ import { type IGooeyMorphingSurfaceProps } from './GooeyMorphingSurface.types';
21
+ export * from './GooeyMorphingSurface.types';
22
+ /**
23
+ * Headless gooey pill→card morph surface.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <GooeyMorphingSurface
28
+ * open={open}
29
+ * pill={<span>Pull origin</span>}
30
+ * card={<ProgressCard transfer={transfer} />}
31
+ * config={{ blur: 12, mergeOverlap: 14 }}
32
+ * />
33
+ * ```
34
+ */
35
+ export declare function GooeyMorphingSurface({ open, pill, card, config: userConfig, className, slots, 'aria-hidden': ariaHidden, }: IGooeyMorphingSurfaceProps): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/primitives/GooeyMorphingSurface/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAEN,KAAK,0BAA0B,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,cAAc,8BAA8B,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EACpC,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,KAAK,EACL,aAAa,EAAE,UAAiB,GAChC,EAAE,0BAA0B,2CAkH5B"}