@vanduo-oss/vd3-cbun 1.4.0 → 1.4.2

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.
@@ -44,8 +44,90 @@
44
44
  opacity: 1;
45
45
  }
46
46
 
47
+ /* Dark theme overrides — tooltip */
48
+ [data-theme="dark"] .vd-chart-tooltip {
49
+ background: color-mix(in srgb, var(--vd-bg-primary, #1a1d20) 96%, transparent);
50
+ border-color: color-mix(in srgb, var(--vd-border-color, #495057) 72%, transparent);
51
+ color: var(--vd-text-primary, #e9ecef);
52
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
53
+ }
54
+
55
+ @media (prefers-color-scheme: dark) {
56
+ :root:not([data-theme]) .vd-chart-tooltip {
57
+ background: color-mix(in srgb, var(--vd-bg-primary, #1a1d20) 96%, transparent);
58
+ border-color: color-mix(in srgb, var(--vd-border-color, #495057) 72%, transparent);
59
+ color: var(--vd-text-primary, #e9ecef);
60
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
61
+ }
62
+ }
63
+
64
+ /* Focus indicator for interactive chart marks (keyboard navigation) */
65
+ .vd-chart-root [tabindex="0"]:focus-visible {
66
+ outline: 2px solid var(--vd-color-primary, #5c7cfa);
67
+ outline-offset: 1px;
68
+ }
69
+
70
+ /* Respect reduced-motion preference */
71
+ @media (prefers-reduced-motion: reduce) {
72
+ .vd-chart-tooltip {
73
+ transition: none;
74
+ }
75
+ }
76
+
47
77
  .vd-chart-empty {
48
78
  color: var(--vd-text-muted, #868e96);
49
79
  font-size: 0.875rem;
50
80
  }
51
81
 
82
+ /* Screen-reader-only utility for accessible data table fallback */
83
+ .vd-chart-sr-only {
84
+ position: absolute;
85
+ width: 1px;
86
+ height: 1px;
87
+ padding: 0;
88
+ margin: -1px;
89
+ overflow: hidden;
90
+ clip: rect(0, 0, 0, 0);
91
+ white-space: nowrap;
92
+ border-width: 0;
93
+ }
94
+
95
+ /* Accessible data table styling (when visible) */
96
+ .vd-chart-data-table:not(.vd-chart-sr-only) {
97
+ width: 100%;
98
+ margin-top: 1rem;
99
+ border-collapse: collapse;
100
+ font-size: 0.8125rem;
101
+ color: var(--vd-text-primary, #1a1d20);
102
+ }
103
+
104
+ .vd-chart-data-table:not(.vd-chart-sr-only) caption {
105
+ caption-side: top;
106
+ font-weight: 600;
107
+ text-align: left;
108
+ margin-bottom: 0.5rem;
109
+ color: var(--vd-text-primary, #1a1d20);
110
+ }
111
+
112
+ .vd-chart-data-table:not(.vd-chart-sr-only) th,
113
+ .vd-chart-data-table:not(.vd-chart-sr-only) td {
114
+ padding: 0.4rem 0.65rem;
115
+ border: 1px solid var(--vd-border-color, #dee2e6);
116
+ text-align: left;
117
+ }
118
+
119
+ .vd-chart-data-table:not(.vd-chart-sr-only) th {
120
+ background: color-mix(in srgb, var(--vd-bg-primary, #ffffff) 90%, var(--vd-border-color, #dee2e6));
121
+ font-weight: 600;
122
+ }
123
+
124
+ [data-theme="dark"] .vd-chart-data-table:not(.vd-chart-sr-only) th {
125
+ background: color-mix(in srgb, var(--vd-bg-primary, #1a1d20) 88%, var(--vd-border-color, #495057));
126
+ }
127
+
128
+ @media (prefers-color-scheme: dark) {
129
+ :root:not([data-theme]) .vd-chart-data-table:not(.vd-chart-sr-only) th {
130
+ background: color-mix(in srgb, var(--vd-bg-primary, #1a1d20) 88%, var(--vd-border-color, #495057));
131
+ }
132
+ }
133
+
@@ -77,6 +77,12 @@ export interface VdChartProps {
77
77
  /** Axis titles. */
78
78
  xAxis?: { label?: string };
79
79
  yAxis?: { label?: string };
80
+ /** Accessible data table: `true` (sr-only, default) / `false` / `'visible'`. */
81
+ dataTable?: boolean | 'visible';
82
+ /** Override the SVG `aria-roledescription` (defaults to `${kind} chart`). */
83
+ ariaRoleDescription?: string;
84
+ /** Override the inner SVG graphics role without consuming the root `role` attribute. */
85
+ svgRole?: string;
80
86
  }
81
87
 
82
88
  /**
@@ -144,6 +144,11 @@
144
144
  white-space: pre-wrap;
145
145
  overflow-wrap: break-word;
146
146
  word-break: break-word;
147
+ /* Both layers must share the same scrollbar-gutter reservation so long lines
148
+ wrap at identical positions. Without this, the textarea's visible scrollbar
149
+ shrinks its client width while the hidden-overflow <pre> keeps the full
150
+ width, causing caret-to-glyph misalignment on wrapped lines. */
151
+ scrollbar-gutter: stable;
147
152
  }
148
153
 
149
154
  /* Editable surface — transparent text over the highlight, visible caret. */
@@ -175,6 +175,12 @@ export class VdDraw {
175
175
  setGridVisible(visible: boolean): this;
176
176
  toggleGrid(): this;
177
177
 
178
+ // Runtime options
179
+ setReadonly(readonly: boolean): this;
180
+ setSnap(snap: boolean): this;
181
+ setHistoryEnabled(enabled: boolean): this;
182
+ setHistoryLimit(limit: number): this;
183
+
178
184
  // Shapes
179
185
  getShape(id: string): DrawShape | null;
180
186
  getShapes(): DrawShape[];
@@ -225,7 +231,7 @@ export class VdDraw {
225
231
  zoomIn(): this;
226
232
  zoomOut(): this;
227
233
  resetView(): this;
228
- fitView(): this;
234
+ fitView(padding?: number): this;
229
235
 
230
236
  // History
231
237
  undo(): this;