@contractspec/lib.ui-kit-web 3.8.0 → 3.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/ui/data-table.js +4 -0
- package/dist/browser/ui/data-table.parts.js +4 -0
- package/dist/browser/ui/visualization/Visualization.js +9 -1
- package/dist/ui/data-table.js +4 -0
- package/dist/ui/data-table.parts.js +4 -0
- package/dist/ui/visualization/Visualization.js +9 -1
- package/package.json +6 -6
|
@@ -736,6 +736,7 @@ function ResizeHandle({
|
|
|
736
736
|
}, [column]);
|
|
737
737
|
return /* @__PURE__ */ jsxDEV6("span", {
|
|
738
738
|
role: "separator",
|
|
739
|
+
"aria-label": `Resize ${column.label} column`,
|
|
739
740
|
"aria-orientation": "vertical",
|
|
740
741
|
tabIndex: -1,
|
|
741
742
|
className: "absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",
|
|
@@ -748,6 +749,7 @@ function ResizeHandle({
|
|
|
748
749
|
function renderHeaderContent(controller, column) {
|
|
749
750
|
if (column.kind === "selection" && controller.selectionMode === "multiple") {
|
|
750
751
|
return /* @__PURE__ */ jsxDEV6(Checkbox, {
|
|
752
|
+
"aria-label": "Select all rows",
|
|
751
753
|
checked: controller.allRowsSelected || (controller.someRowsSelected ? "indeterminate" : false),
|
|
752
754
|
onCheckedChange: (checked) => controller.toggleAllRowsSelected?.(Boolean(checked)),
|
|
753
755
|
onClick: (event) => event.stopPropagation()
|
|
@@ -762,6 +764,7 @@ function renderCellContent(row, cell) {
|
|
|
762
764
|
return null;
|
|
763
765
|
if (cell.kind === "selection") {
|
|
764
766
|
return /* @__PURE__ */ jsxDEV6(Checkbox, {
|
|
767
|
+
"aria-label": `Select row ${row.id}`,
|
|
765
768
|
checked: row.isSelected,
|
|
766
769
|
onCheckedChange: (checked) => row.toggleSelected?.(Boolean(checked))
|
|
767
770
|
}, undefined, false, undefined, this);
|
|
@@ -771,6 +774,7 @@ function renderCellContent(row, cell) {
|
|
|
771
774
|
variant: "ghost",
|
|
772
775
|
size: "icon",
|
|
773
776
|
className: "h-7 w-7",
|
|
777
|
+
"aria-label": row.isExpanded ? `Collapse row ${row.id}` : `Expand row ${row.id}`,
|
|
774
778
|
onClick: () => row.toggleExpanded?.(),
|
|
775
779
|
children: row.isExpanded ? /* @__PURE__ */ jsxDEV6(ChevronDown, {
|
|
776
780
|
className: "h-4 w-4"
|
|
@@ -397,6 +397,7 @@ function ResizeHandle({
|
|
|
397
397
|
}, [column]);
|
|
398
398
|
return /* @__PURE__ */ jsxDEV4("span", {
|
|
399
399
|
role: "separator",
|
|
400
|
+
"aria-label": `Resize ${column.label} column`,
|
|
400
401
|
"aria-orientation": "vertical",
|
|
401
402
|
tabIndex: -1,
|
|
402
403
|
className: "absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",
|
|
@@ -409,6 +410,7 @@ function ResizeHandle({
|
|
|
409
410
|
function renderHeaderContent(controller, column) {
|
|
410
411
|
if (column.kind === "selection" && controller.selectionMode === "multiple") {
|
|
411
412
|
return /* @__PURE__ */ jsxDEV4(Checkbox, {
|
|
413
|
+
"aria-label": "Select all rows",
|
|
412
414
|
checked: controller.allRowsSelected || (controller.someRowsSelected ? "indeterminate" : false),
|
|
413
415
|
onCheckedChange: (checked) => controller.toggleAllRowsSelected?.(Boolean(checked)),
|
|
414
416
|
onClick: (event) => event.stopPropagation()
|
|
@@ -423,6 +425,7 @@ function renderCellContent(row, cell) {
|
|
|
423
425
|
return null;
|
|
424
426
|
if (cell.kind === "selection") {
|
|
425
427
|
return /* @__PURE__ */ jsxDEV4(Checkbox, {
|
|
428
|
+
"aria-label": `Select row ${row.id}`,
|
|
426
429
|
checked: row.isSelected,
|
|
427
430
|
onCheckedChange: (checked) => row.toggleSelected?.(Boolean(checked))
|
|
428
431
|
}, undefined, false, undefined, this);
|
|
@@ -432,6 +435,7 @@ function renderCellContent(row, cell) {
|
|
|
432
435
|
variant: "ghost",
|
|
433
436
|
size: "icon",
|
|
434
437
|
className: "h-7 w-7",
|
|
438
|
+
"aria-label": row.isExpanded ? `Collapse row ${row.id}` : `Expand row ${row.id}`,
|
|
435
439
|
onClick: () => row.toggleExpanded?.(),
|
|
436
440
|
children: row.isExpanded ? /* @__PURE__ */ jsxDEV4(ChevronDown, {
|
|
437
441
|
className: "h-4 w-4"
|
|
@@ -334,6 +334,13 @@ echarts2.use([
|
|
|
334
334
|
FunnelChart,
|
|
335
335
|
MapChart
|
|
336
336
|
]);
|
|
337
|
+
function canRenderCanvasCharts() {
|
|
338
|
+
if (typeof document === "undefined") {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
const canvas = document.createElement("canvas");
|
|
342
|
+
return typeof canvas.getContext === "function" && canvas.getContext("2d") !== null;
|
|
343
|
+
}
|
|
337
344
|
function Visualization({
|
|
338
345
|
model,
|
|
339
346
|
className,
|
|
@@ -343,8 +350,9 @@ function Visualization({
|
|
|
343
350
|
const chartRef = React2.useRef(null);
|
|
344
351
|
const option = React2.useMemo(() => buildVisualizationEChartsOption(model), [model]);
|
|
345
352
|
React2.useEffect(() => {
|
|
346
|
-
if (!shouldRenderEChart(model) || !chartRef.current)
|
|
353
|
+
if (!shouldRenderEChart(model) || !chartRef.current || !canRenderCanvasCharts()) {
|
|
347
354
|
return;
|
|
355
|
+
}
|
|
348
356
|
registerGeoMap(model);
|
|
349
357
|
const chart = echarts2.init(chartRef.current, undefined, {
|
|
350
358
|
renderer: "canvas"
|
package/dist/ui/data-table.js
CHANGED
|
@@ -731,6 +731,7 @@ function ResizeHandle({
|
|
|
731
731
|
}, [column]);
|
|
732
732
|
return /* @__PURE__ */ jsxDEV6("span", {
|
|
733
733
|
role: "separator",
|
|
734
|
+
"aria-label": `Resize ${column.label} column`,
|
|
734
735
|
"aria-orientation": "vertical",
|
|
735
736
|
tabIndex: -1,
|
|
736
737
|
className: "absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",
|
|
@@ -743,6 +744,7 @@ function ResizeHandle({
|
|
|
743
744
|
function renderHeaderContent(controller, column) {
|
|
744
745
|
if (column.kind === "selection" && controller.selectionMode === "multiple") {
|
|
745
746
|
return /* @__PURE__ */ jsxDEV6(Checkbox, {
|
|
747
|
+
"aria-label": "Select all rows",
|
|
746
748
|
checked: controller.allRowsSelected || (controller.someRowsSelected ? "indeterminate" : false),
|
|
747
749
|
onCheckedChange: (checked) => controller.toggleAllRowsSelected?.(Boolean(checked)),
|
|
748
750
|
onClick: (event) => event.stopPropagation()
|
|
@@ -757,6 +759,7 @@ function renderCellContent(row, cell) {
|
|
|
757
759
|
return null;
|
|
758
760
|
if (cell.kind === "selection") {
|
|
759
761
|
return /* @__PURE__ */ jsxDEV6(Checkbox, {
|
|
762
|
+
"aria-label": `Select row ${row.id}`,
|
|
760
763
|
checked: row.isSelected,
|
|
761
764
|
onCheckedChange: (checked) => row.toggleSelected?.(Boolean(checked))
|
|
762
765
|
}, undefined, false, undefined, this);
|
|
@@ -766,6 +769,7 @@ function renderCellContent(row, cell) {
|
|
|
766
769
|
variant: "ghost",
|
|
767
770
|
size: "icon",
|
|
768
771
|
className: "h-7 w-7",
|
|
772
|
+
"aria-label": row.isExpanded ? `Collapse row ${row.id}` : `Expand row ${row.id}`,
|
|
769
773
|
onClick: () => row.toggleExpanded?.(),
|
|
770
774
|
children: row.isExpanded ? /* @__PURE__ */ jsxDEV6(ChevronDown, {
|
|
771
775
|
className: "h-4 w-4"
|
|
@@ -392,6 +392,7 @@ function ResizeHandle({
|
|
|
392
392
|
}, [column]);
|
|
393
393
|
return /* @__PURE__ */ jsxDEV4("span", {
|
|
394
394
|
role: "separator",
|
|
395
|
+
"aria-label": `Resize ${column.label} column`,
|
|
395
396
|
"aria-orientation": "vertical",
|
|
396
397
|
tabIndex: -1,
|
|
397
398
|
className: "absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",
|
|
@@ -404,6 +405,7 @@ function ResizeHandle({
|
|
|
404
405
|
function renderHeaderContent(controller, column) {
|
|
405
406
|
if (column.kind === "selection" && controller.selectionMode === "multiple") {
|
|
406
407
|
return /* @__PURE__ */ jsxDEV4(Checkbox, {
|
|
408
|
+
"aria-label": "Select all rows",
|
|
407
409
|
checked: controller.allRowsSelected || (controller.someRowsSelected ? "indeterminate" : false),
|
|
408
410
|
onCheckedChange: (checked) => controller.toggleAllRowsSelected?.(Boolean(checked)),
|
|
409
411
|
onClick: (event) => event.stopPropagation()
|
|
@@ -418,6 +420,7 @@ function renderCellContent(row, cell) {
|
|
|
418
420
|
return null;
|
|
419
421
|
if (cell.kind === "selection") {
|
|
420
422
|
return /* @__PURE__ */ jsxDEV4(Checkbox, {
|
|
423
|
+
"aria-label": `Select row ${row.id}`,
|
|
421
424
|
checked: row.isSelected,
|
|
422
425
|
onCheckedChange: (checked) => row.toggleSelected?.(Boolean(checked))
|
|
423
426
|
}, undefined, false, undefined, this);
|
|
@@ -427,6 +430,7 @@ function renderCellContent(row, cell) {
|
|
|
427
430
|
variant: "ghost",
|
|
428
431
|
size: "icon",
|
|
429
432
|
className: "h-7 w-7",
|
|
433
|
+
"aria-label": row.isExpanded ? `Collapse row ${row.id}` : `Expand row ${row.id}`,
|
|
430
434
|
onClick: () => row.toggleExpanded?.(),
|
|
431
435
|
children: row.isExpanded ? /* @__PURE__ */ jsxDEV4(ChevronDown, {
|
|
432
436
|
className: "h-4 w-4"
|
|
@@ -329,6 +329,13 @@ echarts2.use([
|
|
|
329
329
|
FunnelChart,
|
|
330
330
|
MapChart
|
|
331
331
|
]);
|
|
332
|
+
function canRenderCanvasCharts() {
|
|
333
|
+
if (typeof document === "undefined") {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
const canvas = document.createElement("canvas");
|
|
337
|
+
return typeof canvas.getContext === "function" && canvas.getContext("2d") !== null;
|
|
338
|
+
}
|
|
332
339
|
function Visualization({
|
|
333
340
|
model,
|
|
334
341
|
className,
|
|
@@ -338,8 +345,9 @@ function Visualization({
|
|
|
338
345
|
const chartRef = React2.useRef(null);
|
|
339
346
|
const option = React2.useMemo(() => buildVisualizationEChartsOption(model), [model]);
|
|
340
347
|
React2.useEffect(() => {
|
|
341
|
-
if (!shouldRenderEChart(model) || !chartRef.current)
|
|
348
|
+
if (!shouldRenderEChart(model) || !chartRef.current || !canRenderCanvasCharts()) {
|
|
342
349
|
return;
|
|
350
|
+
}
|
|
343
351
|
registerGeoMap(model);
|
|
344
352
|
const chart = echarts2.init(chartRef.current, undefined, {
|
|
345
353
|
renderer: "canvas"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.ui-kit-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.4",
|
|
4
4
|
"description": "Web UI components with Radix primitives",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@contractspec/lib.contracts-spec": "
|
|
35
|
-
"@contractspec/lib.presentation-runtime-core": "3.
|
|
36
|
-
"@contractspec/lib.ui-kit-core": "3.7.
|
|
34
|
+
"@contractspec/lib.contracts-spec": "5.0.0",
|
|
35
|
+
"@contractspec/lib.presentation-runtime-core": "3.9.0",
|
|
36
|
+
"@contractspec/lib.ui-kit-core": "3.7.9",
|
|
37
37
|
"@hookform/resolvers": "5.2.2",
|
|
38
38
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
39
39
|
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"typescript": "^5.9.3",
|
|
97
97
|
"react": "19.2.0",
|
|
98
98
|
"react-dom": "19.2.0",
|
|
99
|
-
"@contractspec/tool.typescript": "3.7.
|
|
99
|
+
"@contractspec/tool.typescript": "3.7.9",
|
|
100
100
|
"@types/geojson": "^7946.0.14",
|
|
101
101
|
"@sentry/nextjs": "^10.42.0",
|
|
102
102
|
"maplibre-gl": "^5.20.2",
|
|
103
103
|
"react-map-gl": "^8.0.4",
|
|
104
|
-
"@contractspec/tool.bun": "3.7.
|
|
104
|
+
"@contractspec/tool.bun": "3.7.9"
|
|
105
105
|
},
|
|
106
106
|
"exports": {
|
|
107
107
|
".": {
|