@developer_tribe/react-builder 1.0.6 → 1.0.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 (63) hide show
  1. package/dist/build-components/patterns.generated.d.ts +56 -56
  2. package/dist/components/AttributesEditorPanel.d.ts +2 -2
  3. package/dist/components/BottomBar.d.ts +6 -2
  4. package/dist/components/Checkbox.d.ts +1 -1
  5. package/dist/index.cjs.js +3 -3
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.esm.js +3 -3
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/index.native.cjs.js +1 -1
  11. package/dist/index.native.cjs.js.map +1 -1
  12. package/dist/index.native.esm.js +4 -4
  13. package/dist/index.native.esm.js.map +1 -1
  14. package/dist/modals/ScreenColorsModal.d.ts +1 -1
  15. package/dist/pages/ProjectPage.d.ts +3 -2
  16. package/dist/pages/tabs/BuilderPanel.d.ts +2 -2
  17. package/dist/pages/tabs/SideTool.d.ts +8 -0
  18. package/dist/store.d.ts +0 -6
  19. package/dist/styles.css +1 -1
  20. package/package.json +5 -2
  21. package/src/RenderPage.tsx +1 -4
  22. package/src/assets/samples/carousel-sample.json +81 -99
  23. package/src/assets/samples/simple-1.json +2 -8
  24. package/src/assets/samples/simple-2.json +9 -36
  25. package/src/assets/samples/vpn-onboard-1.json +23 -27
  26. package/src/assets/samples/vpn-onboard-2.json +275 -279
  27. package/src/assets/samples/vpn-onboard-3.json +246 -247
  28. package/src/assets/samples/vpn-onboard-4.json +246 -247
  29. package/src/assets/samples/vpn-onboard-5.json +369 -375
  30. package/src/assets/samples/vpn-onboard-6.json +248 -252
  31. package/src/build-components/View/pattern.json +2 -2
  32. package/src/build-components/patterns.generated.ts +56 -56
  33. package/src/components/AttributesEditorPanel.tsx +8 -12
  34. package/src/components/BottomBar.tsx +75 -69
  35. package/src/components/EditorHeader.tsx +4 -11
  36. package/src/index.ts +2 -1
  37. package/src/modals/ScreenColorsModal.tsx +57 -51
  38. package/src/pages/ProjectPage.tsx +168 -69
  39. package/src/pages/tabs/BuilderPanel.tsx +8 -14
  40. package/src/pages/tabs/SideTool.tsx +253 -0
  41. package/src/store.ts +6 -10
  42. package/src/styles/base/_global.scss +29 -32
  43. package/src/styles/components/_attributes-editor.scss +27 -33
  44. package/src/styles/components/_bottom-bar.scss +11 -23
  45. package/src/styles/components/_editor-shell.scss +38 -18
  46. package/src/styles/components/_mockos-router.scss +16 -14
  47. package/src/styles/components/_ui-components.scss +14 -15
  48. package/src/styles/foundation/_colors.scss +28 -8
  49. package/src/styles/foundation/_mixins.scss +1 -1
  50. package/src/styles/foundation/_sizes.scss +4 -2
  51. package/src/styles/layout/_builder.scss +1 -1
  52. package/src/styles/modals/_add-component.scss +2 -2
  53. package/src/styles/modals/_color-modal.scss +2 -2
  54. package/src/styles/modals/_modal-shell.scss +1 -1
  55. package/src/utils/analyseNodeByPatterns.ts +0 -15
  56. package/dist/components/MobilePanelToggleButton.d.ts +0 -8
  57. package/dist/hooks/useMinimumDelay.d.ts +0 -7
  58. package/dist/hooks/useMobileEditorPanels.d.ts +0 -12
  59. package/dist/hooks/useSyncProjectPageStore.d.ts +0 -15
  60. package/src/components/MobilePanelToggleButton.tsx +0 -39
  61. package/src/hooks/useMinimumDelay.ts +0 -20
  62. package/src/hooks/useMobileEditorPanels.ts +0 -56
  63. package/src/hooks/useSyncProjectPageStore.ts +0 -40
@@ -1,15 +1,16 @@
1
- @use '../foundation/colors';
1
+ @use '../foundation/colors' as colors;
2
2
 
3
3
  .rb-bottom-bar {
4
4
  position: fixed;
5
5
  left: 50%;
6
6
  transform: translateX(-66%);
7
7
  bottom: 10px;
8
+ z-index: 200;
8
9
 
9
10
  height: 50px;
10
11
  border-radius: 24px;
11
12
 
12
- background-color: #fff;
13
+ background-color: colors.$surfaceColor;
13
14
  color: colors.$textColor;
14
15
 
15
16
  display: flex;
@@ -20,8 +21,8 @@
20
21
  padding: 0 10px;
21
22
  gap: 10px;
22
23
 
23
- border: 1px solid rgba(colors.$textColor, 0.06);
24
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
24
+ border: 1px solid colors.$borderColor;
25
+ box-shadow: 0 8px 20px hsl(var(--foreground, 220.9 39.3% 11%) / 0.08);
25
26
  }
26
27
 
27
28
  .rb-bottom-bar__button {
@@ -40,27 +41,14 @@
40
41
 
41
42
  .rb-bottom-bar__button.is-active {
42
43
  color: colors.$accentColor;
43
- background: rgba(colors.$accentColor, 0.08);
44
- box-shadow: 0 0 18px rgba(colors.$accentColor, 0.28);
45
- }
46
-
47
- .rb-bottom-bar__button--preview.is-active {
48
- // make preview cursor extra obvious
49
- box-shadow:
50
- 0 0 0 3px rgba(colors.$accentColor, 0.18),
51
- 0 0 26px rgba(colors.$accentColor, 0.35);
52
- }
53
-
54
- .rb-bottom-bar__button:focus-visible {
55
- outline: none;
56
- box-shadow:
57
- 0 0 0 3px rgba(colors.$accentColor, 0.18),
58
- 0 0 18px rgba(colors.$accentColor, 0.22);
44
+ background: colors.$accentColor; /* Fallback */
45
+ background: color-mix(in srgb, #{colors.$accentColor}, transparent 92%);
46
+ box-shadow: 0 0 10px hsl(var(--primary, 221.2 83.2% 53.3%) / 0.18);
59
47
  }
60
48
 
61
49
  /* border between each tool button */
62
50
  .rb-bottom-bar__button + .rb-bottom-bar__button {
63
- border-left: 1px solid rgba(colors.$textColor, 0.06);
51
+ border-left: 1px solid colors.$borderColor;
64
52
  padding-left: 14px;
65
53
  margin-left: 4px;
66
54
  }
@@ -102,12 +90,12 @@
102
90
 
103
91
  .rb-bottom-bar__lang.is-active {
104
92
  color: colors.$accentColor;
105
- text-shadow: 0 0 12px rgba(colors.$accentColor, 0.25);
93
+ text-shadow: 0 0 12px hsl(var(--primary, 221.2 83.2% 53.3%) / 0.25);
106
94
  }
107
95
 
108
96
  /* border between each language button */
109
97
  .rb-bottom-bar__lang + .rb-bottom-bar__lang {
110
- border-left: 1px solid rgba(colors.$textColor, 0.06);
98
+ border-left: 1px solid colors.$borderColor;
111
99
  margin-left: 8px;
112
100
  padding-left: 14px;
113
101
  }
@@ -5,7 +5,7 @@
5
5
  .editor-tabs {
6
6
  display: flex;
7
7
  gap: 8px;
8
- border-bottom: 1px solid #e5e7eb;
8
+ border-bottom: 1px solid colors.$borderColor;
9
9
  }
10
10
 
11
11
  .editor-tab {
@@ -29,8 +29,9 @@
29
29
  }
30
30
 
31
31
  .editor-tab--active {
32
- background: #fff;
33
- border-color: #e5e7eb #e5e7eb #fff #e5e7eb;
32
+ background: colors.$surfaceColor;
33
+ border-color: colors.$borderColor colors.$borderColor colors.$surfaceColor
34
+ colors.$borderColor;
34
35
  }
35
36
 
36
37
  .editor-panels {
@@ -89,7 +90,7 @@
89
90
  cursor: pointer;
90
91
  font-size: 12px;
91
92
  &.editor-device-button--selected {
92
- border-color: #000;
93
+ border-color: colors.$textColor;
93
94
  }
94
95
  }
95
96
 
@@ -129,14 +130,14 @@
129
130
  font-size: 12px;
130
131
  line-height: 1.2;
131
132
  border-radius: 999px;
132
- background: rgba(255, 255, 255, 0.95);
133
- border-color: rgba(15, 23, 42, 0.15);
134
- box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
133
+ background: hsl(var(--card, 0 0% 100%) / 0.95);
134
+ border-color: hsl(var(--foreground, 220.9 39.3% 11%) / 0.15);
135
+ box-shadow: 0 2px 4px hsl(var(--foreground, 220.9 39.3% 11%) / 0.08);
135
136
  }
136
137
 
137
138
  .debug-button:hover {
138
- background: #fff;
139
- border-color: rgba(15, 23, 42, 0.3);
139
+ background: colors.$surfaceColor;
140
+ border-color: hsl(var(--foreground, 220.9 39.3% 11%) / 0.3);
140
141
  }
141
142
 
142
143
  .editor-button:disabled {
@@ -147,7 +148,7 @@
147
148
  /* Specific hooks for save buttons (kept empty for now) */
148
149
  .editor-save-button,
149
150
  .editor-save-previewconfig-button {
150
- color: #000;
151
+ color: colors.$textColor;
151
152
  font-weight: 600;
152
153
  font-size: 12px;
153
154
  }
@@ -158,9 +159,9 @@
158
159
  margin-top: 12px;
159
160
  min-height: 52px;
160
161
  border-style: dashed;
161
- border-color: #cbd5f5;
162
- background: #f8fafc;
163
- color: #0f172a;
162
+ border-color: colors.$borderColor;
163
+ background: colors.$canvasColor;
164
+ color: colors.$textColor;
164
165
  font-weight: 600;
165
166
  gap: 10px;
166
167
  transition:
@@ -176,14 +177,33 @@
176
177
  border-radius: 999px;
177
178
  align-items: center;
178
179
  justify-content: center;
179
- background: #2563eb;
180
- color: #fff;
180
+ background: colors.$accentColor;
181
+ color: colors.$surfaceColor;
181
182
  font-size: 18px;
182
183
  line-height: 1;
183
184
  }
184
185
 
185
186
  .builder__add-button:hover {
186
- border-color: #94a3b8;
187
- background: #eef2ff;
188
- color: #111827;
187
+ border-color: colors.$borderColor;
188
+ background: colors.$canvasColor;
189
+ color: colors.$textColor;
190
+ }
191
+
192
+ .side-tool-container {
193
+ position: absolute;
194
+ top: 0;
195
+ left: 0;
196
+ z-index: 5;
197
+ }
198
+
199
+ .side-tool select {
200
+ width: 100%;
201
+ font-size: 11px;
202
+ padding: 4px 6px;
203
+ }
204
+
205
+ .side-tool .debug-button {
206
+ border-radius: 0;
207
+ width: 100%;
208
+ justify-content: center;
189
209
  }
@@ -1,3 +1,5 @@
1
+ @use '../foundation/colors' as colors;
2
+
1
3
  .mockos-router {
2
4
  width: 100%;
3
5
  height: 100%;
@@ -18,35 +20,35 @@
18
20
  }
19
21
 
20
22
  .mockos-screen--launchscreen {
21
- background-color: #000000;
23
+ background-color: colors.$textColor;
22
24
  }
23
25
 
24
26
  .mockos-screen--home {
25
27
  padding: 20px;
26
- background-color: #f5f5f5;
28
+ background-color: colors.$canvasColor;
27
29
  }
28
30
 
29
31
  .mockos-screen--onboard {
30
32
  padding: 20px;
31
- background-color: #ffffff;
33
+ background-color: colors.$surfaceColor;
32
34
  }
33
35
 
34
36
  .mockos-screen--subscription {
35
37
  padding: 20px;
36
- background-color: #ffffff;
38
+ background-color: colors.$surfaceColor;
37
39
  }
38
40
 
39
41
  // Screen Content
40
42
  .mockos-screen__title {
41
43
  font-size: 32px;
42
44
  font-weight: bold;
43
- color: #000;
45
+ color: colors.$textColor;
44
46
  margin-bottom: 16px;
45
47
  }
46
48
 
47
49
  .mockos-screen__subtitle {
48
50
  font-size: 16px;
49
- color: #666;
51
+ color: colors.$mutedTextColor;
50
52
  }
51
53
 
52
54
  .mockos-screen__heading {
@@ -57,7 +59,7 @@
57
59
 
58
60
  .mockos-screen__text {
59
61
  font-size: 16px;
60
- color: #333;
62
+ color: colors.$textColor;
61
63
  margin-bottom: 12px;
62
64
  }
63
65
 
@@ -68,13 +70,13 @@
68
70
  margin-bottom: 12px;
69
71
 
70
72
  &--premium {
71
- background-color: #007aff;
72
- color: #fff;
73
+ background-color: colors.$accentColor;
74
+ color: colors.$surfaceColor;
73
75
  }
74
76
 
75
77
  &--basic {
76
- background-color: #e5e5e5;
77
- color: #333;
78
+ background-color: colors.$canvasColor;
79
+ color: colors.$textColor;
78
80
  }
79
81
  }
80
82
 
@@ -107,7 +109,7 @@
107
109
  transition: background-color 0.2s;
108
110
 
109
111
  &:hover {
110
- background-color: rgba(255, 255, 255, 0.1);
112
+ background-color: hsl(var(--card, 0 0% 100%) / 0.1);
111
113
  }
112
114
 
113
115
  &:active {
@@ -120,7 +122,7 @@
120
122
  height: 60px;
121
123
  border-radius: 13px;
122
124
  overflow: hidden;
123
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
125
+ box-shadow: 0 2px 8px hsl(var(--foreground, 220.9 39.3% 11%) / 0.3);
124
126
 
125
127
  svg {
126
128
  width: 100%;
@@ -131,7 +133,7 @@
131
133
 
132
134
  .mockos-launcher__app-name {
133
135
  font-size: 12px;
134
- color: #ffffff;
136
+ color: colors.$surfaceColor;
135
137
  text-align: center;
136
138
  max-width: 70px;
137
139
  overflow: hidden;
@@ -1,7 +1,6 @@
1
1
  @use '../foundation/colors' as colors;
2
2
  @use '../foundation/sizes' as sizes;
3
3
  @use '../foundation/mixins' as *;
4
- @use 'sass:color';
5
4
 
6
5
  .editor-controls {
7
6
  display: grid;
@@ -11,7 +10,7 @@
11
10
  }
12
11
 
13
12
  .editor-section {
14
- background: #fff;
13
+ background: colors.$surfaceColor;
15
14
  border: 1px solid colors.$borderColor;
16
15
  border-radius: sizes.$radiusRounded;
17
16
  padding: sizes.$spaceComfy;
@@ -35,15 +34,15 @@
35
34
  padding: 8px 12px;
36
35
  border-radius: 8px;
37
36
  border: 1px solid colors.$borderColor;
38
- background: #fff;
37
+ background: colors.$surfaceColor;
39
38
  cursor: pointer;
40
39
  transition:
41
40
  background 0.2s ease,
42
41
  box-shadow 0.2s ease;
43
42
 
44
43
  &:hover {
45
- background: #f9fafb;
46
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
44
+ background: colors.$canvasColor;
45
+ box-shadow: 0 6px 16px hsl(var(--foreground, 220.9 39.3% 11%) / 0.06);
47
46
  }
48
47
  }
49
48
 
@@ -55,7 +54,7 @@
55
54
  padding: 0 8px;
56
55
  border: 1px solid colors.$borderColor;
57
56
  border-radius: sizes.$radiusRounded;
58
- background: #fff;
57
+ background: colors.$surfaceColor;
59
58
  color: colors.$textColor;
60
59
  font: inherit;
61
60
  outline: none;
@@ -64,8 +63,8 @@
64
63
  box-shadow 0.15s ease;
65
64
 
66
65
  &:focus {
67
- border-color: color.adjust(colors.$borderColor, $lightness: -8%);
68
- box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
66
+ border-color: colors.$borderColor;
67
+ box-shadow: 0 0 0 3px hsl(var(--foreground, 220.9 39.3% 11%) / 0.04);
69
68
  }
70
69
  }
71
70
 
@@ -120,7 +119,7 @@
120
119
  height: 20px;
121
120
  border-radius: 6px;
122
121
  border: 2px solid colors.$borderColor;
123
- background: #fff;
122
+ background: colors.$surfaceColor;
124
123
  display: inline-flex;
125
124
  align-items: center;
126
125
  justify-content: center;
@@ -129,7 +128,7 @@
129
128
  border-color 0.2s ease,
130
129
  box-shadow 0.2s ease,
131
130
  transform 0.2s ease;
132
- box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
131
+ box-shadow: 0 2px 6px hsl(var(--foreground, 220.9 39.3% 11%) / 0.12);
133
132
 
134
133
  &::after {
135
134
  content: '';
@@ -150,17 +149,17 @@
150
149
  }
151
150
 
152
151
  .builder-checkbox__native:focus-visible + .builder-checkbox__control {
153
- box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
152
+ box-shadow: 0 0 0 3px hsl(var(--primary, 221.2 83.2% 53.3%) / 0.3);
154
153
  }
155
154
 
156
155
  .builder-checkbox__native:checked + .builder-checkbox__control {
157
- background: linear-gradient(135deg, #1f2937, #4f46e5);
156
+ background: linear-gradient(135deg, colors.$textColor, colors.$accentColor);
158
157
  border-color: transparent;
159
- box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
158
+ box-shadow: 0 6px 14px hsl(var(--primary, 221.2 83.2% 53.3%) / 0.35);
160
159
  }
161
160
 
162
161
  .builder-checkbox__native:checked + .builder-checkbox__control::after {
163
- border-color: #fff;
162
+ border-color: colors.$surfaceColor;
164
163
  transform: rotate(45deg) scale(1);
165
164
  }
166
165
 
@@ -171,7 +170,7 @@
171
170
 
172
171
  .builder-checkbox__helper {
173
172
  font-size: 12px;
174
- color: #6b7280;
173
+ color: colors.$mutedTextColor;
175
174
  margin-left: 30px;
176
175
  }
177
176
 
@@ -1,8 +1,28 @@
1
- /* Library color tokens live in a single place for easy discovery. */
2
- $textColor: #111827;
3
- $mutedTextColor: #6b7280;
4
- $surfaceColor: #ffffff;
5
- $canvasColor: #f3f4f6;
6
- $borderColor: #e5e7eb;
7
- $accentColor: #2563eb;
8
- $dangerColor: #ef4444;
1
+ /* Library color tokens live in a single place for easy discovery.
2
+ *
3
+ * TribeHub theming (shadcn/ui style):
4
+ * - Host app defines HSL channels as CSS variables (without the `hsl()` wrapper).
5
+ * - Builder consumes them as `hsl(var(--token))`.
6
+ * - If the host doesn't define a token, we fall back to the builder defaults.
7
+ */
8
+
9
+ $background: hsl(var(--background, 220 14.3% 95.9%));
10
+ $foreground: hsl(var(--foreground, 220.9 39.3% 11%));
11
+ $card: hsl(var(--card, 0 0% 100%));
12
+ $cardForeground: hsl(var(--card-foreground, 220.9 39.3% 11%));
13
+ $muted: hsl(var(--muted, 220 14.3% 95.9%));
14
+ $mutedForeground: hsl(var(--muted-foreground, 220 8.9% 46.1%));
15
+ $primary: hsl(var(--primary, 221.2 83.2% 53.3%));
16
+ $primaryForeground: hsl(var(--primary-foreground, 0 0% 100%));
17
+ $destructive: hsl(var(--destructive, 0 84.2% 60.2%));
18
+ $destructiveForeground: hsl(var(--destructive-foreground, 0 0% 100%));
19
+ $border: hsl(var(--border, 220 13% 91%));
20
+
21
+ /* Back-compat aliases used by the existing SCSS. */
22
+ $textColor: $foreground;
23
+ $mutedTextColor: $mutedForeground;
24
+ $surfaceColor: $card;
25
+ $canvasColor: $background;
26
+ $borderColor: $border;
27
+ $accentColor: $primary;
28
+ $dangerColor: $destructive;
@@ -14,7 +14,7 @@
14
14
 
15
15
  @mixin thin-scrollbar {
16
16
  scrollbar-width: thin;
17
- scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
17
+ scrollbar-color: hsl(var(--foreground, 220.9 39.3% 11%) / 0.25) transparent;
18
18
  &::-webkit-scrollbar {
19
19
  width: 8px;
20
20
  height: 4px;
@@ -1,4 +1,6 @@
1
1
  /* Library sizing scale (spacing, radii, shadow) stays centralized. */
2
+ @use './colors' as colors;
3
+
2
4
  $spaceTight: 4px;
3
5
  $spaceSnug: 6px;
4
6
  $spaceCompact: 8px;
@@ -16,8 +18,8 @@ $radiusPill: 12px;
16
18
  $borderWidthHairline: 1px;
17
19
  $outlineWidthFocus: 2px;
18
20
 
19
- $cardShadow: 0 10px 30px rgba(0, 0, 0, 0.12);
20
- $shadowTooltip: 0 6px 16px rgba(0, 0, 0, 0.2);
21
+ $cardShadow: 0 10px 30px hsl(var(--foreground, 220.9 39.3% 11%) / 0.12);
22
+ $shadowTooltip: 0 6px 16px hsl(var(--foreground, 220.9 39.3% 11%) / 0.2);
21
23
 
22
24
  $fontSizeXs: 11px;
23
25
  $fontSizeSm: 12px;
@@ -49,7 +49,7 @@
49
49
  padding: 0 sizes.$spaceTight;
50
50
  margin: 0;
51
51
  background: colors.$accentColor;
52
- color: #fff;
52
+ color: colors.$surfaceColor;
53
53
  font-size: clamp(sizes.$fontSizeXs, 1.3vw, sizes.$fontSizeSmPlus);
54
54
  white-space: nowrap;
55
55
  overflow: hidden;
@@ -49,7 +49,7 @@
49
49
  border-radius: 12px;
50
50
  padding: sizes.$spaceComfy;
51
51
  margin-bottom: sizes.$spaceCozy;
52
- box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
52
+ box-shadow: 0 10px 20px hsl(var(--foreground, 220.9 39.3% 11%) / 0.05);
53
53
  }
54
54
 
55
55
  .add-component-modal__group-title {
@@ -86,7 +86,7 @@
86
86
 
87
87
  .add-component-modal__card:hover {
88
88
  border-color: colors.$accentColor;
89
- box-shadow: 0 10px 25px rgba(37, 99, 235, 0.15);
89
+ box-shadow: 0 10px 25px hsl(var(--primary, 221.2 83.2% 53.3%) / 0.15);
90
90
  transform: translateY(-2px);
91
91
  }
92
92
 
@@ -30,7 +30,7 @@
30
30
  width: 32px;
31
31
  height: 32px;
32
32
  border-radius: 6px;
33
- border: 1px solid rgba(0, 0, 0, 0.1);
33
+ border: 1px solid hsl(var(--foreground, 220.9 39.3% 11%) / 0.1);
34
34
  }
35
35
 
36
36
  .color-modal__selected-label {
@@ -158,7 +158,7 @@
158
158
  }
159
159
 
160
160
  .color-modal__swatch-preview--light {
161
- border: 1px solid rgba(0, 0, 0, 0.1);
161
+ border: 1px solid hsl(var(--foreground, 220.9 39.3% 11%) / 0.1);
162
162
  }
163
163
 
164
164
  .color-modal__swatch-label {
@@ -10,7 +10,7 @@
10
10
  .modal__overlay {
11
11
  position: absolute;
12
12
  inset: 0;
13
- background: rgba(0, 0, 0, 0.4);
13
+ background: hsl(var(--foreground, 220.9 39.3% 11%) / 0.4);
14
14
  z-index: 0;
15
15
  }
16
16
 
@@ -334,26 +334,11 @@ function validateAttributesByPattern(
334
334
  if (attrs == null) return ok();
335
335
  if (!isPlainObject(attrs)) return fail(`attributes must be an object`, path);
336
336
 
337
- const componentType = normalizeTypeOrFallback(pattern.pattern.type);
338
-
339
337
  const schema: AttributeSchema = (getAttributeSchema(pattern.pattern.type) ??
340
338
  pattern.pattern.attributes ??
341
339
  {}) as AttributeSchema;
342
340
 
343
341
  for (const [attrName, attrValue] of Object.entries(attrs)) {
344
- // Legacy compatibility: older onboard samples/projects stored theme on the provider.
345
- // Modern projects store theme under `appConfig.theme`, but we still accept this
346
- // attribute to avoid breaking existing JSON.
347
- if (componentType === 'OnboardProvider' && attrName === 'theme') {
348
- if (typeof attrValue !== 'string') {
349
- return fail(`Expected one of: light, dark`, joinPath(path, attrName));
350
- }
351
- if (attrValue !== 'light' && attrValue !== 'dark') {
352
- return fail(`Expected one of: light, dark`, joinPath(path, attrName));
353
- }
354
- continue;
355
- }
356
-
357
342
  const attrSpec = schema?.[attrName];
358
343
  if (!attrSpec) {
359
344
  if (pattern.allowUnknownAttributes) continue;
@@ -1,8 +0,0 @@
1
- export type MobilePanelToggleButtonProps = {
2
- label: string;
3
- isActive: boolean;
4
- ariaLabel: string;
5
- ariaControls: string;
6
- onClick: () => void;
7
- };
8
- export declare function MobilePanelToggleButton({ label, isActive, ariaLabel, ariaControls, onClick, }: MobilePanelToggleButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- /**
2
- * Ensures a boolean becomes `true` only after a minimum delay.
3
- * Resets to `false` whenever `deps` change.
4
- *
5
- * Common use-case: keep a loading indicator visible for at least N ms.
6
- */
7
- export declare function useMinimumDelay(delayMs: number, deps?: unknown[]): boolean;
@@ -1,12 +0,0 @@
1
- export type MobileEditorPanel = 'builder' | 'attributes';
2
- export type UseMobileEditorPanelsOptions = {
3
- breakpoint?: number;
4
- };
5
- export declare function useMobileEditorPanels(options?: UseMobileEditorPanelsOptions): {
6
- isMobile: boolean;
7
- mobilePanel: MobileEditorPanel | null;
8
- toggleMobilePanel: (panel: MobileEditorPanel) => void;
9
- closeMobilePanels: () => void;
10
- leftPanelIsOpen: boolean;
11
- attributesPanelIsOpen: boolean;
12
- };
@@ -1,15 +0,0 @@
1
- import type { AppConfig } from '../types/PreviewConfig';
2
- import type { ProjectColors } from '../types/Project';
3
- export type UseSyncProjectPageStoreArgs = {
4
- appConfig: AppConfig;
5
- name: string;
6
- projectColors: ProjectColors | undefined;
7
- setAppConfig: (appConfig: AppConfig) => void;
8
- setProjectName: (name: string) => void;
9
- setProjectColors: (colors: ProjectColors | undefined) => void;
10
- };
11
- /**
12
- * Syncs ProjectPage props into the render store.
13
- * Kept as a small hook to keep ProjectPage UI-focused.
14
- */
15
- export declare function useSyncProjectPageStore({ appConfig, name, projectColors, setAppConfig, setProjectName, setProjectColors, }: UseSyncProjectPageStoreArgs): void;
@@ -1,39 +0,0 @@
1
- export type MobilePanelToggleButtonProps = {
2
- label: string;
3
- isActive: boolean;
4
- ariaLabel: string;
5
- ariaControls: string;
6
- onClick: () => void;
7
- };
8
-
9
- export function MobilePanelToggleButton({
10
- label,
11
- isActive,
12
- ariaLabel,
13
- ariaControls,
14
- onClick,
15
- }: MobilePanelToggleButtonProps) {
16
- return (
17
- <button
18
- type="button"
19
- className={`mobile-panel-toggle__button${isActive ? ' mobile-panel-toggle__button--active' : ''}`}
20
- aria-label={ariaLabel}
21
- aria-expanded={isActive}
22
- aria-controls={ariaControls}
23
- onClick={onClick}
24
- >
25
- <span className="mobile-panel-toggle__icon" aria-hidden="true">
26
- <svg viewBox="0 0 16 12" role="presentation" focusable="false">
27
- <path
28
- d="M1 1h14M1 6h14M1 11h14"
29
- stroke="currentColor"
30
- strokeWidth="2"
31
- strokeLinecap="round"
32
- fill="none"
33
- />
34
- </svg>
35
- </span>
36
- <span className="mobile-panel-toggle__label">{label}</span>
37
- </button>
38
- );
39
- }
@@ -1,20 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
-
3
- /**
4
- * Ensures a boolean becomes `true` only after a minimum delay.
5
- * Resets to `false` whenever `deps` change.
6
- *
7
- * Common use-case: keep a loading indicator visible for at least N ms.
8
- */
9
- export function useMinimumDelay(delayMs: number, deps: unknown[] = []) {
10
- const [done, setDone] = useState<boolean>(false);
11
-
12
- useEffect(() => {
13
- setDone(false);
14
- const timer = setTimeout(() => setDone(true), delayMs);
15
- return () => clearTimeout(timer);
16
- // eslint-disable-next-line react-hooks/exhaustive-deps
17
- }, [delayMs, ...deps]);
18
-
19
- return done;
20
- }