@developer_tribe/react-builder 1.0.6 → 1.0.8

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 +31 -25
  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 +147 -48
  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
@@ -0,0 +1,253 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { JsonTextEditor } from '../../components/JsonTextEditor';
3
+ import { Modal } from '../../modals';
4
+ import type { Node } from '../../types/Node';
5
+ import type { Localication } from '../../types/PreviewConfig';
6
+ import { useLogRender } from '../../utils/useLogRender';
7
+ import { useRenderStore } from '../../store';
8
+ import { Checkbox } from '../../components/Checkbox';
9
+ import { LocalicationModal } from '../../modals/LocalicationModal';
10
+ import { analyseAndProccess } from '../../utils/analyseNode';
11
+
12
+ const screenStyleDefaults = {
13
+ light: { backgroundColor: '#FDFDFD', color: '#161827' },
14
+ dark: { backgroundColor: '#12131A', color: '#E9EBF9' },
15
+ } as const;
16
+
17
+ type ScreenMode = keyof typeof screenStyleDefaults;
18
+ type ScreenColorKey = keyof (typeof screenStyleDefaults)['light'];
19
+
20
+ type SideToolProps = {
21
+ data: Node;
22
+ setData: React.Dispatch<React.SetStateAction<Node>>;
23
+ };
24
+
25
+ const colorFields = [
26
+ {
27
+ id: 'light-bg',
28
+ label: 'Light Background Color',
29
+ mode: 'light' as ScreenMode,
30
+ key: 'backgroundColor' as ScreenColorKey,
31
+ },
32
+ {
33
+ id: 'light-color',
34
+ label: 'Light Color',
35
+ mode: 'light' as ScreenMode,
36
+ key: 'color' as ScreenColorKey,
37
+ },
38
+ {
39
+ id: 'dark-bg',
40
+ label: 'Dark Background Color',
41
+ mode: 'dark' as ScreenMode,
42
+ key: 'backgroundColor' as ScreenColorKey,
43
+ },
44
+ {
45
+ id: 'dark-color',
46
+ label: 'Dark Color',
47
+ mode: 'dark' as ScreenMode,
48
+ key: 'color' as ScreenColorKey,
49
+ },
50
+ ];
51
+
52
+ export function SideTool({ data, setData }: SideToolProps) {
53
+ useLogRender('SideTool');
54
+ const [isDebugModalOpen, setIsDebugModalOpen] = useState(false);
55
+ const [isLocalicationModalOpen, setIsLocalicationModalOpen] = useState(false);
56
+ const [isCompactMode, setIsCompactMode] = useState(() => {
57
+ if (typeof window === 'undefined') {
58
+ return false;
59
+ }
60
+ return window.innerWidth < 1000;
61
+ });
62
+ const [isCompactPanelVisible, setIsCompactPanelVisible] = useState(false);
63
+ const { appConfig, setAppConfig, previewMode, setPreviewMode } =
64
+ useRenderStore((s) => ({
65
+ appConfig: s.appConfig,
66
+ setAppConfig: s.setAppConfig,
67
+ previewMode: s.previewMode,
68
+ setPreviewMode: s.setPreviewMode,
69
+ }));
70
+
71
+ useEffect(() => {
72
+ if (typeof window === 'undefined') {
73
+ return;
74
+ }
75
+
76
+ const handleResize = () => {
77
+ const compact = window.innerWidth < 1000;
78
+ setIsCompactMode(compact);
79
+ };
80
+
81
+ handleResize();
82
+ window.addEventListener('resize', handleResize);
83
+ return () => window.removeEventListener('resize', handleResize);
84
+ }, []);
85
+
86
+ const getScreenColorValue = (mode: ScreenMode, key: ScreenColorKey) =>
87
+ appConfig.screenStyle?.[mode]?.[key] ?? screenStyleDefaults[mode][key];
88
+
89
+ const handleScreenStyleChange = (
90
+ mode: ScreenMode,
91
+ key: ScreenColorKey,
92
+ value: string,
93
+ ) => {
94
+ setAppConfig({
95
+ ...appConfig,
96
+ screenStyle: {
97
+ ...screenStyleDefaults,
98
+ ...appConfig.screenStyle,
99
+ [mode]: {
100
+ ...screenStyleDefaults[mode],
101
+ ...appConfig.screenStyle?.[mode],
102
+ [key]: value,
103
+ },
104
+ },
105
+ });
106
+ };
107
+
108
+ const handleLocalicationChange = (data: Localication) => {
109
+ setAppConfig({ ...appConfig, localication: data });
110
+ };
111
+
112
+ return (
113
+ <div className="side-tool-container">
114
+ <button
115
+ type="button"
116
+ className="editor-button"
117
+ onClick={() => setIsCompactPanelVisible((prev) => !prev)}
118
+ aria-pressed={isCompactPanelVisible}
119
+ >
120
+ {isCompactPanelVisible ? 'Hide tools' : 'Show tools'}
121
+ </button>
122
+
123
+ {isCompactPanelVisible && (
124
+ <div className="side-tool">
125
+ <select
126
+ value={appConfig.defaultLanguage ?? 'en'}
127
+ onChange={(e) =>
128
+ setAppConfig({ ...appConfig, defaultLanguage: e.target.value })
129
+ }
130
+ >
131
+ {Object.keys(appConfig.localication ?? {}).map((language) => (
132
+ <option key={language} value={language}>
133
+ {language}
134
+ </option>
135
+ ))}
136
+ </select>
137
+
138
+ <Checkbox
139
+ label="Dark Mode"
140
+ checked={appConfig.theme === 'dark'}
141
+ onChange={(checked) =>
142
+ setAppConfig({ ...appConfig, theme: checked ? 'dark' : 'light' })
143
+ }
144
+ />
145
+
146
+ <Checkbox
147
+ label="Is RTL"
148
+ checked={appConfig.isRtl ?? false}
149
+ onChange={(checked) =>
150
+ setAppConfig({ ...appConfig, isRtl: checked })
151
+ }
152
+ />
153
+
154
+ <Checkbox
155
+ label="Preview mode"
156
+ checked={previewMode}
157
+ onChange={setPreviewMode}
158
+ />
159
+
160
+ <div>
161
+ <div
162
+ style={{
163
+ display: 'grid',
164
+ gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
165
+ gap: 12,
166
+ }}
167
+ >
168
+ {colorFields.map(({ id, label, mode, key }) => (
169
+ <React.Fragment key={id}>
170
+ <div>{label}</div>
171
+ <input
172
+ id={id}
173
+ type="color"
174
+ className="input input--color"
175
+ value={getScreenColorValue(mode, key)}
176
+ onChange={(e) =>
177
+ handleScreenStyleChange(mode, key, e.target.value)
178
+ }
179
+ />
180
+ </React.Fragment>
181
+ ))}
182
+ </div>
183
+ </div>
184
+
185
+ <div
186
+ style={{
187
+ marginTop: 'auto',
188
+ paddingTop: 16,
189
+ display: 'flex',
190
+ flexDirection: 'column',
191
+ gap: 8,
192
+ }}
193
+ >
194
+ <button
195
+ type="button"
196
+ className="editor-button"
197
+ onClick={() => setIsLocalicationModalOpen(true)}
198
+ >
199
+ Open localization editor
200
+ </button>
201
+ <button
202
+ type="button"
203
+ className="editor-button debug-button"
204
+ title="Inspect raw JSON data"
205
+ onClick={() => setIsDebugModalOpen(true)}
206
+ >
207
+ Debug JSON
208
+ </button>
209
+ </div>
210
+
211
+ {isDebugModalOpen && (
212
+ <Modal
213
+ onClose={() => setIsDebugModalOpen(false)}
214
+ ariaLabelledBy="debug-json-editor-title"
215
+ className="modal--large modal--scrollable"
216
+ contentClassName="localication-modal__content"
217
+ >
218
+ <div className="modal__header localication-modal__header">
219
+ <button
220
+ type="button"
221
+ className="editor-button"
222
+ onClick={() => setIsDebugModalOpen(false)}
223
+ >
224
+ Close
225
+ </button>
226
+ </div>
227
+ <div className="localication-modal__body">
228
+ <div className="localication-modal__editor">
229
+ <JsonTextEditor
230
+ rootName="node"
231
+ value={data ?? {}}
232
+ onChange={(next) =>
233
+ setData(analyseAndProccess(next as Node) as Node)
234
+ }
235
+ className="localication-modal__json-editor"
236
+ />
237
+ </div>
238
+ </div>
239
+ </Modal>
240
+ )}
241
+
242
+ {isLocalicationModalOpen && (
243
+ <LocalicationModal
244
+ data={appConfig.localication ?? {}}
245
+ onChange={handleLocalicationChange}
246
+ onClose={() => setIsLocalicationModalOpen(false)}
247
+ />
248
+ )}
249
+ </div>
250
+ )}
251
+ </div>
252
+ );
253
+ }
package/src/store.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import { createWithEqualityFn } from 'zustand/traditional';
2
2
  import { shallow } from 'zustand/shallow';
3
3
  import type { Device } from './types/Device';
4
- import { defaultAppConfig, type AppConfig } from './types/PreviewConfig';
4
+ import {
5
+ defaultAppConfig,
6
+ type AppConfig,
7
+ type Localication,
8
+ } from './types/PreviewConfig';
5
9
  import { getDefaultDevice } from './utils/getDevices';
10
+ import { ScreenStyle } from './RenderPage';
6
11
  import { createJSONStorage, persist } from 'zustand/middleware';
7
12
  import { Node } from './types/Node';
8
13
  import type { LogEntry, LogLevel, ProjectColors } from './types/Project';
@@ -15,12 +20,6 @@ import type {
15
20
  type RenderStore = {
16
21
  projectName: string;
17
22
  setProjectName: (name: string) => void;
18
- /**
19
- * Root node tree being edited (a.k.a. "editor data").
20
- * Not persisted: it comes from the currently opened project.
21
- */
22
- editorData: Node | null;
23
- setEditorData: (data: Node | null) => void;
24
23
  copiedNode: Node | null;
25
24
  setCopiedNode: (node: Node | null) => void;
26
25
  current: Node | null;
@@ -67,8 +66,6 @@ export const useRenderStore = createWithEqualityFn<RenderStore>()(
67
66
  (set) => ({
68
67
  projectName: '',
69
68
  setProjectName: (name) => set({ projectName: name }),
70
- editorData: null,
71
- setEditorData: (data) => set({ editorData: data, current: data }),
72
69
  copiedNode: null,
73
70
  setCopiedNode: (node) => set({ copiedNode: node }),
74
71
  current: null,
@@ -196,7 +193,6 @@ export const useRenderStore = createWithEqualityFn<RenderStore>()(
196
193
  name: 'render-store',
197
194
  partialize: (state) => ({
198
195
  // Explicitly DO NOT persist projectName (it comes from ProjectPage props)
199
- // Explicitly DO NOT persist editorData/current (they come from the opened project)
200
196
  copiedNode: state.copiedNode ?? null,
201
197
  logLevel: state.logLevel,
202
198
  products: state.products,
@@ -2,7 +2,6 @@
2
2
  @use '../foundation/sizes' as sizes;
3
3
  @use '../foundation/typography' as type;
4
4
  @use '../foundation/mixins' as *;
5
- @use 'sass:color';
6
5
 
7
6
  /* Global utility classes */
8
7
  html,
@@ -37,7 +36,7 @@ body,
37
36
  height: 120px;
38
37
  border: 2px dashed colors.$mutedTextColor;
39
38
  border-radius: sizes.$radiusRounded;
40
- background: #fff;
39
+ background: colors.$surfaceColor;
41
40
  cursor: pointer;
42
41
  font-weight: 600;
43
42
  color: colors.$textColor;
@@ -45,12 +44,12 @@ body,
45
44
  border-color 0.2s ease,
46
45
  transform 0.1s ease,
47
46
  box-shadow 0.2s ease;
48
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
47
+ box-shadow: 0 1px 2px hsl(var(--foreground, 220.9 39.3% 11%) / 0.04);
49
48
 
50
49
  &:hover {
51
- border-color: color.adjust(colors.$mutedTextColor, $lightness: -10%);
50
+ border-color: colors.$mutedTextColor;
52
51
  transform: translateY(-1px);
53
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
52
+ box-shadow: 0 6px 16px hsl(var(--foreground, 220.9 39.3% 11%) / 0.1);
54
53
  }
55
54
  }
56
55
 
@@ -72,6 +71,7 @@ body,
72
71
  max-height: calc(100vh - 120px);
73
72
  overflow: auto;
74
73
  padding: sizes.$spaceComfy;
74
+ background-image: var(--rb-canvas-bg, none);
75
75
  background-size: cover;
76
76
  background-position: center;
77
77
  background-repeat: repeat;
@@ -82,6 +82,11 @@ body,
82
82
  }
83
83
  }
84
84
 
85
+ /* Hide the canvas grid background in dark theme (Tailwind/shadcn convention). */
86
+ .dark .split-right {
87
+ --rb-canvas-bg: none !important;
88
+ }
89
+
85
90
  .split-third {
86
91
  flex: 1 1 25%;
87
92
  border-right: 1px solid colors.$borderColor;
@@ -94,10 +99,10 @@ body,
94
99
  .stage {
95
100
  @include card;
96
101
  align-self: center;
97
- border: 1px solid color.adjust(colors.$borderColor, $lightness: -10%);
102
+ border: 1px solid colors.$borderColor;
98
103
  box-shadow:
99
- 0 18px 50px rgba(0, 0, 0, 0.16),
100
- 0 6px 16px rgba(0, 0, 0, 0.1);
104
+ 0 18px 50px hsl(var(--foreground, 220.9 39.3% 11%) / 0.16),
105
+ 0 6px 16px hsl(var(--foreground, 220.9 39.3% 11%) / 0.1);
101
106
  overflow: hidden;
102
107
  .scroll-container {
103
108
  /* Mobile-like scrollbar styling */
@@ -111,19 +116,19 @@ body,
111
116
  }
112
117
 
113
118
  &::-webkit-scrollbar-thumb {
114
- background: rgba(0, 0, 0, 0.25);
119
+ background: hsl(var(--foreground, 220.9 39.3% 11%) / 0.25);
115
120
  border-radius: 8px;
116
121
  }
117
122
 
118
123
  /* For Firefox */
119
124
  scrollbar-width: thin;
120
- scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
125
+ scrollbar-color: hsl(var(--foreground, 220.9 39.3% 11%) / 0.25) transparent;
121
126
  }
122
127
  }
123
128
 
124
129
  /* Builder preview selection helpers */
125
130
  .rb-node-selected {
126
- border: 1px solid #2684ff;
131
+ border: 1px solid colors.$accentColor;
127
132
  }
128
133
 
129
134
  /* Header */
@@ -131,7 +136,7 @@ body,
131
136
  position: sticky;
132
137
  top: 0;
133
138
  z-index: 10;
134
- background: #fff;
139
+ background: colors.$surfaceColor;
135
140
  border-bottom: 1px solid colors.$borderColor;
136
141
  height: 60px;
137
142
  padding: 0 sizes.$spaceComfy;
@@ -165,7 +170,6 @@ body,
165
170
  display: flex;
166
171
  align-items: center;
167
172
  gap: sizes.$spaceCozy;
168
- flex-wrap: wrap;
169
173
  font-size: 12px;
170
174
  color: colors.$mutedTextColor;
171
175
  }
@@ -201,15 +205,11 @@ body,
201
205
  display: flex;
202
206
  align-items: center;
203
207
  gap: sizes.$spaceCompact;
204
- flex-wrap: wrap;
205
- row-gap: sizes.$spaceTight;
206
208
  }
207
209
 
208
210
  .breadcrumb__item {
209
211
  display: inline-flex;
210
212
  align-items: center;
211
- max-width: 100%;
212
- overflow-wrap: anywhere;
213
213
  &--clickable {
214
214
  cursor: pointer;
215
215
  }
@@ -217,7 +217,7 @@ body,
217
217
 
218
218
  .breadcrumb__separator {
219
219
  color: colors.$borderColor;
220
- margin: 0;
220
+ margin: 0 sizes.$spaceTight;
221
221
  }
222
222
 
223
223
  .breadcrumb__link {
@@ -256,7 +256,7 @@ body,
256
256
  padding: sizes.$spaceCozy;
257
257
  border-radius: sizes.$radiusRounded;
258
258
  border: 1px solid colors.$borderColor;
259
- background: #fff;
259
+ background: colors.$surfaceColor;
260
260
  color: colors.$textColor;
261
261
  font-weight: 600;
262
262
  cursor: pointer;
@@ -274,9 +274,9 @@ body,
274
274
 
275
275
  .mobile-panel-toggle__button--active {
276
276
  background: colors.$textColor;
277
- color: #fff;
277
+ color: colors.$surfaceColor;
278
278
  border-color: colors.$textColor;
279
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
279
+ box-shadow: 0 6px 16px hsl(var(--foreground, 220.9 39.3% 11%) / 0.15);
280
280
  }
281
281
 
282
282
  .mobile-panel-toggle__icon {
@@ -301,8 +301,8 @@ body,
301
301
  right: sizes.$spaceCozy;
302
302
  border: none;
303
303
  border-radius: sizes.$radiusRounded;
304
- background: rgba(0, 0, 0, 0.7);
305
- color: #fff;
304
+ background: hsl(var(--foreground, 220.9 39.3% 11%) / 0.7);
305
+ color: colors.$surfaceColor;
306
306
  padding: sizes.$spaceSnug sizes.$spaceComfy;
307
307
  font-weight: 600;
308
308
  cursor: pointer;
@@ -330,7 +330,7 @@ body,
330
330
  width: 100%;
331
331
  height: 100%;
332
332
  background: colors.$canvasColor;
333
- box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
333
+ box-shadow: 0 25px 60px hsl(var(--foreground, 220.9 39.3% 11%) / 0.15);
334
334
  transition:
335
335
  transform 0.3s ease,
336
336
  opacity 0.3s ease;
@@ -375,7 +375,7 @@ body,
375
375
  display: block;
376
376
  position: absolute;
377
377
  inset: 0;
378
- background: rgba(17, 24, 39, 0.35);
378
+ background: hsl(var(--foreground, 220.9 39.3% 11%) / 0.35);
379
379
  border: none;
380
380
  padding: 0;
381
381
  margin: 0;
@@ -389,6 +389,9 @@ body,
389
389
  top: sizes.$spaceCozy;
390
390
  z-index: 5;
391
391
  padding-bottom: sizes.$spaceCozy;
392
+ .side-tool {
393
+ width: 100%;
394
+ }
392
395
  }
393
396
  }
394
397
  .screen-preview {
@@ -397,12 +400,6 @@ body,
397
400
  height: 100%;
398
401
  }
399
402
 
400
- // Custom blue/glow cursor while preview mode is enabled
401
- .screen-preview--preview {
402
- cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%3E%3Cdefs%3E%3Cfilter%20id='g'%20x='-50%25'%20y='-50%25'%20width='200%25'%20height='200%25'%3E%3CfeDropShadow%20dx='0'%20dy='0'%20stdDeviation='1.6'%20flood-color='%2360a5fa'%20flood-opacity='0.95'/%3E%3C/filter%3E%3C/defs%3E%3Cpath%20filter='url(%23g)'%20d='M6%202%20L6%2022%20L11%2017%20L15%2027%20L18%2026%20L14%2016%20L21%2016%20Z'%20fill='%2360a5fa'%20stroke='%231d4ed8'%20stroke-width='1'/%3E%3C/svg%3E") 6 2,
403
- pointer;
404
- }
405
-
406
403
  /* ProjectPage loading overlay */
407
404
  .rb-loading-overlay {
408
405
  position: absolute;
@@ -412,7 +409,7 @@ body,
412
409
  align-items: center;
413
410
  justify-content: center;
414
411
  pointer-events: none;
415
- background: rgba(255, 255, 255, 0.55);
412
+ background: hsl(var(--card, 0 0% 100%) / 0.55);
416
413
  backdrop-filter: blur(1px);
417
414
  }
418
415
 
@@ -1,3 +1,4 @@
1
+ @use '../foundation/colors' as colors;
1
2
  @use '../foundation/sizes' as sizes;
2
3
 
3
4
  .attributes-editor {
@@ -5,8 +6,8 @@
5
6
  margin-bottom: sizes.$spaceRelaxed;
6
7
  padding: sizes.$spaceCozy sizes.$spaceComfy;
7
8
  border-radius: sizes.$radiusRounded;
8
- border: sizes.$borderWidthHairline solid #eee;
9
- background: #f8f8f8;
9
+ border: sizes.$borderWidthHairline solid colors.$borderColor;
10
+ background: colors.$canvasColor;
10
11
  }
11
12
 
12
13
  &__component-title,
@@ -23,7 +24,7 @@
23
24
  &__component-description {
24
25
  margin: sizes.$spaceSnug 0 0;
25
26
  font-size: sizes.$fontSizeBase;
26
- color: #555;
27
+ color: colors.$mutedTextColor;
27
28
  }
28
29
 
29
30
  &__tabs {
@@ -36,9 +37,9 @@
36
37
  &__tab-button {
37
38
  padding: sizes.$spaceSnug sizes.$spaceCozy;
38
39
  border-radius: sizes.$radiusMid;
39
- border: sizes.$borderWidthHairline solid #ddd;
40
- background: #fff;
41
- color: #222;
40
+ border: sizes.$borderWidthHairline solid colors.$borderColor;
41
+ background: colors.$surfaceColor;
42
+ color: colors.$textColor;
42
43
  cursor: pointer;
43
44
  font-weight: 600;
44
45
  transition:
@@ -51,8 +52,8 @@
51
52
  }
52
53
 
53
54
  &--active {
54
- background: #222;
55
- color: #fff;
55
+ background: colors.$textColor;
56
+ color: colors.$surfaceColor;
56
57
  }
57
58
  }
58
59
 
@@ -120,8 +121,8 @@
120
121
  margin-bottom: sizes.$spaceComfy;
121
122
  padding: sizes.$spaceCozy sizes.$spaceComfy;
122
123
  border-radius: sizes.$radiusRounded;
123
- border: sizes.$borderWidthHairline solid #eee;
124
- background: #fff;
124
+ border: sizes.$borderWidthHairline solid colors.$borderColor;
125
+ background: colors.$surfaceColor;
125
126
  }
126
127
 
127
128
  &__mockable-title {
@@ -135,7 +136,7 @@
135
136
  }
136
137
 
137
138
  &__mockable-row + &__mockable-row {
138
- border-top: sizes.$borderWidthHairline solid #eee;
139
+ border-top: sizes.$borderWidthHairline solid colors.$borderColor;
139
140
  }
140
141
 
141
142
  &__mockable-name {
@@ -159,7 +160,7 @@
159
160
  right: 0;
160
161
  font-size: sizes.$fontSizeXs;
161
162
  line-height: 1.2;
162
- color: #666;
163
+ color: colors.$mutedTextColor;
163
164
  cursor: pointer;
164
165
  font-weight: 600;
165
166
  white-space: nowrap;
@@ -175,7 +176,8 @@
175
176
  }
176
177
 
177
178
  &__trigger:focus-visible {
178
- outline: sizes.$outlineWidthFocus solid rgba(17, 24, 39, 0.4);
179
+ outline: sizes.$outlineWidthFocus solid
180
+ hsl(var(--foreground, 220.9 39.3% 11%) / 0.4);
179
181
  outline-offset: sizes.$outlineWidthFocus;
180
182
  }
181
183
 
@@ -184,22 +186,14 @@
184
186
  top: 50%;
185
187
  right: 100%;
186
188
  transform: translate(calc(-1 * sizes.$spaceCompact), -50%);
187
- background: #111;
188
- color: #fff;
189
+ background: colors.$textColor;
190
+ color: colors.$surfaceColor;
189
191
  padding: sizes.$spaceSnug sizes.$spaceInset;
190
192
  border-radius: sizes.$radiusSoft;
191
193
  font-size: sizes.$fontSizeSm;
192
194
  line-height: 1.4;
193
- // Prevent long descriptions (e.g. URLs or long tokens) from overflowing the tooltip bubble.
194
- width: min(
195
- sizes.$dimensionSizeGridMax,
196
- calc(100vw - (2 * sizes.$spaceComfy))
197
- );
195
+ width: sizes.$dimensionSizeGridMax;
198
196
  text-align: left;
199
- white-space: normal;
200
- overflow-wrap: anywhere;
201
- word-break: break-word;
202
- hyphens: auto;
203
197
  box-shadow: sizes.$shadowTooltip;
204
198
  z-index: sizes.$zIndexRaised;
205
199
  opacity: 0;
@@ -216,11 +210,11 @@
216
210
  }
217
211
 
218
212
  .special-category-section {
219
- border: sizes.$borderWidthHairline solid #e0e0e0;
213
+ border: sizes.$borderWidthHairline solid colors.$borderColor;
220
214
  border-radius: sizes.$radiusRounded;
221
215
  padding: sizes.$spaceCozy;
222
216
  margin-bottom: sizes.$spaceComfy;
223
- background: #fdfdfd;
217
+ background: colors.$surfaceColor;
224
218
 
225
219
  &__header {
226
220
  display: flex;
@@ -235,9 +229,9 @@
235
229
  }
236
230
 
237
231
  &__toggle {
238
- border: sizes.$borderWidthHairline solid #ddd;
239
- background: #fff;
240
- color: #222;
232
+ border: sizes.$borderWidthHairline solid colors.$borderColor;
233
+ background: colors.$surfaceColor;
234
+ color: colors.$textColor;
241
235
  border-radius: sizes.$radiusSoft;
242
236
  padding: sizes.$spaceTight sizes.$spaceInset;
243
237
  cursor: pointer;
@@ -248,15 +242,15 @@
248
242
  border-color 0.15s ease;
249
243
 
250
244
  &[data-active='true'] {
251
- background: #222;
252
- color: #fff;
253
- border-color: #222;
245
+ background: colors.$textColor;
246
+ color: colors.$surfaceColor;
247
+ border-color: colors.$textColor;
254
248
  }
255
249
  }
256
250
 
257
251
  &__description {
258
252
  margin: sizes.$spaceCompact 0 0;
259
- color: #666;
253
+ color: colors.$mutedTextColor;
260
254
  font-size: sizes.$fontSizeSmPlus;
261
255
  padding-bottom: sizes.$spaceComfy;
262
256
  }