framepexls-ui-lib 0.3.4 → 0.3.6

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.
@@ -11,7 +11,7 @@ type CheckboxProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
11
11
  className?: string;
12
12
  inputClassName?: string;
13
13
  };
14
- declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
14
+ declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
15
15
  label?: React__default.ReactNode;
16
16
  description?: React__default.ReactNode;
17
17
  error?: boolean;
@@ -11,7 +11,7 @@ type CheckboxProps = Omit<React__default.InputHTMLAttributes<HTMLInputElement>,
11
11
  className?: string;
12
12
  inputClassName?: string;
13
13
  };
14
- declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
14
+ declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
15
15
  label?: React__default.ReactNode;
16
16
  description?: React__default.ReactNode;
17
17
  error?: boolean;
package/dist/Checkbox.js CHANGED
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(Checkbox_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_framer_motion = require("framer-motion");
38
+ var import_Input = __toESM(require("./Input"));
38
39
  function cx(...a) {
39
40
  return a.filter(Boolean).join(" ");
40
41
  }
@@ -83,14 +84,15 @@ const Checkbox = import_react.default.forwardRef(
83
84
  }
84
85
  }, [props.checked]);
85
86
  if (unstyled) {
86
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref: inputRef, id, type: "checkbox", ...props });
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Input.default, { unstyled: true, ref: inputRef, id, type: "checkbox", ...props });
87
88
  }
88
89
  const descId = description ? `${id != null ? id : internalId}-desc` : void 0;
89
90
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: cx("inline-flex select-none items-start gap-2", className), children: [
90
91
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "relative inline-grid place-items-center", children: [
91
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
- "input",
93
+ import_Input.default,
93
94
  {
95
+ unstyled: true,
94
96
  ref: inputRef,
95
97
  id: id != null ? id : internalId,
96
98
  type: "checkbox",
package/dist/Checkbox.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React, { useEffect, useId, useRef } from "react";
4
4
  import { motion } from "framer-motion";
5
+ import Input from "./Input";
5
6
  function cx(...a) {
6
7
  return a.filter(Boolean).join(" ");
7
8
  }
@@ -50,14 +51,15 @@ const Checkbox = React.forwardRef(
50
51
  }
51
52
  }, [props.checked]);
52
53
  if (unstyled) {
53
- return /* @__PURE__ */ jsx("input", { ref: inputRef, id, type: "checkbox", ...props });
54
+ return /* @__PURE__ */ jsx(Input, { unstyled: true, ref: inputRef, id, type: "checkbox", ...props });
54
55
  }
55
56
  const descId = description ? `${id != null ? id : internalId}-desc` : void 0;
56
57
  return /* @__PURE__ */ jsxs("label", { className: cx("inline-flex select-none items-start gap-2", className), children: [
57
58
  /* @__PURE__ */ jsxs("span", { className: "relative inline-grid place-items-center", children: [
58
59
  /* @__PURE__ */ jsx(
59
- "input",
60
+ Input,
60
61
  {
62
+ unstyled: true,
61
63
  ref: inputRef,
62
64
  id: id != null ? id : internalId,
63
65
  type: "checkbox",
@@ -188,15 +188,12 @@ function DateTimeField({
188
188
  }, [open]);
189
189
  const stylePop = (() => {
190
190
  if (!anchorRect) return { visibility: "hidden" };
191
- const GAP = 8, MARGIN = 8;
192
- const W = Math.min(420, Math.max(320, window.innerWidth - MARGIN * 2));
193
- const H = Math.min(520, Math.max(320, Math.floor(window.innerHeight * 0.75)));
194
- let left = anchorRect.left + (anchorRect.width - W) / 2;
191
+ const W = 360, GAP = 4, MARGIN = 8, H = 420;
192
+ let left = anchorRect.right - W;
195
193
  left = Math.max(MARGIN, Math.min(left, window.innerWidth - (W + MARGIN)));
196
- let top = anchorRect.bottom + GAP;
197
- if (top + H > window.innerHeight) top = Math.max(MARGIN, anchorRect.top - GAP - H);
198
- const maxHeight = Math.min(H, window.innerHeight - top - MARGIN);
199
- return { position: "fixed", top, left, zIndex: 1e5, width: W, maxHeight, overflowY: "auto" };
194
+ let top = anchorRect.top - GAP - H;
195
+ if (top < MARGIN) top = Math.max(MARGIN, anchorRect.bottom + GAP);
196
+ return { position: "fixed", top, left, zIndex: 1e5 };
200
197
  })();
201
198
  const parsed = (0, import_react.useMemo)(() => value ? parseValueByType(value, type) : null, [value, type]);
202
199
  const [cursor, setCursor] = (0, import_react.useState)(() => parsed != null ? parsed : /* @__PURE__ */ new Date());
@@ -259,7 +256,7 @@ function DateTimeField({
259
256
  ref: popRef,
260
257
  style: { ...stylePop, willChange: "transform, opacity" },
261
258
  "data-dtf-pop": true,
262
- className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
259
+ className: "w-1/3 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
263
260
  children: [
264
261
  type !== "time" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
265
262
  import_CalendarPanel.default,
@@ -155,15 +155,12 @@ function DateTimeField({
155
155
  }, [open]);
156
156
  const stylePop = (() => {
157
157
  if (!anchorRect) return { visibility: "hidden" };
158
- const GAP = 8, MARGIN = 8;
159
- const W = Math.min(420, Math.max(320, window.innerWidth - MARGIN * 2));
160
- const H = Math.min(520, Math.max(320, Math.floor(window.innerHeight * 0.75)));
161
- let left = anchorRect.left + (anchorRect.width - W) / 2;
158
+ const W = 360, GAP = 4, MARGIN = 8, H = 420;
159
+ let left = anchorRect.right - W;
162
160
  left = Math.max(MARGIN, Math.min(left, window.innerWidth - (W + MARGIN)));
163
- let top = anchorRect.bottom + GAP;
164
- if (top + H > window.innerHeight) top = Math.max(MARGIN, anchorRect.top - GAP - H);
165
- const maxHeight = Math.min(H, window.innerHeight - top - MARGIN);
166
- return { position: "fixed", top, left, zIndex: 1e5, width: W, maxHeight, overflowY: "auto" };
161
+ let top = anchorRect.top - GAP - H;
162
+ if (top < MARGIN) top = Math.max(MARGIN, anchorRect.bottom + GAP);
163
+ return { position: "fixed", top, left, zIndex: 1e5 };
167
164
  })();
168
165
  const parsed = useMemo(() => value ? parseValueByType(value, type) : null, [value, type]);
169
166
  const [cursor, setCursor] = useState(() => parsed != null ? parsed : /* @__PURE__ */ new Date());
@@ -226,7 +223,7 @@ function DateTimeField({
226
223
  ref: popRef,
227
224
  style: { ...stylePop, willChange: "transform, opacity" },
228
225
  "data-dtf-pop": true,
229
- className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
226
+ className: "w-1/3 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
230
227
  children: [
231
228
  type !== "time" && /* @__PURE__ */ jsx(
232
229
  CalendarPanel,
@@ -0,0 +1,12 @@
1
+ import React__default from 'react';
2
+ import Button from './Button.mjs';
3
+
4
+ type FileButtonProps = React__default.ComponentProps<typeof Button> & {
5
+ accept?: string;
6
+ multiple?: boolean;
7
+ capture?: boolean | string;
8
+ onFiles: (files: FileList | null, e: React__default.ChangeEvent<HTMLInputElement>) => void;
9
+ };
10
+ declare const FileButton: React__default.ForwardRefExoticComponent<Omit<FileButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
11
+
12
+ export { type FileButtonProps, FileButton as default };
@@ -0,0 +1,12 @@
1
+ import React__default from 'react';
2
+ import Button from './Button.js';
3
+
4
+ type FileButtonProps = React__default.ComponentProps<typeof Button> & {
5
+ accept?: string;
6
+ multiple?: boolean;
7
+ capture?: boolean | string;
8
+ onFiles: (files: FileList | null, e: React__default.ChangeEvent<HTMLInputElement>) => void;
9
+ };
10
+ declare const FileButton: React__default.ForwardRefExoticComponent<Omit<FileButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
11
+
12
+ export { type FileButtonProps, FileButton as default };
@@ -0,0 +1,77 @@
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 FileButton_exports = {};
31
+ __export(FileButton_exports, {
32
+ default: () => FileButton_default
33
+ });
34
+ module.exports = __toCommonJS(FileButton_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = __toESM(require("react"));
37
+ var import_Button = __toESM(require("./Button"));
38
+ var import_Input = __toESM(require("./Input"));
39
+ const FileButton = import_react.default.forwardRef(
40
+ ({ accept, multiple, capture, onFiles, children, ...btnProps }, ref) => {
41
+ const inputRef = import_react.default.useRef(null);
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
+ import_Button.default,
45
+ {
46
+ ...btnProps,
47
+ ref,
48
+ onClick: (e) => {
49
+ var _a, _b;
50
+ e.preventDefault();
51
+ (_a = btnProps.onClick) == null ? void 0 : _a.call(btnProps, e);
52
+ (_b = inputRef.current) == null ? void 0 : _b.click();
53
+ },
54
+ children
55
+ }
56
+ ),
57
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
58
+ import_Input.default,
59
+ {
60
+ unstyled: true,
61
+ ref: inputRef,
62
+ type: "file",
63
+ accept,
64
+ multiple,
65
+ ...capture !== void 0 ? { capture } : {},
66
+ className: "hidden",
67
+ onChange: (e) => {
68
+ onFiles == null ? void 0 : onFiles(e.target.files, e);
69
+ e.target.value = "";
70
+ }
71
+ }
72
+ )
73
+ ] });
74
+ }
75
+ );
76
+ FileButton.displayName = "FileButton";
77
+ var FileButton_default = FileButton;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Button from "./Button";
5
+ import Input from "./Input";
6
+ const FileButton = React.forwardRef(
7
+ ({ accept, multiple, capture, onFiles, children, ...btnProps }, ref) => {
8
+ const inputRef = React.useRef(null);
9
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10
+ /* @__PURE__ */ jsx(
11
+ Button,
12
+ {
13
+ ...btnProps,
14
+ ref,
15
+ onClick: (e) => {
16
+ var _a, _b;
17
+ e.preventDefault();
18
+ (_a = btnProps.onClick) == null ? void 0 : _a.call(btnProps, e);
19
+ (_b = inputRef.current) == null ? void 0 : _b.click();
20
+ },
21
+ children
22
+ }
23
+ ),
24
+ /* @__PURE__ */ jsx(
25
+ Input,
26
+ {
27
+ unstyled: true,
28
+ ref: inputRef,
29
+ type: "file",
30
+ accept,
31
+ multiple,
32
+ ...capture !== void 0 ? { capture } : {},
33
+ className: "hidden",
34
+ onChange: (e) => {
35
+ onFiles == null ? void 0 : onFiles(e.target.files, e);
36
+ e.target.value = "";
37
+ }
38
+ }
39
+ )
40
+ ] });
41
+ }
42
+ );
43
+ FileButton.displayName = "FileButton";
44
+ var FileButton_default = FileButton;
45
+ export {
46
+ FileButton_default as default
47
+ };
package/dist/MediaTile.js CHANGED
@@ -38,6 +38,7 @@ var import_image = __toESM(require("next/image"));
38
38
  var import_framer_motion = require("framer-motion");
39
39
  var import_animations = require("./animations");
40
40
  var import_Dropdown = __toESM(require("./Dropdown"));
41
+ var import_Button = __toESM(require("./Button"));
41
42
  function MediaTile({
42
43
  imageUrl,
43
44
  title,
@@ -63,7 +64,7 @@ function MediaTile({
63
64
  };
64
65
  const btnSize = menuSize === "lg" ? "h-11 w-11" : menuSize === "sm" ? "h-8 w-8" : "h-9 w-9";
65
66
  const iconSize = menuSize === "lg" ? "h-7 w-7" : menuSize === "sm" ? "h-5 w-5" : "h-6 w-6";
66
- const ImgWrap = onPreview ? (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props });
67
+ const ImgWrap = onPreview ? (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, { unstyled: true, type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props });
67
68
  if (loading) {
68
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
69
70
  "div",
@@ -5,6 +5,7 @@ import Image from "next/image";
5
5
  import { motion } from "framer-motion";
6
6
  import { microTransition } from "./animations";
7
7
  import Dropdown from "./Dropdown";
8
+ import Button from "./Button";
8
9
  function MediaTile({
9
10
  imageUrl,
10
11
  title,
@@ -30,7 +31,7 @@ function MediaTile({
30
31
  };
31
32
  const btnSize = menuSize === "lg" ? "h-11 w-11" : menuSize === "sm" ? "h-8 w-8" : "h-9 w-9";
32
33
  const iconSize = menuSize === "lg" ? "h-7 w-7" : menuSize === "sm" ? "h-5 w-5" : "h-6 w-6";
33
- const ImgWrap = onPreview ? (props) => /* @__PURE__ */ jsx("button", { type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ jsx("div", { ...props });
34
+ const ImgWrap = onPreview ? (props) => /* @__PURE__ */ jsx(Button, { unstyled: true, type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ jsx("div", { ...props });
34
35
  if (loading) {
35
36
  return /* @__PURE__ */ jsxs(
36
37
  "div",
@@ -69,11 +69,11 @@ function TimePopover({
69
69
  const place = React.useCallback(() => {
70
70
  const a = anchorEl == null ? void 0 : anchorEl.getBoundingClientRect();
71
71
  if (!a) return;
72
- const W = 220, Hh = 128, GAP = 8, MARGIN = 8;
72
+ const W = 220, Hh = 128, GAP = 4, MARGIN = 8;
73
73
  let left = Math.min(a.left, window.innerWidth - W - MARGIN);
74
74
  left = Math.max(MARGIN, left);
75
- let top = a.bottom + GAP;
76
- if (top + Hh > window.innerHeight) top = Math.max(MARGIN, a.top - GAP - Hh);
75
+ let top = a.top - GAP - Hh;
76
+ if (top < MARGIN) top = Math.max(MARGIN, a.bottom + GAP);
77
77
  setPos({ top, left });
78
78
  }, [anchorEl]);
79
79
  React.useEffect(() => {
@@ -34,11 +34,11 @@ function TimePopover({
34
34
  const place = React.useCallback(() => {
35
35
  const a = anchorEl == null ? void 0 : anchorEl.getBoundingClientRect();
36
36
  if (!a) return;
37
- const W = 220, Hh = 128, GAP = 8, MARGIN = 8;
37
+ const W = 220, Hh = 128, GAP = 4, MARGIN = 8;
38
38
  let left = Math.min(a.left, window.innerWidth - W - MARGIN);
39
39
  left = Math.max(MARGIN, left);
40
- let top = a.bottom + GAP;
41
- if (top + Hh > window.innerHeight) top = Math.max(MARGIN, a.top - GAP - Hh);
40
+ let top = a.top - GAP - Hh;
41
+ if (top < MARGIN) top = Math.max(MARGIN, a.bottom + GAP);
42
42
  setPos({ top, left });
43
43
  }, [anchorEl]);
44
44
  React.useEffect(() => {
@@ -128,15 +128,18 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
128
128
  }, [open]);
129
129
  const stylePop = (() => {
130
130
  if (!anchorRect) return { visibility: "hidden" };
131
- const GAP = 8, MARGIN = 8;
132
- const W = Math.min(420, Math.max(300, window.innerWidth - MARGIN * 2));
133
- const H = Math.min(360, Math.max(200, Math.floor(window.innerHeight * 0.6)));
134
- let left = anchorRect.left + (anchorRect.width - W) / 2;
131
+ const W = 360, GAP = 2, MARGIN = 8;
132
+ let left = anchorRect.right - W;
135
133
  left = Math.max(MARGIN, Math.min(left, window.innerWidth - (W + MARGIN)));
136
- let top = anchorRect.bottom + GAP;
137
- if (top + H > window.innerHeight) top = Math.max(MARGIN, anchorRect.top - GAP - H);
138
- const maxHeight = Math.min(H, window.innerHeight - top - MARGIN);
139
- return { position: "fixed", top, left, zIndex: 1e5, width: W, maxHeight, overflowY: "auto" };
134
+ const spaceAbove = anchorRect.top - MARGIN;
135
+ const spaceBelow = window.innerHeight - anchorRect.bottom - MARGIN;
136
+ const placeAbove = spaceAbove >= spaceBelow;
137
+ if (placeAbove) {
138
+ const top2 = Math.max(MARGIN, anchorRect.top - GAP);
139
+ return { position: "fixed", top: top2, left, zIndex: 1e5, transform: "translateY(-100%)" };
140
+ }
141
+ const top = Math.max(MARGIN, anchorRect.bottom + GAP);
142
+ return { position: "fixed", top, left, zIndex: 1e5 };
140
143
  })();
141
144
  const commit = (f, t) => {
142
145
  let f2 = f, t2 = t;
@@ -149,7 +152,7 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
149
152
  setTo(t2);
150
153
  onValueChange == null ? void 0 : onValueChange({ from: f2 ? fmtHHmm(f2.hh, f2.mm) : null, to: t2 ? fmtHHmm(t2.hh, t2.mm) : null });
151
154
  };
152
- const popover = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { "data-trf-pop": true, style: stylePop, className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
155
+ const popover = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { "data-trf-pop": true, style: stylePop, className: "w-1/3 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
153
156
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 px-3 py-2 text-sm", children: [
154
157
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "font-medium", children: "Selecciona horario" }),
155
158
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -95,15 +95,18 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
95
95
  }, [open]);
96
96
  const stylePop = (() => {
97
97
  if (!anchorRect) return { visibility: "hidden" };
98
- const GAP = 8, MARGIN = 8;
99
- const W = Math.min(420, Math.max(300, window.innerWidth - MARGIN * 2));
100
- const H = Math.min(360, Math.max(200, Math.floor(window.innerHeight * 0.6)));
101
- let left = anchorRect.left + (anchorRect.width - W) / 2;
98
+ const W = 360, GAP = 2, MARGIN = 8;
99
+ let left = anchorRect.right - W;
102
100
  left = Math.max(MARGIN, Math.min(left, window.innerWidth - (W + MARGIN)));
103
- let top = anchorRect.bottom + GAP;
104
- if (top + H > window.innerHeight) top = Math.max(MARGIN, anchorRect.top - GAP - H);
105
- const maxHeight = Math.min(H, window.innerHeight - top - MARGIN);
106
- return { position: "fixed", top, left, zIndex: 1e5, width: W, maxHeight, overflowY: "auto" };
101
+ const spaceAbove = anchorRect.top - MARGIN;
102
+ const spaceBelow = window.innerHeight - anchorRect.bottom - MARGIN;
103
+ const placeAbove = spaceAbove >= spaceBelow;
104
+ if (placeAbove) {
105
+ const top2 = Math.max(MARGIN, anchorRect.top - GAP);
106
+ return { position: "fixed", top: top2, left, zIndex: 1e5, transform: "translateY(-100%)" };
107
+ }
108
+ const top = Math.max(MARGIN, anchorRect.bottom + GAP);
109
+ return { position: "fixed", top, left, zIndex: 1e5 };
107
110
  })();
108
111
  const commit = (f, t) => {
109
112
  let f2 = f, t2 = t;
@@ -116,7 +119,7 @@ function TimeRangeField({ value, onValueChange, portal = true, portalId, clearab
116
119
  setTo(t2);
117
120
  onValueChange == null ? void 0 : onValueChange({ from: f2 ? fmtHHmm(f2.hh, f2.mm) : null, to: t2 ? fmtHHmm(t2.hh, t2.mm) : null });
118
121
  };
119
- const popover = /* @__PURE__ */ jsxs("div", { "data-trf-pop": true, style: stylePop, className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
122
+ const popover = /* @__PURE__ */ jsxs("div", { "data-trf-pop": true, style: stylePop, className: "w-1/3 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
120
123
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-2 text-sm", children: [
121
124
  /* @__PURE__ */ jsx("div", { className: "font-medium", children: "Selecciona horario" }),
122
125
  /* @__PURE__ */ jsx(
package/dist/index.d.mts CHANGED
@@ -43,6 +43,7 @@ export { default as Tooltip } from './Tooltip.mjs';
43
43
  export { default as Link } from './Link.mjs';
44
44
  export { ToastProvider, useToast } from './Toast.mjs';
45
45
  export { default as StorageUsage, StorageUsageProps } from './StorageUsage.mjs';
46
+ export { default as FileButton, FileButtonProps } from './FileButton.mjs';
46
47
  export { a as Animations } from './animations-CHrNeawW.mjs';
47
48
  export { default as MotionProvider } from './MotionProvider.mjs';
48
49
  export { default as CalendarPanel, CalendarPanelProps } from './CalendarPanel.mjs';
package/dist/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export { default as Tooltip } from './Tooltip.js';
43
43
  export { default as Link } from './Link.js';
44
44
  export { ToastProvider, useToast } from './Toast.js';
45
45
  export { default as StorageUsage, StorageUsageProps } from './StorageUsage.js';
46
+ export { default as FileButton, FileButtonProps } from './FileButton.js';
46
47
  export { a as Animations } from './animations-CHrNeawW.js';
47
48
  export { default as MotionProvider } from './MotionProvider.js';
48
49
  export { default as CalendarPanel, CalendarPanelProps } from './CalendarPanel.js';
package/dist/index.js CHANGED
@@ -54,6 +54,7 @@ __export(index_exports, {
54
54
  Drawer: () => import_Drawer.default,
55
55
  Dropdown: () => import_Dropdown.default,
56
56
  EmptyState: () => import_EmptyState.default,
57
+ FileButton: () => import_FileButton.default,
57
58
  FiltersMultiSelect: () => import_FiltersMultiSelect.default,
58
59
  InfoGrid: () => import_InfoGrid.default,
59
60
  Input: () => import_Input.default,
@@ -146,6 +147,7 @@ var import_Tooltip = __toESM(require("./Tooltip"));
146
147
  var import_Link = __toESM(require("./Link"));
147
148
  var import_Toast = require("./Toast");
148
149
  var import_StorageUsage = __toESM(require("./StorageUsage"));
150
+ var import_FileButton = __toESM(require("./FileButton"));
149
151
  var Animations = __toESM(require("./animations"));
150
152
  var import_MotionProvider = __toESM(require("./MotionProvider"));
151
153
  var import_CalendarPanel = __toESM(require("./CalendarPanel"));
@@ -187,6 +189,7 @@ var import_ThemeToggle = __toESM(require("./theme/ThemeToggle"));
187
189
  Drawer,
188
190
  Dropdown,
189
191
  EmptyState,
192
+ FileButton,
190
193
  FiltersMultiSelect,
191
194
  InfoGrid,
192
195
  Input,
package/dist/index.mjs CHANGED
@@ -46,20 +46,21 @@ import { default as default41 } from "./Tooltip";
46
46
  import { default as default42 } from "./Link";
47
47
  import { ToastProvider, useToast } from "./Toast";
48
48
  import { default as default43 } from "./StorageUsage";
49
+ import { default as default44 } from "./FileButton";
49
50
  import * as Animations from "./animations";
50
- import { default as default44 } from "./MotionProvider";
51
- import { default as default45 } from "./CalendarPanel";
52
- import { default as default46 } from "./TimePopover";
51
+ import { default as default45 } from "./MotionProvider";
52
+ import { default as default46 } from "./CalendarPanel";
53
+ import { default as default47 } from "./TimePopover";
53
54
  import { WeekPopover, MonthPopover } from "./TimePopover";
54
- import { default as default47 } from "./TimePanel";
55
- import { default as default48 } from "./TimeRangeField";
56
- import { default as default49 } from "./Steps";
55
+ import { default as default48 } from "./TimePanel";
56
+ import { default as default49 } from "./TimeRangeField";
57
+ import { default as default50 } from "./Steps";
57
58
  import { StepsNav } from "./Steps";
58
59
  export * from "./iconos";
59
- import { default as default50 } from "./ColorPicker";
60
- import { default as default51, useTheme } from "./theme/ThemeProvider";
61
- import { default as default52 } from "./theme/ThemeScript";
62
- import { default as default53 } from "./theme/ThemeToggle";
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
64
  export {
64
65
  default3 as ActionIconButton,
65
66
  AnimatedBody,
@@ -71,12 +72,12 @@ export {
71
72
  default26 as BadgeCluster,
72
73
  default27 as Breadcrumb,
73
74
  default2 as Button,
74
- default45 as CalendarPanel,
75
+ default46 as CalendarPanel,
75
76
  default39 as Card,
76
77
  default17 as ChartCard,
77
78
  default6 as Checkbox,
78
79
  default7 as CheckboxPillsGroup,
79
- default50 as ColorPicker,
80
+ default51 as ColorPicker,
80
81
  default11 as ColumnSelector,
81
82
  default10 as ComboSelect,
82
83
  CtrHorizontalBar,
@@ -86,6 +87,7 @@ export {
86
87
  default40 as Drawer,
87
88
  default14 as Dropdown,
88
89
  default28 as EmptyState,
90
+ default44 as FileButton,
89
91
  default8 as FiltersMultiSelect,
90
92
  default16 as InfoGrid,
91
93
  default4 as Input,
@@ -96,7 +98,7 @@ export {
96
98
  default20 as MediaTile,
97
99
  default29 as Money,
98
100
  MonthPopover,
99
- default44 as MotionProvider,
101
+ default45 as MotionProvider,
100
102
  default37 as MultiComboSelect,
101
103
  default34 as OrderButton,
102
104
  default15 as Pagination,
@@ -108,19 +110,19 @@ export {
108
110
  default21 as Skeleton,
109
111
  SortTh,
110
112
  default23 as StatCard,
111
- default49 as Steps,
113
+ default50 as Steps,
112
114
  StepsNav,
113
115
  default43 as StorageUsage,
114
116
  Td,
115
117
  default5 as Textarea,
116
118
  Th,
117
- default51 as ThemeProvider,
118
- default52 as ThemeScript,
119
- default53 as ThemeToggle,
119
+ default52 as ThemeProvider,
120
+ default53 as ThemeScript,
121
+ default54 as ThemeToggle,
120
122
  default30 as TimeAgo,
121
- default47 as TimePanel,
122
- default46 as TimePopover,
123
- default48 as TimeRangeField,
123
+ default48 as TimePanel,
124
+ default47 as TimePopover,
125
+ default49 as TimeRangeField,
124
126
  ToastProvider,
125
127
  default41 as Tooltip,
126
128
  TopImpresionesBar,
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  "use client";
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
10
  for (var name in all)
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
16
18
  }
17
19
  return to;
18
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
+ ));
19
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
30
  var ThemeToggle_exports = {};
21
31
  __export(ThemeToggle_exports, {
@@ -24,6 +34,7 @@ __export(ThemeToggle_exports, {
24
34
  module.exports = __toCommonJS(ThemeToggle_exports);
25
35
  var import_jsx_runtime = require("react/jsx-runtime");
26
36
  var import_ThemeProvider = require("./ThemeProvider");
37
+ var import_Button = __toESM(require("../Button"));
27
38
  const defaultCycle = ["light", "dark", "system"];
28
39
  function ThemeToggle({ cycle = defaultCycle, className, labels }) {
29
40
  var _a;
@@ -35,8 +46,9 @@ function ThemeToggle({ cycle = defaultCycle, className, labels }) {
35
46
  };
36
47
  const text = (_a = labels == null ? void 0 : labels[theme]) != null ? _a : theme === "system" ? "Sistema" : theme === "dark" ? "Oscuro" : "Claro";
37
48
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
38
- "button",
49
+ import_Button.default,
39
50
  {
51
+ unstyled: true,
40
52
  type: "button",
41
53
  onClick: handleClick,
42
54
  "aria-label": `Cambiar tema (actual: ${text})`,
@@ -44,7 +56,6 @@ function ThemeToggle({ cycle = defaultCycle, className, labels }) {
44
56
  className: [
45
57
  "inline-flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm font-medium",
46
58
  "border border-slate-200 bg-white shadow-sm transition hover:bg-slate-50",
47
- // In dark, use the unified surface as the backplate; keep hover as a light overlay
48
59
  "dark:border-white/10 dark:bg-[var(--fx-surface)] dark:hover:bg-white/10",
49
60
  className != null ? className : ""
50
61
  ].join(" "),
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useTheme } from "./ThemeProvider";
4
+ import Button from "../Button";
4
5
  const defaultCycle = ["light", "dark", "system"];
5
6
  function ThemeToggle({ cycle = defaultCycle, className, labels }) {
6
7
  var _a;
@@ -12,8 +13,9 @@ function ThemeToggle({ cycle = defaultCycle, className, labels }) {
12
13
  };
13
14
  const text = (_a = labels == null ? void 0 : labels[theme]) != null ? _a : theme === "system" ? "Sistema" : theme === "dark" ? "Oscuro" : "Claro";
14
15
  return /* @__PURE__ */ jsxs(
15
- "button",
16
+ Button,
16
17
  {
18
+ unstyled: true,
17
19
  type: "button",
18
20
  onClick: handleClick,
19
21
  "aria-label": `Cambiar tema (actual: ${text})`,
@@ -21,7 +23,6 @@ function ThemeToggle({ cycle = defaultCycle, className, labels }) {
21
23
  className: [
22
24
  "inline-flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm font-medium",
23
25
  "border border-slate-200 bg-white shadow-sm transition hover:bg-slate-50",
24
- // In dark, use the unified surface as the backplate; keep hover as a light overlay
25
26
  "dark:border-white/10 dark:bg-[var(--fx-surface)] dark:hover:bg-white/10",
26
27
  className != null ? className : ""
27
28
  ].join(" "),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepexls-ui-lib",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Componentes UI de Framepexls para React/Next.",