@orion-ds/react 5.0.1 → 5.1.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/client.cjs +1 -1
- package/dist/client.mjs +143 -139
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.mjs +105 -86
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.d.ts +2 -3
- package/dist/components/Chart/Chart.d.ts.map +1 -1
- package/dist/components/Chart/Chart.mjs +124 -71
- package/dist/components/Chat/components/ChatMarkdown.cjs +1 -1
- package/dist/components/Chat/components/ChatMarkdown.d.ts.map +1 -1
- package/dist/components/Chat/components/ChatMarkdown.mjs +32 -17
- package/dist/components/CodeEditor/CodeEditor.cjs +6 -6
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.mjs +118 -99
- package/dist/components/CollapsibleFolder/CollapsibleFolder.cjs +1 -1
- package/dist/components/CollapsibleFolder/CollapsibleFolder.d.ts.map +1 -1
- package/dist/components/CollapsibleFolder/CollapsibleFolder.mjs +123 -105
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +70 -52
- package/dist/components/MissingDependencyError.cjs +1 -0
- package/dist/components/MissingDependencyError.d.ts +5 -0
- package/dist/components/MissingDependencyError.d.ts.map +1 -0
- package/dist/components/MissingDependencyError.mjs +140 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +143 -139
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/optionalDeps.cjs +1 -0
- package/dist/utils/optionalDeps.d.ts +63 -0
- package/dist/utils/optionalDeps.d.ts.map +1 -0
- package/dist/utils/optionalDeps.mjs +55 -0
- package/package.json +1 -1
|
@@ -1,135 +1,154 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as O, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useMemo as w, useCallback as M, useId as X } from "react";
|
|
3
|
+
import { ChevronLeft as Z, ChevronRight as $ } from "lucide-react";
|
|
4
|
+
import { MissingDependencyError as p } from "../MissingDependencyError.mjs";
|
|
5
5
|
import o from "./Calendar.module.css.mjs";
|
|
6
6
|
import { Button as I } from "../Button/Button.mjs";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
7
|
+
let h, A, T, W, B, L, j, l, b, v, S, D, y, z = null;
|
|
8
|
+
try {
|
|
9
|
+
const e = require("date-fns");
|
|
10
|
+
h = e.startOfMonth, A = e.endOfMonth, T = e.startOfWeek, W = e.endOfWeek, B = e.eachDayOfInterval, L = e.addMonths, j = e.subMonths, l = e.isSameDay, b = e.isSameMonth, v = e.isToday, S = e.isBefore, D = e.isAfter, y = e.format;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
z = e instanceof Error ? e : new Error("date-fns not found");
|
|
11
13
|
}
|
|
12
|
-
const ee =
|
|
14
|
+
const ee = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
15
|
+
function te(e, r) {
|
|
16
|
+
const c = e.length, d = (r % c + c) % c;
|
|
17
|
+
return [...e.slice(d), ...e.slice(0, d)];
|
|
18
|
+
}
|
|
19
|
+
const ne = (e) => {
|
|
20
|
+
if (z)
|
|
21
|
+
return /* @__PURE__ */ i(
|
|
22
|
+
p,
|
|
23
|
+
{
|
|
24
|
+
available: !1,
|
|
25
|
+
componentName: "Calendar",
|
|
26
|
+
depName: "date-fns",
|
|
27
|
+
installCommand: "npm install date-fns",
|
|
28
|
+
pnpmCommand: "pnpm add date-fns",
|
|
29
|
+
docsUrl: "https://docs.orion-ds.dev/components/calendar"
|
|
30
|
+
}
|
|
31
|
+
);
|
|
13
32
|
const {
|
|
14
33
|
mode: r = "single",
|
|
15
|
-
min:
|
|
16
|
-
max:
|
|
17
|
-
disabled:
|
|
18
|
-
weekStartsOn:
|
|
19
|
-
showOutsideDays:
|
|
20
|
-
className:
|
|
21
|
-
...
|
|
22
|
-
} =
|
|
23
|
-
selected:
|
|
24
|
-
onSelect:
|
|
25
|
-
...
|
|
26
|
-
} =
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
}, [
|
|
30
|
-
() =>
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
(
|
|
34
|
-
[
|
|
35
|
-
),
|
|
36
|
-
(
|
|
37
|
-
[r,
|
|
38
|
-
),
|
|
39
|
-
(
|
|
40
|
-
if (r !== "range" ||
|
|
34
|
+
min: c,
|
|
35
|
+
max: d,
|
|
36
|
+
disabled: m,
|
|
37
|
+
weekStartsOn: u = 0,
|
|
38
|
+
showOutsideDays: _ = !0,
|
|
39
|
+
className: F,
|
|
40
|
+
...P
|
|
41
|
+
} = e, {
|
|
42
|
+
selected: oe,
|
|
43
|
+
onSelect: le,
|
|
44
|
+
...H
|
|
45
|
+
} = P, [f, E] = V(() => r === "single" && e.mode !== "range" && e.mode !== "multiple" && e.selected ? h(e.selected) : r === "range" && e.mode === "range" && e.selected?.from ? h(e.selected.from) : h(/* @__PURE__ */ new Date())), R = w(() => {
|
|
46
|
+
const t = h(f), n = A(f), s = T(t, { weekStartsOn: u }), a = W(n, { weekStartsOn: u });
|
|
47
|
+
return B({ start: s, end: a });
|
|
48
|
+
}, [f, u]), q = w(
|
|
49
|
+
() => te(ee, u),
|
|
50
|
+
[u]
|
|
51
|
+
), g = M(
|
|
52
|
+
(t) => c && S(t, re(c)) || d && D(t, se(d)) ? !0 : m ? Array.isArray(m) ? m.some((n) => l(n, t)) : m(t) : !1,
|
|
53
|
+
[c, d, m]
|
|
54
|
+
), C = M(
|
|
55
|
+
(t) => r === "single" && e.mode !== "range" && e.mode !== "multiple" ? e.selected ? l(e.selected, t) : !1 : r === "multiple" && e.mode === "multiple" ? e.selected?.some((n) => l(n, t)) ?? !1 : !1,
|
|
56
|
+
[r, e]
|
|
57
|
+
), N = M(
|
|
58
|
+
(t) => {
|
|
59
|
+
if (r !== "range" || e.mode !== "range" || !e.selected)
|
|
41
60
|
return null;
|
|
42
|
-
const { from: n, to: s } =
|
|
43
|
-
return n ? s ?
|
|
61
|
+
const { from: n, to: s } = e.selected;
|
|
62
|
+
return n ? s ? l(t, n) && l(t, s) || l(t, n) ? "start" : l(t, s) ? "end" : D(t, n) && S(t, s) ? "middle" : null : l(t, n) ? "start" : null : null;
|
|
44
63
|
},
|
|
45
|
-
[r,
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
if (!
|
|
49
|
-
if (r === "single" &&
|
|
50
|
-
const n =
|
|
51
|
-
n?.(
|
|
52
|
-
} else if (r === "range" &&
|
|
53
|
-
const n =
|
|
54
|
-
!s?.from || s.from && s.to ? n?.({ from:
|
|
55
|
-
} else if (r === "multiple" &&
|
|
56
|
-
const n =
|
|
57
|
-
|
|
64
|
+
[r, e]
|
|
65
|
+
), K = M(
|
|
66
|
+
(t) => {
|
|
67
|
+
if (!g(t)) {
|
|
68
|
+
if (r === "single" && e.mode !== "range" && e.mode !== "multiple") {
|
|
69
|
+
const n = e.onSelect;
|
|
70
|
+
n?.(t);
|
|
71
|
+
} else if (r === "range" && e.mode === "range") {
|
|
72
|
+
const n = e.onSelect, s = e.selected;
|
|
73
|
+
!s?.from || s.from && s.to ? n?.({ from: t, to: void 0 }) : S(t, s.from) ? n?.({ from: t, to: s.from }) : n?.({ from: s.from, to: t });
|
|
74
|
+
} else if (r === "multiple" && e.mode === "multiple") {
|
|
75
|
+
const n = e.onSelect, s = e.selected ?? [], a = s.findIndex((x) => l(x, t));
|
|
76
|
+
a >= 0 ? n?.(s.filter((x, Q) => Q !== a)) : n?.([...s, t]);
|
|
58
77
|
}
|
|
59
78
|
}
|
|
60
79
|
},
|
|
61
|
-
[r,
|
|
62
|
-
),
|
|
80
|
+
[r, e, g]
|
|
81
|
+
), U = () => E((t) => j(t, 1)), Y = () => E((t) => L(t, 1)), G = (t) => {
|
|
63
82
|
const n = [o.day];
|
|
64
|
-
if (!
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
} else
|
|
83
|
+
if (!b(t, f) && n.push(o.outside), v(t) && n.push(o.today), g(t) && n.push(o.disabled), r === "range") {
|
|
84
|
+
const a = N(t);
|
|
85
|
+
a === "start" && (n.push(o.rangeStart), e.mode === "range" && e.selected?.from && e.selected?.to && l(e.selected.from, e.selected.to) && n.push(o.rangeEnd)), a === "middle" && n.push(o.rangeMiddle), a === "end" && n.push(o.rangeEnd);
|
|
86
|
+
} else C(t) && n.push(o.selected);
|
|
68
87
|
return n.join(" ");
|
|
69
|
-
},
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
88
|
+
}, J = [o.calendar, F].filter(Boolean).join(" "), k = X();
|
|
89
|
+
return /* @__PURE__ */ O("div", { className: J, ...H, children: [
|
|
90
|
+
/* @__PURE__ */ O("div", { className: o.header, children: [
|
|
91
|
+
/* @__PURE__ */ i(
|
|
73
92
|
I,
|
|
74
93
|
{
|
|
75
94
|
variant: "ghost",
|
|
76
95
|
iconOnly: !0,
|
|
77
96
|
size: "sm",
|
|
78
|
-
icon: /* @__PURE__ */
|
|
79
|
-
onClick:
|
|
97
|
+
icon: /* @__PURE__ */ i(Z, { size: 16 }),
|
|
98
|
+
onClick: U,
|
|
80
99
|
"aria-label": "Previous month"
|
|
81
100
|
}
|
|
82
101
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ i("span", { id: k, className: o.monthLabel, children: y(f, "MMMM yyyy") }),
|
|
103
|
+
/* @__PURE__ */ i(
|
|
85
104
|
I,
|
|
86
105
|
{
|
|
87
106
|
variant: "ghost",
|
|
88
107
|
iconOnly: !0,
|
|
89
108
|
size: "sm",
|
|
90
|
-
icon: /* @__PURE__ */
|
|
91
|
-
onClick:
|
|
109
|
+
icon: /* @__PURE__ */ i($, { size: 16 }),
|
|
110
|
+
onClick: Y,
|
|
92
111
|
"aria-label": "Next month"
|
|
93
112
|
}
|
|
94
113
|
)
|
|
95
114
|
] }),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
115
|
+
/* @__PURE__ */ O("div", { className: o.grid, role: "grid", "aria-labelledby": k, children: [
|
|
116
|
+
q.map((t) => /* @__PURE__ */ i(
|
|
98
117
|
"div",
|
|
99
118
|
{
|
|
100
119
|
className: o.weekday,
|
|
101
120
|
role: "columnheader",
|
|
102
|
-
"aria-label":
|
|
103
|
-
children:
|
|
121
|
+
"aria-label": t,
|
|
122
|
+
children: t
|
|
104
123
|
},
|
|
105
|
-
|
|
124
|
+
t
|
|
106
125
|
)),
|
|
107
|
-
|
|
126
|
+
R.map((t) => !b(t, f) && !_ ? /* @__PURE__ */ i("div", {}, t.toISOString()) : /* @__PURE__ */ i(
|
|
108
127
|
"button",
|
|
109
128
|
{
|
|
110
129
|
type: "button",
|
|
111
|
-
className:
|
|
112
|
-
onClick: () =>
|
|
113
|
-
disabled:
|
|
114
|
-
tabIndex:
|
|
115
|
-
"aria-label":
|
|
116
|
-
"aria-selected":
|
|
117
|
-
children:
|
|
130
|
+
className: G(t),
|
|
131
|
+
onClick: () => K(t),
|
|
132
|
+
disabled: g(t),
|
|
133
|
+
tabIndex: v(t) ? 0 : -1,
|
|
134
|
+
"aria-label": y(t, "EEEE, MMMM d, yyyy"),
|
|
135
|
+
"aria-selected": C(t) || N(t) !== null,
|
|
136
|
+
children: y(t, "d")
|
|
118
137
|
},
|
|
119
|
-
|
|
138
|
+
t.toISOString()
|
|
120
139
|
))
|
|
121
140
|
] })
|
|
122
141
|
] });
|
|
123
142
|
};
|
|
124
|
-
|
|
125
|
-
function
|
|
126
|
-
const r = new Date(
|
|
143
|
+
ne.displayName = "Calendar";
|
|
144
|
+
function re(e) {
|
|
145
|
+
const r = new Date(e);
|
|
127
146
|
return r.setHours(0, 0, 0, 0), r;
|
|
128
147
|
}
|
|
129
|
-
function
|
|
130
|
-
const r = new Date(
|
|
148
|
+
function se(e) {
|
|
149
|
+
const r = new Date(e);
|
|
131
150
|
return r.setHours(23, 59, 59, 999), r;
|
|
132
151
|
}
|
|
133
152
|
export {
|
|
134
|
-
|
|
153
|
+
ne as Calendar
|
|
135
154
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),S=require("./useResolvedChartColors.cjs"),h=require("../MissingDependencyError.cjs"),n=require("./Chart.module.css.cjs");let j,N,y,p=null;try{const t=require("recharts");j=t.ResponsiveContainer,N=t.Tooltip,y=t.Legend}catch(t){p=t instanceof Error?t:new Error("recharts not found")}const f=u.createContext({}),b=({config:t,children:o,className:s,style:a,...r})=>{if(p)return e.jsx(h.MissingDependencyError,{available:!1,componentName:"Chart",depName:"recharts",installCommand:"npm install recharts",pnpmCommand:"pnpm add recharts",docsUrl:"https://docs.orion-ds.dev/components/chart"});const{resolvedConfig:l,resolvedColorVars:i}=S.useResolvedChartColors(t),d=[n.default.container,s].filter(Boolean).join(" ");return e.jsx(f.Provider,{value:l,children:e.jsx("div",{role:"figure",className:d,style:{...i,...a},...r,children:e.jsx(j,{width:"100%",height:"100%",children:o})})})};b.displayName="ChartContainer";const L=({active:t,payload:o,label:s,indicator:a="dot",hideLabel:r=!1,hideIndicator:l=!1,labelFormatter:i,formatter:d,className:C})=>{if(p)return e.jsx(h.MissingDependencyError,{available:!1,componentName:"Chart",depName:"recharts",installCommand:"npm install recharts",pnpmCommand:"pnpm add recharts",docsUrl:"https://docs.orion-ds.dev/components/chart"});const T=u.useContext(f);if(!t||!o?.length)return null;const R=[n.default.tooltip,C].filter(Boolean).join(" "),g=i?i(String(s)):s,q={dot:n.default.tooltipDot,line:n.default.tooltipLine,dashed:n.default.tooltipDashed}[a];return e.jsxs("div",{className:R,children:[!r&&g&&e.jsx("div",{className:n.default.tooltipLabel,children:g}),e.jsx("div",{className:n.default.tooltipItems,children:o.map(c=>{const m=String(c.dataKey||c.name),x=T[m],M=x?.label||m,I=d?d(c.value,m):String(c.value),v=c.color||x?.color;return e.jsxs("div",{className:n.default.tooltipItem,children:[!l&&e.jsx("span",{className:q,style:{backgroundColor:v,borderColor:v}}),e.jsx("span",{className:n.default.tooltipName,children:M}),e.jsx("span",{className:n.default.tooltipValue,children:I})]},m)})})]})};L.displayName="ChartTooltipContent";const D=({payload:t,className:o})=>{if(p)return e.jsx(h.MissingDependencyError,{available:!1,componentName:"Chart",depName:"recharts",installCommand:"npm install recharts",pnpmCommand:"pnpm add recharts",docsUrl:"https://docs.orion-ds.dev/components/chart"});const s=u.useContext(f);if(!t?.length)return null;const a=[n.default.legend,o].filter(Boolean).join(" ");return e.jsx("div",{className:a,children:t.map(r=>{const l=r.dataKey||r.value,i=s[l],d=i?.label||l,C=r.color||i?.color;return e.jsxs("div",{className:n.default.legendItem,children:[e.jsx("span",{className:n.default.legendDot,style:{backgroundColor:C}}),e.jsx("span",{children:d})]},l)})})};D.displayName="ChartLegendContent";const E=({id:t,color:o,startOpacity:s=.4,endOpacity:a=.05})=>p?e.jsx(h.MissingDependencyError,{available:!1,componentName:"Chart",depName:"recharts",installCommand:"npm install recharts",pnpmCommand:"pnpm add recharts",docsUrl:"https://docs.orion-ds.dev/components/chart"}):e.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:o,stopOpacity:s}),e.jsx("stop",{offset:"95%",stopColor:o,stopOpacity:a})]});E.displayName="ChartGradient";const G=N||null,K=y||null;exports.ChartContainer=b;exports.ChartGradient=E;exports.ChartLegend=K;exports.ChartLegendContent=D;exports.ChartTooltip=G;exports.ChartTooltipContent=L;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { Tooltip, Legend } from 'recharts';
|
|
3
2
|
import { ChartContainerProps, ChartTooltipContentProps, ChartLegendContentProps, ChartGradientProps } from './Chart.types';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -30,6 +29,6 @@ export declare const ChartLegendContent: React.FC<ChartLegendContentProps>;
|
|
|
30
29
|
* ```
|
|
31
30
|
*/
|
|
32
31
|
export declare const ChartGradient: React.FC<ChartGradientProps>;
|
|
33
|
-
export declare const ChartTooltip:
|
|
34
|
-
export declare const ChartLegend:
|
|
32
|
+
export declare const ChartTooltip: any;
|
|
33
|
+
export declare const ChartLegend: any;
|
|
35
34
|
//# sourceMappingURL=Chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/Chart.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../src/components/Chart/Chart.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AAgBzD,OAAO,KAAK,EAEV,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAQvB;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0CxD,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAsElE,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA4ChE,CAAC;AAIF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0BtD,CAAC;AAMF,eAAO,MAAM,YAAY,KAAkB,CAAC;AAC5C,eAAO,MAAM,WAAW,KAAiB,CAAC"}
|
|
@@ -1,103 +1,156 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as y, createContext as K } from "react";
|
|
3
|
+
import { useResolvedChartColors as R } from "./useResolvedChartColors.mjs";
|
|
4
|
+
import { MissingDependencyError as C } from "../MissingDependencyError.mjs";
|
|
5
5
|
import o from "./Chart.module.css.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
let b, L, x, p = null;
|
|
7
|
+
try {
|
|
8
|
+
const t = require("recharts");
|
|
9
|
+
b = t.ResponsiveContainer, L = t.Tooltip, x = t.Legend;
|
|
10
|
+
} catch (t) {
|
|
11
|
+
p = t instanceof Error ? t : new Error("recharts not found");
|
|
12
|
+
}
|
|
13
|
+
const u = K({}), U = ({
|
|
14
|
+
config: t,
|
|
15
|
+
children: n,
|
|
16
|
+
className: a,
|
|
17
|
+
style: r,
|
|
18
|
+
...s
|
|
12
19
|
}) => {
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
if (p)
|
|
21
|
+
return /* @__PURE__ */ e(
|
|
22
|
+
C,
|
|
23
|
+
{
|
|
24
|
+
available: !1,
|
|
25
|
+
componentName: "Chart",
|
|
26
|
+
depName: "recharts",
|
|
27
|
+
installCommand: "npm install recharts",
|
|
28
|
+
pnpmCommand: "pnpm add recharts",
|
|
29
|
+
docsUrl: "https://docs.orion-ds.dev/components/chart"
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
const { resolvedConfig: l, resolvedColorVars: i } = R(t), c = [o.container, a].filter(Boolean).join(" ");
|
|
33
|
+
return /* @__PURE__ */ e(u.Provider, { value: l, children: /* @__PURE__ */ e(
|
|
15
34
|
"div",
|
|
16
35
|
{
|
|
17
36
|
role: "figure",
|
|
18
37
|
className: c,
|
|
19
|
-
style: { ...
|
|
20
|
-
...
|
|
21
|
-
children: /* @__PURE__ */
|
|
38
|
+
style: { ...i, ...r },
|
|
39
|
+
...s,
|
|
40
|
+
children: /* @__PURE__ */ e(b, { width: "100%", height: "100%", children: n })
|
|
22
41
|
}
|
|
23
42
|
) });
|
|
24
43
|
};
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
active:
|
|
28
|
-
payload:
|
|
29
|
-
label:
|
|
30
|
-
indicator:
|
|
31
|
-
hideLabel:
|
|
32
|
-
hideIndicator:
|
|
33
|
-
labelFormatter:
|
|
44
|
+
U.displayName = "ChartContainer";
|
|
45
|
+
const B = ({
|
|
46
|
+
active: t,
|
|
47
|
+
payload: n,
|
|
48
|
+
label: a,
|
|
49
|
+
indicator: r = "dot",
|
|
50
|
+
hideLabel: s = !1,
|
|
51
|
+
hideIndicator: l = !1,
|
|
52
|
+
labelFormatter: i,
|
|
34
53
|
formatter: c,
|
|
35
|
-
className:
|
|
54
|
+
className: f
|
|
36
55
|
}) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
if (p)
|
|
57
|
+
return /* @__PURE__ */ e(
|
|
58
|
+
C,
|
|
59
|
+
{
|
|
60
|
+
available: !1,
|
|
61
|
+
componentName: "Chart",
|
|
62
|
+
depName: "recharts",
|
|
63
|
+
installCommand: "npm install recharts",
|
|
64
|
+
pnpmCommand: "pnpm add recharts",
|
|
65
|
+
docsUrl: "https://docs.orion-ds.dev/components/chart"
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
const j = y(u);
|
|
69
|
+
if (!t || !n?.length) return null;
|
|
70
|
+
const I = [o.tooltip, f].filter(Boolean).join(" "), v = i ? i(String(a)) : a, T = {
|
|
40
71
|
dot: o.tooltipDot,
|
|
41
72
|
line: o.tooltipLine,
|
|
42
73
|
dashed: o.tooltipDashed
|
|
43
|
-
}[
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
!
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
!
|
|
74
|
+
}[r];
|
|
75
|
+
return /* @__PURE__ */ h("div", { className: I, children: [
|
|
76
|
+
!s && v && /* @__PURE__ */ e("div", { className: o.tooltipLabel, children: v }),
|
|
77
|
+
/* @__PURE__ */ e("div", { className: o.tooltipItems, children: n.map((d) => {
|
|
78
|
+
const m = String(d.dataKey || d.name), g = j[m], D = g?.label || m, E = c ? c(d.value, m) : String(d.value), N = d.color || g?.color;
|
|
79
|
+
return /* @__PURE__ */ h("div", { className: o.tooltipItem, children: [
|
|
80
|
+
!l && /* @__PURE__ */ e(
|
|
50
81
|
"span",
|
|
51
82
|
{
|
|
52
|
-
className:
|
|
53
|
-
style: { backgroundColor:
|
|
83
|
+
className: T,
|
|
84
|
+
style: { backgroundColor: N, borderColor: N }
|
|
54
85
|
}
|
|
55
86
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
] },
|
|
87
|
+
/* @__PURE__ */ e("span", { className: o.tooltipName, children: D }),
|
|
88
|
+
/* @__PURE__ */ e("span", { className: o.tooltipValue, children: E })
|
|
89
|
+
] }, m);
|
|
59
90
|
}) })
|
|
60
91
|
] });
|
|
61
92
|
};
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
payload:
|
|
65
|
-
className:
|
|
93
|
+
B.displayName = "ChartTooltipContent";
|
|
94
|
+
const G = ({
|
|
95
|
+
payload: t,
|
|
96
|
+
className: n
|
|
66
97
|
}) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
98
|
+
if (p)
|
|
99
|
+
return /* @__PURE__ */ e(
|
|
100
|
+
C,
|
|
101
|
+
{
|
|
102
|
+
available: !1,
|
|
103
|
+
componentName: "Chart",
|
|
104
|
+
depName: "recharts",
|
|
105
|
+
installCommand: "npm install recharts",
|
|
106
|
+
pnpmCommand: "pnpm add recharts",
|
|
107
|
+
docsUrl: "https://docs.orion-ds.dev/components/chart"
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
const a = y(u);
|
|
111
|
+
if (!t?.length) return null;
|
|
112
|
+
const r = [o.legend, n].filter(Boolean).join(" ");
|
|
113
|
+
return /* @__PURE__ */ e("div", { className: r, children: t.map((s) => {
|
|
114
|
+
const l = s.dataKey || s.value, i = a[l], c = i?.label || l, f = s.color || i?.color;
|
|
115
|
+
return /* @__PURE__ */ h("div", { className: o.legendItem, children: [
|
|
116
|
+
/* @__PURE__ */ e(
|
|
74
117
|
"span",
|
|
75
118
|
{
|
|
76
119
|
className: o.legendDot,
|
|
77
|
-
style: { backgroundColor:
|
|
120
|
+
style: { backgroundColor: f }
|
|
78
121
|
}
|
|
79
122
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
] },
|
|
123
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
124
|
+
] }, l);
|
|
82
125
|
}) });
|
|
83
126
|
};
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
id:
|
|
87
|
-
color:
|
|
88
|
-
startOpacity:
|
|
89
|
-
endOpacity:
|
|
90
|
-
}) => /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
127
|
+
G.displayName = "ChartLegendContent";
|
|
128
|
+
const S = ({
|
|
129
|
+
id: t,
|
|
130
|
+
color: n,
|
|
131
|
+
startOpacity: a = 0.4,
|
|
132
|
+
endOpacity: r = 0.05
|
|
133
|
+
}) => p ? /* @__PURE__ */ e(
|
|
134
|
+
C,
|
|
135
|
+
{
|
|
136
|
+
available: !1,
|
|
137
|
+
componentName: "Chart",
|
|
138
|
+
depName: "recharts",
|
|
139
|
+
installCommand: "npm install recharts",
|
|
140
|
+
pnpmCommand: "pnpm add recharts",
|
|
141
|
+
docsUrl: "https://docs.orion-ds.dev/components/chart"
|
|
142
|
+
}
|
|
143
|
+
) : /* @__PURE__ */ h("linearGradient", { id: t, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
144
|
+
/* @__PURE__ */ e("stop", { offset: "5%", stopColor: n, stopOpacity: a }),
|
|
145
|
+
/* @__PURE__ */ e("stop", { offset: "95%", stopColor: n, stopOpacity: r })
|
|
93
146
|
] });
|
|
94
|
-
|
|
95
|
-
const
|
|
147
|
+
S.displayName = "ChartGradient";
|
|
148
|
+
const M = L || null, P = x || null;
|
|
96
149
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
150
|
+
U as ChartContainer,
|
|
151
|
+
S as ChartGradient,
|
|
152
|
+
P as ChartLegend,
|
|
153
|
+
G as ChartLegendContent,
|
|
154
|
+
M as ChartTooltip,
|
|
155
|
+
B as ChartTooltipContent
|
|
103
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),k=require("./ChatCodeBlock.cjs"),p=require("../../MissingDependencyError.cjs"),g=require("../Chat.module.css.cjs");let s,c,i=null;try{s=require("react-markdown"),c=require("remark-gfm")}catch(a){i=a instanceof Error?a:new Error("react-markdown or remark-gfm not found")}const d=({content:a,className:m,...l})=>i?r.jsx(p.MissingDependencyError,{available:!1,componentName:"Chat",depName:["react-markdown","remark-gfm"],installCommand:"npm install react-markdown remark-gfm",pnpmCommand:"pnpm add react-markdown remark-gfm",docsUrl:"https://docs.orion-ds.dev/components/chat"}):r.jsx("div",{className:[g.default.markdown,m].filter(Boolean).join(" "),...l,children:r.jsx(s,{remarkPlugins:[c],components:{code({className:e,children:t,...o}){const n=/language-(\w+)/.exec(e||"");if(!n)return r.jsx("code",{className:e,...o,children:t});const u=String(t).replace(/\n$/,"");return r.jsx(k.ChatCodeBlock,{code:u,language:n[1]})},pre({children:e}){return r.jsx(r.Fragment,{children:e})},a({href:e,children:t,...o}){const n=e?.startsWith("http");return r.jsx("a",{href:e,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}},children:a})});d.displayName="ChatMarkdown";exports.ChatMarkdown=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatMarkdown.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatMarkdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatMarkdown.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAiBvD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuEpD,CAAC"}
|
|
@@ -1,33 +1,48 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ChatCodeBlock as p } from "./ChatCodeBlock.mjs";
|
|
1
|
+
import { jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { ChatCodeBlock as k } from "./ChatCodeBlock.mjs";
|
|
3
|
+
import { MissingDependencyError as f } from "../../MissingDependencyError.mjs";
|
|
5
4
|
import g from "../Chat.module.css.mjs";
|
|
6
|
-
|
|
5
|
+
let m, c, i = null;
|
|
6
|
+
try {
|
|
7
|
+
m = require("react-markdown"), c = require("remark-gfm");
|
|
8
|
+
} catch (a) {
|
|
9
|
+
i = a instanceof Error ? a : new Error("react-markdown or remark-gfm not found");
|
|
10
|
+
}
|
|
11
|
+
const u = ({
|
|
7
12
|
content: a,
|
|
8
|
-
className:
|
|
9
|
-
...
|
|
10
|
-
}) => /* @__PURE__ */ e(
|
|
13
|
+
className: s,
|
|
14
|
+
...l
|
|
15
|
+
}) => i ? /* @__PURE__ */ e(
|
|
16
|
+
f,
|
|
17
|
+
{
|
|
18
|
+
available: !1,
|
|
19
|
+
componentName: "Chat",
|
|
20
|
+
depName: ["react-markdown", "remark-gfm"],
|
|
21
|
+
installCommand: "npm install react-markdown remark-gfm",
|
|
22
|
+
pnpmCommand: "pnpm add react-markdown remark-gfm",
|
|
23
|
+
docsUrl: "https://docs.orion-ds.dev/components/chat"
|
|
24
|
+
}
|
|
25
|
+
) : /* @__PURE__ */ e(
|
|
11
26
|
"div",
|
|
12
27
|
{
|
|
13
|
-
className: [g.markdown,
|
|
14
|
-
...
|
|
28
|
+
className: [g.markdown, s].filter(Boolean).join(" "),
|
|
29
|
+
...l,
|
|
15
30
|
children: /* @__PURE__ */ e(
|
|
16
|
-
|
|
31
|
+
m,
|
|
17
32
|
{
|
|
18
|
-
remarkPlugins: [
|
|
33
|
+
remarkPlugins: [c],
|
|
19
34
|
components: {
|
|
20
35
|
// Custom code block rendering
|
|
21
36
|
code({ className: r, children: o, ...t }) {
|
|
22
37
|
const n = /language-(\w+)/.exec(r || "");
|
|
23
38
|
if (!n)
|
|
24
39
|
return /* @__PURE__ */ e("code", { className: r, ...t, children: o });
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */ e(
|
|
40
|
+
const d = String(o).replace(/\n$/, "");
|
|
41
|
+
return /* @__PURE__ */ e(k, { code: d, language: n[1] });
|
|
27
42
|
},
|
|
28
43
|
// Custom pre rendering (remove wrapper for code blocks)
|
|
29
44
|
pre({ children: r }) {
|
|
30
|
-
return /* @__PURE__ */ e(
|
|
45
|
+
return /* @__PURE__ */ e(p, { children: r });
|
|
31
46
|
},
|
|
32
47
|
// Custom link rendering (open in new tab)
|
|
33
48
|
a({ href: r, children: o, ...t }) {
|
|
@@ -49,7 +64,7 @@ const f = ({
|
|
|
49
64
|
)
|
|
50
65
|
}
|
|
51
66
|
);
|
|
52
|
-
|
|
67
|
+
u.displayName = "ChatMarkdown";
|
|
53
68
|
export {
|
|
54
|
-
|
|
69
|
+
u as ChatMarkdown
|
|
55
70
|
};
|