@homebound/beam 2.395.0 → 2.397.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.
package/README.md CHANGED
@@ -47,6 +47,16 @@ For them, a MUI application in Company A shouldn't have to look & behave exactly
47
47
 
48
48
  But for Beam at Homebound, we specifically _want_ a component that behaves in our App A to look & behave the same as it does in our App B.
49
49
 
50
+ ## Adding Props Checklist
51
+
52
+ When designers have new Figmas, or give UX feedback, that would require adding new stylistic props to Beam components (i.e. props to change color, size, layout, etc), we should:
53
+
54
+ - Let them know their change doesn't match the existing Beam style, and confirm they really meant for this to be a non-standard change (discouraged).
55
+
56
+ - Ask them if they want this change to be rolled out app-wide, which would be fine & means we can avoid adding the per-page props (preferred).
57
+
58
+ - If they insist this is both a necessary change, but not app-wide, can we describe this ask as a "variant" or "style" or other "high-level knob", that is not making pages pick individual, low-level pixels and color values (fine now & then).
59
+
50
60
  ## Beam and Open Source
51
61
 
52
62
  As we open source Beam, this vision of "as few props as possible", "components must look _the same_ in every app" doesn't seem like something that other companies/projects would adopt (i.e. surely they want different colors, slightly different behavior to suit their user base, etc.).
package/dist/index.cjs CHANGED
@@ -4543,7 +4543,7 @@ function pluralize(count, noun, pluralNoun) {
4543
4543
  // src/components/Tooltip.tsx
4544
4544
  var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
4545
4545
  function Tooltip(props) {
4546
- const { placement, children, title, disabled, delay = 0, bgColor } = props;
4546
+ const { placement, children, title, disabled, delay = 0, bgColor, xss } = props;
4547
4547
  const state = (0, import_react_stately.useTooltipTriggerState)({ delay, isDisabled: disabled });
4548
4548
  const triggerRef = (0, import_react3.useRef)(null);
4549
4549
  const { triggerProps, tooltipProps: _tooltipProps } = (0, import_react_aria.useTooltipTrigger)({ isDisabled: disabled }, state, triggerRef);
@@ -4570,12 +4570,13 @@ function Tooltip(props) {
4570
4570
  triggerRef,
4571
4571
  content: title,
4572
4572
  placement,
4573
- bgColor
4573
+ bgColor,
4574
+ xss
4574
4575
  }
4575
4576
  )
4576
4577
  ] });
4577
4578
  }
4578
- function Popper({ triggerRef, content, placement = "auto", bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */ }) {
4579
+ function Popper({ triggerRef, content, placement = "auto", xss, bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */ }) {
4579
4580
  const popperRef = (0, import_react3.useRef)(null);
4580
4581
  const [arrowRef, setArrowRef] = (0, import_react3.useState)(null);
4581
4582
  const targetElement = triggerRef.current ? triggerRef.current.children[0] ?? triggerRef.current.parentElement : null;
@@ -4593,7 +4594,10 @@ function Popper({ triggerRef, content, placement = "auto", bgColor = "rgba(36, 3
4593
4594
  ref: popperRef,
4594
4595
  style: styles.popper,
4595
4596
  ...attributes.popper,
4596
- css: Css.maxw("320px").bgColor(bgColor).bshBasic.white.px1.py("4px").br4.xs.add("zIndex", 999999).$,
4597
+ css: {
4598
+ ...Css.maxw("320px").bgColor(bgColor).bshBasic.white.px1.py("4px").br4.xs.z(999999).$,
4599
+ ...xss
4600
+ },
4597
4601
  children: [
4598
4602
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: setArrowRef, style: { ...styles.arrow }, id: "arrow" }),
4599
4603
  content
@@ -5747,7 +5751,7 @@ function IconButton(props) {
5747
5751
  }
5748
5752
  );
5749
5753
  return maybeTooltip({
5750
- title: resolveTooltip(disabled, tooltip),
5754
+ title: resolveTooltip(disabled ?? label, tooltip),
5751
5755
  placement: "top",
5752
5756
  children: getButtonOrLink(buttonContent, onPress, buttonAttrs, openInNew, download)
5753
5757
  });