@homebound/beam 4.30.0 → 4.32.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
@@ -207,6 +207,7 @@ __export(index_exports, {
207
207
  StepperLayout: () => StepperLayout,
208
208
  StepperTab: () => StepperTab,
209
209
  StepperTabs: () => StepperTabs,
210
+ StyledRadio: () => StyledRadio,
210
211
  SubmitButton: () => SubmitButton,
211
212
  SuperDrawerContent: () => SuperDrawerContent,
212
213
  SuperDrawerHeader: () => SuperDrawerHeader,
@@ -17310,6 +17311,7 @@ function EntityLockup(props) {
17310
17311
  const {
17311
17312
  imgSrc,
17312
17313
  title,
17314
+ eyebrow,
17313
17315
  description,
17314
17316
  right,
17315
17317
  compact = false
@@ -17317,10 +17319,13 @@ function EntityLockup(props) {
17317
17319
  const tid = useTestIds(props, "entityLockup");
17318
17320
  const styles = compact ? compactStyles : defaultStyles;
17319
17321
  return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.container), ...tid, children: [
17320
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.image), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("img", { src: imgSrc, alt: "", loading: "lazy", className: "w100 h100 obf_cover db", ...tid.image }) }),
17322
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.image), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("img", { src: imgSrc, alt: title, loading: "lazy", className: "w100 h100 obf_cover db", ...tid.image }) }),
17321
17323
  /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.body), children: [
17322
17324
  /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.text), children: [
17323
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.title), ...tid.title, children: title }),
17325
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.heading), children: [
17326
+ isDefined(eyebrow) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.eyebrow), ...tid.eyebrow, children: eyebrow }),
17327
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.title), ...tid.title, children: title })
17328
+ ] }),
17324
17329
  isDefined(description) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.description), ...tid.description, children: description })
17325
17330
  ] }),
17326
17331
  isDefined(right) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.right), ...tid.right, children: right })
@@ -17363,6 +17368,19 @@ var defaultStyles = {
17363
17368
  flexGrow: "fg1",
17364
17369
  gap: "g_1"
17365
17370
  },
17371
+ heading: {
17372
+ display: "df",
17373
+ flexDirection: "fdc",
17374
+ gap: "g_2px"
17375
+ },
17376
+ eyebrow: {
17377
+ fontWeight: "fw4",
17378
+ fontSize: "fz_14px",
17379
+ lineHeight: "lh_20px",
17380
+ color: ["color_var", {
17381
+ "--color": "var(--b-on-surface)"
17382
+ }]
17383
+ },
17366
17384
  title: {
17367
17385
  fontWeight: "fw6",
17368
17386
  fontSize: "fz_14px",
@@ -17430,6 +17448,18 @@ var compactStyles = {
17430
17448
  gap: "g_2px",
17431
17449
  paddingTop: "pt_4px"
17432
17450
  },
17451
+ heading: {
17452
+ display: "df",
17453
+ flexDirection: "fdc"
17454
+ },
17455
+ eyebrow: {
17456
+ fontWeight: "fw4",
17457
+ fontSize: "fz_12px",
17458
+ lineHeight: "lh_16px",
17459
+ color: ["color_var", {
17460
+ "--color": "var(--b-on-surface)"
17461
+ }]
17462
+ },
17433
17463
  title: {
17434
17464
  fontWeight: "fw6",
17435
17465
  fontSize: "fz_12px",
@@ -22263,7 +22293,7 @@ function GridSelectCard(props) {
22263
22293
  // src/inputs/SelectCard/ListSelectCard.tsx
22264
22294
  var import_react_aria45 = require("react-aria");
22265
22295
 
22266
- // src/inputs/SelectCard/StyledRadio.tsx
22296
+ // src/inputs/StyledRadio.tsx
22267
22297
  var import_react_aria44 = require("react-aria");
22268
22298
  var import_runtime101 = require("@homebound/truss/runtime");
22269
22299
 
@@ -22377,12 +22407,13 @@ function getRadioStateStyles({
22377
22407
  return radioUnchecked;
22378
22408
  }
22379
22409
 
22380
- // src/inputs/SelectCard/StyledRadio.tsx
22410
+ // src/inputs/StyledRadio.tsx
22381
22411
  var import_jsx_runtime142 = require("react/jsx-runtime");
22382
22412
  function StyledRadio(props) {
22383
22413
  const {
22384
22414
  isDisabled = false,
22385
22415
  isSelected = false,
22416
+ isFocusVisible = false,
22386
22417
  label,
22387
22418
  inputProps
22388
22419
  } = props;
@@ -22393,18 +22424,29 @@ function StyledRadio(props) {
22393
22424
  isDisabled
22394
22425
  });
22395
22426
  const tid = useTestIds(props, label ? defaultTestId(label) : void 0);
22396
- return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("input", { type: "radio", ...(0, import_runtime101.trussProps)({
22397
- ...radioReset,
22398
- ...radioDefault,
22399
- ...getRadioStateStyles({
22400
- isDisabled,
22401
- isSelected
22402
- }),
22403
- ...isHovered && !isDisabled ? radioHover : {},
22404
- ...{
22405
- flexShrink: "fs0"
22427
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
22428
+ "input",
22429
+ {
22430
+ type: "radio",
22431
+ ...(0, import_runtime101.trussProps)({
22432
+ ...radioReset,
22433
+ ...radioDefault,
22434
+ ...getRadioStateStyles({
22435
+ isDisabled,
22436
+ isSelected
22437
+ }),
22438
+ ...isHovered && !isDisabled ? radioHover : {},
22439
+ ...isFocusVisible ? radioFocus : {},
22440
+ ...{
22441
+ flexShrink: "fs0"
22442
+ }
22443
+ }),
22444
+ disabled: isDisabled,
22445
+ ...hoverProps,
22446
+ ...tid.value,
22447
+ ...inputProps
22406
22448
  }
22407
- }), disabled: isDisabled, ...hoverProps, ...inputProps, ...tid.value });
22449
+ );
22408
22450
  }
22409
22451
 
22410
22452
  // src/inputs/SelectCard/ListSelectCard.tsx
@@ -23048,6 +23090,7 @@ function RadioGroupField(props) {
23048
23090
  helperText,
23049
23091
  layout = "vertical",
23050
23092
  tooltip,
23093
+ renderOption,
23051
23094
  ...otherProps
23052
23095
  } = props;
23053
23096
  const name = (0, import_react101.useMemo)(() => `radio-group-${++nextNameId}`, []);
@@ -23069,6 +23112,7 @@ function RadioGroupField(props) {
23069
23112
  isRequired: required
23070
23113
  }, state);
23071
23114
  const isThumbnail = layout === "thumbnail";
23115
+ const stretchOptions = !!renderOption && !isThumbnail;
23072
23116
  return (
23073
23117
  // default styling to position `<Label />` above.
23074
23118
  /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...(0, import_runtime106.trussProps)({
@@ -23083,7 +23127,14 @@ function RadioGroupField(props) {
23083
23127
  } : {}
23084
23128
  }), ...tid, children: [
23085
23129
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: labelStyle === "hidden" }),
23086
- /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...radioGroupProps, children: [
23130
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...radioGroupProps, ...(0, import_runtime106.trussProps)({
23131
+ ...stretchOptions && labelStyle === "left" ? {
23132
+ flexGrow: "fg1"
23133
+ } : {},
23134
+ ...stretchOptions && labelStyle !== "left" ? {
23135
+ width: "w100"
23136
+ } : {}
23137
+ }), children: [
23087
23138
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { ...(0, import_runtime106.trussProps)({
23088
23139
  display: "df",
23089
23140
  flexDirection: "fdc",
@@ -23103,7 +23154,7 @@ function RadioGroupField(props) {
23103
23154
  ...otherProps,
23104
23155
  ...tid[option.value]
23105
23156
  };
23106
- return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_react101.Fragment, { children: isThumbnail ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(ThumbnailRadio, { ...radioProps }) : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Radio, { parentId: name, ...radioProps }) }, option.value);
23157
+ return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_react101.Fragment, { children: isThumbnail ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(ThumbnailRadio, { ...radioProps }) : renderOption ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(CustomRadio, { ...radioProps, renderOption }) : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Radio, { parentId: name, ...radioProps }) }, option.value);
23107
23158
  }) }),
23108
23159
  errorMsg && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(ErrorMessage, { errorMsg, ...tid.errorMsg }),
23109
23160
  helperText && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(HelperText, { helperText })
@@ -23217,6 +23268,43 @@ function Radio(props) {
23217
23268
  ] })
23218
23269
  });
23219
23270
  }
23271
+ function CustomRadio(props) {
23272
+ const {
23273
+ option,
23274
+ state,
23275
+ isOptionDisabled,
23276
+ renderOption,
23277
+ ...others
23278
+ } = props;
23279
+ const ref = (0, import_react101.useRef)(null);
23280
+ const {
23281
+ inputProps,
23282
+ isDisabled
23283
+ } = (0, import_react_aria49.useRadio)({
23284
+ value: option.value,
23285
+ "aria-label": option.label,
23286
+ isDisabled: isOptionDisabled
23287
+ }, state, ref);
23288
+ const isSelected = !isDisabled && state.selectedValue === option.value;
23289
+ const {
23290
+ focusProps,
23291
+ isFocusVisible
23292
+ } = (0, import_react_aria49.useFocusRing)();
23293
+ return maybeTooltip({
23294
+ title: resolveTooltip(option.disabled),
23295
+ placement: "bottom",
23296
+ children: renderOption(option, {
23297
+ // Merge others last b/c it could have data-testid in it or onX events.
23298
+ inputProps: {
23299
+ ...(0, import_react_aria49.mergeProps)(inputProps, focusProps, others),
23300
+ ref
23301
+ },
23302
+ isSelected,
23303
+ isDisabled,
23304
+ isFocusVisible
23305
+ })
23306
+ });
23307
+ }
23220
23308
  function ThumbnailRadio(props) {
23221
23309
  const {
23222
23310
  option: {
@@ -32556,6 +32644,7 @@ var togglePressStyles = {
32556
32644
  StepperLayout,
32557
32645
  StepperTab,
32558
32646
  StepperTabs,
32647
+ StyledRadio,
32559
32648
  SubmitButton,
32560
32649
  SuperDrawerContent,
32561
32650
  SuperDrawerHeader,