@homebound/beam 2.385.1 → 2.387.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/dist/index.cjs CHANGED
@@ -9552,31 +9552,36 @@ function CheckboxBase(props) {
9552
9552
  errorMsg,
9553
9553
  helperText,
9554
9554
  checkboxOnly = false,
9555
- withLabelElement = true
9555
+ withLabelElement = true,
9556
+ tooltip
9556
9557
  } = props;
9557
9558
  const ref = (0, import_react39.useRef)(null);
9558
9559
  const { isFocusVisible, focusProps } = (0, import_react_aria21.useFocusRing)(ariaProps);
9559
9560
  const tid = useTestIds(props, defaultTestId(label));
9560
9561
  const Tag2 = withLabelElement ? "label" : "div";
9561
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
9562
- Tag2,
9563
- {
9564
- css: Css.df.cursorPointer.relative.w("max-content").maxw(px(320)).if(description !== void 0).maxw(px(344)).if(isDisabled).cursorNotAllowed.$,
9565
- "aria-label": label,
9566
- children: [
9567
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_aria21.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { ref, ...(0, import_react_aria21.mergeProps)(inputProps, focusProps), ...tid, "data-indeterminate": isIndeterminate }) }),
9568
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StyledCheckbox, { ...props, isFocusVisible, ...tid }),
9569
- !checkboxOnly && // Use a mtPx(-2) to better align the label with the checkbox.
9570
- // Not using align-items: center as the checkbox would align with all content below, where we really want it to stay only aligned with the label
9571
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { css: Css.ml1.mtPx(-2).$, children: [
9572
- label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { css: { ...labelStyles, ...isDisabled && disabledColor }, children: label }),
9573
- description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { css: { ...descStyles, ...isDisabled && disabledColor }, children: description }),
9574
- errorMsg && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorMessage, { errorMsg, ...tid.errorMsg }),
9575
- helperText && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HelperText, { helperText, ...tid.helperText })
9576
- ] })
9577
- ]
9578
- }
9579
- );
9562
+ return maybeTooltip({
9563
+ title: tooltip,
9564
+ placement: "top",
9565
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
9566
+ Tag2,
9567
+ {
9568
+ css: Css.df.cursorPointer.relative.w("max-content").maxw(px(320)).if(description !== void 0).maxw(px(344)).if(isDisabled).cursorNotAllowed.$,
9569
+ "aria-label": label,
9570
+ children: [
9571
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_aria21.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { ref, ...(0, import_react_aria21.mergeProps)(inputProps, focusProps), ...tid, "data-indeterminate": isIndeterminate }) }),
9572
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StyledCheckbox, { ...props, isFocusVisible, ...tid }),
9573
+ !checkboxOnly && // Use a mtPx(-2) to better align the label with the checkbox.
9574
+ // Not using align-items: center as the checkbox would align with all content below, where we really want it to stay only aligned with the label
9575
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { css: Css.ml1.mtPx(-2).$, children: [
9576
+ label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { css: { ...labelStyles, ...isDisabled && disabledColor }, children: label }),
9577
+ description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { css: { ...descStyles, ...isDisabled && disabledColor }, children: description }),
9578
+ errorMsg && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorMessage, { errorMsg, ...tid.errorMsg }),
9579
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HelperText, { helperText, ...tid.helperText })
9580
+ ] })
9581
+ ]
9582
+ }
9583
+ )
9584
+ });
9580
9585
  }
9581
9586
  var baseStyles2 = Css.hPx(16).mw(px(16)).relative.ba.bcGray300.br4.bgWhite.transition.$;
9582
9587
  var filledBoxStyles = Css.bcBlue700.bgBlue700.$;
@@ -11014,10 +11019,10 @@ var import_react_aria29 = require("react-aria");
11014
11019
  var import_react_stately9 = require("react-stately");
11015
11020
  var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
11016
11021
  function Checkbox(props) {
11017
- const { label, disabled: isDisabled = false, selected, ...otherProps } = props;
11022
+ const { label, disabled = false, selected, ...otherProps } = props;
11018
11023
  const isSelected = selected === true;
11019
11024
  const isIndeterminate = selected === "indeterminate";
11020
- const ariaProps = { isSelected, isDisabled, isIndeterminate, ...otherProps };
11025
+ const ariaProps = { isSelected, isDisabled: !!disabled, isIndeterminate, ...otherProps };
11021
11026
  const checkboxProps = { ...ariaProps, "aria-label": label };
11022
11027
  const ref = (0, import_react47.useRef)(null);
11023
11028
  const toggleState = (0, import_react_stately9.useToggleState)(ariaProps);
@@ -11026,11 +11031,12 @@ function Checkbox(props) {
11026
11031
  CheckboxBase,
11027
11032
  {
11028
11033
  ariaProps,
11029
- isDisabled,
11034
+ isDisabled: ariaProps.isDisabled,
11030
11035
  isIndeterminate,
11031
11036
  isSelected,
11032
11037
  inputProps,
11033
11038
  label,
11039
+ tooltip: resolveTooltip(disabled),
11034
11040
  ...otherProps
11035
11041
  }
11036
11042
  );
@@ -13842,6 +13848,7 @@ function Accordion(props) {
13842
13848
  index,
13843
13849
  setExpandedIndex,
13844
13850
  titleOnClick,
13851
+ onToggle,
13845
13852
  omitPadding = false,
13846
13853
  xss
13847
13854
  } = props;
@@ -13866,7 +13873,8 @@ function Accordion(props) {
13866
13873
  const toggle = (0, import_react69.useCallback)(() => {
13867
13874
  setExpanded((prev) => !prev);
13868
13875
  if (setExpandedIndex) setExpandedIndex(index);
13869
- }, [index, setExpandedIndex]);
13876
+ if (onToggle) onToggle();
13877
+ }, [index, setExpandedIndex, onToggle]);
13870
13878
  const touchableStyle = (0, import_react69.useMemo)(
13871
13879
  () => ({
13872
13880
  ...Css.df.jcsb.gapPx(12).aic.p2.baseMd.outline("none").onHover.bgGray100.if(!!titleOnClick).baseSb.$,
@@ -14384,7 +14392,6 @@ function SuperDrawer() {
14384
14392
  }
14385
14393
 
14386
14394
  // src/components/Layout/FormPageLayout.tsx
14387
- var import_mobx_react21 = require("mobx-react");
14388
14395
  var import_react85 = __toESM(require("react"), 1);
14389
14396
  var import_react_aria43 = require("react-aria");
14390
14397
 
@@ -15240,7 +15247,7 @@ function BoundForm(props) {
15240
15247
  function FormRow({ row, formState }) {
15241
15248
  const tid = useTestIds({}, "boundFormRow");
15242
15249
  const componentsWithConfig = (0, import_react81.useMemo)(() => {
15243
- return safeEntries(row).map(([key, fieldFnOrCustomNode]) => {
15250
+ return Object.entries(row).map(([key, fieldFnOrCustomNode]) => {
15244
15251
  if (typeof fieldFnOrCustomNode === "function" && !isCustomReactNodeKey(key)) {
15245
15252
  const field = formState[key] ?? fail(`Field ${key.toString()} not found in formState`);
15246
15253
  const fieldFn = fieldFnOrCustomNode ?? fail(`Field function not defined for key ${key.toLocaleString()}`);
@@ -15606,7 +15613,7 @@ function PageHeader(props) {
15606
15613
  breadCrumb && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(PageHeaderBreadcrumbs, { breadcrumb: breadCrumb }),
15607
15614
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h1", { css: Css.xl3Sb.$, ...tids.pageTitle, children: pageTitle })
15608
15615
  ] }),
15609
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_mobx_react21.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { css: Css.df.gap1.$, children: [
15616
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { css: Css.df.gap1.$, children: [
15610
15617
  tertiaryAction && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
15611
15618
  Button,
15612
15619
  {
@@ -15614,8 +15621,7 @@ function PageHeader(props) {
15614
15621
  onClick: tertiaryAction.onClick,
15615
15622
  variant: "tertiary",
15616
15623
  disabled: tertiaryAction.disabled,
15617
- tooltip: tertiaryAction.tooltip,
15618
- ...tids.tertiaryAction
15624
+ tooltip: tertiaryAction.tooltip
15619
15625
  }
15620
15626
  ),
15621
15627
  cancelAction && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
@@ -15625,22 +15631,11 @@ function PageHeader(props) {
15625
15631
  onClick: cancelAction.onClick,
15626
15632
  variant: "secondary",
15627
15633
  disabled: cancelAction.disabled,
15628
- tooltip: cancelAction.tooltip,
15629
- ...tids.cancelAction
15634
+ tooltip: cancelAction.tooltip
15630
15635
  }
15631
15636
  ),
15632
- submitAction && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
15633
- Button,
15634
- {
15635
- label: submitAction.label,
15636
- onClick: submitAction.onClick,
15637
- variant: "primary",
15638
- disabled: !formState.valid || submitAction.disabled,
15639
- tooltip: submitAction.tooltip,
15640
- ...tids.submitAction
15641
- }
15642
- )
15643
- ] }) })
15637
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(SubmitButton, { form: formState, ...submitAction })
15638
+ ] })
15644
15639
  ] }) });
15645
15640
  }
15646
15641
  function FormSections(props) {