@cognite/aura 0.3.1 → 0.3.3
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/DESIGN.md +1651 -7
- package/README.md +45 -3
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +58 -325
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -83
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -62
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -98
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -81
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -189
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -158
- package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/index.js +5 -8
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -39
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +79 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +19 -17
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -250
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +23 -0
- package/package.json +23 -7
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
|
@@ -1,187 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
ref: o,
|
|
27
|
-
"data-slot": "card-header-start",
|
|
28
|
-
className: s(
|
|
29
|
-
"col-start-1 row-start-1 h-12 self-stretch pt-1.5",
|
|
30
|
-
t
|
|
31
|
-
),
|
|
32
|
-
...a,
|
|
33
|
-
children: /* @__PURE__ */ e("div", { className: "flex items-start h-full", children: r })
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
);
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i } from "../dropdown-menu/dropdown-menu.js";
|
|
4
|
+
import { forwardRef as a } from "react";
|
|
5
|
+
import { IconDotsVertical as o } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region libs/aura/src/components/ui/core/card/card.tsx
|
|
8
|
+
var l = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
9
|
+
ref: r,
|
|
10
|
+
"data-slot": "card",
|
|
11
|
+
className: e("bg-card-background text-foreground flex flex-col rounded-xl p-4 gap-4", t),
|
|
12
|
+
...n
|
|
13
|
+
}));
|
|
14
|
+
l.displayName = "Card";
|
|
15
|
+
var u = a(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ s("div", {
|
|
16
|
+
ref: i,
|
|
17
|
+
"data-slot": "card-header-start",
|
|
18
|
+
className: e("col-start-1 row-start-1 h-12 self-stretch pt-1.5", t),
|
|
19
|
+
...r,
|
|
20
|
+
children: /* @__PURE__ */ s("div", {
|
|
21
|
+
className: "flex items-start h-full",
|
|
22
|
+
children: n
|
|
23
|
+
})
|
|
24
|
+
}));
|
|
37
25
|
u.displayName = "CardHeaderStart";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"col-start-3 row-start-1 self-start justify-self-end flex justify-end items-start gap-1",
|
|
74
|
-
t
|
|
75
|
-
),
|
|
76
|
-
...r
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
);
|
|
80
|
-
x.displayName = "CardHeaderEnd";
|
|
81
|
-
const N = d(
|
|
82
|
-
({ className: t, children: r, ...a }, o) => /* @__PURE__ */ e(
|
|
83
|
-
"div",
|
|
84
|
-
{
|
|
85
|
-
ref: o,
|
|
86
|
-
"data-slot": "card-header",
|
|
87
|
-
className: s(
|
|
88
|
-
"group/card-header @container/card-header grid items-center gap-x-3 grid-cols-[auto_minmax(0,1fr)_auto]",
|
|
89
|
-
t
|
|
90
|
-
),
|
|
91
|
-
...a,
|
|
92
|
-
children: r
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
);
|
|
96
|
-
N.displayName = "CardHeader";
|
|
97
|
-
const h = d(
|
|
98
|
-
({ className: t, ...r }, a) => /* @__PURE__ */ e(
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
ref: a,
|
|
102
|
-
"data-slot": "card-header-center",
|
|
103
|
-
className: s(
|
|
104
|
-
"col-start-1 row-start-1 min-w-0 flex flex-col justify-center",
|
|
105
|
-
"group-has-data-[slot=card-header-start]/card-header:col-start-2",
|
|
106
|
-
t
|
|
107
|
-
),
|
|
108
|
-
...r
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
);
|
|
26
|
+
var d = a(({ className: t, as: n = "h3", ...r }, i) => /* @__PURE__ */ s(n, {
|
|
27
|
+
ref: i,
|
|
28
|
+
"data-slot": "card-title",
|
|
29
|
+
className: e("tracking-tightest text-foreground font-medium text-lg leading-6 line-clamp-2 overflow-hidden", t),
|
|
30
|
+
...r
|
|
31
|
+
}));
|
|
32
|
+
d.displayName = "CardTitle";
|
|
33
|
+
var f = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("p", {
|
|
34
|
+
ref: r,
|
|
35
|
+
"data-slot": "card-description",
|
|
36
|
+
className: e("text-muted-foreground text-sm font-normal leading-5 tracking-tight line-clamp-2 overflow-hidden", t),
|
|
37
|
+
...n
|
|
38
|
+
}));
|
|
39
|
+
f.displayName = "CardDescription";
|
|
40
|
+
var p = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
41
|
+
ref: r,
|
|
42
|
+
"data-slot": "card-header-end",
|
|
43
|
+
className: e("col-start-3 row-start-1 self-start justify-self-end flex justify-end items-start gap-1", t),
|
|
44
|
+
...n
|
|
45
|
+
}));
|
|
46
|
+
p.displayName = "CardHeaderEnd";
|
|
47
|
+
var m = a(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ s("div", {
|
|
48
|
+
ref: i,
|
|
49
|
+
"data-slot": "card-header",
|
|
50
|
+
className: e("group/card-header @container/card-header grid items-center gap-x-3 grid-cols-[auto_minmax(0,1fr)_auto]", t),
|
|
51
|
+
...r,
|
|
52
|
+
children: n
|
|
53
|
+
}));
|
|
54
|
+
m.displayName = "CardHeader";
|
|
55
|
+
var h = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
56
|
+
ref: r,
|
|
57
|
+
"data-slot": "card-header-center",
|
|
58
|
+
className: e("col-start-1 row-start-1 min-w-0 flex flex-col justify-center", "group-has-data-[slot=card-header-start]/card-header:col-start-2", t),
|
|
59
|
+
...n
|
|
60
|
+
}));
|
|
112
61
|
h.displayName = "CardHeaderCenter";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
className: s("flex-1 flex items-start justify-start gap-2", t),
|
|
157
|
-
...r
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
);
|
|
161
|
-
H.displayName = "CardFooterStart";
|
|
162
|
-
const j = d(
|
|
163
|
-
({ className: t, ...r }, a) => /* @__PURE__ */ e(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
ref: a,
|
|
167
|
-
"data-slot": "card-footer-end",
|
|
168
|
-
className: s("flex items-center justify-end", t),
|
|
169
|
-
...r
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
);
|
|
173
|
-
j.displayName = "CardFooterEnd";
|
|
174
|
-
export {
|
|
175
|
-
p as Card,
|
|
176
|
-
y as CardActions,
|
|
177
|
-
v as CardContent,
|
|
178
|
-
g as CardDescription,
|
|
179
|
-
w as CardFooter,
|
|
180
|
-
j as CardFooterEnd,
|
|
181
|
-
H as CardFooterStart,
|
|
182
|
-
N as CardHeader,
|
|
183
|
-
h as CardHeaderCenter,
|
|
184
|
-
x as CardHeaderEnd,
|
|
185
|
-
u as CardHeaderStart,
|
|
186
|
-
C as CardTitle
|
|
187
|
-
};
|
|
62
|
+
var g = a(({ children: e, align: a = "end", ...l }, u) => /* @__PURE__ */ c(n, {
|
|
63
|
+
...l,
|
|
64
|
+
children: [/* @__PURE__ */ s(i, { render: /* @__PURE__ */ s(t, {
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size: "icon-sm",
|
|
67
|
+
ref: u,
|
|
68
|
+
children: /* @__PURE__ */ s(o, {})
|
|
69
|
+
}) }), /* @__PURE__ */ s(r, {
|
|
70
|
+
align: a,
|
|
71
|
+
children: e
|
|
72
|
+
})]
|
|
73
|
+
}));
|
|
74
|
+
g.displayName = "CardActions";
|
|
75
|
+
var _ = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
76
|
+
ref: r,
|
|
77
|
+
"data-slot": "card-content",
|
|
78
|
+
className: e("text-secondary-foreground flex flex-col items-start gap-4 self-stretch", t),
|
|
79
|
+
...n
|
|
80
|
+
}));
|
|
81
|
+
_.displayName = "CardContent";
|
|
82
|
+
var v = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
83
|
+
ref: r,
|
|
84
|
+
"data-slot": "card-footer",
|
|
85
|
+
className: e("flex items-center gap-4 self-stretch", t),
|
|
86
|
+
...n
|
|
87
|
+
}));
|
|
88
|
+
v.displayName = "CardFooter";
|
|
89
|
+
var y = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
90
|
+
ref: r,
|
|
91
|
+
"data-slot": "card-footer-start",
|
|
92
|
+
className: e("flex-1 flex items-start justify-start gap-2", t),
|
|
93
|
+
...n
|
|
94
|
+
}));
|
|
95
|
+
y.displayName = "CardFooterStart";
|
|
96
|
+
var b = a(({ className: t, ...n }, r) => /* @__PURE__ */ s("div", {
|
|
97
|
+
ref: r,
|
|
98
|
+
"data-slot": "card-footer-end",
|
|
99
|
+
className: e("flex items-center justify-end", t),
|
|
100
|
+
...n
|
|
101
|
+
}));
|
|
102
|
+
b.displayName = "CardFooterEnd";
|
|
103
|
+
//#endregion
|
|
104
|
+
export { l as Card, g as CardActions, _ as CardContent, f as CardDescription, v as CardFooter, b as CardFooterEnd, y as CardFooterStart, m as CardHeader, h as CardHeaderCenter, p as CardHeaderEnd, u as CardHeaderStart, d as CardTitle };
|
|
@@ -1,215 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { createContext as t, useContext as n, useMemo as r } from "react";
|
|
3
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { Legend as s, ResponsiveContainer as c, Tooltip as l } from "recharts";
|
|
5
|
+
//#region libs/aura/src/components/ui/core/chart/chart.tsx
|
|
6
|
+
function u(e) {
|
|
7
|
+
if (!e) return;
|
|
8
|
+
let t = e.trim();
|
|
9
|
+
return {
|
|
10
|
+
backgroundColor: t,
|
|
11
|
+
borderColor: t
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return e;
|
|
14
|
+
var d = t(null);
|
|
15
|
+
function f() {
|
|
16
|
+
let e = n(d);
|
|
17
|
+
if (!e) throw Error("useChart must be used within a <ChartContainer>");
|
|
18
|
+
return e;
|
|
17
19
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return r;
|
|
20
|
+
function p(e) {
|
|
21
|
+
let t = {};
|
|
22
|
+
for (let [n, r] of Object.entries(e)) r.color && (t[`--color-${n}`] = r.color);
|
|
23
|
+
return t;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
|
|
42
|
-
r
|
|
43
|
-
),
|
|
44
|
-
style: { ...f, ...d },
|
|
45
|
-
...o,
|
|
46
|
-
children: /* @__PURE__ */ a(M, { children: s })
|
|
47
|
-
}
|
|
48
|
-
) });
|
|
25
|
+
function m({ id: t, className: n, children: i, config: o, style: s, role: l = "img", ...u }) {
|
|
26
|
+
let f = r(() => ({ config: o }), [o]), m = p(o);
|
|
27
|
+
return /* @__PURE__ */ a(d.Provider, {
|
|
28
|
+
value: f,
|
|
29
|
+
children: /* @__PURE__ */ a("div", {
|
|
30
|
+
role: l,
|
|
31
|
+
"data-slot": "chart",
|
|
32
|
+
"data-chart-id": t,
|
|
33
|
+
className: e("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", n),
|
|
34
|
+
style: {
|
|
35
|
+
...m,
|
|
36
|
+
...s
|
|
37
|
+
},
|
|
38
|
+
...u,
|
|
39
|
+
children: /* @__PURE__ */ a(c, { children: i })
|
|
40
|
+
})
|
|
41
|
+
});
|
|
49
42
|
}
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
n === "dot" && "items-center"
|
|
97
|
-
),
|
|
98
|
-
children: h && t.value != null && t.name != null ? h(
|
|
99
|
-
t.value,
|
|
100
|
-
t.name,
|
|
101
|
-
t,
|
|
102
|
-
v,
|
|
103
|
-
m(t.payload) ? t.payload : void 0
|
|
104
|
-
) : /* @__PURE__ */ g(L, { children: [
|
|
105
|
-
u?.icon ? u.icon : !c && /* @__PURE__ */ a(
|
|
106
|
-
"div",
|
|
107
|
-
{
|
|
108
|
-
className: i("shrink-0 rounded-xs", {
|
|
109
|
-
"h-2 w-2": n === "dot",
|
|
110
|
-
"w-1": n === "line",
|
|
111
|
-
"w-0 border border-dashed bg-transparent": n === "dashed",
|
|
112
|
-
"my-0.5": p && n === "dashed"
|
|
113
|
-
}),
|
|
114
|
-
style: F
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ g(
|
|
118
|
-
"div",
|
|
119
|
-
{
|
|
120
|
-
className: i(
|
|
121
|
-
"flex flex-1 justify-between gap-4 leading-none",
|
|
122
|
-
p ? "items-end" : "items-center"
|
|
123
|
-
),
|
|
124
|
-
children: [
|
|
125
|
-
/* @__PURE__ */ g("div", { className: "grid gap-1", children: [
|
|
126
|
-
p ? k : null,
|
|
127
|
-
/* @__PURE__ */ a("span", { className: "text-muted-foreground", children: u?.label ?? t.name })
|
|
128
|
-
] }),
|
|
129
|
-
t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", { className: "text-foreground tabular-nums", children: A(t.value) })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] })
|
|
134
|
-
},
|
|
135
|
-
t.dataKey ?? v
|
|
136
|
-
);
|
|
137
|
-
}) })
|
|
138
|
-
] })
|
|
139
|
-
}
|
|
140
|
-
);
|
|
43
|
+
var h = l, g = [], _ = (e) => typeof e == "number" ? e.toLocaleString() : String(e);
|
|
44
|
+
function v({ active: t, payload: n = g, className: r, indicator: s = "dot", hideLabel: c = !1, hideIndicator: l = !1, label: d, labelFormatter: p, labelClassName: m, formatter: h, color: v, nameKey: y, labelKey: b, valueFormatter: x = _ }) {
|
|
45
|
+
let { config: w } = f(), T = (() => {
|
|
46
|
+
if (c || !n?.length) return null;
|
|
47
|
+
let [t] = n, r = `${b ?? t?.dataKey ?? t?.name ?? "value"}`, i = S(w, t, r), o = !b && typeof d == "string" ? w[d]?.label ?? d : i?.label;
|
|
48
|
+
return p ? /* @__PURE__ */ a("div", {
|
|
49
|
+
className: e("font-medium", m),
|
|
50
|
+
children: p(o, n)
|
|
51
|
+
}) : o ? /* @__PURE__ */ a("div", {
|
|
52
|
+
className: e("font-medium", m),
|
|
53
|
+
children: o
|
|
54
|
+
}) : null;
|
|
55
|
+
})(), E = !t || !n.length, D = n.length === 1 && s !== "dot";
|
|
56
|
+
return /* @__PURE__ */ a("div", {
|
|
57
|
+
className: e("bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md", E && "invisible", r),
|
|
58
|
+
children: E ? null : /* @__PURE__ */ o(i, { children: [D ? null : T, /* @__PURE__ */ a("div", {
|
|
59
|
+
className: "grid gap-1.5",
|
|
60
|
+
children: n.filter((e) => e.type !== "none").map((t, n) => {
|
|
61
|
+
let r = `${y ?? t.name ?? t.dataKey ?? "value"}`, c = S(w, t, r), d = C(t.payload) && typeof t.payload.fill == "string" ? t.payload.fill : void 0, f = v ?? d ?? t.color, p = u(typeof f == "string" ? f : void 0);
|
|
62
|
+
return /* @__PURE__ */ a("div", {
|
|
63
|
+
className: e("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", s === "dot" && "items-center"),
|
|
64
|
+
children: h && t.value != null && t.name != null ? h(t.value, t.name, t, n, C(t.payload) ? t.payload : void 0) : /* @__PURE__ */ o(i, { children: [c?.icon ? c.icon : !l && /* @__PURE__ */ a("div", {
|
|
65
|
+
className: e("shrink-0 rounded-xs", {
|
|
66
|
+
"h-2 w-2": s === "dot",
|
|
67
|
+
"w-1": s === "line",
|
|
68
|
+
"w-0 border border-dashed bg-transparent": s === "dashed",
|
|
69
|
+
"my-0.5": D && s === "dashed"
|
|
70
|
+
}),
|
|
71
|
+
style: p
|
|
72
|
+
}), /* @__PURE__ */ o("div", {
|
|
73
|
+
className: e("flex flex-1 justify-between gap-4 leading-none", D ? "items-end" : "items-center"),
|
|
74
|
+
children: [/* @__PURE__ */ o("div", {
|
|
75
|
+
className: "grid gap-1",
|
|
76
|
+
children: [D ? T : null, /* @__PURE__ */ a("span", {
|
|
77
|
+
className: "text-muted-foreground",
|
|
78
|
+
children: c?.label ?? t.name
|
|
79
|
+
})]
|
|
80
|
+
}), t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", {
|
|
81
|
+
className: "text-foreground tabular-nums",
|
|
82
|
+
children: x(t.value)
|
|
83
|
+
})]
|
|
84
|
+
})] })
|
|
85
|
+
}, t.dataKey ?? n);
|
|
86
|
+
})
|
|
87
|
+
})] })
|
|
88
|
+
});
|
|
141
89
|
}
|
|
142
|
-
|
|
143
|
-
function
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
),
|
|
159
|
-
children: s.filter((o) => o.type !== "none").map((o, l) => {
|
|
160
|
-
const f = `${d ?? o.dataKey ?? "value"}`, h = b(c, o, f), y = S(
|
|
161
|
-
typeof o.color == "string" ? o.color : void 0
|
|
162
|
-
);
|
|
163
|
-
return /* @__PURE__ */ g(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
className: i(
|
|
167
|
-
"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
|
|
168
|
-
),
|
|
169
|
-
children: [
|
|
170
|
-
h?.icon && !r ? h.icon : /* @__PURE__ */ a(
|
|
171
|
-
"div",
|
|
172
|
-
{
|
|
173
|
-
className: "h-2 w-2 shrink-0 rounded-xs",
|
|
174
|
-
style: y
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
h?.label ?? o.value
|
|
178
|
-
]
|
|
179
|
-
},
|
|
180
|
-
o.value ?? l
|
|
181
|
-
);
|
|
182
|
-
})
|
|
183
|
-
}
|
|
184
|
-
) : null;
|
|
90
|
+
var y = s, b = [];
|
|
91
|
+
function x({ className: t, hideIcon: n = !1, payload: r = b, verticalAlign: i = "bottom", nameKey: s }) {
|
|
92
|
+
let { config: c } = f();
|
|
93
|
+
return r?.length ? /* @__PURE__ */ a("div", {
|
|
94
|
+
className: e("flex items-center justify-center gap-4", i === "top" ? "pb-3" : "pt-3", t),
|
|
95
|
+
children: r.filter((e) => e.type !== "none").map((t, r) => {
|
|
96
|
+
let i = `${s ?? t.dataKey ?? "value"}`, l = S(c, t, i), d = u(typeof t.color == "string" ? t.color : void 0);
|
|
97
|
+
return /* @__PURE__ */ o("div", {
|
|
98
|
+
className: e("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
|
|
99
|
+
children: [l?.icon && !n ? l.icon : /* @__PURE__ */ a("div", {
|
|
100
|
+
className: "h-2 w-2 shrink-0 rounded-xs",
|
|
101
|
+
style: d
|
|
102
|
+
}), l?.label ?? t.value]
|
|
103
|
+
}, t.value ?? r);
|
|
104
|
+
})
|
|
105
|
+
}) : null;
|
|
185
106
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
const l = d ? P(d, s) : void 0;
|
|
196
|
-
l && (c = l);
|
|
197
|
-
}
|
|
198
|
-
return e[c] ?? e[s];
|
|
107
|
+
function S(e, t, n) {
|
|
108
|
+
if (!C(t)) return;
|
|
109
|
+
let r = t, i = C(r.payload) ? r.payload : void 0, a = n, o = w(r, n);
|
|
110
|
+
if (o) a = o;
|
|
111
|
+
else {
|
|
112
|
+
let e = i ? w(i, n) : void 0;
|
|
113
|
+
e && (a = e);
|
|
114
|
+
}
|
|
115
|
+
return e[a] ?? e[n];
|
|
199
116
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
117
|
+
function C(e) {
|
|
118
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
202
119
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
|
|
120
|
+
function w(e, t) {
|
|
121
|
+
let n = e[t];
|
|
122
|
+
return typeof n == "string" ? n : void 0;
|
|
206
123
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
X as ChartLegend,
|
|
210
|
-
Z as ChartLegendContent,
|
|
211
|
-
U as ChartTooltip,
|
|
212
|
-
W as ChartTooltipContent,
|
|
213
|
-
R as colorVarsFromConfig,
|
|
214
|
-
b as getPayloadConfigFromPayload
|
|
215
|
-
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { m as ChartContainer, y as ChartLegend, x as ChartLegendContent, h as ChartTooltip, v as ChartTooltipContent, p as colorVarsFromConfig, S as getPayloadConfigFromPayload };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { ChartContainer as e, ChartLegend as
|
|
2
|
-
export {
|
|
3
|
-
e as ChartContainer,
|
|
4
|
-
n as ChartLegend,
|
|
5
|
-
r as ChartLegendContent,
|
|
6
|
-
C as ChartTooltip,
|
|
7
|
-
a as ChartTooltipContent
|
|
8
|
-
};
|
|
1
|
+
import { ChartContainer as e, ChartLegend as t, ChartLegendContent as n, ChartTooltip as r, ChartTooltipContent as i } from "./chart.js";
|
|
2
|
+
export { e as ChartContainer, t as ChartLegend, n as ChartLegendContent, r as ChartTooltip, i as ChartTooltipContent };
|