@versini/ui-panel 3.4.2 → 3.5.1
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/index.d.ts +11 -1
- package/dist/index.js +62 -47
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
2
2
|
|
|
3
3
|
export declare const MESSAGEBOX_CLASSNAME = "av-messagebox";
|
|
4
4
|
|
|
5
|
-
export declare const Panel: ({ open, onOpenChange, title, children, footer, borderMode, kind, className, animation, animationType, maxWidth, maxHeight, }: PanelProps) => JSX.Element;
|
|
5
|
+
export declare const Panel: ({ open, onOpenChange, title, children, footer, borderMode, kind, className, animation, animationType, maxWidth, maxHeight, headerBlurEffect, footerBlurEffect, }: PanelProps) => JSX.Element;
|
|
6
6
|
|
|
7
7
|
export declare const PANEL_CLASSNAME = "av-panel";
|
|
8
8
|
|
|
@@ -64,6 +64,16 @@ declare type PanelProps = {
|
|
|
64
64
|
* @default "large" (for panels only)
|
|
65
65
|
*/
|
|
66
66
|
maxHeight?: "small" | "medium" | "large";
|
|
67
|
+
/**
|
|
68
|
+
* The blur effect to apply to the header background.
|
|
69
|
+
* @default "none"
|
|
70
|
+
*/
|
|
71
|
+
headerBlurEffect?: "none" | "light" | "heavy";
|
|
72
|
+
/**
|
|
73
|
+
* The blur effect to apply to the footer background.
|
|
74
|
+
* @default "none"
|
|
75
|
+
*/
|
|
76
|
+
footerBlurEffect?: "none" | "light" | "heavy";
|
|
67
77
|
};
|
|
68
78
|
|
|
69
79
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-panel v3.
|
|
2
|
+
@versini/ui-panel v3.5.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_PANEL__) {
|
|
7
7
|
window.__VERSINI_UI_PANEL__ = {
|
|
8
|
-
version: "3.
|
|
9
|
-
buildTime: "11/
|
|
8
|
+
version: "3.5.1",
|
|
9
|
+
buildTime: "11/28/2025 12:47 PM EST",
|
|
10
10
|
homepage: "https://github.com/aversini/ui-components",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -46,7 +46,7 @@ const PANEL_CLASSNAME = "av-panel";
|
|
|
46
46
|
if (!window.__VERSINI_UI_MODAL__) {
|
|
47
47
|
window.__VERSINI_UI_MODAL__ = {
|
|
48
48
|
version: "3.1.0",
|
|
49
|
-
buildTime: "11/
|
|
49
|
+
buildTime: "11/28/2025 12:47 PM EST",
|
|
50
50
|
homepage: "https://github.com/aversini/ui-components",
|
|
51
51
|
license: "MIT"
|
|
52
52
|
};
|
|
@@ -206,15 +206,15 @@ const Modal_ModalClose = /*#__PURE__*/ forwardRef(function ModalClose(props, ref
|
|
|
206
206
|
|
|
207
207
|
const TYPE_PANEL = "panel";
|
|
208
208
|
const TYPE_MESSAGEBOX = "messagebox";
|
|
209
|
-
const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth = "medium", maxHeight })=>{
|
|
209
|
+
const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth = "medium", maxHeight, headerBlurEffect = "none", footerBlurEffect = "none" })=>{
|
|
210
210
|
// Apply default maxHeight only for TYPE_PANEL to maintain backward compatibility
|
|
211
211
|
const effectiveMaxHeight = maxHeight ?? (kind === TYPE_PANEL ? "large" : undefined);
|
|
212
212
|
return {
|
|
213
|
-
|
|
213
|
+
outerWrapper: clsx("main prose prose-lighter flex flex-col bg-surface-dark", {
|
|
214
214
|
"duration-200 ease-out": animation,
|
|
215
215
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
* Panel styles
|
|
217
|
+
*/ [`${PANEL_CLASSNAME} min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: kind === TYPE_PANEL,
|
|
218
218
|
["w-full sm:w-[95%] md:max-w-2xl"]: kind === TYPE_PANEL && !className && maxWidth === "small",
|
|
219
219
|
["w-full sm:w-[95%] md:max-w-3xl"]: kind === TYPE_PANEL && !className && maxWidth === "medium",
|
|
220
220
|
["w-full sm:w-[95%] md:max-w-4xl"]: kind === TYPE_PANEL && !className && maxWidth === "large",
|
|
@@ -224,8 +224,8 @@ const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth =
|
|
|
224
224
|
"sm:border-border-dark": borderMode === "dark" && kind === TYPE_PANEL,
|
|
225
225
|
"sm:border-border-accent": borderMode === "light" && kind === TYPE_PANEL,
|
|
226
226
|
/**
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
* Messagebox styles
|
|
228
|
+
*/ [`${MESSAGEBOX_CLASSNAME} rounded-lg border-2`]: kind === TYPE_MESSAGEBOX,
|
|
229
229
|
["w-[95%] sm:w-[50%] md:max-w-2xl"]: kind === TYPE_MESSAGEBOX && !className,
|
|
230
230
|
"max-h-[20%]": kind === TYPE_MESSAGEBOX && effectiveMaxHeight === "small",
|
|
231
231
|
"max-h-[50%]": kind === TYPE_MESSAGEBOX && effectiveMaxHeight === "medium",
|
|
@@ -234,10 +234,20 @@ const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth =
|
|
|
234
234
|
"border-border-accent": borderMode === "light" && kind === TYPE_MESSAGEBOX,
|
|
235
235
|
[`${className}`]: !!className
|
|
236
236
|
}),
|
|
237
|
-
|
|
238
|
-
footer: "
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
innerWrapper: "content flex flex-col overflow-y-auto",
|
|
238
|
+
footer: clsx("p-2 sticky bottom-0 z-10 sm:rounded-b-md", "backdrop-brightness-50", {
|
|
239
|
+
"backdrop-blur-sm": footerBlurEffect === "light",
|
|
240
|
+
"backdrop-blur-lg": footerBlurEffect === "heavy",
|
|
241
|
+
"bg-surface-dark": footerBlurEffect === "none"
|
|
242
|
+
}),
|
|
243
|
+
header: clsx("flex flex-row-reverse items-center justify-between", "sticky top-0 z-10 sm:rounded-t-md", "backdrop-brightness-50", {
|
|
244
|
+
"backdrop-blur-sm": headerBlurEffect === "light",
|
|
245
|
+
"backdrop-blur-lg": headerBlurEffect === "heavy",
|
|
246
|
+
"bg-surface-dark": headerBlurEffect === "none"
|
|
247
|
+
}),
|
|
248
|
+
title: "mb-0 p-2",
|
|
249
|
+
close: "p-2",
|
|
250
|
+
content: "py-2 px-2"
|
|
241
251
|
};
|
|
242
252
|
};
|
|
243
253
|
|
|
@@ -250,7 +260,7 @@ const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth =
|
|
|
250
260
|
|
|
251
261
|
const ANIMATION_SLIDE = "slide";
|
|
252
262
|
const ANIMATION_FADE = "fade";
|
|
253
|
-
const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "light", kind = TYPE_PANEL, className, animation = false, animationType = ANIMATION_SLIDE, maxWidth = "medium", maxHeight })=>{
|
|
263
|
+
const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "light", kind = TYPE_PANEL, className, animation = false, animationType = ANIMATION_SLIDE, maxWidth = "medium", maxHeight, headerBlurEffect = "none", footerBlurEffect = "none" })=>{
|
|
254
264
|
const originalTitleRef = useRef("");
|
|
255
265
|
/* v8 ignore next 9 */ const [animationStyles, setAnimationStyles] = useState(!animation ? {} : animationType === ANIMATION_FADE ? {
|
|
256
266
|
opacity: 0
|
|
@@ -263,7 +273,9 @@ const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "ligh
|
|
|
263
273
|
borderMode,
|
|
264
274
|
animation,
|
|
265
275
|
maxWidth,
|
|
266
|
-
maxHeight
|
|
276
|
+
maxHeight,
|
|
277
|
+
headerBlurEffect,
|
|
278
|
+
footerBlurEffect
|
|
267
279
|
});
|
|
268
280
|
/**
|
|
269
281
|
* If the panel is opened, set the document
|
|
@@ -315,40 +327,43 @@ const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "ligh
|
|
|
315
327
|
children: open && /*#__PURE__*/ jsx(Modal, {
|
|
316
328
|
open: open,
|
|
317
329
|
onOpenChange: onOpenChange,
|
|
318
|
-
children: /*#__PURE__*/
|
|
319
|
-
className: panelClassName.
|
|
330
|
+
children: /*#__PURE__*/ jsx(Modal_ModalContent, {
|
|
331
|
+
className: panelClassName.outerWrapper,
|
|
320
332
|
style: animationStyles,
|
|
321
|
-
children:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
333
|
+
children: /*#__PURE__*/ jsxs(Modal_ModalDescription, {
|
|
334
|
+
className: panelClassName.innerWrapper,
|
|
335
|
+
children: [
|
|
336
|
+
/*#__PURE__*/ jsxs("div", {
|
|
337
|
+
className: panelClassName.header,
|
|
338
|
+
children: [
|
|
339
|
+
/*#__PURE__*/ jsx(Modal_ModalClose, {
|
|
340
|
+
className: panelClassName.close,
|
|
341
|
+
trigger: /*#__PURE__*/ jsx(ButtonIcon, {
|
|
342
|
+
mode: "dark",
|
|
343
|
+
focusMode: "light",
|
|
344
|
+
noBorder: true,
|
|
345
|
+
label: "Close",
|
|
346
|
+
children: /*#__PURE__*/ jsx(IconClose, {
|
|
347
|
+
monotone: true
|
|
348
|
+
})
|
|
334
349
|
})
|
|
350
|
+
}),
|
|
351
|
+
/*#__PURE__*/ jsx(Modal_ModalHeading, {
|
|
352
|
+
className: panelClassName.title,
|
|
353
|
+
children: title
|
|
335
354
|
})
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
className: panelClassName.footer,
|
|
349
|
-
children: footer
|
|
350
|
-
})
|
|
351
|
-
]
|
|
355
|
+
]
|
|
356
|
+
}),
|
|
357
|
+
/*#__PURE__*/ jsx("div", {
|
|
358
|
+
className: panelClassName.content,
|
|
359
|
+
children: children
|
|
360
|
+
}),
|
|
361
|
+
footer && /*#__PURE__*/ jsx("div", {
|
|
362
|
+
className: panelClassName.footer,
|
|
363
|
+
children: footer
|
|
364
|
+
})
|
|
365
|
+
]
|
|
366
|
+
})
|
|
352
367
|
})
|
|
353
368
|
})
|
|
354
369
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-panel",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ca6d7648786a5ed9f6f4880b0edb36beca9439a5"
|
|
54
54
|
}
|