@homebound/beam 2.254.1 → 2.255.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.
|
@@ -13,6 +13,6 @@ function StaticField(props) {
|
|
|
13
13
|
const { label, labelStyle = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.labelStyle) !== null && _a !== void 0 ? _a : "above", value, children } = props;
|
|
14
14
|
const tid = (0, useTestIds_1.useTestIds)(props, typeof label === "string" ? (0, defaultTestId_1.defaultTestId)(label) : "staticField");
|
|
15
15
|
const id = (0, utils_1.useId)();
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.if(labelStyle === "left").df.jcsb.maxw100.$, ...tid.container, children: [(0, jsx_runtime_1.jsx)("label", { css: Css_1.Css.db.sm.gray700.mbPx(4).$, htmlFor: id, ...tid.label, children: label }), (0, jsx_runtime_1.jsx)("div", { id: id, css: Css_1.Css.smMd.gray900.df.aic.if(labelStyle === "left").w50.$, ...tid, children: value || children })] }));
|
|
17
17
|
}
|
|
18
18
|
exports.StaticField = StaticField;
|
|
@@ -17,7 +17,7 @@ const useTestIds_1 = require("../utils/useTestIds");
|
|
|
17
17
|
// Used by both TextField and TextArea
|
|
18
18
|
function TextFieldBase(props) {
|
|
19
19
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
20
|
-
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
20
|
+
const { fieldProps, wrap = false } = (0, PresentationContext_1.usePresentationContext)();
|
|
21
21
|
const { label, required, labelProps, inputProps, inputRef, inputWrapRef, groupProps, compact = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact) !== null && _a !== void 0 ? _a : false, errorMsg, helperText, multiline = false, onChange, onBlur, onFocus, xss, endAdornment, startAdornment, labelStyle = (_b = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.labelStyle) !== null && _b !== void 0 ? _b : "above", contrast = false, borderless = (_c = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.borderless) !== null && _c !== void 0 ? _c : false, textAreaMinHeight = 96, clearable = false, tooltip, visuallyDisabled = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.visuallyDisabled) !== null && _d !== void 0 ? _d : true, errorInTooltip = (_e = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.errorInTooltip) !== null && _e !== void 0 ? _e : false, hideErrorMessage = false, alwaysShowHelperText = false, } = props;
|
|
22
22
|
const typeScale = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _f !== void 0 ? _f : (inputProps.readOnly && labelStyle !== "hidden" ? "smMd" : "sm");
|
|
23
23
|
const internalProps = props.internalProps || {};
|
|
@@ -99,7 +99,7 @@ function TextFieldBase(props) {
|
|
|
99
99
|
children: inputProps.readOnly ? ((0, jsx_runtime_1.jsxs)("div", { css: {
|
|
100
100
|
// Use input wrapper to get common styles, but then we need to override some
|
|
101
101
|
...fieldStyles.inputWrapperReadOnly,
|
|
102
|
-
...(multiline ? Css_1.Css.fdc.aifs.gap2.$ : Css_1.Css.truncate.$),
|
|
102
|
+
...(multiline ? Css_1.Css.fdc.aifs.gap2.$ : Css_1.Css.if(wrap === false).truncate.$),
|
|
103
103
|
...xss,
|
|
104
104
|
}, "data-readonly": "true", ...tid, children: [!multiline && labelStyle === "inline" && label && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, { labelProps: labelProps, label: label, ...tid.label })), multiline
|
|
105
105
|
? (_g = inputProps.value) === null || _g === void 0 ? void 0 : _g.split("\n\n").map((p, i) => ((0, jsx_runtime_1.jsx)("p", { css: Css_1.Css.my1.$, children: p.split("\n").map((sentence, j) => ((0, jsx_runtime_1.jsxs)("span", { children: [sentence, (0, jsx_runtime_1.jsx)("br", {})] }, j))) }, i)))
|