prometeo-design-system 9.1.2 → 9.1.3
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/PLNotificationsList.es.js +1 -1
- package/dist/PyrionLayout.es.js +1 -1
- package/dist/{Scrollable-C2iwLEgl.js → Scrollable-B845sesY.js} +67 -59
- package/dist/Scrollable.es.js +1 -1
- package/dist/TabSwitch.es.js +1 -1
- package/dist/Tabs.es.js +1 -1
- package/dist/UserAccountMenu.es.js +1 -1
- package/dist/components/Scrollable/useScrollable.d.ts +2 -0
- package/dist/prometeo-design-system.es.js +1 -1
- package/dist/{usePyrionLayout-DiYRqqHU.js → usePyrionLayout-N9l4oGVr.js} +1 -1
- package/dist/usePyrionLayout.es.js +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { c as x } from "./cn-B6yFEsav.js";
|
|
|
3
3
|
import { useState as K, useRef as l, useCallback as M, useEffect as p, useLayoutEffect as V, useMemo as S } from "react";
|
|
4
4
|
import W from "./IconButton.es.js";
|
|
5
5
|
import Y from "./NotificationCard.es.js";
|
|
6
|
-
import { a as Z } from "./Scrollable-
|
|
6
|
+
import { a as Z } from "./Scrollable-B845sesY.js";
|
|
7
7
|
import ee from "./Spinner.es.js";
|
|
8
8
|
import te from "./Tabs.es.js";
|
|
9
9
|
import { S as D } from "./Skeleton-C8OCBBLq.js";
|
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { useScrollable as
|
|
1
|
+
import { j as s } from "./jsx-runtime-CqQglQKg.js";
|
|
2
|
+
import p, { useLayoutEffect as P, useImperativeHandle as U } from "react";
|
|
3
|
+
import { useScrollable as W } from "./useScrollable.es.js";
|
|
4
4
|
import { c as n } from "./cn-B6yFEsav.js";
|
|
5
|
+
import { useDragScroll as A } from "./useDragScroll.es.js";
|
|
5
6
|
import { ChevronLeft as N } from "./Icon-ChevronLeft.es.js";
|
|
6
7
|
const E = (o) => {
|
|
7
8
|
switch (o) {
|
|
@@ -14,7 +15,7 @@ const E = (o) => {
|
|
|
14
15
|
default:
|
|
15
16
|
return " overflow-auto";
|
|
16
17
|
}
|
|
17
|
-
},
|
|
18
|
+
}, b = (o) => {
|
|
18
19
|
const { position: i, type: l } = o;
|
|
19
20
|
let a = " absolute z-100";
|
|
20
21
|
if (l === "icon")
|
|
@@ -48,17 +49,21 @@ const E = (o) => {
|
|
|
48
49
|
break;
|
|
49
50
|
}
|
|
50
51
|
return a;
|
|
51
|
-
},
|
|
52
|
+
}, _ = (o) => o.hide ? " prometeo-scrollbar-none" : o.size === "small" ? " prometeo-scrollbar-thin" : "", $ = (o) => {
|
|
52
53
|
const {
|
|
53
54
|
debugMode: i = !1,
|
|
54
55
|
className: l,
|
|
55
56
|
axis: a = "both",
|
|
56
57
|
children: j,
|
|
57
|
-
scrollTopButton:
|
|
58
|
+
scrollTopButton: d,
|
|
58
59
|
contentClassName: I,
|
|
59
|
-
persistScroll: v
|
|
60
|
+
persistScroll: v,
|
|
60
61
|
// Añadir persistScroll a las props desestructuradas
|
|
61
|
-
|
|
62
|
+
disableDragScroll: g = !1
|
|
63
|
+
} = o, { bind: M, ref: R } = A({
|
|
64
|
+
axis: a,
|
|
65
|
+
disabled: g
|
|
66
|
+
}), k = o.scrollableState || {
|
|
62
67
|
state: {
|
|
63
68
|
scrollableElement: null,
|
|
64
69
|
scrollableBaseElement: null,
|
|
@@ -98,117 +103,120 @@ const E = (o) => {
|
|
|
98
103
|
handleIndicatorWheel: () => {
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
|
-
}, { state: c, handlers:
|
|
102
|
-
setScrollableRef:
|
|
103
|
-
setScrollableBaseRef:
|
|
106
|
+
}, { state: c, handlers: B } = k, { finalIndicators: h, finalScrollbarProps: z, scrollTopButtonVisible: C } = c, {
|
|
107
|
+
setScrollableRef: D,
|
|
108
|
+
setScrollableBaseRef: H,
|
|
104
109
|
handleIndicatorClick: y,
|
|
105
110
|
handleIndicatorMouseEnter: x,
|
|
106
111
|
handleIndicatorMouseLeave: w,
|
|
107
112
|
handleIndicatorMouseDown: m,
|
|
108
113
|
handleIndicatorMouseUp: S,
|
|
109
114
|
handleIndicatorWheel: T,
|
|
110
|
-
scrollToTop:
|
|
111
|
-
} =
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
o.hyperExtensionTopSlot && /* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
115
|
+
scrollToTop: L
|
|
116
|
+
} = B, O = p.Children.toArray(j), V = Object.values(h).some((t) => t?.show && t?.type === "icon"), u = p.useRef(null);
|
|
117
|
+
return P(() => {
|
|
118
|
+
u.current && c.indicatorRefs.top?.style.setProperty("--hyper-extension-top-slot-height", `${u.current.clientHeight}px`);
|
|
119
|
+
}, [u.current]), /* @__PURE__ */ s.jsxs("div", { ref: H, className: n("relative p-0", l, E(a), "scrolleable", V ? "overflow-visible" : "overflow-hidden!", "scrollable-base-container"), children: [
|
|
120
|
+
o.hyperExtensionTopSlot && /* @__PURE__ */ s.jsx("div", { className: "hyper-extension-top-slot w-full ", ref: u, children: typeof o.hyperExtensionTopSlot == "function" ? o.hyperExtensionTopSlot({ scrollableState: c }) : o.hyperExtensionTopSlot }),
|
|
121
|
+
/* @__PURE__ */ s.jsx(
|
|
117
122
|
"div",
|
|
118
123
|
{
|
|
119
|
-
ref:
|
|
124
|
+
ref: (t) => {
|
|
125
|
+
D(t), R.current = t;
|
|
126
|
+
},
|
|
120
127
|
id: v ? `scrollable-content-${v}` : void 0,
|
|
121
128
|
className: n(
|
|
122
129
|
i && "border border-red-900 border-dashed",
|
|
123
130
|
"py-2 relative w-full h-full min-h-full",
|
|
124
131
|
I,
|
|
125
132
|
E(a),
|
|
126
|
-
|
|
133
|
+
_(z),
|
|
127
134
|
"overscroll-y-contain"
|
|
128
135
|
),
|
|
129
|
-
|
|
136
|
+
...M,
|
|
137
|
+
children: O?.map((t) => p.cloneElement(t, { className: n(t?.props?.className, "shrink-0! pointer-events-auto") }))
|
|
130
138
|
}
|
|
131
139
|
),
|
|
132
|
-
o.hyperExtensionBottomSlot && /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
140
|
+
o.hyperExtensionBottomSlot && /* @__PURE__ */ s.jsx("div", { className: "hyper-extension-bottom-slot w-full ", children: typeof o.hyperExtensionBottomSlot == "function" ? o.hyperExtensionBottomSlot({ scrollableState: c }) : o.hyperExtensionBottomSlot }),
|
|
141
|
+
/* @__PURE__ */ s.jsx("div", { className: "h-full w-full z-10 absolute inset-0 pointer-events-none overflow-hidden rounded-[inherit] shadow-indicators-container", children: Object.entries(h).map(([t, e]) => {
|
|
134
142
|
if (!e?.show || e.type !== "shadow") return null;
|
|
135
|
-
const
|
|
136
|
-
return /* @__PURE__ */
|
|
143
|
+
const r = t;
|
|
144
|
+
return /* @__PURE__ */ s.jsxs(
|
|
137
145
|
"span",
|
|
138
146
|
{
|
|
139
|
-
ref: (
|
|
140
|
-
c.indicatorRefs[
|
|
147
|
+
ref: (f) => {
|
|
148
|
+
c.indicatorRefs[t] = f;
|
|
141
149
|
},
|
|
142
150
|
className: n(
|
|
143
151
|
e.behavior === "scroll-on-click" ? "cursor-pointer" : "cursor-default",
|
|
144
152
|
"ease-in-out z-100",
|
|
145
153
|
"opacity-0 pointer-events-none"
|
|
146
154
|
),
|
|
147
|
-
onClick: () => y(
|
|
148
|
-
onMouseEnter: () => x(
|
|
149
|
-
onMouseLeave: () => w(
|
|
150
|
-
onMouseDown: () => m(
|
|
151
|
-
onMouseUp: () => S(
|
|
155
|
+
onClick: () => y(r, e.behavior, e.type),
|
|
156
|
+
onMouseEnter: () => x(r, e.behavior, e.type),
|
|
157
|
+
onMouseLeave: () => w(r, e.behavior, e.type),
|
|
158
|
+
onMouseDown: () => m(r, e.behavior, e.type),
|
|
159
|
+
onMouseUp: () => S(r, e.behavior, e.type),
|
|
152
160
|
onWheel: T,
|
|
153
161
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ s.jsx("span", { className: n(b({ position: r, type: "shadow" }), "shadow-base", e.className) }),
|
|
163
|
+
/* @__PURE__ */ s.jsx("span", { className: n(b({ position: r, type: "shadow" }), "shadow-hover opacity-0 transition-opacity duration-300", e.className) })
|
|
156
164
|
]
|
|
157
165
|
},
|
|
158
|
-
|
|
166
|
+
t
|
|
159
167
|
);
|
|
160
168
|
}) }),
|
|
161
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ s.jsx("div", { className: "h-full w-full z-20 absolute inset-0 pointer-events-none icons-indicators-container", children: Object.entries(h).map(([t, e]) => {
|
|
162
170
|
if (!e?.show || e.type !== "icon") return null;
|
|
163
|
-
const
|
|
164
|
-
return /* @__PURE__ */
|
|
171
|
+
const r = t;
|
|
172
|
+
return /* @__PURE__ */ s.jsx(
|
|
165
173
|
"span",
|
|
166
174
|
{
|
|
167
|
-
ref: (
|
|
168
|
-
c.indicatorRefs[
|
|
175
|
+
ref: (f) => {
|
|
176
|
+
c.indicatorRefs[t] = f;
|
|
169
177
|
},
|
|
170
178
|
className: "pointer-events-auto cursor-default transition-all duration-300 opacity-0",
|
|
171
|
-
onClick: () => y(
|
|
172
|
-
onMouseEnter: () => x(
|
|
173
|
-
onMouseLeave: () => w(
|
|
174
|
-
onMouseDown: () => m(
|
|
175
|
-
onMouseUp: () => S(
|
|
179
|
+
onClick: () => y(r, e.behavior, e.type),
|
|
180
|
+
onMouseEnter: () => x(r, e.behavior, e.type),
|
|
181
|
+
onMouseLeave: () => w(r, e.behavior, e.type),
|
|
182
|
+
onMouseDown: () => m(r, e.behavior, e.type),
|
|
183
|
+
onMouseUp: () => S(r, e.behavior, e.type),
|
|
176
184
|
onWheel: T,
|
|
177
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ s.jsx(N, { size: 20, className: n(b({ position: r, type: "icon" }), e.className) })
|
|
178
186
|
},
|
|
179
|
-
|
|
187
|
+
t
|
|
180
188
|
);
|
|
181
189
|
}) }),
|
|
182
|
-
|
|
190
|
+
d && /* @__PURE__ */ s.jsx(
|
|
183
191
|
"button",
|
|
184
192
|
{
|
|
185
|
-
tabIndex:
|
|
186
|
-
onClick:
|
|
193
|
+
tabIndex: d.tabIndex ?? -1,
|
|
194
|
+
onClick: L,
|
|
187
195
|
className: n(
|
|
188
196
|
"absolute bottom-6 right-6 z-50 p-3.5! aspect-square rounded-full! shadow-lg transition-all duration-300 hover:scale-110 pointer-events-auto cursor-pointer scroll-to-top-button",
|
|
189
197
|
"bg-brand-primary-default hover:bg-brand-primary-hover text-white",
|
|
190
198
|
// Transiciones de aparición/desaparición
|
|
191
199
|
"transform translate-y-0 opacity-70",
|
|
192
|
-
!
|
|
193
|
-
|
|
200
|
+
!C && "translate-y-4 opacity-0 pointer-events-none",
|
|
201
|
+
d.className
|
|
194
202
|
),
|
|
195
203
|
"aria-label": "Scroll to top",
|
|
196
204
|
style: {
|
|
197
205
|
transition: "all 0.3s ease-in-out"
|
|
198
206
|
},
|
|
199
|
-
children:
|
|
207
|
+
children: d.icon ? /* @__PURE__ */ s.jsx(d.icon, { size: 20, className: "text-white" }) : /* @__PURE__ */ s.jsx(N, { size: 20, className: "text-white rotate-90" })
|
|
200
208
|
}
|
|
201
209
|
)
|
|
202
210
|
] });
|
|
203
|
-
},
|
|
204
|
-
const { controls: i } = o, l =
|
|
205
|
-
return
|
|
211
|
+
}, X = (o) => {
|
|
212
|
+
const { controls: i } = o, l = W(o);
|
|
213
|
+
return U(i, () => ({
|
|
206
214
|
subscribeToScrollTarget: l.handlers.subscribeToScrollTarget,
|
|
207
215
|
subscribeToHyperextension: l.handlers.subscribeToHyperextension,
|
|
208
216
|
releaseHyperextensionOverscroll: l.handlers.releaseHyperextensionOverscroll
|
|
209
|
-
}), [l]), /* @__PURE__ */
|
|
217
|
+
}), [l]), /* @__PURE__ */ s.jsx($, { ...o, scrollableState: l });
|
|
210
218
|
};
|
|
211
219
|
export {
|
|
212
|
-
|
|
213
|
-
|
|
220
|
+
X as S,
|
|
221
|
+
$ as a
|
|
214
222
|
};
|
package/dist/Scrollable.es.js
CHANGED
package/dist/TabSwitch.es.js
CHANGED
package/dist/Tabs.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Badge as R } from "./Badge.es.js";
|
|
|
6
6
|
import { i as E } from "./iconUtils-rTOfKDxE.js";
|
|
7
7
|
import { PlainTooltip as M } from "./PlainTooltip.es.js";
|
|
8
8
|
import { Info as L } from "./Icon-Info.es.js";
|
|
9
|
-
import { S as $ } from "./Scrollable-
|
|
9
|
+
import { S as $ } from "./Scrollable-B845sesY.js";
|
|
10
10
|
const A = b(
|
|
11
11
|
"relative transition-colors duration-200 ease-in-out p-0 gap-0 flex",
|
|
12
12
|
{
|
|
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-CqQglQKg.js";
|
|
|
2
2
|
import { c as u } from "./cn-B6yFEsav.js";
|
|
3
3
|
import f from "./UserCard.es.js";
|
|
4
4
|
import h from "./ListItem.es.js";
|
|
5
|
-
import { S as v } from "./Scrollable-
|
|
5
|
+
import { S as v } from "./Scrollable-B845sesY.js";
|
|
6
6
|
import b from "./Divider.es.js";
|
|
7
7
|
import { Settings as y } from "./Icon-Settings.es.js";
|
|
8
8
|
import { Logout as N } from "./Icon-Logout.es.js";
|
|
@@ -70,6 +70,8 @@ export interface ScrollableProps {
|
|
|
70
70
|
children?: React.ReactNode;
|
|
71
71
|
scrollbarProps?: ScrollbarProps;
|
|
72
72
|
disableMouseScroll?: boolean;
|
|
73
|
+
/** Desactiva el scroll por drag (click y arrastrar). @default false */
|
|
74
|
+
disableDragScroll?: boolean;
|
|
73
75
|
defaultBehavior?: 'scroll-on-click' | 'scroll-on-hover' | 'none';
|
|
74
76
|
persistScroll?: boolean | string;
|
|
75
77
|
controls?: React.RefObject<ScrollableControlsHandler | null>;
|
|
@@ -65,7 +65,7 @@ import { default as fa } from "./Spinner.es.js";
|
|
|
65
65
|
import { S as pa } from "./Star-DKhRZoa9.js";
|
|
66
66
|
import { Steps as xa } from "./Steps.es.js";
|
|
67
67
|
import { Subtitle as ga } from "./Subtitle.es.js";
|
|
68
|
-
import { T as Ca } from "./usePyrionLayout-
|
|
68
|
+
import { T as Ca } from "./usePyrionLayout-N9l4oGVr.js";
|
|
69
69
|
import { TertiaryLevelSidebar as wa } from "./TertiaryLevelSidebar.es.js";
|
|
70
70
|
import { TextArea as Ta, TextArea as La } from "./TextArea.es.js";
|
|
71
71
|
import { Title as Na } from "./Title.es.js";
|
|
@@ -8,7 +8,7 @@ import Z, { useDrawerSidebarOpen as Jt } from "./NavigationDrawer.es.js";
|
|
|
8
8
|
import { a as ce, u as Me } from "./useDrawerCollapsed-CJOXf2Fw.js";
|
|
9
9
|
import { Sidebar as Qt } from "./Sidebar.es.js";
|
|
10
10
|
import { NavigationRail as ee } from "./NavigationRail.es.js";
|
|
11
|
-
import { S as nt } from "./Scrollable-
|
|
11
|
+
import { S as nt } from "./Scrollable-B845sesY.js";
|
|
12
12
|
import je from "./Divider.es.js";
|
|
13
13
|
import { SidebarItem as le } from "./SidebarItem.es.js";
|
|
14
14
|
import { Collapsible as qe } from "./Collapsible.es.js";
|