@orion-ds/react 5.0.0 → 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/README.md +48 -4
- package/dist/client.cjs +1 -1
- package/dist/client.mjs +143 -139
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.module.css.cjs +1 -1
- package/dist/components/Button/Button.module.css.mjs +28 -28
- 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/styles.css +111 -3
- package/dist/theme.css +110 -2
- 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 +2 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
const n = "
|
|
1
|
+
const n = "_button_gjg2h_9", g = "_primary_gjg2h_49", _ = "_secondary_gjg2h_65", o = "_secondaryInverse_gjg2h_104", s = "_ghost_gjg2h_124", t = "_ghostInverse_gjg2h_141", e = "_danger_gjg2h_157", c = "_inverse_gjg2h_178", i = "_sm_gjg2h_207", h = "_md_gjg2h_214", r = "_lg_gjg2h_221", d = "_fullWidth_gjg2h_233", a = "_iconOnly_gjg2h_238", l = "_loading_gjg2h_256", j = "_spinner_gjg2h_261", y = "_spin_gjg2h_261", p = "_loadingContent_gjg2h_339", m = "_icon_gjg2h_238", v = "_iconRight_gjg2h_437", u = {
|
|
2
2
|
button: n,
|
|
3
|
-
primary:
|
|
4
|
-
secondary:
|
|
5
|
-
secondaryInverse:
|
|
6
|
-
ghost:
|
|
3
|
+
primary: g,
|
|
4
|
+
secondary: _,
|
|
5
|
+
secondaryInverse: o,
|
|
6
|
+
ghost: s,
|
|
7
7
|
ghostInverse: t,
|
|
8
|
-
danger:
|
|
9
|
-
inverse:
|
|
10
|
-
sm:
|
|
11
|
-
md:
|
|
8
|
+
danger: e,
|
|
9
|
+
inverse: c,
|
|
10
|
+
sm: i,
|
|
11
|
+
md: h,
|
|
12
12
|
lg: r,
|
|
13
13
|
fullWidth: d,
|
|
14
14
|
iconOnly: a,
|
|
15
15
|
loading: l,
|
|
16
|
-
spinner:
|
|
17
|
-
spin:
|
|
18
|
-
loadingContent:
|
|
19
|
-
icon:
|
|
20
|
-
iconRight:
|
|
16
|
+
spinner: j,
|
|
17
|
+
spin: y,
|
|
18
|
+
loadingContent: p,
|
|
19
|
+
icon: m,
|
|
20
|
+
iconRight: v
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
23
|
n as button,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
e as danger,
|
|
25
|
+
u as default,
|
|
26
26
|
d as fullWidth,
|
|
27
|
-
|
|
27
|
+
s as ghost,
|
|
28
28
|
t as ghostInverse,
|
|
29
|
-
|
|
29
|
+
m as icon,
|
|
30
30
|
a as iconOnly,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
v as iconRight,
|
|
32
|
+
c as inverse,
|
|
33
33
|
r as lg,
|
|
34
34
|
l as loading,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
p as loadingContent,
|
|
36
|
+
h as md,
|
|
37
|
+
g as primary,
|
|
38
|
+
_ as secondary,
|
|
39
|
+
o as secondaryInverse,
|
|
40
|
+
i as sm,
|
|
41
|
+
y as spin,
|
|
42
|
+
j as spinner
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("react"),k=require("lucide-react"),V=require("../MissingDependencyError.cjs"),r=require("./Calendar.module.css.cjs"),N=require("../Button/Button.cjs");let g,w,I,q,A,B,T,a,b,x,S,C,y,W=null;try{const e=require("date-fns");g=e.startOfMonth,w=e.endOfMonth,I=e.startOfWeek,q=e.endOfWeek,A=e.eachDayOfInterval,B=e.addMonths,T=e.subMonths,a=e.isSameDay,b=e.isSameMonth,x=e.isToday,S=e.isBefore,C=e.isAfter,y=e.format}catch(e){W=e instanceof Error?e:new Error("date-fns not found")}const X=["Su","Mo","Tu","We","Th","Fr","Sa"];function Z(e,s){const d=e.length,u=(s%d+d)%d;return[...e.slice(u),...e.slice(0,u)]}const L=e=>{if(W)return o.jsx(V.MissingDependencyError,{available:!1,componentName:"Calendar",depName:"date-fns",installCommand:"npm install date-fns",pnpmCommand:"pnpm add date-fns",docsUrl:"https://docs.orion-ds.dev/components/calendar"});const{mode:s="single",min:d,max:u,disabled:m,weekStartsOn:h=0,showOutsideDays:R=!0,className:_,...z}=e,{selected:ee,onSelect:te,...P}=z,[f,O]=c.useState(()=>s==="single"&&e.mode!=="range"&&e.mode!=="multiple"&&e.selected?g(e.selected):s==="range"&&e.mode==="range"&&e.selected?.from?g(e.selected.from):g(new Date)),F=c.useMemo(()=>{const t=g(f),n=w(f),l=I(t,{weekStartsOn:h}),i=q(n,{weekStartsOn:h});return A({start:l,end:i})},[f,h]),H=c.useMemo(()=>Z(X,h),[h]),M=c.useCallback(t=>d&&S(t,$(d))||u&&C(t,p(u))?!0:m?Array.isArray(m)?m.some(n=>a(n,t)):m(t):!1,[d,u,m]),v=c.useCallback(t=>s==="single"&&e.mode!=="range"&&e.mode!=="multiple"?e.selected?a(e.selected,t):!1:s==="multiple"&&e.mode==="multiple"?e.selected?.some(n=>a(n,t))??!1:!1,[s,e]),j=c.useCallback(t=>{if(s!=="range"||e.mode!=="range"||!e.selected)return null;const{from:n,to:l}=e.selected;return n?l?a(t,n)&&a(t,l)||a(t,n)?"start":a(t,l)?"end":C(t,n)&&S(t,l)?"middle":null:a(t,n)?"start":null:null},[s,e]),K=c.useCallback(t=>{if(!M(t)){if(s==="single"&&e.mode!=="range"&&e.mode!=="multiple"){const n=e.onSelect;n?.(t)}else if(s==="range"&&e.mode==="range"){const n=e.onSelect,l=e.selected;!l?.from||l.from&&l.to?n?.({from:t,to:void 0}):S(t,l.from)?n?.({from:t,to:l.from}):n?.({from:l.from,to:t})}else if(s==="multiple"&&e.mode==="multiple"){const n=e.onSelect,l=e.selected??[],i=l.findIndex(E=>a(E,t));i>=0?n?.(l.filter((E,Q)=>Q!==i)):n?.([...l,t])}}},[s,e,M]),U=()=>O(t=>T(t,1)),Y=()=>O(t=>B(t,1)),G=t=>{const n=[r.default.day];if(!b(t,f)&&n.push(r.default.outside),x(t)&&n.push(r.default.today),M(t)&&n.push(r.default.disabled),s==="range"){const i=j(t);i==="start"&&(n.push(r.default.rangeStart),e.mode==="range"&&e.selected?.from&&e.selected?.to&&a(e.selected.from,e.selected.to)&&n.push(r.default.rangeEnd)),i==="middle"&&n.push(r.default.rangeMiddle),i==="end"&&n.push(r.default.rangeEnd)}else v(t)&&n.push(r.default.selected);return n.join(" ")},J=[r.default.calendar,_].filter(Boolean).join(" "),D=c.useId();return o.jsxs("div",{className:J,...P,children:[o.jsxs("div",{className:r.default.header,children:[o.jsx(N.Button,{variant:"ghost",iconOnly:!0,size:"sm",icon:o.jsx(k.ChevronLeft,{size:16}),onClick:U,"aria-label":"Previous month"}),o.jsx("span",{id:D,className:r.default.monthLabel,children:y(f,"MMMM yyyy")}),o.jsx(N.Button,{variant:"ghost",iconOnly:!0,size:"sm",icon:o.jsx(k.ChevronRight,{size:16}),onClick:Y,"aria-label":"Next month"})]}),o.jsxs("div",{className:r.default.grid,role:"grid","aria-labelledby":D,children:[H.map(t=>o.jsx("div",{className:r.default.weekday,role:"columnheader","aria-label":t,children:t},t)),F.map(t=>!b(t,f)&&!R?o.jsx("div",{},t.toISOString()):o.jsx("button",{type:"button",className:G(t),onClick:()=>K(t),disabled:M(t),tabIndex:x(t)?0:-1,"aria-label":y(t,"EEEE, MMMM d, yyyy"),"aria-selected":v(t)||j(t)!==null,children:y(t,"d")},t.toISOString()))]})]})};L.displayName="Calendar";function $(e){const s=new Date(e);return s.setHours(0,0,0,0),s}function p(e){const s=new Date(e);return s.setHours(23,59,59,999),s}exports.Calendar=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAgD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAgD,MAAM,OAAO,CAAC;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,kBAAkB,CAAC;AA8CjE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0Q5C,CAAC"}
|
|
@@ -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 } 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"}
|