brix-runtime-sdk-api-web 1.0.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.
- package/dist/index.js +190 -0
- package/dist/types/api-exports.test.d.ts +33 -0
- package/dist/types/api-exports.test.d.ts.map +1 -0
- package/dist/types/context/RuntimeContext.d.ts +69 -0
- package/dist/types/context/RuntimeContext.d.ts.map +1 -0
- package/dist/types/context/index.d.ts +23 -0
- package/dist/types/context/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +52 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/auth.d.ts +405 -0
- package/dist/types/types/auth.d.ts.map +1 -0
- package/dist/types/types/capability.d.ts +218 -0
- package/dist/types/types/capability.d.ts.map +1 -0
- package/dist/types/types/common.d.ts +99 -0
- package/dist/types/types/common.d.ts.map +1 -0
- package/dist/types/types/config.d.ts +85 -0
- package/dist/types/types/config.d.ts.map +1 -0
- package/dist/types/types/event.d.ts +658 -0
- package/dist/types/types/event.d.ts.map +1 -0
- package/dist/types/types/http.d.ts +132 -0
- package/dist/types/types/http.d.ts.map +1 -0
- package/dist/types/types/i18n.d.ts +327 -0
- package/dist/types/types/i18n.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +61 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/layout.d.ts +301 -0
- package/dist/types/types/layout.d.ts.map +1 -0
- package/dist/types/types/module.d.ts +78 -0
- package/dist/types/types/module.d.ts.map +1 -0
- package/dist/types/types/navigation.d.ts +295 -0
- package/dist/types/types/navigation.d.ts.map +1 -0
- package/dist/types/types/plugin-loader-capability.d.ts +142 -0
- package/dist/types/types/plugin-loader-capability.d.ts.map +1 -0
- package/dist/types/types/plugin.d.ts +250 -0
- package/dist/types/types/plugin.d.ts.map +1 -0
- package/dist/types/types/state.d.ts +306 -0
- package/dist/types/types/state.d.ts.map +1 -0
- package/dist/types/types/theme.d.ts +279 -0
- package/dist/types/types/theme.d.ts.map +1 -0
- package/dist/types/types/ui/adapter.d.ts +181 -0
- package/dist/types/types/ui/adapter.d.ts.map +1 -0
- package/dist/types/types/ui/avatar.d.ts +102 -0
- package/dist/types/types/ui/avatar.d.ts.map +1 -0
- package/dist/types/types/ui/badge.d.ts +101 -0
- package/dist/types/types/ui/badge.d.ts.map +1 -0
- package/dist/types/types/ui/button.d.ts +135 -0
- package/dist/types/types/ui/button.d.ts.map +1 -0
- package/dist/types/types/ui/card.d.ts +105 -0
- package/dist/types/types/ui/card.d.ts.map +1 -0
- package/dist/types/types/ui/common.d.ts +29 -0
- package/dist/types/types/ui/common.d.ts.map +1 -0
- package/dist/types/types/ui/icon.d.ts +78 -0
- package/dist/types/types/ui/icon.d.ts.map +1 -0
- package/dist/types/types/ui/index.d.ts +59 -0
- package/dist/types/types/ui/index.d.ts.map +1 -0
- package/dist/types/types/ui/input.d.ts +200 -0
- package/dist/types/types/ui/input.d.ts.map +1 -0
- package/dist/types/types/ui/menu.d.ts +211 -0
- package/dist/types/types/ui/menu.d.ts.map +1 -0
- package/dist/types/types/ui/message.d.ts +121 -0
- package/dist/types/types/ui/message.d.ts.map +1 -0
- package/dist/types/types/ui/modal.d.ts +167 -0
- package/dist/types/types/ui/modal.d.ts.map +1 -0
- package/dist/types/types/ui/select.d.ts +213 -0
- package/dist/types/types/ui/select.d.ts.map +1 -0
- package/dist/types/types/ui/theme-tokens.d.ts +226 -0
- package/dist/types/types/ui/theme-tokens.d.ts.map +1 -0
- package/dist/types/types/ui/tooltip.d.ts +98 -0
- package/dist/types/types/ui/tooltip.d.ts.map +1 -0
- package/dist/types/types/ui.d.ts +49 -0
- package/dist/types/types/ui.d.ts.map +1 -0
- package/package.json +34 -0
- package/src/api-exports.test.ts +199 -0
- package/src/context/RuntimeContext.d.ts +69 -0
- package/src/context/RuntimeContext.d.ts.map +1 -0
- package/src/context/RuntimeContext.ts +75 -0
- package/src/context/index.d.ts +23 -0
- package/src/context/index.d.ts.map +1 -0
- package/src/context/index.ts +23 -0
- package/src/index.d.ts +52 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.ts +59 -0
- package/src/types/auth.d.ts +146 -0
- package/src/types/auth.d.ts.map +1 -0
- package/src/types/auth.ts +479 -0
- package/src/types/capability.d.ts +218 -0
- package/src/types/capability.d.ts.map +1 -0
- package/src/types/capability.ts +302 -0
- package/src/types/common.d.ts +99 -0
- package/src/types/common.d.ts.map +1 -0
- package/src/types/common.ts +115 -0
- package/src/types/config.d.ts +64 -0
- package/src/types/config.d.ts.map +1 -0
- package/src/types/config.ts +96 -0
- package/src/types/event.d.ts +206 -0
- package/src/types/event.d.ts.map +1 -0
- package/src/types/event.ts +776 -0
- package/src/types/http.d.ts +132 -0
- package/src/types/http.d.ts.map +1 -0
- package/src/types/http.ts +156 -0
- package/src/types/i18n.ts +420 -0
- package/src/types/index.d.ts +50 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.ts +120 -0
- package/src/types/layout.ts +394 -0
- package/src/types/module.d.ts +78 -0
- package/src/types/module.d.ts.map +1 -0
- package/src/types/module.ts +92 -0
- package/src/types/navigation.d.ts +101 -0
- package/src/types/navigation.d.ts.map +1 -0
- package/src/types/navigation.ts +361 -0
- package/src/types/plugin-loader-capability.ts +159 -0
- package/src/types/plugin.d.ts +250 -0
- package/src/types/plugin.d.ts.map +1 -0
- package/src/types/plugin.ts +344 -0
- package/src/types/state.d.ts +119 -0
- package/src/types/state.d.ts.map +1 -0
- package/src/types/state.ts +366 -0
- package/src/types/theme.ts +378 -0
- package/src/types/ui/adapter.ts +222 -0
- package/src/types/ui/avatar.ts +113 -0
- package/src/types/ui/badge.ts +112 -0
- package/src/types/ui/button.ts +148 -0
- package/src/types/ui/card.ts +116 -0
- package/src/types/ui/common.ts +29 -0
- package/src/types/ui/icon.ts +85 -0
- package/src/types/ui/index.ts +78 -0
- package/src/types/ui/input.ts +225 -0
- package/src/types/ui/menu.ts +237 -0
- package/src/types/ui/message.ts +135 -0
- package/src/types/ui/modal.ts +188 -0
- package/src/types/ui/select.ts +239 -0
- package/src/types/ui/theme-tokens.ts +357 -0
- package/src/types/ui/tooltip.ts +120 -0
- package/src/types/ui.ts +49 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Brix Platform Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @file Theme Tokens Type Definitions
|
|
18
|
+
* @description Defines theme token types and preset values for the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/theme-tokens
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*
|
|
22
|
+
* [Design Principles]
|
|
23
|
+
* - Theme tokens follow MUI standard color palette for broad compatibility
|
|
24
|
+
* - Layout-specific colors support Shell layer layout assembly
|
|
25
|
+
* - Preset constants provide sensible defaults for light/dark modes
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import type { ReactNode } from 'react';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Theme Tokens (MUI Standard Color Palette)
|
|
32
|
+
*
|
|
33
|
+
* Comprehensive design tokens following Material UI conventions.
|
|
34
|
+
* These tokens ensure visual consistency across different UI adapter implementations.
|
|
35
|
+
*
|
|
36
|
+
* **Architectural Note:** Layout-specific colors (sidebarBackground, headerBackground, etc.)
|
|
37
|
+
* are included to support Shell layer layout assembly while maintaining theme consistency.
|
|
38
|
+
*/
|
|
39
|
+
export interface ThemeTokens {
|
|
40
|
+
// ========================================
|
|
41
|
+
// Brand Colors (Primary & Secondary)
|
|
42
|
+
// ========================================
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Primary Brand Color
|
|
46
|
+
*
|
|
47
|
+
* Main brand color for primary actions and highlights.
|
|
48
|
+
*/
|
|
49
|
+
primary: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Primary Color - Light Variant
|
|
53
|
+
*
|
|
54
|
+
* Lighter shade of primary for hover states and backgrounds.
|
|
55
|
+
*/
|
|
56
|
+
primaryLight: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Primary Color - Dark Variant
|
|
60
|
+
*
|
|
61
|
+
* Darker shade of primary for active states.
|
|
62
|
+
*/
|
|
63
|
+
primaryDark: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Primary Contrast Text
|
|
67
|
+
*
|
|
68
|
+
* Text color that contrasts with primary background.
|
|
69
|
+
*/
|
|
70
|
+
primaryContrastText: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Secondary Brand Color
|
|
74
|
+
*/
|
|
75
|
+
secondary: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Secondary Color - Light Variant
|
|
79
|
+
*/
|
|
80
|
+
secondaryLight: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Secondary Color - Dark Variant
|
|
84
|
+
*/
|
|
85
|
+
secondaryDark: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Secondary Contrast Text
|
|
89
|
+
*/
|
|
90
|
+
secondaryContrastText: string;
|
|
91
|
+
|
|
92
|
+
// ========================================
|
|
93
|
+
// Semantic Colors
|
|
94
|
+
// ========================================
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Error/Danger Color
|
|
98
|
+
*
|
|
99
|
+
* Used for error states, destructive actions, invalid inputs.
|
|
100
|
+
*/
|
|
101
|
+
error: string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Warning Color
|
|
105
|
+
*
|
|
106
|
+
* Used for warning messages and caution states.
|
|
107
|
+
*/
|
|
108
|
+
warning: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Info Color
|
|
112
|
+
*
|
|
113
|
+
* Used for informational messages and neutral highlights.
|
|
114
|
+
*/
|
|
115
|
+
info: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Success Color
|
|
119
|
+
*
|
|
120
|
+
* Used for success states and positive confirmations.
|
|
121
|
+
*/
|
|
122
|
+
success: string;
|
|
123
|
+
|
|
124
|
+
// ========================================
|
|
125
|
+
// Neutral Colors
|
|
126
|
+
// ========================================
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Page Background Color
|
|
130
|
+
*
|
|
131
|
+
* Default background color for the page/viewport.
|
|
132
|
+
*/
|
|
133
|
+
background: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Paper/Surface Color
|
|
137
|
+
*
|
|
138
|
+
* Background color for elevated surfaces like cards and dialogs.
|
|
139
|
+
*/
|
|
140
|
+
paper: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Primary Text Color
|
|
144
|
+
*
|
|
145
|
+
* Main text color for headings and body text.
|
|
146
|
+
*/
|
|
147
|
+
textPrimary: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Secondary Text Color
|
|
151
|
+
*
|
|
152
|
+
* Subdued text color for captions and supporting text.
|
|
153
|
+
*/
|
|
154
|
+
textSecondary: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Disabled Text Color
|
|
158
|
+
*
|
|
159
|
+
* Text color for disabled/inactive elements.
|
|
160
|
+
*/
|
|
161
|
+
textDisabled: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Divider Color
|
|
165
|
+
*
|
|
166
|
+
* Color for divider lines and borders.
|
|
167
|
+
*/
|
|
168
|
+
divider: string;
|
|
169
|
+
|
|
170
|
+
// ========================================
|
|
171
|
+
// Layout Colors (Shell Layer Support)
|
|
172
|
+
// ========================================
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Sidebar Background Color
|
|
176
|
+
*
|
|
177
|
+
* Background color for the sidebar navigation area.
|
|
178
|
+
*/
|
|
179
|
+
sidebarBackground: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Sidebar Text Color
|
|
183
|
+
*
|
|
184
|
+
* Default text color in the sidebar.
|
|
185
|
+
*/
|
|
186
|
+
sidebarText: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Sidebar Active Item Background
|
|
190
|
+
*
|
|
191
|
+
* Background color for the selected/active menu item.
|
|
192
|
+
*/
|
|
193
|
+
sidebarActiveBackground: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Sidebar Hover Background
|
|
197
|
+
*
|
|
198
|
+
* Background color on hover for sidebar items.
|
|
199
|
+
*/
|
|
200
|
+
sidebarHoverBackground: string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Header Background Color
|
|
204
|
+
*
|
|
205
|
+
* Background color for the top header area.
|
|
206
|
+
*/
|
|
207
|
+
headerBackground: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Header Text Color
|
|
211
|
+
*
|
|
212
|
+
* Text color in the header area.
|
|
213
|
+
*/
|
|
214
|
+
headerText: string;
|
|
215
|
+
|
|
216
|
+
// ========================================
|
|
217
|
+
// Shape Tokens
|
|
218
|
+
// ========================================
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Border Radius - Small
|
|
222
|
+
*
|
|
223
|
+
* Small border radius for compact elements (e.g., chips, tags).
|
|
224
|
+
*/
|
|
225
|
+
borderRadiusSmall: number;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Border Radius - Medium
|
|
229
|
+
*
|
|
230
|
+
* Default border radius for buttons, inputs, cards.
|
|
231
|
+
*/
|
|
232
|
+
borderRadiusMedium: number;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Border Radius - Large
|
|
236
|
+
*
|
|
237
|
+
* Large border radius for modals, large cards.
|
|
238
|
+
*/
|
|
239
|
+
borderRadiusLarge: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Theme Provider Component Props
|
|
244
|
+
*
|
|
245
|
+
* Provides theme context to child components.
|
|
246
|
+
* Implemented by each UI adapter to apply the appropriate theme.
|
|
247
|
+
*/
|
|
248
|
+
export interface ThemeProviderProps {
|
|
249
|
+
/**
|
|
250
|
+
* Child Elements
|
|
251
|
+
*
|
|
252
|
+
* Components that receive theme context.
|
|
253
|
+
*/
|
|
254
|
+
children: ReactNode;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Theme Mode
|
|
258
|
+
*
|
|
259
|
+
* Light or dark theme mode. Defaults to light.
|
|
260
|
+
* @default 'light'
|
|
261
|
+
*/
|
|
262
|
+
theme?: 'light' | 'dark';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ============================================================================
|
|
266
|
+
// MUI Theme Presets
|
|
267
|
+
// ============================================================================
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* MUI Light Theme Tokens
|
|
271
|
+
*
|
|
272
|
+
* Default light mode theme following Material UI conventions.
|
|
273
|
+
*/
|
|
274
|
+
export const MUI_THEME_TOKENS: ThemeTokens = {
|
|
275
|
+
// Brand Colors
|
|
276
|
+
primary: '#1976d2',
|
|
277
|
+
primaryLight: '#42a5f5',
|
|
278
|
+
primaryDark: '#1565c0',
|
|
279
|
+
primaryContrastText: '#ffffff',
|
|
280
|
+
|
|
281
|
+
secondary: '#9c27b0',
|
|
282
|
+
secondaryLight: '#ba68c8',
|
|
283
|
+
secondaryDark: '#7b1fa2',
|
|
284
|
+
secondaryContrastText: '#ffffff',
|
|
285
|
+
|
|
286
|
+
// Semantic Colors
|
|
287
|
+
error: '#d32f2f',
|
|
288
|
+
warning: '#ed6c02',
|
|
289
|
+
info: '#0288d1',
|
|
290
|
+
success: '#2e7d32',
|
|
291
|
+
|
|
292
|
+
// Neutral Colors
|
|
293
|
+
background: '#f5f5f5',
|
|
294
|
+
paper: '#ffffff',
|
|
295
|
+
textPrimary: 'rgba(0, 0, 0, 0.87)',
|
|
296
|
+
textSecondary: 'rgba(0, 0, 0, 0.6)',
|
|
297
|
+
textDisabled: 'rgba(0, 0, 0, 0.38)',
|
|
298
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
299
|
+
|
|
300
|
+
// Layout Colors
|
|
301
|
+
sidebarBackground: '#1e293b',
|
|
302
|
+
sidebarText: 'rgba(255, 255, 255, 0.87)',
|
|
303
|
+
sidebarActiveBackground: '#3b82f6',
|
|
304
|
+
sidebarHoverBackground: 'rgba(255, 255, 255, 0.08)',
|
|
305
|
+
headerBackground: '#ffffff',
|
|
306
|
+
headerText: 'rgba(0, 0, 0, 0.87)',
|
|
307
|
+
|
|
308
|
+
// Shape Tokens
|
|
309
|
+
borderRadiusSmall: 4,
|
|
310
|
+
borderRadiusMedium: 8,
|
|
311
|
+
borderRadiusLarge: 12,
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* MUI Dark Theme Tokens
|
|
316
|
+
*
|
|
317
|
+
* Dark mode variant of MUI theme tokens.
|
|
318
|
+
*/
|
|
319
|
+
export const MUI_DARK_THEME_TOKENS: ThemeTokens = {
|
|
320
|
+
// Brand Colors (same as light)
|
|
321
|
+
primary: '#90caf9',
|
|
322
|
+
primaryLight: '#e3f2fd',
|
|
323
|
+
primaryDark: '#42a5f5',
|
|
324
|
+
primaryContrastText: 'rgba(0, 0, 0, 0.87)',
|
|
325
|
+
|
|
326
|
+
secondary: '#ce93d8',
|
|
327
|
+
secondaryLight: '#f3e5f5',
|
|
328
|
+
secondaryDark: '#ab47bc',
|
|
329
|
+
secondaryContrastText: 'rgba(0, 0, 0, 0.87)',
|
|
330
|
+
|
|
331
|
+
// Semantic Colors (adjusted for dark mode)
|
|
332
|
+
error: '#f44336',
|
|
333
|
+
warning: '#ffa726',
|
|
334
|
+
info: '#29b6f6',
|
|
335
|
+
success: '#66bb6a',
|
|
336
|
+
|
|
337
|
+
// Neutral Colors (inverted)
|
|
338
|
+
background: '#121212',
|
|
339
|
+
paper: '#1e1e1e',
|
|
340
|
+
textPrimary: 'rgba(255, 255, 255, 0.87)',
|
|
341
|
+
textSecondary: 'rgba(255, 255, 255, 0.6)',
|
|
342
|
+
textDisabled: 'rgba(255, 255, 255, 0.38)',
|
|
343
|
+
divider: 'rgba(255, 255, 255, 0.12)',
|
|
344
|
+
|
|
345
|
+
// Layout Colors (adjusted for dark mode)
|
|
346
|
+
sidebarBackground: '#0f172a',
|
|
347
|
+
sidebarText: 'rgba(255, 255, 255, 0.87)',
|
|
348
|
+
sidebarActiveBackground: '#1e40af',
|
|
349
|
+
sidebarHoverBackground: 'rgba(255, 255, 255, 0.08)',
|
|
350
|
+
headerBackground: '#1e1e1e',
|
|
351
|
+
headerText: 'rgba(255, 255, 255, 0.87)',
|
|
352
|
+
|
|
353
|
+
// Shape Tokens (same as light)
|
|
354
|
+
borderRadiusSmall: 4,
|
|
355
|
+
borderRadiusMedium: 8,
|
|
356
|
+
borderRadiusLarge: 12,
|
|
357
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Brix Platform Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @file Tooltip Component Type Definitions
|
|
18
|
+
* @description Defines types for the Tooltip component in the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/tooltip
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Tooltip Placement Options
|
|
27
|
+
*/
|
|
28
|
+
export type TooltipPlacement =
|
|
29
|
+
| 'top'
|
|
30
|
+
| 'top-start'
|
|
31
|
+
| 'top-end'
|
|
32
|
+
| 'bottom'
|
|
33
|
+
| 'bottom-start'
|
|
34
|
+
| 'bottom-end'
|
|
35
|
+
| 'left'
|
|
36
|
+
| 'left-start'
|
|
37
|
+
| 'left-end'
|
|
38
|
+
| 'right'
|
|
39
|
+
| 'right-start'
|
|
40
|
+
| 'right-end';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Tooltip Component Props
|
|
44
|
+
*
|
|
45
|
+
* Informative text that appears on hover or focus.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <Tooltip title="Save changes" placement="top">
|
|
50
|
+
* <Button startIcon="save">Save</Button>
|
|
51
|
+
* </Tooltip>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export interface TooltipProps {
|
|
55
|
+
/**
|
|
56
|
+
* Tooltip Content
|
|
57
|
+
*
|
|
58
|
+
* The content displayed in the tooltip.
|
|
59
|
+
*/
|
|
60
|
+
title: ReactNode;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Tooltip Placement
|
|
64
|
+
*
|
|
65
|
+
* Position of the tooltip relative to the target element.
|
|
66
|
+
* @default 'top'
|
|
67
|
+
*/
|
|
68
|
+
placement?: TooltipPlacement;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Show Arrow
|
|
72
|
+
*
|
|
73
|
+
* When true, displays an arrow pointing to the target element.
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
arrow?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Enter Delay (ms)
|
|
80
|
+
*
|
|
81
|
+
* Delay before showing the tooltip.
|
|
82
|
+
* @default 100
|
|
83
|
+
*/
|
|
84
|
+
enterDelay?: number;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Leave Delay (ms)
|
|
88
|
+
*
|
|
89
|
+
* Delay before hiding the tooltip.
|
|
90
|
+
* @default 0
|
|
91
|
+
*/
|
|
92
|
+
leaveDelay?: number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Disabled State
|
|
96
|
+
*
|
|
97
|
+
* When true, the tooltip is disabled.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Custom Inline Styles
|
|
104
|
+
*
|
|
105
|
+
* Styles applied to the tooltip popup.
|
|
106
|
+
*/
|
|
107
|
+
style?: CSSProperties;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Custom CSS Class Name
|
|
111
|
+
*/
|
|
112
|
+
className?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Tooltip Target Element
|
|
116
|
+
*
|
|
117
|
+
* The element that triggers the tooltip on hover/focus.
|
|
118
|
+
*/
|
|
119
|
+
children: ReactNode;
|
|
120
|
+
}
|
package/src/types/ui.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Brix Platform Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @file UI Adapter Type Definitions - Backward Compatibility Re-export
|
|
18
|
+
* @description Re-exports all UI adapter types from the ui/ subfolder for backward compatibility.
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*
|
|
22
|
+
* [v3.2.0 Refactoring]
|
|
23
|
+
* The original 2100+ line file has been split into component-specific modules in the ui/ folder:
|
|
24
|
+
* - ui/common.ts: Shared types (ComponentSize)
|
|
25
|
+
* - ui/button.ts: Button component types
|
|
26
|
+
* - ui/input.ts: Input component types
|
|
27
|
+
* - ui/select.ts: Select component types
|
|
28
|
+
* - ui/card.ts: Card component types
|
|
29
|
+
* - ui/avatar.ts: Avatar component types
|
|
30
|
+
* - ui/badge.ts: Badge component types
|
|
31
|
+
* - ui/tooltip.ts: Tooltip component types
|
|
32
|
+
* - ui/menu.ts: Menu and MenuItem component types
|
|
33
|
+
* - ui/modal.ts: Modal component types
|
|
34
|
+
* - ui/message.ts: Message API types
|
|
35
|
+
* - ui/theme-tokens.ts: Theme tokens and preset values
|
|
36
|
+
* - ui/icon.ts: Icon component types
|
|
37
|
+
* - ui/adapter.ts: UIAdapter interface and capability symbol
|
|
38
|
+
*
|
|
39
|
+
* This file re-exports everything from the ui/ folder for backward compatibility.
|
|
40
|
+
* New code should import directly from '@brix/runtime-sdk-api-web/types/ui/[component]'.
|
|
41
|
+
*
|
|
42
|
+
* [Architectural Constraints - v3.0.4 Blueprint]
|
|
43
|
+
* - UIAdapter only contains ATOMIC components
|
|
44
|
+
* - Layout components (Sidebar, Header, Layout) are FORBIDDEN in UIAdapter
|
|
45
|
+
* - Shell layer assembles layouts using these atomic components
|
|
46
|
+
* - Host layer selects adapter via configuration
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
export * from './ui/index';
|