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,145 @@
|
|
|
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 TimePanel_exports = {};
|
|
21
|
+
__export(TimePanel_exports, {
|
|
22
|
+
default: () => TimePopover
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(TimePanel_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
28
|
+
function TimePopover({
|
|
29
|
+
anchorRef,
|
|
30
|
+
hh,
|
|
31
|
+
mm,
|
|
32
|
+
step = 5,
|
|
33
|
+
onChange,
|
|
34
|
+
onClose
|
|
35
|
+
}) {
|
|
36
|
+
const popRef = (0, import_react.useRef)(null);
|
|
37
|
+
const stylePop = (0, import_react.useMemo)(() => {
|
|
38
|
+
var _a;
|
|
39
|
+
const r = (_a = anchorRef.current) == null ? void 0 : _a.getBoundingClientRect();
|
|
40
|
+
if (!r) return { visibility: "hidden" };
|
|
41
|
+
const W = 300, H = 180, GAP = 8, M = 8;
|
|
42
|
+
let left = r.left;
|
|
43
|
+
left = Math.max(M, Math.min(left, window.innerWidth - (W + M)));
|
|
44
|
+
let top = r.bottom + GAP;
|
|
45
|
+
if (top + H > window.innerHeight) top = Math.max(M, r.top - GAP - H);
|
|
46
|
+
return { position: "fixed", top, left, width: W, zIndex: 100001 };
|
|
47
|
+
}, [anchorRef]);
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
const stopInside = (e) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const t = e.target;
|
|
52
|
+
if ((_a = popRef.current) == null ? void 0 : _a.contains(t)) e.stopPropagation();
|
|
53
|
+
};
|
|
54
|
+
window.addEventListener("pointerdown", stopInside, true);
|
|
55
|
+
return () => window.removeEventListener("pointerdown", stopInside, true);
|
|
56
|
+
}, []);
|
|
57
|
+
const incH = () => onChange((hh + 1) % 24, mm);
|
|
58
|
+
const decH = () => onChange((hh + 23) % 24, mm);
|
|
59
|
+
const incM = () => onChange(hh, (mm + step) % 60);
|
|
60
|
+
const decM = () => onChange(hh, (mm + 60 - step) % 60);
|
|
61
|
+
const onWheelH = (e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
if (e.deltaY > 0) {
|
|
64
|
+
decH();
|
|
65
|
+
} else {
|
|
66
|
+
incH();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const onWheelM = (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
if (e.deltaY > 0) {
|
|
72
|
+
decM();
|
|
73
|
+
} else {
|
|
74
|
+
incM();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const btn = "inline-flex h-7 w-7 items-center justify-center rounded-lg ring-1 ring-slate-200 bg-white hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5";
|
|
78
|
+
const chip = "min-w-[56px] rounded-xl ring-1 ring-slate-200 px-2 py-1 text-center font-medium dark:ring-white/10 dark:bg-white/5";
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
ref: popRef,
|
|
83
|
+
style: stylePop,
|
|
84
|
+
"data-dtf-pop": true,
|
|
85
|
+
className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-2 text-sm font-medium text-slate-600 dark:text-slate-300", children: "Selecciona hora" }),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-slate-100 p-2 dark:border-white/10", children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-2 text-xs font-semibold text-slate-500 dark:text-slate-400", children: "Hora" }),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: incH, "aria-label": "Aumentar hora", children: "+" }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: chip, onWheel: onWheelH, children: pad2(hh) }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: decH, "aria-label": "Disminuir hora", children: "\u2212" })
|
|
95
|
+
] })
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-slate-100 p-2 dark:border-white/10", children: [
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-2 text-xs font-semibold text-slate-500 dark:text-slate-400", children: "Minutos" }),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: incM, "aria-label": "Aumentar minutos", children: "+" }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: chip, onWheel: onWheelM, children: pad2(mm) }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: decM, "aria-label": "Disminuir minutos", children: "\u2212" })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: [0, 15, 30, 45].map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
105
|
+
"button",
|
|
106
|
+
{
|
|
107
|
+
className: "rounded-xl px-2 py-1 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5",
|
|
108
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
109
|
+
onClick: () => onChange(hh, v),
|
|
110
|
+
children: [
|
|
111
|
+
":",
|
|
112
|
+
pad2(v)
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
v
|
|
116
|
+
)) })
|
|
117
|
+
] })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center justify-between", children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
className: "rounded-xl px-2.5 py-1.5 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5",
|
|
124
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
125
|
+
onClick: () => {
|
|
126
|
+
const t = /* @__PURE__ */ new Date();
|
|
127
|
+
onChange(t.getHours(), t.getMinutes());
|
|
128
|
+
},
|
|
129
|
+
children: "Ahora"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-sm text-white hover:opacity-95 active:scale-95 dark:bg-white dark:text-slate-900",
|
|
136
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
137
|
+
onClick: onClose,
|
|
138
|
+
children: "Listo"
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
4
|
+
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
5
|
+
function TimePopover({
|
|
6
|
+
anchorRef,
|
|
7
|
+
hh,
|
|
8
|
+
mm,
|
|
9
|
+
step = 5,
|
|
10
|
+
onChange,
|
|
11
|
+
onClose
|
|
12
|
+
}) {
|
|
13
|
+
const popRef = useRef(null);
|
|
14
|
+
const stylePop = useMemo(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
const r = (_a = anchorRef.current) == null ? void 0 : _a.getBoundingClientRect();
|
|
17
|
+
if (!r) return { visibility: "hidden" };
|
|
18
|
+
const W = 300, H = 180, GAP = 8, M = 8;
|
|
19
|
+
let left = r.left;
|
|
20
|
+
left = Math.max(M, Math.min(left, window.innerWidth - (W + M)));
|
|
21
|
+
let top = r.bottom + GAP;
|
|
22
|
+
if (top + H > window.innerHeight) top = Math.max(M, r.top - GAP - H);
|
|
23
|
+
return { position: "fixed", top, left, width: W, zIndex: 100001 };
|
|
24
|
+
}, [anchorRef]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const stopInside = (e) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const t = e.target;
|
|
29
|
+
if ((_a = popRef.current) == null ? void 0 : _a.contains(t)) e.stopPropagation();
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener("pointerdown", stopInside, true);
|
|
32
|
+
return () => window.removeEventListener("pointerdown", stopInside, true);
|
|
33
|
+
}, []);
|
|
34
|
+
const incH = () => onChange((hh + 1) % 24, mm);
|
|
35
|
+
const decH = () => onChange((hh + 23) % 24, mm);
|
|
36
|
+
const incM = () => onChange(hh, (mm + step) % 60);
|
|
37
|
+
const decM = () => onChange(hh, (mm + 60 - step) % 60);
|
|
38
|
+
const onWheelH = (e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
if (e.deltaY > 0) {
|
|
41
|
+
decH();
|
|
42
|
+
} else {
|
|
43
|
+
incH();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const onWheelM = (e) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
if (e.deltaY > 0) {
|
|
49
|
+
decM();
|
|
50
|
+
} else {
|
|
51
|
+
incM();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const btn = "inline-flex h-7 w-7 items-center justify-center rounded-lg ring-1 ring-slate-200 bg-white hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5";
|
|
55
|
+
const chip = "min-w-[56px] rounded-xl ring-1 ring-slate-200 px-2 py-1 text-center font-medium dark:ring-white/10 dark:bg-white/5";
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref: popRef,
|
|
60
|
+
style: stylePop,
|
|
61
|
+
"data-dtf-pop": true,
|
|
62
|
+
className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0e0d0e]",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx("div", { className: "mb-2 text-sm font-medium text-slate-600 dark:text-slate-300", children: "Selecciona hora" }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-slate-100 p-2 dark:border-white/10", children: [
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "mb-2 text-xs font-semibold text-slate-500 dark:text-slate-400", children: "Hora" }),
|
|
68
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: incH, "aria-label": "Aumentar hora", children: "+" }),
|
|
70
|
+
/* @__PURE__ */ jsx("div", { className: chip, onWheel: onWheelH, children: pad2(hh) }),
|
|
71
|
+
/* @__PURE__ */ jsx("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: decH, "aria-label": "Disminuir hora", children: "\u2212" })
|
|
72
|
+
] })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-slate-100 p-2 dark:border-white/10", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "mb-2 text-xs font-semibold text-slate-500 dark:text-slate-400", children: "Minutos" }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
|
|
77
|
+
/* @__PURE__ */ jsx("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: incM, "aria-label": "Aumentar minutos", children: "+" }),
|
|
78
|
+
/* @__PURE__ */ jsx("div", { className: chip, onWheel: onWheelM, children: pad2(mm) }),
|
|
79
|
+
/* @__PURE__ */ jsx("button", { className: btn, onPointerDown: (e) => e.preventDefault(), onClick: decM, "aria-label": "Disminuir minutos", children: "\u2212" })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-1.5", children: [0, 15, 30, 45].map((v) => /* @__PURE__ */ jsxs(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
className: "rounded-xl px-2 py-1 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5",
|
|
85
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
86
|
+
onClick: () => onChange(hh, v),
|
|
87
|
+
children: [
|
|
88
|
+
":",
|
|
89
|
+
pad2(v)
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
v
|
|
93
|
+
)) })
|
|
94
|
+
] })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center justify-between", children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"button",
|
|
99
|
+
{
|
|
100
|
+
className: "rounded-xl px-2.5 py-1.5 text-sm ring-1 ring-slate-200 hover:bg-slate-50 active:scale-95 dark:ring-white/10 dark:bg-white/5",
|
|
101
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
102
|
+
onClick: () => {
|
|
103
|
+
const t = /* @__PURE__ */ new Date();
|
|
104
|
+
onChange(t.getHours(), t.getMinutes());
|
|
105
|
+
},
|
|
106
|
+
children: "Ahora"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
className: "rounded-xl bg-slate-900 px-3 py-1.5 text-sm text-white hover:opacity-95 active:scale-95 dark:bg-white dark:text-slate-900",
|
|
113
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
114
|
+
onClick: onClose,
|
|
115
|
+
children: "Listo"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
TimePopover as default
|
|
125
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
/** ancla (el botón/chip que abriste) */
|
|
5
|
+
anchorEl: HTMLElement | null;
|
|
6
|
+
hh: number;
|
|
7
|
+
mm: number;
|
|
8
|
+
onChange: (hh: number, mm: number) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
step?: number;
|
|
11
|
+
};
|
|
12
|
+
declare function TimePopover({ anchorEl, hh, mm, onChange, onClose, step }: Props): React.ReactPortal;
|
|
13
|
+
declare function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose }: {
|
|
14
|
+
anchorEl: HTMLElement | null;
|
|
15
|
+
cursor: Date;
|
|
16
|
+
value?: {
|
|
17
|
+
from: Date;
|
|
18
|
+
to: Date;
|
|
19
|
+
} | null;
|
|
20
|
+
onCursorChange: (d: Date) => void;
|
|
21
|
+
onPick: (from: Date, to: Date) => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}): React.ReactPortal;
|
|
24
|
+
declare function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose }: {
|
|
25
|
+
anchorEl: HTMLElement | null;
|
|
26
|
+
cursor: Date;
|
|
27
|
+
value?: string;
|
|
28
|
+
onCursorChange: (d: Date) => void;
|
|
29
|
+
onPick: (d: Date) => void;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
}): React.ReactPortal;
|
|
32
|
+
|
|
33
|
+
export { MonthPopover, WeekPopover, TimePopover as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
/** ancla (el botón/chip que abriste) */
|
|
5
|
+
anchorEl: HTMLElement | null;
|
|
6
|
+
hh: number;
|
|
7
|
+
mm: number;
|
|
8
|
+
onChange: (hh: number, mm: number) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
step?: number;
|
|
11
|
+
};
|
|
12
|
+
declare function TimePopover({ anchorEl, hh, mm, onChange, onClose, step }: Props): React.ReactPortal;
|
|
13
|
+
declare function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose }: {
|
|
14
|
+
anchorEl: HTMLElement | null;
|
|
15
|
+
cursor: Date;
|
|
16
|
+
value?: {
|
|
17
|
+
from: Date;
|
|
18
|
+
to: Date;
|
|
19
|
+
} | null;
|
|
20
|
+
onCursorChange: (d: Date) => void;
|
|
21
|
+
onPick: (from: Date, to: Date) => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}): React.ReactPortal;
|
|
24
|
+
declare function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose }: {
|
|
25
|
+
anchorEl: HTMLElement | null;
|
|
26
|
+
cursor: Date;
|
|
27
|
+
value?: string;
|
|
28
|
+
onCursorChange: (d: Date) => void;
|
|
29
|
+
onPick: (d: Date) => void;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
}): React.ReactPortal;
|
|
32
|
+
|
|
33
|
+
export { MonthPopover, WeekPopover, TimePopover as default };
|