@superwall/studio 1.3.0 → 1.5.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 (62) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/index-Bi2YHYVJ.js +11 -0
  3. package/dist/assets/index-DrsTCwot.css +1 -0
  4. package/dist/index.html +2 -2
  5. package/dist/lib/components/DownloadScreenshot.d.ts +6 -0
  6. package/dist/lib/components/PreviewOnDevice.d.ts +6 -0
  7. package/dist/lib/components/Tooltip.d.ts +5 -0
  8. package/dist/lib/components/chrome/Toolbar.d.ts +1 -0
  9. package/dist/lib/components/chrome/TopBar.d.ts +1 -0
  10. package/dist/lib/components/icons.d.ts +1 -0
  11. package/dist/lib/components/menus/CompareMenu.d.ts +2 -1
  12. package/dist/lib/components/preview/Canvas.d.ts +18 -0
  13. package/dist/lib/components/preview/DeviceFrame.d.ts +4 -4
  14. package/dist/lib/components/preview/ResizeHandles.d.ts +13 -0
  15. package/dist/lib/index.d.ts +5 -1
  16. package/dist/lib/index.js +2924 -1229
  17. package/dist/lib/lib/actions.d.ts +1 -0
  18. package/dist/lib/lib/canvas.d.ts +27 -0
  19. package/dist/lib/lib/contract.d.ts +7 -1
  20. package/dist/lib/lib/devices.d.ts +9 -0
  21. package/dist/lib/lib/host.d.ts +2 -1
  22. package/dist/lib/lib/notify.d.ts +4 -0
  23. package/dist/lib/lib/presentation.d.ts +23 -0
  24. package/dist/lib/lib/preview.d.ts +1 -0
  25. package/dist/lib/lib/project.d.ts +1 -0
  26. package/dist/lib/lib/scheme.d.ts +11 -0
  27. package/dist/lib/lib/surfaces.d.ts +26 -2
  28. package/dist/lib/studio.css +1 -1
  29. package/package.json +3 -2
  30. package/src/components/DownloadScreenshot.tsx +133 -0
  31. package/src/components/OpenInApp.tsx +5 -25
  32. package/src/components/PaywallToasts.tsx +5 -3
  33. package/src/components/PreviewOnDevice.tsx +133 -0
  34. package/src/components/SurfaceCard.tsx +1 -1
  35. package/src/components/Tooltip.tsx +27 -0
  36. package/src/components/chrome/Toolbar.tsx +47 -6
  37. package/src/components/chrome/TopBar.tsx +37 -3
  38. package/src/components/icons.tsx +6 -0
  39. package/src/components/menus/ActionMenu.tsx +8 -8
  40. package/src/components/menus/CompareMenu.tsx +49 -30
  41. package/src/components/panels/MissingProducts.tsx +1 -1
  42. package/src/components/preview/Canvas.tsx +426 -0
  43. package/src/components/preview/DeviceFrame.tsx +83 -74
  44. package/src/components/preview/ResizeHandles.tsx +205 -0
  45. package/src/index.ts +6 -0
  46. package/src/lib/actions.ts +7 -0
  47. package/src/lib/canvas.ts +60 -0
  48. package/src/lib/contract.ts +8 -1
  49. package/src/lib/devices.ts +52 -4
  50. package/src/lib/host.ts +7 -2
  51. package/src/lib/notify.tsx +31 -0
  52. package/src/lib/presentation.ts +102 -0
  53. package/src/lib/preview.ts +3 -0
  54. package/src/lib/project.ts +45 -1
  55. package/src/lib/scheme.ts +31 -0
  56. package/src/lib/surfaces.ts +42 -1
  57. package/src/main.tsx +5 -1
  58. package/src/screens/SurfaceEditor.tsx +219 -52
  59. package/src/screens/SurfaceList.tsx +2 -2
  60. package/src/styles.css +89 -8
  61. package/dist/assets/index-CEz-HnIH.js +0 -11
  62. package/dist/assets/index-_HCp6gCi.css +0 -1
package/src/styles.css CHANGED
@@ -1,6 +1,22 @@
1
1
  @import "tailwindcss";
2
2
 
3
3
  @theme {
4
+ /* One restrained corner at every scale, so a control's size never changes
5
+ the visual language. Genuinely circular shapes stay 9999px. */
6
+ --radius: 3px;
7
+ --radius-xs: 3px;
8
+ --radius-sm: 3px;
9
+ --radius-md: 3px;
10
+ --radius-lg: 3px;
11
+ --radius-xl: 3px;
12
+ --radius-2xl: 3px;
13
+ --radius-3xl: 3px;
14
+
15
+ /* Structure is one hairline everywhere; controls carry a slightly stronger
16
+ edge because they hold a shape of their own. */
17
+ --hairline: color-mix(in srgb, var(--color-cream) 10%, transparent);
18
+ --edge: color-mix(in srgb, var(--color-cream) 18%, transparent);
19
+
4
20
  --color-ink: #1a1918;
5
21
  --color-bar: #211f1d;
6
22
  --color-panel: #242220;
@@ -44,13 +60,14 @@
44
60
 
45
61
  @layer components {
46
62
  .sw-btn {
63
+ border-radius: var(--radius);
47
64
  display: inline-flex;
48
65
  align-items: center;
49
66
  justify-content: center;
50
67
  gap: 7px;
51
68
  height: 30px;
52
69
  padding: 0 12px;
53
- border: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
70
+ border: 1px solid var(--edge);
54
71
  background: transparent;
55
72
  color: var(--color-cream);
56
73
  font-size: 0.8125rem;
@@ -59,17 +76,23 @@
59
76
  transition: background-color 150ms ease;
60
77
  }
61
78
 
62
- .sw-btn:hover {
79
+ .sw-btn:hover:not(:disabled):not(.sw-btn--blocked) {
63
80
  background: color-mix(in srgb, var(--color-cream) 5%, transparent);
64
81
  }
65
82
 
83
+ .sw-btn:disabled,
84
+ .sw-btn--blocked {
85
+ opacity: 0.4;
86
+ cursor: not-allowed;
87
+ }
88
+
66
89
  .sw-btn--primary {
67
90
  background: var(--color-cream);
68
91
  border-color: var(--color-cream);
69
92
  color: var(--color-ink);
70
93
  }
71
94
 
72
- .sw-btn--primary:hover {
95
+ .sw-btn--primary:hover:not(:disabled):not(.sw-btn--blocked) {
73
96
  background: color-mix(in srgb, var(--color-cream) 85%, transparent);
74
97
  }
75
98
 
@@ -91,11 +114,12 @@
91
114
  }
92
115
 
93
116
  .sw-chip {
117
+ border-radius: var(--radius);
94
118
  display: inline-flex;
95
119
  align-items: center;
96
120
  height: 20px;
97
121
  padding: 0 7px;
98
- border: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
122
+ border: 1px solid var(--edge);
99
123
  color: var(--color-cream);
100
124
  white-space: nowrap;
101
125
  }
@@ -114,11 +138,12 @@
114
138
  }
115
139
 
116
140
  .sw-select {
141
+ border-radius: var(--radius);
117
142
  appearance: none;
118
143
  cursor: pointer;
119
144
  height: 30px;
120
145
  padding: 0 24px 0 9px;
121
- border: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
146
+ border: 1px solid var(--edge);
122
147
  background:
123
148
  linear-gradient(
124
149
  45deg,
@@ -144,8 +169,9 @@
144
169
  }
145
170
 
146
171
  .sw-segmented {
172
+ border-radius: var(--radius);
147
173
  display: inline-flex;
148
- border: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
174
+ border: 1px solid var(--edge);
149
175
  height: 30px;
150
176
  }
151
177
 
@@ -163,7 +189,15 @@
163
189
  }
164
190
 
165
191
  .sw-segmented button + button {
166
- border-left: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
192
+ border-left: 1px solid var(--edge);
193
+ }
194
+
195
+ .sw-segmented button:first-child {
196
+ border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
197
+ }
198
+
199
+ .sw-segmented button:last-child {
200
+ border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
167
201
  }
168
202
 
169
203
  .sw-segmented button[aria-pressed="true"] {
@@ -171,6 +205,52 @@
171
205
  color: var(--color-ink);
172
206
  }
173
207
 
208
+ .sw-stepper {
209
+ border-radius: var(--radius);
210
+ display: inline-flex;
211
+ border: 1px solid var(--edge);
212
+ height: 30px;
213
+ }
214
+
215
+ .sw-stepper button {
216
+ display: inline-flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ color: var(--color-cream);
220
+ transition: background-color 150ms ease;
221
+ }
222
+
223
+ .sw-stepper button:hover {
224
+ background: color-mix(in srgb, var(--color-cream) 5%, transparent);
225
+ }
226
+
227
+ .sw-stepper button + button {
228
+ border-left: 1px solid var(--edge);
229
+ }
230
+
231
+ .sw-stepper > button:first-child,
232
+ .sw-stepper > button:last-child {
233
+ width: 28px;
234
+ }
235
+
236
+ .sw-stepper > button:first-child {
237
+ border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
238
+ }
239
+
240
+ .sw-stepper > button:last-child {
241
+ border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
242
+ }
243
+
244
+ .sw-stepper svg {
245
+ width: 14px;
246
+ height: 14px;
247
+ stroke: currentColor;
248
+ fill: none;
249
+ stroke-width: 1.5;
250
+ stroke-linecap: round;
251
+ stroke-linejoin: round;
252
+ }
253
+
174
254
  input[type="search"]::-webkit-search-cancel-button,
175
255
  input[type="search"]::-webkit-search-decoration,
176
256
  input[type="search"]::-webkit-search-results-button,
@@ -181,9 +261,10 @@
181
261
  }
182
262
 
183
263
  .sw-input {
264
+ border-radius: var(--radius);
184
265
  height: 30px;
185
266
  padding: 0 9px;
186
- border: 1px solid color-mix(in srgb, var(--color-cream) 18%, transparent);
267
+ border: 1px solid var(--edge);
187
268
  background: transparent;
188
269
  color: var(--color-cream);
189
270
  font: inherit;