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 CHANGED
@@ -3251,6 +3251,22 @@ const MenuItem = ({ testId = null, cssClasses = null, style = null, text, isActi
3251
3251
  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));
3252
3252
  };
3253
3253
 
3254
+ const Image = ({ testId = null, containerTestId = null, cssClasses = null, containerCssClasses = null, style = null, containerStyle = null, src, fixedSize = 'is-1by1', isRounded = false }) => {
3255
+ const imageContainerClasses = parseClasses([
3256
+ 'image',
3257
+ fixedSize,
3258
+ containerCssClasses
3259
+ ]);
3260
+ const imageClasses = parseClasses([
3261
+ isRounded ? 'is-rounded' : null,
3262
+ cssClasses
3263
+ ]);
3264
+ const imageContainerTestId = containerTestId !== null && containerTestId !== void 0 ? containerTestId : parseTestId({ tag: 'image', parsedClasses: imageContainerClasses });
3265
+ const imageTestId = testId !== null && testId !== void 0 ? testId : `${imageContainerTestId}-img`;
3266
+ return (React.createElement("figure", { "data-testid": imageContainerTestId, className: imageContainerClasses, style: containerStyle !== null && containerStyle !== void 0 ? containerStyle : undefined },
3267
+ React.createElement("img", { "data-testid": imageTestId, className: imageClasses, style: style !== null && style !== void 0 ? style : undefined, src: src })));
3268
+ };
3269
+
3254
3270
  const PaginationItem = ({ testId = null, cssClasses = null, style = null, text, labelText = 'Page', currentLabelText = 'Go to page', isSelected = null, onClick = null }) => {
3255
3271
  const paginationItemClasses = parseClasses([
3256
3272
  'pagination-link',
@@ -3478,6 +3494,28 @@ const Pagination = ({ testId = null, containerTestId = null, cssClasses = null,
3478
3494
  React.createElement("ul", { "data-testid": paginationTestId, className: paginationClasses, style: style !== null && style !== void 0 ? style : undefined }, renderPages(pages, hasEllipsis, ellipsisItems))));
3479
3495
  };
3480
3496
 
3497
+ const Modal = ({ testId = null, containerTestId = null, cssClasses = null, containerCssClasses = null, style = null, containerStyle = null, children = null, onCloseClick = null }) => {
3498
+ const [modalIsOpen, setModalIsOpen] = reactExports.useState(true);
3499
+ const modalContainerClasses = parseClasses([
3500
+ 'modal',
3501
+ 'is-active',
3502
+ containerCssClasses
3503
+ ]);
3504
+ const modalContainerTestId = containerTestId !== null && containerTestId !== void 0 ? containerTestId : parseTestId({ tag: 'modal', parsedClasses: modalContainerClasses });
3505
+ const modalClasses = parseClasses(['modal-content', cssClasses]);
3506
+ const modalTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'modal-content', parsedClasses: modalClasses });
3507
+ const handleCloseClick = () => {
3508
+ if (onCloseClick)
3509
+ onCloseClick();
3510
+ setModalIsOpen(false);
3511
+ };
3512
+ return (children &&
3513
+ modalIsOpen && (React.createElement("section", { "data-testid": modalContainerTestId, className: modalContainerClasses, style: containerStyle !== null && containerStyle !== void 0 ? containerStyle : undefined },
3514
+ React.createElement("section", { "data-testid": 'test-modal-background', className: 'modal-background', "aria-hidden": 'true', onClick: handleCloseClick }),
3515
+ React.createElement("section", { "data-testid": modalTestId, className: modalClasses, style: style !== null && style !== void 0 ? style : undefined }, children),
3516
+ React.createElement("button", { "data-testid": 'test-modal-close', className: 'modal-close is-large', "aria-label": 'close', onClick: handleCloseClick }))));
3517
+ };
3518
+
3481
3519
  exports.Block = Block;
3482
3520
  exports.Box = Box;
3483
3521
  exports.BreadcrumbItem = BreadcrumbItem;
@@ -3493,11 +3531,13 @@ exports.DropdownItem = DropdownItem;
3493
3531
  exports.DropdownTrigger = DropdownTrigger;
3494
3532
  exports.File = File;
3495
3533
  exports.Icon = Icon;
3534
+ exports.Image = Image;
3496
3535
  exports.Input = Input;
3497
3536
  exports.Menu = Menu;
3498
3537
  exports.MenuItem = MenuItem;
3499
3538
  exports.MenuList = MenuList;
3500
3539
  exports.Message = Message;
3540
+ exports.Modal = Modal;
3501
3541
  exports.Notification = Notification;
3502
3542
  exports.Pagination = Pagination;
3503
3543
  exports.PaginationItem = PaginationItem;