@mks2508/mks-ui 0.7.0 → 0.8.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 (109) hide show
  1. package/dist/css/primitives-DotMatrix-dot.css +364 -0
  2. package/dist/css/primitives-GooeyMorphingSurface-gooey.css +112 -0
  3. package/dist/css/ui-GooeyButton-gooey.css +43 -0
  4. package/dist/index.css +531 -0
  5. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts +8 -3
  6. package/dist/react-ui/components/MorphingPopover/MorphingPopover.types.d.ts.map +1 -1
  7. package/dist/react-ui/index.js +24 -1
  8. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts +109 -0
  9. package/dist/react-ui/primitives/DotMatrix/DotMatrix.types.d.ts.map +1 -0
  10. package/dist/react-ui/primitives/DotMatrix/dot-matrix.js +0 -0
  11. package/dist/react-ui/primitives/DotMatrix/dot.css +364 -0
  12. package/dist/react-ui/primitives/DotMatrix/index.d.ts +7 -0
  13. package/dist/react-ui/primitives/DotMatrix/index.d.ts.map +1 -0
  14. package/dist/react-ui/primitives/DotMatrix/index.js +185 -0
  15. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts +32 -0
  16. package/dist/react-ui/primitives/DotMatrix/patterns.d.ts.map +1 -0
  17. package/dist/react-ui/primitives/DotMatrix/patterns.js +175 -0
  18. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts +100 -0
  19. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.d.ts.map +1 -0
  20. package/dist/react-ui/primitives/GooeyMorphingSurface/GooeyMorphingSurface.types.js +20 -0
  21. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing-surface.js +0 -0
  22. package/dist/react-ui/primitives/GooeyMorphingSurface/gooey-morphing.css +112 -0
  23. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts +36 -0
  24. package/dist/react-ui/primitives/GooeyMorphingSurface/index.d.ts.map +1 -0
  25. package/dist/react-ui/primitives/GooeyMorphingSurface/index.js +141 -0
  26. package/dist/react-ui/primitives/index.d.ts +2 -0
  27. package/dist/react-ui/primitives/index.d.ts.map +1 -1
  28. package/dist/react-ui/primitives/index.js +4 -0
  29. package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
  30. package/dist/react-ui/ui/Button/Button.styles.d.ts +1 -1
  31. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
  32. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts +25 -0
  33. package/dist/react-ui/ui/FileIcon/FileIcon.styles.d.ts.map +1 -0
  34. package/dist/react-ui/ui/FileIcon/FileIcon.styles.js +31 -0
  35. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts +89 -0
  36. package/dist/react-ui/ui/FileIcon/FileIcon.types.d.ts.map +1 -0
  37. package/dist/react-ui/ui/FileIcon/index.d.ts +46 -0
  38. package/dist/react-ui/ui/FileIcon/index.d.ts.map +1 -0
  39. package/dist/react-ui/ui/FileIcon/index.js +138 -0
  40. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts +47 -0
  41. package/dist/react-ui/ui/FileItem/FileItem.styles.d.ts.map +1 -0
  42. package/dist/react-ui/ui/FileItem/FileItem.styles.js +60 -0
  43. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts +84 -0
  44. package/dist/react-ui/ui/FileItem/FileItem.types.d.ts.map +1 -0
  45. package/dist/react-ui/ui/FileItem/index.d.ts +48 -0
  46. package/dist/react-ui/ui/FileItem/index.d.ts.map +1 -0
  47. package/dist/react-ui/ui/FileItem/index.js +124 -0
  48. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts +34 -0
  49. package/dist/react-ui/ui/FilePanel/FilePanel.styles.d.ts.map +1 -0
  50. package/dist/react-ui/ui/FilePanel/FilePanel.styles.js +57 -0
  51. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts +55 -0
  52. package/dist/react-ui/ui/FilePanel/FilePanel.types.d.ts.map +1 -0
  53. package/dist/react-ui/ui/FilePanel/index.d.ts +55 -0
  54. package/dist/react-ui/ui/FilePanel/index.d.ts.map +1 -0
  55. package/dist/react-ui/ui/FilePanel/index.js +107 -0
  56. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts +31 -0
  57. package/dist/react-ui/ui/FileTree/FileTree.styles.d.ts.map +1 -0
  58. package/dist/react-ui/ui/FileTree/FileTree.styles.js +45 -0
  59. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts +95 -0
  60. package/dist/react-ui/ui/FileTree/FileTree.types.d.ts.map +1 -0
  61. package/dist/react-ui/ui/FileTree/index.d.ts +60 -0
  62. package/dist/react-ui/ui/FileTree/index.d.ts.map +1 -0
  63. package/dist/react-ui/ui/FileTree/index.js +226 -0
  64. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts +35 -0
  65. package/dist/react-ui/ui/GooeyButton/GooeyButton.types.d.ts.map +1 -0
  66. package/dist/react-ui/ui/GooeyButton/gooey-button.js +0 -0
  67. package/dist/react-ui/ui/GooeyButton/gooey.css +43 -0
  68. package/dist/react-ui/ui/GooeyButton/index.d.ts +26 -0
  69. package/dist/react-ui/ui/GooeyButton/index.d.ts.map +1 -0
  70. package/dist/react-ui/ui/GooeyButton/index.js +109 -0
  71. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts +23 -0
  72. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.d.ts.map +1 -0
  73. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.styles.js +32 -0
  74. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts +43 -0
  75. package/dist/react-ui/ui/MiddleTruncatePath/MiddleTruncatePath.types.d.ts.map +1 -0
  76. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts +33 -0
  77. package/dist/react-ui/ui/MiddleTruncatePath/index.d.ts.map +1 -0
  78. package/dist/react-ui/ui/MiddleTruncatePath/index.js +60 -0
  79. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts +17 -0
  80. package/dist/react-ui/ui/OperationCard/OperationCard.context.d.ts.map +1 -0
  81. package/dist/react-ui/ui/OperationCard/OperationCard.context.js +27 -0
  82. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts +19 -0
  83. package/dist/react-ui/ui/OperationCard/OperationCard.styles.d.ts.map +1 -0
  84. package/dist/react-ui/ui/OperationCard/OperationCard.styles.js +39 -0
  85. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts +188 -0
  86. package/dist/react-ui/ui/OperationCard/OperationCard.types.d.ts.map +1 -0
  87. package/dist/react-ui/ui/OperationCard/index.d.ts +45 -0
  88. package/dist/react-ui/ui/OperationCard/index.d.ts.map +1 -0
  89. package/dist/react-ui/ui/OperationCard/index.js +118 -0
  90. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts +3 -0
  91. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.d.ts.map +1 -0
  92. package/dist/react-ui/ui/OperationCard/parts/OperationCardActions.js +86 -0
  93. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts +14 -0
  94. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.d.ts.map +1 -0
  95. package/dist/react-ui/ui/OperationCard/parts/OperationCardHeader.js +62 -0
  96. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts +3 -0
  97. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.d.ts.map +1 -0
  98. package/dist/react-ui/ui/OperationCard/parts/OperationCardProgress.js +37 -0
  99. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts +3 -0
  100. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.d.ts.map +1 -0
  101. package/dist/react-ui/ui/OperationCard/parts/OperationCardStats.js +42 -0
  102. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts +3 -0
  103. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.d.ts.map +1 -0
  104. package/dist/react-ui/ui/OperationCard/parts/OperationCardVisualizer.js +53 -0
  105. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +3 -3
  106. package/dist/react-ui/ui/index.d.ts +7 -0
  107. package/dist/react-ui/ui/index.d.ts.map +1 -1
  108. package/dist/react-ui/ui/index.js +19 -0
  109. package/package.json +1 -1
@@ -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"}
@@ -0,0 +1,141 @@
1
+ import { cn } from "../../lib/utils.js";
2
+ import "./gooey-morphing-surface.js";
3
+ import { DEFAULT_GOOEY_CONFIG } from "./GooeyMorphingSurface.types.js";
4
+ import { useId } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region src/react-ui/primitives/GooeyMorphingSurface/index.tsx
8
+ /**
9
+ * GooeyMorphingSurface — headless pill→card gooey morph primitive.
10
+ *
11
+ * Paints an SVG canvas where a pill-shaped rect sits on top and a card-
12
+ * shaped rect sits below (body). Both rects share a gaussian-blur +
13
+ * alpha-threshold filter that fuses them into a single silhouette with a
14
+ * soft metaball throat wherever they overlap. When `open` is false, the
15
+ * body rect is a geometric clone of the pill (same x/y/w/h/rx) — no extra
16
+ * halo, no pop. When `open` flips to true, all six SVG presentation attrs
17
+ * (x, y, width, height, rx, ry) interpolate in lock-step, producing a
18
+ * continuous morph from pill to card.
19
+ *
20
+ * The primitive is purely presentational: it does not own open state, does
21
+ * not bind click handlers, does not trap focus. Use `<GooeyButton>` for
22
+ * the ergonomic wrapper that adds those behaviours.
23
+ *
24
+ * @module @mks2508/mks-ui/react/primitives/GooeyMorphingSurface
25
+ */
26
+ /**
27
+ * Headless gooey pill→card morph surface.
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * <GooeyMorphingSurface
32
+ * open={open}
33
+ * pill={<span>Pull origin</span>}
34
+ * card={<ProgressCard transfer={transfer} />}
35
+ * config={{ blur: 12, mergeOverlap: 14 }}
36
+ * />
37
+ * ```
38
+ */
39
+ function GooeyMorphingSurface({ open, pill, card, config: userConfig, className, slots, "aria-hidden": ariaHidden = true }) {
40
+ const filterId = `gms-filter-${useId().replace(/:/g, "")}`;
41
+ const { pillWidth, pillHeight, cardWidth, cardHeight, cardRadius, mergeOverlap, blur, alphaAmp, alphaOffset, fill, durationMs, easing, pillOffsetX } = {
42
+ ...DEFAULT_GOOEY_CONFIG,
43
+ ...userConfig
44
+ };
45
+ const pillRadius = pillHeight / 2;
46
+ const svgHeight = pillHeight + cardHeight + mergeOverlap;
47
+ const pillX = (cardWidth - pillWidth) / 2 + pillOffsetX;
48
+ const bodyX = open ? 0 : pillX;
49
+ const bodyY = open ? pillHeight - mergeOverlap : 0;
50
+ const bodyW = open ? cardWidth : pillWidth;
51
+ const bodyH = open ? cardHeight + mergeOverlap : pillHeight;
52
+ const bodyR = open ? cardRadius : pillRadius;
53
+ const rootStyle = {
54
+ "--gms-pill-w": `${pillWidth}px`,
55
+ "--gms-pill-h": `${pillHeight}px`,
56
+ "--gms-card-w": `${cardWidth}px`,
57
+ "--gms-card-h": `${cardHeight}px`,
58
+ "--gms-card-r": `${cardRadius}px`,
59
+ "--gms-overlap": `${mergeOverlap}px`,
60
+ "--gms-pill-x": `${pillX}px`,
61
+ "--gms-fill": fill,
62
+ "--gms-duration": `${durationMs}ms`,
63
+ "--gms-ease": easing
64
+ };
65
+ const alphaMatrix = `1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${alphaAmp} ${alphaOffset}`;
66
+ return /* @__PURE__ */ jsx("div", {
67
+ className: cn("gms-root", slots?.root, className),
68
+ style: rootStyle,
69
+ children: /* @__PURE__ */ jsxs("div", {
70
+ className: cn("gms-shell", slots?.shell),
71
+ "data-open": open,
72
+ children: [
73
+ /* @__PURE__ */ jsxs("svg", {
74
+ className: "gms-svg",
75
+ width: cardWidth,
76
+ height: svgHeight,
77
+ "aria-hidden": ariaHidden,
78
+ children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("filter", {
79
+ id: filterId,
80
+ x: "-20%",
81
+ y: "-20%",
82
+ width: "140%",
83
+ height: "140%",
84
+ colorInterpolationFilters: "sRGB",
85
+ children: [
86
+ /* @__PURE__ */ jsx("feGaussianBlur", {
87
+ in: "SourceGraphic",
88
+ stdDeviation: blur,
89
+ result: "blur"
90
+ }),
91
+ /* @__PURE__ */ jsx("feColorMatrix", {
92
+ in: "blur",
93
+ mode: "matrix",
94
+ values: alphaMatrix,
95
+ result: "goo"
96
+ }),
97
+ /* @__PURE__ */ jsx("feComposite", {
98
+ in: "SourceGraphic",
99
+ in2: "goo",
100
+ operator: "atop"
101
+ })
102
+ ]
103
+ }) }), /* @__PURE__ */ jsxs("g", {
104
+ filter: `url(#${filterId})`,
105
+ children: [/* @__PURE__ */ jsx("rect", {
106
+ x: pillX,
107
+ y: 0,
108
+ width: pillWidth,
109
+ height: pillHeight,
110
+ rx: pillRadius,
111
+ ry: pillRadius,
112
+ fill
113
+ }), /* @__PURE__ */ jsx("rect", {
114
+ className: "gms-body-rect",
115
+ fill,
116
+ style: {
117
+ x: bodyX,
118
+ y: bodyY,
119
+ width: bodyW,
120
+ height: bodyH,
121
+ rx: bodyR,
122
+ ry: bodyR
123
+ }
124
+ })]
125
+ })]
126
+ }),
127
+ /* @__PURE__ */ jsx("div", {
128
+ className: cn("gms-pill", slots?.pill),
129
+ children: pill
130
+ }),
131
+ /* @__PURE__ */ jsx("div", {
132
+ className: cn("gms-card", slots?.card),
133
+ children: card
134
+ })
135
+ ]
136
+ })
137
+ });
138
+ }
139
+
140
+ //#endregion
141
+ export { GooeyMorphingSurface };
@@ -9,5 +9,7 @@ export * from './Slot';
9
9
  export * from './Highlight';
10
10
  export * from './AutoHeight';
11
11
  export * from './CountingNumber';
12
+ export * from './DotMatrix';
13
+ export * from './GooeyMorphingSurface';
12
14
  export * from './waapi';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-ui/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-ui/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AAGvC,cAAc,SAAS,CAAC"}
@@ -2,6 +2,10 @@ import { Slot } from "./Slot/index.js";
2
2
  import { Highlight, HighlightItem, useHighlight } from "./Highlight/index.js";
3
3
  import { AutoHeight } from "./AutoHeight/index.js";
4
4
  import { CountingNumber } from "./CountingNumber/index.js";
5
+ import { DOT_MATRIX_PATTERNS, buildDelays } from "./DotMatrix/patterns.js";
6
+ import { DotMatrix } from "./DotMatrix/index.js";
7
+ import { DEFAULT_GOOEY_CONFIG } from "./GooeyMorphingSurface/GooeyMorphingSurface.types.js";
8
+ import { GooeyMorphingSurface } from "./GooeyMorphingSurface/index.js";
5
9
  import { ANIMATION_CONFIGS, ANIMATION_DEFAULTS, EASINGS, EFFECTS, PRESETS, RESPONSIVE_CONFIGS, TIMING, TRANSFORMS, getResponsiveDuration, getResponsiveStagger } from "./waapi/core/animationConstants.js";
6
10
  import { useElementRegistry } from "./waapi/core/useElementRegistry.js";
7
11
  import { usePositionCapture } from "./waapi/core/usePositionCapture.js";
@@ -8,7 +8,7 @@ declare const badgeStyles: StyleSlots<BadgeSlot>;
8
8
  * @see {@link https://cva.style/docs/getting-started/variants}
9
9
  */
10
10
  declare const badgeVariants: (props?: ({
11
- variant?: "default" | "outline" | "secondary" | "destructive" | null | undefined;
11
+ variant?: "default" | "outline" | "destructive" | "secondary" | null | undefined;
12
12
  size?: "default" | "sm" | "lg" | null | undefined;
13
13
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
14
  export { badgeStyles, badgeVariants };