framepexls-ui-lib 2.2.0 → 2.2.2
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/Checkbox.d.mts +1 -1
- package/dist/Checkbox.d.ts +1 -1
- package/dist/QuickActionsDock.d.mts +26 -0
- package/dist/QuickActionsDock.d.ts +26 -0
- package/dist/QuickActionsDock.js +99 -0
- package/dist/QuickActionsDock.mjs +79 -0
- package/dist/Sidebar.d.mts +2 -0
- package/dist/Sidebar.d.ts +2 -0
- package/dist/Sidebar.js +98 -42
- package/dist/Sidebar.mjs +98 -42
- package/dist/SupportChatWidget.d.mts +128 -0
- package/dist/SupportChatWidget.d.ts +128 -0
- package/dist/SupportChatWidget.js +696 -0
- package/dist/SupportChatWidget.mjs +678 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.mjs +148 -144
- package/dist/theme.css +1 -1
- package/package.json +11 -8
package/dist/Checkbox.d.mts
CHANGED
|
@@ -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>, "
|
|
14
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
15
15
|
label?: React__default.ReactNode;
|
|
16
16
|
description?: React__default.ReactNode;
|
|
17
17
|
error?: boolean;
|
package/dist/Checkbox.d.ts
CHANGED
|
@@ -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>, "
|
|
14
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
|
|
15
15
|
label?: React__default.ReactNode;
|
|
16
16
|
description?: React__default.ReactNode;
|
|
17
17
|
error?: boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
type QuickActionsDockDisplay = "icon" | "label" | "description";
|
|
4
|
+
type QuickActionItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon: React__default.ComponentType<React__default.SVGProps<SVGSVGElement>>;
|
|
9
|
+
accent?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
display?: QuickActionsDockDisplay;
|
|
12
|
+
onSelect: () => void;
|
|
13
|
+
};
|
|
14
|
+
type QuickActionsDockProps = {
|
|
15
|
+
items: QuickActionItem[];
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
display?: QuickActionsDockDisplay;
|
|
18
|
+
sticky?: boolean;
|
|
19
|
+
stickyClassName?: string;
|
|
20
|
+
stickyReserveClassName?: string;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function QuickActionsDock({ items, loading, display, sticky, stickyClassName, stickyReserveClassName, ariaLabel, className, }: QuickActionsDockProps): React__default.JSX.Element | null;
|
|
25
|
+
|
|
26
|
+
export { type QuickActionItem, type QuickActionsDockDisplay, type QuickActionsDockProps, QuickActionsDock as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
type QuickActionsDockDisplay = "icon" | "label" | "description";
|
|
4
|
+
type QuickActionItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon: React__default.ComponentType<React__default.SVGProps<SVGSVGElement>>;
|
|
9
|
+
accent?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
display?: QuickActionsDockDisplay;
|
|
12
|
+
onSelect: () => void;
|
|
13
|
+
};
|
|
14
|
+
type QuickActionsDockProps = {
|
|
15
|
+
items: QuickActionItem[];
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
display?: QuickActionsDockDisplay;
|
|
18
|
+
sticky?: boolean;
|
|
19
|
+
stickyClassName?: string;
|
|
20
|
+
stickyReserveClassName?: string;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function QuickActionsDock({ items, loading, display, sticky, stickyClassName, stickyReserveClassName, ariaLabel, className, }: QuickActionsDockProps): React__default.JSX.Element | null;
|
|
25
|
+
|
|
26
|
+
export { type QuickActionItem, type QuickActionsDockDisplay, type QuickActionsDockProps, QuickActionsDock as default };
|
|
@@ -0,0 +1,99 @@
|
|
|
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 QuickActionsDock_exports = {};
|
|
21
|
+
__export(QuickActionsDock_exports, {
|
|
22
|
+
default: () => QuickActionsDock
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(QuickActionsDock_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
function cx(...values) {
|
|
27
|
+
return values.filter(Boolean).join(" ");
|
|
28
|
+
}
|
|
29
|
+
function itemSize(display) {
|
|
30
|
+
if (display === "icon") return "h-14 w-14 justify-center p-0";
|
|
31
|
+
if (display === "label") return "min-h-[72px] w-[11.5rem] p-3";
|
|
32
|
+
return "min-h-[96px] w-[17rem] p-3";
|
|
33
|
+
}
|
|
34
|
+
function QuickActionsDock({
|
|
35
|
+
items,
|
|
36
|
+
loading = false,
|
|
37
|
+
display = "description",
|
|
38
|
+
sticky = false,
|
|
39
|
+
stickyClassName = "lg:sticky lg:top-4",
|
|
40
|
+
stickyReserveClassName = "",
|
|
41
|
+
ariaLabel = "Acciones r\xE1pidas",
|
|
42
|
+
className
|
|
43
|
+
}) {
|
|
44
|
+
if (!items.length) return null;
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
"section",
|
|
47
|
+
{
|
|
48
|
+
"aria-label": ariaLabel,
|
|
49
|
+
className: cx("relative z-20", sticky && stickyClassName, sticky && stickyReserveClassName, className),
|
|
50
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-hidden rounded-[1.75rem] border border-[color-mix(in_oklab,var(--border)_72%,transparent)] bg-[color-mix(in_oklab,var(--card)_94%,transparent)] p-2 shadow-[0_20px_54px_rgba(15,23,42,0.10)] backdrop-blur-xl", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-x-auto overscroll-x-contain [scrollbar-width:thin]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex w-max min-w-full gap-2", children: items.map((item) => {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
const Icon = item.icon;
|
|
53
|
+
const accent = (_a = item.accent) != null ? _a : "var(--primary)";
|
|
54
|
+
const resolvedDisplay = (_b = item.display) != null ? _b : display;
|
|
55
|
+
const showLabel = resolvedDisplay !== "icon";
|
|
56
|
+
const showDescription = resolvedDisplay === "description" && Boolean(item.description);
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
type: "button",
|
|
61
|
+
title: resolvedDisplay === "icon" ? item.label : void 0,
|
|
62
|
+
"aria-label": item.label,
|
|
63
|
+
disabled: loading || item.disabled,
|
|
64
|
+
onClick: item.onSelect,
|
|
65
|
+
className: cx(
|
|
66
|
+
"group relative shrink-0 overflow-hidden rounded-[1.35rem] border border-[color-mix(in_oklab,var(--border)_76%,transparent)] bg-[linear-gradient(180deg,color-mix(in_oklab,var(--surface)_92%,white),color-mix(in_oklab,var(--card)_98%,transparent))] text-left shadow-sm transition hover:-translate-y-0.5 hover:border-[color-mix(in_oklab,var(--ring)_34%,var(--border))] hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_oklab,var(--ring)_38%,transparent)] disabled:pointer-events-none disabled:opacity-55",
|
|
67
|
+
itemSize(resolvedDisplay)
|
|
68
|
+
),
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: "absolute -right-8 -top-10 h-24 w-24 rounded-full opacity-15 blur-2xl transition group-hover:opacity-25",
|
|
75
|
+
style: { background: accent }
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("relative flex items-start gap-3", resolvedDisplay === "icon" && "items-center justify-center"), children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
className: "grid h-11 w-11 shrink-0 place-items-center rounded-2xl text-white shadow-sm",
|
|
83
|
+
style: { background: accent },
|
|
84
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5", "aria-hidden": true })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
showLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block text-sm font-semibold tracking-tight text-[var(--foreground)]", children: item.label }),
|
|
89
|
+
showDescription ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mt-1 block max-h-10 overflow-hidden text-xs leading-5 text-[var(--muted)]", children: item.description }) : null
|
|
90
|
+
] }) : null
|
|
91
|
+
] })
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
item.id
|
|
95
|
+
);
|
|
96
|
+
}) }) }) })
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function cx(...values) {
|
|
4
|
+
return values.filter(Boolean).join(" ");
|
|
5
|
+
}
|
|
6
|
+
function itemSize(display) {
|
|
7
|
+
if (display === "icon") return "h-14 w-14 justify-center p-0";
|
|
8
|
+
if (display === "label") return "min-h-[72px] w-[11.5rem] p-3";
|
|
9
|
+
return "min-h-[96px] w-[17rem] p-3";
|
|
10
|
+
}
|
|
11
|
+
function QuickActionsDock({
|
|
12
|
+
items,
|
|
13
|
+
loading = false,
|
|
14
|
+
display = "description",
|
|
15
|
+
sticky = false,
|
|
16
|
+
stickyClassName = "lg:sticky lg:top-4",
|
|
17
|
+
stickyReserveClassName = "",
|
|
18
|
+
ariaLabel = "Acciones r\xE1pidas",
|
|
19
|
+
className
|
|
20
|
+
}) {
|
|
21
|
+
if (!items.length) return null;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"section",
|
|
24
|
+
{
|
|
25
|
+
"aria-label": ariaLabel,
|
|
26
|
+
className: cx("relative z-20", sticky && stickyClassName, sticky && stickyReserveClassName, className),
|
|
27
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-[1.75rem] border border-[color-mix(in_oklab,var(--border)_72%,transparent)] bg-[color-mix(in_oklab,var(--card)_94%,transparent)] p-2 shadow-[0_20px_54px_rgba(15,23,42,0.10)] backdrop-blur-xl", children: /* @__PURE__ */ jsx("div", { className: "overflow-x-auto overscroll-x-contain [scrollbar-width:thin]", children: /* @__PURE__ */ jsx("div", { className: "flex w-max min-w-full gap-2", children: items.map((item) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const Icon = item.icon;
|
|
30
|
+
const accent = (_a = item.accent) != null ? _a : "var(--primary)";
|
|
31
|
+
const resolvedDisplay = (_b = item.display) != null ? _b : display;
|
|
32
|
+
const showLabel = resolvedDisplay !== "icon";
|
|
33
|
+
const showDescription = resolvedDisplay === "description" && Boolean(item.description);
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
title: resolvedDisplay === "icon" ? item.label : void 0,
|
|
39
|
+
"aria-label": item.label,
|
|
40
|
+
disabled: loading || item.disabled,
|
|
41
|
+
onClick: item.onSelect,
|
|
42
|
+
className: cx(
|
|
43
|
+
"group relative shrink-0 overflow-hidden rounded-[1.35rem] border border-[color-mix(in_oklab,var(--border)_76%,transparent)] bg-[linear-gradient(180deg,color-mix(in_oklab,var(--surface)_92%,white),color-mix(in_oklab,var(--card)_98%,transparent))] text-left shadow-sm transition hover:-translate-y-0.5 hover:border-[color-mix(in_oklab,var(--ring)_34%,var(--border))] hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_oklab,var(--ring)_38%,transparent)] disabled:pointer-events-none disabled:opacity-55",
|
|
44
|
+
itemSize(resolvedDisplay)
|
|
45
|
+
),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: "absolute -right-8 -top-10 h-24 w-24 rounded-full opacity-15 blur-2xl transition group-hover:opacity-25",
|
|
52
|
+
style: { background: accent }
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: cx("relative flex items-start gap-3", resolvedDisplay === "icon" && "items-center justify-center"), children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: "grid h-11 w-11 shrink-0 place-items-center rounded-2xl text-white shadow-sm",
|
|
60
|
+
style: { background: accent },
|
|
61
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5", "aria-hidden": true })
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
showLabel ? /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
65
|
+
/* @__PURE__ */ jsx("span", { className: "block text-sm font-semibold tracking-tight text-[var(--foreground)]", children: item.label }),
|
|
66
|
+
showDescription ? /* @__PURE__ */ jsx("span", { className: "mt-1 block max-h-10 overflow-hidden text-xs leading-5 text-[var(--muted)]", children: item.description }) : null
|
|
67
|
+
] }) : null
|
|
68
|
+
] })
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
item.id
|
|
72
|
+
);
|
|
73
|
+
}) }) }) })
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
QuickActionsDock as default
|
|
79
|
+
};
|
package/dist/Sidebar.d.mts
CHANGED
package/dist/Sidebar.d.ts
CHANGED
package/dist/Sidebar.js
CHANGED
|
@@ -1495,13 +1495,20 @@ function WorkspaceSwitcher({
|
|
|
1495
1495
|
variant = "standalone",
|
|
1496
1496
|
color = "accent"
|
|
1497
1497
|
}) {
|
|
1498
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1498
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
1499
1499
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
1500
|
+
const [workspaceQuery, setWorkspaceQuery] = (0, import_react.useState)("");
|
|
1500
1501
|
const triggerRef = (0, import_react.useRef)(null);
|
|
1502
|
+
const searchRef = (0, import_react.useRef)(null);
|
|
1501
1503
|
const popoverRef = (0, import_react.useRef)(null);
|
|
1502
1504
|
const [mounted, setMounted] = (0, import_react.useState)(false);
|
|
1503
1505
|
const portalRoot = typeof document !== "undefined" ? document.body : null;
|
|
1504
|
-
const [menuPos, setMenuPos] = (0, import_react.useState)({
|
|
1506
|
+
const [menuPos, setMenuPos] = (0, import_react.useState)({
|
|
1507
|
+
top: 0,
|
|
1508
|
+
left: 0,
|
|
1509
|
+
width: 0,
|
|
1510
|
+
maxHeight: 420
|
|
1511
|
+
});
|
|
1505
1512
|
const current = (0, import_react.useMemo)(() => {
|
|
1506
1513
|
var _a2, _b2;
|
|
1507
1514
|
const list = (workspaces != null ? workspaces : []).filter((w) => !w.disabled);
|
|
@@ -1517,6 +1524,17 @@ function WorkspaceSwitcher({
|
|
|
1517
1524
|
}
|
|
1518
1525
|
return { primary: p, secondary: s };
|
|
1519
1526
|
}, [workspaces]);
|
|
1527
|
+
const normalizedWorkspaceQuery = workspaceQuery.trim().toLocaleLowerCase();
|
|
1528
|
+
const matchesWorkspaceQuery = import_react.default.useCallback(
|
|
1529
|
+
(workspace) => {
|
|
1530
|
+
if (!normalizedWorkspaceQuery) return true;
|
|
1531
|
+
return [workspace.name, workspace.subtitle, workspace.badge, workspace.initials].filter(Boolean).some((value) => String(value).toLocaleLowerCase().includes(normalizedWorkspaceQuery));
|
|
1532
|
+
},
|
|
1533
|
+
[normalizedWorkspaceQuery]
|
|
1534
|
+
);
|
|
1535
|
+
const filteredPrimary = (0, import_react.useMemo)(() => primary.filter(matchesWorkspaceQuery), [matchesWorkspaceQuery, primary]);
|
|
1536
|
+
const filteredSecondary = (0, import_react.useMemo)(() => secondary.filter(matchesWorkspaceQuery), [matchesWorkspaceQuery, secondary]);
|
|
1537
|
+
const hasFilteredWorkspaces = filteredPrimary.length > 0 || filteredSecondary.length > 0;
|
|
1520
1538
|
(0, import_react.useEffect)(() => {
|
|
1521
1539
|
if (!open) return;
|
|
1522
1540
|
const onDown = (e) => {
|
|
@@ -1539,6 +1557,17 @@ function WorkspaceSwitcher({
|
|
|
1539
1557
|
(0, import_react.useEffect)(() => {
|
|
1540
1558
|
if (collapsed) setOpen(false);
|
|
1541
1559
|
}, [collapsed]);
|
|
1560
|
+
(0, import_react.useEffect)(() => {
|
|
1561
|
+
if (!open) {
|
|
1562
|
+
setWorkspaceQuery("");
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
const id = window.setTimeout(() => {
|
|
1566
|
+
var _a2;
|
|
1567
|
+
return (_a2 = searchRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
|
|
1568
|
+
}, 40);
|
|
1569
|
+
return () => window.clearTimeout(id);
|
|
1570
|
+
}, [open]);
|
|
1542
1571
|
(0, import_react.useEffect)(() => {
|
|
1543
1572
|
setMounted(true);
|
|
1544
1573
|
}, []);
|
|
@@ -1547,21 +1576,29 @@ function WorkspaceSwitcher({
|
|
|
1547
1576
|
if (!el) return;
|
|
1548
1577
|
const r = el.getBoundingClientRect();
|
|
1549
1578
|
const viewportPad = 12;
|
|
1550
|
-
const w = Math.
|
|
1579
|
+
const w = Math.min(380, Math.max(180, window.innerWidth - viewportPad * 2));
|
|
1580
|
+
const maxPreferredHeight = Math.min(520, Math.max(120, window.innerHeight - viewportPad * 2));
|
|
1551
1581
|
if (collapsed) {
|
|
1552
1582
|
let left2 = r.right + 12;
|
|
1553
1583
|
if (left2 + w > window.innerWidth - viewportPad) left2 = Math.max(viewportPad, window.innerWidth - viewportPad - w);
|
|
1554
|
-
let
|
|
1555
|
-
const maxTop = Math.max(viewportPad, window.innerHeight - viewportPad -
|
|
1556
|
-
if (
|
|
1557
|
-
if (
|
|
1558
|
-
setMenuPos({ left: left2, top
|
|
1584
|
+
let top = r.top;
|
|
1585
|
+
const maxTop = Math.max(viewportPad, window.innerHeight - viewportPad - maxPreferredHeight);
|
|
1586
|
+
if (top > maxTop) top = maxTop;
|
|
1587
|
+
if (top < viewportPad) top = viewportPad;
|
|
1588
|
+
setMenuPos({ left: left2, top, width: w, maxHeight: maxPreferredHeight });
|
|
1559
1589
|
return;
|
|
1560
1590
|
}
|
|
1561
1591
|
let left = r.left;
|
|
1562
1592
|
if (left + w > window.innerWidth - viewportPad) left = Math.max(viewportPad, window.innerWidth - viewportPad - w);
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1593
|
+
const belowTop = r.bottom + 8;
|
|
1594
|
+
const belowSpace = Math.max(80, window.innerHeight - belowTop - viewportPad);
|
|
1595
|
+
const aboveSpace = Math.max(80, r.top - viewportPad - 8);
|
|
1596
|
+
if (belowSpace < 260 && aboveSpace > belowSpace) {
|
|
1597
|
+
const maxHeight = Math.min(maxPreferredHeight, aboveSpace);
|
|
1598
|
+
setMenuPos({ left, top: Math.max(viewportPad, r.top - 8 - maxHeight), width: w, maxHeight });
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
setMenuPos({ left, top: belowTop, width: w, maxHeight: Math.min(maxPreferredHeight, belowSpace) });
|
|
1565
1602
|
}, [collapsed]);
|
|
1566
1603
|
(0, import_react.useLayoutEffect)(() => {
|
|
1567
1604
|
if (!open) return;
|
|
@@ -1584,9 +1621,11 @@ function WorkspaceSwitcher({
|
|
|
1584
1621
|
const labelSecondary = (_c = labels == null ? void 0 : labels.secondary) != null ? _c : "Secundarios";
|
|
1585
1622
|
const labelManage = (_d = labels == null ? void 0 : labels.manage) != null ? _d : "Administrar espacios";
|
|
1586
1623
|
const labelManageHint = (_e = labels == null ? void 0 : labels.manageHint) != null ? _e : "Agrega slots para sub-empresas.";
|
|
1624
|
+
const labelSearchPlaceholder = (_f = labels == null ? void 0 : labels.searchPlaceholder) != null ? _f : "Buscar empresa o workspace...";
|
|
1625
|
+
const labelEmpty = (_g = labels == null ? void 0 : labels.empty) != null ? _g : "No hay espacios que coincidan.";
|
|
1587
1626
|
const tooltipContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
1588
1627
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-[0.75rem] font-semibold", children: current.name }),
|
|
1589
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-0.5 truncate text-[0.6875rem] text-white/70", children: (
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-0.5 truncate text-[0.6875rem] text-white/70", children: (_h = current.subtitle) != null ? _h : labelTitle })
|
|
1590
1629
|
] });
|
|
1591
1630
|
const renderRow = (w) => {
|
|
1592
1631
|
var _a2, _b2, _c2;
|
|
@@ -1602,7 +1641,7 @@ function WorkspaceSwitcher({
|
|
|
1602
1641
|
},
|
|
1603
1642
|
disabled: w.disabled,
|
|
1604
1643
|
className: [
|
|
1605
|
-
"
|
|
1644
|
+
"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-2xl px-2.5 py-2 text-left",
|
|
1606
1645
|
w.disabled ? "cursor-not-allowed opacity-50" : "hover:bg-[color-mix(in_oklab,var(--surface)_70%,transparent)]",
|
|
1607
1646
|
active ? "bg-[color-mix(in_oklab,var(--primary)_10%,transparent)] ring-1 ring-inset ring-[color-mix(in_oklab,var(--ring)_22%,transparent)]" : ""
|
|
1608
1647
|
].join(" "),
|
|
@@ -1615,13 +1654,14 @@ function WorkspaceSwitcher({
|
|
|
1615
1654
|
alt: w.name,
|
|
1616
1655
|
initials: (_b2 = w.initials) != null ? _b2 : computeInitials(w.name),
|
|
1617
1656
|
radiusClass: "rounded-2xl",
|
|
1618
|
-
color: (_c2 = w.color) != null ? _c2 : color
|
|
1657
|
+
color: (_c2 = w.color) != null ? _c2 : color,
|
|
1658
|
+
className: "shrink-0"
|
|
1619
1659
|
}
|
|
1620
1660
|
),
|
|
1621
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1622
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1623
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-w-0
|
|
1624
|
-
w.badge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 rounded-full border border-[var(--border)] bg-[color-mix(in_oklab,var(--surface)_70%,transparent)] px-2 py-0.5 text-[0.6875rem] font-semibold text-[var(--muted)]", children: w.badge }) : null
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block min-w-0 max-w-full flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-sm font-semibold text-[var(--foreground)]", children: w.name }),
|
|
1664
|
+
w.badge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "max-w-[5.75rem] shrink-0 truncate rounded-full border border-[var(--border)] bg-[color-mix(in_oklab,var(--surface)_70%,transparent)] px-2 py-0.5 text-[0.6875rem] font-semibold text-[var(--muted)]", children: w.badge }) : null
|
|
1625
1665
|
] }),
|
|
1626
1666
|
w.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-xs text-[var(--muted)] text-left", children: w.subtitle }) : null
|
|
1627
1667
|
] }),
|
|
@@ -1646,7 +1686,8 @@ function WorkspaceSwitcher({
|
|
|
1646
1686
|
"aria-expanded": open,
|
|
1647
1687
|
title: void 0,
|
|
1648
1688
|
className: [
|
|
1649
|
-
"group
|
|
1689
|
+
"group w-full min-w-0 items-center gap-3 rounded-2xl",
|
|
1690
|
+
collapsed ? "flex" : "grid grid-cols-[auto_minmax(0,1fr)_auto]",
|
|
1650
1691
|
variant === "panel" ? "border-0 bg-transparent shadow-none hover:bg-[color-mix(in_oklab,var(--surface)_70%,transparent)]" : "border border-[var(--border)] bg-[var(--card)] shadow-sm hover:bg-[color-mix(in_oklab,var(--surface)_70%,transparent)]",
|
|
1651
1692
|
collapsed ? "justify-center p-2" : "px-2.5 py-2",
|
|
1652
1693
|
"active:scale-[0.99]"
|
|
@@ -1656,20 +1697,21 @@ function WorkspaceSwitcher({
|
|
|
1656
1697
|
import_AvatarSquare.default,
|
|
1657
1698
|
{
|
|
1658
1699
|
size: collapsed ? 44 : 34,
|
|
1659
|
-
src: (
|
|
1700
|
+
src: (_i = current.avatarUrl) != null ? _i : void 0,
|
|
1660
1701
|
alt: current.name,
|
|
1661
|
-
initials: (
|
|
1702
|
+
initials: (_j = current.initials) != null ? _j : computeInitials(current.name),
|
|
1662
1703
|
radiusClass: collapsed ? "rounded-2xl" : "rounded-2xl",
|
|
1663
|
-
color: (
|
|
1704
|
+
color: (_k = current.color) != null ? _k : color,
|
|
1705
|
+
className: "shrink-0"
|
|
1664
1706
|
}
|
|
1665
1707
|
),
|
|
1666
1708
|
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1667
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1668
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1669
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-w-0
|
|
1670
|
-
current.badge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "shrink-0 rounded-full border border-[var(--border)] bg-[color-mix(in_oklab,var(--surface)_70%,transparent)] px-2 py-0.5 text-[0.6875rem] font-semibold text-[var(--muted)]", children: current.badge }) : null
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block min-w-0 max-w-full flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-sm font-semibold", children: current.name }),
|
|
1712
|
+
current.badge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "max-w-[5.75rem] shrink-0 truncate rounded-full border border-[var(--border)] bg-[color-mix(in_oklab,var(--surface)_70%,transparent)] px-2 py-0.5 text-[0.6875rem] font-semibold text-[var(--muted)]", children: current.badge }) : null
|
|
1671
1713
|
] }),
|
|
1672
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-xs text-[var(--muted)] text-left", children: (
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-xs text-[var(--muted)] text-left", children: (_l = current.subtitle) != null ? _l : labelTitle })
|
|
1673
1715
|
] }),
|
|
1674
1716
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 text-[var(--muted)] group-hover:text-[var(--foreground)]", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.ChevronDownIcon, { className: `transition-transform ${open ? "rotate-180" : ""}`, "aria-hidden": true }) })
|
|
1675
1717
|
] })
|
|
@@ -1687,23 +1729,37 @@ function WorkspaceSwitcher({
|
|
|
1687
1729
|
exit: { opacity: 0, y: 6, scale: 0.985 },
|
|
1688
1730
|
transition: { duration: 0.14, ease: "easeOut" },
|
|
1689
1731
|
className: [
|
|
1690
|
-
"fixed z-50 overflow-hidden rounded-3xl border border-[var(--border)] bg-[var(--card)] shadow-2xl",
|
|
1732
|
+
"fixed z-50 flex flex-col overflow-hidden rounded-3xl border border-[var(--border)] bg-[var(--card)] shadow-2xl",
|
|
1691
1733
|
mobile ? "max-w-[18rem]" : ""
|
|
1692
1734
|
].join(" "),
|
|
1693
|
-
style: { top: menuPos.top, left: menuPos.left, width: menuPos.width },
|
|
1735
|
+
style: { top: menuPos.top, left: menuPos.left, width: menuPos.width, maxHeight: menuPos.maxHeight },
|
|
1694
1736
|
children: [
|
|
1695
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-[0.6875rem] font-semibold uppercase tracking-wider text-[var(--muted)]", children: labelTitle }) }),
|
|
1696
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
1697
|
-
|
|
1737
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-[0.6875rem] font-semibold uppercase tracking-wider text-[var(--muted)]", children: labelTitle }) }),
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 px-3 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1739
|
+
import_Input.default,
|
|
1740
|
+
{
|
|
1741
|
+
ref: searchRef,
|
|
1742
|
+
type: "search",
|
|
1743
|
+
value: workspaceQuery,
|
|
1744
|
+
onChange: (event) => setWorkspaceQuery(event.currentTarget.value),
|
|
1745
|
+
placeholder: labelSearchPlaceholder,
|
|
1746
|
+
leftSlot: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.MagnifyingGlassIcon, { className: "size-4", "aria-hidden": true }),
|
|
1747
|
+
clearable: true,
|
|
1748
|
+
onClear: () => setWorkspaceQuery(""),
|
|
1749
|
+
className: "h-9 rounded-2xl py-2 text-xs shadow-none"
|
|
1750
|
+
}
|
|
1751
|
+
) }),
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-2 pb-2 [scrollbar-width:thin]", children: hasFilteredWorkspaces ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1753
|
+
filteredPrimary.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1698
1754
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-2 pb-1 pt-1 text-[0.6875rem] font-semibold uppercase tracking-wider text-slate-400", children: labelPrimary }),
|
|
1699
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1", children:
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1", children: filteredPrimary.map(renderRow) })
|
|
1700
1756
|
] }) : null,
|
|
1701
|
-
|
|
1757
|
+
filteredSecondary.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1702
1758
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 px-2 pb-1 pt-1 text-[0.6875rem] font-semibold uppercase tracking-wider text-slate-400", children: labelSecondary }),
|
|
1703
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1", children:
|
|
1759
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-1", children: filteredSecondary.map(renderRow) })
|
|
1704
1760
|
] }) : null
|
|
1705
|
-
] }),
|
|
1706
|
-
onManageWorkspaces ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "border-t border-[var(--border)] px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1761
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 py-8 text-center text-sm text-[var(--muted)]", children: labelEmpty }) }),
|
|
1762
|
+
onManageWorkspaces ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 border-t border-[var(--border)] px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1707
1763
|
import_Button.default,
|
|
1708
1764
|
{
|
|
1709
1765
|
unstyled: true,
|
|
@@ -1712,13 +1768,13 @@ function WorkspaceSwitcher({
|
|
|
1712
1768
|
setOpen(false);
|
|
1713
1769
|
onManageWorkspaces();
|
|
1714
1770
|
},
|
|
1715
|
-
className: "flex w-full items-center justify-between gap-3 rounded-2xl px-3 py-2 text-left hover:bg-[color-mix(in_oklab,var(--surface)_70%,transparent)]",
|
|
1771
|
+
className: "flex w-full min-w-0 items-center justify-between gap-3 rounded-2xl px-3 py-2 text-left hover:bg-[color-mix(in_oklab,var(--surface)_70%,transparent)]",
|
|
1716
1772
|
children: [
|
|
1717
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
1718
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold text-[var(--foreground)]", children: labelManage }),
|
|
1719
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-[var(--muted)]", children: labelManageHint })
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 overflow-hidden", children: [
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-sm font-semibold text-[var(--foreground)]", children: labelManage }),
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-xs text-[var(--muted)]", children: labelManageHint })
|
|
1720
1776
|
] }),
|
|
1721
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.PlusIcon, { className: "text-[var(--muted)]", "aria-hidden": true })
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.PlusIcon, { className: "shrink-0 text-[var(--muted)]", "aria-hidden": true })
|
|
1722
1778
|
]
|
|
1723
1779
|
}
|
|
1724
1780
|
) }) : null
|
|
@@ -2291,7 +2347,7 @@ function SidebarInner({
|
|
|
2291
2347
|
] }) : null,
|
|
2292
2348
|
sidebarSlotCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center justify-center", children: sidebarSlotCollapsed }) : null
|
|
2293
2349
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: topPanelClass, children: [
|
|
2294
|
-
showWorkspaceInTopPanel ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-3 py-3", children: [
|
|
2350
|
+
showWorkspaceInTopPanel ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 overflow-hidden px-3 py-3", children: [
|
|
2295
2351
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2296
2352
|
WorkspaceSwitcher,
|
|
2297
2353
|
{
|