framepexls-ui-lib 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionIconButton.d.mts +11 -0
- package/dist/ActionIconButton.d.ts +11 -0
- package/dist/ActionIconButton.js +71 -0
- package/dist/ActionIconButton.mjs +41 -0
- package/dist/AppTopbar.d.mts +17 -0
- package/dist/AppTopbar.d.ts +17 -0
- package/dist/AppTopbar.js +51 -0
- package/dist/AppTopbar.mjs +31 -0
- package/dist/AvatarSquare.d.mts +16 -0
- package/dist/AvatarSquare.d.ts +16 -0
- package/dist/AvatarSquare.js +82 -0
- package/dist/AvatarSquare.mjs +52 -0
- package/dist/Badge.d.mts +13 -0
- package/dist/Badge.d.ts +13 -0
- package/dist/Badge.js +65 -0
- package/dist/Badge.mjs +45 -0
- package/dist/BadgeCluster.d.mts +17 -0
- package/dist/BadgeCluster.d.ts +17 -0
- package/dist/BadgeCluster.js +125 -0
- package/dist/BadgeCluster.mjs +95 -0
- package/dist/Breadcrumb.d.mts +11 -0
- package/dist/Breadcrumb.d.ts +11 -0
- package/dist/Breadcrumb.js +42 -0
- package/dist/Breadcrumb.mjs +12 -0
- package/dist/Button.d.mts +15 -0
- package/dist/Button.d.ts +15 -0
- package/dist/Button.js +72 -0
- package/dist/Button.mjs +52 -0
- package/dist/CalendarPanel.d.mts +13 -0
- package/dist/CalendarPanel.d.ts +13 -0
- package/dist/CalendarPanel.js +110 -0
- package/dist/CalendarPanel.mjs +90 -0
- package/dist/ChartCard.d.mts +15 -0
- package/dist/ChartCard.d.ts +15 -0
- package/dist/ChartCard.js +44 -0
- package/dist/ChartCard.mjs +24 -0
- package/dist/CheckboxPillsGroup.d.mts +28 -0
- package/dist/CheckboxPillsGroup.d.ts +28 -0
- package/dist/CheckboxPillsGroup.js +186 -0
- package/dist/CheckboxPillsGroup.mjs +156 -0
- package/dist/ColumnSelector.d.mts +17 -0
- package/dist/ColumnSelector.d.ts +17 -0
- package/dist/ColumnSelector.js +74 -0
- package/dist/ColumnSelector.mjs +54 -0
- package/dist/ComboSelect.d.mts +46 -0
- package/dist/ComboSelect.d.ts +46 -0
- package/dist/ComboSelect.js +442 -0
- package/dist/ComboSelect.mjs +412 -0
- package/dist/DateTimeField.d.mts +22 -0
- package/dist/DateTimeField.d.ts +22 -0
- package/dist/DateTimeField.js +409 -0
- package/dist/DateTimeField.mjs +379 -0
- package/dist/Dialog.d.mts +82 -0
- package/dist/Dialog.d.ts +82 -0
- package/dist/Dialog.js +408 -0
- package/dist/Dialog.mjs +368 -0
- package/dist/Dropdown.d.mts +52 -0
- package/dist/Dropdown.d.ts +52 -0
- package/dist/Dropdown.js +333 -0
- package/dist/Dropdown.mjs +313 -0
- package/dist/EmptyState.d.mts +8 -0
- package/dist/EmptyState.d.ts +8 -0
- package/dist/EmptyState.js +35 -0
- package/dist/EmptyState.mjs +15 -0
- package/dist/InfoGrid.d.mts +20 -0
- package/dist/InfoGrid.d.ts +20 -0
- package/dist/InfoGrid.js +67 -0
- package/dist/InfoGrid.mjs +47 -0
- package/dist/Input.d.mts +20 -0
- package/dist/Input.d.ts +20 -0
- package/dist/Input.js +85 -0
- package/dist/Input.mjs +55 -0
- package/dist/Money.d.mts +8 -0
- package/dist/Money.d.ts +8 -0
- package/dist/Money.js +30 -0
- package/dist/Money.mjs +10 -0
- package/dist/OrderButton.d.mts +11 -0
- package/dist/OrderButton.d.ts +11 -0
- package/dist/OrderButton.js +39 -0
- package/dist/OrderButton.mjs +19 -0
- package/dist/Pagination.d.mts +12 -0
- package/dist/Pagination.d.ts +12 -0
- package/dist/Pagination.js +71 -0
- package/dist/Pagination.mjs +51 -0
- package/dist/SearchInput.d.mts +17 -0
- package/dist/SearchInput.d.ts +17 -0
- package/dist/SearchInput.js +116 -0
- package/dist/SearchInput.mjs +86 -0
- package/dist/Select.d.mts +31 -0
- package/dist/Select.d.ts +31 -0
- package/dist/Select.js +293 -0
- package/dist/Select.mjs +263 -0
- package/dist/StatCard.d.mts +15 -0
- package/dist/StatCard.d.ts +15 -0
- package/dist/StatCard.js +47 -0
- package/dist/StatCard.mjs +27 -0
- package/dist/Steps.d.mts +31 -0
- package/dist/Steps.d.ts +31 -0
- package/dist/Steps.js +123 -0
- package/dist/Steps.mjs +99 -0
- package/dist/Table.d.mts +31 -0
- package/dist/Table.d.ts +31 -0
- package/dist/Table.js +153 -0
- package/dist/Table.mjs +117 -0
- package/dist/TimeAgo.d.mts +12 -0
- package/dist/TimeAgo.d.ts +12 -0
- package/dist/TimeAgo.js +104 -0
- package/dist/TimeAgo.mjs +74 -0
- package/dist/TimePanel.d.mts +14 -0
- package/dist/TimePanel.d.ts +14 -0
- package/dist/TimePanel.js +145 -0
- package/dist/TimePanel.mjs +125 -0
- package/dist/TimePopover.d.mts +33 -0
- package/dist/TimePopover.d.ts +33 -0
- package/dist/TimePopover.js +441 -0
- package/dist/TimePopover.mjs +406 -0
- package/dist/iconos/index.d.mts +60 -0
- package/dist/iconos/index.d.ts +60 -0
- package/dist/iconos/index.js +621 -0
- package/dist/iconos/index.mjs +548 -0
- package/dist/index.d.mts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +141 -0
- package/dist/index.mjs +70 -0
- package/package.json +178 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
4
|
+
const fmtISODate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
5
|
+
const dow = ["D", "L", "M", "M", "J", "V", "S"];
|
|
6
|
+
function buildMonthGrid(year, monthIdx0) {
|
|
7
|
+
const firstOfMonth = new Date(year, monthIdx0, 1);
|
|
8
|
+
const start = new Date(firstOfMonth);
|
|
9
|
+
start.setDate(firstOfMonth.getDate() - firstOfMonth.getDay());
|
|
10
|
+
return Array.from({ length: 42 }, (_, i) => {
|
|
11
|
+
const d = new Date(start);
|
|
12
|
+
d.setDate(start.getDate() + i);
|
|
13
|
+
return d;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function CalendarPanel({
|
|
17
|
+
cursor,
|
|
18
|
+
value,
|
|
19
|
+
min,
|
|
20
|
+
max,
|
|
21
|
+
onCursorChange,
|
|
22
|
+
onPick
|
|
23
|
+
}) {
|
|
24
|
+
const year = cursor.getFullYear();
|
|
25
|
+
const month = cursor.getMonth();
|
|
26
|
+
const today = /* @__PURE__ */ new Date();
|
|
27
|
+
const grid = buildMonthGrid(year, month);
|
|
28
|
+
const withinBounds = (d) => {
|
|
29
|
+
if (!min && !max) return true;
|
|
30
|
+
const t = d.getTime();
|
|
31
|
+
if (min) {
|
|
32
|
+
const m = new Date(min);
|
|
33
|
+
if (!isNaN(m) && t < m.getTime()) return false;
|
|
34
|
+
}
|
|
35
|
+
if (max) {
|
|
36
|
+
const M = new Date(max);
|
|
37
|
+
if (!isNaN(M) && t > M.getTime()) return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
49
|
+
onClick: () => onCursorChange(new Date(year, month - 1, 1)),
|
|
50
|
+
children: "\u25C0"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
|
|
57
|
+
onClick: () => onCursorChange(new Date(year, month + 1, 1)),
|
|
58
|
+
children: "\u25B6"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 px-2 pb-2 text-center text-[11px] uppercase tracking-wide text-slate-500", children: dow.map((d, i) => /* @__PURE__ */ jsx("div", { className: "py-1", children: d }, i)) }),
|
|
64
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 px-2 pb-2", children: grid.map((d) => {
|
|
65
|
+
const inMonth = d.getMonth() === month;
|
|
66
|
+
const selected = value && fmtISODate(d) === fmtISODate(value);
|
|
67
|
+
const isToday = fmtISODate(d) === fmtISODate(today);
|
|
68
|
+
const disabled = !withinBounds(d);
|
|
69
|
+
const key = d.toISOString().slice(0, 10);
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"button",
|
|
72
|
+
{
|
|
73
|
+
disabled,
|
|
74
|
+
onClick: () => !disabled && onPick(d),
|
|
75
|
+
className: [
|
|
76
|
+
"h-9 rounded-xl text-sm flex items-center justify-center leading-none",
|
|
77
|
+
selected ? "bg-slate-900 text-white dark:bg-white dark:text-slate-900" : isToday ? "border border-slate-300/70 dark:border-white/10" : "hover:bg-slate-100 dark:hover:bg-white/10",
|
|
78
|
+
!inMonth && "text-slate-400",
|
|
79
|
+
disabled && "opacity-40 cursor-not-allowed"
|
|
80
|
+
].filter(Boolean).join(" "),
|
|
81
|
+
children: d.getDate()
|
|
82
|
+
},
|
|
83
|
+
key
|
|
84
|
+
);
|
|
85
|
+
}) })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
CalendarPanel as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
title?: React__default.ReactNode;
|
|
6
|
+
subtitle?: React__default.ReactNode;
|
|
7
|
+
right?: React__default.ReactNode;
|
|
8
|
+
children: React__default.ReactNode;
|
|
9
|
+
footer?: React__default.ReactNode;
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function ChartCard({ title, subtitle, right, children, footer, compact, className }: Props): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { ChartCard as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
title?: React__default.ReactNode;
|
|
6
|
+
subtitle?: React__default.ReactNode;
|
|
7
|
+
right?: React__default.ReactNode;
|
|
8
|
+
children: React__default.ReactNode;
|
|
9
|
+
footer?: React__default.ReactNode;
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function ChartCard({ title, subtitle, right, children, footer, compact, className }: Props): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { ChartCard as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var ChartCard_exports = {};
|
|
21
|
+
__export(ChartCard_exports, {
|
|
22
|
+
default: () => ChartCard
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ChartCard_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
function ChartCard({ title, subtitle, right, children, footer, compact, className }) {
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: ["relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5", className != null ? className : ""].join(" "),
|
|
31
|
+
children: [
|
|
32
|
+
(title || subtitle || right) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: ["flex items-center justify-between gap-3 border-b border-slate-100 px-4", compact ? "py-2" : "py-3", "dark:border-white/10"].join(" "), children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
34
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold text-slate-700 dark:text-slate-100", children: title }),
|
|
35
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-slate-500", children: subtitle })
|
|
36
|
+
] }),
|
|
37
|
+
right
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ["", compact ? "p-3" : "p-4"].join(" "), children }),
|
|
40
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: ["border-t border-slate-100 px-4 text-xs text-slate-500", compact ? "py-2" : "py-3", "dark:border-white/10"].join(" "), children: footer })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function ChartCard({ title, subtitle, right, children, footer, compact, className }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: ["relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5", className != null ? className : ""].join(" "),
|
|
8
|
+
children: [
|
|
9
|
+
(title || subtitle || right) && /* @__PURE__ */ jsxs("div", { className: ["flex items-center justify-between gap-3 border-b border-slate-100 px-4", compact ? "py-2" : "py-3", "dark:border-white/10"].join(" "), children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11
|
+
title && /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-slate-700 dark:text-slate-100", children: title }),
|
|
12
|
+
subtitle && /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500", children: subtitle })
|
|
13
|
+
] }),
|
|
14
|
+
right
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ jsx("div", { className: ["", compact ? "p-3" : "p-4"].join(" "), children }),
|
|
17
|
+
footer && /* @__PURE__ */ jsx("div", { className: ["border-t border-slate-100 px-4 text-xs text-slate-500", compact ? "py-2" : "py-3", "dark:border-white/10"].join(" "), children: footer })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
ChartCard as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type PillsOption = string | {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: React__default.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
};
|
|
10
|
+
type CheckboxPillsGroupProps = {
|
|
11
|
+
options: PillsOption[];
|
|
12
|
+
value: string[];
|
|
13
|
+
onChange: (next: string[]) => void;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
name?: string;
|
|
16
|
+
label?: React__default.ReactNode;
|
|
17
|
+
emptyText?: React__default.ReactNode;
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
accent?: "rose" | "sky" | "violet" | "emerald" | "indigo" | "amber" | "slate";
|
|
20
|
+
variant?: "soft" | "outline" | "glass";
|
|
21
|
+
rounded?: "md" | "xl" | "2xl" | "full";
|
|
22
|
+
withIcon?: boolean;
|
|
23
|
+
maxSelected?: number;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function CheckboxPillsGroup({ options, value, onChange, multiple, name, label, emptyText, size, accent, variant, rounded, withIcon, maxSelected, className, }: CheckboxPillsGroupProps): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { type CheckboxPillsGroupProps, type PillsOption, CheckboxPillsGroup as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type PillsOption = string | {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: React__default.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
};
|
|
10
|
+
type CheckboxPillsGroupProps = {
|
|
11
|
+
options: PillsOption[];
|
|
12
|
+
value: string[];
|
|
13
|
+
onChange: (next: string[]) => void;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
name?: string;
|
|
16
|
+
label?: React__default.ReactNode;
|
|
17
|
+
emptyText?: React__default.ReactNode;
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
accent?: "rose" | "sky" | "violet" | "emerald" | "indigo" | "amber" | "slate";
|
|
20
|
+
variant?: "soft" | "outline" | "glass";
|
|
21
|
+
rounded?: "md" | "xl" | "2xl" | "full";
|
|
22
|
+
withIcon?: boolean;
|
|
23
|
+
maxSelected?: number;
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function CheckboxPillsGroup({ options, value, onChange, multiple, name, label, emptyText, size, accent, variant, rounded, withIcon, maxSelected, className, }: CheckboxPillsGroupProps): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { type CheckboxPillsGroupProps, type PillsOption, CheckboxPillsGroup as default };
|
|
@@ -0,0 +1,186 @@
|
|
|
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 CheckboxPillsGroup_exports = {};
|
|
31
|
+
__export(CheckboxPillsGroup_exports, {
|
|
32
|
+
default: () => CheckboxPillsGroup
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(CheckboxPillsGroup_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
const cx = (...a) => a.filter(Boolean).join(" ");
|
|
38
|
+
function toObj(opt) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (typeof opt === "string") return { value: opt, label: opt, disabled: false, title: opt };
|
|
41
|
+
return {
|
|
42
|
+
value: opt.value,
|
|
43
|
+
label: (_a = opt.label) != null ? _a : opt.value,
|
|
44
|
+
disabled: !!opt.disabled,
|
|
45
|
+
title: (_b = opt.title) != null ? _b : typeof opt.label === "string" ? opt.label : opt.value
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const SIZE = {
|
|
49
|
+
sm: { text: "text-[13px]", padX: "px-3", padY: "py-1.5", height: "h-8", icon: "h-3.5 w-3.5" },
|
|
50
|
+
md: { text: "text-sm", padX: "px-3.5", padY: "py-2", height: "h-9", icon: "h-4 w-4" }
|
|
51
|
+
};
|
|
52
|
+
const ACTIVE_SOFT = {
|
|
53
|
+
rose: "border-blue-300 bg-blue-50/80 text-blue-700 dark:border-blue-400/40 dark:bg-blue-500/10 dark:text-blue-200",
|
|
54
|
+
sky: "border-sky-300 bg-sky-50/80 text-sky-700 dark:border-sky-400/40 dark:bg-sky-500/10 dark:text-sky-200",
|
|
55
|
+
violet: "border-blue-300 bg-blue-50/80 text-blue-700 dark:border-blue-400/40 dark:bg-blue-500/10 dark:text-blue-200",
|
|
56
|
+
emerald: "border-emerald-300 bg-emerald-50/80 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/10 dark:text-emerald-200",
|
|
57
|
+
indigo: "border-indigo-300 bg-indigo-50/80 text-indigo-700 dark:border-indigo-400/40 dark:bg-indigo-500/10 dark:text-indigo-200",
|
|
58
|
+
amber: "border-amber-300 bg-amber-50/80 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/10 dark:text-amber-200",
|
|
59
|
+
slate: "border-slate-300 bg-slate-50/80 text-slate-700 dark:border-slate-400/40 dark:bg-slate-500/10 dark:text-slate-200"
|
|
60
|
+
};
|
|
61
|
+
const ACTIVE_OUTLINE = {
|
|
62
|
+
rose: "border-blue-400 text-blue-700 dark:text-blue-200",
|
|
63
|
+
sky: "border-sky-400 text-sky-700 dark:text-sky-200",
|
|
64
|
+
violet: "border-blue-400 text-blue-700 dark:text-blue-200",
|
|
65
|
+
emerald: "border-emerald-400 text-emerald-700 dark:text-emerald-200",
|
|
66
|
+
indigo: "border-indigo-400 text-indigo-700 dark:text-indigo-200",
|
|
67
|
+
amber: "border-amber-400 text-amber-700 dark:text-amber-200",
|
|
68
|
+
slate: "border-slate-400 text-slate-700 dark:text-slate-200"
|
|
69
|
+
};
|
|
70
|
+
const ACTIVE_GLASS = {
|
|
71
|
+
rose: "border-blue-300 bg-gradient-to-br from-blue-50 to-blue-50/0 text-blue-700 dark:from-blue-400/10 dark:text-blue-200",
|
|
72
|
+
sky: "border-sky-300 bg-gradient-to-br from-sky-50 to-sky-50/0 text-sky-700 dark:from-sky-400/10 dark:text-sky-200",
|
|
73
|
+
violet: "border-blue-300 bg-gradient-to-br from-blue-50 to-blue-50/0 text-blue-700 dark:from-blue-400/10 dark:text-blue-200",
|
|
74
|
+
emerald: "border-emerald-300 bg-gradient-to-br from-emerald-50 to-emerald-50/0 text-emerald-700 dark:from-emerald-400/10 dark:text-emerald-200",
|
|
75
|
+
indigo: "border-indigo-300 bg-gradient-to-br from-indigo-50 to-indigo-50/0 text-indigo-700 dark:from-indigo-400/10 dark:text-indigo-200",
|
|
76
|
+
amber: "border-amber-300 bg-gradient-to-br from-amber-50 to-amber-50/0 text-amber-700 dark:from-amber-400/10 dark:text-amber-200",
|
|
77
|
+
slate: "border-slate-300 bg-gradient-to-br from-slate-50 to-slate-50/0 text-slate-700 dark:from-slate-400/10 dark:text-slate-200"
|
|
78
|
+
};
|
|
79
|
+
function activeClasses(accent, variant) {
|
|
80
|
+
if (variant === "soft") return ACTIVE_SOFT[accent];
|
|
81
|
+
if (variant === "outline") return ACTIVE_OUTLINE[accent] + " bg-white/70 dark:bg-white/5";
|
|
82
|
+
return ACTIVE_GLASS[accent] + " backdrop-blur-[2px]";
|
|
83
|
+
}
|
|
84
|
+
const NEUTRAL = "border-slate-200 bg-white/70 text-slate-700 hover:bg-slate-50 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:hover:bg-white/10";
|
|
85
|
+
function CheckboxPillsGroup({
|
|
86
|
+
options,
|
|
87
|
+
value,
|
|
88
|
+
onChange,
|
|
89
|
+
multiple = false,
|
|
90
|
+
name,
|
|
91
|
+
label,
|
|
92
|
+
emptyText = "No hay elementos.",
|
|
93
|
+
size = "md",
|
|
94
|
+
accent = "rose",
|
|
95
|
+
variant = "glass",
|
|
96
|
+
rounded = "full",
|
|
97
|
+
withIcon = true,
|
|
98
|
+
maxSelected,
|
|
99
|
+
className
|
|
100
|
+
}) {
|
|
101
|
+
const opts = import_react.default.useMemo(() => options.map(toObj), [options]);
|
|
102
|
+
const sz = SIZE[size];
|
|
103
|
+
const radius = rounded === "full" ? "rounded-full" : rounded === "2xl" ? "rounded-2xl" : rounded === "md" ? "rounded-md" : "rounded-xl";
|
|
104
|
+
const baseChip = cx(
|
|
105
|
+
"relative inline-flex items-center whitespace-nowrap select-none",
|
|
106
|
+
"border transition-[background-color,border-color,color,opacity] duration-150 ease-out",
|
|
107
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-slate-300 dark:focus-visible:ring-white/20",
|
|
108
|
+
sz.height,
|
|
109
|
+
sz.padX,
|
|
110
|
+
sz.padY,
|
|
111
|
+
sz.text,
|
|
112
|
+
"shadow-[0_1px_0_rgba(2,6,23,0.05)] dark:shadow-[0_1px_0_rgba(255,255,255,0.04)]",
|
|
113
|
+
radius
|
|
114
|
+
);
|
|
115
|
+
const isActive = (v) => multiple ? value.includes(v) : value[0] === v;
|
|
116
|
+
const toggle = (v, disabled) => {
|
|
117
|
+
if (disabled) return;
|
|
118
|
+
if (multiple) {
|
|
119
|
+
const exists = value.includes(v);
|
|
120
|
+
if (!exists) {
|
|
121
|
+
if (typeof maxSelected === "number" && value.length >= maxSelected) return;
|
|
122
|
+
onChange([...value, v]);
|
|
123
|
+
} else {
|
|
124
|
+
onChange(value.filter((x) => x !== v));
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
const isOn = value[0] === v;
|
|
128
|
+
onChange(isOn ? [] : [v]);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("mt-2 space-y-2", className), children: [
|
|
132
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cx("font-medium text-slate-700 dark:text-slate-200", sz.text), children: label }),
|
|
133
|
+
opts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-slate-500", children: emptyText }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { role: multiple ? "group" : "radiogroup", className: "flex flex-wrap gap-2", children: opts.map((o) => {
|
|
134
|
+
const active = isActive(o.value);
|
|
135
|
+
const disabled = !!o.disabled;
|
|
136
|
+
const canSelectMore = multiple && typeof maxSelected === "number" ? active || value.length < maxSelected : true;
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
138
|
+
"label",
|
|
139
|
+
{
|
|
140
|
+
title: o.title,
|
|
141
|
+
className: cx(
|
|
142
|
+
baseChip,
|
|
143
|
+
active ? activeClasses(accent, variant) : NEUTRAL,
|
|
144
|
+
(disabled || !canSelectMore) && !active && "cursor-not-allowed opacity-60"
|
|
145
|
+
),
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
"input",
|
|
149
|
+
{
|
|
150
|
+
type: multiple ? "checkbox" : "radio",
|
|
151
|
+
name: !multiple ? name != null ? name : "pills-group" : void 0,
|
|
152
|
+
className: "sr-only",
|
|
153
|
+
checked: active,
|
|
154
|
+
disabled: disabled || !canSelectMore && !active,
|
|
155
|
+
onChange: () => toggle(o.value, disabled || !canSelectMore && !active)
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
withIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "relative mr-2 inline-block h-[22px] w-[22px] flex-none", children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cx("absolute inset-0 grid place-items-center transition-opacity duration-150", active ? "opacity-0" : "opacity-100"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "grid place-items-center rounded-full border border-slate-300/80 bg-white/70 text-slate-500 dark:border-white/15 dark:bg-white/5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: sz.icon, fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "7" }) }) }) }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cx("absolute inset-0 grid place-items-center transition-opacity duration-150", active ? "opacity-100" : "opacity-0"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
className: cx(
|
|
164
|
+
"grid place-items-center rounded-full",
|
|
165
|
+
{
|
|
166
|
+
rose: "bg-blue-500/10 text-blue-600",
|
|
167
|
+
sky: "bg-sky-500/10 text-sky-600",
|
|
168
|
+
violet: "bg-blue-500/10 text-blue-600",
|
|
169
|
+
emerald: "bg-emerald-500/10 text-emerald-600",
|
|
170
|
+
indigo: "bg-indigo-500/10 text-indigo-600",
|
|
171
|
+
amber: "bg-amber-500/10 text-amber-600",
|
|
172
|
+
slate: "bg-slate-500/10 text-slate-600"
|
|
173
|
+
}[accent]
|
|
174
|
+
),
|
|
175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: sz.icon, fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5 12 4 4 10-10" }) })
|
|
176
|
+
}
|
|
177
|
+
) })
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate", children: o.label })
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
o.value
|
|
183
|
+
);
|
|
184
|
+
}) })
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
const cx = (...a) => a.filter(Boolean).join(" ");
|
|
5
|
+
function toObj(opt) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (typeof opt === "string") return { value: opt, label: opt, disabled: false, title: opt };
|
|
8
|
+
return {
|
|
9
|
+
value: opt.value,
|
|
10
|
+
label: (_a = opt.label) != null ? _a : opt.value,
|
|
11
|
+
disabled: !!opt.disabled,
|
|
12
|
+
title: (_b = opt.title) != null ? _b : typeof opt.label === "string" ? opt.label : opt.value
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const SIZE = {
|
|
16
|
+
sm: { text: "text-[13px]", padX: "px-3", padY: "py-1.5", height: "h-8", icon: "h-3.5 w-3.5" },
|
|
17
|
+
md: { text: "text-sm", padX: "px-3.5", padY: "py-2", height: "h-9", icon: "h-4 w-4" }
|
|
18
|
+
};
|
|
19
|
+
const ACTIVE_SOFT = {
|
|
20
|
+
rose: "border-blue-300 bg-blue-50/80 text-blue-700 dark:border-blue-400/40 dark:bg-blue-500/10 dark:text-blue-200",
|
|
21
|
+
sky: "border-sky-300 bg-sky-50/80 text-sky-700 dark:border-sky-400/40 dark:bg-sky-500/10 dark:text-sky-200",
|
|
22
|
+
violet: "border-blue-300 bg-blue-50/80 text-blue-700 dark:border-blue-400/40 dark:bg-blue-500/10 dark:text-blue-200",
|
|
23
|
+
emerald: "border-emerald-300 bg-emerald-50/80 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/10 dark:text-emerald-200",
|
|
24
|
+
indigo: "border-indigo-300 bg-indigo-50/80 text-indigo-700 dark:border-indigo-400/40 dark:bg-indigo-500/10 dark:text-indigo-200",
|
|
25
|
+
amber: "border-amber-300 bg-amber-50/80 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/10 dark:text-amber-200",
|
|
26
|
+
slate: "border-slate-300 bg-slate-50/80 text-slate-700 dark:border-slate-400/40 dark:bg-slate-500/10 dark:text-slate-200"
|
|
27
|
+
};
|
|
28
|
+
const ACTIVE_OUTLINE = {
|
|
29
|
+
rose: "border-blue-400 text-blue-700 dark:text-blue-200",
|
|
30
|
+
sky: "border-sky-400 text-sky-700 dark:text-sky-200",
|
|
31
|
+
violet: "border-blue-400 text-blue-700 dark:text-blue-200",
|
|
32
|
+
emerald: "border-emerald-400 text-emerald-700 dark:text-emerald-200",
|
|
33
|
+
indigo: "border-indigo-400 text-indigo-700 dark:text-indigo-200",
|
|
34
|
+
amber: "border-amber-400 text-amber-700 dark:text-amber-200",
|
|
35
|
+
slate: "border-slate-400 text-slate-700 dark:text-slate-200"
|
|
36
|
+
};
|
|
37
|
+
const ACTIVE_GLASS = {
|
|
38
|
+
rose: "border-blue-300 bg-gradient-to-br from-blue-50 to-blue-50/0 text-blue-700 dark:from-blue-400/10 dark:text-blue-200",
|
|
39
|
+
sky: "border-sky-300 bg-gradient-to-br from-sky-50 to-sky-50/0 text-sky-700 dark:from-sky-400/10 dark:text-sky-200",
|
|
40
|
+
violet: "border-blue-300 bg-gradient-to-br from-blue-50 to-blue-50/0 text-blue-700 dark:from-blue-400/10 dark:text-blue-200",
|
|
41
|
+
emerald: "border-emerald-300 bg-gradient-to-br from-emerald-50 to-emerald-50/0 text-emerald-700 dark:from-emerald-400/10 dark:text-emerald-200",
|
|
42
|
+
indigo: "border-indigo-300 bg-gradient-to-br from-indigo-50 to-indigo-50/0 text-indigo-700 dark:from-indigo-400/10 dark:text-indigo-200",
|
|
43
|
+
amber: "border-amber-300 bg-gradient-to-br from-amber-50 to-amber-50/0 text-amber-700 dark:from-amber-400/10 dark:text-amber-200",
|
|
44
|
+
slate: "border-slate-300 bg-gradient-to-br from-slate-50 to-slate-50/0 text-slate-700 dark:from-slate-400/10 dark:text-slate-200"
|
|
45
|
+
};
|
|
46
|
+
function activeClasses(accent, variant) {
|
|
47
|
+
if (variant === "soft") return ACTIVE_SOFT[accent];
|
|
48
|
+
if (variant === "outline") return ACTIVE_OUTLINE[accent] + " bg-white/70 dark:bg-white/5";
|
|
49
|
+
return ACTIVE_GLASS[accent] + " backdrop-blur-[2px]";
|
|
50
|
+
}
|
|
51
|
+
const NEUTRAL = "border-slate-200 bg-white/70 text-slate-700 hover:bg-slate-50 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:hover:bg-white/10";
|
|
52
|
+
function CheckboxPillsGroup({
|
|
53
|
+
options,
|
|
54
|
+
value,
|
|
55
|
+
onChange,
|
|
56
|
+
multiple = false,
|
|
57
|
+
name,
|
|
58
|
+
label,
|
|
59
|
+
emptyText = "No hay elementos.",
|
|
60
|
+
size = "md",
|
|
61
|
+
accent = "rose",
|
|
62
|
+
variant = "glass",
|
|
63
|
+
rounded = "full",
|
|
64
|
+
withIcon = true,
|
|
65
|
+
maxSelected,
|
|
66
|
+
className
|
|
67
|
+
}) {
|
|
68
|
+
const opts = React.useMemo(() => options.map(toObj), [options]);
|
|
69
|
+
const sz = SIZE[size];
|
|
70
|
+
const radius = rounded === "full" ? "rounded-full" : rounded === "2xl" ? "rounded-2xl" : rounded === "md" ? "rounded-md" : "rounded-xl";
|
|
71
|
+
const baseChip = cx(
|
|
72
|
+
"relative inline-flex items-center whitespace-nowrap select-none",
|
|
73
|
+
"border transition-[background-color,border-color,color,opacity] duration-150 ease-out",
|
|
74
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-slate-300 dark:focus-visible:ring-white/20",
|
|
75
|
+
sz.height,
|
|
76
|
+
sz.padX,
|
|
77
|
+
sz.padY,
|
|
78
|
+
sz.text,
|
|
79
|
+
"shadow-[0_1px_0_rgba(2,6,23,0.05)] dark:shadow-[0_1px_0_rgba(255,255,255,0.04)]",
|
|
80
|
+
radius
|
|
81
|
+
);
|
|
82
|
+
const isActive = (v) => multiple ? value.includes(v) : value[0] === v;
|
|
83
|
+
const toggle = (v, disabled) => {
|
|
84
|
+
if (disabled) return;
|
|
85
|
+
if (multiple) {
|
|
86
|
+
const exists = value.includes(v);
|
|
87
|
+
if (!exists) {
|
|
88
|
+
if (typeof maxSelected === "number" && value.length >= maxSelected) return;
|
|
89
|
+
onChange([...value, v]);
|
|
90
|
+
} else {
|
|
91
|
+
onChange(value.filter((x) => x !== v));
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
const isOn = value[0] === v;
|
|
95
|
+
onChange(isOn ? [] : [v]);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("mt-2 space-y-2", className), children: [
|
|
99
|
+
label && /* @__PURE__ */ jsx("div", { className: cx("font-medium text-slate-700 dark:text-slate-200", sz.text), children: label }),
|
|
100
|
+
opts.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500", children: emptyText }) : /* @__PURE__ */ jsx("div", { role: multiple ? "group" : "radiogroup", className: "flex flex-wrap gap-2", children: opts.map((o) => {
|
|
101
|
+
const active = isActive(o.value);
|
|
102
|
+
const disabled = !!o.disabled;
|
|
103
|
+
const canSelectMore = multiple && typeof maxSelected === "number" ? active || value.length < maxSelected : true;
|
|
104
|
+
return /* @__PURE__ */ jsxs(
|
|
105
|
+
"label",
|
|
106
|
+
{
|
|
107
|
+
title: o.title,
|
|
108
|
+
className: cx(
|
|
109
|
+
baseChip,
|
|
110
|
+
active ? activeClasses(accent, variant) : NEUTRAL,
|
|
111
|
+
(disabled || !canSelectMore) && !active && "cursor-not-allowed opacity-60"
|
|
112
|
+
),
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"input",
|
|
116
|
+
{
|
|
117
|
+
type: multiple ? "checkbox" : "radio",
|
|
118
|
+
name: !multiple ? name != null ? name : "pills-group" : void 0,
|
|
119
|
+
className: "sr-only",
|
|
120
|
+
checked: active,
|
|
121
|
+
disabled: disabled || !canSelectMore && !active,
|
|
122
|
+
onChange: () => toggle(o.value, disabled || !canSelectMore && !active)
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
withIcon && /* @__PURE__ */ jsxs("span", { className: "relative mr-2 inline-block h-[22px] w-[22px] flex-none", children: [
|
|
126
|
+
/* @__PURE__ */ jsx("span", { className: cx("absolute inset-0 grid place-items-center transition-opacity duration-150", active ? "opacity-0" : "opacity-100"), children: /* @__PURE__ */ jsx("span", { className: "grid place-items-center rounded-full border border-slate-300/80 bg-white/70 text-slate-500 dark:border-white/15 dark:bg-white/5", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: sz.icon, fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "7" }) }) }) }),
|
|
127
|
+
/* @__PURE__ */ jsx("span", { className: cx("absolute inset-0 grid place-items-center transition-opacity duration-150", active ? "opacity-100" : "opacity-0"), children: /* @__PURE__ */ jsx(
|
|
128
|
+
"span",
|
|
129
|
+
{
|
|
130
|
+
className: cx(
|
|
131
|
+
"grid place-items-center rounded-full",
|
|
132
|
+
{
|
|
133
|
+
rose: "bg-blue-500/10 text-blue-600",
|
|
134
|
+
sky: "bg-sky-500/10 text-sky-600",
|
|
135
|
+
violet: "bg-blue-500/10 text-blue-600",
|
|
136
|
+
emerald: "bg-emerald-500/10 text-emerald-600",
|
|
137
|
+
indigo: "bg-indigo-500/10 text-indigo-600",
|
|
138
|
+
amber: "bg-amber-500/10 text-amber-600",
|
|
139
|
+
slate: "bg-slate-500/10 text-slate-600"
|
|
140
|
+
}[accent]
|
|
141
|
+
),
|
|
142
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: sz.icon, fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { d: "m5 12 4 4 10-10" }) })
|
|
143
|
+
}
|
|
144
|
+
) })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: o.label })
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
o.value
|
|
150
|
+
);
|
|
151
|
+
}) })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
CheckboxPillsGroup as default
|
|
156
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type ColumnItem<K extends string> = {
|
|
5
|
+
key: K;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
type ColumnSelectorProps<K extends string> = {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onToggleOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
11
|
+
items: ColumnItem<K>[];
|
|
12
|
+
visible: Record<K, boolean>;
|
|
13
|
+
setVisible: (key: K, val: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
declare function ColumnSelector<K extends string>({ open, onToggleOpen, items, visible, setVisible, }: ColumnSelectorProps<K>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { type ColumnItem, ColumnSelector as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type ColumnItem<K extends string> = {
|
|
5
|
+
key: K;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
type ColumnSelectorProps<K extends string> = {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onToggleOpen: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
11
|
+
items: ColumnItem<K>[];
|
|
12
|
+
visible: Record<K, boolean>;
|
|
13
|
+
setVisible: (key: K, val: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
declare function ColumnSelector<K extends string>({ open, onToggleOpen, items, visible, setVisible, }: ColumnSelectorProps<K>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { type ColumnItem, ColumnSelector as default };
|