glchat-a2ui-react-renderer 0.0.4 → 0.0.6

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 (96) hide show
  1. package/README.md +217 -95
  2. package/dist/index.d.ts +2 -18
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +4 -17
  5. package/dist/src/a2ui/adapter.d.ts +3 -0
  6. package/dist/src/a2ui/adapter.d.ts.map +1 -0
  7. package/dist/src/a2ui/adapter.js +11 -0
  8. package/dist/src/a2ui/glchatStandardCatalog.d.ts +10 -0
  9. package/dist/src/a2ui/glchatStandardCatalog.d.ts.map +1 -0
  10. package/dist/src/a2ui/glchatStandardCatalog.js +14 -0
  11. package/dist/src/components/custom/Button.d.ts +3 -0
  12. package/dist/src/components/custom/Button.d.ts.map +1 -0
  13. package/dist/src/components/custom/Button.js +14 -0
  14. package/dist/src/components/custom/Card.d.ts +3 -0
  15. package/dist/src/components/custom/Card.d.ts.map +1 -0
  16. package/dist/src/components/custom/Card.js +7 -0
  17. package/dist/src/components/custom/Timeout.d.ts +3 -0
  18. package/dist/src/components/custom/Timeout.d.ts.map +1 -0
  19. package/dist/src/components/custom/Timeout.js +6 -0
  20. package/dist/src/components/{Button.d.ts → ui/Button.d.ts} +4 -4
  21. package/dist/src/components/ui/Button.d.ts.map +1 -0
  22. package/dist/src/components/ui/Button.js +38 -0
  23. package/dist/src/components/{Card.d.ts → ui/Card.d.ts} +1 -1
  24. package/dist/src/components/ui/Card.d.ts.map +1 -0
  25. package/dist/src/components/ui/Card.js +16 -0
  26. package/dist/src/components/ui/Timeout.d.ts +6 -0
  27. package/dist/src/components/ui/Timeout.d.ts.map +1 -0
  28. package/dist/src/components/{Timeout.js → ui/Timeout.js} +3 -4
  29. package/package.json +9 -5
  30. package/styles/globals.css +103 -0
  31. package/styles/theme-v4.css +86 -0
  32. package/tailwind.config.cjs +111 -0
  33. package/dist/src/components/Button.d.ts.map +0 -1
  34. package/dist/src/components/Button.js +0 -43
  35. package/dist/src/components/Card.d.ts.map +0 -1
  36. package/dist/src/components/Card.js +0 -16
  37. package/dist/src/components/Checkbox.d.ts +0 -5
  38. package/dist/src/components/Checkbox.d.ts.map +0 -1
  39. package/dist/src/components/Checkbox.js +0 -9
  40. package/dist/src/components/Column.d.ts +0 -13
  41. package/dist/src/components/Column.d.ts.map +0 -1
  42. package/dist/src/components/Column.js +0 -20
  43. package/dist/src/components/Image.d.ts +0 -9
  44. package/dist/src/components/Image.d.ts.map +0 -1
  45. package/dist/src/components/Image.js +0 -21
  46. package/dist/src/components/Input.d.ts +0 -8
  47. package/dist/src/components/Input.d.ts.map +0 -1
  48. package/dist/src/components/Input.js +0 -9
  49. package/dist/src/components/Label.d.ts +0 -5
  50. package/dist/src/components/Label.d.ts.map +0 -1
  51. package/dist/src/components/Label.js +0 -8
  52. package/dist/src/components/Row.d.ts +0 -13
  53. package/dist/src/components/Row.d.ts.map +0 -1
  54. package/dist/src/components/Row.js +0 -20
  55. package/dist/src/components/Separator.d.ts +0 -5
  56. package/dist/src/components/Separator.d.ts.map +0 -1
  57. package/dist/src/components/Separator.js +0 -11
  58. package/dist/src/components/Text.d.ts +0 -8
  59. package/dist/src/components/Text.d.ts.map +0 -1
  60. package/dist/src/components/Text.js +0 -19
  61. package/dist/src/components/TextField.d.ts +0 -13
  62. package/dist/src/components/TextField.d.ts.map +0 -1
  63. package/dist/src/components/TextField.js +0 -31
  64. package/dist/src/components/Timeout.d.ts +0 -8
  65. package/dist/src/components/Timeout.d.ts.map +0 -1
  66. package/dist/src/helpers/messageParser.d.ts +0 -10
  67. package/dist/src/helpers/messageParser.d.ts.map +0 -1
  68. package/dist/src/helpers/messageParser.js +0 -40
  69. package/dist/src/hooks/useA2UIProcessor.d.ts +0 -17
  70. package/dist/src/hooks/useA2UIProcessor.d.ts.map +0 -1
  71. package/dist/src/hooks/useA2UIProcessor.js +0 -16
  72. package/dist/src/rendering/Surface.d.ts +0 -28
  73. package/dist/src/rendering/Surface.d.ts.map +0 -1
  74. package/dist/src/rendering/Surface.js +0 -51
  75. package/dist/src/rendering/catalog.d.ts +0 -42
  76. package/dist/src/rendering/catalog.d.ts.map +0 -1
  77. package/dist/src/rendering/catalog.js +0 -136
  78. package/dist/src/rendering/componentRegistry.d.ts +0 -9
  79. package/dist/src/rendering/componentRegistry.d.ts.map +0 -1
  80. package/dist/src/rendering/componentRegistry.js +0 -10
  81. package/dist/src/runtime/bindingResolver.d.ts +0 -29
  82. package/dist/src/runtime/bindingResolver.d.ts.map +0 -1
  83. package/dist/src/runtime/bindingResolver.js +0 -143
  84. package/dist/src/runtime/dispatcher.d.ts +0 -15
  85. package/dist/src/runtime/dispatcher.d.ts.map +0 -1
  86. package/dist/src/runtime/dispatcher.js +0 -29
  87. package/dist/src/runtime/messageProcessor.d.ts +0 -54
  88. package/dist/src/runtime/messageProcessor.d.ts.map +0 -1
  89. package/dist/src/runtime/messageProcessor.js +0 -85
  90. package/dist/src/runtime/surfaceManager.d.ts +0 -48
  91. package/dist/src/runtime/surfaceManager.d.ts.map +0 -1
  92. package/dist/src/runtime/surfaceManager.js +0 -90
  93. package/dist/src/types.d.ts +0 -285
  94. package/dist/src/types.d.ts.map +0 -1
  95. package/dist/src/types.js +0 -4
  96. package/dist/styles.css +0 -395
@@ -1,285 +0,0 @@
1
- export interface A2UIMessage {
2
- beginRendering?: BeginRenderingMessage;
3
- surfaceUpdate?: SurfaceUpdateMessage;
4
- dataModelUpdate?: DataModelUpdateMessage;
5
- deleteSurface?: DeleteSurfaceMessage;
6
- }
7
- export interface BeginRenderingMessage {
8
- surfaceId: string;
9
- root: string;
10
- styles?: Record<string, string>;
11
- }
12
- export interface SurfaceUpdateMessage {
13
- surfaceId: string;
14
- components: ComponentDefinition[];
15
- }
16
- export interface DataModelUpdateMessage {
17
- surfaceId: string;
18
- contents: DataModelContent[];
19
- path?: string;
20
- }
21
- export interface DeleteSurfaceMessage {
22
- surfaceId: string;
23
- }
24
- export interface ComponentDefinition {
25
- id: string;
26
- component: Component;
27
- }
28
- export type Component = TextComponent | ButtonComponent | TextFieldComponent | CardComponent | RowComponent | ColumnComponent | ListComponent | CheckBoxComponent | DateTimeInputComponent | MultipleChoiceComponent | SliderComponent | ImageComponent | IconComponent | DividerComponent | TabsComponent | ModalComponent | TimeoutComponent;
29
- export interface TextComponent {
30
- Text: {
31
- text: BoundValue;
32
- usageHint?: "h1" | "h2" | "h3" | "h4" | "h5" | "body" | "caption";
33
- };
34
- }
35
- export interface ImageComponent {
36
- Image: {
37
- url: BoundValue;
38
- fit?: "cover" | "contain" | "fill" | "none" | "scaleDown";
39
- usageHint?: "avatar" | "hero" | "thumbnail";
40
- };
41
- }
42
- export interface IconComponent {
43
- Icon: {
44
- name: string;
45
- size?: number;
46
- };
47
- }
48
- export interface DividerComponent {
49
- Divider: {
50
- axis?: "horizontal" | "vertical";
51
- };
52
- }
53
- export interface RowComponent {
54
- Row: {
55
- children: string[];
56
- distribution?: "start" | "end" | "center" | "spaceBetween" | "spaceAround" | "spaceEvenly";
57
- alignment?: "start" | "end" | "center" | "stretch";
58
- };
59
- }
60
- export interface ColumnComponent {
61
- Column: {
62
- children: string[];
63
- distribution?: "start" | "end" | "center" | "spaceBetween" | "spaceAround" | "spaceEvenly";
64
- alignment?: "start" | "end" | "center" | "stretch";
65
- };
66
- }
67
- export interface ListComponent {
68
- List: {
69
- template: string;
70
- dataBinding: string;
71
- direction?: "horizontal" | "vertical";
72
- alignment?: "start" | "end" | "center" | "stretch";
73
- };
74
- }
75
- export interface CardComponent {
76
- Card: {
77
- child: string;
78
- };
79
- }
80
- export interface TabsComponent {
81
- Tabs: {
82
- tabItems: Array<{
83
- title: string;
84
- child: string;
85
- }>;
86
- };
87
- }
88
- export interface ModalComponent {
89
- Modal: {
90
- entryPointChild: string;
91
- contentChild: string;
92
- };
93
- }
94
- export interface ButtonComponent {
95
- Button: {
96
- child?: string;
97
- action?: ActionDefinition;
98
- primary?: boolean;
99
- };
100
- }
101
- export interface TextFieldComponent {
102
- TextField: {
103
- label?: BoundValue;
104
- text: BoundValue;
105
- textFieldType?: "shortText" | "longText" | "number" | "obscured" | "date";
106
- validationRegexp?: string;
107
- };
108
- }
109
- export interface CheckBoxComponent {
110
- CheckBox: {
111
- label?: BoundValue;
112
- checked: BoundValue;
113
- };
114
- }
115
- export interface DateTimeInputComponent {
116
- DateTimeInput: {
117
- label?: BoundValue;
118
- value: BoundValue;
119
- enableDate?: boolean;
120
- enableTime?: boolean;
121
- };
122
- }
123
- export interface MultipleChoiceComponent {
124
- MultipleChoice: {
125
- label?: BoundValue;
126
- options: Array<{
127
- id: string;
128
- label: BoundValue;
129
- }>;
130
- selections: BoundValue;
131
- maxAllowedSelections?: number;
132
- };
133
- }
134
- export interface SliderComponent {
135
- Slider: {
136
- label?: BoundValue;
137
- value: BoundValue;
138
- minValue: number;
139
- maxValue: number;
140
- };
141
- }
142
- export interface TimeoutComponent {
143
- Timeout: {
144
- targetTimeUtc: BoundValue;
145
- usageHint?: "body" | "caption" | "h3" | "h4" | "h5";
146
- };
147
- }
148
- export type BoundValue = {
149
- literalString: string;
150
- } | {
151
- literalNumber: number;
152
- } | {
153
- literalBoolean: boolean;
154
- } | {
155
- path: string;
156
- } | {
157
- literalString: string;
158
- path: string;
159
- } | {
160
- literalNumber: number;
161
- path: string;
162
- } | {
163
- literalBoolean: boolean;
164
- path: string;
165
- };
166
- /** Context can be a record (key -> BoundValue) or an array of { key, value: BoundValue } for submission payload */
167
- export type ActionContextInput = Record<string, BoundValue> | Array<{
168
- key: string;
169
- value: BoundValue;
170
- }>;
171
- export interface ActionDefinition {
172
- name: string;
173
- context?: ActionContextInput;
174
- }
175
- export interface ValueMapItem {
176
- key: string;
177
- valueString?: string;
178
- valueInt?: number;
179
- valueBool?: boolean;
180
- valueMap?: ValueMapItem[];
181
- }
182
- export interface DataModelContent {
183
- key: string;
184
- valueMap?: ValueMapItem[];
185
- valueString?: string;
186
- valueInt?: number;
187
- valueBool?: boolean;
188
- valueList?: Array<DataModelContent>;
189
- }
190
- export interface SurfaceState {
191
- surfaceId: string;
192
- componentBuffer: Map<string, ComponentDefinition>;
193
- dataModel: Record<string, any>;
194
- ready: boolean;
195
- rootId?: string;
196
- }
197
- /**
198
- * User-initiated action sent from the client to the server.
199
- * Same shape as @a2ui/web_core ClientToServerMessage UserAction (Lit/Angular).
200
- */
201
- export interface UserAction {
202
- /** The name of the action. */
203
- name: string;
204
- /** The ID of the surface. */
205
- surfaceId: string;
206
- /** The ID of the component that triggered the event. */
207
- sourceComponentId: string;
208
- /** An ISO 8601 timestamp of when the event occurred. */
209
- timestamp: string;
210
- /** Resolved action context (key-value pairs from the component's action.context). */
211
- context?: {
212
- [k: string]: unknown;
213
- };
214
- }
215
- /**
216
- * Client error report (e.g. during UI rendering).
217
- * Same shape as @a2ui/web_core (Lit/Angular).
218
- */
219
- export interface ClientError {
220
- [k: string]: unknown;
221
- }
222
- /**
223
- * Message sent from the client to the server. Exactly one property is typically set.
224
- * Same shape as @a2ui/web_core ClientToServerMessage (Lit/Angular).
225
- */
226
- export interface ClientToServerMessage {
227
- userAction?: UserAction;
228
- clientUiCapabilities?: unknown;
229
- error?: ClientError;
230
- request?: unknown;
231
- }
232
- /**
233
- * Event pushed to processor.events when the user triggers an action (e.g. button click).
234
- * Same pattern as Angular: message is the full client message; completion completes the round-trip.
235
- * Client subscribes to processor.events; on each event, send event.message to backend,
236
- * then after processMessages(response) call event.completion(messages).
237
- */
238
- export interface DispatchedEvent {
239
- /** The client-to-server message to send to the backend (e.g. { userAction }). */
240
- message: ClientToServerMessage;
241
- /** Call with the A2UI messages from the backend response (resolves dispatch() promise). */
242
- completion: (messages: A2UIMessage[]) => void;
243
- }
244
- /**
245
- * Theme for styling built-in components (React: className strings).
246
- * Aligns conceptually with Lit/Angular theme; uses strings for className.
247
- */
248
- export interface Theme {
249
- components?: {
250
- Text?: {
251
- className?: string;
252
- h1?: string;
253
- h2?: string;
254
- h3?: string;
255
- h4?: string;
256
- h5?: string;
257
- body?: string;
258
- caption?: string;
259
- };
260
- TextField?: {
261
- container?: string;
262
- label?: string;
263
- element?: string;
264
- };
265
- Button?: string;
266
- Card?: string;
267
- CheckBox?: {
268
- container?: string;
269
- label?: string;
270
- element?: string;
271
- };
272
- Row?: string;
273
- Column?: string;
274
- Image?: string;
275
- Divider?: string;
276
- Timeout?: string;
277
- };
278
- additionalStyles?: {
279
- Text?: Record<string, string>;
280
- TextField?: Record<string, string>;
281
- };
282
- }
283
- /** Empty theme; renderer works without a theme. */
284
- export declare const defaultTheme: Theme;
285
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,mBAAmB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,SAAS,GACjB,aAAa,GACb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,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE;YACT,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,gBAAgB,CAAC,EAAE;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC,CAAC;CACH;AAED,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAAE,KAAU,CAAC"}
package/dist/src/types.js DELETED
@@ -1,4 +0,0 @@
1
- // A2UI Protocol Type Definitions
2
- // Based on A2UI Specification v0.8
3
- /** Empty theme; renderer works without a theme. */
4
- export const defaultTheme = {};
package/dist/styles.css DELETED
@@ -1,395 +0,0 @@
1
- /**
2
- * Use: import 'glchat-a2ui-react-renderer/styles.css' in client app.
3
- * Variables use HSL format (H S% L%) — override via :root or .a2ui-surface.
4
- * Colors aligned with glchat-ui default theme.
5
- */
6
-
7
- /* ---------------------------------------------------------------------------
8
- Variables (HSL: H S% L%)
9
- --------------------------------------------------------------------------- */
10
- :root {
11
- /* From glchat-ui globals.css :root */
12
- --a2ui-background: 0 0% 100%;
13
- --a2ui-background-hover: 0 0% 98%;
14
- --a2ui-foreground: 0 0% 11%;
15
- --a2ui-muted: 0 0% 96.1%;
16
- --a2ui-muted-foreground: 0 0% 45.1%;
17
- --a2ui-border: 0 0% 86%;
18
-
19
- --a2ui-primary: 198 100% 31%;
20
- --a2ui-primary-foreground: 0 0% 100%;
21
- --a2ui-primary-subtle: 198 57% 85%;
22
- --a2ui-primary-subtle-foreground: 198 100% 28%;
23
-
24
- --a2ui-destructive: 0 97% 59%;
25
- --a2ui-destructive-foreground: 0 0% 100%;
26
- --a2ui-destructive-alternate: 8 100% 97%;
27
- --a2ui-destructive-alternate-foreground: 356 83% 38%;
28
-
29
- --a2ui-ring: 198 100% 31%;
30
- --a2ui-card: 0 0% 100%;
31
- --a2ui-card-foreground: 0 0% 11%;
32
- --a2ui-hover: 0 0% 0% / 5%;
33
- --a2ui-error: 0 97% 59%;
34
-
35
- /* Hover shades (slightly darker than base) */
36
- --a2ui-primary-hover: 198 100% 26%;
37
- --a2ui-primary-subtle-hover: 198 57% 78%;
38
- --a2ui-destructive-hover: 0 97% 50%;
39
- --a2ui-destructive-alternate-hover: 8 100% 95%;
40
- }
41
-
42
- .dark .a2ui-surface,
43
- .a2ui-surface.dark {
44
- /* From glchat-ui globals.css .dark */
45
- --a2ui-background: 0 0% 11%;
46
- --a2ui-background-hover: 0 0% 7%;
47
- --a2ui-foreground: 0 0% 100%;
48
- --a2ui-muted: 0 0% 14.9%;
49
- --a2ui-muted-foreground: 0 0% 63.9%;
50
- --a2ui-border: 0 0% 25%;
51
-
52
- --a2ui-primary: 196 71% 39%;
53
- --a2ui-primary-foreground: 0 0% 100%;
54
- --a2ui-primary-subtle: 198 99% 17%;
55
- --a2ui-primary-subtle-foreground: 198 57% 85%;
56
-
57
- --a2ui-destructive: 4 100% 75%;
58
- --a2ui-destructive-foreground: 0 0% 100%;
59
- --a2ui-destructive-alternate: 354 92% 28%;
60
- --a2ui-destructive-alternate-foreground: 8 100% 97%;
61
-
62
- --a2ui-ring: 196 71% 39%;
63
- --a2ui-card: 0 0% 11%;
64
- --a2ui-card-foreground: 0 0% 100%;
65
- --a2ui-hover: 0 0% 100% / 5%;
66
- --a2ui-error: 4 100% 75%;
67
-
68
- --a2ui-primary-hover: 196 71% 33%;
69
- --a2ui-primary-subtle-hover: 198 99% 20%;
70
- --a2ui-destructive-hover: 4 100% 65%;
71
- --a2ui-destructive-alternate-hover: 354 92% 32%;
72
- }
73
-
74
- /* Surface root — scoped base for embedded surfaces */
75
- .a2ui-surface {
76
- font-family: ui-sans-serif, system-ui, sans-serif;
77
- font-size: 16px;
78
- line-height: 1.5;
79
- color: hsl(var(--a2ui-foreground));
80
- box-sizing: border-box;
81
- }
82
-
83
- .a2ui-surface *,
84
- .a2ui-surface *::before,
85
- .a2ui-surface *::after {
86
- box-sizing: border-box;
87
- }
88
-
89
- /* ---------------------------------------------------------------------------
90
- Layout: Row, Column
91
- --------------------------------------------------------------------------- */
92
- .a2ui-row {
93
- display: flex;
94
- flex-direction: row;
95
- flex-wrap: wrap;
96
- gap: 8px;
97
- }
98
-
99
- .a2ui-row--justify-start { justify-content: flex-start; }
100
- .a2ui-row--justify-end { justify-content: flex-end; }
101
- .a2ui-row--justify-center { justify-content: center; }
102
- .a2ui-row--justify-between { justify-content: space-between; }
103
- .a2ui-row--justify-around { justify-content: space-around; }
104
- .a2ui-row--justify-evenly { justify-content: space-evenly; }
105
-
106
- .a2ui-row--items-start { align-items: flex-start; }
107
- .a2ui-row--items-end { align-items: flex-end; }
108
- .a2ui-row--items-center { align-items: center; }
109
- .a2ui-row--items-stretch { align-items: stretch; }
110
-
111
- .a2ui-column {
112
- display: flex;
113
- flex-direction: column;
114
- gap: 8px;
115
- }
116
-
117
- .a2ui-column--justify-start { justify-content: flex-start; }
118
- .a2ui-column--justify-end { justify-content: flex-end; }
119
- .a2ui-column--justify-center { justify-content: center; }
120
- .a2ui-column--justify-between { justify-content: space-between; }
121
- .a2ui-column--justify-around { justify-content: space-around; }
122
- .a2ui-column--justify-evenly { justify-content: space-evenly; }
123
-
124
- .a2ui-column--items-start { align-items: flex-start; }
125
- .a2ui-column--items-end { align-items: flex-end; }
126
- .a2ui-column--items-center { align-items: center; }
127
- .a2ui-column--items-stretch { align-items: stretch; }
128
-
129
- /* ---------------------------------------------------------------------------
130
- Text
131
- --------------------------------------------------------------------------- */
132
- .a2ui-text-h1 { font-size: 2.25rem; font-weight: 700; }
133
- .a2ui-text-h2 { font-size: 1.875rem; font-weight: 700; }
134
- .a2ui-text-h3 { font-size: 1.5rem; font-weight: 600; }
135
- .a2ui-text-h4 { font-size: 1.25rem; font-weight: 600; }
136
- .a2ui-text-h5 { font-size: 1.125rem; font-weight: 500; }
137
- .a2ui-text-body { font-size: 1rem; }
138
- .a2ui-text-caption { font-size: 0.875rem; color: hsl(var(--a2ui-muted-foreground)); }
139
-
140
- /* ---------------------------------------------------------------------------
141
- Button
142
- --------------------------------------------------------------------------- */
143
- .a2ui-button {
144
- display: inline-flex;
145
- align-items: center;
146
- justify-content: center;
147
- font-weight: 600;
148
- white-space: nowrap;
149
- border-width: 1px;
150
- border-style: solid;
151
- cursor: pointer;
152
- transition: background-color 0.15s, border-color 0.15s, color 0.15s;
153
- }
154
-
155
- .a2ui-button:disabled {
156
- pointer-events: none;
157
- opacity: 0.6;
158
- }
159
-
160
- .a2ui-button--primary {
161
- border-color: hsl(var(--a2ui-primary));
162
- background-color: hsl(var(--a2ui-primary));
163
- color: hsl(var(--a2ui-primary-foreground));
164
- }
165
- .a2ui-button--primary:hover,
166
- .a2ui-button--primary:focus { background-color: hsl(var(--a2ui-primary-hover)); border-color: hsl(var(--a2ui-primary-hover)); }
167
- .a2ui-button--primary:focus-visible { outline: 2px solid hsl(var(--a2ui-ring)); outline-offset: 2px; }
168
-
169
- .a2ui-button--secondary {
170
- border-color: hsl(var(--a2ui-primary-subtle));
171
- background-color: hsl(var(--a2ui-primary-subtle));
172
- color: hsl(var(--a2ui-primary-subtle-foreground));
173
- }
174
- .a2ui-button--secondary:hover,
175
- .a2ui-button--secondary:focus { background-color: hsl(var(--a2ui-primary-subtle-hover)); border-color: hsl(var(--a2ui-primary-subtle-hover)); }
176
- .a2ui-button--secondary:focus-visible { outline: 2px solid hsl(var(--a2ui-ring)); outline-offset: 2px; }
177
-
178
- .a2ui-button--destructive {
179
- border-color: hsl(var(--a2ui-destructive));
180
- background-color: hsl(var(--a2ui-destructive));
181
- color: hsl(var(--a2ui-destructive-foreground));
182
- }
183
- .a2ui-button--destructive:hover,
184
- .a2ui-button--destructive:focus { background-color: hsl(var(--a2ui-destructive-hover)); border-color: hsl(var(--a2ui-destructive-hover)); }
185
- .a2ui-button--destructive:focus-visible { outline: 2px solid hsl(var(--a2ui-ring)); outline-offset: 2px; }
186
-
187
- .a2ui-button--destructive-subtle {
188
- border-color: hsl(var(--a2ui-destructive-alternate));
189
- background-color: hsl(var(--a2ui-destructive-alternate));
190
- color: hsl(var(--a2ui-destructive-alternate-foreground));
191
- }
192
- .a2ui-button--destructive-subtle:hover,
193
- .a2ui-button--destructive-subtle:focus { background-color: hsl(var(--a2ui-destructive-alternate-hover)); border-color: hsl(var(--a2ui-destructive-alternate-hover)); }
194
- .a2ui-button--destructive-subtle:focus-visible { outline: 2px solid hsl(var(--a2ui-ring)); outline-offset: 2px; }
195
-
196
- .a2ui-button--outline {
197
- background-color: hsl(var(--a2ui-background));
198
- color: hsl(var(--a2ui-foreground));
199
- border-color: hsl(var(--a2ui-border));
200
- }
201
- .a2ui-button--outline:hover,
202
- .a2ui-button--outline:focus,
203
- .a2ui-button--outline:focus-visible { background-color: hsl(var(--a2ui-background-hover)); }
204
-
205
- .a2ui-button--ghost-primary {
206
- border-color: transparent;
207
- color: hsl(var(--a2ui-primary));
208
- }
209
- .a2ui-button--ghost-primary:hover,
210
- .a2ui-button--ghost-primary:focus { background-color: hsl(var(--a2ui-primary-subtle)); }
211
- .a2ui-button--ghost-primary:hover { text-decoration: underline; text-decoration-color: hsl(var(--a2ui-primary)); }
212
-
213
- .a2ui-button--ghost-neutral {
214
- border-color: transparent;
215
- color: hsl(var(--a2ui-foreground));
216
- }
217
- .a2ui-button--ghost-neutral:hover,
218
- .a2ui-button--ghost-neutral:focus { background-color: hsl(var(--a2ui-background-hover)); }
219
-
220
- .a2ui-button--ghost-destructive {
221
- border-color: transparent;
222
- color: hsl(var(--a2ui-destructive));
223
- }
224
- .a2ui-button--ghost-destructive:hover,
225
- .a2ui-button--ghost-destructive:focus { background-color: hsl(var(--a2ui-destructive-alternate)); }
226
-
227
- .a2ui-button--link-primary { border-color: transparent; color: hsl(var(--a2ui-primary)); }
228
- .a2ui-button--link-neutral { border-color: transparent; color: hsl(var(--a2ui-foreground)); }
229
-
230
- /* Button sizes */
231
- .a2ui-button--tiny { font-size: 0.875rem; padding: 6px 12px; border-radius: 6px; }
232
- .a2ui-button--small { font-size: 1rem; padding: 8px 16px; border-radius: 8px; }
233
- .a2ui-button--medium { font-size: 1rem; padding: 10px 16px; border-radius: 10px; }
234
- .a2ui-button--large { font-size: 1.125rem; padding: 10px 20px; border-radius: 12px; }
235
- .a2ui-button--icon { width: 40px; height: 40px; padding: 0; border-radius: 8px; }
236
- .a2ui-button--pill { border-radius: 9999px; }
237
-
238
- /* ---------------------------------------------------------------------------
239
- Card
240
- --------------------------------------------------------------------------- */
241
- .a2ui-card {
242
- border-radius: 8px;
243
- border: 1px solid hsl(var(--a2ui-border));
244
- background-color: hsl(var(--a2ui-card));
245
- color: hsl(var(--a2ui-card-foreground));
246
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
247
- transition: background-color 0.3s;
248
- }
249
- .a2ui-card:hover { background-color: hsl(var(--a2ui-background-hover)); }
250
-
251
- .a2ui-card-header {
252
- display: flex;
253
- flex-direction: column;
254
- gap: 6px;
255
- padding: 24px;
256
- }
257
-
258
- .a2ui-card-title {
259
- font-weight: 600;
260
- line-height: 1.2;
261
- letter-spacing: -0.025em;
262
- }
263
-
264
- .a2ui-card-description {
265
- font-size: 0.875rem;
266
- }
267
-
268
- .a2ui-card-content {
269
- padding: 24px;
270
- }
271
-
272
- .a2ui-card-footer {
273
- display: flex;
274
- align-items: center;
275
- padding: 0 24px 24px;
276
- }
277
-
278
- /* ---------------------------------------------------------------------------
279
- Input
280
- --------------------------------------------------------------------------- */
281
- .a2ui-input-wrap {
282
- position: relative;
283
- display: flex;
284
- width: 100%;
285
- align-items: center;
286
- }
287
-
288
- .a2ui-input {
289
- display: flex;
290
- height: 40px;
291
- width: 100%;
292
- border-radius: 6px;
293
- border: 1px solid hsl(var(--a2ui-border));
294
- background-color: hsl(var(--a2ui-background));
295
- padding: 8px 12px;
296
- font-size: 0.875rem;
297
- color: hsl(var(--a2ui-foreground));
298
- }
299
- .a2ui-input::placeholder { color: hsl(var(--a2ui-muted-foreground)); }
300
- .a2ui-input:focus {
301
- outline: none;
302
- border-color: hsl(var(--a2ui-primary));
303
- }
304
- .a2ui-input:disabled { cursor: not-allowed; opacity: 0.5; }
305
- .a2ui-input.invalid { border-color: hsl(var(--a2ui-error)); }
306
- .a2ui-input-action { position: absolute; right: 12px; top: 0; bottom: 0; display: flex; align-items: center; z-index: 10; }
307
-
308
- .a2ui-textarea {
309
- min-height: 100px;
310
- resize: vertical;
311
- }
312
-
313
- /* ---------------------------------------------------------------------------
314
- TextField
315
- --------------------------------------------------------------------------- */
316
- .a2ui-textfield-label { margin-bottom: 8px; }
317
- .a2ui-textfield-input { margin-top: 8px; }
318
-
319
- /* ---------------------------------------------------------------------------
320
- Label
321
- --------------------------------------------------------------------------- */
322
- .a2ui-label {
323
- font-size: 0.875rem;
324
- font-weight: 500;
325
- line-height: 1;
326
- }
327
- .a2ui-label.peer-disabled { cursor: not-allowed; opacity: 0.7; }
328
-
329
- /* ---------------------------------------------------------------------------
330
- Checkbox
331
- --------------------------------------------------------------------------- */
332
- .a2ui-checkbox {
333
- width: 16px;
334
- height: 16px;
335
- flex-shrink: 0;
336
- border-radius: 4px;
337
- border: 1px solid hsl(var(--a2ui-primary));
338
- background: transparent;
339
- cursor: pointer;
340
- display: inline-flex;
341
- align-items: center;
342
- justify-content: center;
343
- }
344
- .a2ui-checkbox:focus-visible {
345
- outline: 2px solid hsl(var(--a2ui-ring));
346
- outline-offset: 2px;
347
- }
348
- .a2ui-checkbox:disabled { cursor: not-allowed; opacity: 0.5; }
349
- .a2ui-checkbox[data-state="checked"] {
350
- background-color: hsl(var(--a2ui-primary));
351
- color: hsl(var(--a2ui-primary-foreground));
352
- }
353
- .a2ui-checkbox-indicator { display: flex; align-items: center; justify-content: center; color: currentColor; }
354
-
355
- .a2ui-checkbox-group {
356
- display: flex;
357
- align-items: center;
358
- gap: 8px;
359
- font-size: 0.875rem;
360
- color: hsl(var(--a2ui-foreground));
361
- }
362
- .a2ui-checkbox-group .a2ui-label { font-weight: 400; }
363
-
364
- /* ---------------------------------------------------------------------------
365
- Separator
366
- --------------------------------------------------------------------------- */
367
- .a2ui-separator {
368
- flex-shrink: 0;
369
- background-color: hsl(var(--a2ui-border));
370
- }
371
- .a2ui-separator--horizontal { height: 2px; width: 100%; }
372
- .a2ui-separator--vertical { height: 100%; width: 2px; }
373
-
374
- /* ---------------------------------------------------------------------------
375
- Image
376
- --------------------------------------------------------------------------- */
377
- .a2ui-image {
378
- max-width: 100%;
379
- height: auto;
380
- }
381
- .a2ui-image--cover { object-fit: cover; }
382
- .a2ui-image--contain { object-fit: contain; }
383
- .a2ui-image--fill { object-fit: fill; }
384
- .a2ui-image--none { object-fit: none; }
385
- .a2ui-image--scale-down { object-fit: scale-down; }
386
- .a2ui-image--avatar { border-radius: 9999px; width: 48px; height: 48px; }
387
- .a2ui-image--hero { width: 100%; height: 256px; }
388
- .a2ui-image--thumbnail { width: 96px; height: 96px; }
389
-
390
- /* ---------------------------------------------------------------------------
391
- Timeout
392
- --------------------------------------------------------------------------- */
393
- .a2ui-timeout {
394
- font-variant-numeric: tabular-nums;
395
- }