@versini/ui-panel 9.0.0 → 9.0.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.js +15 -17
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-panel v9.0.
|
|
2
|
+
@versini/ui-panel v9.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { cloneElement, createContext,
|
|
7
|
+
import { cloneElement, createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { FloatingFocusManager, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useInteractions, useMergeRefs, useRole } from "@floating-ui/react";
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
|
|
@@ -129,7 +129,7 @@ function ModalComponent({ children, ...options }) {
|
|
|
129
129
|
...props
|
|
130
130
|
});
|
|
131
131
|
/* v8 ignore stop */ }
|
|
132
|
-
|
|
132
|
+
function ModalContent({ ref: propRef, overlayBackground, ...rest }) {
|
|
133
133
|
const { context: floatingContext, nodeId, ...context } = useModalContext();
|
|
134
134
|
const ref = useMergeRefs([
|
|
135
135
|
context.refs.setFloating,
|
|
@@ -138,8 +138,7 @@ const Modal_ModalContent = /*#__PURE__*/ forwardRef(function ModalContent(props,
|
|
|
138
138
|
/* v8 ignore start */ if (!floatingContext.open) {
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
|
-
/* v8 ignore stop */ const
|
|
142
|
-
const overlayClass = clsx("grid place-items-center", {
|
|
141
|
+
/* v8 ignore stop */ const overlayClass = clsx("grid place-items-center", {
|
|
143
142
|
"bg-black sm:bg-black/80": !overlayBackground
|
|
144
143
|
});
|
|
145
144
|
return /*#__PURE__*/ jsx(FloatingNode, {
|
|
@@ -162,8 +161,8 @@ const Modal_ModalContent = /*#__PURE__*/ forwardRef(function ModalContent(props,
|
|
|
162
161
|
})
|
|
163
162
|
})
|
|
164
163
|
});
|
|
165
|
-
}
|
|
166
|
-
|
|
164
|
+
}
|
|
165
|
+
function ModalHeading({ children, ref, ...props }) {
|
|
167
166
|
const { setLabelId } = useModalContext();
|
|
168
167
|
const id = useId();
|
|
169
168
|
// Only sets `aria-labelledby` on the Modal root element
|
|
@@ -181,8 +180,8 @@ const Modal_ModalHeading = /*#__PURE__*/ forwardRef(function ModalHeading({ chil
|
|
|
181
180
|
id: id,
|
|
182
181
|
children: children
|
|
183
182
|
});
|
|
184
|
-
}
|
|
185
|
-
|
|
183
|
+
}
|
|
184
|
+
function ModalDescription({ children, ref, ...props }) {
|
|
186
185
|
const { setDescriptionId } = useModalContext();
|
|
187
186
|
const id = useId();
|
|
188
187
|
// Only sets `aria-describedby` on the Modal root element
|
|
@@ -200,10 +199,9 @@ const Modal_ModalDescription = /*#__PURE__*/ forwardRef(function ModalDescriptio
|
|
|
200
199
|
id: id,
|
|
201
200
|
children: children
|
|
202
201
|
});
|
|
203
|
-
}
|
|
204
|
-
|
|
202
|
+
}
|
|
203
|
+
function ModalClose({ ref, trigger, className, ...rest }) {
|
|
205
204
|
const { setOpen } = useModalContext();
|
|
206
|
-
const { trigger, className, ...rest } = props;
|
|
207
205
|
const handleClose = useCallback(()=>setOpen(false), [
|
|
208
206
|
setOpen
|
|
209
207
|
]);
|
|
@@ -215,7 +213,7 @@ const Modal_ModalClose = /*#__PURE__*/ forwardRef(function ModalClose(props, ref
|
|
|
215
213
|
...rest
|
|
216
214
|
})
|
|
217
215
|
});
|
|
218
|
-
}
|
|
216
|
+
}
|
|
219
217
|
|
|
220
218
|
;// CONCATENATED MODULE: ./src/components/Panel/utilities.ts
|
|
221
219
|
|
|
@@ -367,18 +365,18 @@ const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "ligh
|
|
|
367
365
|
open: open,
|
|
368
366
|
onOpenChange: onOpenChange,
|
|
369
367
|
initialFocus: initialFocus,
|
|
370
|
-
children: /*#__PURE__*/ jsx(
|
|
368
|
+
children: /*#__PURE__*/ jsx(ModalContent, {
|
|
371
369
|
className: panelClassName.outerWrapper,
|
|
372
370
|
style: {
|
|
373
371
|
...animationStyles
|
|
374
372
|
},
|
|
375
|
-
children: /*#__PURE__*/ jsxs(
|
|
373
|
+
children: /*#__PURE__*/ jsxs(ModalDescription, {
|
|
376
374
|
className: panelClassName.innerWrapper,
|
|
377
375
|
children: [
|
|
378
376
|
/*#__PURE__*/ jsxs("div", {
|
|
379
377
|
className: panelClassName.header,
|
|
380
378
|
children: [
|
|
381
|
-
/*#__PURE__*/ jsx(
|
|
379
|
+
/*#__PURE__*/ jsx(ModalClose, {
|
|
382
380
|
className: panelClassName.closeWrapper,
|
|
383
381
|
trigger: /*#__PURE__*/ jsx("button", {
|
|
384
382
|
className: panelClassName.closeButton,
|
|
@@ -401,7 +399,7 @@ const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "ligh
|
|
|
401
399
|
})
|
|
402
400
|
})
|
|
403
401
|
}),
|
|
404
|
-
/*#__PURE__*/ jsx(
|
|
402
|
+
/*#__PURE__*/ jsx(ModalHeading, {
|
|
405
403
|
className: panelClassName.title,
|
|
406
404
|
children: title
|
|
407
405
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-panel",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@testing-library/jest-dom": "6.9.1",
|
|
46
|
-
"@versini/ui-types": "8.
|
|
46
|
+
"@versini/ui-types": "8.2.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@tailwindcss/typography": "0.5.19",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"sideEffects": [
|
|
57
57
|
"**/*.css"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5cc3c9aaf61ca3843f16a3d6b322a92f7fb210ca"
|
|
60
60
|
}
|