@copilotkit/a2ui-renderer 1.51.4-next.5 → 1.51.4-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/A2UIMessageRenderer.d.ts.map +1 -1
  3. package/dist/A2UIMessageRenderer.js +71 -140
  4. package/dist/A2UIMessageRenderer.js.map +1 -1
  5. package/dist/A2UIViewer.d.ts +11 -1
  6. package/dist/A2UIViewer.d.ts.map +1 -1
  7. package/dist/A2UIViewer.js +58 -102
  8. package/dist/A2UIViewer.js.map +1 -1
  9. package/dist/__tests__/A2UIMessageRenderer.test.js +57 -232
  10. package/dist/__tests__/A2UIMessageRenderer.test.js.map +1 -1
  11. package/dist/__tests__/setup.js +0 -13
  12. package/dist/__tests__/setup.js.map +1 -1
  13. package/dist/index.d.ts +1 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.umd.js +1 -1000
  18. package/dist/index.umd.js.map +1 -1
  19. package/dist/react-renderer/components/content/AudioPlayer.d.ts +8 -0
  20. package/dist/react-renderer/components/content/AudioPlayer.d.ts.map +1 -0
  21. package/dist/react-renderer/components/content/AudioPlayer.js +23 -0
  22. package/dist/react-renderer/components/content/AudioPlayer.js.map +1 -0
  23. package/dist/react-renderer/components/content/Divider.d.ts +13 -0
  24. package/dist/react-renderer/components/content/Divider.d.ts.map +1 -0
  25. package/dist/react-renderer/components/content/Divider.js +22 -0
  26. package/dist/react-renderer/components/content/Divider.js.map +1 -0
  27. package/dist/react-renderer/components/content/Icon.d.ts +16 -0
  28. package/dist/react-renderer/components/content/Icon.d.ts.map +1 -0
  29. package/dist/react-renderer/components/content/Icon.js +40 -0
  30. package/dist/react-renderer/components/content/Icon.js.map +1 -0
  31. package/dist/react-renderer/components/content/Image.d.ts +11 -0
  32. package/dist/react-renderer/components/content/Image.d.ts.map +1 -0
  33. package/dist/react-renderer/components/content/Image.js +34 -0
  34. package/dist/react-renderer/components/content/Image.js.map +1 -0
  35. package/dist/react-renderer/components/content/Text.d.ts +28 -0
  36. package/dist/react-renderer/components/content/Text.d.ts.map +1 -0
  37. package/dist/react-renderer/components/content/Text.js +132 -0
  38. package/dist/react-renderer/components/content/Text.js.map +1 -0
  39. package/dist/react-renderer/components/content/Video.d.ts +10 -0
  40. package/dist/react-renderer/components/content/Video.d.ts.map +1 -0
  41. package/dist/react-renderer/components/content/Video.js +41 -0
  42. package/dist/react-renderer/components/content/Video.js.map +1 -0
  43. package/dist/react-renderer/components/content/index.d.ts +7 -0
  44. package/dist/react-renderer/components/content/index.d.ts.map +1 -0
  45. package/dist/react-renderer/components/content/index.js +7 -0
  46. package/dist/react-renderer/components/content/index.js.map +1 -0
  47. package/dist/react-renderer/components/interactive/Button.d.ts +11 -0
  48. package/dist/react-renderer/components/interactive/Button.d.ts.map +1 -0
  49. package/dist/react-renderer/components/interactive/Button.js +27 -0
  50. package/dist/react-renderer/components/interactive/Button.js.map +1 -0
  51. package/dist/react-renderer/components/interactive/CheckBox.d.ts +10 -0
  52. package/dist/react-renderer/components/interactive/CheckBox.d.ts.map +1 -0
  53. package/dist/react-renderer/components/interactive/CheckBox.js +55 -0
  54. package/dist/react-renderer/components/interactive/CheckBox.js.map +1 -0
  55. package/dist/react-renderer/components/interactive/DateTimeInput.d.ts +10 -0
  56. package/dist/react-renderer/components/interactive/DateTimeInput.d.ts.map +1 -0
  57. package/dist/react-renderer/components/interactive/DateTimeInput.js +68 -0
  58. package/dist/react-renderer/components/interactive/DateTimeInput.js.map +1 -0
  59. package/dist/react-renderer/components/interactive/MultipleChoice.d.ts +11 -0
  60. package/dist/react-renderer/components/interactive/MultipleChoice.d.ts.map +1 -0
  61. package/dist/react-renderer/components/interactive/MultipleChoice.js +43 -0
  62. package/dist/react-renderer/components/interactive/MultipleChoice.js.map +1 -0
  63. package/dist/react-renderer/components/interactive/Slider.d.ts +10 -0
  64. package/dist/react-renderer/components/interactive/Slider.d.ts.map +1 -0
  65. package/dist/react-renderer/components/interactive/Slider.js +62 -0
  66. package/dist/react-renderer/components/interactive/Slider.js.map +1 -0
  67. package/dist/react-renderer/components/interactive/TextField.d.ts +10 -0
  68. package/dist/react-renderer/components/interactive/TextField.d.ts.map +1 -0
  69. package/dist/react-renderer/components/interactive/TextField.js +63 -0
  70. package/dist/react-renderer/components/interactive/TextField.js.map +1 -0
  71. package/dist/react-renderer/components/interactive/index.d.ts +7 -0
  72. package/dist/react-renderer/components/interactive/index.d.ts.map +1 -0
  73. package/dist/react-renderer/components/interactive/index.js +7 -0
  74. package/dist/react-renderer/components/interactive/index.js.map +1 -0
  75. package/dist/react-renderer/components/layout/Card.d.ts +17 -0
  76. package/dist/react-renderer/components/layout/Card.d.ts.map +1 -0
  77. package/dist/react-renderer/components/layout/Card.js +39 -0
  78. package/dist/react-renderer/components/layout/Card.js.map +1 -0
  79. package/dist/react-renderer/components/layout/Column.d.ts +10 -0
  80. package/dist/react-renderer/components/layout/Column.d.ts.map +1 -0
  81. package/dist/react-renderer/components/layout/Column.js +33 -0
  82. package/dist/react-renderer/components/layout/Column.js.map +1 -0
  83. package/dist/react-renderer/components/layout/List.d.ts +10 -0
  84. package/dist/react-renderer/components/layout/List.d.ts.map +1 -0
  85. package/dist/react-renderer/components/layout/List.js +32 -0
  86. package/dist/react-renderer/components/layout/List.js.map +1 -0
  87. package/dist/react-renderer/components/layout/Modal.d.ts +15 -0
  88. package/dist/react-renderer/components/layout/Modal.d.ts.map +1 -0
  89. package/dist/react-renderer/components/layout/Modal.js +65 -0
  90. package/dist/react-renderer/components/layout/Modal.js.map +1 -0
  91. package/dist/react-renderer/components/layout/Row.d.ts +10 -0
  92. package/dist/react-renderer/components/layout/Row.d.ts.map +1 -0
  93. package/dist/react-renderer/components/layout/Row.js +33 -0
  94. package/dist/react-renderer/components/layout/Row.js.map +1 -0
  95. package/dist/react-renderer/components/layout/Tabs.d.ts +8 -0
  96. package/dist/react-renderer/components/layout/Tabs.d.ts.map +1 -0
  97. package/dist/react-renderer/components/layout/Tabs.js +29 -0
  98. package/dist/react-renderer/components/layout/Tabs.js.map +1 -0
  99. package/dist/react-renderer/components/layout/index.d.ts +7 -0
  100. package/dist/react-renderer/components/layout/index.d.ts.map +1 -0
  101. package/dist/react-renderer/components/layout/index.js +7 -0
  102. package/dist/react-renderer/components/layout/index.js.map +1 -0
  103. package/dist/react-renderer/core/A2UIProvider.d.ts +82 -0
  104. package/dist/react-renderer/core/A2UIProvider.d.ts.map +1 -0
  105. package/dist/react-renderer/core/A2UIProvider.js +156 -0
  106. package/dist/react-renderer/core/A2UIProvider.js.map +1 -0
  107. package/dist/react-renderer/core/A2UIRenderer.d.ts +36 -0
  108. package/dist/react-renderer/core/A2UIRenderer.d.ts.map +1 -0
  109. package/dist/react-renderer/core/A2UIRenderer.js +83 -0
  110. package/dist/react-renderer/core/A2UIRenderer.js.map +1 -0
  111. package/dist/react-renderer/core/A2UIViewer.d.ts +56 -0
  112. package/dist/react-renderer/core/A2UIViewer.d.ts.map +1 -0
  113. package/dist/react-renderer/core/A2UIViewer.js +135 -0
  114. package/dist/react-renderer/core/A2UIViewer.js.map +1 -0
  115. package/dist/react-renderer/core/ComponentNode.d.ts +25 -0
  116. package/dist/react-renderer/core/ComponentNode.d.ts.map +1 -0
  117. package/dist/react-renderer/core/ComponentNode.js +43 -0
  118. package/dist/react-renderer/core/ComponentNode.js.map +1 -0
  119. package/dist/react-renderer/core/store.d.ts +37 -0
  120. package/dist/react-renderer/core/store.d.ts.map +1 -0
  121. package/dist/react-renderer/core/store.js +2 -0
  122. package/dist/react-renderer/core/store.js.map +1 -0
  123. package/dist/react-renderer/hooks/useA2UI.d.ts +46 -0
  124. package/dist/react-renderer/hooks/useA2UI.d.ts.map +1 -0
  125. package/dist/react-renderer/hooks/useA2UI.js +41 -0
  126. package/dist/react-renderer/hooks/useA2UI.js.map +1 -0
  127. package/dist/react-renderer/hooks/useA2UIComponent.d.ts +52 -0
  128. package/dist/react-renderer/hooks/useA2UIComponent.d.ts.map +1 -0
  129. package/dist/react-renderer/hooks/useA2UIComponent.js +166 -0
  130. package/dist/react-renderer/hooks/useA2UIComponent.js.map +1 -0
  131. package/dist/react-renderer/index.d.ts +37 -0
  132. package/dist/react-renderer/index.d.ts.map +1 -0
  133. package/dist/react-renderer/index.js +40 -0
  134. package/dist/react-renderer/index.js.map +1 -0
  135. package/dist/react-renderer/lib/utils.d.ts +32 -0
  136. package/dist/react-renderer/lib/utils.d.ts.map +1 -0
  137. package/dist/react-renderer/lib/utils.js +41 -0
  138. package/dist/react-renderer/lib/utils.js.map +1 -0
  139. package/dist/react-renderer/registry/ComponentRegistry.d.ts +78 -0
  140. package/dist/react-renderer/registry/ComponentRegistry.d.ts.map +1 -0
  141. package/dist/react-renderer/registry/ComponentRegistry.js +113 -0
  142. package/dist/react-renderer/registry/ComponentRegistry.js.map +1 -0
  143. package/dist/react-renderer/registry/defaultCatalog.d.ts +13 -0
  144. package/dist/react-renderer/registry/defaultCatalog.d.ts.map +1 -0
  145. package/dist/react-renderer/registry/defaultCatalog.js +59 -0
  146. package/dist/react-renderer/registry/defaultCatalog.js.map +1 -0
  147. package/dist/react-renderer/styles/index.d.ts +41 -0
  148. package/dist/react-renderer/styles/index.d.ts.map +1 -0
  149. package/dist/react-renderer/styles/index.js +473 -0
  150. package/dist/react-renderer/styles/index.js.map +1 -0
  151. package/dist/react-renderer/styles/reset.d.ts +18 -0
  152. package/dist/react-renderer/styles/reset.d.ts.map +1 -0
  153. package/dist/react-renderer/styles/reset.js +24 -0
  154. package/dist/react-renderer/styles/reset.js.map +1 -0
  155. package/dist/react-renderer/theme/ThemeContext.d.ts +29 -0
  156. package/dist/react-renderer/theme/ThemeContext.d.ts.map +1 -0
  157. package/dist/react-renderer/theme/ThemeContext.js +35 -0
  158. package/dist/react-renderer/theme/ThemeContext.js.map +1 -0
  159. package/dist/react-renderer/theme/litTheme.d.ts +8 -0
  160. package/dist/react-renderer/theme/litTheme.d.ts.map +1 -0
  161. package/dist/react-renderer/theme/litTheme.js +401 -0
  162. package/dist/react-renderer/theme/litTheme.js.map +1 -0
  163. package/dist/react-renderer/theme/utils.d.ts +23 -0
  164. package/dist/react-renderer/theme/utils.d.ts.map +1 -0
  165. package/dist/react-renderer/theme/utils.js +46 -0
  166. package/dist/react-renderer/theme/utils.js.map +1 -0
  167. package/dist/react-renderer/types.d.ts +53 -0
  168. package/dist/react-renderer/types.d.ts.map +1 -0
  169. package/dist/react-renderer/types.js +2 -0
  170. package/dist/react-renderer/types.js.map +1 -0
  171. package/package.json +6 -6
  172. package/dist/styles/components.d.ts +0 -7
  173. package/dist/styles/components.d.ts.map +0 -1
  174. package/dist/styles/components.js +0 -7
  175. package/dist/styles/components.js.map +0 -1
  176. package/dist/styles/global.d.ts +0 -2
  177. package/dist/styles/global.d.ts.map +0 -1
  178. package/dist/styles/global.js +0 -145
  179. package/dist/styles/global.js.map +0 -1
  180. package/dist/themed-surface.d.ts +0 -20
  181. package/dist/themed-surface.d.ts.map +0 -1
  182. package/dist/themed-surface.js +0 -133
  183. package/dist/themed-surface.js.map +0 -1
@@ -0,0 +1,401 @@
1
+ /**
2
+ * Default theme for A2UI React components.
3
+ *
4
+ * This theme uses the same CSS class conventions as the Lit renderer,
5
+ * ensuring visual consistency between React and Lit implementations.
6
+ *
7
+ * IMPORTANT: This theme must be kept in sync with the Lit renderer's internal
8
+ * styling. If Lit components change their class maps, this file must be updated
9
+ * to match. Ideally, Lit would export its default theme for direct import.
10
+ *
11
+ * Requires the structural styles to be injected:
12
+ * @example
13
+ * ```tsx
14
+ * import { A2UIProvider } from '@a2ui/react';
15
+ * import { injectStyles } from '@a2ui/react/styles';
16
+ *
17
+ * // Inject structural CSS at app startup
18
+ * injectStyles();
19
+ *
20
+ * function App() {
21
+ * return (
22
+ * <A2UIProvider>
23
+ * <A2UIRenderer surfaceId="main" />
24
+ * </A2UIProvider>
25
+ * );
26
+ * }
27
+ * ```
28
+ */
29
+ // =============================================================================
30
+ // Element Styles (used for markdown rendering and form elements)
31
+ // =============================================================================
32
+ const elementA = {
33
+ 'typography-f-sf': true,
34
+ 'typography-fs-n': true,
35
+ 'typography-w-500': true,
36
+ 'layout-as-n': true,
37
+ 'layout-dis-iflx': true,
38
+ 'layout-al-c': true,
39
+ 'typography-td-none': true,
40
+ 'color-c-p40': true,
41
+ };
42
+ const elementAudio = {
43
+ 'layout-w-100': true,
44
+ };
45
+ const elementBody = {
46
+ 'typography-f-s': true,
47
+ 'typography-fs-n': true,
48
+ 'typography-w-400': true,
49
+ 'layout-mt-0': true,
50
+ 'layout-mb-2': true,
51
+ 'typography-sz-bm': true,
52
+ 'color-c-n10': true,
53
+ };
54
+ const elementButton = {
55
+ 'typography-f-sf': true,
56
+ 'typography-fs-n': true,
57
+ 'typography-w-500': true,
58
+ 'layout-pt-3': true,
59
+ 'layout-pb-3': true,
60
+ 'layout-pl-5': true,
61
+ 'layout-pr-5': true,
62
+ 'layout-mb-1': true,
63
+ 'border-br-16': true,
64
+ 'border-bw-0': true,
65
+ 'border-c-n70': true,
66
+ 'border-bs-s': true,
67
+ 'color-bgc-s30': true,
68
+ 'behavior-ho-80': true,
69
+ };
70
+ const elementHeading = {
71
+ 'typography-f-sf': true,
72
+ 'typography-fs-n': true,
73
+ 'typography-w-500': true,
74
+ 'layout-mt-0': true,
75
+ 'layout-mb-2': true,
76
+ };
77
+ const elementIframe = {
78
+ 'behavior-sw-n': true,
79
+ };
80
+ const elementInput = {
81
+ 'typography-f-sf': true,
82
+ 'typography-fs-n': true,
83
+ 'typography-w-400': true,
84
+ 'layout-pl-4': true,
85
+ 'layout-pr-4': true,
86
+ 'layout-pt-2': true,
87
+ 'layout-pb-2': true,
88
+ 'border-br-6': true,
89
+ 'border-bw-1': true,
90
+ 'color-bc-s70': true,
91
+ 'border-bs-s': true,
92
+ 'layout-as-n': true,
93
+ 'color-c-n10': true,
94
+ };
95
+ const elementP = {
96
+ 'typography-f-s': true,
97
+ 'typography-fs-n': true,
98
+ 'typography-w-400': true,
99
+ 'layout-m-0': true,
100
+ 'typography-sz-bm': true,
101
+ 'layout-as-n': true,
102
+ 'color-c-n10': true,
103
+ };
104
+ const elementList = {
105
+ 'typography-f-s': true,
106
+ 'typography-fs-n': true,
107
+ 'typography-w-400': true,
108
+ 'layout-m-0': true,
109
+ 'typography-sz-bm': true,
110
+ 'layout-as-n': true,
111
+ 'color-c-n10': true,
112
+ };
113
+ const elementPre = {
114
+ 'typography-f-c': true,
115
+ 'typography-fs-n': true,
116
+ 'typography-w-400': true,
117
+ 'typography-sz-bm': true,
118
+ 'typography-ws-p': true,
119
+ 'layout-as-n': true,
120
+ };
121
+ const elementTextarea = {
122
+ ...elementInput,
123
+ 'layout-r-none': true,
124
+ 'layout-fs-c': true,
125
+ };
126
+ const elementVideo = {
127
+ 'layout-el-cv': true,
128
+ };
129
+ // =============================================================================
130
+ // Theme Export
131
+ // =============================================================================
132
+ export const litTheme = {
133
+ // ===========================================================================
134
+ // Additional Styles (inline CSS properties)
135
+ // ===========================================================================
136
+ // additionalStyles is optional - only define if custom styling is needed
137
+ // The default Lit theme does not apply any additional inline styles
138
+ components: {
139
+ // =========================================================================
140
+ // Content Components
141
+ // =========================================================================
142
+ AudioPlayer: {},
143
+ Divider: {},
144
+ Icon: {},
145
+ Image: {
146
+ all: {
147
+ 'border-br-5': true,
148
+ 'layout-el-cv': true,
149
+ 'layout-w-100': true,
150
+ 'layout-h-100': true,
151
+ },
152
+ avatar: { 'is-avatar': true },
153
+ header: {},
154
+ icon: {},
155
+ largeFeature: {},
156
+ mediumFeature: {},
157
+ smallFeature: {},
158
+ },
159
+ Text: {
160
+ all: {
161
+ 'layout-w-100': true,
162
+ 'layout-g-2': true,
163
+ },
164
+ h1: {
165
+ 'typography-f-sf': true,
166
+ 'typography-v-r': true,
167
+ 'typography-w-400': true,
168
+ 'layout-m-0': true,
169
+ 'layout-p-0': true,
170
+ 'typography-sz-hs': true,
171
+ },
172
+ h2: {
173
+ 'typography-f-sf': true,
174
+ 'typography-v-r': true,
175
+ 'typography-w-400': true,
176
+ 'layout-m-0': true,
177
+ 'layout-p-0': true,
178
+ 'typography-sz-tl': true,
179
+ },
180
+ h3: {
181
+ 'typography-f-sf': true,
182
+ 'typography-v-r': true,
183
+ 'typography-w-400': true,
184
+ 'layout-m-0': true,
185
+ 'layout-p-0': true,
186
+ 'typography-sz-tl': true,
187
+ },
188
+ h4: {
189
+ 'typography-f-sf': true,
190
+ 'typography-v-r': true,
191
+ 'typography-w-400': true,
192
+ 'layout-m-0': true,
193
+ 'layout-p-0': true,
194
+ 'typography-sz-bl': true,
195
+ },
196
+ h5: {
197
+ 'typography-f-sf': true,
198
+ 'typography-v-r': true,
199
+ 'typography-w-400': true,
200
+ 'layout-m-0': true,
201
+ 'layout-p-0': true,
202
+ 'typography-sz-bm': true,
203
+ },
204
+ body: {},
205
+ caption: {},
206
+ },
207
+ Video: {
208
+ 'border-br-5': true,
209
+ 'layout-el-cv': true,
210
+ },
211
+ // =========================================================================
212
+ // Layout Components
213
+ // =========================================================================
214
+ Card: {
215
+ 'border-br-9': true,
216
+ 'layout-p-4': true,
217
+ 'color-bgc-n100': true,
218
+ },
219
+ Column: {
220
+ 'layout-g-2': true,
221
+ },
222
+ List: {
223
+ 'layout-g-4': true,
224
+ 'layout-p-2': true,
225
+ },
226
+ Modal: {
227
+ backdrop: {
228
+ 'color-bbgc-p60_20': true,
229
+ },
230
+ element: {
231
+ 'border-br-2': true,
232
+ 'color-bgc-p100': true,
233
+ 'layout-p-4': true,
234
+ 'border-bw-1': true,
235
+ 'border-bs-s': true,
236
+ 'color-bc-p80': true,
237
+ },
238
+ },
239
+ Row: {
240
+ 'layout-g-4': true,
241
+ },
242
+ Tabs: {
243
+ container: {},
244
+ controls: {
245
+ all: {},
246
+ selected: {},
247
+ },
248
+ element: {},
249
+ },
250
+ // =========================================================================
251
+ // Interactive Components
252
+ // =========================================================================
253
+ Button: {
254
+ 'layout-pt-2': true,
255
+ 'layout-pb-2': true,
256
+ 'layout-pl-3': true,
257
+ 'layout-pr-3': true,
258
+ 'border-br-12': true,
259
+ 'border-bw-0': true,
260
+ 'border-bs-s': true,
261
+ 'color-bgc-p30': true,
262
+ 'color-c-p100': true, // White text on dark purple background
263
+ 'behavior-ho-70': true,
264
+ 'typography-w-400': true,
265
+ },
266
+ CheckBox: {
267
+ container: {
268
+ 'layout-dsp-iflex': true,
269
+ 'layout-al-c': true,
270
+ },
271
+ element: {
272
+ 'layout-m-0': true,
273
+ 'layout-mr-2': true,
274
+ 'layout-p-2': true,
275
+ 'border-br-12': true,
276
+ 'border-bw-1': true,
277
+ 'border-bs-s': true,
278
+ 'color-bgc-p100': true,
279
+ 'color-bc-p60': true,
280
+ 'color-c-n30': true,
281
+ 'color-c-p30': true,
282
+ },
283
+ label: {
284
+ 'color-c-p30': true,
285
+ 'typography-f-sf': true,
286
+ 'typography-v-r': true,
287
+ 'typography-w-400': true,
288
+ 'layout-flx-1': true,
289
+ 'typography-sz-ll': true,
290
+ },
291
+ },
292
+ DateTimeInput: {
293
+ container: {
294
+ 'typography-sz-bm': true,
295
+ 'layout-w-100': true,
296
+ 'layout-g-2': true,
297
+ 'layout-dsp-flexhor': true,
298
+ 'layout-al-c': true,
299
+ 'typography-ws-nw': true,
300
+ },
301
+ label: {
302
+ 'color-c-p30': true,
303
+ 'typography-sz-bm': true,
304
+ },
305
+ element: {
306
+ 'layout-pt-2': true,
307
+ 'layout-pb-2': true,
308
+ 'layout-pl-3': true,
309
+ 'layout-pr-3': true,
310
+ 'border-br-2': true,
311
+ 'border-bw-1': true,
312
+ 'border-bs-s': true,
313
+ 'color-bgc-p100': true,
314
+ 'color-bc-p60': true,
315
+ 'color-c-n30': true,
316
+ 'color-c-p30': true,
317
+ },
318
+ },
319
+ MultipleChoice: {
320
+ container: {},
321
+ label: {},
322
+ element: {},
323
+ },
324
+ Slider: {
325
+ container: {},
326
+ label: {},
327
+ element: {},
328
+ },
329
+ TextField: {
330
+ container: {
331
+ 'typography-sz-bm': true,
332
+ 'layout-w-100': true,
333
+ 'layout-g-2': true,
334
+ 'layout-dsp-flexhor': true,
335
+ 'layout-al-c': true,
336
+ 'typography-ws-nw': true,
337
+ },
338
+ label: {
339
+ 'layout-flx-0': true,
340
+ 'color-c-p30': true,
341
+ },
342
+ element: {
343
+ 'typography-sz-bm': true,
344
+ 'layout-pt-2': true,
345
+ 'layout-pb-2': true,
346
+ 'layout-pl-3': true,
347
+ 'layout-pr-3': true,
348
+ 'border-br-2': true,
349
+ 'border-bw-1': true,
350
+ 'border-bs-s': true,
351
+ 'color-bgc-p100': true,
352
+ 'color-bc-p60': true,
353
+ 'color-c-n30': true,
354
+ 'color-c-p30': true,
355
+ },
356
+ },
357
+ },
358
+ // ===========================================================================
359
+ // HTML Elements (used for markdown rendering and raw HTML)
360
+ // ===========================================================================
361
+ elements: {
362
+ a: elementA,
363
+ audio: elementAudio,
364
+ body: elementBody,
365
+ button: elementButton,
366
+ h1: elementHeading,
367
+ h2: elementHeading,
368
+ h3: elementHeading,
369
+ h4: elementHeading,
370
+ h5: elementHeading,
371
+ iframe: elementIframe,
372
+ input: elementInput,
373
+ p: elementP,
374
+ pre: elementPre,
375
+ textarea: elementTextarea,
376
+ video: elementVideo,
377
+ },
378
+ // ===========================================================================
379
+ // Markdown (class arrays for markdown-it renderer)
380
+ // ===========================================================================
381
+ markdown: {
382
+ p: Object.keys(elementP),
383
+ h1: Object.keys(elementHeading),
384
+ h2: Object.keys(elementHeading),
385
+ h3: Object.keys(elementHeading),
386
+ h4: Object.keys(elementHeading),
387
+ h5: Object.keys(elementHeading),
388
+ ul: Object.keys(elementList),
389
+ ol: Object.keys(elementList),
390
+ li: Object.keys(elementList),
391
+ a: Object.keys(elementA),
392
+ strong: [],
393
+ em: [],
394
+ },
395
+ };
396
+ /**
397
+ * Alias for litTheme - the default theme for A2UI React components.
398
+ * @see litTheme
399
+ */
400
+ export const defaultTheme = litTheme;
401
+ //# sourceMappingURL=litTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"litTheme.js","sourceRoot":"","sources":["../../../src/react-renderer/theme/litTheme.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,gFAAgF;AAChF,iEAAiE;AACjE,gFAAgF;AAEhF,MAAM,QAAQ,GAAG;IACf,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,IAAI;IACnB,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,WAAW,GAAG;IAClB,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,cAAc,GAAG;IACrB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,aA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cAAc;QAClB,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,cAAc;QAClB,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,YAAY;QACnB,CAAC,EAAE,QAAQ;QACX,GAAG,EAAE,UAAU;QACf,QAAQ,EAAE,eAAe;QACzB,KAAK,EAAE,YAAY;KACpB;IAED,8EAA8E;IAC9E,mDAAmD;IACnD,8EAA8E;IAE9E,QAAQ,EAAE;QACR,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACxB,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QAC5B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QAC5B,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QAC5B,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACxB,MAAM,EAAE,EAAE;QACV,EAAE,EAAE,EAAE;KACP;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Converts a theme class map (Record<string, boolean>) to a className string.
3
+ *
4
+ * @param classMap - An object where keys are class names and values are booleans
5
+ * @returns A space-separated string of class names where the value is true
6
+ *
7
+ * @example
8
+ * classMapToString({ 'a2ui-button': true, 'a2ui-button--primary': true, 'disabled': false })
9
+ * // Returns: 'a2ui-button a2ui-button--primary'
10
+ */
11
+ export declare function classMapToString(classMap: Record<string, boolean> | undefined): string;
12
+ /**
13
+ * Converts an additional styles object (Record<string, string>) to a React style object.
14
+ *
15
+ * @param styles - An object with CSS property names as keys and values as strings
16
+ * @returns A React-compatible style object, or undefined if no styles
17
+ *
18
+ * @example
19
+ * stylesToObject({ 'background-color': 'red', 'font-size': '16px', '--custom-var': 'blue' })
20
+ * // Returns: { backgroundColor: 'red', fontSize: '16px', '--custom-var': 'blue' }
21
+ */
22
+ export declare function stylesToObject(styles: Record<string, string> | undefined): React.CSSProperties | undefined;
23
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/react-renderer/theme/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAMtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACzC,KAAK,CAAC,aAAa,GAAG,SAAS,CAejC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Converts a theme class map (Record<string, boolean>) to a className string.
3
+ *
4
+ * @param classMap - An object where keys are class names and values are booleans
5
+ * @returns A space-separated string of class names where the value is true
6
+ *
7
+ * @example
8
+ * classMapToString({ 'a2ui-button': true, 'a2ui-button--primary': true, 'disabled': false })
9
+ * // Returns: 'a2ui-button a2ui-button--primary'
10
+ */
11
+ export function classMapToString(classMap) {
12
+ if (!classMap)
13
+ return '';
14
+ return Object.entries(classMap)
15
+ .filter(([, enabled]) => enabled)
16
+ .map(([className]) => className)
17
+ .join(' ');
18
+ }
19
+ /**
20
+ * Converts an additional styles object (Record<string, string>) to a React style object.
21
+ *
22
+ * @param styles - An object with CSS property names as keys and values as strings
23
+ * @returns A React-compatible style object, or undefined if no styles
24
+ *
25
+ * @example
26
+ * stylesToObject({ 'background-color': 'red', 'font-size': '16px', '--custom-var': 'blue' })
27
+ * // Returns: { backgroundColor: 'red', fontSize: '16px', '--custom-var': 'blue' }
28
+ */
29
+ export function stylesToObject(styles) {
30
+ if (!styles || Object.keys(styles).length === 0)
31
+ return undefined;
32
+ const result = {};
33
+ for (const [key, value] of Object.entries(styles)) {
34
+ // Preserve CSS custom properties (--var-name) as-is
35
+ if (key.startsWith('--')) {
36
+ result[key] = value;
37
+ }
38
+ else {
39
+ // Convert kebab-case to camelCase for React
40
+ const camelKey = key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
41
+ result[camelKey] = value;
42
+ }
43
+ }
44
+ return result;
45
+ }
46
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/react-renderer/theme/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA6C;IAC5E,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;SAC/B,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA0C;IAE1C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAElE,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,oDAAoD;QACpD,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,4CAA4C;YAC5C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;YAC/E,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,MAA6B,CAAC;AACvC,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { Types, Primitives } from '@a2ui/lit/0.8';
3
+ export type { Types, Primitives };
4
+ export type AnyComponentNode = Types.AnyComponentNode;
5
+ export type Surface = Types.Surface;
6
+ export type SurfaceID = Types.SurfaceID;
7
+ export type Theme = Types.Theme;
8
+ export type ServerToClientMessage = Types.ServerToClientMessage;
9
+ export type A2UIClientEventMessage = Types.A2UIClientEventMessage;
10
+ export type Action = Types.Action;
11
+ export type DataValue = Types.DataValue;
12
+ export type MessageProcessor = Types.MessageProcessor;
13
+ export type StringValue = Primitives.StringValue;
14
+ export type NumberValue = Primitives.NumberValue;
15
+ export type BooleanValue = Primitives.BooleanValue;
16
+ /**
17
+ * Props passed to all A2UI React components.
18
+ */
19
+ export interface A2UIComponentProps<T extends Types.AnyComponentNode = Types.AnyComponentNode> {
20
+ /** The resolved component node from the A2UI message processor */
21
+ node: T;
22
+ /** The surface ID this component belongs to */
23
+ surfaceId: string;
24
+ }
25
+ /**
26
+ * A function that loads a React component asynchronously.
27
+ */
28
+ export type ComponentLoader<T extends Types.AnyComponentNode = Types.AnyComponentNode> = () => Promise<{
29
+ default: ComponentType<A2UIComponentProps<T>>;
30
+ }>;
31
+ /**
32
+ * Registration entry for a component in the registry.
33
+ */
34
+ export interface ComponentRegistration<T extends Types.AnyComponentNode = Types.AnyComponentNode> {
35
+ /** The React component or a loader function for lazy loading */
36
+ component: ComponentType<A2UIComponentProps<T>> | ComponentLoader<T>;
37
+ /** If true, the component will be lazy loaded */
38
+ lazy?: boolean;
39
+ }
40
+ /**
41
+ * Callback for when a user action is dispatched.
42
+ */
43
+ export type OnActionCallback = (message: Types.A2UIClientEventMessage) => void | Promise<void>;
44
+ /**
45
+ * Configuration options for the A2UI provider.
46
+ */
47
+ export interface A2UIProviderConfig {
48
+ /** Callback invoked when a user action is dispatched (button click, etc.) */
49
+ onAction?: OnActionCallback;
50
+ /** Initial theme configuration */
51
+ theme?: Types.Theme;
52
+ }
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/react-renderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAGlC,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AACpC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;AACxC,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAChC,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAC;AAChE,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,sBAAsB,CAAC;AAClE,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAClC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;AACxC,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;AAGtD,MAAM,M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ot":"","sources":["../../src/react-renderer/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@copilotkit/a2ui-renderer",
3
3
  "private": false,
4
- "version": "1.51.4-next.5",
4
+ "version": "1.51.4-next.7",
5
5
  "description": "A2UI Renderer for CopilotKit - render A2UI surfaces in React applications",
6
6
  "homepage": "https://github.com/CopilotKit/CopilotKit",
7
7
  "repository": {
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@a2ui/lit": "^0.8.1",
40
- "@lit-labs/signals": "^0.1.3",
41
- "@lit/context": "^1.1.4",
42
- "lit": "^3.2.1",
43
- "zod": "^3.25.75",
44
- "@copilotkit/react-core": "1.51.4-next.5"
40
+ "clsx": "^2.1.1",
41
+ "markdown-it": "^14.1.0",
42
+ "zod": "^3.25.75"
45
43
  },
46
44
  "peerDependencies": {
45
+ "@copilotkit/react-core": ">=1.51.4-next.7",
47
46
  "react": "^18 || ^19 || ^19.0.0-rc",
48
47
  "react-dom": "^18 || ^19 || ^19.0.0-rc"
49
48
  },
50
49
  "devDependencies": {
51
50
  "@testing-library/react": "^16.0.0",
51
+ "@types/markdown-it": "^14.1.2",
52
52
  "@types/react": "^19.2.3",
53
53
  "@types/react-dom": "^19.2.3",
54
54
  "jsdom": "^26.1.0",
@@ -1,7 +0,0 @@
1
- /**
2
- * Component-level styles distributed via ThemeManager.
3
- * These use :host() selectors to target specific A2UI components
4
- * from within their shadow roots.
5
- */
6
- export declare const componentStyles = "";
7
- //# sourceMappingURL=components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/styles/components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Component-level styles distributed via ThemeManager.
3
- * These use :host() selectors to target specific A2UI components
4
- * from within their shadow roots.
5
- */
6
- export const componentStyles = ``;
7
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/styles/components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const globalStyles = "\n :host {\n --n-100: #ffffff;\n --n-99: #fcfcfc;\n --n-98: #f9f9f9;\n --n-95: #f1f1f1;\n --n-90: #e2e2e2;\n --n-80: #c6c6c6;\n --n-70: #ababab;\n --n-60: #919191;\n --n-50: #777777;\n --n-40: #5e5e5e;\n --n-35: #525252;\n --n-30: #474747;\n --n-25: #3b3b3b;\n --n-20: #303030;\n --n-15: #262626;\n --n-10: #1b1b1b;\n --n-5: #111111;\n --n-0: #000000;\n\n --p-100: var(--a2ui-card-bg, #ffffff);\n --p-99: #fffbff;\n --p-98: #fcf8ff;\n --p-95: #f2efff;\n --p-90: #e1e0ff;\n --p-80: #c0c1ff;\n --p-70: #a0a3ff;\n --p-60: #8487ea;\n --p-50: #6a6dcd;\n --p-40: #5154b3;\n --p-35: #4447a6;\n --p-30: #383b99;\n --p-25: #2c2e8d;\n --p-20: #202182;\n --p-15: #131178;\n --p-10: #06006c;\n --p-5: #03004d;\n --p-0: #000000;\n\n --s-100: #ffffff;\n --s-99: #fffbff;\n --s-98: #fcf8ff;\n --s-95: #f2efff;\n --s-90: #e2e0f9;\n --s-80: #c6c4dd;\n --s-70: #aaa9c1;\n --s-60: #8f8fa5;\n --s-50: #75758b;\n --s-40: #5d5c72;\n --s-35: #515165;\n --s-30: #454559;\n --s-25: #393a4d;\n --s-20: #2e2f42;\n --s-15: #242437;\n --s-10: #191a2c;\n --s-5: #0f0f21;\n --s-0: #000000;\n\n --t-100: #ffffff;\n --t-99: #fffbff;\n --t-98: #fff8f9;\n --t-95: #ffecf4;\n --t-90: #ffd8ec;\n --t-80: #e9b9d3;\n --t-70: #cc9eb8;\n --t-60: #af849d;\n --t-50: #946b83;\n --t-40: #79536a;\n --t-35: #6c475d;\n --t-30: #5f3c51;\n --t-25: #523146;\n --t-20: #46263a;\n --t-15: #3a1b2f;\n --t-10: #2e1125;\n --t-5: #22071a;\n --t-0: #000000;\n\n --nv-100: #ffffff;\n --nv-99: #fffbff;\n --nv-98: #fcf8ff;\n --nv-95: #f2effa;\n --nv-90: #e4e1ec;\n --nv-80: #c8c5d0;\n --nv-70: #acaab4;\n --nv-60: #918f9a;\n --nv-50: #777680;\n --nv-40: #5e5d67;\n --nv-35: #52515b;\n --nv-30: #46464f;\n --nv-25: #3b3b43;\n --nv-20: #303038;\n --nv-15: #25252d;\n --nv-10: #1b1b23;\n --nv-5: #101018;\n --nv-0: #000000;\n\n --e-100: #ffffff;\n --e-99: #fffbff;\n --e-98: #fff8f7;\n --e-95: #ffedea;\n --e-90: #ffdad6;\n --e-80: #ffb4ab;\n --e-70: #ff897d;\n --e-60: #ff5449;\n --e-50: #de3730;\n --e-40: #ba1a1a;\n --e-35: #a80710;\n --e-30: #93000a;\n --e-25: #7e0007;\n --e-20: #690005;\n --e-15: #540003;\n --e-10: #410002;\n --e-5: #2d0001;\n --e-0: #000000;\n\n --primary: #137fec;\n --text-color: #fff;\n --background-light: #f6f7f8;\n --background-dark: #101922;\n --border-color: oklch(from var(--background-light) l c h / calc(alpha * 0.15));\n --elevated-background-light: oklch(\n from var(--background-light) l c h / calc(alpha * 0.05)\n );\n --bb-grid-size: 4px;\n --bb-grid-size-2: calc(var(--bb-grid-size) * 2);\n --bb-grid-size-3: calc(var(--bb-grid-size) * 3);\n --bb-grid-size-4: calc(var(--bb-grid-size) * 4);\n --bb-grid-size-5: calc(var(--bb-grid-size) * 5);\n --bb-grid-size-6: calc(var(--bb-grid-size) * 6);\n --bb-grid-size-7: calc(var(--bb-grid-size) * 7);\n --bb-grid-size-8: calc(var(--bb-grid-size) * 8);\n --bb-grid-size-9: calc(var(--bb-grid-size) * 9);\n --bb-grid-size-10: calc(var(--bb-grid-size) * 10);\n --bb-grid-size-11: calc(var(--bb-grid-size) * 11);\n --bb-grid-size-12: calc(var(--bb-grid-size) * 12);\n --bb-grid-size-13: calc(var(--bb-grid-size) * 13);\n --bb-grid-size-14: calc(var(--bb-grid-size) * 14);\n --bb-grid-size-15: calc(var(--bb-grid-size) * 15);\n --bb-grid-size-16: calc(var(--bb-grid-size) * 16);\n\n font-family: \"Google Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n }\n";
2
- //# sourceMappingURL=global.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/styles/global.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,+mHA+IxB,CAAC"}