@homebound/beam 4.31.0 → 4.33.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 +117 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -8
- package/dist/index.d.ts +25 -8
- package/dist/index.js +116 -55
- package/dist/index.js.map +1 -1
- package/dist/truss.css +32 -14
- package/package.json +1 -1
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,
|
|
@@ -17317,103 +17318,105 @@ function EntityLockup(props) {
|
|
|
17317
17318
|
} = props;
|
|
17318
17319
|
const tid = useTestIds(props, "entityLockup");
|
|
17319
17320
|
const styles = compact ? compactStyles : defaultStyles;
|
|
17320
|
-
return
|
|
17321
|
-
|
|
17322
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.
|
|
17323
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.
|
|
17321
|
+
return (
|
|
17322
|
+
// `defaultStyles` query this container's width to switch to compact.
|
|
17323
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "w100 mw0 ctis cn_entityLockup", ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.container), children: [
|
|
17324
|
+
/* @__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 }) }),
|
|
17325
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.body), children: [
|
|
17326
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.text), children: [
|
|
17327
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ...(0, import_runtime69.trussProps)(styles.heading), children: [
|
|
17328
|
+
isDefined(eyebrow) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.eyebrow), ...tid.eyebrow, children: eyebrow }),
|
|
17329
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.title), ...tid.title, children: title })
|
|
17330
|
+
] }),
|
|
17331
|
+
isDefined(description) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.description), ...tid.description, children: description })
|
|
17327
17332
|
] }),
|
|
17328
|
-
isDefined(
|
|
17329
|
-
] })
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
] });
|
|
17333
|
+
isDefined(right) && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ...(0, import_runtime69.trussProps)(styles.right), ...tid.right, children: right })
|
|
17334
|
+
] })
|
|
17335
|
+
] }) })
|
|
17336
|
+
);
|
|
17333
17337
|
}
|
|
17334
17338
|
var defaultStyles = {
|
|
17335
17339
|
container: {
|
|
17336
17340
|
display: "df",
|
|
17337
17341
|
alignItems: "aifs",
|
|
17338
|
-
gap: "g_2"
|
|
17342
|
+
gap: "g_2 container_entityLockup_max_width_400px_g_12px"
|
|
17339
17343
|
},
|
|
17340
17344
|
image: {
|
|
17341
17345
|
flexShrink: "fs0",
|
|
17342
|
-
height: "h_96px",
|
|
17343
|
-
width: "w_96px",
|
|
17346
|
+
height: "h_96px container_entityLockup_max_width_400px_h_62px",
|
|
17347
|
+
width: "w_96px container_entityLockup_max_width_400px_w_62px",
|
|
17344
17348
|
borderRadius: "br8",
|
|
17345
17349
|
borderStyle: "bss",
|
|
17346
17350
|
borderWidth: "bw1",
|
|
17347
|
-
borderColor: ["bc_var", {
|
|
17348
|
-
"--borderColor": "var(--b-field-border-default)"
|
|
17351
|
+
borderColor: ["bc_var container_entityLockup_max_width_400px_bc_var", {
|
|
17352
|
+
"--borderColor": "var(--b-field-border-default)",
|
|
17353
|
+
"--container_entityLockup_max_width_400px_borderColor": "var(--b-surface-separator)"
|
|
17349
17354
|
}],
|
|
17350
17355
|
overflow: "oh",
|
|
17351
17356
|
backgroundColor: ["bgColor_var", {
|
|
17352
17357
|
"--backgroundColor": "var(--b-surface-raised)"
|
|
17353
17358
|
}]
|
|
17354
17359
|
},
|
|
17355
|
-
// On small screens, `right` moves under the description so the text keeps its width.
|
|
17356
17360
|
body: {
|
|
17357
17361
|
display: "df",
|
|
17358
17362
|
flexGrow: "fg1",
|
|
17359
17363
|
minWidth: "mw0",
|
|
17360
|
-
gap: "g_2
|
|
17361
|
-
|
|
17364
|
+
gap: "g_2 container_entityLockup_max_width_400px_g_12px",
|
|
17365
|
+
alignSelf: "container_entityLockup_max_width_400px_asStretch"
|
|
17362
17366
|
},
|
|
17363
17367
|
text: {
|
|
17364
17368
|
display: "df",
|
|
17365
17369
|
flexDirection: "fdc",
|
|
17366
17370
|
minWidth: "mw0",
|
|
17367
17371
|
flexGrow: "fg1",
|
|
17368
|
-
gap: "g_1"
|
|
17372
|
+
gap: "g_1 container_entityLockup_max_width_400px_g_2px",
|
|
17373
|
+
paddingTop: "container_entityLockup_max_width_400px_pt_4px"
|
|
17369
17374
|
},
|
|
17370
17375
|
heading: {
|
|
17371
17376
|
display: "df",
|
|
17372
17377
|
flexDirection: "fdc",
|
|
17373
|
-
gap: "g_2px"
|
|
17378
|
+
gap: "g_2px container_entityLockup_max_width_400px_g_0"
|
|
17374
17379
|
},
|
|
17375
17380
|
eyebrow: {
|
|
17376
|
-
fontWeight: "fw4",
|
|
17377
|
-
fontSize: "fz_14px",
|
|
17378
|
-
lineHeight: "lh_20px",
|
|
17381
|
+
fontWeight: "fw4 container_entityLockup_max_width_400px_fw4",
|
|
17382
|
+
fontSize: "fz_14px container_entityLockup_max_width_400px_fz_12px",
|
|
17383
|
+
lineHeight: "lh_20px container_entityLockup_max_width_400px_lh_16px",
|
|
17379
17384
|
color: ["color_var", {
|
|
17380
17385
|
"--color": "var(--b-on-surface)"
|
|
17381
17386
|
}]
|
|
17382
17387
|
},
|
|
17383
17388
|
title: {
|
|
17384
|
-
fontWeight: "fw6",
|
|
17385
|
-
fontSize: "fz_14px",
|
|
17386
|
-
lineHeight: "lh_20px",
|
|
17389
|
+
fontWeight: "fw6 container_entityLockup_max_width_400px_fw6",
|
|
17390
|
+
fontSize: "fz_14px container_entityLockup_max_width_400px_fz_12px",
|
|
17391
|
+
lineHeight: "lh_20px container_entityLockup_max_width_400px_lh_16px",
|
|
17387
17392
|
color: ["color_var", {
|
|
17388
17393
|
"--color": "var(--b-on-surface)"
|
|
17389
17394
|
}]
|
|
17390
17395
|
},
|
|
17391
17396
|
description: {
|
|
17392
|
-
fontWeight: "fw4",
|
|
17393
|
-
fontSize: "fz_12px",
|
|
17394
|
-
lineHeight: "lh_16px",
|
|
17397
|
+
fontWeight: "fw4 container_entityLockup_max_width_400px_fw4",
|
|
17398
|
+
fontSize: "fz_12px container_entityLockup_max_width_400px_fz_10px",
|
|
17399
|
+
lineHeight: "lh_16px container_entityLockup_max_width_400px_lh_14px",
|
|
17395
17400
|
color: ["color_var", {
|
|
17396
17401
|
"--color": "var(--b-on-surface)"
|
|
17397
17402
|
}]
|
|
17398
17403
|
},
|
|
17399
|
-
// Capped at half the row so wide content can't squeeze the text to nothing
|
|
17400
|
-
// A lone child (fewer than two elements) stays right-aligned instead of falling to the start under `jcsb`.
|
|
17404
|
+
// Capped at half the row so wide content can't squeeze the text to nothing.
|
|
17401
17405
|
right: {
|
|
17402
17406
|
flexShrink: "fs0",
|
|
17403
|
-
maxWidth: "maxw50
|
|
17407
|
+
maxWidth: "maxw50",
|
|
17404
17408
|
display: "df",
|
|
17405
|
-
flexDirection: "fdc
|
|
17406
|
-
alignItems: "aife
|
|
17409
|
+
flexDirection: "fdc",
|
|
17410
|
+
alignItems: "aife",
|
|
17407
17411
|
gap: "g_6px",
|
|
17408
|
-
alignSelf: "asfs
|
|
17409
|
-
textAlign: "tar"
|
|
17410
|
-
justifyContent: "sm_jcsb sm_n_has_nth_child_2_jcfe"
|
|
17412
|
+
alignSelf: "asfs",
|
|
17413
|
+
textAlign: "tar"
|
|
17411
17414
|
}
|
|
17412
17415
|
};
|
|
17413
17416
|
var compactStyles = {
|
|
17414
17417
|
container: {
|
|
17415
17418
|
display: "df",
|
|
17416
|
-
alignItems: "
|
|
17419
|
+
alignItems: "aifs",
|
|
17417
17420
|
gap: "g_12px"
|
|
17418
17421
|
},
|
|
17419
17422
|
image: {
|
|
@@ -22292,7 +22295,7 @@ function GridSelectCard(props) {
|
|
|
22292
22295
|
// src/inputs/SelectCard/ListSelectCard.tsx
|
|
22293
22296
|
var import_react_aria45 = require("react-aria");
|
|
22294
22297
|
|
|
22295
|
-
// src/inputs/
|
|
22298
|
+
// src/inputs/StyledRadio.tsx
|
|
22296
22299
|
var import_react_aria44 = require("react-aria");
|
|
22297
22300
|
var import_runtime101 = require("@homebound/truss/runtime");
|
|
22298
22301
|
|
|
@@ -22406,12 +22409,13 @@ function getRadioStateStyles({
|
|
|
22406
22409
|
return radioUnchecked;
|
|
22407
22410
|
}
|
|
22408
22411
|
|
|
22409
|
-
// src/inputs/
|
|
22412
|
+
// src/inputs/StyledRadio.tsx
|
|
22410
22413
|
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
22411
22414
|
function StyledRadio(props) {
|
|
22412
22415
|
const {
|
|
22413
22416
|
isDisabled = false,
|
|
22414
22417
|
isSelected = false,
|
|
22418
|
+
isFocusVisible = false,
|
|
22415
22419
|
label,
|
|
22416
22420
|
inputProps
|
|
22417
22421
|
} = props;
|
|
@@ -22422,18 +22426,29 @@ function StyledRadio(props) {
|
|
|
22422
22426
|
isDisabled
|
|
22423
22427
|
});
|
|
22424
22428
|
const tid = useTestIds(props, label ? defaultTestId(label) : void 0);
|
|
22425
|
-
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
22430
|
+
"input",
|
|
22431
|
+
{
|
|
22432
|
+
type: "radio",
|
|
22433
|
+
...(0, import_runtime101.trussProps)({
|
|
22434
|
+
...radioReset,
|
|
22435
|
+
...radioDefault,
|
|
22436
|
+
...getRadioStateStyles({
|
|
22437
|
+
isDisabled,
|
|
22438
|
+
isSelected
|
|
22439
|
+
}),
|
|
22440
|
+
...isHovered && !isDisabled ? radioHover : {},
|
|
22441
|
+
...isFocusVisible ? radioFocus : {},
|
|
22442
|
+
...{
|
|
22443
|
+
flexShrink: "fs0"
|
|
22444
|
+
}
|
|
22445
|
+
}),
|
|
22446
|
+
disabled: isDisabled,
|
|
22447
|
+
...hoverProps,
|
|
22448
|
+
...tid.value,
|
|
22449
|
+
...inputProps
|
|
22435
22450
|
}
|
|
22436
|
-
|
|
22451
|
+
);
|
|
22437
22452
|
}
|
|
22438
22453
|
|
|
22439
22454
|
// src/inputs/SelectCard/ListSelectCard.tsx
|
|
@@ -23077,6 +23092,7 @@ function RadioGroupField(props) {
|
|
|
23077
23092
|
helperText,
|
|
23078
23093
|
layout = "vertical",
|
|
23079
23094
|
tooltip,
|
|
23095
|
+
renderOption,
|
|
23080
23096
|
...otherProps
|
|
23081
23097
|
} = props;
|
|
23082
23098
|
const name = (0, import_react101.useMemo)(() => `radio-group-${++nextNameId}`, []);
|
|
@@ -23098,6 +23114,7 @@ function RadioGroupField(props) {
|
|
|
23098
23114
|
isRequired: required
|
|
23099
23115
|
}, state);
|
|
23100
23116
|
const isThumbnail = layout === "thumbnail";
|
|
23117
|
+
const stretchOptions = !!renderOption && !isThumbnail;
|
|
23101
23118
|
return (
|
|
23102
23119
|
// default styling to position `<Label />` above.
|
|
23103
23120
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...(0, import_runtime106.trussProps)({
|
|
@@ -23112,7 +23129,14 @@ function RadioGroupField(props) {
|
|
|
23112
23129
|
} : {}
|
|
23113
23130
|
}), ...tid, children: [
|
|
23114
23131
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: labelStyle === "hidden" }),
|
|
23115
|
-
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...radioGroupProps,
|
|
23132
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { ...radioGroupProps, ...(0, import_runtime106.trussProps)({
|
|
23133
|
+
...stretchOptions && labelStyle === "left" ? {
|
|
23134
|
+
flexGrow: "fg1"
|
|
23135
|
+
} : {},
|
|
23136
|
+
...stretchOptions && labelStyle !== "left" ? {
|
|
23137
|
+
width: "w100"
|
|
23138
|
+
} : {}
|
|
23139
|
+
}), children: [
|
|
23116
23140
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { ...(0, import_runtime106.trussProps)({
|
|
23117
23141
|
display: "df",
|
|
23118
23142
|
flexDirection: "fdc",
|
|
@@ -23132,7 +23156,7 @@ function RadioGroupField(props) {
|
|
|
23132
23156
|
...otherProps,
|
|
23133
23157
|
...tid[option.value]
|
|
23134
23158
|
};
|
|
23135
|
-
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);
|
|
23159
|
+
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);
|
|
23136
23160
|
}) }),
|
|
23137
23161
|
errorMsg && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(ErrorMessage, { errorMsg, ...tid.errorMsg }),
|
|
23138
23162
|
helperText && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(HelperText, { helperText })
|
|
@@ -23246,6 +23270,43 @@ function Radio(props) {
|
|
|
23246
23270
|
] })
|
|
23247
23271
|
});
|
|
23248
23272
|
}
|
|
23273
|
+
function CustomRadio(props) {
|
|
23274
|
+
const {
|
|
23275
|
+
option,
|
|
23276
|
+
state,
|
|
23277
|
+
isOptionDisabled,
|
|
23278
|
+
renderOption,
|
|
23279
|
+
...others
|
|
23280
|
+
} = props;
|
|
23281
|
+
const ref = (0, import_react101.useRef)(null);
|
|
23282
|
+
const {
|
|
23283
|
+
inputProps,
|
|
23284
|
+
isDisabled
|
|
23285
|
+
} = (0, import_react_aria49.useRadio)({
|
|
23286
|
+
value: option.value,
|
|
23287
|
+
"aria-label": option.label,
|
|
23288
|
+
isDisabled: isOptionDisabled
|
|
23289
|
+
}, state, ref);
|
|
23290
|
+
const isSelected = !isDisabled && state.selectedValue === option.value;
|
|
23291
|
+
const {
|
|
23292
|
+
focusProps,
|
|
23293
|
+
isFocusVisible
|
|
23294
|
+
} = (0, import_react_aria49.useFocusRing)();
|
|
23295
|
+
return maybeTooltip({
|
|
23296
|
+
title: resolveTooltip(option.disabled),
|
|
23297
|
+
placement: "bottom",
|
|
23298
|
+
children: renderOption(option, {
|
|
23299
|
+
// Merge others last b/c it could have data-testid in it or onX events.
|
|
23300
|
+
inputProps: {
|
|
23301
|
+
...(0, import_react_aria49.mergeProps)(inputProps, focusProps, others),
|
|
23302
|
+
ref
|
|
23303
|
+
},
|
|
23304
|
+
isSelected,
|
|
23305
|
+
isDisabled,
|
|
23306
|
+
isFocusVisible
|
|
23307
|
+
})
|
|
23308
|
+
});
|
|
23309
|
+
}
|
|
23249
23310
|
function ThumbnailRadio(props) {
|
|
23250
23311
|
const {
|
|
23251
23312
|
option: {
|
|
@@ -32585,6 +32646,7 @@ var togglePressStyles = {
|
|
|
32585
32646
|
StepperLayout,
|
|
32586
32647
|
StepperTab,
|
|
32587
32648
|
StepperTabs,
|
|
32649
|
+
StyledRadio,
|
|
32588
32650
|
SubmitButton,
|
|
32589
32651
|
SuperDrawerContent,
|
|
32590
32652
|
SuperDrawerHeader,
|