@contractspec/lib.ui-kit-web 3.7.6 → 3.9.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.
- package/README.md +33 -88
- package/dist/browser/ui/accordion.js +4 -4
- package/dist/browser/ui/alert-dialog.js +9 -9
- package/dist/browser/ui/alert.js +4 -4
- package/dist/browser/ui/atoms/FilterSelect/FilterSelect.js +51 -51
- package/dist/browser/ui/atoms/FilterSelect/index.js +51 -51
- package/dist/browser/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/browser/ui/atoms/Pagination/Pagination.js +13 -13
- package/dist/browser/ui/atoms/Pagination/index.js +13 -13
- package/dist/browser/ui/atoms/SearchInput/SearchInput.js +8 -8
- package/dist/browser/ui/atoms/SearchInput/index.js +8 -8
- package/dist/browser/ui/avatar.js +1 -1
- package/dist/browser/ui/badge.js +3 -3
- package/dist/browser/ui/breadcrumb.js +4 -4
- package/dist/browser/ui/button.js +5 -5
- package/dist/browser/ui/calendar.js +21 -21
- package/dist/browser/ui/card.js +2 -2
- package/dist/browser/ui/carousel.js +6 -6
- package/dist/browser/ui/checkbox.js +2 -2
- package/dist/browser/ui/command.js +14 -14
- package/dist/browser/ui/confirm-dialog.js +9 -9
- package/dist/browser/ui/context-menu.js +10 -10
- package/dist/browser/ui/cta.js +5 -5
- package/dist/browser/ui/data-table.js +1009 -0
- package/dist/browser/ui/data-table.parts.js +467 -0
- package/dist/browser/ui/date-picker.js +26 -26
- package/dist/browser/ui/date-range-picker.js +24 -24
- package/dist/browser/ui/datetime-picker.js +29 -29
- package/dist/browser/ui/dialog.js +5 -5
- package/dist/browser/ui/drawer.js +5 -5
- package/dist/browser/ui/dropdown-menu.js +10 -10
- package/dist/browser/ui/empty-state.js +5 -5
- package/dist/browser/ui/empty.js +7 -7
- package/dist/browser/ui/field.js +12 -12
- package/dist/browser/ui/form.js +4 -4
- package/dist/browser/ui/hover-card.js +2 -2
- package/dist/browser/ui/input-group.js +16 -16
- package/dist/browser/ui/input-otp.js +4 -4
- package/dist/browser/ui/input.js +1 -1
- package/dist/browser/ui/label.js +2 -2
- package/dist/browser/ui/loading-button.js +8 -8
- package/dist/browser/ui/marketing/FeatureGrid.js +3 -3
- package/dist/browser/ui/marketing/Hero.js +7 -7
- package/dist/browser/ui/marketing/PricingTable.js +10 -10
- package/dist/browser/ui/menubar.js +12 -12
- package/dist/browser/ui/molecules/Autocomplete/index.js +26 -26
- package/dist/browser/ui/molecules/SearchAndFilter/SearchAndFilter.js +62 -62
- package/dist/browser/ui/molecules/SearchAndFilter/index.js +62 -62
- package/dist/browser/ui/molecules/SkeletonList.js +1 -1
- package/dist/browser/ui/nav-layout.js +22 -22
- package/dist/browser/ui/navigation-menu.js +7 -7
- package/dist/browser/ui/organisms/ErrorBoundary/ErrorBoundary.js +11 -11
- package/dist/browser/ui/organisms/ListPage/ListPage.js +84 -84
- package/dist/browser/ui/page-header.js +4 -4
- package/dist/browser/ui/pagination.js +6 -6
- package/dist/browser/ui/popover.js +2 -2
- package/dist/browser/ui/progress.js +3 -3
- package/dist/browser/ui/radio-group.js +3 -3
- package/dist/browser/ui/resizable.js +3 -3
- package/dist/browser/ui/scroll-area.js +4 -4
- package/dist/browser/ui/section.js +1 -1
- package/dist/browser/ui/select.js +6 -6
- package/dist/browser/ui/separator.js +2 -2
- package/dist/browser/ui/sheet.js +5 -5
- package/dist/browser/ui/sidebar.js +64 -64
- package/dist/browser/ui/skeleton.js +1 -1
- package/dist/browser/ui/slider.js +6 -6
- package/dist/browser/ui/stack.js +1 -1
- package/dist/browser/ui/stat-card-group.js +5 -5
- package/dist/browser/ui/stepper.js +2 -2
- package/dist/browser/ui/switch.js +3 -3
- package/dist/browser/ui/table.js +5 -5
- package/dist/browser/ui/tabs.js +3 -3
- package/dist/browser/ui/text.js +2 -2
- package/dist/browser/ui/textarea.js +1 -1
- package/dist/browser/ui/time-picker.js +10 -10
- package/dist/browser/ui/toast.js +5 -5
- package/dist/browser/ui/toaster.js +5 -5
- package/dist/browser/ui/toggle-group.js +7 -7
- package/dist/browser/ui/toggle.js +5 -5
- package/dist/browser/ui/tooltip.js +3 -3
- package/dist/browser/ui/typography.js +14 -14
- package/dist/browser/ui/usecases/UseCaseCard.js +8 -8
- package/dist/browser/ui/usecases/UserStoryCard.js +3 -3
- package/dist/browser/ui/visualization/Visualization.js +447 -0
- package/dist/browser/ui/visualization/Visualization.support.js +128 -0
- package/dist/browser/ui/visualization/index.js +10 -0
- package/dist/ui/accordion.d.ts +2 -2
- package/dist/ui/accordion.js +4 -4
- package/dist/ui/alert-dialog.d.ts +2 -2
- package/dist/ui/alert-dialog.js +9 -9
- package/dist/ui/alert.d.ts +2 -2
- package/dist/ui/alert.js +4 -4
- package/dist/ui/atoms/FilterSelect/FilterSelect.js +51 -51
- package/dist/ui/atoms/FilterSelect/index.d.ts +1 -1
- package/dist/ui/atoms/FilterSelect/index.js +51 -51
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/ui/atoms/LoadingSpinner/index.d.ts +1 -1
- package/dist/ui/atoms/Pagination/Pagination.js +13 -13
- package/dist/ui/atoms/Pagination/index.js +13 -13
- package/dist/ui/atoms/SearchInput/SearchInput.js +8 -8
- package/dist/ui/atoms/SearchInput/index.js +8 -8
- package/dist/ui/avatar.d.ts +2 -2
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +3 -3
- package/dist/ui/breadcrumb.d.ts +1 -1
- package/dist/ui/breadcrumb.js +4 -4
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +5 -5
- package/dist/ui/calendar.js +21 -21
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.js +2 -2
- package/dist/ui/carousel.d.ts +2 -2
- package/dist/ui/carousel.js +6 -6
- package/dist/ui/checkbox.d.ts +1 -1
- package/dist/ui/checkbox.js +2 -2
- package/dist/ui/collapsible.d.ts +1 -1
- package/dist/ui/command.d.ts +2 -2
- package/dist/ui/command.js +14 -14
- package/dist/ui/confirm-dialog.js +9 -9
- package/dist/ui/context-menu.d.ts +2 -2
- package/dist/ui/context-menu.js +10 -10
- package/dist/ui/cta.js +5 -5
- package/dist/ui/data-table.d.ts +12 -0
- package/dist/ui/data-table.js +1004 -0
- package/dist/ui/data-table.parts.d.ts +14 -0
- package/dist/ui/data-table.parts.js +462 -0
- package/dist/ui/date-picker.js +26 -26
- package/dist/ui/date-range-picker.js +24 -24
- package/dist/ui/datetime-picker.js +29 -29
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.js +5 -5
- package/dist/ui/drawer.d.ts +1 -1
- package/dist/ui/drawer.js +5 -5
- package/dist/ui/dropdown-menu.d.ts +2 -2
- package/dist/ui/dropdown-menu.js +10 -10
- package/dist/ui/empty-state.d.ts +1 -1
- package/dist/ui/empty-state.js +5 -5
- package/dist/ui/empty.d.ts +2 -2
- package/dist/ui/empty.js +7 -7
- package/dist/ui/field.d.ts +2 -2
- package/dist/ui/field.js +12 -12
- package/dist/ui/form.d.ts +3 -3
- package/dist/ui/form.js +4 -4
- package/dist/ui/hover-card.d.ts +2 -2
- package/dist/ui/hover-card.js +2 -2
- package/dist/ui/input-group.d.ts +2 -2
- package/dist/ui/input-group.js +16 -16
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +4 -4
- package/dist/ui/input.js +1 -1
- package/dist/ui/label.d.ts +1 -1
- package/dist/ui/label.js +2 -2
- package/dist/ui/loading-button.js +8 -8
- package/dist/ui/map/index.d.ts +1 -1
- package/dist/ui/marketing/FeatureGrid.js +3 -3
- package/dist/ui/marketing/Hero.js +7 -7
- package/dist/ui/marketing/PricingTable.js +10 -10
- package/dist/ui/marketing/index.d.ts +1 -1
- package/dist/ui/menubar.d.ts +2 -2
- package/dist/ui/menubar.js +12 -12
- package/dist/ui/molecules/Autocomplete/index.js +26 -26
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +62 -62
- package/dist/ui/molecules/SearchAndFilter/index.js +62 -62
- package/dist/ui/molecules/SkeletonList.js +1 -1
- package/dist/ui/nav-layout.d.ts +1 -1
- package/dist/ui/nav-layout.js +22 -22
- package/dist/ui/navigation-menu.d.ts +2 -2
- package/dist/ui/navigation-menu.js +7 -7
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +11 -11
- package/dist/ui/organisms/ErrorBoundary/index.d.ts +1 -1
- package/dist/ui/organisms/ListPage/ListPage.js +84 -84
- package/dist/ui/organisms/ListPage/index.d.ts +1 -1
- package/dist/ui/organisms/ListPage/types.d.ts +1 -1
- package/dist/ui/page-header.d.ts +1 -1
- package/dist/ui/page-header.js +4 -4
- package/dist/ui/pagination.js +6 -6
- package/dist/ui/popover.d.ts +2 -2
- package/dist/ui/popover.js +2 -2
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/progress.js +3 -3
- package/dist/ui/radio-group.d.ts +1 -1
- package/dist/ui/radio-group.js +3 -3
- package/dist/ui/resizable.d.ts +2 -2
- package/dist/ui/resizable.js +3 -3
- package/dist/ui/scroll-area.d.ts +1 -1
- package/dist/ui/scroll-area.js +4 -4
- package/dist/ui/section.d.ts +1 -1
- package/dist/ui/section.js +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.js +6 -6
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/separator.js +2 -2
- package/dist/ui/sheet.d.ts +2 -2
- package/dist/ui/sheet.js +5 -5
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/sidebar.js +64 -64
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.d.ts +1 -1
- package/dist/ui/slider.js +6 -6
- package/dist/ui/stack.d.ts +4 -4
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card-group.js +5 -5
- package/dist/ui/stepper.js +2 -2
- package/dist/ui/switch.d.ts +1 -1
- package/dist/ui/switch.js +3 -3
- package/dist/ui/table.d.ts +1 -1
- package/dist/ui/table.js +5 -5
- package/dist/ui/tabs.d.ts +2 -2
- package/dist/ui/tabs.js +3 -3
- package/dist/ui/text.js +2 -2
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/time-picker.js +10 -10
- package/dist/ui/toast.d.ts +2 -2
- package/dist/ui/toast.js +5 -5
- package/dist/ui/toaster.js +5 -5
- package/dist/ui/toggle-group.d.ts +1 -1
- package/dist/ui/toggle-group.js +7 -7
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.js +5 -5
- package/dist/ui/tooltip.d.ts +2 -2
- package/dist/ui/tooltip.js +3 -3
- package/dist/ui/typography.js +14 -14
- package/dist/ui/use-toast.d.ts +1 -1
- package/dist/ui/usecases/UseCaseCard.js +8 -8
- package/dist/ui/usecases/UserStoryCard.js +3 -3
- package/dist/ui/visualization/Visualization.d.ts +9 -0
- package/dist/ui/visualization/Visualization.js +442 -0
- package/dist/ui/visualization/Visualization.support.d.ts +15 -0
- package/dist/ui/visualization/Visualization.support.js +123 -0
- package/dist/ui/visualization/index.d.ts +1 -0
- package/dist/ui/visualization/index.js +5 -0
- package/package.json +75 -12
|
@@ -7,23 +7,23 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
// ui/button.tsx
|
|
10
|
+
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
10
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
11
12
|
import { cva } from "class-variance-authority";
|
|
12
|
-
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
13
13
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
14
|
-
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm
|
|
14
|
+
var buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
15
15
|
variants: {
|
|
16
16
|
variant: {
|
|
17
17
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
18
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40
|
|
19
|
-
outline: "border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:
|
|
18
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
19
|
+
outline: "border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
20
20
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
21
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
22
|
link: "text-primary underline-offset-4 hover:underline"
|
|
23
23
|
},
|
|
24
24
|
size: {
|
|
25
25
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
-
sm: "h-8
|
|
26
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
27
27
|
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
28
|
icon: "size-9"
|
|
29
29
|
}
|
|
@@ -56,8 +56,8 @@ function Button({
|
|
|
56
56
|
}, undefined, false, undefined, this);
|
|
57
57
|
}
|
|
58
58
|
// ui/stack.tsx
|
|
59
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
60
59
|
import { cn as cn2 } from "@contractspec/lib.ui-kit-core/utils";
|
|
60
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
61
61
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
62
62
|
var vStackVariants = cva2("flex flex-col", {
|
|
63
63
|
variants: {
|
|
@@ -233,11 +233,11 @@ function UseCaseCard({
|
|
|
233
233
|
gap: "sm",
|
|
234
234
|
children: [
|
|
235
235
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
236
|
-
className: "text-lg
|
|
236
|
+
className: "font-semibold text-lg",
|
|
237
237
|
children: title
|
|
238
238
|
}, undefined, false, undefined, this),
|
|
239
239
|
summary && /* @__PURE__ */ jsxDEV3("div", {
|
|
240
|
-
className: "text-muted-foreground
|
|
240
|
+
className: "text-base text-muted-foreground",
|
|
241
241
|
children: summary
|
|
242
242
|
}, undefined, false, undefined, this),
|
|
243
243
|
ctaHref && /* @__PURE__ */ jsxDEV3(HStack, {
|
|
@@ -7,8 +7,8 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
// ui/stack.tsx
|
|
10
|
-
import { cva } from "class-variance-authority";
|
|
11
10
|
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
12
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
13
13
|
var vStackVariants = cva("flex flex-col", {
|
|
14
14
|
variants: {
|
|
@@ -182,11 +182,11 @@ function UserStoryCard({
|
|
|
182
182
|
gap: "sm",
|
|
183
183
|
children: [
|
|
184
184
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
185
|
-
className: "text-lg
|
|
185
|
+
className: "font-semibold text-lg",
|
|
186
186
|
children: title
|
|
187
187
|
}, undefined, false, undefined, this),
|
|
188
188
|
body && /* @__PURE__ */ jsxDEV2("div", {
|
|
189
|
-
className: "text-muted-foreground
|
|
189
|
+
className: "text-base text-muted-foreground",
|
|
190
190
|
children: body
|
|
191
191
|
}, undefined, false, undefined, this),
|
|
192
192
|
outcome && /* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// ui/map/MapBase.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import Map, {
|
|
12
|
+
NavigationControl,
|
|
13
|
+
ScaleControl
|
|
14
|
+
} from "react-map-gl/maplibre";
|
|
15
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
16
|
+
"use client";
|
|
17
|
+
var DEFAULT_STYLE = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json";
|
|
18
|
+
function MapBase(props) {
|
|
19
|
+
const {
|
|
20
|
+
initialViewState = { longitude: 2.3522, latitude: 48.8566, zoom: 5 },
|
|
21
|
+
styleUrl = DEFAULT_STYLE,
|
|
22
|
+
style,
|
|
23
|
+
showControls = true,
|
|
24
|
+
showCssLink = true,
|
|
25
|
+
onMapRef,
|
|
26
|
+
children
|
|
27
|
+
} = props;
|
|
28
|
+
const mapRef = React.useRef(null);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
onMapRef?.(mapRef.current);
|
|
31
|
+
}, [mapRef.current]);
|
|
32
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
33
|
+
style: {
|
|
34
|
+
position: "relative",
|
|
35
|
+
width: "100%",
|
|
36
|
+
height: "100%",
|
|
37
|
+
...style || {}
|
|
38
|
+
},
|
|
39
|
+
children: [
|
|
40
|
+
showCssLink && /* @__PURE__ */ jsxDEV("link", {
|
|
41
|
+
href: "https://unpkg.com/maplibre-gl@4.7.0/dist/maplibre-gl.css",
|
|
42
|
+
rel: "stylesheet"
|
|
43
|
+
}, undefined, false, undefined, this),
|
|
44
|
+
/* @__PURE__ */ jsxDEV(Map, {
|
|
45
|
+
ref: mapRef,
|
|
46
|
+
mapLib: import("maplibre-gl"),
|
|
47
|
+
initialViewState,
|
|
48
|
+
style: { width: "100%", height: "100%" },
|
|
49
|
+
mapStyle: styleUrl,
|
|
50
|
+
maplibreLogo: false,
|
|
51
|
+
children: [
|
|
52
|
+
showControls && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxDEV(ScaleControl, {
|
|
55
|
+
position: "bottom-left"
|
|
56
|
+
}, undefined, false, undefined, this),
|
|
57
|
+
/* @__PURE__ */ jsxDEV(NavigationControl, {
|
|
58
|
+
position: "bottom-left"
|
|
59
|
+
}, undefined, false, undefined, this)
|
|
60
|
+
]
|
|
61
|
+
}, undefined, true, undefined, this),
|
|
62
|
+
children
|
|
63
|
+
]
|
|
64
|
+
}, undefined, true, undefined, this)
|
|
65
|
+
]
|
|
66
|
+
}, undefined, true, undefined, this);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ui/map/MapGeoJsonOverlay.tsx
|
|
70
|
+
import { Layer, Source } from "react-map-gl/maplibre";
|
|
71
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
72
|
+
"use client";
|
|
73
|
+
function MapGeoJsonOverlay(props) {
|
|
74
|
+
const {
|
|
75
|
+
id = "geojson-overlay",
|
|
76
|
+
data,
|
|
77
|
+
fillColor = "#2563eb",
|
|
78
|
+
fillOpacity = 0.25,
|
|
79
|
+
lineColor = "#1e40af",
|
|
80
|
+
lineWidth = 1.5,
|
|
81
|
+
lineOpacity = 0.8
|
|
82
|
+
} = props;
|
|
83
|
+
const fillLayer = {
|
|
84
|
+
id: `${id}-fill`,
|
|
85
|
+
type: "fill",
|
|
86
|
+
paint: {
|
|
87
|
+
"fill-color": fillColor,
|
|
88
|
+
"fill-opacity": fillOpacity
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const outlineLayer = {
|
|
92
|
+
id: `${id}-outline`,
|
|
93
|
+
type: "line",
|
|
94
|
+
paint: {
|
|
95
|
+
"line-color": lineColor,
|
|
96
|
+
"line-width": lineWidth,
|
|
97
|
+
"line-opacity": lineOpacity
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return /* @__PURE__ */ jsxDEV2(Source, {
|
|
101
|
+
id,
|
|
102
|
+
type: "geojson",
|
|
103
|
+
data,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsxDEV2(Layer, {
|
|
106
|
+
...fillLayer
|
|
107
|
+
}, undefined, false, undefined, this),
|
|
108
|
+
/* @__PURE__ */ jsxDEV2(Layer, {
|
|
109
|
+
...outlineLayer
|
|
110
|
+
}, undefined, false, undefined, this)
|
|
111
|
+
]
|
|
112
|
+
}, undefined, true, undefined, this);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ui/map/MapMarkers.tsx
|
|
116
|
+
import { Marker } from "react-map-gl/maplibre";
|
|
117
|
+
import { jsxDEV as jsxDEV3, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
|
118
|
+
"use client";
|
|
119
|
+
function MapMarkers({ points }) {
|
|
120
|
+
return /* @__PURE__ */ jsxDEV3(Fragment2, {
|
|
121
|
+
children: points.map((p) => /* @__PURE__ */ jsxDEV3(Marker, {
|
|
122
|
+
longitude: p.lng,
|
|
123
|
+
latitude: p.lat,
|
|
124
|
+
anchor: "bottom",
|
|
125
|
+
children: /* @__PURE__ */ jsxDEV3("button", {
|
|
126
|
+
role: p.onClick ? "button" : undefined,
|
|
127
|
+
tabIndex: p.onClick ? 0 : -1,
|
|
128
|
+
"aria-label": p.ariaLabel || "marker",
|
|
129
|
+
onClick: p.onClick,
|
|
130
|
+
onKeyDown: (e) => {
|
|
131
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
p.onClick?.();
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
style: {
|
|
137
|
+
width: p.size ?? 14,
|
|
138
|
+
height: p.size ?? 14,
|
|
139
|
+
background: p.color ?? "#2563eb",
|
|
140
|
+
border: "2px solid white",
|
|
141
|
+
borderRadius: 9999,
|
|
142
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.35)",
|
|
143
|
+
cursor: p.onClick ? "pointer" : "default"
|
|
144
|
+
}
|
|
145
|
+
}, undefined, false, undefined, this)
|
|
146
|
+
}, p.id, false, undefined, this))
|
|
147
|
+
}, undefined, false, undefined, this);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ui/visualization/Visualization.support.tsx
|
|
151
|
+
import {
|
|
152
|
+
formatVisualizationValue
|
|
153
|
+
} from "@contractspec/lib.presentation-runtime-core";
|
|
154
|
+
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
155
|
+
import * as echarts from "echarts/core";
|
|
156
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
157
|
+
"use client";
|
|
158
|
+
function MetricVisualization({
|
|
159
|
+
className,
|
|
160
|
+
model
|
|
161
|
+
}) {
|
|
162
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
163
|
+
className: cn("space-y-2", className),
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
166
|
+
className: "text-muted-foreground text-sm",
|
|
167
|
+
children: model.metric?.label ?? model.title
|
|
168
|
+
}, undefined, false, undefined, this),
|
|
169
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
170
|
+
className: "font-semibold text-3xl",
|
|
171
|
+
children: formatVisualizationValue(model.metric?.value, model.metric?.format)
|
|
172
|
+
}, undefined, false, undefined, this),
|
|
173
|
+
model.metric?.comparisonValue != null ? /* @__PURE__ */ jsxDEV4("div", {
|
|
174
|
+
className: "text-muted-foreground text-sm",
|
|
175
|
+
children: [
|
|
176
|
+
"Comparison:",
|
|
177
|
+
" ",
|
|
178
|
+
formatVisualizationValue(model.metric.comparisonValue, model.metric.format)
|
|
179
|
+
]
|
|
180
|
+
}, undefined, true, undefined, this) : null,
|
|
181
|
+
/* @__PURE__ */ jsxDEV4(TableAlternative, {
|
|
182
|
+
model
|
|
183
|
+
}, undefined, false, undefined, this)
|
|
184
|
+
]
|
|
185
|
+
}, undefined, true, undefined, this);
|
|
186
|
+
}
|
|
187
|
+
function TableAlternative({
|
|
188
|
+
model
|
|
189
|
+
}) {
|
|
190
|
+
if (!model.table.columns.length || !model.table.rows.length)
|
|
191
|
+
return null;
|
|
192
|
+
return /* @__PURE__ */ jsxDEV4("details", {
|
|
193
|
+
className: "rounded-md border p-3 text-sm",
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ jsxDEV4("summary", {
|
|
196
|
+
className: "cursor-pointer font-medium",
|
|
197
|
+
children: "Data summary"
|
|
198
|
+
}, undefined, false, undefined, this),
|
|
199
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
200
|
+
className: "mt-3 overflow-x-auto",
|
|
201
|
+
children: /* @__PURE__ */ jsxDEV4("table", {
|
|
202
|
+
className: "w-full text-left",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ jsxDEV4("thead", {
|
|
205
|
+
children: /* @__PURE__ */ jsxDEV4("tr", {
|
|
206
|
+
children: model.table.columns.map((column) => /* @__PURE__ */ jsxDEV4("th", {
|
|
207
|
+
className: "px-2 py-1 font-medium",
|
|
208
|
+
children: column.label
|
|
209
|
+
}, column.key, false, undefined, this))
|
|
210
|
+
}, undefined, false, undefined, this)
|
|
211
|
+
}, undefined, false, undefined, this),
|
|
212
|
+
/* @__PURE__ */ jsxDEV4("tbody", {
|
|
213
|
+
children: model.table.rows.slice(0, 8).map((row, index) => /* @__PURE__ */ jsxDEV4("tr", {
|
|
214
|
+
children: model.table.columns.map((column) => /* @__PURE__ */ jsxDEV4("td", {
|
|
215
|
+
className: "px-2 py-1",
|
|
216
|
+
children: String(row[column.key] ?? "—")
|
|
217
|
+
}, column.key, false, undefined, this))
|
|
218
|
+
}, `summary-row-${index}`, false, undefined, this))
|
|
219
|
+
}, undefined, false, undefined, this)
|
|
220
|
+
]
|
|
221
|
+
}, undefined, true, undefined, this)
|
|
222
|
+
}, undefined, false, undefined, this)
|
|
223
|
+
]
|
|
224
|
+
}, undefined, true, undefined, this);
|
|
225
|
+
}
|
|
226
|
+
function FallbackVisualization({
|
|
227
|
+
className,
|
|
228
|
+
model,
|
|
229
|
+
reason
|
|
230
|
+
}) {
|
|
231
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
232
|
+
className: cn("space-y-3", className),
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsxDEV4("p", {
|
|
235
|
+
className: "text-muted-foreground text-sm",
|
|
236
|
+
children: reason
|
|
237
|
+
}, undefined, false, undefined, this),
|
|
238
|
+
/* @__PURE__ */ jsxDEV4(TableAlternative, {
|
|
239
|
+
model
|
|
240
|
+
}, undefined, false, undefined, this)
|
|
241
|
+
]
|
|
242
|
+
}, undefined, true, undefined, this);
|
|
243
|
+
}
|
|
244
|
+
function shouldRenderEChart(model) {
|
|
245
|
+
if (model.kind === "metric")
|
|
246
|
+
return false;
|
|
247
|
+
if (model.kind === "geo" && model.geo?.mode === "slippy-map")
|
|
248
|
+
return false;
|
|
249
|
+
if (model.kind === "geo" && model.geo?.geoJson?.type === "url")
|
|
250
|
+
return false;
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
function registerGeoMap(model) {
|
|
254
|
+
if (model.kind !== "geo" || model.geo?.geoJson?.type !== "inline")
|
|
255
|
+
return;
|
|
256
|
+
registerInlineMap(model.geo.geoJson);
|
|
257
|
+
}
|
|
258
|
+
function registerInlineMap(geoJson) {
|
|
259
|
+
if (geoJson.type !== "inline")
|
|
260
|
+
return;
|
|
261
|
+
echarts.registerMap("contractspec-visualization-geo", geoJson.data);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// ui/visually-hidden.tsx
|
|
265
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
266
|
+
var srOnlyStyle = {
|
|
267
|
+
border: 0,
|
|
268
|
+
clip: "rect(0 0 0 0)",
|
|
269
|
+
height: "1px",
|
|
270
|
+
margin: "-1px",
|
|
271
|
+
overflow: "hidden",
|
|
272
|
+
padding: 0,
|
|
273
|
+
position: "absolute",
|
|
274
|
+
width: "1px",
|
|
275
|
+
whiteSpace: "nowrap"
|
|
276
|
+
};
|
|
277
|
+
function VisuallyHidden({
|
|
278
|
+
as = "span",
|
|
279
|
+
style,
|
|
280
|
+
children,
|
|
281
|
+
ref,
|
|
282
|
+
...props
|
|
283
|
+
}) {
|
|
284
|
+
const Comp = as;
|
|
285
|
+
return /* @__PURE__ */ jsxDEV5(Comp, {
|
|
286
|
+
ref,
|
|
287
|
+
style: { ...srOnlyStyle, ...style },
|
|
288
|
+
...props,
|
|
289
|
+
children
|
|
290
|
+
}, undefined, false, undefined, this);
|
|
291
|
+
}
|
|
292
|
+
// ui/visualization/Visualization.tsx
|
|
293
|
+
import {
|
|
294
|
+
buildVisualizationEChartsOption
|
|
295
|
+
} from "@contractspec/lib.presentation-runtime-core";
|
|
296
|
+
import { cn as cn2 } from "@contractspec/lib.ui-kit-core/utils";
|
|
297
|
+
import {
|
|
298
|
+
BarChart,
|
|
299
|
+
FunnelChart,
|
|
300
|
+
HeatmapChart,
|
|
301
|
+
LineChart,
|
|
302
|
+
MapChart,
|
|
303
|
+
PieChart,
|
|
304
|
+
ScatterChart
|
|
305
|
+
} from "echarts/charts";
|
|
306
|
+
import {
|
|
307
|
+
AriaComponent,
|
|
308
|
+
GeoComponent,
|
|
309
|
+
GridComponent,
|
|
310
|
+
LegendComponent,
|
|
311
|
+
TitleComponent,
|
|
312
|
+
TooltipComponent,
|
|
313
|
+
VisualMapComponent
|
|
314
|
+
} from "echarts/components";
|
|
315
|
+
import * as echarts2 from "echarts/core";
|
|
316
|
+
import { CanvasRenderer } from "echarts/renderers";
|
|
317
|
+
import * as React2 from "react";
|
|
318
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
319
|
+
"use client";
|
|
320
|
+
echarts2.use([
|
|
321
|
+
AriaComponent,
|
|
322
|
+
TitleComponent,
|
|
323
|
+
TooltipComponent,
|
|
324
|
+
GridComponent,
|
|
325
|
+
LegendComponent,
|
|
326
|
+
VisualMapComponent,
|
|
327
|
+
GeoComponent,
|
|
328
|
+
CanvasRenderer,
|
|
329
|
+
LineChart,
|
|
330
|
+
BarChart,
|
|
331
|
+
PieChart,
|
|
332
|
+
ScatterChart,
|
|
333
|
+
HeatmapChart,
|
|
334
|
+
FunnelChart,
|
|
335
|
+
MapChart
|
|
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
|
+
}
|
|
344
|
+
function Visualization({
|
|
345
|
+
model,
|
|
346
|
+
className,
|
|
347
|
+
height = 280,
|
|
348
|
+
onDataPointPress
|
|
349
|
+
}) {
|
|
350
|
+
const chartRef = React2.useRef(null);
|
|
351
|
+
const option = React2.useMemo(() => buildVisualizationEChartsOption(model), [model]);
|
|
352
|
+
React2.useEffect(() => {
|
|
353
|
+
if (!shouldRenderEChart(model) || !chartRef.current || !canRenderCanvasCharts()) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
registerGeoMap(model);
|
|
357
|
+
const chart = echarts2.init(chartRef.current, undefined, {
|
|
358
|
+
renderer: "canvas"
|
|
359
|
+
});
|
|
360
|
+
chart.setOption(option);
|
|
361
|
+
if (onDataPointPress) {
|
|
362
|
+
chart.on("click", onDataPointPress);
|
|
363
|
+
}
|
|
364
|
+
const observer = new ResizeObserver(() => chart.resize());
|
|
365
|
+
observer.observe(chartRef.current);
|
|
366
|
+
return () => {
|
|
367
|
+
observer.disconnect();
|
|
368
|
+
if (onDataPointPress) {
|
|
369
|
+
chart.off("click", onDataPointPress);
|
|
370
|
+
}
|
|
371
|
+
chart.dispose();
|
|
372
|
+
};
|
|
373
|
+
}, [model, onDataPointPress, option]);
|
|
374
|
+
if (model.kind === "metric") {
|
|
375
|
+
return /* @__PURE__ */ jsxDEV6(MetricVisualization, {
|
|
376
|
+
className,
|
|
377
|
+
model
|
|
378
|
+
}, undefined, false, undefined, this);
|
|
379
|
+
}
|
|
380
|
+
if (model.kind === "geo" && model.geo?.mode === "slippy-map") {
|
|
381
|
+
return /* @__PURE__ */ jsxDEV6(MapVisualization, {
|
|
382
|
+
className,
|
|
383
|
+
height,
|
|
384
|
+
model
|
|
385
|
+
}, undefined, false, undefined, this);
|
|
386
|
+
}
|
|
387
|
+
if (model.kind === "geo" && model.geo?.geoJson?.type === "url") {
|
|
388
|
+
return /* @__PURE__ */ jsxDEV6(FallbackVisualization, {
|
|
389
|
+
className,
|
|
390
|
+
model,
|
|
391
|
+
reason: "Geo URL sources currently fall back to the summary table."
|
|
392
|
+
}, undefined, false, undefined, this);
|
|
393
|
+
}
|
|
394
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
395
|
+
className: cn2("space-y-3", className),
|
|
396
|
+
children: [
|
|
397
|
+
/* @__PURE__ */ jsxDEV6(VisuallyHidden, {
|
|
398
|
+
children: model.summary
|
|
399
|
+
}, undefined, false, undefined, this),
|
|
400
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
401
|
+
ref: chartRef,
|
|
402
|
+
"aria-label": model.summary,
|
|
403
|
+
className: "w-full rounded-md",
|
|
404
|
+
style: { height }
|
|
405
|
+
}, undefined, false, undefined, this),
|
|
406
|
+
/* @__PURE__ */ jsxDEV6(TableAlternative, {
|
|
407
|
+
model
|
|
408
|
+
}, undefined, false, undefined, this)
|
|
409
|
+
]
|
|
410
|
+
}, undefined, true, undefined, this);
|
|
411
|
+
}
|
|
412
|
+
function MapVisualization({
|
|
413
|
+
className,
|
|
414
|
+
height,
|
|
415
|
+
model
|
|
416
|
+
}) {
|
|
417
|
+
const markers = model.series.flatMap((series) => series.points.filter((point) => point.latitude != null && point.longitude != null).map((point) => ({
|
|
418
|
+
id: point.id,
|
|
419
|
+
lat: point.latitude,
|
|
420
|
+
lng: point.longitude,
|
|
421
|
+
ariaLabel: point.name
|
|
422
|
+
})));
|
|
423
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
424
|
+
className: cn2("space-y-3", className),
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
427
|
+
style: { height },
|
|
428
|
+
children: /* @__PURE__ */ jsxDEV6(MapBase, {
|
|
429
|
+
children: [
|
|
430
|
+
markers.length > 0 ? /* @__PURE__ */ jsxDEV6(MapMarkers, {
|
|
431
|
+
points: markers
|
|
432
|
+
}, undefined, false, undefined, this) : null,
|
|
433
|
+
model.geo?.geoJson?.type === "inline" ? /* @__PURE__ */ jsxDEV6(MapGeoJsonOverlay, {
|
|
434
|
+
data: model.geo.geoJson.data
|
|
435
|
+
}, undefined, false, undefined, this) : null
|
|
436
|
+
]
|
|
437
|
+
}, undefined, true, undefined, this)
|
|
438
|
+
}, undefined, false, undefined, this),
|
|
439
|
+
/* @__PURE__ */ jsxDEV6(TableAlternative, {
|
|
440
|
+
model
|
|
441
|
+
}, undefined, false, undefined, this)
|
|
442
|
+
]
|
|
443
|
+
}, undefined, true, undefined, this);
|
|
444
|
+
}
|
|
445
|
+
export {
|
|
446
|
+
Visualization
|
|
447
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// ui/visualization/Visualization.support.tsx
|
|
10
|
+
import {
|
|
11
|
+
formatVisualizationValue
|
|
12
|
+
} from "@contractspec/lib.presentation-runtime-core";
|
|
13
|
+
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
14
|
+
import * as echarts from "echarts/core";
|
|
15
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
16
|
+
"use client";
|
|
17
|
+
function MetricVisualization({
|
|
18
|
+
className,
|
|
19
|
+
model
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
22
|
+
className: cn("space-y-2", className),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
25
|
+
className: "text-muted-foreground text-sm",
|
|
26
|
+
children: model.metric?.label ?? model.title
|
|
27
|
+
}, undefined, false, undefined, this),
|
|
28
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
29
|
+
className: "font-semibold text-3xl",
|
|
30
|
+
children: formatVisualizationValue(model.metric?.value, model.metric?.format)
|
|
31
|
+
}, undefined, false, undefined, this),
|
|
32
|
+
model.metric?.comparisonValue != null ? /* @__PURE__ */ jsxDEV("div", {
|
|
33
|
+
className: "text-muted-foreground text-sm",
|
|
34
|
+
children: [
|
|
35
|
+
"Comparison:",
|
|
36
|
+
" ",
|
|
37
|
+
formatVisualizationValue(model.metric.comparisonValue, model.metric.format)
|
|
38
|
+
]
|
|
39
|
+
}, undefined, true, undefined, this) : null,
|
|
40
|
+
/* @__PURE__ */ jsxDEV(TableAlternative, {
|
|
41
|
+
model
|
|
42
|
+
}, undefined, false, undefined, this)
|
|
43
|
+
]
|
|
44
|
+
}, undefined, true, undefined, this);
|
|
45
|
+
}
|
|
46
|
+
function TableAlternative({
|
|
47
|
+
model
|
|
48
|
+
}) {
|
|
49
|
+
if (!model.table.columns.length || !model.table.rows.length)
|
|
50
|
+
return null;
|
|
51
|
+
return /* @__PURE__ */ jsxDEV("details", {
|
|
52
|
+
className: "rounded-md border p-3 text-sm",
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxDEV("summary", {
|
|
55
|
+
className: "cursor-pointer font-medium",
|
|
56
|
+
children: "Data summary"
|
|
57
|
+
}, undefined, false, undefined, this),
|
|
58
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
59
|
+
className: "mt-3 overflow-x-auto",
|
|
60
|
+
children: /* @__PURE__ */ jsxDEV("table", {
|
|
61
|
+
className: "w-full text-left",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxDEV("thead", {
|
|
64
|
+
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
65
|
+
children: model.table.columns.map((column) => /* @__PURE__ */ jsxDEV("th", {
|
|
66
|
+
className: "px-2 py-1 font-medium",
|
|
67
|
+
children: column.label
|
|
68
|
+
}, column.key, false, undefined, this))
|
|
69
|
+
}, undefined, false, undefined, this)
|
|
70
|
+
}, undefined, false, undefined, this),
|
|
71
|
+
/* @__PURE__ */ jsxDEV("tbody", {
|
|
72
|
+
children: model.table.rows.slice(0, 8).map((row, index) => /* @__PURE__ */ jsxDEV("tr", {
|
|
73
|
+
children: model.table.columns.map((column) => /* @__PURE__ */ jsxDEV("td", {
|
|
74
|
+
className: "px-2 py-1",
|
|
75
|
+
children: String(row[column.key] ?? "—")
|
|
76
|
+
}, column.key, false, undefined, this))
|
|
77
|
+
}, `summary-row-${index}`, false, undefined, this))
|
|
78
|
+
}, undefined, false, undefined, this)
|
|
79
|
+
]
|
|
80
|
+
}, undefined, true, undefined, this)
|
|
81
|
+
}, undefined, false, undefined, this)
|
|
82
|
+
]
|
|
83
|
+
}, undefined, true, undefined, this);
|
|
84
|
+
}
|
|
85
|
+
function FallbackVisualization({
|
|
86
|
+
className,
|
|
87
|
+
model,
|
|
88
|
+
reason
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
91
|
+
className: cn("space-y-3", className),
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
94
|
+
className: "text-muted-foreground text-sm",
|
|
95
|
+
children: reason
|
|
96
|
+
}, undefined, false, undefined, this),
|
|
97
|
+
/* @__PURE__ */ jsxDEV(TableAlternative, {
|
|
98
|
+
model
|
|
99
|
+
}, undefined, false, undefined, this)
|
|
100
|
+
]
|
|
101
|
+
}, undefined, true, undefined, this);
|
|
102
|
+
}
|
|
103
|
+
function shouldRenderEChart(model) {
|
|
104
|
+
if (model.kind === "metric")
|
|
105
|
+
return false;
|
|
106
|
+
if (model.kind === "geo" && model.geo?.mode === "slippy-map")
|
|
107
|
+
return false;
|
|
108
|
+
if (model.kind === "geo" && model.geo?.geoJson?.type === "url")
|
|
109
|
+
return false;
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
function registerGeoMap(model) {
|
|
113
|
+
if (model.kind !== "geo" || model.geo?.geoJson?.type !== "inline")
|
|
114
|
+
return;
|
|
115
|
+
registerInlineMap(model.geo.geoJson);
|
|
116
|
+
}
|
|
117
|
+
function registerInlineMap(geoJson) {
|
|
118
|
+
if (geoJson.type !== "inline")
|
|
119
|
+
return;
|
|
120
|
+
echarts.registerMap("contractspec-visualization-geo", geoJson.data);
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
shouldRenderEChart,
|
|
124
|
+
registerGeoMap,
|
|
125
|
+
TableAlternative,
|
|
126
|
+
MetricVisualization,
|
|
127
|
+
FallbackVisualization
|
|
128
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
Visualization
|
|
10
|
+
};
|
package/dist/ui/accordion.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export { Accordion, AccordionItem, AccordionTrigger
|
|
7
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|