@deepnoid/ui 0.1.42 → 0.1.44

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.
Files changed (43) hide show
  1. package/.turbo/turbo-build.log +186 -171
  2. package/dist/chunk-3YMMVZDL.mjs +1 -0
  3. package/dist/chunk-NZOVUADT.mjs +136 -0
  4. package/dist/{chunk-6ZL5NEEI.mjs → chunk-RIW4TT6V.mjs} +1 -1
  5. package/dist/chunk-TBZSYI6R.mjs +107 -0
  6. package/dist/{chunk-K7V4VE7R.mjs → chunk-WOEZHDJR.mjs} +1 -1
  7. package/dist/components/breadcrumb/breadcrumb.mjs +2 -2
  8. package/dist/components/breadcrumb/index.mjs +2 -2
  9. package/dist/components/button/index.mjs +6 -6
  10. package/dist/components/charts/areaCharts.d.mts +66 -0
  11. package/dist/components/charts/areaCharts.d.ts +66 -0
  12. package/dist/components/charts/areaCharts.js +471 -0
  13. package/dist/components/charts/areaCharts.mjs +10 -0
  14. package/dist/components/charts/circularProgress.d.mts +92 -0
  15. package/dist/components/charts/circularProgress.d.ts +92 -0
  16. package/dist/components/charts/circularProgress.js +441 -0
  17. package/dist/components/charts/circularProgress.mjs +11 -0
  18. package/dist/components/charts/index.d.mts +5 -0
  19. package/dist/components/charts/index.d.ts +5 -0
  20. package/dist/components/charts/index.js +573 -0
  21. package/dist/components/charts/index.mjs +15 -0
  22. package/dist/components/dateTimePicker/dateTimePicker.mjs +3 -3
  23. package/dist/components/dateTimePicker/index.mjs +3 -3
  24. package/dist/components/dateTimePicker/timePicker.mjs +2 -2
  25. package/dist/components/fileUpload/fileUpload.mjs +3 -3
  26. package/dist/components/fileUpload/index.mjs +3 -3
  27. package/dist/components/list/index.mjs +3 -3
  28. package/dist/components/modal/index.mjs +3 -3
  29. package/dist/components/modal/modal.mjs +3 -3
  30. package/dist/components/table/index.js +1 -1
  31. package/dist/components/table/index.mjs +5 -5
  32. package/dist/components/table/table.js +1 -1
  33. package/dist/components/table/table.mjs +3 -3
  34. package/dist/components/toast/index.mjs +2 -2
  35. package/dist/components/toast/use-toast.mjs +2 -2
  36. package/dist/index.d.mts +2 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +226 -1
  39. package/dist/index.mjs +61 -52
  40. package/package.json +4 -3
  41. package/dist/{chunk-IBI3OVQI.mjs → chunk-CTBTYNSM.mjs} +3 -3
  42. package/dist/{chunk-BFOK4HVC.mjs → chunk-KYJTZPXY.mjs} +3 -3
  43. package/dist/{chunk-25QOEKXS.mjs → chunk-TRR232FS.mjs} +3 -3
@@ -0,0 +1 @@
1
+ "use client";
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import {
3
+ tv
4
+ } from "./chunk-4ZJFD3L3.mjs";
5
+ import {
6
+ mapPropsVariants
7
+ } from "./chunk-E3G5QXSH.mjs";
8
+
9
+ // src/components/charts/areaCharts.tsx
10
+ import { forwardRef, useMemo, useState } from "react";
11
+ import { AreaChart, Area, XAxis, YAxis, ResponsiveContainer, CartesianGrid } from "recharts";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ var AreaChartComponent = forwardRef((originalProps, ref) => {
14
+ var _a, _b;
15
+ const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
16
+ const { areaData, color, classNames } = { ...props, ...variantProps };
17
+ const slots = useMemo(() => areaChartStyle({ ...variantProps }), [variantProps]);
18
+ const colorHex = (_b = (_a = areaChartStyle.variants.color) == null ? void 0 : _a[color || "primary"]) == null ? void 0 : _b._colorValue;
19
+ const [xTickPositions, setXTickPositions] = useState([]);
20
+ const midPoints = useMemo(() => {
21
+ const sorted = [...xTickPositions].sort((a, b) => a - b);
22
+ const mids = [];
23
+ for (let i = 0; i < sorted.length - 1; i++) {
24
+ mids.push((sorted[i] + sorted[i + 1]) / 2);
25
+ }
26
+ return mids;
27
+ }, [xTickPositions]);
28
+ const CustomDotWithShadow = (props2) => {
29
+ const { cx, cy, fill, stroke } = props2;
30
+ if (cx === void 0 || cy === void 0) return null;
31
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
32
+ /* @__PURE__ */ jsx("circle", { cx, cy, r: 8, fill, opacity: 0.2 }),
33
+ /* @__PURE__ */ jsx("circle", { cx, cy, r: 3.5, fill, stroke, strokeWidth: 2 })
34
+ ] });
35
+ };
36
+ return /* @__PURE__ */ jsx("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(AreaChart, { data: areaData, children: [
37
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "colorGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
38
+ /* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
39
+ /* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
40
+ ] }) }),
41
+ /* @__PURE__ */ jsx(
42
+ CartesianGrid,
43
+ {
44
+ vertical: true,
45
+ horizontal: false,
46
+ strokeDasharray: "3 3",
47
+ className: "stroke-neutral-light",
48
+ verticalPoints: midPoints
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx(
52
+ XAxis,
53
+ {
54
+ dataKey: "name",
55
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
56
+ tickLine: false,
57
+ tick: ({ x, y, payload }) => {
58
+ setXTickPositions((prev) => {
59
+ if (!prev.includes(x)) return [...prev, x];
60
+ return prev;
61
+ });
62
+ return /* @__PURE__ */ jsx(
63
+ "text",
64
+ {
65
+ x,
66
+ y: y + 14,
67
+ textAnchor: "middle",
68
+ fontSize: 12,
69
+ fontWeight: 700,
70
+ fill: "currentColor",
71
+ className: "text-body-foreground",
72
+ children: payload.value
73
+ }
74
+ );
75
+ },
76
+ padding: { left: 35.5, right: 35.5 }
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(
80
+ YAxis,
81
+ {
82
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
83
+ tickLine: false,
84
+ tick: {
85
+ fontSize: 12,
86
+ fontWeight: 700,
87
+ fill: "text-body-foreground",
88
+ textAnchor: "middle",
89
+ dx: -10
90
+ },
91
+ ticks: [0, 20, 40, 60, 80, 100],
92
+ domain: [-10, 110]
93
+ }
94
+ ),
95
+ /* @__PURE__ */ jsx(
96
+ Area,
97
+ {
98
+ type: "monotone",
99
+ dataKey: "value",
100
+ stroke: colorHex,
101
+ strokeWidth: 2,
102
+ fill: "url(#colorGradient)",
103
+ dot: /* @__PURE__ */ jsx(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
104
+ activeDot: { r: 7, fill: colorHex }
105
+ }
106
+ )
107
+ ] }) }) });
108
+ });
109
+ AreaChartComponent.displayName = "AreaChart";
110
+ var areaCharts_default = AreaChartComponent;
111
+ var areaChartStyle = tv({
112
+ slots: {
113
+ base: [],
114
+ color: [],
115
+ axis: ["text-sm", "font-bold", "text-center", "text-body-foreground"]
116
+ },
117
+ variants: {
118
+ color: {
119
+ primary: {
120
+ color: ["text-primary-main"],
121
+ _colorValue: "#3F9CF2"
122
+ },
123
+ danger: {
124
+ color: ["text-danger-main"],
125
+ _colorValue: "#FF4684"
126
+ }
127
+ }
128
+ },
129
+ defaultVariants: {
130
+ color: "primary"
131
+ }
132
+ });
133
+
134
+ export {
135
+ areaCharts_default
136
+ };
@@ -138,7 +138,7 @@ var tableStyle = tv({
138
138
  table: ["w-full", "h-auto"],
139
139
  thead: ["w-full"],
140
140
  tbody: ["w-full"],
141
- tr: ["group", "outline-none", "w-full", "h-full"],
141
+ tr: ["group/tr", "outline-none", "w-full", "h-full"],
142
142
  th: [
143
143
  "text-body-foreground",
144
144
  "font-bold",
@@ -0,0 +1,107 @@
1
+ "use client";
2
+ import {
3
+ tv
4
+ } from "./chunk-4ZJFD3L3.mjs";
5
+ import {
6
+ mapPropsVariants
7
+ } from "./chunk-E3G5QXSH.mjs";
8
+
9
+ // src/components/charts/circularProgress.tsx
10
+ import { RadialBarChart, RadialBar, PolarAngleAxis } from "recharts";
11
+ import { forwardRef, useMemo } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var CircularProgress = forwardRef((originalProps, ref) => {
14
+ const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
15
+ const { title, size = 150, color, percentage, unit, classNames } = { ...props, ...variantProps };
16
+ const slots = useMemo(() => circularProgressStyle({ ...variantProps }), [variantProps]);
17
+ const data = [
18
+ {
19
+ name: title,
20
+ value: percentage
21
+ }
22
+ ];
23
+ const BAR_SIZE = 24;
24
+ const OUTER_RADIUS = 88;
25
+ const INNER_RADIUS = OUTER_RADIUS - BAR_SIZE;
26
+ return /* @__PURE__ */ jsxs("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
27
+ /* @__PURE__ */ jsxs("div", { className: `relative h-[${size}px] w-[${size}px]`, children: [
28
+ /* @__PURE__ */ jsxs(
29
+ RadialBarChart,
30
+ {
31
+ width: size,
32
+ height: size,
33
+ innerRadius: INNER_RADIUS,
34
+ outerRadius: OUTER_RADIUS,
35
+ barSize: BAR_SIZE,
36
+ data,
37
+ startAngle: 90,
38
+ endAngle: -270,
39
+ children: [
40
+ /* @__PURE__ */ jsx(
41
+ "circle",
42
+ {
43
+ cx: size / 2,
44
+ cy: size / 2,
45
+ r: INNER_RADIUS + BAR_SIZE / 2,
46
+ className: slots.background({ class: classNames == null ? void 0 : classNames.background }),
47
+ fill: "currentColor"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsx(PolarAngleAxis, { type: "number", domain: [0, 100], angleAxisId: 0, tick: false }),
51
+ /* @__PURE__ */ jsx(
52
+ RadialBar,
53
+ {
54
+ dataKey: "value",
55
+ cornerRadius: 12,
56
+ animationDuration: 1e3,
57
+ className: slots.progress({ class: classNames == null ? void 0 : classNames.progress })
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ ),
63
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxs("span", { className: slots.text({ class: classNames == null ? void 0 : classNames.text }), children: [
64
+ percentage,
65
+ unit
66
+ ] }) })
67
+ ] }),
68
+ title && /* @__PURE__ */ jsx("p", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title })
69
+ ] });
70
+ });
71
+ CircularProgress.displayName = "CircularProgress";
72
+ var circularProgress_default = CircularProgress;
73
+ var circularProgressStyle = tv({
74
+ slots: {
75
+ base: ["flex", "flex-col", "items-center", "gap-[20px]"],
76
+ background: [],
77
+ progress: ["transition-all", "duration-1000 ease-out"],
78
+ text: ["text-xl", "font-bold"],
79
+ title: ["text-md", "font-bold", "text-center", "text-body-foreground"]
80
+ },
81
+ variants: {
82
+ color: {
83
+ primary: {
84
+ background: ["fill-primary-soft"],
85
+ progress: ["fill-primary-main"],
86
+ text: ["text-primary-dark"]
87
+ },
88
+ secondary: {
89
+ background: ["fill-secondary-soft"],
90
+ progress: ["fill-secondary-main"],
91
+ text: ["text-secondary-dark"]
92
+ },
93
+ warning: {
94
+ background: ["fill-warning-soft"],
95
+ progress: ["fill-warning-main"],
96
+ text: ["text-warning-dark"]
97
+ }
98
+ }
99
+ },
100
+ defaultVariants: {
101
+ color: "primary"
102
+ }
103
+ });
104
+
105
+ export {
106
+ circularProgress_default
107
+ };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-A7RU3FU5.mjs";
5
5
  import {
6
6
  timePicker_default
7
- } from "./chunk-BFOK4HVC.mjs";
7
+ } from "./chunk-KYJTZPXY.mjs";
8
8
  import {
9
9
  useDatePicker
10
10
  } from "./chunk-FWJ2ZKH6.mjs";
@@ -3,13 +3,13 @@ import {
3
3
  breadcrumb_default
4
4
  } from "../../chunk-G67WUZO3.mjs";
5
5
  import "../../chunk-MY5U63QO.mjs";
6
+ import "../../chunk-7TAGGLNY.mjs";
7
+ import "../../chunk-WFMFC7R6.mjs";
6
8
  import "../../chunk-LPZOH3RP.mjs";
7
9
  import "../../chunk-UB4YBFOT.mjs";
8
- import "../../chunk-7TAGGLNY.mjs";
9
10
  import "../../chunk-6WSACUIB.mjs";
10
11
  import "../../chunk-LXHUO6VM.mjs";
11
12
  import "../../chunk-6PNKRBUT.mjs";
12
- import "../../chunk-WFMFC7R6.mjs";
13
13
  import "../../chunk-ZYIIXWVY.mjs";
14
14
  import "../../chunk-2TKEWFGH.mjs";
15
15
  import "../../chunk-2SDYFOZL.mjs";
@@ -4,13 +4,13 @@ import {
4
4
  breadcrumb_default
5
5
  } from "../../chunk-G67WUZO3.mjs";
6
6
  import "../../chunk-MY5U63QO.mjs";
7
+ import "../../chunk-7TAGGLNY.mjs";
8
+ import "../../chunk-WFMFC7R6.mjs";
7
9
  import "../../chunk-LPZOH3RP.mjs";
8
10
  import "../../chunk-UB4YBFOT.mjs";
9
- import "../../chunk-7TAGGLNY.mjs";
10
11
  import "../../chunk-6WSACUIB.mjs";
11
12
  import "../../chunk-LXHUO6VM.mjs";
12
13
  import "../../chunk-6PNKRBUT.mjs";
13
- import "../../chunk-WFMFC7R6.mjs";
14
14
  import "../../chunk-ZYIIXWVY.mjs";
15
15
  import "../../chunk-2TKEWFGH.mjs";
16
16
  import "../../chunk-2SDYFOZL.mjs";
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import "../../chunk-MY5U63QO.mjs";
3
+ import {
4
+ icon_button_default
5
+ } from "../../chunk-7TAGGLNY.mjs";
6
+ import {
7
+ text_button_default
8
+ } from "../../chunk-WFMFC7R6.mjs";
3
9
  import {
4
10
  button_group_default
5
11
  } from "../../chunk-LPZOH3RP.mjs";
6
12
  import {
7
13
  button_default
8
14
  } from "../../chunk-UB4YBFOT.mjs";
9
- import {
10
- icon_button_default
11
- } from "../../chunk-7TAGGLNY.mjs";
12
15
  import "../../chunk-6WSACUIB.mjs";
13
16
  import "../../chunk-LXHUO6VM.mjs";
14
17
  import "../../chunk-6PNKRBUT.mjs";
15
- import {
16
- text_button_default
17
- } from "../../chunk-WFMFC7R6.mjs";
18
18
  import "../../chunk-ZYIIXWVY.mjs";
19
19
  import "../../chunk-2TKEWFGH.mjs";
20
20
  import "../../chunk-2SDYFOZL.mjs";
@@ -0,0 +1,66 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as react from 'react';
4
+ import { SlotsToClasses } from '../../utils/types.mjs';
5
+
6
+ type AreaData = {
7
+ name: string;
8
+ value: number;
9
+ };
10
+ type Props = {
11
+ areaData?: AreaData[];
12
+ classNames?: SlotsToClasses<AreaChartSlots>;
13
+ };
14
+ type AreaChartProps = Props & AreaChartVariantProps;
15
+ declare const AreaChartComponent: react.ForwardRefExoticComponent<Props & AreaChartVariantProps & react.RefAttributes<HTMLDivElement>>;
16
+
17
+ declare const areaChartStyle: tailwind_variants.TVReturnType<{
18
+ color: {
19
+ primary: {
20
+ color: string[];
21
+ _colorValue: string;
22
+ };
23
+ danger: {
24
+ color: string[];
25
+ _colorValue: string;
26
+ };
27
+ };
28
+ }, {
29
+ base: never[];
30
+ color: never[];
31
+ axis: string[];
32
+ }, undefined, {
33
+ color: {
34
+ primary: {
35
+ color: string[];
36
+ _colorValue: string;
37
+ };
38
+ danger: {
39
+ color: string[];
40
+ _colorValue: string;
41
+ };
42
+ };
43
+ }, {
44
+ base: never[];
45
+ color: never[];
46
+ axis: string[];
47
+ }, tailwind_variants.TVReturnType<{
48
+ color: {
49
+ primary: {
50
+ color: string[];
51
+ _colorValue: string;
52
+ };
53
+ danger: {
54
+ color: string[];
55
+ _colorValue: string;
56
+ };
57
+ };
58
+ }, {
59
+ base: never[];
60
+ color: never[];
61
+ axis: string[];
62
+ }, undefined, unknown, unknown, undefined>>;
63
+ type AreaChartVariantProps = VariantProps<typeof areaChartStyle>;
64
+ type AreaChartSlots = keyof ReturnType<typeof areaChartStyle>;
65
+
66
+ export { type AreaChartProps, AreaChartComponent as default };
@@ -0,0 +1,66 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as react from 'react';
4
+ import { SlotsToClasses } from '../../utils/types.js';
5
+
6
+ type AreaData = {
7
+ name: string;
8
+ value: number;
9
+ };
10
+ type Props = {
11
+ areaData?: AreaData[];
12
+ classNames?: SlotsToClasses<AreaChartSlots>;
13
+ };
14
+ type AreaChartProps = Props & AreaChartVariantProps;
15
+ declare const AreaChartComponent: react.ForwardRefExoticComponent<Props & AreaChartVariantProps & react.RefAttributes<HTMLDivElement>>;
16
+
17
+ declare const areaChartStyle: tailwind_variants.TVReturnType<{
18
+ color: {
19
+ primary: {
20
+ color: string[];
21
+ _colorValue: string;
22
+ };
23
+ danger: {
24
+ color: string[];
25
+ _colorValue: string;
26
+ };
27
+ };
28
+ }, {
29
+ base: never[];
30
+ color: never[];
31
+ axis: string[];
32
+ }, undefined, {
33
+ color: {
34
+ primary: {
35
+ color: string[];
36
+ _colorValue: string;
37
+ };
38
+ danger: {
39
+ color: string[];
40
+ _colorValue: string;
41
+ };
42
+ };
43
+ }, {
44
+ base: never[];
45
+ color: never[];
46
+ axis: string[];
47
+ }, tailwind_variants.TVReturnType<{
48
+ color: {
49
+ primary: {
50
+ color: string[];
51
+ _colorValue: string;
52
+ };
53
+ danger: {
54
+ color: string[];
55
+ _colorValue: string;
56
+ };
57
+ };
58
+ }, {
59
+ base: never[];
60
+ color: never[];
61
+ axis: string[];
62
+ }, undefined, unknown, unknown, undefined>>;
63
+ type AreaChartVariantProps = VariantProps<typeof areaChartStyle>;
64
+ type AreaChartSlots = keyof ReturnType<typeof areaChartStyle>;
65
+
66
+ export { type AreaChartProps, AreaChartComponent as default };