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,112 @@
|
|
|
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 Badge Component Type Definitions
|
|
18
|
+
* @description Defines types for the Badge component in the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/badge
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ReactNode, CSSProperties } from 'react';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Badge Color Variants
|
|
27
|
+
*/
|
|
28
|
+
export type BadgeColor = 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Badge Component Props
|
|
32
|
+
*
|
|
33
|
+
* Small status indicator that can be attached to other elements.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Badge count={5} color="error" showZero={false}>
|
|
38
|
+
* <Icon name="notification" />
|
|
39
|
+
* </Badge>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export interface BadgeProps {
|
|
43
|
+
/**
|
|
44
|
+
* Badge Count
|
|
45
|
+
*
|
|
46
|
+
* Numeric value to display. If 0 and showZero is false, badge is hidden.
|
|
47
|
+
*/
|
|
48
|
+
count?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Maximum Count
|
|
52
|
+
*
|
|
53
|
+
* Maximum count to display. Exceeding values show as "max+".
|
|
54
|
+
* @default 99
|
|
55
|
+
*/
|
|
56
|
+
max?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Show Zero
|
|
60
|
+
*
|
|
61
|
+
* When true, displays the badge even when count is 0.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
showZero?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Dot Mode
|
|
68
|
+
*
|
|
69
|
+
* When true, displays a simple dot instead of count.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
dot?: boolean;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Badge Color
|
|
76
|
+
*
|
|
77
|
+
* @default 'primary'
|
|
78
|
+
*/
|
|
79
|
+
color?: BadgeColor;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Badge Position Offset
|
|
83
|
+
*
|
|
84
|
+
* Offset from the default position [horizontal, vertical].
|
|
85
|
+
*/
|
|
86
|
+
offset?: [number, number];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Invisible Mode
|
|
90
|
+
*
|
|
91
|
+
* When true, the badge is not rendered.
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
invisible?: boolean;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Custom Inline Styles
|
|
98
|
+
*/
|
|
99
|
+
style?: CSSProperties;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Custom CSS Class Name
|
|
103
|
+
*/
|
|
104
|
+
className?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Badge Target Element
|
|
108
|
+
*
|
|
109
|
+
* The element that the badge is attached to.
|
|
110
|
+
*/
|
|
111
|
+
children?: ReactNode;
|
|
112
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
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 Button Component Type Definitions
|
|
18
|
+
* @description Defines types for the Button component in the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/button
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
24
|
+
import type { ComponentSize } from './common';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Button Style Variants
|
|
28
|
+
*
|
|
29
|
+
* Defines the visual style of the button:
|
|
30
|
+
* - primary: Solid background, high emphasis
|
|
31
|
+
* - secondary: Outlined style, medium emphasis
|
|
32
|
+
* - text: Text only, low emphasis
|
|
33
|
+
* - danger: Destructive action indicator
|
|
34
|
+
*/
|
|
35
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'text' | 'danger';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Button Component Props
|
|
39
|
+
*
|
|
40
|
+
* UI library agnostic button properties. All UI adapter implementations
|
|
41
|
+
* must support these properties to ensure consistent behavior across
|
|
42
|
+
* different UI framework implementations.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Button
|
|
47
|
+
* variant="primary"
|
|
48
|
+
* size="medium"
|
|
49
|
+
* startIcon="save"
|
|
50
|
+
* onClick={handleSave}
|
|
51
|
+
* >
|
|
52
|
+
* Save Changes
|
|
53
|
+
* </Button>
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export interface ButtonProps {
|
|
57
|
+
/**
|
|
58
|
+
* Button Visual Variant
|
|
59
|
+
*
|
|
60
|
+
* Determines the visual style of the button.
|
|
61
|
+
* @default 'primary'
|
|
62
|
+
*/
|
|
63
|
+
variant?: ButtonVariant;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Button Size
|
|
67
|
+
*
|
|
68
|
+
* Controls the button dimensions and font size.
|
|
69
|
+
* @default 'medium'
|
|
70
|
+
*/
|
|
71
|
+
size?: ComponentSize;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Loading State
|
|
75
|
+
*
|
|
76
|
+
* When true, displays a loading spinner and disables interaction.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Disabled State
|
|
83
|
+
*
|
|
84
|
+
* When true, the button is non-interactive and visually dimmed.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Full Width Mode
|
|
91
|
+
*
|
|
92
|
+
* When true, the button expands to fill its container width.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
fullWidth?: boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Start Icon Name
|
|
99
|
+
*
|
|
100
|
+
* Icon name to display before the button text.
|
|
101
|
+
* The actual icon is resolved by the Icon component from UIAdapter.
|
|
102
|
+
*/
|
|
103
|
+
startIcon?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* End Icon Name
|
|
107
|
+
*
|
|
108
|
+
* Icon name to display after the button text.
|
|
109
|
+
* The actual icon is resolved by the Icon component from UIAdapter.
|
|
110
|
+
*/
|
|
111
|
+
endIcon?: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Click Event Handler
|
|
115
|
+
*
|
|
116
|
+
* Callback fired when the button is clicked.
|
|
117
|
+
*/
|
|
118
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* HTML Button Type
|
|
122
|
+
*
|
|
123
|
+
* Native HTML button type attribute for form integration.
|
|
124
|
+
* @default 'button'
|
|
125
|
+
*/
|
|
126
|
+
type?: 'button' | 'submit' | 'reset';
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Custom Inline Styles
|
|
130
|
+
*
|
|
131
|
+
* CSS properties applied directly to the button element.
|
|
132
|
+
*/
|
|
133
|
+
style?: CSSProperties;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Custom CSS Class Name
|
|
137
|
+
*
|
|
138
|
+
* Additional CSS class names for styling customization.
|
|
139
|
+
*/
|
|
140
|
+
className?: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Button Content
|
|
144
|
+
*
|
|
145
|
+
* The text or elements displayed inside the button.
|
|
146
|
+
*/
|
|
147
|
+
children: ReactNode;
|
|
148
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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 Card Component Type Definitions
|
|
18
|
+
* @description Defines types for the Card component in the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/card
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ReactNode, MouseEvent, CSSProperties } from 'react';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Card Component Props
|
|
27
|
+
*
|
|
28
|
+
* Container component for grouping related content with optional
|
|
29
|
+
* elevation and interactive states.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Card
|
|
34
|
+
* title="User Profile"
|
|
35
|
+
* hoverable
|
|
36
|
+
* onClick={handleCardClick}
|
|
37
|
+
* >
|
|
38
|
+
* <p>Card content here</p>
|
|
39
|
+
* </Card>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export interface CardProps {
|
|
43
|
+
/**
|
|
44
|
+
* Card Title
|
|
45
|
+
*
|
|
46
|
+
* Optional title displayed at the top of the card.
|
|
47
|
+
*/
|
|
48
|
+
title?: ReactNode;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Card Subtitle
|
|
52
|
+
*
|
|
53
|
+
* Optional subtitle displayed below the title.
|
|
54
|
+
*/
|
|
55
|
+
subtitle?: ReactNode;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Elevation Level
|
|
59
|
+
*
|
|
60
|
+
* Shadow depth level. 0 means no shadow.
|
|
61
|
+
* @default 1
|
|
62
|
+
*/
|
|
63
|
+
elevation?: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Hoverable State
|
|
67
|
+
*
|
|
68
|
+
* When true, the card shows hover effects on mouse over.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
hoverable?: boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Bordered Style
|
|
75
|
+
*
|
|
76
|
+
* When true, displays a border instead of/in addition to shadow.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
bordered?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Click Event Handler
|
|
83
|
+
*
|
|
84
|
+
* Callback fired when the card is clicked.
|
|
85
|
+
*/
|
|
86
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Header Actions
|
|
90
|
+
*
|
|
91
|
+
* Action elements displayed in the card header area.
|
|
92
|
+
*/
|
|
93
|
+
headerActions?: ReactNode;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Footer Content
|
|
97
|
+
*
|
|
98
|
+
* Content displayed in the card footer area.
|
|
99
|
+
*/
|
|
100
|
+
footer?: ReactNode;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Custom Inline Styles
|
|
104
|
+
*/
|
|
105
|
+
style?: CSSProperties;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Custom CSS Class Name
|
|
109
|
+
*/
|
|
110
|
+
className?: string;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Card Content
|
|
114
|
+
*/
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 Common UI Type Definitions
|
|
18
|
+
* @description Shared type definitions used across UI components
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/common
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Component Size Variants
|
|
25
|
+
*
|
|
26
|
+
* Standard size variants used across all UI components for visual consistency.
|
|
27
|
+
* These sizes map to specific pixel values defined by each UI adapter implementation.
|
|
28
|
+
*/
|
|
29
|
+
export type ComponentSize = 'small' | 'medium' | 'large';
|
|
@@ -0,0 +1,85 @@
|
|
|
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 Icon Component Type Definitions
|
|
18
|
+
* @description Defines types for the Icon component in the UI adapter system
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui/icon
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { MouseEvent, CSSProperties } from 'react';
|
|
24
|
+
import type { ComponentSize } from './common';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Icon Component Props
|
|
28
|
+
*
|
|
29
|
+
* Name-based icon lookup component. The actual icon rendering
|
|
30
|
+
* is handled by the UI adapter implementation (MUI icons, SVG icons, etc.).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Icon name="dashboard" size="medium" color="#1976d2" />
|
|
35
|
+
* <Icon name="settings" size={24} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export interface IconProps {
|
|
39
|
+
/**
|
|
40
|
+
* Icon Name
|
|
41
|
+
*
|
|
42
|
+
* Name/identifier of the icon to display.
|
|
43
|
+
* The name is resolved by the UI adapter's icon mapping.
|
|
44
|
+
*/
|
|
45
|
+
name: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Icon Size
|
|
49
|
+
*
|
|
50
|
+
* Predefined size or custom pixel value.
|
|
51
|
+
* @default 'medium'
|
|
52
|
+
*/
|
|
53
|
+
size?: ComponentSize | number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Icon Color
|
|
57
|
+
*
|
|
58
|
+
* Custom color override (CSS color value).
|
|
59
|
+
*/
|
|
60
|
+
color?: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Custom Inline Styles
|
|
64
|
+
*/
|
|
65
|
+
style?: CSSProperties;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Custom CSS Class Name
|
|
69
|
+
*/
|
|
70
|
+
className?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Accessible Label
|
|
74
|
+
*
|
|
75
|
+
* ARIA label for screen readers.
|
|
76
|
+
*/
|
|
77
|
+
'aria-label'?: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Click Handler
|
|
81
|
+
*
|
|
82
|
+
* Optional click handler for interactive icons.
|
|
83
|
+
*/
|
|
84
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
85
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 Barrel Export
|
|
18
|
+
* @description Unified export for all UI adapter type definitions
|
|
19
|
+
* @module @brix/runtime-sdk-api-web/types/ui
|
|
20
|
+
* @version 3.2.0
|
|
21
|
+
*
|
|
22
|
+
* [v3.2.0 Refactoring]
|
|
23
|
+
* Split the original 2100+ line ui.ts into component-specific modules:
|
|
24
|
+
* - common.ts: Shared types (ComponentSize)
|
|
25
|
+
* - button.ts: Button component types
|
|
26
|
+
* - input.ts: Input component types
|
|
27
|
+
* - select.ts: Select component types
|
|
28
|
+
* - card.ts: Card component types
|
|
29
|
+
* - avatar.ts: Avatar component types
|
|
30
|
+
* - badge.ts: Badge component types
|
|
31
|
+
* - tooltip.ts: Tooltip component types
|
|
32
|
+
* - menu.ts: Menu and MenuItem component types
|
|
33
|
+
* - modal.ts: Modal component types
|
|
34
|
+
* - message.ts: Message API types
|
|
35
|
+
* - theme-tokens.ts: Theme tokens and preset values
|
|
36
|
+
* - icon.ts: Icon component types
|
|
37
|
+
* - adapter.ts: UIAdapter interface and capability symbol
|
|
38
|
+
*
|
|
39
|
+
* [Design Principles]
|
|
40
|
+
* - Each file has a single responsibility
|
|
41
|
+
* - Facilitates on-demand imports for tree-shaking
|
|
42
|
+
* - Easy to maintain and extend
|
|
43
|
+
* - Full backward compatibility via this barrel export
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
// =========================================
|
|
47
|
+
// Common Types
|
|
48
|
+
// =========================================
|
|
49
|
+
export * from './common';
|
|
50
|
+
|
|
51
|
+
// =========================================
|
|
52
|
+
// Component Types
|
|
53
|
+
// =========================================
|
|
54
|
+
export * from './button';
|
|
55
|
+
export * from './input';
|
|
56
|
+
export * from './select';
|
|
57
|
+
export * from './card';
|
|
58
|
+
export * from './avatar';
|
|
59
|
+
export * from './badge';
|
|
60
|
+
export * from './tooltip';
|
|
61
|
+
export * from './menu';
|
|
62
|
+
export * from './modal';
|
|
63
|
+
export * from './message';
|
|
64
|
+
|
|
65
|
+
// =========================================
|
|
66
|
+
// Theme System
|
|
67
|
+
// =========================================
|
|
68
|
+
export * from './theme-tokens';
|
|
69
|
+
|
|
70
|
+
// =========================================
|
|
71
|
+
// Icon System
|
|
72
|
+
// =========================================
|
|
73
|
+
export * from './icon';
|
|
74
|
+
|
|
75
|
+
// =========================================
|
|
76
|
+
// UI Adapter Interface
|
|
77
|
+
// =========================================
|
|
78
|
+
export * from './adapter';
|