@opendata-ai/openchart-vanilla 8.0.0-rc.9 → 8.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.
Files changed (150) hide show
  1. package/dist/{chunk-SPILUE5S.js → chunk-2NAQRP66.js} +2 -2
  2. package/dist/{chunk-IZQBT6QM.js → chunk-6BUCYCLD.js} +7283 -5881
  3. package/dist/chunk-6BUCYCLD.js.map +1 -0
  4. package/dist/chunk-DCODCLWI.js +234 -0
  5. package/dist/chunk-DCODCLWI.js.map +1 -0
  6. package/dist/{chunk-QW7ZB6NE.js → chunk-EKAUQAAX.js} +49 -45
  7. package/dist/chunk-EKAUQAAX.js.map +1 -0
  8. package/dist/chunk-RM5XS6NR.js +113 -0
  9. package/dist/chunk-RM5XS6NR.js.map +1 -0
  10. package/dist/chunk-T32UHMZA.js +282 -0
  11. package/dist/chunk-T32UHMZA.js.map +1 -0
  12. package/dist/export-gif.d.ts +113 -0
  13. package/dist/export-gif.js +21 -0
  14. package/dist/export-gif.js.map +1 -0
  15. package/dist/index.d.ts +309 -27
  16. package/dist/index.js +2020 -836
  17. package/dist/index.js.map +1 -1
  18. package/dist/{mount-CUKQLeqD.d.ts → mount-CL-nA0f-.d.ts} +85 -2
  19. package/dist/simulation-worker.js +83 -2
  20. package/dist/static.d.ts +2 -0
  21. package/dist/static.js +8 -69
  22. package/dist/static.js.map +1 -1
  23. package/dist/story/index.d.ts +25 -9
  24. package/dist/story/index.js +9 -7
  25. package/dist/story/index.js.map +1 -1
  26. package/dist/styles.css +1 -1
  27. package/dist/styles.css.map +1 -1
  28. package/package.json +14 -6
  29. package/dist/chunk-IZQBT6QM.js.map +0 -1
  30. package/dist/chunk-QW7ZB6NE.js.map +0 -1
  31. package/src/__test-fixtures__/dom.ts +0 -70
  32. package/src/__test-fixtures__/specs.ts +0 -214
  33. package/src/__tests__/animation.test.ts +0 -358
  34. package/src/__tests__/annotations-render.test.ts +0 -201
  35. package/src/__tests__/compound-labels.test.ts +0 -122
  36. package/src/__tests__/continuous-legend.test.ts +0 -91
  37. package/src/__tests__/crosshair.test.ts +0 -130
  38. package/src/__tests__/edit-events.test.ts +0 -1477
  39. package/src/__tests__/editable-prop.test.ts +0 -174
  40. package/src/__tests__/events.test.ts +0 -387
  41. package/src/__tests__/export.test.ts +0 -241
  42. package/src/__tests__/font-race.test.ts +0 -199
  43. package/src/__tests__/gradient-ids.test.ts +0 -159
  44. package/src/__tests__/gradient-utils.test.ts +0 -125
  45. package/src/__tests__/invert.test.ts +0 -187
  46. package/src/__tests__/known-bugs-render.test.ts +0 -183
  47. package/src/__tests__/map.test.ts +0 -636
  48. package/src/__tests__/mount.test.ts +0 -357
  49. package/src/__tests__/pattern-fills.test.ts +0 -105
  50. package/src/__tests__/resize-timing.test.ts +0 -218
  51. package/src/__tests__/sankey.test.ts +0 -133
  52. package/src/__tests__/selection-events.test.ts +0 -1062
  53. package/src/__tests__/series-search.test.ts +0 -311
  54. package/src/__tests__/static.test.ts +0 -141
  55. package/src/__tests__/svg-renderer.test.ts +0 -895
  56. package/src/__tests__/table-keyboard.test.ts +0 -361
  57. package/src/__tests__/table-mount.test.ts +0 -639
  58. package/src/__tests__/tilemap.test.ts +0 -158
  59. package/src/__tests__/tooltip.test.ts +0 -337
  60. package/src/__tests__/transition.test.ts +0 -1792
  61. package/src/__tests__/update-scrolly-matrix.test.ts +0 -563
  62. package/src/__tests__/you-draw-it.test.ts +0 -273
  63. package/src/animation-vars.ts +0 -42
  64. package/src/animation.ts +0 -76
  65. package/src/barlist-mount.ts +0 -383
  66. package/src/barlist-renderer.ts +0 -267
  67. package/src/dom-helpers.ts +0 -17
  68. package/src/export.ts +0 -482
  69. package/src/gradient-utils.ts +0 -138
  70. package/src/graph/__tests__/canvas-renderer.test.ts +0 -713
  71. package/src/graph/__tests__/graph-mount.test.ts +0 -213
  72. package/src/graph/__tests__/interaction.test.ts +0 -205
  73. package/src/graph/__tests__/keyboard.test.ts +0 -653
  74. package/src/graph/__tests__/search.test.ts +0 -88
  75. package/src/graph/__tests__/simulation.test.ts +0 -233
  76. package/src/graph/__tests__/spatial-index.test.ts +0 -142
  77. package/src/graph/__tests__/zoom.test.ts +0 -203
  78. package/src/graph/canvas-renderer.ts +0 -747
  79. package/src/graph/interaction.ts +0 -367
  80. package/src/graph/keyboard.ts +0 -208
  81. package/src/graph/search.ts +0 -50
  82. package/src/graph/simulation-worker-url.ts +0 -12
  83. package/src/graph/simulation-worker.ts +0 -278
  84. package/src/graph/simulation.ts +0 -422
  85. package/src/graph/spatial-index.ts +0 -121
  86. package/src/graph/types.ts +0 -47
  87. package/src/graph/worker-protocol.ts +0 -70
  88. package/src/graph/zoom.ts +0 -134
  89. package/src/graph-mount.ts +0 -888
  90. package/src/index.ts +0 -76
  91. package/src/interactions/chart-events.ts +0 -139
  92. package/src/interactions/crosshair.ts +0 -233
  93. package/src/interactions/drag-handler.ts +0 -175
  94. package/src/interactions/editing-drags.ts +0 -649
  95. package/src/interactions/index.ts +0 -27
  96. package/src/interactions/invert.ts +0 -54
  97. package/src/interactions/keyboard-nav.ts +0 -111
  98. package/src/interactions/legend-interaction.ts +0 -46
  99. package/src/interactions/selection.ts +0 -286
  100. package/src/interactions/tooltip-events.ts +0 -72
  101. package/src/map-camera.ts +0 -111
  102. package/src/map-mount.ts +0 -797
  103. package/src/map-renderer.ts +0 -476
  104. package/src/map-transition.ts +0 -99
  105. package/src/measure-text.ts +0 -134
  106. package/src/mount.ts +0 -1434
  107. package/src/pattern-utils.ts +0 -110
  108. package/src/renderers/annotations.ts +0 -388
  109. package/src/renderers/axes.ts +0 -351
  110. package/src/renderers/brand.ts +0 -87
  111. package/src/renderers/chrome.ts +0 -196
  112. package/src/renderers/endpoint-labels.ts +0 -150
  113. package/src/renderers/legend.ts +0 -312
  114. package/src/renderers/marks.ts +0 -561
  115. package/src/renderers/metrics.ts +0 -63
  116. package/src/renderers/svg-dom.ts +0 -40
  117. package/src/renderers/table-cells.ts +0 -446
  118. package/src/resize-observer.ts +0 -46
  119. package/src/sankey-mount.ts +0 -622
  120. package/src/sankey-renderer.ts +0 -614
  121. package/src/series-search.ts +0 -392
  122. package/src/static.ts +0 -251
  123. package/src/story/__tests__/camera-math.test.ts +0 -145
  124. package/src/story/__tests__/create-chart-story.test.ts +0 -317
  125. package/src/story/__tests__/progress-math.test.ts +0 -95
  126. package/src/story/__tests__/scroll-driver.test.ts +0 -130
  127. package/src/story/__tests__/tween.test.ts +0 -159
  128. package/src/story/camera-math.ts +0 -125
  129. package/src/story/create-chart-story.ts +0 -353
  130. package/src/story/crossfade.ts +0 -70
  131. package/src/story/index.ts +0 -39
  132. package/src/story/progress-math.ts +0 -85
  133. package/src/story/resolve-camera-target.ts +0 -119
  134. package/src/story/scroll-driver.ts +0 -206
  135. package/src/story/story-camera.ts +0 -49
  136. package/src/story/tween.ts +0 -112
  137. package/src/story/types.ts +0 -76
  138. package/src/svg-ids.ts +0 -23
  139. package/src/svg-renderer.ts +0 -383
  140. package/src/table-keyboard.ts +0 -266
  141. package/src/table-mount.ts +0 -567
  142. package/src/table-renderer.ts +0 -414
  143. package/src/text-edit-overlay.ts +0 -389
  144. package/src/theme-tokens.ts +0 -51
  145. package/src/tilemap-mount.ts +0 -511
  146. package/src/tilemap-renderer.ts +0 -396
  147. package/src/tooltip.ts +0 -177
  148. package/src/transition.ts +0 -2816
  149. package/src/you-draw-it.ts +0 -480
  150. /package/dist/{chunk-SPILUE5S.js.map → chunk-2NAQRP66.js.map} +0 -0
@@ -1,389 +0,0 @@
1
- /**
2
- * Text edit overlay: creates a positioned textarea over an SVG text element
3
- * for inline editing. Handles commit (Enter), cancel (Escape), and
4
- * click-outside-to-commit behavior.
5
- */
6
-
7
- export interface TextEditOverlayConfig {
8
- /** The container div that holds the SVG. */
9
- container: HTMLElement;
10
- /** The root SVG element. */
11
- svg: SVGSVGElement;
12
- /** The SVG text element being edited. */
13
- targetElement: SVGElement;
14
- /** Current text content to populate the textarea. */
15
- currentText: string;
16
- /** Called when the user commits the edit (Enter or click outside). */
17
- onCommit: (newText: string) => void;
18
- /** Called when the user cancels the edit (Escape). */
19
- onCancel: () => void;
20
- }
21
-
22
- /**
23
- * Get the viewBox-to-pixel scale factors for an SVG element.
24
- * Same approach used by the drag handlers in mount.ts.
25
- */
26
- function getScale(svg: SVGSVGElement): { scaleX: number; scaleY: number } {
27
- const viewBox = svg.viewBox?.baseVal;
28
- const svgRect = svg.getBoundingClientRect();
29
- return {
30
- scaleX: viewBox?.width && svgRect.width ? svgRect.width / viewBox.width : 1,
31
- scaleY: viewBox?.height && svgRect.height ? svgRect.height / viewBox.height : 1,
32
- };
33
- }
34
-
35
- /**
36
- * Read computed font styles from an SVG text element and map them to CSS.
37
- */
38
- function getTextStyles(
39
- targetElement: SVGElement,
40
- scale: { scaleX: number; scaleY: number },
41
- ): {
42
- fontFamily: string;
43
- fontSize: string;
44
- fontWeight: string;
45
- color: string;
46
- textAlign: string;
47
- lineHeight: string;
48
- } {
49
- const computed = window.getComputedStyle(targetElement);
50
-
51
- // Font size needs to be scaled from SVG viewBox units to pixel units
52
- const svgFontSize = parseFloat(
53
- targetElement.getAttribute('font-size') ?? computed.fontSize ?? '14',
54
- );
55
- const pixelFontSize = svgFontSize * scale.scaleY;
56
-
57
- const fontFamily = targetElement.getAttribute('font-family') ?? computed.fontFamily ?? 'inherit';
58
- const fontWeight = targetElement.getAttribute('font-weight') ?? computed.fontWeight ?? '400';
59
-
60
- // Get fill color from inline style or attribute
61
- const fill =
62
- (targetElement as SVGElement & ElementCSSInlineStyle).style.getPropertyValue('fill') ||
63
- targetElement.getAttribute('fill') ||
64
- computed.color ||
65
- '#000';
66
-
67
- // Map SVG text-anchor to CSS text-align
68
- const textAnchor = targetElement.getAttribute('text-anchor') ?? 'start';
69
- let textAlign = 'left';
70
- if (textAnchor === 'middle') textAlign = 'center';
71
- else if (textAnchor === 'end') textAlign = 'right';
72
-
73
- return {
74
- fontFamily,
75
- fontSize: `${pixelFontSize}px`,
76
- fontWeight,
77
- color: fill,
78
- textAlign,
79
- lineHeight: '1.3',
80
- };
81
- }
82
-
83
- /**
84
- * Compute the pixel position and size for the textarea based on the
85
- * target SVG element's bounding box.
86
- */
87
- function computePosition(
88
- targetElement: SVGElement,
89
- svg: SVGSVGElement,
90
- container: HTMLElement,
91
- ): { top: number; left: number; width: number; height: number } {
92
- const bbox = (targetElement as SVGGraphicsElement).getBBox();
93
- const scale = getScale(svg);
94
- const svgRect = svg.getBoundingClientRect();
95
- const containerRect = container.getBoundingClientRect();
96
-
97
- // SVG viewBox coords -> pixel coords relative to the container
98
- const padding = 4;
99
- const left = bbox.x * scale.scaleX + (svgRect.left - containerRect.left) - padding;
100
- const top = bbox.y * scale.scaleY + (svgRect.top - containerRect.top) - padding;
101
- const width = bbox.width * scale.scaleX + padding * 2;
102
- const height = bbox.height * scale.scaleY + padding * 2;
103
-
104
- return {
105
- top: Math.max(0, top),
106
- left: Math.max(0, left),
107
- width: Math.max(width, 60),
108
- height: Math.max(height, 24),
109
- };
110
- }
111
-
112
- /**
113
- * Create an inline text editing overlay positioned over an SVG text element.
114
- * Returns an object with a `destroy()` method to clean up.
115
- */
116
- export function createTextEditOverlay(config: TextEditOverlayConfig): { destroy: () => void } {
117
- const { container, svg, targetElement, currentText, onCommit, onCancel } = config;
118
-
119
- let destroyed = false;
120
-
121
- // Hide the underlying SVG text element (not display:none to preserve layout)
122
- const originalOpacity = targetElement.getAttribute('opacity');
123
- targetElement.setAttribute('opacity', '0');
124
-
125
- // Compute position and styles
126
- const scale = getScale(svg);
127
- const styles = getTextStyles(targetElement, scale);
128
- const position = computePosition(targetElement, svg, container);
129
-
130
- // Create the textarea
131
- const textarea = document.createElement('textarea');
132
- textarea.value = currentText;
133
-
134
- // Ensure container is positioned so absolute children work
135
- const containerPosition = window.getComputedStyle(container).position;
136
- const containerWasStatic = containerPosition === 'static';
137
- if (containerWasStatic) {
138
- container.style.position = 'relative';
139
- }
140
-
141
- // Style the textarea to match the SVG text
142
- Object.assign(textarea.style, {
143
- position: 'absolute',
144
- top: `${position.top}px`,
145
- left: `${position.left}px`,
146
- width: `${position.width}px`,
147
- minHeight: `${position.height}px`,
148
- fontFamily: styles.fontFamily,
149
- fontSize: styles.fontSize,
150
- fontWeight: styles.fontWeight,
151
- color: styles.color,
152
- textAlign: styles.textAlign,
153
- lineHeight: styles.lineHeight,
154
- padding: '2px 4px',
155
- margin: '0',
156
- border: '1px solid rgba(79, 70, 229, 0.4)', // intentionally 0.4, not --oc-editable-hover (0.35)
157
- borderRadius: '3px',
158
- background: 'rgba(255, 255, 255, 0.95)',
159
- outline: 'none',
160
- resize: 'none',
161
- overflow: 'hidden',
162
- boxSizing: 'border-box',
163
- zIndex: '10000',
164
- // Remove default textarea appearance
165
- WebkitAppearance: 'none',
166
- appearance: 'none',
167
- } as Record<string, string>);
168
-
169
- container.appendChild(textarea);
170
-
171
- // Auto-select all text
172
- textarea.focus();
173
- textarea.select();
174
-
175
- // Cleanup function
176
- function destroy(): void {
177
- if (destroyed) return;
178
- destroyed = true;
179
-
180
- // Restore SVG text visibility
181
- if (originalOpacity !== null) {
182
- targetElement.setAttribute('opacity', originalOpacity);
183
- } else {
184
- targetElement.removeAttribute('opacity');
185
- }
186
-
187
- // Remove event listeners
188
- textarea.removeEventListener('keydown', handleKeyDown);
189
- document.removeEventListener('mousedown', handleClickOutside);
190
- resizeObserver.disconnect();
191
-
192
- // Restore container position if we changed it
193
- if (containerWasStatic) {
194
- container.style.position = '';
195
- }
196
-
197
- // Remove the textarea
198
- if (textarea.parentNode) {
199
- textarea.parentNode.removeChild(textarea);
200
- }
201
- }
202
-
203
- function commit(): void {
204
- if (destroyed) return;
205
- const newText = textarea.value;
206
- destroy();
207
- onCommit(newText);
208
- }
209
-
210
- function cancel(): void {
211
- if (destroyed) return;
212
- destroy();
213
- onCancel();
214
- }
215
-
216
- // Keyboard handling
217
- const handleKeyDown = (e: KeyboardEvent) => {
218
- if (e.key === 'Enter' && !e.shiftKey) {
219
- e.preventDefault();
220
- commit();
221
- } else if (e.key === 'Escape') {
222
- e.preventDefault();
223
- cancel();
224
- }
225
- };
226
-
227
- textarea.addEventListener('keydown', handleKeyDown);
228
-
229
- // Click outside to commit
230
- const handleClickOutside = (e: MouseEvent) => {
231
- if (!textarea.contains(e.target as Node)) {
232
- commit();
233
- }
234
- };
235
-
236
- // Delay attaching click-outside so the current click event doesn't trigger it
237
- requestAnimationFrame(() => {
238
- if (!destroyed) {
239
- document.addEventListener('mousedown', handleClickOutside);
240
- }
241
- });
242
-
243
- // Reposition on container resize
244
- const resizeObserver = new ResizeObserver(() => {
245
- if (destroyed) return;
246
- const newPosition = computePosition(targetElement, svg, container);
247
- textarea.style.top = `${newPosition.top}px`;
248
- textarea.style.left = `${newPosition.left}px`;
249
- textarea.style.width = `${newPosition.width}px`;
250
- textarea.style.minHeight = `${newPosition.height}px`;
251
- });
252
- resizeObserver.observe(container);
253
-
254
- return { destroy };
255
- }
256
-
257
- // ---------------------------------------------------------------------------
258
- // Position-based overlay (for creating new annotations at a click position)
259
- // ---------------------------------------------------------------------------
260
-
261
- export interface TextEditOverlayAtPositionConfig {
262
- container: HTMLElement;
263
- svg: SVGSVGElement;
264
- position: { x: number; y: number };
265
- onCommit: (text: string) => void;
266
- onCancel: () => void;
267
- }
268
-
269
- export function createTextEditOverlayAtPosition(config: TextEditOverlayAtPositionConfig): {
270
- destroy: () => void;
271
- } {
272
- const { container, svg, position, onCommit, onCancel } = config;
273
-
274
- let destroyed = false;
275
-
276
- const scale = getScale(svg);
277
- const svgRect = svg.getBoundingClientRect();
278
- const containerRect = container.getBoundingClientRect();
279
-
280
- const padding = 4;
281
- const left = position.x * scale.scaleX + (svgRect.left - containerRect.left) - padding;
282
- const top = position.y * scale.scaleY + (svgRect.top - containerRect.top) - padding;
283
-
284
- const computedStyle = window.getComputedStyle(svg);
285
- const fontFamily = computedStyle.getPropertyValue('--oc-font-family').trim() || 'inherit';
286
- const textColor =
287
- computedStyle.getPropertyValue('--oc-text-color').trim() || computedStyle.color || '#333';
288
- const surfaceColor =
289
- computedStyle.getPropertyValue('--oc-surface-color').trim() || 'rgba(255, 255, 255, 0.95)';
290
- const fontSize = 13 * scale.scaleY;
291
-
292
- const textarea = document.createElement('textarea');
293
- textarea.value = '';
294
- textarea.placeholder = 'Type annotation text...';
295
-
296
- const containerPosition = window.getComputedStyle(container).position;
297
- const containerWasStatic = containerPosition === 'static';
298
- if (containerWasStatic) {
299
- container.style.position = 'relative';
300
- }
301
-
302
- Object.assign(textarea.style, {
303
- position: 'absolute',
304
- top: `${Math.max(0, top)}px`,
305
- left: `${Math.max(0, left)}px`,
306
- width: '160px',
307
- minHeight: '24px',
308
- fontFamily,
309
- fontSize: `${fontSize}px`,
310
- fontWeight: '400',
311
- color: textColor,
312
- textAlign: 'left',
313
- lineHeight: '1.3',
314
- padding: '2px 4px',
315
- margin: '0',
316
- border: '1px solid rgba(79, 70, 229, 0.4)',
317
- borderRadius: '3px',
318
- background: surfaceColor,
319
- outline: 'none',
320
- resize: 'none',
321
- overflow: 'hidden',
322
- boxSizing: 'border-box',
323
- zIndex: '10000',
324
- WebkitAppearance: 'none',
325
- appearance: 'none',
326
- } as Record<string, string>);
327
-
328
- container.appendChild(textarea);
329
- textarea.focus();
330
-
331
- function destroy(): void {
332
- if (destroyed) return;
333
- destroyed = true;
334
-
335
- textarea.removeEventListener('keydown', handleKeyDown);
336
- document.removeEventListener('mousedown', handleClickOutside);
337
-
338
- if (containerWasStatic) {
339
- container.style.position = '';
340
- }
341
-
342
- if (textarea.parentNode) {
343
- textarea.parentNode.removeChild(textarea);
344
- }
345
- }
346
-
347
- function commit(): void {
348
- if (destroyed) return;
349
- const text = textarea.value.trim();
350
- destroy();
351
- if (text) {
352
- onCommit(text);
353
- } else {
354
- onCancel();
355
- }
356
- }
357
-
358
- function cancel(): void {
359
- if (destroyed) return;
360
- destroy();
361
- onCancel();
362
- }
363
-
364
- const handleKeyDown = (e: KeyboardEvent) => {
365
- if (e.key === 'Enter' && !e.shiftKey) {
366
- e.preventDefault();
367
- commit();
368
- } else if (e.key === 'Escape') {
369
- e.preventDefault();
370
- cancel();
371
- }
372
- };
373
-
374
- textarea.addEventListener('keydown', handleKeyDown);
375
-
376
- const handleClickOutside = (e: MouseEvent) => {
377
- if (!textarea.contains(e.target as Node)) {
378
- commit();
379
- }
380
- };
381
-
382
- requestAnimationFrame(() => {
383
- if (!destroyed) {
384
- document.addEventListener('mousedown', handleClickOutside);
385
- }
386
- });
387
-
388
- return { destroy };
389
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * Generate CSS custom properties from a resolved JS theme.
3
- *
4
- * Stamped on the .oc-root container at mount time so CSS consumers
5
- * read from the same source of truth as the JS engine. The static
6
- * values in tokens.css / dark.css serve as fallback defaults for
7
- * contexts where JS hasn't mounted (SSR, static HTML).
8
- */
9
-
10
- import type { ResolvedTheme } from '@opendata-ai/openchart-core';
11
- import { adaptForLightLineStroke, cssTokenDefault } from '@opendata-ai/openchart-core';
12
-
13
- export function stampThemeProperties(el: HTMLElement, theme: ResolvedTheme): void {
14
- const accent = theme.colors.categorical[0] ?? cssTokenDefault('--oc-accent', 'light');
15
- const bg =
16
- theme.colors.background === 'transparent'
17
- ? theme.isDark
18
- ? cssTokenDefault('--oc-bg', 'dark')
19
- : cssTokenDefault('--oc-bg', 'light')
20
- : theme.colors.background;
21
-
22
- const props: [string, string][] = [
23
- ['--oc-font-family', theme.fonts.family],
24
- ['--oc-font-mono', theme.fonts.mono],
25
- ['--oc-title-size', `${theme.chrome.title.fontSize}px`],
26
- ['--oc-title-weight', `${theme.chrome.title.fontWeight}`],
27
- ['--oc-subtitle-size', `${theme.chrome.subtitle.fontSize}px`],
28
- ['--oc-subtitle-weight', `${theme.chrome.subtitle.fontWeight}`],
29
- ['--oc-source-size', `${theme.chrome.source.fontSize}px`],
30
- ['--oc-source-weight', `${theme.chrome.source.fontWeight}`],
31
- ['--oc-body-size', `${theme.fonts.sizes.body}px`],
32
- ['--oc-eyebrow-size', `${theme.chrome.eyebrow.fontSize}px`],
33
- ['--oc-eyebrow-weight', `${theme.chrome.eyebrow.fontWeight}`],
34
- ['--oc-bg', bg],
35
- ['--oc-text', theme.colors.text],
36
- ['--oc-text-muted', theme.colors.axis],
37
- ['--oc-gridline', theme.colors.gridline],
38
- ['--oc-axis', theme.colors.axis],
39
- ['--oc-border-radius', `${theme.borderRadius}px`],
40
- ['--oc-accent', accent],
41
- ['--oc-accent-strong', adaptForLightLineStroke(accent)],
42
- ['--oc-positive', theme.colors.positive],
43
- ['--oc-negative', theme.colors.negative],
44
- ['--oc-space-2', `${theme.spacing.chromeGap * 2}px`],
45
- ['--oc-space-4', `${theme.spacing.padding}px`],
46
- ];
47
-
48
- for (const [name, value] of props) {
49
- el.style.setProperty(name, value);
50
- }
51
- }