@pagamio/frontend-commons-lib 0.8.302 → 0.8.303
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/lib/components/ui/Modal.js +3 -2
- package/lib/styles.css +3 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Modal as FlowbiteModal, ModalBody as FlowbiteModalBody, ModalFooter as FlowbiteModalFooter,
|
|
2
|
+
import { Modal as FlowbiteModal, ModalBody as FlowbiteModalBody, ModalFooter as FlowbiteModalFooter, } from 'flowbite-react';
|
|
3
|
+
import { HiX } from 'react-icons/hi';
|
|
3
4
|
import { cn } from '../../helpers';
|
|
4
5
|
import Button from './Button';
|
|
5
6
|
/**
|
|
@@ -26,6 +27,6 @@ import Button from './Button';
|
|
|
26
27
|
* ```
|
|
27
28
|
*/
|
|
28
29
|
const Modal = ({ title, children, isOpen, onClose, size = 'md', dismissible = false, primaryButton, secondaryButton, headerContent, footerContent, className, ...rest }) => {
|
|
29
|
-
return (_jsxs(FlowbiteModal, { show: isOpen, onClose: onClose, size: size, dismissible: dismissible, className: cn('max-h-[90vh] mt-16 md:mt-0 md:max-h-full', className), ...rest, children: [
|
|
30
|
+
return (_jsxs(FlowbiteModal, { show: isOpen, onClose: onClose, size: size, dismissible: dismissible, className: cn('max-h-[90vh] mt-16 md:mt-0 md:max-h-full', className), ...rest, children: [_jsxs("div", { className: cn('flex items-center justify-between rounded-t border-b border-gray-200 p-4 dark:border-gray-600', !(title ?? headerContent) && 'border-b-0 pb-2'), children: [_jsx("div", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: headerContent ?? title ?? null }), _jsxs("button", { type: "button", "aria-label": "Close", onClick: onClose, className: "ml-auto inline-flex items-center rounded-lg bg-transparent p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white", children: [_jsx(HiX, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: "Close modal" })] })] }), _jsx(FlowbiteModalBody, { children: _jsx("div", { className: "space-y-4", children: children }) }), (primaryButton || secondaryButton || footerContent) && (_jsx(FlowbiteModalFooter, { children: footerContent ?? (_jsxs("div", { className: "flex w-full justify-end gap-2", children: [secondaryButton && (_jsx(Button, { onClick: secondaryButton.onClick, variant: secondaryButton.variant ?? 'outline-primary', disabled: secondaryButton.loading ?? secondaryButton.disabled, className: secondaryButton.variant, children: secondaryButton.label })), primaryButton && (_jsx(Button, { onClick: primaryButton.onClick, variant: primaryButton.variant ?? 'primary', disabled: primaryButton.loading ?? primaryButton.disabled, className: primaryButton.variant, children: primaryButton.label }))] })) }))] }));
|
|
30
31
|
};
|
|
31
32
|
export default Modal;
|
package/lib/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.303",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|