@loomhq/lens 11.5.1 → 11.7.0

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.
@@ -8,7 +8,7 @@ type IconButtonProps = {
8
8
  iconColor?: string;
9
9
  isActive?: boolean;
10
10
  isDisabled?: boolean;
11
- size?: 'small' | 'medium';
11
+ size?: 'small' | 'medium' | 'large';
12
12
  };
13
13
  type IconButtonBoxProps = {
14
14
  size?: 'small' | 'medium';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  declare const ModalCardWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, ModalCardProps, object>;
3
- export declare const ModalCard: ({ children, onCloseClick, isOpen, maxWidth, maxHeight, placement, ariaLabel, ref, ...props }: ModalCardProps & React.ComponentProps<typeof ModalCardWrapper>) => React.JSX.Element;
3
+ export declare const ModalCard: ({ children, onCloseClick, isOpen, maxWidth, maxHeight, placement, ariaLabel, ref, removeClose, ...props }: ModalCardProps & React.ComponentProps<typeof ModalCardWrapper>) => React.JSX.Element;
4
4
  declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps & {
5
5
  isOpen?: boolean;
6
6
  children?: React.ReactNode;
@@ -47,5 +47,10 @@ type ModalCardProps = {
47
47
  maxHeight?: number | string;
48
48
  maxWidth?: number | string;
49
49
  ariaLabel?: string;
50
+ /**
51
+ * Use sparingly, and always provide a way for the user to continue or close out.
52
+ * Useful for cases where there are mandatory steps.
53
+ */
54
+ removeClose?: boolean;
50
55
  };
51
56
  export default Modal;
@@ -7,7 +7,7 @@ type TextButtonProps = {
7
7
  icon?: React.ReactNode;
8
8
  iconPosition?: 'left' | 'right';
9
9
  children: React.ReactNode;
10
- size?: 'small' | 'medium';
10
+ size?: 'small' | 'medium' | 'large';
11
11
  htmlTag?: 'button' | 'a';
12
12
  offsetSide?: 'left' | 'right';
13
13
  href?: string;
package/dist/index.js CHANGED
@@ -2494,6 +2494,10 @@ var sizeStyles = {
2494
2494
  medium: {
2495
2495
  size: u(4),
2496
2496
  iconSize: 3
2497
+ },
2498
+ large: {
2499
+ size: u(5),
2500
+ iconSize: 4
2497
2501
  }
2498
2502
  };
2499
2503
  var IconButtonBox = styled13.button`
@@ -2729,6 +2733,12 @@ var sizeStyles2 = {
2729
2733
  iconSize: 3,
2730
2734
  height: u(4),
2731
2735
  xSpace: u(1.5)
2736
+ },
2737
+ large: {
2738
+ textSize: "large",
2739
+ iconSize: 4,
2740
+ height: u(5),
2741
+ xSpace: u(2)
2732
2742
  }
2733
2743
  };
2734
2744
  var TextButtonWrapper = styled15.button`
@@ -3541,7 +3551,8 @@ var ModalCard = (_a) => {
3541
3551
  maxHeight = "70vh",
3542
3552
  placement = "center",
3543
3553
  ariaLabel,
3544
- ref
3554
+ ref,
3555
+ removeClose
3545
3556
  } = _b, props = __objRest(_b, [
3546
3557
  "children",
3547
3558
  "onCloseClick",
@@ -3550,13 +3561,16 @@ var ModalCard = (_a) => {
3550
3561
  "maxHeight",
3551
3562
  "placement",
3552
3563
  "ariaLabel",
3553
- "ref"
3564
+ "ref",
3565
+ "removeClose"
3554
3566
  ]);
3555
3567
  useEffect3(() => {
3556
3568
  const keyListener = (e) => {
3557
3569
  if (e.key === "Escape") {
3558
3570
  e.preventDefault();
3559
- onCloseClick(e);
3571
+ if (!removeClose) {
3572
+ onCloseClick(e);
3573
+ }
3560
3574
  }
3561
3575
  };
3562
3576
  window.addEventListener("keydown", keyListener);
@@ -3585,7 +3599,7 @@ var ModalCard = (_a) => {
3585
3599
  ref,
3586
3600
  "aria-label": ariaLabel
3587
3601
  }, props),
3588
- onCloseClick && /* @__PURE__ */ React25.createElement(CloseIconSection, null, /* @__PURE__ */ React25.createElement(
3602
+ !removeClose && onCloseClick && /* @__PURE__ */ React25.createElement(CloseIconSection, null, /* @__PURE__ */ React25.createElement(
3589
3603
  icon_button_default,
3590
3604
  {
3591
3605
  altText: "Close",
@@ -3593,7 +3607,13 @@ var ModalCard = (_a) => {
3593
3607
  onClick: onCloseClick
3594
3608
  }
3595
3609
  )),
3596
- /* @__PURE__ */ React25.createElement(ModalCardChildrenSection, null, children)
3610
+ /* @__PURE__ */ React25.createElement(
3611
+ ModalCardChildrenSection,
3612
+ {
3613
+ tabIndex: removeClose ? 0 : -1
3614
+ },
3615
+ children
3616
+ )
3597
3617
  )
3598
3618
  );
3599
3619
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "11.5.1",
3
+ "version": "11.7.0",
4
4
  "engines": {
5
5
  "pnpm": "^8.9.2"
6
6
  },