reactive-bulma 2.8.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/index.d.ts +1 -0
- package/dist/cjs/types/components/molecules/Modal/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/index.d.ts +1 -0
- package/dist/cjs/types/interfaces/moleculeProps.d.ts +6 -0
- package/dist/esm/index.js +39 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/index.d.ts +1 -0
- package/dist/esm/types/components/molecules/Modal/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/index.d.ts +1 -0
- package/dist/esm/types/interfaces/moleculeProps.d.ts +6 -0
- package/dist/index.d.ts +20 -1
- package/package.json +26 -26
@@ -17,4 +17,5 @@ export { default as BreadcrumbItem } from './BreadcrumbItem';
|
|
17
17
|
export { default as DropdownTrigger } from './DropdownTrigger';
|
18
18
|
export { default as DropdownItem } from './DropdownItem';
|
19
19
|
export { default as MenuItem } from './MenuItem';
|
20
|
+
export { default as Image } from './Image';
|
20
21
|
export { default as PaginationItem } from './PaginationItem';
|
@@ -109,4 +109,10 @@ export interface PaginationProps extends ComposedElementProps {
|
|
109
109
|
/** `Styling` Will adjust the pages position on screen */
|
110
110
|
alignment?: elementAlignType | null;
|
111
111
|
}
|
112
|
+
export interface ModalProps extends ComposedElementProps {
|
113
|
+
/** `Attribute` Reffers to the component or array of components that will be shown inside the column */
|
114
|
+
children?: string | React.ReactElement | React.ReactElement[] | null;
|
115
|
+
/** `Function` Custom function related to the modal's close button to inject custom code if needed */
|
116
|
+
onCloseClick?: () => void;
|
117
|
+
}
|
112
118
|
export {};
|
package/dist/esm/index.js
CHANGED
@@ -3249,6 +3249,22 @@ const MenuItem = ({ testId = null, cssClasses = null, style = null, text, isActi
|
|
3249
3249
|
return (React.createElement("a", { "data-testid": menuItemTestId, className: menuItemClasses, style: style !== null && style !== void 0 ? style : undefined, "aria-hidden": 'true', onClick: onClick !== null && onClick !== void 0 ? onClick : undefined }, text));
|
3250
3250
|
};
|
3251
3251
|
|
3252
|
+
const Image = ({ testId = null, containerTestId = null, cssClasses = null, containerCssClasses = null, style = null, containerStyle = null, src, fixedSize = 'is-1by1', isRounded = false }) => {
|
3253
|
+
const imageContainerClasses = parseClasses([
|
3254
|
+
'image',
|
3255
|
+
fixedSize,
|
3256
|
+
containerCssClasses
|
3257
|
+
]);
|
3258
|
+
const imageClasses = parseClasses([
|
3259
|
+
isRounded ? 'is-rounded' : null,
|
3260
|
+
cssClasses
|
3261
|
+
]);
|
3262
|
+
const imageContainerTestId = containerTestId !== null && containerTestId !== void 0 ? containerTestId : parseTestId({ tag: 'image', parsedClasses: imageContainerClasses });
|
3263
|
+
const imageTestId = testId !== null && testId !== void 0 ? testId : `${imageContainerTestId}-img`;
|
3264
|
+
return (React.createElement("figure", { "data-testid": imageContainerTestId, className: imageContainerClasses, style: containerStyle !== null && containerStyle !== void 0 ? containerStyle : undefined },
|
3265
|
+
React.createElement("img", { "data-testid": imageTestId, className: imageClasses, style: style !== null && style !== void 0 ? style : undefined, src: src })));
|
3266
|
+
};
|
3267
|
+
|
3252
3268
|
const PaginationItem = ({ testId = null, cssClasses = null, style = null, text, labelText = 'Page', currentLabelText = 'Go to page', isSelected = null, onClick = null }) => {
|
3253
3269
|
const paginationItemClasses = parseClasses([
|
3254
3270
|
'pagination-link',
|
@@ -3476,5 +3492,27 @@ const Pagination = ({ testId = null, containerTestId = null, cssClasses = null,
|
|
3476
3492
|
React.createElement("ul", { "data-testid": paginationTestId, className: paginationClasses, style: style !== null && style !== void 0 ? style : undefined }, renderPages(pages, hasEllipsis, ellipsisItems))));
|
3477
3493
|
};
|
3478
3494
|
|
3479
|
-
|
3495
|
+
const Modal = ({ testId = null, containerTestId = null, cssClasses = null, containerCssClasses = null, style = null, containerStyle = null, children = null, onCloseClick = null }) => {
|
3496
|
+
const [modalIsOpen, setModalIsOpen] = reactExports.useState(true);
|
3497
|
+
const modalContainerClasses = parseClasses([
|
3498
|
+
'modal',
|
3499
|
+
'is-active',
|
3500
|
+
containerCssClasses
|
3501
|
+
]);
|
3502
|
+
const modalContainerTestId = containerTestId !== null && containerTestId !== void 0 ? containerTestId : parseTestId({ tag: 'modal', parsedClasses: modalContainerClasses });
|
3503
|
+
const modalClasses = parseClasses(['modal-content', cssClasses]);
|
3504
|
+
const modalTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'modal-content', parsedClasses: modalClasses });
|
3505
|
+
const handleCloseClick = () => {
|
3506
|
+
if (onCloseClick)
|
3507
|
+
onCloseClick();
|
3508
|
+
setModalIsOpen(false);
|
3509
|
+
};
|
3510
|
+
return (children &&
|
3511
|
+
modalIsOpen && (React.createElement("section", { "data-testid": modalContainerTestId, className: modalContainerClasses, style: containerStyle !== null && containerStyle !== void 0 ? containerStyle : undefined },
|
3512
|
+
React.createElement("section", { "data-testid": 'test-modal-background', className: 'modal-background', "aria-hidden": 'true', onClick: handleCloseClick }),
|
3513
|
+
React.createElement("section", { "data-testid": modalTestId, className: modalClasses, style: style !== null && style !== void 0 ? style : undefined }, children),
|
3514
|
+
React.createElement("button", { "data-testid": 'test-modal-close', className: 'modal-close is-large', "aria-label": 'close', onClick: handleCloseClick }))));
|
3515
|
+
};
|
3516
|
+
|
3517
|
+
export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, Icon, Image, Input, Menu, MenuItem, MenuList, Message, Modal, Notification, Pagination, PaginationItem, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
|
3480
3518
|
//# sourceMappingURL=index.js.map
|