@homebound/beam 2.367.0 → 2.369.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/components/Icon.js +1 -1
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.d.ts +1 -1
- package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +1 -1
- package/dist/inputs/TextField.d.ts +2 -0
- package/dist/inputs/TextFieldBase.d.ts +2 -0
- package/dist/inputs/TextFieldBase.js +3 -2
- package/package.json +1 -1
package/dist/components/Icon.js
CHANGED
|
@@ -102,7 +102,7 @@ exports.Icons = {
|
|
|
102
102
|
subDirectoryRight: (0, jsx_runtime_1.jsx)("path", { d: "M14 13H8V5H6V14C6 14.553 6.447 15 7 15H14V18L19 14L14 10V13Z" }),
|
|
103
103
|
// Media
|
|
104
104
|
camera: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 8C9.832 8 8 9.832 8 12C8 14.168 9.832 16 12 16C14.168 16 16 14.168 16 12C16 9.832 14.168 8 12 8ZM12 14C10.935 14 10 13.065 10 12C10 10.935 10.935 10 12 10C13.065 10 14 10.935 14 12C14 13.065 13.065 14 12 14Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M20 5H17.414L14.707 2.293C14.52 2.105 14.266 2 14 2H10C9.734 2 9.48 2.105 9.293 2.293L6.586 5H4C2.897 5 2 5.897 2 7V18C2 19.103 2.897 20 4 20H20C21.103 20 22 19.103 22 18V7C22 5.897 21.103 5 20 5ZM4 18V7H7C7.266 7 7.52 6.895 7.707 6.707L10.414 4H13.586L16.293 6.707C16.48 6.895 16.734 7 17 7H20L20.002 18H4Z" })] })),
|
|
105
|
-
email: ((0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", "clip-rule": "evenodd", d: "
|
|
105
|
+
email: ((0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", "clip-rule": "evenodd", d: "M19.7885 7.82129L11.9381 14.1015L4.13462 7.41281V18.0529H19.7885V7.82129ZM5.92342 6.13462L11.9851 11.3303L18.4797 6.13462H5.92342ZM2 20.1875V4H21.9231V6.02293L21.9673 6.07821L21.9231 6.11359V20.1875H2Z" })),
|
|
106
106
|
fileBlank: ((0, jsx_runtime_1.jsx)("path", { d: "M19.937 8.68C19.926 8.648 19.917 8.617 19.904 8.586C19.855 8.48 19.794 8.379 19.708 8.293L13.708 2.293C13.622 2.207 13.521 2.146 13.415 2.097C13.385 2.083 13.353 2.075 13.321 2.064C13.237 2.036 13.151 2.018 13.062 2.013C13.04 2.011 13.021 2 13 2H6C4.897 2 4 2.897 4 4V20C4 21.103 4.897 22 6 22H18C19.103 22 20 21.103 20 20V9C20 8.979 19.989 8.96 19.987 8.938C19.982 8.85 19.965 8.764 19.937 8.68ZM16.586 8H14V5.414L16.586 8ZM6 20V4H12V9C12 9.553 12.447 10 13 10H18L18.002 20H6Z" })),
|
|
107
107
|
folder: ((0, jsx_runtime_1.jsx)("path", { d: "M20 5H11.414L9.707 3.293C9.52 3.105 9.265 3 9 3H4C2.897 3 2 3.897 2 5V19C2 20.103 2.897 21 4 21H20C21.103 21 22 20.103 22 19V7C22 5.897 21.103 5 20 5ZM4 19V7H11H12H20L20.002 19H4Z" })),
|
|
108
108
|
image: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M7.49902 11C8.32745 11 8.99902 10.3284 8.99902 9.5C8.99902 8.67157 8.32745 8 7.49902 8C6.6706 8 5.99902 8.67157 5.99902 9.5C5.99902 10.3284 6.6706 11 7.49902 11Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.499 14L8.99902 12L5.99902 16H8.99902H11.999H17.999L13.499 10L10.499 14Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M19.999 4H3.99902C2.89602 4 1.99902 4.897 1.99902 6V18C1.99902 19.103 2.89602 20 3.99902 20H19.999C21.102 20 21.999 19.103 21.999 18V6C21.999 4.897 21.102 4 19.999 4ZM3.99902 18V6H19.999L20.001 18H3.99902Z" })] })),
|
|
@@ -16,7 +16,7 @@ function SuperDrawerHeader(props) {
|
|
|
16
16
|
const currentContent = (_b = contentStack.current[contentStack.current.length - 1]) === null || _b === void 0 ? void 0 : _b.opts;
|
|
17
17
|
const isDetail = currentContent !== firstContent;
|
|
18
18
|
const tid = (0, utils_1.useTestIds)({}, "superDrawerHeader");
|
|
19
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.aic.jcsb.gap3.$, ...tid, children: [isStructuredProps(props) ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.gap2.fg1.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.fg1.df.aic.gap2.$, children: [(0, jsx_runtime_1.jsx)("h1", { children: props.title }), props.left] }), props.right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.$, children: props.right })] })) : ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.$, children: props.children })), !hideControls && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.if(isDetail).vh.$, children: (0, jsx_runtime_1.jsx)(ButtonGroup_1.ButtonGroup, { buttons: [
|
|
19
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.aic.jcsb.gap3.$, ...tid, children: [isStructuredProps(props) ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.df.jcsb.aic.gap2.fg1.$, children: [(0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.fg1.df.aic.gap2.$, children: [typeof props.title === "string" ? (0, jsx_runtime_1.jsx)("h1", { children: props.title }) : props.title, props.left] }), props.right && (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.$, children: props.right })] })) : ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.$, children: props.children })), !hideControls && ((0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fs0.if(isDetail).vh.$, children: (0, jsx_runtime_1.jsx)(ButtonGroup_1.ButtonGroup, { buttons: [
|
|
20
20
|
{ icon: "chevronLeft", onClick: () => onPrevClick && onPrevClick(), disabled: !onPrevClick },
|
|
21
21
|
{ icon: "chevronRight", onClick: () => onNextClick && onNextClick(), disabled: !onNextClick },
|
|
22
22
|
], ...tid.actions }) }))] }), sdHeaderDiv);
|
|
@@ -19,6 +19,8 @@ export interface TextFieldProps<X> extends BeamTextFieldProps<X> {
|
|
|
19
19
|
endAdornment?: ReactNode;
|
|
20
20
|
startAdornment?: ReactNode;
|
|
21
21
|
hideErrorMessage?: boolean;
|
|
22
|
+
/** Allow focusing without selecting, i.e. to let the user keep typing after we've pre-filled text + called focus, like the Add New component. */
|
|
23
|
+
selectOnFocus?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare function TextField<X extends Only<TextFieldXss, X>>(props: TextFieldProps<X>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
26
|
export type TextFieldApi = {
|
|
@@ -18,5 +18,7 @@ export interface TextFieldBaseProps<X> extends Pick<BeamTextFieldProps<X>, "labe
|
|
|
18
18
|
hideErrorMessage?: boolean;
|
|
19
19
|
alwaysShowHelperText?: boolean;
|
|
20
20
|
unfocusedPlaceholder?: ReactNode;
|
|
21
|
+
/** Allow focusing without selecting, i.e. to let the user keep typing after we've pre-filled text + called focus, like the Add New component. */
|
|
22
|
+
selectOnFocus?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare function TextFieldBase<X extends Only<TextFieldXss, X>>(props: TextFieldBaseProps<X>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -20,7 +20,7 @@ function TextFieldBase(props) {
|
|
|
20
20
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
21
21
|
const { fieldProps, wrap = false } = (0, PresentationContext_1.usePresentationContext)();
|
|
22
22
|
const { labelLeftFieldWidth = "50%" } = fieldProps !== null && fieldProps !== void 0 ? fieldProps : {};
|
|
23
|
-
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, fullWidth = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _f !== void 0 ? _f : false, unfocusedPlaceholder, } = props;
|
|
23
|
+
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, fullWidth = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _f !== void 0 ? _f : false, unfocusedPlaceholder, selectOnFocus = true, } = props;
|
|
24
24
|
const typeScale = (_g = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _g !== void 0 ? _g : (inputProps.readOnly && labelStyle !== "hidden" ? "smMd" : "sm");
|
|
25
25
|
const internalProps = props.internalProps || {};
|
|
26
26
|
const { compound = false, forceFocus = false, forceHover = false } = internalProps;
|
|
@@ -104,7 +104,8 @@ function TextFieldBase(props) {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
const onFocusChained = (0, react_aria_1.chain)((e) => {
|
|
107
|
-
|
|
107
|
+
if (selectOnFocus)
|
|
108
|
+
e.target.select();
|
|
108
109
|
}, onFocus);
|
|
109
110
|
// Simulate clicking `ElementType` when using an unfocused placeholder
|
|
110
111
|
function handleUnfocusedPlaceholderClick(e) {
|