@devalok/shilp-sutra 0.8.3 → 0.9.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.
- package/dist/_chunks/avatar.js +50 -0
- package/dist/_chunks/button.js +95 -0
- package/dist/_chunks/card.js +40 -0
- package/dist/_chunks/checkbox.js +14 -0
- package/dist/_chunks/form.js +27 -0
- package/dist/_chunks/primitives.js +6965 -0
- package/dist/_chunks/sidebar.js +592 -0
- package/dist/_chunks/spinner.js +34 -0
- package/dist/_chunks/tiptap.js +15254 -0
- package/dist/_chunks/tooltip.js +13 -0
- package/dist/_chunks/tree-view.js +304 -0
- package/dist/_chunks/use-calendar.js +990 -0
- package/dist/_chunks/utils.js +15 -0
- package/dist/_chunks/vendor.js +5823 -0
- package/dist/composed/avatar-group.js +20 -20
- package/dist/composed/command-palette.js +1 -1
- package/dist/composed/confirm-dialog.js +5 -5
- package/dist/composed/content-card.d.ts +1 -1
- package/dist/composed/content-card.js +6 -6
- package/dist/composed/date-picker/index.js +13 -0
- package/dist/composed/empty-state.js +10 -10
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +4 -4
- package/dist/composed/index.js +45 -53
- package/dist/composed/loading-skeleton.js +2 -2
- package/dist/composed/member-picker.js +5 -5
- package/dist/composed/page-header.js +4 -4
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +422 -209
- package/dist/composed/schedule-view.js +1 -1
- package/dist/composed/simple-tooltip.js +6 -6
- package/dist/composed/status-badge.d.ts +1 -1
- package/dist/composed/status-badge.js +2 -2
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/notification-center.js +2 -2
- package/dist/shell/notification-preferences.js +32 -33
- package/dist/shell/sidebar.js +24 -24
- package/dist/shell/top-bar.js +22 -22
- package/dist/ui/accordion.js +17 -17
- package/dist/ui/alert-dialog.js +29 -29
- package/dist/ui/alert.d.ts +2 -2
- package/dist/ui/alert.js +65 -44
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/autocomplete.js +11 -11
- package/dist/ui/avatar.d.ts +1 -1
- package/dist/ui/avatar.js +67 -25
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +115 -91
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.js +5 -5
- package/dist/ui/breadcrumb.js +14 -14
- package/dist/ui/button-group.js +30 -15
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +114 -71
- package/dist/ui/card.js +66 -22
- package/dist/ui/charts/index.js +1221 -18
- package/dist/ui/checkbox.js +25 -5
- package/dist/ui/chip.d.ts +4 -4
- package/dist/ui/chip.js +2 -2
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +5 -5
- package/dist/ui/color-input.js +11 -11
- package/dist/ui/combobox.js +12 -12
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +37 -37
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +2 -2
- package/dist/ui/dialog.js +33 -33
- package/dist/ui/dropdown-menu.js +60 -60
- package/dist/ui/file-upload.js +1 -1
- package/dist/ui/form.js +36 -15
- package/dist/ui/hover-card.js +7 -7
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +523 -325
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/input-otp.js +14 -14
- package/dist/ui/input.js +56 -28
- package/dist/ui/label.js +18 -4
- package/dist/ui/lib/utils.js +4 -5
- package/dist/ui/link.js +9 -9
- package/dist/ui/menubar.js +81 -81
- package/dist/ui/navigation-menu.js +42 -42
- package/dist/ui/number-input.js +13 -13
- package/dist/ui/pagination.js +5 -5
- package/dist/ui/popover.js +9 -9
- package/dist/ui/progress.d.ts +1 -1
- package/dist/ui/progress.js +15 -15
- package/dist/ui/radio.js +10 -10
- package/dist/ui/search-input.js +5 -5
- package/dist/ui/segmented-control.js +91 -83
- package/dist/ui/select.js +52 -52
- package/dist/ui/separator.js +20 -5
- package/dist/ui/sheet.js +28 -28
- package/dist/ui/sidebar.js +36 -560
- package/dist/ui/skeleton.d.ts +1 -1
- package/dist/ui/skeleton.js +9 -9
- package/dist/ui/slider.js +11 -11
- package/dist/ui/spinner.js +37 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +1 -1
- package/dist/ui/stepper.js +15 -15
- package/dist/ui/switch.js +22 -3
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.js +59 -32
- package/dist/ui/text.js +2 -2
- package/dist/ui/textarea.js +7 -7
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +28 -28
- package/dist/ui/toggle-group.js +11 -11
- package/dist/ui/toggle.js +9 -9
- package/dist/ui/tooltip.js +17 -6
- package/dist/ui/transitions.js +68 -58
- package/dist/ui/tree-view/index.js +7 -0
- package/dist/ui/visually-hidden.js +3 -3
- package/llms-full.txt +1 -1
- package/llms.txt +7 -0
- package/package.json +656 -701
- package/dist/_virtual/client.js +0 -5
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/react-dom-client.development.js +0 -5
- package/dist/_virtual/react-dom-client.production.js +0 -5
- package/dist/_virtual/scheduler.development.js +0 -5
- package/dist/_virtual/scheduler.production.js +0 -5
- package/dist/composed/date-picker/calendar-grid.js +0 -194
- package/dist/composed/date-picker/date-picker.js +0 -124
- package/dist/composed/date-picker/date-range-picker.js +0 -167
- package/dist/composed/date-picker/date-time-picker.js +0 -193
- package/dist/composed/date-picker/month-picker.js +0 -53
- package/dist/composed/date-picker/presets.js +0 -84
- package/dist/composed/date-picker/time-picker.js +0 -181
- package/dist/composed/date-picker/use-calendar.js +0 -17
- package/dist/composed/date-picker/year-picker.js +0 -45
- package/dist/composed/extensions/emoji-suggestion.js +0 -119
- package/dist/composed/extensions/file-attachment.js +0 -55
- package/dist/composed/extensions/mention-suggestion.js +0 -79
- package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +0 -40141
- package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +0 -17
- package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +0 -2958
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +0 -17062
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +0 -9790
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +0 -20
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +0 -237
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +0 -234
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +0 -11
- package/dist/primitives/_internal/number.js +0 -6
- package/dist/primitives/_internal/primitive.js +0 -9
- package/dist/primitives/_internal/react-arrow.js +0 -13
- package/dist/primitives/_internal/react-collection.js +0 -48
- package/dist/primitives/_internal/react-compose-refs.js +0 -29
- package/dist/primitives/_internal/react-context.js +0 -76
- package/dist/primitives/_internal/react-direction.js +0 -10
- package/dist/primitives/_internal/react-dismissable-layer.js +0 -103
- package/dist/primitives/_internal/react-focus-guards.js +0 -17
- package/dist/primitives/_internal/react-focus-scope.js +0 -137
- package/dist/primitives/_internal/react-id.js +0 -14
- package/dist/primitives/_internal/react-popper.js +0 -137
- package/dist/primitives/_internal/react-portal.js +0 -16
- package/dist/primitives/_internal/react-presence.js +0 -71
- package/dist/primitives/_internal/react-primitive.js +0 -36
- package/dist/primitives/_internal/react-use-callback-ref.js +0 -13
- package/dist/primitives/_internal/react-use-controllable-state.js +0 -44
- package/dist/primitives/_internal/react-use-escape-keydown.js +0 -14
- package/dist/primitives/_internal/react-use-is-hydrated.js +0 -15
- package/dist/primitives/_internal/react-use-layout-effect.js +0 -6
- package/dist/primitives/_internal/react-use-previous.js +0 -8
- package/dist/primitives/_internal/react-use-size.js +0 -27
- package/dist/primitives/react-accordion.js +0 -239
- package/dist/primitives/react-alert-dialog.js +0 -127
- package/dist/primitives/react-aspect-ratio.js +0 -43
- package/dist/primitives/react-avatar.js +0 -75
- package/dist/primitives/react-checkbox.js +0 -251
- package/dist/primitives/react-collapsible.js +0 -120
- package/dist/primitives/react-context-menu.js +0 -240
- package/dist/primitives/react-dialog.js +0 -262
- package/dist/primitives/react-dropdown-menu.js +0 -227
- package/dist/primitives/react-hover-card.js +0 -187
- package/dist/primitives/react-label.js +0 -20
- package/dist/primitives/react-menu.js +0 -652
- package/dist/primitives/react-menubar.js +0 -355
- package/dist/primitives/react-navigation-menu.js +0 -607
- package/dist/primitives/react-popover.js +0 -243
- package/dist/primitives/react-progress.js +0 -84
- package/dist/primitives/react-radio-group.js +0 -238
- package/dist/primitives/react-roving-focus.js +0 -183
- package/dist/primitives/react-select.js +0 -862
- package/dist/primitives/react-separator.js +0 -24
- package/dist/primitives/react-slider.js +0 -437
- package/dist/primitives/react-slot.js +0 -70
- package/dist/primitives/react-switch.js +0 -132
- package/dist/primitives/react-tabs.js +0 -163
- package/dist/primitives/react-toast.js +0 -446
- package/dist/primitives/react-toggle-group.js +0 -137
- package/dist/primitives/react-toggle.js +0 -33
- package/dist/primitives/react-tooltip.js +0 -338
- package/dist/primitives/react-visually-hidden.js +0 -32
- package/dist/ui/charts/_internal/animation.js +0 -18
- package/dist/ui/charts/_internal/axes.js +0 -42
- package/dist/ui/charts/_internal/colors.js +0 -21
- package/dist/ui/charts/_internal/grid-lines.js +0 -43
- package/dist/ui/charts/_internal/legend.js +0 -29
- package/dist/ui/charts/_internal/tooltip.js +0 -39
- package/dist/ui/charts/_internal/types.js +0 -10
- package/dist/ui/charts/area-chart.js +0 -245
- package/dist/ui/charts/bar-chart.js +0 -153
- package/dist/ui/charts/chart-container.js +0 -27
- package/dist/ui/charts/gauge-chart.js +0 -72
- package/dist/ui/charts/line-chart.js +0 -163
- package/dist/ui/charts/pie-chart.js +0 -132
- package/dist/ui/charts/radar-chart.js +0 -223
- package/dist/ui/charts/sparkline.js +0 -124
- package/dist/ui/lib/motion.js +0 -32
- package/dist/ui/lib/use-reduced-motion.js +0 -15
- package/dist/ui/lib/use-ripple.js +0 -14
- package/dist/ui/tree-view/tree-item.js +0 -139
- package/dist/ui/tree-view/tree-view.js +0 -140
- package/dist/ui/tree-view/use-tree.js +0 -38
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
-
import { useState as d, useCallback as r } from "react";
|
|
4
|
-
import { cn as a } from "../../lib/utils.js";
|
|
5
|
-
function u({ state: t, className: o }) {
|
|
6
|
-
return t.visible ? /* @__PURE__ */ p(
|
|
7
|
-
"div",
|
|
8
|
-
{
|
|
9
|
-
className: a(
|
|
10
|
-
"pointer-events-none absolute z-tooltip",
|
|
11
|
-
"rounded-ds-md border border-border",
|
|
12
|
-
"bg-layer-01 px-ds-03 py-ds-02",
|
|
13
|
-
"shadow-02",
|
|
14
|
-
"text-ds-sm text-text-primary",
|
|
15
|
-
o
|
|
16
|
-
),
|
|
17
|
-
style: { left: t.x + 12, top: t.y - 12 },
|
|
18
|
-
children: t.content
|
|
19
|
-
}
|
|
20
|
-
) : null;
|
|
21
|
-
}
|
|
22
|
-
u.displayName = "ChartTooltip";
|
|
23
|
-
function f() {
|
|
24
|
-
const [t, o] = d({
|
|
25
|
-
visible: !1,
|
|
26
|
-
x: 0,
|
|
27
|
-
y: 0,
|
|
28
|
-
content: null
|
|
29
|
-
}), i = r((e, s, n) => {
|
|
30
|
-
o({ visible: !0, x: e, y: s, content: n });
|
|
31
|
-
}, []), l = r(() => {
|
|
32
|
-
o((e) => ({ ...e, visible: !1 }));
|
|
33
|
-
}, []);
|
|
34
|
-
return { tooltip: t, show: i, hide: l };
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
u as ChartTooltip,
|
|
38
|
-
f as useChartTooltip
|
|
39
|
-
};
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as f, jsx as r, Fragment as S } from "react/jsx-runtime";
|
|
3
|
-
import * as oe from "react";
|
|
4
|
-
import { stack as ne, stackOrderNone as re, stackOffsetNone as ae, area as _, curveMonotoneX as le, curveLinear as ce, line as z } from "d3-shape";
|
|
5
|
-
import { scaleLinear as B, scalePoint as se } from "d3-scale";
|
|
6
|
-
import { cn as ie } from "../lib/utils.js";
|
|
7
|
-
import { ChartContainer as me } from "./chart-container.js";
|
|
8
|
-
import { Axis as I } from "./_internal/axes.js";
|
|
9
|
-
import { GridLines as O } from "./_internal/grid-lines.js";
|
|
10
|
-
import { Legend as ue } from "./_internal/legend.js";
|
|
11
|
-
import { useChartTooltip as pe, ChartTooltip as fe } from "./_internal/tooltip.js";
|
|
12
|
-
import { resolveColor as de } from "./_internal/colors.js";
|
|
13
|
-
import { useReducedMotion as he } from "./_internal/animation.js";
|
|
14
|
-
function ye({
|
|
15
|
-
data: m,
|
|
16
|
-
xKey: h,
|
|
17
|
-
series: c,
|
|
18
|
-
curved: V = !1,
|
|
19
|
-
stacked: G = !1,
|
|
20
|
-
fillOpacity: b = 0.3,
|
|
21
|
-
gradient: k = !1,
|
|
22
|
-
strokeWidth: X = 2,
|
|
23
|
-
height: F = 300,
|
|
24
|
-
showGrid: A = !0,
|
|
25
|
-
showTooltip: M = !0,
|
|
26
|
-
showLegend: Y = !1,
|
|
27
|
-
animate: ge = !0,
|
|
28
|
-
xLabel: Z,
|
|
29
|
-
yLabel: q,
|
|
30
|
-
className: E
|
|
31
|
-
}) {
|
|
32
|
-
const { tooltip: J, show: Q, hide: U } = pe();
|
|
33
|
-
he();
|
|
34
|
-
const y = c.map((d, u) => de(d.color, u)), C = oe.useId();
|
|
35
|
-
return /* @__PURE__ */ f("div", { className: ie("relative", E), children: [
|
|
36
|
-
/* @__PURE__ */ r(me, { height: F, children: ({ width: d, height: u, margin: ke }) => {
|
|
37
|
-
const L = m.map((e) => e[h]), W = L.every((e) => typeof e == "number");
|
|
38
|
-
let $, v, x;
|
|
39
|
-
if (W) {
|
|
40
|
-
const e = L, t = Math.min(...e), a = Math.max(...e), s = B().domain([t, a]).range([0, d]);
|
|
41
|
-
$ = s, v = (i) => s(Number(i[h])), x = (i) => s(Number(m[i][h]));
|
|
42
|
-
} else {
|
|
43
|
-
const e = L.map(String), t = se().domain(e).range([0, d]).padding(0.5);
|
|
44
|
-
$ = t, v = (a) => t(String(a[h])) ?? 0, x = (a) => t(String(m[a][h])) ?? 0;
|
|
45
|
-
}
|
|
46
|
-
let D;
|
|
47
|
-
G ? D = Math.max(
|
|
48
|
-
...m.map(
|
|
49
|
-
(e) => c.reduce((t, a) => t + (Number(e[a.key]) || 0), 0)
|
|
50
|
-
)
|
|
51
|
-
) : D = Math.max(
|
|
52
|
-
...m.flatMap(
|
|
53
|
-
(e) => c.map((t) => Number(e[t.key]) || 0)
|
|
54
|
-
)
|
|
55
|
-
);
|
|
56
|
-
const g = B().domain([0, D * 1.1]).range([u, 0]).nice(), N = V ? le : ce, j = () => m.map((e, t) => {
|
|
57
|
-
const a = v(e), s = d / Math.max(m.length - 1, 1);
|
|
58
|
-
return /* @__PURE__ */ r(
|
|
59
|
-
"rect",
|
|
60
|
-
{
|
|
61
|
-
x: a - s / 2,
|
|
62
|
-
y: 0,
|
|
63
|
-
width: s,
|
|
64
|
-
height: u,
|
|
65
|
-
fill: "transparent",
|
|
66
|
-
onMouseMove: (i) => {
|
|
67
|
-
var o;
|
|
68
|
-
const p = (o = i.currentTarget.closest("div")) == null ? void 0 : o.getBoundingClientRect();
|
|
69
|
-
Q(
|
|
70
|
-
i.clientX - ((p == null ? void 0 : p.left) ?? 0),
|
|
71
|
-
i.clientY - ((p == null ? void 0 : p.top) ?? 0),
|
|
72
|
-
/* @__PURE__ */ f("div", { children: [
|
|
73
|
-
/* @__PURE__ */ r("div", { className: "font-medium", children: String(e[h]) }),
|
|
74
|
-
c.map((l, n) => /* @__PURE__ */ f(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
className: "flex items-center gap-ds-02",
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ r(
|
|
80
|
-
"span",
|
|
81
|
-
{
|
|
82
|
-
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
83
|
-
style: { backgroundColor: y[n] }
|
|
84
|
-
}
|
|
85
|
-
),
|
|
86
|
-
/* @__PURE__ */ f("span", { className: "text-text-secondary", children: [
|
|
87
|
-
l.label,
|
|
88
|
-
":"
|
|
89
|
-
] }),
|
|
90
|
-
" ",
|
|
91
|
-
Number(e[l.key]).toLocaleString()
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
l.key
|
|
95
|
-
))
|
|
96
|
-
] })
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
onMouseLeave: U
|
|
100
|
-
},
|
|
101
|
-
`hover-${t}`
|
|
102
|
-
);
|
|
103
|
-
}), P = () => k ? /* @__PURE__ */ r("defs", { children: c.map((e, t) => /* @__PURE__ */ f(
|
|
104
|
-
"linearGradient",
|
|
105
|
-
{
|
|
106
|
-
id: `${C}-gradient-${t}`,
|
|
107
|
-
x1: "0",
|
|
108
|
-
y1: "0",
|
|
109
|
-
x2: "0",
|
|
110
|
-
y2: "1",
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ r(
|
|
113
|
-
"stop",
|
|
114
|
-
{
|
|
115
|
-
offset: "0%",
|
|
116
|
-
stopColor: y[t],
|
|
117
|
-
stopOpacity: b
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ r(
|
|
121
|
-
"stop",
|
|
122
|
-
{
|
|
123
|
-
offset: "100%",
|
|
124
|
-
stopColor: y[t],
|
|
125
|
-
stopOpacity: 0.05
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
`grad-${t}`
|
|
131
|
-
)) }) : null, R = () => /* @__PURE__ */ f(S, { children: [
|
|
132
|
-
/* @__PURE__ */ r(
|
|
133
|
-
I,
|
|
134
|
-
{
|
|
135
|
-
scale: $,
|
|
136
|
-
orientation: "bottom",
|
|
137
|
-
transform: `translate(0,${u})`,
|
|
138
|
-
label: Z
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
/* @__PURE__ */ r(I, { scale: g, orientation: "left", label: q })
|
|
142
|
-
] });
|
|
143
|
-
if (G) {
|
|
144
|
-
const e = c.map((o) => o.key), t = ne().keys(e).order(re).offset(ae), a = m.map((o) => {
|
|
145
|
-
const l = { [h]: String(o[h]) };
|
|
146
|
-
for (const n of c)
|
|
147
|
-
l[n.key] = Number(o[n.key]) || 0;
|
|
148
|
-
return l;
|
|
149
|
-
}), s = t(a), i = _().curve(N).x((o, l) => x(l)).y0((o) => g(o[0])).y1((o) => g(o[1])), p = z().curve(N).x((o, l) => x(l)).y((o) => g(o[1]));
|
|
150
|
-
return /* @__PURE__ */ f(S, { children: [
|
|
151
|
-
P(),
|
|
152
|
-
A && /* @__PURE__ */ r(
|
|
153
|
-
O,
|
|
154
|
-
{
|
|
155
|
-
width: d,
|
|
156
|
-
height: u,
|
|
157
|
-
yScale: g,
|
|
158
|
-
horizontal: !0
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
[...s].reverse().map((o, l) => {
|
|
162
|
-
const n = s.length - 1 - l, T = o, K = i(T) ?? "", ee = p(T) ?? "", te = k ? `url(#${C}-gradient-${n})` : y[n];
|
|
163
|
-
return /* @__PURE__ */ f("g", { children: [
|
|
164
|
-
/* @__PURE__ */ r(
|
|
165
|
-
"path",
|
|
166
|
-
{
|
|
167
|
-
d: K,
|
|
168
|
-
fill: te,
|
|
169
|
-
opacity: k ? 1 : b
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
/* @__PURE__ */ r(
|
|
173
|
-
"path",
|
|
174
|
-
{
|
|
175
|
-
d: ee,
|
|
176
|
-
fill: "none",
|
|
177
|
-
stroke: y[n],
|
|
178
|
-
strokeWidth: X,
|
|
179
|
-
strokeLinejoin: "round",
|
|
180
|
-
strokeLinecap: "round"
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
] }, c[n].key);
|
|
184
|
-
}),
|
|
185
|
-
M && j(),
|
|
186
|
-
R()
|
|
187
|
-
] });
|
|
188
|
-
}
|
|
189
|
-
const w = _().curve(N).defined((e) => e != null), H = z().curve(N).defined((e) => e != null);
|
|
190
|
-
return /* @__PURE__ */ f(S, { children: [
|
|
191
|
-
P(),
|
|
192
|
-
A && /* @__PURE__ */ r(
|
|
193
|
-
O,
|
|
194
|
-
{
|
|
195
|
-
width: d,
|
|
196
|
-
height: u,
|
|
197
|
-
yScale: g,
|
|
198
|
-
horizontal: !0
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
[...c].reverse().map((e, t) => {
|
|
202
|
-
const a = c.length - 1 - t, s = w.x((n) => v(n)).y0(u).y1((n) => g(Number(n[e.key]) || 0)), i = H.x((n) => v(n)).y((n) => g(Number(n[e.key]) || 0)), p = s(m) ?? "", o = i(m) ?? "", l = k ? `url(#${C}-gradient-${a})` : y[a];
|
|
203
|
-
return /* @__PURE__ */ f("g", { children: [
|
|
204
|
-
/* @__PURE__ */ r(
|
|
205
|
-
"path",
|
|
206
|
-
{
|
|
207
|
-
d: p,
|
|
208
|
-
fill: l,
|
|
209
|
-
opacity: k ? 1 : b
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ r(
|
|
213
|
-
"path",
|
|
214
|
-
{
|
|
215
|
-
d: o,
|
|
216
|
-
fill: "none",
|
|
217
|
-
stroke: y[a],
|
|
218
|
-
strokeWidth: X,
|
|
219
|
-
strokeLinejoin: "round",
|
|
220
|
-
strokeLinecap: "round"
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] }, e.key);
|
|
224
|
-
}),
|
|
225
|
-
M && j(),
|
|
226
|
-
R()
|
|
227
|
-
] });
|
|
228
|
-
} }),
|
|
229
|
-
M && /* @__PURE__ */ r(fe, { state: J }),
|
|
230
|
-
Y && c.length > 1 && /* @__PURE__ */ r(
|
|
231
|
-
ue,
|
|
232
|
-
{
|
|
233
|
-
items: c.map((d, u) => ({
|
|
234
|
-
label: d.label,
|
|
235
|
-
color: y[u]
|
|
236
|
-
})),
|
|
237
|
-
className: "mt-ds-04"
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
] });
|
|
241
|
-
}
|
|
242
|
-
ye.displayName = "AreaChart";
|
|
243
|
-
export {
|
|
244
|
-
ye as AreaChart
|
|
245
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as v, jsx as r, Fragment as T } from "react/jsx-runtime";
|
|
3
|
-
import { scaleBand as I, scaleLinear as H } from "d3-scale";
|
|
4
|
-
import { cn as k } from "../lib/utils.js";
|
|
5
|
-
import { ChartContainer as L } from "./chart-container.js";
|
|
6
|
-
import { Axis as x } from "./_internal/axes.js";
|
|
7
|
-
import { GridLines as tt } from "./_internal/grid-lines.js";
|
|
8
|
-
import { Legend as at } from "./_internal/legend.js";
|
|
9
|
-
import { useChartTooltip as rt, ChartTooltip as ot } from "./_internal/tooltip.js";
|
|
10
|
-
import { resolveColor as X } from "./_internal/colors.js";
|
|
11
|
-
import { useReducedMotion as nt } from "./_internal/animation.js";
|
|
12
|
-
function it({
|
|
13
|
-
data: g,
|
|
14
|
-
xKey: V,
|
|
15
|
-
yKey: C,
|
|
16
|
-
orientation: Y = "vertical",
|
|
17
|
-
stacked: s = !1,
|
|
18
|
-
grouped: N = !1,
|
|
19
|
-
color: n,
|
|
20
|
-
height: _ = 300,
|
|
21
|
-
showGrid: q = !0,
|
|
22
|
-
showTooltip: z = !0,
|
|
23
|
-
showLegend: D = !1,
|
|
24
|
-
animate: et = !0,
|
|
25
|
-
barRadius: E = 4,
|
|
26
|
-
xLabel: F,
|
|
27
|
-
yLabel: G,
|
|
28
|
-
seriesLabels: f,
|
|
29
|
-
className: J
|
|
30
|
-
}) {
|
|
31
|
-
const { tooltip: P, show: Q, hide: U } = rt();
|
|
32
|
-
nt();
|
|
33
|
-
const i = Y === "vertical", c = Array.isArray(C) ? C : [C], h = c.length > 1, S = h ? c.map(
|
|
34
|
-
(p, a) => X(
|
|
35
|
-
Array.isArray(n) ? n[a] : typeof n == "string" ? n : void 0,
|
|
36
|
-
a
|
|
37
|
-
)
|
|
38
|
-
) : [
|
|
39
|
-
X(
|
|
40
|
-
typeof n == "string" ? n : Array.isArray(n) ? n[0] : void 0,
|
|
41
|
-
0
|
|
42
|
-
)
|
|
43
|
-
];
|
|
44
|
-
return /* @__PURE__ */ v("div", { className: k("relative", J), children: [
|
|
45
|
-
/* @__PURE__ */ r(L, { height: _, children: ({ width: p, height: a, margin: lt }) => {
|
|
46
|
-
const Z = g.map((e) => String(e[V]));
|
|
47
|
-
let A;
|
|
48
|
-
s ? A = Math.max(
|
|
49
|
-
...g.map(
|
|
50
|
-
(e) => c.reduce((l, o) => l + (Number(e[o]) || 0), 0)
|
|
51
|
-
)
|
|
52
|
-
) : A = Math.max(
|
|
53
|
-
...g.flatMap((e) => c.map((l) => Number(e[l]) || 0))
|
|
54
|
-
);
|
|
55
|
-
const u = I().domain(Z).range(i ? [0, p] : [0, a]).padding(0.2), t = H().domain([0, A * 1.1]).range(i ? [a, 0] : [0, p]).nice(), O = u.bandwidth(), y = h && N ? O / c.length : O;
|
|
56
|
-
return /* @__PURE__ */ v(T, { children: [
|
|
57
|
-
q && /* @__PURE__ */ r(
|
|
58
|
-
tt,
|
|
59
|
-
{
|
|
60
|
-
width: p,
|
|
61
|
-
height: a,
|
|
62
|
-
yScale: i ? t : void 0,
|
|
63
|
-
xScale: i ? void 0 : t,
|
|
64
|
-
horizontal: i,
|
|
65
|
-
vertical: !i
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
g.map((e) => {
|
|
69
|
-
const l = String(e[V]);
|
|
70
|
-
let o = 0;
|
|
71
|
-
return c.map((B, M) => {
|
|
72
|
-
const m = Number(e[B]) || 0, K = S[M] || S[0];
|
|
73
|
-
let $, b, j, w;
|
|
74
|
-
return i ? ($ = (u(l) ?? 0) + (N && h ? M * y : 0), b = t(s ? o + m : m), j = y, w = s ? t(o) - t(o + m) : a - t(m)) : ($ = s ? t(o) : 0, b = (u(l) ?? 0) + (N && h ? M * y : 0), j = s ? t(o + m) - t(o) : t(m), w = y), s && (o += m), /* @__PURE__ */ r(
|
|
75
|
-
"rect",
|
|
76
|
-
{
|
|
77
|
-
x: $,
|
|
78
|
-
y: b,
|
|
79
|
-
width: Math.max(0, j),
|
|
80
|
-
height: Math.max(0, w),
|
|
81
|
-
rx: E,
|
|
82
|
-
fill: K,
|
|
83
|
-
className: "transition-opacity hover:opacity-[0.8]",
|
|
84
|
-
onMouseMove: (R) => {
|
|
85
|
-
var W;
|
|
86
|
-
if (z) {
|
|
87
|
-
const d = (W = R.currentTarget.closest("div")) == null ? void 0 : W.getBoundingClientRect();
|
|
88
|
-
Q(
|
|
89
|
-
R.clientX - ((d == null ? void 0 : d.left) ?? 0),
|
|
90
|
-
R.clientY - ((d == null ? void 0 : d.top) ?? 0),
|
|
91
|
-
/* @__PURE__ */ v("div", { children: [
|
|
92
|
-
/* @__PURE__ */ r("div", { className: "font-medium", children: l }),
|
|
93
|
-
h && /* @__PURE__ */ r("div", { className: "text-text-secondary", children: (f == null ? void 0 : f[M]) ?? B }),
|
|
94
|
-
/* @__PURE__ */ r("div", { children: m.toLocaleString() })
|
|
95
|
-
] })
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
onMouseLeave: U
|
|
100
|
-
},
|
|
101
|
-
`${l}-${B}`
|
|
102
|
-
);
|
|
103
|
-
});
|
|
104
|
-
}),
|
|
105
|
-
i ? /* @__PURE__ */ v(T, { children: [
|
|
106
|
-
/* @__PURE__ */ r(
|
|
107
|
-
x,
|
|
108
|
-
{
|
|
109
|
-
scale: u,
|
|
110
|
-
orientation: "bottom",
|
|
111
|
-
transform: `translate(0,${a})`,
|
|
112
|
-
label: F
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ r(x, { scale: t, orientation: "left", label: G })
|
|
116
|
-
] }) : /* @__PURE__ */ v(T, { children: [
|
|
117
|
-
/* @__PURE__ */ r(
|
|
118
|
-
x,
|
|
119
|
-
{
|
|
120
|
-
scale: t,
|
|
121
|
-
orientation: "bottom",
|
|
122
|
-
transform: `translate(0,${a})`,
|
|
123
|
-
label: F
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
/* @__PURE__ */ r(
|
|
127
|
-
x,
|
|
128
|
-
{
|
|
129
|
-
scale: u,
|
|
130
|
-
orientation: "left",
|
|
131
|
-
label: G
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
] })
|
|
135
|
-
] });
|
|
136
|
-
} }),
|
|
137
|
-
z && /* @__PURE__ */ r(ot, { state: P }),
|
|
138
|
-
D && h && /* @__PURE__ */ r(
|
|
139
|
-
at,
|
|
140
|
-
{
|
|
141
|
-
items: c.map((p, a) => ({
|
|
142
|
-
label: (f == null ? void 0 : f[a]) ?? p,
|
|
143
|
-
color: S[a]
|
|
144
|
-
})),
|
|
145
|
-
className: "mt-ds-04"
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
] });
|
|
149
|
-
}
|
|
150
|
-
it.displayName = "BarChart";
|
|
151
|
-
export {
|
|
152
|
-
it as BarChart
|
|
153
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { useRef as u, useState as p, useEffect as g } from "react";
|
|
4
|
-
import { cn as v } from "../lib/utils.js";
|
|
5
|
-
import { DEFAULT_MARGIN as b } from "./_internal/types.js";
|
|
6
|
-
function w({
|
|
7
|
-
height: i = 300,
|
|
8
|
-
margin: s,
|
|
9
|
-
className: c,
|
|
10
|
-
children: m
|
|
11
|
-
}) {
|
|
12
|
-
const e = u(null), [r, f] = p(0), t = { ...b, ...s };
|
|
13
|
-
g(() => {
|
|
14
|
-
if (!e.current) return;
|
|
15
|
-
const o = new ResizeObserver((d) => {
|
|
16
|
-
const a = d[0];
|
|
17
|
-
a && f(a.contentRect.width);
|
|
18
|
-
});
|
|
19
|
-
return o.observe(e.current), () => o.disconnect();
|
|
20
|
-
}, []);
|
|
21
|
-
const l = Math.max(0, r - t.left - t.right), h = Math.max(0, i - t.top - t.bottom);
|
|
22
|
-
return /* @__PURE__ */ n("div", { ref: e, className: v("relative w-full", c), children: r > 0 && /* @__PURE__ */ n("svg", { width: r, height: i, role: "img", "aria-label": "Chart", children: /* @__PURE__ */ n("g", { transform: `translate(${t.left},${t.top})`, children: m({ width: l, height: h, margin: t }) }) }) });
|
|
23
|
-
}
|
|
24
|
-
w.displayName = "ChartContainer";
|
|
25
|
-
export {
|
|
26
|
-
w as ChartContainer
|
|
27
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e, jsxs as w } from "react/jsx-runtime";
|
|
3
|
-
import { arc as f } from "d3-shape";
|
|
4
|
-
import { cn as B } from "../lib/utils.js";
|
|
5
|
-
import { resolveColor as V } from "./_internal/colors.js";
|
|
6
|
-
import { useReducedMotion as z, getTransitionDuration as D } from "./_internal/animation.js";
|
|
7
|
-
const d = (c) => c * Math.PI / 180;
|
|
8
|
-
function E({
|
|
9
|
-
value: c,
|
|
10
|
-
max: o = 100,
|
|
11
|
-
min: r = 0,
|
|
12
|
-
label: a,
|
|
13
|
-
valueLabel: n,
|
|
14
|
-
color: x,
|
|
15
|
-
trackColor: p = "var(--color-border-subtle)",
|
|
16
|
-
height: g = 200,
|
|
17
|
-
startAngle: i = -120,
|
|
18
|
-
endAngle: m = 120,
|
|
19
|
-
thickness: s = 16,
|
|
20
|
-
animate: v = !0,
|
|
21
|
-
className: y
|
|
22
|
-
}) {
|
|
23
|
-
const R = z(), h = D(R, v ? 600 : 0), G = V(x, 0), u = g, t = u / 2, l = Math.min(Math.max(c, r), o), M = o === r ? 0 : (l - r) / (o - r), C = i + (m - i) * M, N = typeof n == "function" ? n(l) : typeof n == "string" ? n : String(l), A = f().innerRadius(t - s).outerRadius(t).startAngle(d(i)).endAngle(d(m)).cornerRadius(s / 2), P = f().innerRadius(t - s).outerRadius(t).startAngle(d(i)).endAngle(d(C)).cornerRadius(s / 2), $ = A(null) ?? "", j = P(null) ?? "";
|
|
24
|
-
return /* @__PURE__ */ e(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
className: B("inline-flex flex-col items-center", y),
|
|
28
|
-
role: "meter",
|
|
29
|
-
"aria-valuenow": l,
|
|
30
|
-
"aria-valuemin": r,
|
|
31
|
-
"aria-valuemax": o,
|
|
32
|
-
"aria-label": a ?? "Gauge chart",
|
|
33
|
-
children: /* @__PURE__ */ e("svg", { width: u, height: u, role: "img", "aria-hidden": "true", children: /* @__PURE__ */ w("g", { transform: `translate(${t},${t})`, children: [
|
|
34
|
-
/* @__PURE__ */ e("path", { d: $, fill: p }),
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
"path",
|
|
37
|
-
{
|
|
38
|
-
d: j,
|
|
39
|
-
fill: G,
|
|
40
|
-
style: h > 0 ? { transition: `d ${h}ms ease-out` } : void 0
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
"text",
|
|
45
|
-
{
|
|
46
|
-
x: 0,
|
|
47
|
-
y: a ? -4 : 0,
|
|
48
|
-
textAnchor: "middle",
|
|
49
|
-
dominantBaseline: "central",
|
|
50
|
-
className: "fill-text-primary text-ds-2xl font-semibold",
|
|
51
|
-
children: N
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
a && /* @__PURE__ */ e(
|
|
55
|
-
"text",
|
|
56
|
-
{
|
|
57
|
-
x: 0,
|
|
58
|
-
y: 20,
|
|
59
|
-
textAnchor: "middle",
|
|
60
|
-
dominantBaseline: "central",
|
|
61
|
-
className: "fill-text-secondary text-ds-xs",
|
|
62
|
-
children: a
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
] }) })
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
E.displayName = "GaugeChart";
|
|
70
|
-
export {
|
|
71
|
-
E as GaugeChart
|
|
72
|
-
};
|