@code0-tech/pictor 0.15.0 → 0.16.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.
@@ -1 +1 @@
1
- .avatar{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;overflow:hidden}.avatar{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:transparent;box-shadow:none}.avatar--image{padding:0}.avatar--identicon>div>div{--color: inherit;background:transparent;width:calc(var(--size) * 1px);height:calc(var(--size) * 1px)}.avatar--identicon>div>div>span>svg{width:calc(var(--size) * .75px);height:calc(var(--size) * .75px)}.avatar--identicon>div>div>span,.avatar--identicon>div>div>p{color:var(--color);font-size:calc(var(--size) * .75px)}
1
+ .avatar{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;overflow:hidden}.avatar{background:#191825;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:transparent;box-shadow:none}.avatar--image{padding:0}.avatar--identicon>div>div{--color: inherit;background:transparent;width:calc(var(--size) * .75px);height:calc(var(--size) * .75px)}.avatar--identicon>div>div>span>svg{width:calc(var(--size) * .75px);height:calc(var(--size) * .75px)}.avatar--identicon>div>div>span,.avatar--identicon>div>div>p{color:var(--color);font-size:calc(var(--size) * .75px)}
@@ -0,0 +1 @@
1
+ .chart{display:flex;justify-content:center;aspect-ratio:16/9;font-size:.7rem}.chart{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.chart .recharts-cartesian-axis-tick text,.chart .recharts-cartesian-axis-label text{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.chart .recharts-cartesian-axis-tick text{fill:#ffffffbf}.chart .recharts-cartesian-grid line,.chart .recharts-polar-grid line,.chart .recharts-reference-line line,.chart .recharts-reference-line path{stroke:#bfbfbf1a}.chart .recharts-curve.recharts-tooltip-cursor{stroke:#bfbfbf1a}.chart .recharts-dot,.chart .recharts-sector{stroke:transparent}.chart .recharts-layer,.chart .recharts-sector,.chart .recharts-surface{outline:none}.chart .recharts-radial-bar-background-sector,.chart .recharts-rectangle.recharts-tooltip-cursor{fill:#100e1d}.chart__tooltip{display:grid;min-width:8rem;align-items:start;gap:.35rem;padding:.7rem;font-size:.7rem}.chart__tooltip{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.chart__tooltip-label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.chart__tooltip-body{display:grid;gap:.35rem}.chart__tooltip-row{display:flex;flex-wrap:wrap;width:100%;align-items:stretch;gap:.7rem}.chart__tooltip-row>svg{width:.7rem;height:.7rem;color:#ffffffbf}.chart__tooltip-row--dot{align-items:center}.chart__tooltip-indicator{flex-shrink:0;border-radius:1rem;border:1px solid var(--color-border);background:var(--color-bg)}.chart__tooltip-indicator--dot{border-radius:.175rem;width:.7rem;height:.7rem}.chart__tooltip-content{display:flex;flex:1;justify-content:space-between;align-items:center;line-height:1;gap:.7rem}.chart__tooltip-meta{display:grid;gap:.35rem;min-width:0}.chart__tooltip-name{color:#ffffffbf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart__tooltip-value{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;color:#fff;font-variant-numeric:tabular-nums;flex-shrink:0}.chart__legend{display:flex;align-items:center;justify-content:center;gap:1rem}.chart__legend--top{padding-bottom:.7rem}.chart__legend--bottom{padding-top:.7rem}.chart__legend-item{display:flex;align-items:center;gap:.35rem}.chart__legend-item>svg{width:.7rem;height:.7rem;color:#ffffffbf}.chart__legend-swatch{width:.5rem;height:.5rem;flex-shrink:0;border-radius:2px}
@@ -0,0 +1 @@
1
+ .color-input__control{flex:1;min-width:0;align-self:stretch;display:flex;align-items:center;gap:.7rem}.color-input__swatch-wrapper{position:relative;width:20px;height:20px;border-radius:.3rem;overflow:hidden;flex-shrink:0;box-shadow:inset 0 0 0 1px #ffffff1a}.color-input__transparency-grid{position:absolute;inset:0}.color-input__swatch{width:100%;height:100%}.color-input__swatch--empty{background:linear-gradient(to top right,transparent calc(50% - 1px),rgba(255,255,255,.4),transparent calc(50% + 1px))}.color-input__value-text{font-variant-numeric:tabular-nums}.color-input__value-text{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.color-input__value-text--placeholder{opacity:.5}.color-input__trigger{cursor:pointer;display:flex;align-items:center}.color-input__content{padding:.35rem}.color-input__body{display:flex;flex-direction:column;gap:.7rem;width:240px;max-width:100%}.color-input__area{position:relative;width:100%;height:140px;border-radius:.65rem;overflow:hidden}.color-input__area-background{width:100%;height:100%;border-radius:inherit}.color-input__area-thumb{width:14px;height:14px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 0 0 1px #00000059}.color-input__area-thumb:focus{outline:none}.color-input__sliders{display:flex;flex-direction:column;gap:.7rem}.color-input__channel-slider{position:relative;height:14px;border-radius:999px;overflow:hidden}.color-input__channel-slider:focus{outline:none}.color-input__channel-slider-grid{position:absolute;inset:0;border-radius:inherit}.color-input__channel-slider-track{width:100%;height:100%;border-radius:inherit}.color-input__channel-slider-thumb{width:14px;height:14px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 0 0 1px #00000059;transform:translate(-50%,-50%)}.color-input__channel-slider-thumb:focus{outline:none}.color-input__channels{display:flex;flex-direction:column;gap:.7rem}.color-input__notation{width:100%}.color-input__notation .segmented-control__item{flex:1;text-align:center;justify-content:center;font-size:.8rem}.color-input__actions{width:100%;gap:.7rem;margin-top:.35rem}.color-input__actions .button{flex:1;gap:.35rem;justify-content:center;align-items:center}.color-input__channel-row{display:flex;align-items:flex-end;gap:.35rem}.color-input__channel{display:flex;flex-direction:column;align-items:center;gap:2px;flex:1;min-width:0}.color-input__channel--hex{align-items:stretch}.color-input__channel--hex .color-input__channel-label{text-align:center}.color-input__channel-label{font-size:.7rem;opacity:.6}.color-input__channel-label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.color-input__channel-input{width:100%;min-width:0;text-align:center;padding:.35rem;border-radius:.65rem;font-variant-numeric:tabular-nums}.color-input__channel-input{background:#070514;box-shadow:inset 0 1px 1px #ffffff1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.color-input__channel-input:focus{outline:none}.color-input__channel-input{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;font-size:.8rem}.color-input__channel-input:focus,.color-input__channel-input[data-focus]{background:#bfbfbf33;box-shadow:inset 0 1px 1px #ffffff1a;outline:none}
@@ -1,40 +1,42 @@
1
- import { jsxs as z, jsx as r } from "react/jsx-runtime";
2
- import { c as C } from "../../_virtual/compiler-runtime.js";
1
+ import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
+ import { c as y } from "../../_virtual/compiler-runtime.js";
3
3
  import "../../utils/contextStore.js";
4
4
  import "react";
5
- import { mergeComponentProps as I } from "../../utils/component.js";
5
+ import { mergeComponentProps as u } from "../../utils/component.js";
6
6
  import "js-md5";
7
- import { IconCircleX as h, IconAlertCircle as y, IconCircleCheck as x, IconInfoCircle as u, IconCircleDot as a } from "@tabler/icons-react";
7
+ import { IconCircleX as v, IconAlertCircle as x, IconCircleCheck as g, IconInfoCircle as j, IconCircleDot as f } from "@tabler/icons-react";
8
8
  import '../../assets/components/alert/Alert.style.css';/* empty css */
9
- const w = (n) => {
10
- const e = C.c(10);
11
- let o, i, c, t;
12
- if (e[0] !== n) {
9
+ const P = (a) => {
10
+ const e = y.c(14);
11
+ let t, o, s, i, c, l;
12
+ if (e[0] !== a) {
13
13
  const {
14
- color: f,
15
- children: p,
16
- ...d
17
- } = n;
18
- o = p, i = f === void 0 ? "secondary" : f;
19
- let s;
20
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
21
- primary: /* @__PURE__ */ r(a, { size: 16 }),
22
- secondary: /* @__PURE__ */ r(a, { size: 16 }),
23
- tertiary: /* @__PURE__ */ r(a, { size: 16 }),
24
- info: /* @__PURE__ */ r(u, { size: 16 }),
25
- success: /* @__PURE__ */ r(x, { size: 16 }),
26
- warning: /* @__PURE__ */ r(y, { size: 16 }),
27
- error: /* @__PURE__ */ r(h, { size: 16 })
28
- }, e[5] = s) : s = e[5], c = s, t = I(`alert alert--${i}`, d), e[0] = n, e[1] = o, e[2] = i, e[3] = c, e[4] = t;
14
+ color: C,
15
+ children: z,
16
+ ...I
17
+ } = a;
18
+ t = z, o = C === void 0 ? "secondary" : C;
19
+ let m;
20
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
21
+ primary: /* @__PURE__ */ r(f, { size: 16 }),
22
+ secondary: /* @__PURE__ */ r(f, { size: 16 }),
23
+ tertiary: /* @__PURE__ */ r(f, { size: 16 }),
24
+ info: /* @__PURE__ */ r(j, { size: 16 }),
25
+ success: /* @__PURE__ */ r(g, { size: 16 }),
26
+ warning: /* @__PURE__ */ r(x, { size: 16 }),
27
+ error: /* @__PURE__ */ r(v, { size: 16 })
28
+ }, e[7] = m) : m = e[7], s = m;
29
+ const d = o === "error";
30
+ i = d ? "alert" : "status", c = d ? "assertive" : "polite", l = u(`alert alert--${o}`, I), e[0] = a, e[1] = t, e[2] = o, e[3] = s, e[4] = i, e[5] = c, e[6] = l;
29
31
  } else
30
- o = e[1], i = e[2], c = e[3], t = e[4];
31
- const m = c[i];
32
- let l;
33
- return e[6] !== o || e[7] !== t || e[8] !== m ? (l = /* @__PURE__ */ z("div", { ...t, children: [
34
- m,
35
- o
36
- ] }), e[6] = o, e[7] = t, e[8] = m, e[9] = l) : l = e[9], l;
32
+ t = e[1], o = e[2], s = e[3], i = e[4], c = e[5], l = e[6];
33
+ const p = s[o];
34
+ let n;
35
+ return e[8] !== t || e[9] !== i || e[10] !== c || e[11] !== l || e[12] !== p ? (n = /* @__PURE__ */ h("div", { role: i, "aria-live": c, ...l, children: [
36
+ p,
37
+ t
38
+ ] }), e[8] = t, e[9] = i, e[10] = c, e[11] = l, e[12] = p, e[13] = n) : n = e[13], n;
37
39
  };
38
40
  export {
39
- w as Alert
41
+ P as Alert
40
42
  };
@@ -0,0 +1,32 @@
1
+ import { Component } from '../../utils';
2
+ import * as React from "react";
3
+ import * as RechartsPrimitive from "recharts";
4
+ interface ChartItem {
5
+ label?: React.ReactNode;
6
+ icon?: React.ComponentType;
7
+ color?: string;
8
+ }
9
+ export type ChartConfig = Record<string, ChartItem>;
10
+ interface ChartContainerProps extends Component<HTMLDivElement> {
11
+ config: ChartConfig;
12
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
13
+ initialDimension?: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ }
18
+ export declare const ChartContainer: React.FC<ChartContainerProps>;
19
+ interface ChartTooltipContentProps extends Omit<React.ComponentProps<typeof RechartsPrimitive.Tooltip>, "content">, Omit<React.ComponentProps<"div">, "content"> {
20
+ payload?: RechartsPrimitive.TooltipPayload;
21
+ label?: string | number;
22
+ hideLabel?: boolean;
23
+ hideIndicator?: boolean;
24
+ }
25
+ export declare const ChartTooltipContent: React.FC<ChartTooltipContentProps>;
26
+ interface ChartLegendContentProps extends Omit<React.ComponentProps<"div">, "dangerouslySetInnerHTML"> {
27
+ payload?: ReadonlyArray<RechartsPrimitive.LegendPayload>;
28
+ verticalAlign?: "top" | "bottom" | "middle";
29
+ hideIcon?: boolean;
30
+ }
31
+ export declare const ChartLegendContent: React.FC<ChartLegendContentProps>;
32
+ export {};
@@ -0,0 +1,157 @@
1
+ import { jsx as p, jsxs as w } from "react/jsx-runtime";
2
+ import { c as L } from "../../_virtual/compiler-runtime.js";
3
+ import * as j from "react";
4
+ import * as S from "recharts";
5
+ import '../../assets/components/chart/Chart.style.css';/* empty css */
6
+ import "../../utils/contextStore.js";
7
+ import { mergeComponentProps as I } from "../../utils/component.js";
8
+ import "js-md5";
9
+ const A = j.createContext(null), D = () => {
10
+ const o = j.useContext(A);
11
+ if (!o)
12
+ throw new Error("useChart must be used within a <ChartContainer />");
13
+ return o;
14
+ }, H = (o) => {
15
+ const t = L.c(21), {
16
+ id: c,
17
+ className: l,
18
+ children: i,
19
+ config: e,
20
+ initialDimension: r,
21
+ style: _,
22
+ ...h
23
+ } = o;
24
+ let v;
25
+ t[0] !== r ? (v = r === void 0 ? {
26
+ width: 320,
27
+ height: 200
28
+ } : r, t[0] = r, t[1] = v) : v = t[1];
29
+ const a = v, n = j.useId(), d = `chart-${c ?? n.replace(/:/g, "")}`;
30
+ let f;
31
+ t[2] !== e ? (f = Object.entries(e).reduce(k, {}), t[2] = e, t[3] = f) : f = t[3];
32
+ const g = f, x = A;
33
+ let s;
34
+ t[4] !== e ? (s = {
35
+ config: e
36
+ }, t[4] = e, t[5] = s) : s = t[5];
37
+ const $ = "chart";
38
+ let m;
39
+ t[6] !== g || t[7] !== _ ? (m = {
40
+ ...g,
41
+ ..._
42
+ }, t[6] = g, t[7] = _, t[8] = m) : m = t[8];
43
+ const b = I("chart", h);
44
+ let u;
45
+ t[9] !== i || t[10] !== a ? (u = /* @__PURE__ */ p(S.ResponsiveContainer, { initialDimension: a, children: i }), t[9] = i, t[10] = a, t[11] = u) : u = t[11];
46
+ let C;
47
+ t[12] !== d || t[13] !== m || t[14] !== b || t[15] !== u ? (C = /* @__PURE__ */ p("div", { "data-slot": $, "data-chart": d, style: m, ...b, children: u }), t[12] = d, t[13] = m, t[14] = b, t[15] = u, t[16] = C) : C = t[16];
48
+ let N;
49
+ return t[17] !== x.Provider || t[18] !== s || t[19] !== C ? (N = /* @__PURE__ */ p(x.Provider, { value: s, children: C }), t[17] = x.Provider, t[18] = s, t[19] = C, t[20] = N) : N = t[20], N;
50
+ }, J = (o) => {
51
+ const t = L.c(31);
52
+ let c, l, i, e, r, _, h;
53
+ t[0] !== o ? ({
54
+ active: c,
55
+ payload: e,
56
+ className: l,
57
+ hideLabel: _,
58
+ hideIndicator: h,
59
+ label: i,
60
+ ...r
61
+ } = o, t[0] = o, t[1] = c, t[2] = l, t[3] = i, t[4] = e, t[5] = r, t[6] = _, t[7] = h) : (c = t[1], l = t[2], i = t[3], e = t[4], r = t[5], _ = t[6], h = t[7]);
62
+ const v = _ === void 0 ? !1 : _, a = h === void 0 ? !1 : h, {
63
+ config: n
64
+ } = D();
65
+ if (!c || !e?.length)
66
+ return null;
67
+ const [d] = e, f = `${d?.dataKey ?? d?.name ?? "value"}`;
68
+ let g;
69
+ t[8] !== n || t[9] !== d || t[10] !== f ? (g = K(n, d, f), t[8] = n, t[9] = d, t[10] = f, t[11] = g) : g = t[11];
70
+ const s = typeof i == "string" ? n[i]?.label ?? i : g?.label;
71
+ let $;
72
+ t[12] !== l ? ($ = I("chart__tooltip", {
73
+ className: l
74
+ }), t[12] = l, t[13] = $) : $ = t[13];
75
+ let m;
76
+ t[14] !== v || t[15] !== s ? (m = !v && s && /* @__PURE__ */ p("div", { className: "chart__tooltip-label", children: s }), t[14] = v, t[15] = s, t[16] = m) : m = t[16];
77
+ let b;
78
+ if (t[17] !== n || t[18] !== a || t[19] !== e) {
79
+ let N;
80
+ t[21] !== n || t[22] !== a ? (N = (y, E) => {
81
+ const P = K(n, y, `${y.name ?? y.dataKey ?? "value"}`), R = y.payload?.fill ?? y.color;
82
+ return /* @__PURE__ */ w("div", { className: "chart__tooltip-row chart__tooltip-row--dot", children: [
83
+ P?.icon ? /* @__PURE__ */ p(P.icon, {}) : !a && /* @__PURE__ */ p("div", { ...I("chart__tooltip-indicator chart__tooltip-indicator--dot", {
84
+ style: {
85
+ "--color-bg": R,
86
+ "--color-border": R
87
+ }
88
+ }) }),
89
+ /* @__PURE__ */ w("div", { className: "chart__tooltip-content", children: [
90
+ /* @__PURE__ */ p("div", { className: "chart__tooltip-meta", children: /* @__PURE__ */ p("span", { className: "chart__tooltip-name", children: P?.label ?? y.name }) }),
91
+ y.value != null && /* @__PURE__ */ p("span", { className: "chart__tooltip-value", children: typeof y.value == "number" ? y.value.toLocaleString() : String(y.value) })
92
+ ] })
93
+ ] }, E);
94
+ }, t[21] = n, t[22] = a, t[23] = N) : N = t[23], b = e.filter(q).map(N), t[17] = n, t[18] = a, t[19] = e, t[20] = b;
95
+ } else
96
+ b = t[20];
97
+ let u;
98
+ t[24] !== b ? (u = /* @__PURE__ */ p("div", { className: "chart__tooltip-body", children: b }), t[24] = b, t[25] = u) : u = t[25];
99
+ let C;
100
+ return t[26] !== r || t[27] !== $ || t[28] !== m || t[29] !== u ? (C = /* @__PURE__ */ w("div", { ...$, ...r, children: [
101
+ m,
102
+ u
103
+ ] }), t[26] = r, t[27] = $, t[28] = m, t[29] = u, t[30] = C) : C = t[30], C;
104
+ }, M = (o) => {
105
+ const t = L.c(13), {
106
+ className: c,
107
+ hideIcon: l,
108
+ payload: i,
109
+ verticalAlign: e
110
+ } = o, r = l === void 0 ? !1 : l, _ = e === void 0 ? "bottom" : e, {
111
+ config: h
112
+ } = D();
113
+ if (!i?.length)
114
+ return null;
115
+ const v = `chart__legend ${_ === "top" ? "chart__legend--top" : "chart__legend--bottom"}`;
116
+ let a;
117
+ t[0] !== c || t[1] !== v ? (a = I(v, {
118
+ className: c
119
+ }), t[0] = c, t[1] = v, t[2] = a) : a = t[2];
120
+ let n;
121
+ if (t[3] !== h || t[4] !== r || t[5] !== i) {
122
+ let f;
123
+ t[7] !== h || t[8] !== r ? (f = (g, x) => {
124
+ const s = K(h, g, `${g.dataKey ?? "value"}`);
125
+ return /* @__PURE__ */ w("div", { className: "chart__legend-item", children: [
126
+ s?.icon && !r ? /* @__PURE__ */ p(s.icon, {}) : /* @__PURE__ */ p("div", { className: "chart__legend-swatch", style: {
127
+ backgroundColor: g.color
128
+ } }),
129
+ s?.label
130
+ ] }, x);
131
+ }, t[7] = h, t[8] = r, t[9] = f) : f = t[9], n = i.filter(F).map(f), t[3] = h, t[4] = r, t[5] = i, t[6] = n;
132
+ } else
133
+ n = t[6];
134
+ let d;
135
+ return t[10] !== a || t[11] !== n ? (d = /* @__PURE__ */ p("div", { ...a, children: n }), t[10] = a, t[11] = n, t[12] = d) : d = t[12], d;
136
+ }, K = (o, t, c) => {
137
+ if (typeof t != "object" || t === null) return o[c];
138
+ const l = t, i = [c, typeof l.dataKey == "string" ? l.dataKey : void 0, typeof l.name == "string" ? l.name : void 0];
139
+ for (const e of i)
140
+ if (e && e in o)
141
+ return o[e];
142
+ };
143
+ function k(o, t) {
144
+ const [c, l] = t;
145
+ return l.color && (o[`--color-${c}`] = l.color), o;
146
+ }
147
+ function q(o) {
148
+ return o.type !== "none";
149
+ }
150
+ function F(o) {
151
+ return o.type !== "none";
152
+ }
153
+ export {
154
+ H as ChartContainer,
155
+ M as ChartLegendContent,
156
+ J as ChartTooltipContent
157
+ };
@@ -0,0 +1,27 @@
1
+ import { ChartContainer, ChartConfig } from './Chart';
2
+ import { Component } from 'utils';
3
+ import * as React from "react";
4
+ import * as RechartsPrimitive from "recharts";
5
+ export type ChartLines = Omit<React.ComponentProps<typeof RechartsPrimitive.Line>, "dataKey" | "name"> & {
6
+ dataKey: string;
7
+ label?: React.ReactNode;
8
+ color?: string;
9
+ name?: string;
10
+ };
11
+ export type LineChartProps<TData extends Record<string, unknown>> = Omit<React.ComponentProps<typeof RechartsPrimitive.LineChart>, "data"> & Omit<Component<HTMLDivElement>, "height"> & {
12
+ data: TData[];
13
+ lines: ChartLines[];
14
+ xKey: string;
15
+ config?: ChartConfig;
16
+ showDots?: boolean;
17
+ curveType?: React.ComponentProps<typeof RechartsPrimitive.Line>["type"];
18
+ containerProps?: Omit<React.ComponentProps<typeof ChartContainer>, "children" | "config">;
19
+ grid?: React.ComponentProps<typeof RechartsPrimitive.CartesianGrid> | false;
20
+ xAxis?: Omit<React.ComponentProps<typeof RechartsPrimitive.XAxis>, "dataKey">;
21
+ yAxis?: React.ComponentProps<typeof RechartsPrimitive.YAxis>;
22
+ tooltip?: React.ComponentProps<typeof RechartsPrimitive.Tooltip> | false;
23
+ legend?: React.ComponentProps<typeof RechartsPrimitive.Legend> | false;
24
+ };
25
+ type LineChartComponent = <TData extends Record<string, unknown>>(props: LineChartProps<TData>) => React.ReactElement;
26
+ export declare const LineChart: LineChartComponent;
27
+ export {};
@@ -0,0 +1,76 @@
1
+ import { jsx as o, jsxs as X } from "react/jsx-runtime";
2
+ import { c as Y } from "../../_virtual/compiler-runtime.js";
3
+ import * as d from "recharts";
4
+ import { ChartTooltipContent as q, ChartLegendContent as z, ChartContainer as B } from "./Chart.js";
5
+ const Q = (a) => {
6
+ const e = Y.c(48);
7
+ let m, p, r, y, c, l, t, h, s, n, C, g, u;
8
+ e[0] !== a ? ({
9
+ data: y,
10
+ lines: t,
11
+ xKey: g,
12
+ config: m,
13
+ showDots: s,
14
+ curveType: r,
15
+ containerProps: p,
16
+ grid: c,
17
+ xAxis: C,
18
+ yAxis: u,
19
+ tooltip: n,
20
+ legend: l,
21
+ ...h
22
+ } = a, e[0] = a, e[1] = m, e[2] = p, e[3] = r, e[4] = y, e[5] = c, e[6] = l, e[7] = t, e[8] = h, e[9] = s, e[10] = n, e[11] = C, e[12] = g, e[13] = u) : (m = e[1], p = e[2], r = e[3], y = e[4], c = e[5], l = e[6], t = e[7], h = e[8], s = e[9], n = e[10], C = e[11], g = e[12], u = e[13]);
23
+ const W = F;
24
+ let P;
25
+ e[14] !== m || e[15] !== t ? (P = m ?? t.reduce((f, i) => (f[i.dataKey] = {
26
+ label: i.label ?? i.name ?? i.dataKey,
27
+ color: W(i)
28
+ }, f), {}), e[14] = m, e[15] = t, e[16] = P) : P = e[16];
29
+ const D = P;
30
+ let x;
31
+ e[17] !== C || e[18] !== g ? (x = /* @__PURE__ */ o(d.XAxis, { dataKey: g, ...C }), e[17] = C, e[18] = g, e[19] = x) : x = e[19];
32
+ let k;
33
+ e[20] !== u ? (k = /* @__PURE__ */ o(d.YAxis, { ...u }), e[20] = u, e[21] = k) : k = e[21];
34
+ let v;
35
+ e[22] !== c ? (v = c !== !1 && /* @__PURE__ */ o(d.CartesianGrid, { strokeDasharray: "4 4", ...c }), e[22] = c, e[23] = v) : v = e[23];
36
+ let K;
37
+ e[24] !== n ? (K = n !== !1 && /* @__PURE__ */ o(d.Tooltip, { ...n, content: n?.content ?? /* @__PURE__ */ o(q, {}) }), e[24] = n, e[25] = K) : K = e[25];
38
+ let L;
39
+ e[26] !== l ? (L = l !== !1 && /* @__PURE__ */ o(d.Legend, { ...l, content: l?.content ?? /* @__PURE__ */ o(z, {}) }), e[26] = l, e[27] = L) : L = e[27];
40
+ let b;
41
+ if (e[28] !== r || e[29] !== t || e[30] !== s) {
42
+ let f;
43
+ e[32] !== r || e[33] !== s ? (f = (i) => {
44
+ const {
45
+ dataKey: j,
46
+ label: R,
47
+ type: $,
48
+ strokeWidth: w,
49
+ name: E,
50
+ dot: G,
51
+ color: H,
52
+ stroke: I,
53
+ ...N
54
+ } = i, S = typeof R == "string" || typeof R == "number" ? String(R) : E ?? j;
55
+ return /* @__PURE__ */ o(d.Line, { dataKey: j, name: S, stroke: W(i) ?? `var(--color-${j}, currentColor)`, type: $ ?? r ?? "monotone", strokeWidth: w ?? 2, dot: G ?? s, ...N }, j);
56
+ }, e[32] = r, e[33] = s, e[34] = f) : f = e[34], b = t.map(f), e[28] = r, e[29] = t, e[30] = s, e[31] = b;
57
+ } else
58
+ b = e[31];
59
+ let A;
60
+ e[35] !== y || e[36] !== h || e[37] !== x || e[38] !== k || e[39] !== v || e[40] !== K || e[41] !== L || e[42] !== b ? (A = /* @__PURE__ */ X(d.LineChart, { data: y, ...h, children: [
61
+ x,
62
+ k,
63
+ v,
64
+ K,
65
+ L,
66
+ b
67
+ ] }), e[35] = y, e[36] = h, e[37] = x, e[38] = k, e[39] = v, e[40] = K, e[41] = L, e[42] = b, e[43] = A) : A = e[43];
68
+ let T;
69
+ return e[44] !== p || e[45] !== D || e[46] !== A ? (T = /* @__PURE__ */ o(B, { config: D, ...p, children: A }), e[44] = p, e[45] = D, e[46] = A, e[47] = T) : T = e[47], T;
70
+ };
71
+ function F(a) {
72
+ return a.color ?? (typeof a.stroke == "string" ? a.stroke : void 0);
73
+ }
74
+ export {
75
+ Q as LineChart
76
+ };
@@ -0,0 +1,2 @@
1
+ export * from './LineChart';
2
+ export * from './Chart';
@@ -0,0 +1,8 @@
1
+ import { LineChart as r } from "./LineChart.js";
2
+ import { ChartContainer as n, ChartLegendContent as C, ChartTooltipContent as a } from "./Chart.js";
3
+ export {
4
+ n as ChartContainer,
5
+ C as ChartLegendContent,
6
+ a as ChartTooltipContent,
7
+ r as LineChart
8
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsx as i, jsxs as s } from "react/jsx-runtime";
2
2
  import { c } from "../../_virtual/compiler-runtime.js";
3
- import { Command as a } from "cmdk";
3
+ import { Command as r } from "cmdk";
4
4
  import "../../utils/contextStore.js";
5
5
  import "react";
6
- import { mergeComponentProps as r } from "../../utils/component.js";
6
+ import { mergeComponentProps as a } from "../../utils/component.js";
7
7
  import "js-md5";
8
8
  import { DialogPortal as u, DialogContent as h, Dialog as g, DialogOverlay as C } from "../dialog/Dialog.js";
9
9
  import '../../assets/components/form/FileInput.style.css';import '../../assets/components/form/DateInput.style.css';import '../../assets/components/form/SelectInput.style.css';import '../../assets/components/scroll-area/ScrollArea.style.css';import '../../assets/components/menu/Menu.style.css';import '../../assets/components/flex/Flex.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/command/Command.style.css';/* empty css */
@@ -11,6 +11,7 @@ import { Badge as _ } from "../badge/Badge.js";
11
11
  import "@radix-ui/react-checkbox";
12
12
  import "@tabler/icons-react";
13
13
  /* empty css */
14
+ import "../form/ColorInput.js";
14
15
  import "@ark-ui/react";
15
16
  import "@internationalized/date";
16
17
  import "../form/InputWrapper.js";
@@ -38,11 +39,11 @@ import { TextInput as $ } from "../form/TextInput.js";
38
39
  const P = (e) => {
39
40
  const t = c.c(4);
40
41
  let m;
41
- t[0] !== e ? (m = r("command", e), t[0] = e, t[1] = m) : m = t[1];
42
+ t[0] !== e ? (m = a("command", e), t[0] = e, t[1] = m) : m = t[1];
42
43
  const o = m;
43
44
  let n;
44
- return t[2] !== o ? (n = /* @__PURE__ */ i(a, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
45
- }, mt = (e) => {
45
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
46
+ }, ot = (e) => {
46
47
  const t = c.c(11);
47
48
  let m;
48
49
  t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ i(C, {}), t[0] = m) : m = t[0];
@@ -55,14 +56,14 @@ const P = (e) => {
55
56
  ] }), t[3] = e.contentProps, t[4] = o, t[5] = n) : n = t[5];
56
57
  let l;
57
58
  return t[6] !== e.dialogProps || t[7] !== e.onOpenChange || t[8] !== e.open || t[9] !== n ? (l = /* @__PURE__ */ i(g, { ...e.dialogProps, open: e.open, onOpenChange: e.onOpenChange, children: n }), t[6] = e.dialogProps, t[7] = e.onOpenChange, t[8] = e.open, t[9] = n, t[10] = l) : l = t[10], l;
58
- }, ot = (e) => {
59
+ }, it = (e) => {
59
60
  const t = c.c(4);
60
61
  let m;
61
- t[0] !== e ? (m = r("command__list", e), t[0] = e, t[1] = m) : m = t[1];
62
+ t[0] !== e ? (m = a("command__list", e), t[0] = e, t[1] = m) : m = t[1];
62
63
  const o = m;
63
64
  let n;
64
- return t[2] !== o ? (n = /* @__PURE__ */ i(a.List, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
65
- }, it = (e) => {
65
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r.List, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
66
+ }, lt = (e) => {
66
67
  const t = c.c(10);
67
68
  let m;
68
69
  t[0] !== e.value ? (m = e.value?.toString(), t[0] = e.value, t[1] = m) : m = t[1];
@@ -80,51 +81,51 @@ const P = (e) => {
80
81
  let n;
81
82
  t[4] !== e ? (n = /* @__PURE__ */ i($, { className: "command__input", ...e }), t[4] = e, t[5] = n) : n = t[5];
82
83
  let l;
83
- return t[6] !== m || t[7] !== o || t[8] !== n ? (l = /* @__PURE__ */ i(a.Input, { value: m, onValueChange: o, asChild: !0, children: n }), t[6] = m, t[7] = o, t[8] = n, t[9] = l) : l = t[9], l;
84
- }, lt = (e) => {
84
+ return t[6] !== m || t[7] !== o || t[8] !== n ? (l = /* @__PURE__ */ i(r.Input, { value: m, onValueChange: o, asChild: !0, children: n }), t[6] = m, t[7] = o, t[8] = n, t[9] = l) : l = t[9], l;
85
+ }, ct = (e) => {
85
86
  const t = c.c(4);
86
87
  let m;
87
- t[0] !== e ? (m = r("command__empty", e), t[0] = e, t[1] = m) : m = t[1];
88
+ t[0] !== e ? (m = a("command__empty", e), t[0] = e, t[1] = m) : m = t[1];
88
89
  const o = m;
89
90
  let n;
90
- return t[2] !== o ? (n = /* @__PURE__ */ i(a.Empty, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
91
- }, ct = (e) => {
91
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r.Empty, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
92
+ }, rt = (e) => {
92
93
  const t = c.c(4);
93
94
  let m;
94
- t[0] !== e ? (m = r("command__group", e), t[0] = e, t[1] = m) : m = t[1];
95
+ t[0] !== e ? (m = a("command__group", e), t[0] = e, t[1] = m) : m = t[1];
95
96
  const o = m;
96
97
  let n;
97
- return t[2] !== o ? (n = /* @__PURE__ */ i(a.Group, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
98
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r.Group, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
98
99
  }, at = (e) => {
99
100
  const t = c.c(4);
100
101
  let m;
101
- t[0] !== e ? (m = r("command__item", e), t[0] = e, t[1] = m) : m = t[1];
102
+ t[0] !== e ? (m = a("command__item", e), t[0] = e, t[1] = m) : m = t[1];
102
103
  const o = m;
103
104
  let n;
104
- return t[2] !== o ? (n = /* @__PURE__ */ i(a.Item, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
105
- }, rt = (e) => {
105
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r.Item, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
106
+ }, dt = (e) => {
106
107
  const t = c.c(4);
107
108
  let m;
108
- t[0] !== e ? (m = r("command__separator", e), t[0] = e, t[1] = m) : m = t[1];
109
+ t[0] !== e ? (m = a("command__separator", e), t[0] = e, t[1] = m) : m = t[1];
109
110
  const o = m;
110
111
  let n;
111
- return t[2] !== o ? (n = /* @__PURE__ */ i(a.Separator, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
112
- }, dt = (e) => {
112
+ return t[2] !== o ? (n = /* @__PURE__ */ i(r.Separator, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
113
+ }, ft = (e) => {
113
114
  const t = c.c(5);
114
115
  let m;
115
- t[0] !== e ? (m = r("command__shortcut", e), t[0] = e, t[1] = m) : m = t[1];
116
+ t[0] !== e ? (m = a("command__shortcut", e), t[0] = e, t[1] = m) : m = t[1];
116
117
  const o = m;
117
118
  let n;
118
119
  return t[2] !== e.children || t[3] !== o ? (n = /* @__PURE__ */ i(_, { ...o, children: e.children }), t[2] = e.children, t[3] = o, t[4] = n) : n = t[4], n;
119
120
  };
120
121
  export {
121
122
  P as Command,
122
- mt as CommandDialog,
123
- lt as CommandEmpty,
124
- ct as CommandGroup,
125
- it as CommandInput,
123
+ ot as CommandDialog,
124
+ ct as CommandEmpty,
125
+ rt as CommandGroup,
126
+ lt as CommandInput,
126
127
  at as CommandItem,
127
- ot as CommandList,
128
- rt as CommandSeparator,
129
- dt as CommandShortcut
128
+ it as CommandList,
129
+ dt as CommandSeparator,
130
+ ft as CommandShortcut
130
131
  };
@@ -0,0 +1,33 @@
1
+ import { ColorPicker, Color } from '@ark-ui/react';
2
+ import { ComponentProps } from '../../utils';
3
+ import { default as React } from 'react';
4
+ import { InputWrapperProps } from './InputWrapper';
5
+ import { MenuContentProps, MenuTriggerProps } from '../menu/Menu';
6
+ type ColorNotation = "rgba" | "hsla" | "hexa";
7
+ interface ValueChangeDetails {
8
+ value: Color;
9
+ valueAsString: string;
10
+ }
11
+ export type ColorProps = InputWrapperProps & {
12
+ placeholder?: React.ReactNode;
13
+ name?: string;
14
+ disabled?: boolean;
15
+ readOnly?: boolean;
16
+ closeOnSelect?: boolean;
17
+ onValueChange?: (details: ValueChangeDetails) => void;
18
+ children?: React.ReactNode;
19
+ };
20
+ export type ColorInputControlProps = ComponentProps & ColorPicker.ControlProps;
21
+ export type ColorInputSwatchProps = ComponentProps & ColorPicker.ValueSwatchProps;
22
+ export type ColorInputValueTextProps = ComponentProps & Omit<React.HTMLProps<HTMLSpanElement>, "value">;
23
+ export type ColorInputTriggerProps = ComponentProps & MenuTriggerProps;
24
+ export type ColorInputContentProps = ComponentProps & MenuContentProps & {
25
+ defaultNotation?: ColorNotation;
26
+ };
27
+ export declare const ColorInput: React.FC<ColorProps>;
28
+ export declare const ColorInputControl: React.FC<ColorInputControlProps>;
29
+ export declare const ColorInputSwatch: React.FC<ColorInputSwatchProps>;
30
+ export declare const ColorInputValueText: React.FC<ColorInputValueTextProps>;
31
+ export declare const ColorInputTrigger: React.FC<ColorInputTriggerProps>;
32
+ export declare const ColorInputContent: React.FC<ColorInputContentProps>;
33
+ export {};