framepexls-ui-lib 0.3.15 → 0.3.17

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.
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ type BarSeries = {
5
+ key: string;
6
+ name?: string;
7
+ color?: string;
8
+ stackId?: string;
9
+ };
10
+ type RechartsBarCardProps = {
11
+ title: React__default.ReactNode;
12
+ subtitle?: React__default.ReactNode;
13
+ data: any[];
14
+ xKey: string;
15
+ xTickFormatter?: (value: any) => string;
16
+ bars: BarSeries[];
17
+ };
18
+ declare function RechartsBarCard({ title, subtitle, data, xKey, xTickFormatter, bars, }: RechartsBarCardProps): react_jsx_runtime.JSX.Element;
19
+
20
+ export { type BarSeries, type RechartsBarCardProps, RechartsBarCard as default };
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ type BarSeries = {
5
+ key: string;
6
+ name?: string;
7
+ color?: string;
8
+ stackId?: string;
9
+ };
10
+ type RechartsBarCardProps = {
11
+ title: React__default.ReactNode;
12
+ subtitle?: React__default.ReactNode;
13
+ data: any[];
14
+ xKey: string;
15
+ xTickFormatter?: (value: any) => string;
16
+ bars: BarSeries[];
17
+ };
18
+ declare function RechartsBarCard({ title, subtitle, data, xKey, xTickFormatter, bars, }: RechartsBarCardProps): react_jsx_runtime.JSX.Element;
19
+
20
+ export { type BarSeries, type RechartsBarCardProps, RechartsBarCard as default };
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var RechartsBarCard_exports = {};
31
+ __export(RechartsBarCard_exports, {
32
+ default: () => RechartsBarCard
33
+ });
34
+ module.exports = __toCommonJS(RechartsBarCard_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ChartCard = __toESM(require("./ChartCard"));
37
+ var import_recharts = require("recharts");
38
+ const formatNumberMx = (v, opts) => {
39
+ const n = typeof v === "number" ? v : Number(v);
40
+ if (!Number.isFinite(n)) return v;
41
+ return n.toLocaleString("es-MX", { maximumFractionDigits: 0, ...opts });
42
+ };
43
+ function RechartsBarCard({
44
+ title,
45
+ subtitle,
46
+ data,
47
+ xKey,
48
+ xTickFormatter,
49
+ bars
50
+ }) {
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChartCard.default, { title, subtitle, children: !Array.isArray(data) || data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-[220px] items-center justify-center text-xs text-slate-500 dark:text-slate-400", children: "Sin datos para los filtros seleccionados." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-[260px] w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
52
+ import_recharts.BarChart,
53
+ {
54
+ width: 520,
55
+ height: 220,
56
+ data,
57
+ margin: { top: 10, right: 20, left: 0, bottom: 20 },
58
+ children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8f0" }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
+ import_recharts.XAxis,
62
+ {
63
+ dataKey: xKey,
64
+ tickFormatter: xTickFormatter,
65
+ tick: { fontSize: 11 }
66
+ }
67
+ ),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ import_recharts.YAxis,
70
+ {
71
+ tickFormatter: (v) => formatNumberMx(v),
72
+ tick: { fontSize: 11 }
73
+ }
74
+ ),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_recharts.Tooltip,
77
+ {
78
+ formatter: (value, name) => [
79
+ typeof value === "number" ? value.toLocaleString("es-MX", { maximumFractionDigits: 2 }) : value,
80
+ name
81
+ ]
82
+ }
83
+ ),
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.Legend, {}),
85
+ bars.map((b, idx) => {
86
+ var _a, _b;
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
+ import_recharts.Bar,
89
+ {
90
+ dataKey: b.key,
91
+ name: b.name,
92
+ stackId: b.stackId,
93
+ fill: (_b = b.color) != null ? _b : idx === 0 ? "#fb7185" : "#0ea5e9",
94
+ radius: [4, 4, 0, 0]
95
+ },
96
+ (_a = b.key) != null ? _a : idx
97
+ );
98
+ })
99
+ ]
100
+ }
101
+ ) }) });
102
+ }
@@ -0,0 +1,80 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import ChartCard from "./ChartCard";
4
+ import {
5
+ BarChart,
6
+ Bar,
7
+ CartesianGrid,
8
+ XAxis,
9
+ YAxis,
10
+ Tooltip,
11
+ Legend
12
+ } from "recharts";
13
+ const formatNumberMx = (v, opts) => {
14
+ const n = typeof v === "number" ? v : Number(v);
15
+ if (!Number.isFinite(n)) return v;
16
+ return n.toLocaleString("es-MX", { maximumFractionDigits: 0, ...opts });
17
+ };
18
+ function RechartsBarCard({
19
+ title,
20
+ subtitle,
21
+ data,
22
+ xKey,
23
+ xTickFormatter,
24
+ bars
25
+ }) {
26
+ return /* @__PURE__ */ jsx(ChartCard, { title, subtitle, children: !Array.isArray(data) || data.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-[220px] items-center justify-center text-xs text-slate-500 dark:text-slate-400", children: "Sin datos para los filtros seleccionados." }) : /* @__PURE__ */ jsx("div", { className: "h-[260px] w-full overflow-x-auto", children: /* @__PURE__ */ jsxs(
27
+ BarChart,
28
+ {
29
+ width: 520,
30
+ height: 220,
31
+ data,
32
+ margin: { top: 10, right: 20, left: 0, bottom: 20 },
33
+ children: [
34
+ /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8f0" }),
35
+ /* @__PURE__ */ jsx(
36
+ XAxis,
37
+ {
38
+ dataKey: xKey,
39
+ tickFormatter: xTickFormatter,
40
+ tick: { fontSize: 11 }
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx(
44
+ YAxis,
45
+ {
46
+ tickFormatter: (v) => formatNumberMx(v),
47
+ tick: { fontSize: 11 }
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsx(
51
+ Tooltip,
52
+ {
53
+ formatter: (value, name) => [
54
+ typeof value === "number" ? value.toLocaleString("es-MX", { maximumFractionDigits: 2 }) : value,
55
+ name
56
+ ]
57
+ }
58
+ ),
59
+ /* @__PURE__ */ jsx(Legend, {}),
60
+ bars.map((b, idx) => {
61
+ var _a, _b;
62
+ return /* @__PURE__ */ jsx(
63
+ Bar,
64
+ {
65
+ dataKey: b.key,
66
+ name: b.name,
67
+ stackId: b.stackId,
68
+ fill: (_b = b.color) != null ? _b : idx === 0 ? "#fb7185" : "#0ea5e9",
69
+ radius: [4, 4, 0, 0]
70
+ },
71
+ (_a = b.key) != null ? _a : idx
72
+ );
73
+ })
74
+ ]
75
+ }
76
+ ) }) });
77
+ }
78
+ export {
79
+ RechartsBarCard as default
80
+ };
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ type LineSeries = {
5
+ key: string;
6
+ name?: string;
7
+ color?: string;
8
+ yAxisId?: "left" | "right";
9
+ };
10
+ type RechartsTimeSeriesCardProps = {
11
+ title: React__default.ReactNode;
12
+ subtitle?: React__default.ReactNode;
13
+ data: any[];
14
+ xKey: string;
15
+ xTickFormatter?: (value: any) => string;
16
+ leftAxisLabel?: string;
17
+ rightAxisLabel?: string;
18
+ lines: LineSeries[];
19
+ };
20
+ declare function RechartsTimeSeriesCard({ title, subtitle, data, xKey, xTickFormatter, leftAxisLabel, rightAxisLabel, lines, }: RechartsTimeSeriesCardProps): react_jsx_runtime.JSX.Element;
21
+
22
+ export { type LineSeries, type RechartsTimeSeriesCardProps, RechartsTimeSeriesCard as default };
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ type LineSeries = {
5
+ key: string;
6
+ name?: string;
7
+ color?: string;
8
+ yAxisId?: "left" | "right";
9
+ };
10
+ type RechartsTimeSeriesCardProps = {
11
+ title: React__default.ReactNode;
12
+ subtitle?: React__default.ReactNode;
13
+ data: any[];
14
+ xKey: string;
15
+ xTickFormatter?: (value: any) => string;
16
+ leftAxisLabel?: string;
17
+ rightAxisLabel?: string;
18
+ lines: LineSeries[];
19
+ };
20
+ declare function RechartsTimeSeriesCard({ title, subtitle, data, xKey, xTickFormatter, leftAxisLabel, rightAxisLabel, lines, }: RechartsTimeSeriesCardProps): react_jsx_runtime.JSX.Element;
21
+
22
+ export { type LineSeries, type RechartsTimeSeriesCardProps, RechartsTimeSeriesCard as default };
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var RechartsTimeSeriesCard_exports = {};
31
+ __export(RechartsTimeSeriesCard_exports, {
32
+ default: () => RechartsTimeSeriesCard
33
+ });
34
+ module.exports = __toCommonJS(RechartsTimeSeriesCard_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ChartCard = __toESM(require("./ChartCard"));
37
+ var import_recharts = require("recharts");
38
+ const formatNumberMx = (v, opts) => {
39
+ const n = typeof v === "number" ? v : Number(v);
40
+ if (!Number.isFinite(n)) return v;
41
+ return n.toLocaleString("es-MX", { maximumFractionDigits: 0, ...opts });
42
+ };
43
+ function RechartsTimeSeriesCard({
44
+ title,
45
+ subtitle,
46
+ data,
47
+ xKey,
48
+ xTickFormatter,
49
+ leftAxisLabel,
50
+ rightAxisLabel,
51
+ lines
52
+ }) {
53
+ const hasRight = lines.some((l) => {
54
+ var _a;
55
+ return ((_a = l.yAxisId) != null ? _a : "left") === "right";
56
+ });
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChartCard.default, { title, subtitle, children: !Array.isArray(data) || data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-[220px] items-center justify-center text-xs text-slate-500 dark:text-slate-400", children: "Sin datos para los filtros seleccionados." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-[260px] w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
58
+ import_recharts.LineChart,
59
+ {
60
+ width: 520,
61
+ height: 220,
62
+ data,
63
+ margin: { top: 10, right: 20, left: 0, bottom: 20 },
64
+ children: [
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8f0" }),
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
67
+ import_recharts.XAxis,
68
+ {
69
+ dataKey: xKey,
70
+ tickFormatter: xTickFormatter,
71
+ tick: { fontSize: 11 }
72
+ }
73
+ ),
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ import_recharts.YAxis,
76
+ {
77
+ yAxisId: "left",
78
+ allowDecimals: false,
79
+ tickFormatter: (v) => formatNumberMx(v),
80
+ tick: { fontSize: 11 },
81
+ label: leftAxisLabel ? {
82
+ value: leftAxisLabel,
83
+ angle: -90,
84
+ position: "insideLeft",
85
+ fontSize: 10
86
+ } : void 0
87
+ }
88
+ ),
89
+ hasRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
+ import_recharts.YAxis,
91
+ {
92
+ yAxisId: "right",
93
+ orientation: "right",
94
+ tickFormatter: (v) => formatNumberMx(v),
95
+ tick: { fontSize: 11 },
96
+ label: rightAxisLabel ? {
97
+ value: rightAxisLabel,
98
+ angle: 90,
99
+ position: "insideRight",
100
+ fontSize: 10
101
+ } : void 0
102
+ }
103
+ ),
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
+ import_recharts.Tooltip,
106
+ {
107
+ formatter: (value, name) => [
108
+ typeof value === "number" ? value.toLocaleString("es-MX", { maximumFractionDigits: 2 }) : value,
109
+ name
110
+ ]
111
+ }
112
+ ),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.Legend, {}),
114
+ lines.map((l, idx) => {
115
+ var _a, _b, _c;
116
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
+ import_recharts.Line,
118
+ {
119
+ yAxisId: (_b = l.yAxisId) != null ? _b : "left",
120
+ type: "monotone",
121
+ dataKey: l.key,
122
+ name: l.name,
123
+ stroke: (_c = l.color) != null ? _c : idx === 0 ? "#fb7185" : "#0ea5e9",
124
+ strokeWidth: 2,
125
+ dot: false,
126
+ activeDot: { r: 4 }
127
+ },
128
+ (_a = l.key) != null ? _a : idx
129
+ );
130
+ })
131
+ ]
132
+ }
133
+ ) }) });
134
+ }
@@ -0,0 +1,112 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import ChartCard from "./ChartCard";
4
+ import {
5
+ LineChart,
6
+ Line,
7
+ CartesianGrid,
8
+ XAxis,
9
+ YAxis,
10
+ Tooltip,
11
+ Legend
12
+ } from "recharts";
13
+ const formatNumberMx = (v, opts) => {
14
+ const n = typeof v === "number" ? v : Number(v);
15
+ if (!Number.isFinite(n)) return v;
16
+ return n.toLocaleString("es-MX", { maximumFractionDigits: 0, ...opts });
17
+ };
18
+ function RechartsTimeSeriesCard({
19
+ title,
20
+ subtitle,
21
+ data,
22
+ xKey,
23
+ xTickFormatter,
24
+ leftAxisLabel,
25
+ rightAxisLabel,
26
+ lines
27
+ }) {
28
+ const hasRight = lines.some((l) => {
29
+ var _a;
30
+ return ((_a = l.yAxisId) != null ? _a : "left") === "right";
31
+ });
32
+ return /* @__PURE__ */ jsx(ChartCard, { title, subtitle, children: !Array.isArray(data) || data.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-[220px] items-center justify-center text-xs text-slate-500 dark:text-slate-400", children: "Sin datos para los filtros seleccionados." }) : /* @__PURE__ */ jsx("div", { className: "h-[260px] w-full overflow-x-auto", children: /* @__PURE__ */ jsxs(
33
+ LineChart,
34
+ {
35
+ width: 520,
36
+ height: 220,
37
+ data,
38
+ margin: { top: 10, right: 20, left: 0, bottom: 20 },
39
+ children: [
40
+ /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#e2e8f0" }),
41
+ /* @__PURE__ */ jsx(
42
+ XAxis,
43
+ {
44
+ dataKey: xKey,
45
+ tickFormatter: xTickFormatter,
46
+ tick: { fontSize: 11 }
47
+ }
48
+ ),
49
+ /* @__PURE__ */ jsx(
50
+ YAxis,
51
+ {
52
+ yAxisId: "left",
53
+ allowDecimals: false,
54
+ tickFormatter: (v) => formatNumberMx(v),
55
+ tick: { fontSize: 11 },
56
+ label: leftAxisLabel ? {
57
+ value: leftAxisLabel,
58
+ angle: -90,
59
+ position: "insideLeft",
60
+ fontSize: 10
61
+ } : void 0
62
+ }
63
+ ),
64
+ hasRight && /* @__PURE__ */ jsx(
65
+ YAxis,
66
+ {
67
+ yAxisId: "right",
68
+ orientation: "right",
69
+ tickFormatter: (v) => formatNumberMx(v),
70
+ tick: { fontSize: 11 },
71
+ label: rightAxisLabel ? {
72
+ value: rightAxisLabel,
73
+ angle: 90,
74
+ position: "insideRight",
75
+ fontSize: 10
76
+ } : void 0
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(
80
+ Tooltip,
81
+ {
82
+ formatter: (value, name) => [
83
+ typeof value === "number" ? value.toLocaleString("es-MX", { maximumFractionDigits: 2 }) : value,
84
+ name
85
+ ]
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsx(Legend, {}),
89
+ lines.map((l, idx) => {
90
+ var _a, _b, _c;
91
+ return /* @__PURE__ */ jsx(
92
+ Line,
93
+ {
94
+ yAxisId: (_b = l.yAxisId) != null ? _b : "left",
95
+ type: "monotone",
96
+ dataKey: l.key,
97
+ name: l.name,
98
+ stroke: (_c = l.color) != null ? _c : idx === 0 ? "#fb7185" : "#0ea5e9",
99
+ strokeWidth: 2,
100
+ dot: false,
101
+ activeDot: { r: 4 }
102
+ },
103
+ (_a = l.key) != null ? _a : idx
104
+ );
105
+ })
106
+ ]
107
+ }
108
+ ) }) });
109
+ }
110
+ export {
111
+ RechartsTimeSeriesCard as default
112
+ };
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import Button from './Button.mjs';
4
+
5
+ type ButtonColor = NonNullable<React__default.ComponentProps<typeof Button>["color"]>;
6
+ type SegmentedTabOption = {
7
+ value: string;
8
+ label: React__default.ReactNode;
9
+ };
10
+ type SegmentedTabsProps = {
11
+ value: string;
12
+ options: SegmentedTabOption[];
13
+ onChange: (value: string) => void;
14
+ color?: ButtonColor;
15
+ size?: "sm" | "md";
16
+ className?: string;
17
+ };
18
+ declare function SegmentedTabs({ value, options, onChange, color, size, className, }: SegmentedTabsProps): react_jsx_runtime.JSX.Element;
19
+
20
+ export { type SegmentedTabOption, type SegmentedTabsProps, SegmentedTabs as default };
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import Button from './Button.js';
4
+
5
+ type ButtonColor = NonNullable<React__default.ComponentProps<typeof Button>["color"]>;
6
+ type SegmentedTabOption = {
7
+ value: string;
8
+ label: React__default.ReactNode;
9
+ };
10
+ type SegmentedTabsProps = {
11
+ value: string;
12
+ options: SegmentedTabOption[];
13
+ onChange: (value: string) => void;
14
+ color?: ButtonColor;
15
+ size?: "sm" | "md";
16
+ className?: string;
17
+ };
18
+ declare function SegmentedTabs({ value, options, onChange, color, size, className, }: SegmentedTabsProps): react_jsx_runtime.JSX.Element;
19
+
20
+ export { type SegmentedTabOption, type SegmentedTabsProps, SegmentedTabs as default };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var SegmentedTabs_exports = {};
31
+ __export(SegmentedTabs_exports, {
32
+ default: () => SegmentedTabs
33
+ });
34
+ module.exports = __toCommonJS(SegmentedTabs_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_Button = __toESM(require("./Button"));
37
+ function SegmentedTabs({
38
+ value,
39
+ options,
40
+ onChange,
41
+ color = "rose",
42
+ size = "md",
43
+ className
44
+ }) {
45
+ const btnSize = size === "sm" ? "xs" : "sm";
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ "div",
48
+ {
49
+ className: [
50
+ "inline-flex rounded-2xl border border-slate-200 bg-slate-50 p-1.5 text-sm",
51
+ "dark:border-white/10 dark:bg-white/5",
52
+ className != null ? className : ""
53
+ ].join(" "),
54
+ children: options.map((opt) => {
55
+ const active = value === opt.value;
56
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
+ import_Button.default,
58
+ {
59
+ size: btnSize,
60
+ variant: active ? "primary" : "ghost",
61
+ color,
62
+ className: "px-4 rounded-xl",
63
+ onClick: () => {
64
+ if (opt.value !== value) onChange(opt.value);
65
+ },
66
+ children: opt.label
67
+ },
68
+ opt.value
69
+ );
70
+ })
71
+ }
72
+ );
73
+ }
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import Button from "./Button";
4
+ function SegmentedTabs({
5
+ value,
6
+ options,
7
+ onChange,
8
+ color = "rose",
9
+ size = "md",
10
+ className
11
+ }) {
12
+ const btnSize = size === "sm" ? "xs" : "sm";
13
+ return /* @__PURE__ */ jsx(
14
+ "div",
15
+ {
16
+ className: [
17
+ "inline-flex rounded-2xl border border-slate-200 bg-slate-50 p-1.5 text-sm",
18
+ "dark:border-white/10 dark:bg-white/5",
19
+ className != null ? className : ""
20
+ ].join(" "),
21
+ children: options.map((opt) => {
22
+ const active = value === opt.value;
23
+ return /* @__PURE__ */ jsx(
24
+ Button,
25
+ {
26
+ size: btnSize,
27
+ variant: active ? "primary" : "ghost",
28
+ color,
29
+ className: "px-4 rounded-xl",
30
+ onClick: () => {
31
+ if (opt.value !== value) onChange(opt.value);
32
+ },
33
+ children: opt.label
34
+ },
35
+ opt.value
36
+ );
37
+ })
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ SegmentedTabs as default
43
+ };
package/dist/index.d.mts CHANGED
@@ -16,6 +16,8 @@ export { default as Pagination, PaginationProps } from './Pagination.mjs';
16
16
  export { default as InfoGrid, InfoItem } from './InfoGrid.mjs';
17
17
  export { default as ChartCard } from './ChartCard.mjs';
18
18
  export { CtrHorizontalBar, DestinoDonut, TopImpresionesBar } from './AnalyticsCharts.mjs';
19
+ export { BarSeries, default as RechartsBarCard, RechartsBarCardProps } from './RechartsBarCard.mjs';
20
+ export { LineSeries, default as RechartsTimeSeriesCard, RechartsTimeSeriesCardProps } from './RechartsTimeSeriesCard.mjs';
19
21
  export { default as UploadCard, UploadCardProps, UploadItem } from './UploadCard.mjs';
20
22
  export { default as MediaCard, MediaCardProps } from './MediaCard.mjs';
21
23
  export { default as MediaTile, MediaTileProps } from './MediaTile.mjs';
@@ -44,6 +46,7 @@ export { default as Link } from './Link.mjs';
44
46
  export { ToastProvider, useToast } from './Toast.mjs';
45
47
  export { default as StorageUsage, StorageUsageProps } from './StorageUsage.mjs';
46
48
  export { default as FileButton, FileButtonProps } from './FileButton.mjs';
49
+ export { SegmentedTabOption, default as SegmentedTabs, SegmentedTabsProps } from './SegmentedTabs.mjs';
47
50
  export { a as Animations } from './animations-CHrNeawW.mjs';
48
51
  export { default as MotionProvider } from './MotionProvider.mjs';
49
52
  export { default as CalendarPanel, CalendarPanelProps } from './CalendarPanel.mjs';
package/dist/index.d.ts CHANGED
@@ -16,6 +16,8 @@ export { default as Pagination, PaginationProps } from './Pagination.js';
16
16
  export { default as InfoGrid, InfoItem } from './InfoGrid.js';
17
17
  export { default as ChartCard } from './ChartCard.js';
18
18
  export { CtrHorizontalBar, DestinoDonut, TopImpresionesBar } from './AnalyticsCharts.js';
19
+ export { BarSeries, default as RechartsBarCard, RechartsBarCardProps } from './RechartsBarCard.js';
20
+ export { LineSeries, default as RechartsTimeSeriesCard, RechartsTimeSeriesCardProps } from './RechartsTimeSeriesCard.js';
19
21
  export { default as UploadCard, UploadCardProps, UploadItem } from './UploadCard.js';
20
22
  export { default as MediaCard, MediaCardProps } from './MediaCard.js';
21
23
  export { default as MediaTile, MediaTileProps } from './MediaTile.js';
@@ -44,6 +46,7 @@ export { default as Link } from './Link.js';
44
46
  export { ToastProvider, useToast } from './Toast.js';
45
47
  export { default as StorageUsage, StorageUsageProps } from './StorageUsage.js';
46
48
  export { default as FileButton, FileButtonProps } from './FileButton.js';
49
+ export { SegmentedTabOption, default as SegmentedTabs, SegmentedTabsProps } from './SegmentedTabs.js';
47
50
  export { a as Animations } from './animations-CHrNeawW.js';
48
51
  export { default as MotionProvider } from './MotionProvider.js';
49
52
  export { default as CalendarPanel, CalendarPanelProps } from './CalendarPanel.js';
package/dist/index.js CHANGED
@@ -69,9 +69,12 @@ __export(index_exports, {
69
69
  MultiComboSelect: () => import_MultiComboSelect.default,
70
70
  OrderButton: () => import_OrderButton.default,
71
71
  Pagination: () => import_Pagination.default,
72
+ RechartsBarCard: () => import_RechartsBarCard.default,
73
+ RechartsTimeSeriesCard: () => import_RechartsTimeSeriesCard.default,
72
74
  ReviewHistory: () => import_ReviewHistory.default,
73
75
  ReviewHistoryDialog: () => import_ReviewHistory2.ReviewHistoryDialog,
74
76
  SearchInput: () => import_SearchInput.default,
77
+ SegmentedTabs: () => import_SegmentedTabs.default,
75
78
  Select: () => import_Select.default,
76
79
  Sidebar: () => import_Sidebar.default,
77
80
  Skeleton: () => import_Skeleton.default,
@@ -119,6 +122,8 @@ var import_Pagination = __toESM(require("./Pagination"));
119
122
  var import_InfoGrid = __toESM(require("./InfoGrid"));
120
123
  var import_ChartCard = __toESM(require("./ChartCard"));
121
124
  var import_AnalyticsCharts = require("./AnalyticsCharts");
125
+ var import_RechartsBarCard = __toESM(require("./RechartsBarCard"));
126
+ var import_RechartsTimeSeriesCard = __toESM(require("./RechartsTimeSeriesCard"));
122
127
  var import_UploadCard = __toESM(require("./UploadCard"));
123
128
  var import_MediaCard = __toESM(require("./MediaCard"));
124
129
  var import_MediaTile = __toESM(require("./MediaTile"));
@@ -148,6 +153,7 @@ var import_Link = __toESM(require("./Link"));
148
153
  var import_Toast = require("./Toast");
149
154
  var import_StorageUsage = __toESM(require("./StorageUsage"));
150
155
  var import_FileButton = __toESM(require("./FileButton"));
156
+ var import_SegmentedTabs = __toESM(require("./SegmentedTabs"));
151
157
  var Animations = __toESM(require("./animations"));
152
158
  var import_MotionProvider = __toESM(require("./MotionProvider"));
153
159
  var import_CalendarPanel = __toESM(require("./CalendarPanel"));
@@ -204,9 +210,12 @@ var import_ThemeToggle = __toESM(require("./theme/ThemeToggle"));
204
210
  MultiComboSelect,
205
211
  OrderButton,
206
212
  Pagination,
213
+ RechartsBarCard,
214
+ RechartsTimeSeriesCard,
207
215
  ReviewHistory,
208
216
  ReviewHistoryDialog,
209
217
  SearchInput,
218
+ SegmentedTabs,
210
219
  Select,
211
220
  Sidebar,
212
221
  Skeleton,
package/dist/index.mjs CHANGED
@@ -18,115 +18,121 @@ import { default as default15 } from "./Pagination";
18
18
  import { default as default16 } from "./InfoGrid";
19
19
  import { default as default17 } from "./ChartCard";
20
20
  import { TopImpresionesBar, CtrHorizontalBar, DestinoDonut } from "./AnalyticsCharts";
21
- import { default as default18 } from "./UploadCard";
22
- import { default as default19 } from "./MediaCard";
23
- import { default as default20 } from "./MediaTile";
24
- import { default as default21 } from "./Skeleton";
25
- import { default as default22 } from "./MediaSelector";
26
- import { default as default23 } from "./StatCard";
27
- import { default as default24 } from "./KpiCard";
28
- import { default as default25 } from "./Badge";
29
- import { default as default26 } from "./BadgeCluster";
30
- import { default as default27 } from "./Breadcrumb";
31
- import { default as default28 } from "./EmptyState";
32
- import { default as default29 } from "./Money";
33
- import { default as default30 } from "./TimeAgo";
34
- import { default as default31 } from "./AvatarSquare";
35
- import { default as default32 } from "./AvatarGroup";
36
- import { default as default33 } from "./AppTopbar";
37
- import { default as default34 } from "./OrderButton";
38
- import { default as default35 } from "./SearchInput";
39
- import { default as default36 } from "./ReviewHistory";
21
+ import { default as default18 } from "./RechartsBarCard";
22
+ import { default as default19 } from "./RechartsTimeSeriesCard";
23
+ import { default as default20 } from "./UploadCard";
24
+ import { default as default21 } from "./MediaCard";
25
+ import { default as default22 } from "./MediaTile";
26
+ import { default as default23 } from "./Skeleton";
27
+ import { default as default24 } from "./MediaSelector";
28
+ import { default as default25 } from "./StatCard";
29
+ import { default as default26 } from "./KpiCard";
30
+ import { default as default27 } from "./Badge";
31
+ import { default as default28 } from "./BadgeCluster";
32
+ import { default as default29 } from "./Breadcrumb";
33
+ import { default as default30 } from "./EmptyState";
34
+ import { default as default31 } from "./Money";
35
+ import { default as default32 } from "./TimeAgo";
36
+ import { default as default33 } from "./AvatarSquare";
37
+ import { default as default34 } from "./AvatarGroup";
38
+ import { default as default35 } from "./AppTopbar";
39
+ import { default as default36 } from "./OrderButton";
40
+ import { default as default37 } from "./SearchInput";
41
+ import { default as default38 } from "./ReviewHistory";
40
42
  import { ReviewHistoryDialog } from "./ReviewHistory";
41
- import { default as default37 } from "./MultiComboSelect";
42
- import { default as default38 } from "./Sidebar";
43
- import { default as default39 } from "./Card";
44
- import { default as default40 } from "./Drawer";
45
- import { default as default41 } from "./Tooltip";
46
- import { default as default42 } from "./Link";
43
+ import { default as default39 } from "./MultiComboSelect";
44
+ import { default as default40 } from "./Sidebar";
45
+ import { default as default41 } from "./Card";
46
+ import { default as default42 } from "./Drawer";
47
+ import { default as default43 } from "./Tooltip";
48
+ import { default as default44 } from "./Link";
47
49
  import { ToastProvider, useToast } from "./Toast";
48
- import { default as default43 } from "./StorageUsage";
49
- import { default as default44 } from "./FileButton";
50
+ import { default as default45 } from "./StorageUsage";
51
+ import { default as default46 } from "./FileButton";
52
+ import { default as default47 } from "./SegmentedTabs";
50
53
  import * as Animations from "./animations";
51
- import { default as default45 } from "./MotionProvider";
52
- import { default as default46 } from "./CalendarPanel";
53
- import { default as default47 } from "./TimePopover";
54
+ import { default as default48 } from "./MotionProvider";
55
+ import { default as default49 } from "./CalendarPanel";
56
+ import { default as default50 } from "./TimePopover";
54
57
  import { WeekPopover, MonthPopover } from "./TimePopover";
55
- import { default as default48 } from "./TimePanel";
56
- import { default as default49 } from "./TimeRangeField";
57
- import { default as default50 } from "./Steps";
58
+ import { default as default51 } from "./TimePanel";
59
+ import { default as default52 } from "./TimeRangeField";
60
+ import { default as default53 } from "./Steps";
58
61
  import { StepsNav } from "./Steps";
59
62
  export * from "./iconos";
60
- import { default as default51 } from "./ColorPicker";
61
- import { default as default52, useTheme } from "./theme/ThemeProvider";
62
- import { default as default53 } from "./theme/ThemeScript";
63
- import { default as default54 } from "./theme/ThemeToggle";
63
+ import { default as default54 } from "./ColorPicker";
64
+ import { default as default55, useTheme } from "./theme/ThemeProvider";
65
+ import { default as default56 } from "./theme/ThemeScript";
66
+ import { default as default57 } from "./theme/ThemeToggle";
64
67
  export {
65
68
  default3 as ActionIconButton,
66
69
  AnimatedBody,
67
70
  Animations,
68
- default33 as AppTopbar,
69
- default32 as AvatarGroup,
70
- default31 as AvatarSquare,
71
- default25 as Badge,
72
- default26 as BadgeCluster,
73
- default27 as Breadcrumb,
71
+ default35 as AppTopbar,
72
+ default34 as AvatarGroup,
73
+ default33 as AvatarSquare,
74
+ default27 as Badge,
75
+ default28 as BadgeCluster,
76
+ default29 as Breadcrumb,
74
77
  default2 as Button,
75
- default46 as CalendarPanel,
76
- default39 as Card,
78
+ default49 as CalendarPanel,
79
+ default41 as Card,
77
80
  default17 as ChartCard,
78
81
  default6 as Checkbox,
79
82
  default7 as CheckboxPillsGroup,
80
- default51 as ColorPicker,
83
+ default54 as ColorPicker,
81
84
  default11 as ColumnSelector,
82
85
  default10 as ComboSelect,
83
86
  CtrHorizontalBar,
84
87
  default12 as DateTimeField,
85
88
  DestinoDonut,
86
89
  default13 as Dialog,
87
- default40 as Drawer,
90
+ default42 as Drawer,
88
91
  default14 as Dropdown,
89
- default28 as EmptyState,
90
- default44 as FileButton,
92
+ default30 as EmptyState,
93
+ default46 as FileButton,
91
94
  default8 as FiltersMultiSelect,
92
95
  default16 as InfoGrid,
93
96
  default4 as Input,
94
- default24 as KpiCard,
95
- default42 as Link,
96
- default19 as MediaCard,
97
- default22 as MediaSelector,
98
- default20 as MediaTile,
99
- default29 as Money,
97
+ default26 as KpiCard,
98
+ default44 as Link,
99
+ default21 as MediaCard,
100
+ default24 as MediaSelector,
101
+ default22 as MediaTile,
102
+ default31 as Money,
100
103
  MonthPopover,
101
- default45 as MotionProvider,
102
- default37 as MultiComboSelect,
103
- default34 as OrderButton,
104
+ default48 as MotionProvider,
105
+ default39 as MultiComboSelect,
106
+ default36 as OrderButton,
104
107
  default15 as Pagination,
105
- default36 as ReviewHistory,
108
+ default18 as RechartsBarCard,
109
+ default19 as RechartsTimeSeriesCard,
110
+ default38 as ReviewHistory,
106
111
  ReviewHistoryDialog,
107
- default35 as SearchInput,
112
+ default37 as SearchInput,
113
+ default47 as SegmentedTabs,
108
114
  default9 as Select,
109
- default38 as Sidebar,
110
- default21 as Skeleton,
115
+ default40 as Sidebar,
116
+ default23 as Skeleton,
111
117
  SortTh,
112
- default23 as StatCard,
113
- default50 as Steps,
118
+ default25 as StatCard,
119
+ default53 as Steps,
114
120
  StepsNav,
115
- default43 as StorageUsage,
121
+ default45 as StorageUsage,
116
122
  Td,
117
123
  default5 as Textarea,
118
124
  Th,
119
- default52 as ThemeProvider,
120
- default53 as ThemeScript,
121
- default54 as ThemeToggle,
122
- default30 as TimeAgo,
123
- default48 as TimePanel,
124
- default47 as TimePopover,
125
- default49 as TimeRangeField,
125
+ default55 as ThemeProvider,
126
+ default56 as ThemeScript,
127
+ default57 as ThemeToggle,
128
+ default32 as TimeAgo,
129
+ default51 as TimePanel,
130
+ default50 as TimePopover,
131
+ default52 as TimeRangeField,
126
132
  ToastProvider,
127
- default41 as Tooltip,
133
+ default43 as Tooltip,
128
134
  TopImpresionesBar,
129
- default18 as UploadCard,
135
+ default20 as UploadCard,
130
136
  WeekPopover,
131
137
  useTheme,
132
138
  useToast
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepexls-ui-lib",
3
- "version": "0.3.15",
3
+ "version": "0.3.17",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Componentes UI de Framepexls para React/Next.",