@homebound/beam 2.155.0 → 2.157.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.
@@ -10,6 +10,7 @@ declare type MenuItemBase = {
10
10
  label: string;
11
11
  onClick: string | VoidFunction;
12
12
  disabled?: boolean;
13
+ destructive?: boolean;
13
14
  };
14
15
  export declare type IconMenuItemType = MenuItemBase & {
15
16
  icon: IconProps["icon"];
@@ -4,10 +4,9 @@ export interface Step {
4
4
  disabled?: boolean;
5
5
  value: string;
6
6
  }
7
- interface StepperBarProps {
7
+ export interface StepperProps {
8
8
  steps: Step[];
9
9
  currentStep: Step["value"];
10
10
  onChange: (stepValue: string) => void;
11
11
  }
12
- export declare function Stepper({ steps, currentStep, onChange }: StepperBarProps): import("@emotion/react/jsx-runtime").JSX.Element;
13
- export {};
12
+ export declare function Stepper({ steps, currentStep, onChange }: StepperProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -56,7 +56,7 @@ function SuperDrawer() {
56
56
  const { content } = currentContent;
57
57
  // Also get the first / non-detail element on the stack
58
58
  const firstContent = contentStack.current[0].opts;
59
- const { onPrevClick, onNextClick, titleRightContent, titleLeftContent } = firstContent;
59
+ const { onPrevClick, onNextClick, titleRightContent, titleLeftContent, hideControls } = firstContent;
60
60
  const isDetail = currentContent !== firstContent;
61
61
  const title = currentContent.title || firstContent.title;
62
62
  return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Global, { styles: { body: Css_1.Css.overflowHidden.$ } }, void 0), (0, react_1.createElement)(framer_motion_1.motion.div, { ...testId,
@@ -80,7 +80,7 @@ function SuperDrawer() {
80
80
  // Preventing clicks from triggering parent onClick
81
81
  onClick: (e) => e.stopPropagation() }, { children: (0, jsx_runtime_1.jsxs)(form_state_1.AutoSaveStatusProvider, { children: [(0, jsx_runtime_1.jsxs)("header", Object.assign({ css: Css_1.Css.df.p3.bb.bGray200.df.aic.jcsb.gap2.$ }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.df.aic.$ }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.xl2Em.gray900.mr2.$ }, testId.title, { ref: drawerHeaderRef }, { children: !modalState.current && (title || null) }), void 0), !modalState.current && (titleLeftContent || null)] }), void 0), !modalState.current && (
82
82
  // Forcing height to 32px to match title height
83
- (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.df.childGap3.aic.hPx(32).fs0.$ }, { children: [titleRightContent || null, (0, jsx_runtime_1.jsx)(components_1.ButtonGroup, Object.assign({ buttons: [
83
+ (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.df.childGap3.aic.hPx(32).fs0.$ }, { children: [titleRightContent || null, !hideControls && ((0, jsx_runtime_1.jsx)(components_1.ButtonGroup, Object.assign({ buttons: [
84
84
  {
85
85
  icon: "chevronLeft",
86
86
  onClick: () => onPrevClick && onPrevClick(),
@@ -91,7 +91,7 @@ function SuperDrawer() {
91
91
  onClick: () => onNextClick && onNextClick(),
92
92
  disabled: !onNextClick || isDetail,
93
93
  },
94
- ] }, testId.headerActions), void 0), (0, jsx_runtime_1.jsx)(components_1.IconButton, Object.assign({ icon: "x", onClick: closeDrawer }, testId.close), void 0)] }), void 0))] }), void 0), content, modalState.current && (
94
+ ] }, testId.headerActions), void 0)), (0, jsx_runtime_1.jsx)(components_1.IconButton, Object.assign({ icon: "x", onClick: closeDrawer }, testId.close), void 0)] }), void 0))] }), void 0), content, modalState.current && (
95
95
  // Forcing some design constraints on the modal component
96
96
  (0, jsx_runtime_1.jsxs)("div", Object.assign({ css:
97
97
  // topPX(81) is the offset from the header
@@ -11,6 +11,8 @@ export interface OpenInDrawerOpts {
11
11
  onPrevClick?: () => void;
12
12
  /** Invokes right, disabled if undefined. */
13
13
  onNextClick?: () => void;
14
+ /** Hides the pagination controls for `onNextClick` and `onPrevClick` */
15
+ hideControls?: true;
14
16
  /** Adds a callback that is called _after_ close has definitely happened. */
15
17
  onClose?: () => void;
16
18
  content: ReactNode;
@@ -23,6 +23,7 @@ export { NavLink } from "./NavLink";
23
23
  export { PresentationProvider } from "./PresentationContext";
24
24
  export * from "./Snackbar";
25
25
  export * from "./Stepper";
26
+ export type { Step, StepperProps } from "./Stepper";
26
27
  export * from "./SuperDrawer";
27
28
  export * from "./Table";
28
29
  export { TabContent, Tabs, TabsWithContent } from "./Tabs";
@@ -14,7 +14,7 @@ const defaultTestId_1 = require("../../utils/defaultTestId");
14
14
  function MenuItemImpl(props) {
15
15
  const { item, state, onClose } = props;
16
16
  const menuItem = item.value;
17
- const { disabled: isDisabled, onClick, label } = menuItem;
17
+ const { disabled: isDisabled, onClick, label, destructive } = menuItem;
18
18
  const isFocused = state.selectionManager.focusedKey === item.key;
19
19
  const ref = (0, react_1.useRef)(null);
20
20
  const history = (0, react_router_1.useHistory)();
@@ -43,6 +43,7 @@ function MenuItemImpl(props) {
43
43
  ...(!isDisabled && isHovered ? Css_1.Css.bgGray100.$ : {}),
44
44
  ...(isFocused ? Css_1.Css.add("boxShadow", `inset 0 0 0 1px ${Css_1.Palette.LightBlue700}`).$ : {}),
45
45
  ...(isDisabled ? Css_1.Css.gray500.cursorNotAllowed.$ : {}),
46
+ ...(destructive ? Css_1.Css.red600.$ : {}),
46
47
  } }, tid[(0, defaultTestId_1.defaultTestId)(menuItem.label)], { children: maybeWrapInLink(onClick, isIconMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(IconMenuItem, Object.assign({}, menuItem), void 0)) : isImageMenuItem(menuItem) ? ((0, jsx_runtime_1.jsx)(ImageMenuItem, Object.assign({}, menuItem), void 0)) : (label), isDisabled) }), void 0));
47
48
  }
48
49
  exports.MenuItemImpl = MenuItemImpl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.155.0",
3
+ "version": "2.157.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",