@mks2508/mks-ui 0.5.4 → 0.5.7

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 (26) hide show
  1. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +21 -4
  2. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -1
  3. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +2 -2
  4. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -1
  5. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +163 -32
  6. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +7 -0
  7. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -1
  8. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +6 -1
  9. package/dist/react-ui/ui/DynamicToggle/{DynamicToggle-Cm6-VceQ.css → DynamicToggle-DOR3Ld-k.css} +104 -32
  10. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +105 -32
  11. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +2 -2
  12. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +6 -0
  13. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
  14. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
  15. package/dist/react-ui/ui/DynamicToggle/index.js +23 -5
  16. package/package.json +1 -1
  17. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +21 -3
  18. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +177 -40
  19. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +9 -0
  20. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +105 -32
  21. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +2 -2
  22. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +6 -0
  23. package/src/react-ui/ui/DynamicToggle/index.tsx +30 -8
  24. package/src/react-ui/ui/DynamicToggle/prototype-v7-ios.html +413 -0
  25. package/src/react-ui/ui/DynamicToggle/prototype-v8-gooey-safari.html +560 -0
  26. package/src/react-ui/ui/DynamicToggle/prototype-v8b-react-structure.html +227 -0
@@ -0,0 +1,227 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>v8b — Isolate CSS culprit</title>
7
+ <style>
8
+ :root {
9
+ --fg: #e2e8f0; --bg: #0f172a; --card: #1e293b;
10
+ --muted: #64748b; --border: #334155; --accent: #e2e8f0;
11
+ --dt-dur: 0.22s; --dt-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
12
+ --dt-indicator-dur: 0.3s; --dt-indicator-ease: cubic-bezier(0.4, 0, 0.2, 1);
13
+ }
14
+ * { box-sizing: border-box; margin: 0; }
15
+ body {
16
+ min-height: 100vh; display: flex; flex-direction: column; align-items: center;
17
+ padding: 3rem 1rem; gap: 2rem; background: var(--bg);
18
+ font-family: system-ui, sans-serif; color: var(--fg);
19
+ }
20
+ h2 { font-size: 1rem; }
21
+ h3 { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
22
+ p.note { color: var(--muted); font-size: 10px; max-width: 200px; text-align: center; }
23
+ .row { display: flex; gap: 3rem; flex-wrap: wrap; justify-content: center; }
24
+ .col { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
25
+ button {
26
+ padding: 0.5rem 1.5rem; border-radius: 8px; border: 1px solid var(--border);
27
+ background: var(--card); color: var(--fg); cursor: pointer; font-size: 0.8rem;
28
+ }
29
+
30
+ /* ════ Gooey canvas — EXACT same as v8 prototype ════ */
31
+ .gooey-canvas {
32
+ position: absolute; inset: 0;
33
+ border-radius: 9999px;
34
+ pointer-events: none;
35
+ transform: translateZ(0);
36
+ contain: layout style;
37
+ overflow: visible;
38
+ }
39
+ .gooey-canvas svg { position: absolute; overflow: visible; }
40
+
41
+ /* ════ Wrapper (same in all variants) ════ */
42
+ .demo {
43
+ position: relative;
44
+ width: 260px; height: 38px;
45
+ margin-top: 20px;
46
+ border-radius: 9999px;
47
+ }
48
+
49
+ /* ════ React-like wrappers ════ */
50
+ .dt-root {
51
+ position: relative; padding: 2px; user-select: none;
52
+ height: 38px; width: 260px; font-size: 12px; border-radius: 9999px;
53
+ /* filter mode: */
54
+ background: transparent; border: 1px solid transparent;
55
+ overflow: visible;
56
+ }
57
+ .dt-track {
58
+ position: relative; display: grid;
59
+ grid-template-columns: repeat(4, 1fr);
60
+ place-items: center; width: 100%; height: 100%;
61
+ z-index: 1;
62
+ }
63
+ .dt-group {
64
+ grid-column: span 2; position: relative;
65
+ width: 100%; height: 100%;
66
+ display: grid; grid-template-columns: repeat(2, 1fr);
67
+ container-type: size; overflow: hidden;
68
+ }
69
+ .dt-indicator {
70
+ position: absolute; width: 50%; left: 50%; top: 0; bottom: 0;
71
+ background: var(--accent); border-radius: 9999px;
72
+ pointer-events: none; z-index: 0;
73
+ transition: left var(--dt-indicator-dur) var(--dt-indicator-ease);
74
+ }
75
+ .dt-option {
76
+ display: inline-grid; place-items: center;
77
+ cursor: pointer; font-weight: 500; z-index: 2;
78
+ height: 100%; width: 100%; grid-column: span 2;
79
+ }
80
+ .dt-group label {
81
+ display: inline-grid; place-items: center;
82
+ cursor: pointer; font-weight: 500; z-index: 2;
83
+ height: 100%; width: 100%; color: var(--muted);
84
+ transition: color var(--dt-dur) var(--dt-ease), opacity var(--dt-dur) var(--dt-ease);
85
+ }
86
+ </style>
87
+ </head>
88
+ <body>
89
+
90
+ <h2>v8b — What kills the gooey in Safari?</h2>
91
+ <button onclick="toggleAll()">Toggle All</button>
92
+
93
+ <div class="row">
94
+ <div class="col">
95
+ <h3>1: Bare (v8 exact)</h3>
96
+ <div class="demo"><div class="gooey-canvas" id="c1"></div></div>
97
+ </div>
98
+
99
+ <div class="col">
100
+ <h3>2: + dt-root only</h3>
101
+ <p class="note">Root wrapper, no track/group</p>
102
+ <div class="dt-root"><div class="gooey-canvas" id="c2"></div></div>
103
+ </div>
104
+
105
+ <div class="col">
106
+ <h3>3: + track (z-index:1)</h3>
107
+ <p class="note">Root + track with z-index:1</p>
108
+ <div class="dt-root">
109
+ <div class="gooey-canvas" id="c3"></div>
110
+ <div class="dt-track"></div>
111
+ </div>
112
+ </div>
113
+ </div>
114
+
115
+ <div class="row" style="margin-top:1.5rem">
116
+ <div class="col">
117
+ <h3>4: + group (container+overflow)</h3>
118
+ <p class="note">Full structure with labels</p>
119
+ <div class="dt-root">
120
+ <div class="gooey-canvas" id="c4"></div>
121
+ <div class="dt-track">
122
+ <div class="dt-indicator"></div>
123
+ <label class="dt-option"><span>Free</span></label>
124
+ <div class="dt-group">
125
+ <label><span>Solo</span></label>
126
+ <label><span>Team</span></label>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
+
132
+ <div class="col">
133
+ <h3>5: Full BUT no container-type</h3>
134
+ <p class="note">Group: container-type:normal, overflow:visible</p>
135
+ <div class="dt-root">
136
+ <div class="gooey-canvas" id="c5"></div>
137
+ <div class="dt-track">
138
+ <div class="dt-indicator"></div>
139
+ <label class="dt-option"><span>Free</span></label>
140
+ <div class="dt-group" style="container-type:normal;overflow:visible;">
141
+ <label><span>Solo</span></label>
142
+ <label><span>Team</span></label>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <div class="col">
149
+ <h3>6: Full BUT track z-index:auto</h3>
150
+ <p class="note">Track without stacking context</p>
151
+ <div class="dt-root">
152
+ <div class="gooey-canvas" id="c6"></div>
153
+ <div class="dt-track" style="z-index:auto;">
154
+ <div class="dt-indicator"></div>
155
+ <label class="dt-option"><span>Free</span></label>
156
+ <div class="dt-group">
157
+ <label><span>Solo</span></label>
158
+ <label><span>Team</span></label>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+
165
+ <script>
166
+ const W=260, H=38, PAD=2, BH=15, TH=H+BH;
167
+ const ER=Math.min(9999,H/2), IPX=W*0.2, BW=W-2*IPX;
168
+ const BR=Math.min(ER*0.6,BH*0.45,12), FILL='#1e293b', BLUR=Math.round(H*0.15);
169
+ const SPRING=`linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)`;
170
+ const EOUT='cubic-bezier(0.33, 1, 0.68, 1)';
171
+
172
+ let gid=0;
173
+ function mkSVG(el) {
174
+ const id='goo-'+(++gid);
175
+ const svg=document.createElementNS('http://www.w3.org/2000/svg','svg');
176
+ svg.setAttribute('width',W); svg.setAttribute('height',TH);
177
+ svg.setAttribute('viewBox',`0 0 ${W} ${TH}`);
178
+ svg.style.cssText=`position:absolute;top:-${BH}px;left:0;overflow:visible`;
179
+ svg.innerHTML=`<defs><filter id="${id}" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
180
+ <feGaussianBlur in="SourceGraphic" stdDeviation="${BLUR}" result="blur"/>
181
+ <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10" result="goo"/>
182
+ <feComposite in="SourceGraphic" in2="goo" operator="atop"/>
183
+ </filter></defs>`;
184
+
185
+ const pill=document.createElementNS('http://www.w3.org/2000/svg','rect');
186
+ pill.setAttribute('x',PAD); pill.setAttribute('y',BH);
187
+ pill.setAttribute('width',W-PAD*2); pill.setAttribute('height',H-PAD*2);
188
+ pill.setAttribute('rx',ER); pill.setAttribute('ry',ER);
189
+ pill.setAttribute('fill',FILL);
190
+ svg.appendChild(pill);
191
+
192
+ const b=document.createElementNS('http://www.w3.org/2000/svg','rect');
193
+ b.setAttribute('x',IPX); b.setAttribute('y',BH);
194
+ b.setAttribute('width',BW); b.setAttribute('height',0);
195
+ b.setAttribute('rx',BR); b.setAttribute('ry',BR);
196
+ b.setAttribute('fill',FILL);
197
+ svg.appendChild(b);
198
+
199
+ el.style.filter=`url(#${id}) drop-shadow(0 0 0.5px #334155) drop-shadow(0 0 0.5px #334155)`;
200
+ el.appendChild(svg);
201
+ return b;
202
+ }
203
+
204
+ const toggles=[];
205
+ function mk(cid) {
206
+ const bubble=mkSVG(document.getElementById(cid));
207
+ let exp=false, anim=null, last={y:BH,h:0};
208
+ toggles.push(()=>{
209
+ exp=!exp;
210
+ const toY=exp?0:BH, toH=exp?BH:0;
211
+ if(anim) anim.cancel();
212
+ anim=bubble.animate(
213
+ [{y:`${last.y}px`,height:`${last.h}px`},{y:`${toY}px`,height:`${toH}px`}],
214
+ {duration:exp?550:400, easing:exp?SPRING:EOUT, fill:'forwards'}
215
+ );
216
+ last={y:toY,h:toH};
217
+ });
218
+ }
219
+
220
+ function init(){
221
+ ['c1','c2','c3','c4','c5','c6'].forEach(mk);
222
+ }
223
+ function toggleAll(){toggles.forEach(fn=>fn());}
224
+ document.addEventListener('DOMContentLoaded',init);
225
+ </script>
226
+ </body>
227
+ </html>