@homebound/beam 2.186.5 → 2.186.6
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DOMProps } from "@react-types/shared";
|
|
2
|
-
import React, { AriaAttributes } from "react";
|
|
2
|
+
import React, { AriaAttributes, ReactNode } from "react";
|
|
3
3
|
import { Margin, Palette, Xss } from "../Css";
|
|
4
4
|
export interface IconProps extends AriaAttributes, DOMProps {
|
|
5
5
|
/** The name of an icon */
|
|
@@ -10,6 +10,7 @@ export interface IconProps extends AriaAttributes, DOMProps {
|
|
|
10
10
|
inc?: number;
|
|
11
11
|
/** Styles overrides */
|
|
12
12
|
xss?: Xss<Margin | "visibility">;
|
|
13
|
+
tooltip?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const Icon: React.MemoExoticComponent<(props: IconProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
15
16
|
/**
|
package/dist/components/Icon.js
CHANGED
|
@@ -6,11 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Icons = exports.Icon = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const Tooltip_1 = require("./Tooltip");
|
|
9
10
|
const Css_1 = require("../Css");
|
|
10
11
|
exports.Icon = react_1.default.memo((props) => {
|
|
11
|
-
const { icon, inc = 3, color = "currentColor", xss, ...other } = props;
|
|
12
|
+
const { icon, inc = 3, color = "currentColor", xss, tooltip, ...other } = props;
|
|
12
13
|
const size = (0, Css_1.increment)(inc);
|
|
13
|
-
return (
|
|
14
|
+
return (0, Tooltip_1.maybeTooltip)({
|
|
15
|
+
title: tooltip,
|
|
16
|
+
placement: "top",
|
|
17
|
+
children: ((0, jsx_runtime_1.jsx)("svg", Object.assign({ "aria-hidden": true, width: size, height: size, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", css: { "path, rect": Css_1.Css.fill(color).$, ...xss }, "data-icon": icon }, other, { children: exports.Icons[icon] }), void 0)),
|
|
18
|
+
});
|
|
14
19
|
});
|
|
15
20
|
/**
|
|
16
21
|
* Map of icons paths mapped to their respective name.
|
|
@@ -94,7 +94,7 @@ function TextFieldBase(props) {
|
|
|
94
94
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: fieldStyles.container }, groupProps, focusWithinProps, { children: [label && !inlineLabel && (
|
|
95
95
|
// set `hidden` if being rendered as a compound field
|
|
96
96
|
(0, jsx_runtime_1.jsx)(Label_1.Label, Object.assign({ labelProps: labelProps, hidden: hideLabel || compound, label: label, suffix: labelSuffix, contrast: contrast }, tid.label), void 0)), (0, components_1.maybeTooltip)({
|
|
97
|
-
title:
|
|
97
|
+
title: tooltip,
|
|
98
98
|
placement: "top",
|
|
99
99
|
children: inputProps.readOnly ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: {
|
|
100
100
|
// Use input wrapper to get common styles, but then we need to override some
|
|
@@ -121,7 +121,7 @@ function TextFieldBase(props) {
|
|
|
121
121
|
onChange(undefined);
|
|
122
122
|
// Reset focus to input element
|
|
123
123
|
(_a = fieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
124
|
-
} }, void 0)), !multiline && endAdornment && (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.df.aic.pl1.fs0.$ }, { children: endAdornment }), void 0)] }), void 0)),
|
|
124
|
+
} }, void 0)), errorInTooltip && errorMsg && ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.df.aic.pl1.fs0.$ }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "error", color: Css_1.Palette.Red600, tooltip: errorMsg }, void 0) }), void 0)), !multiline && endAdornment && (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.df.aic.pl1.fs0.$ }, { children: endAdornment }), void 0)] }), void 0)),
|
|
125
125
|
}), !compound && !inputProps.disabled && !inputProps.readOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [errorMsg && !errorInTooltip && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ id: errorMessageId, errorMsg: errorMsg }, tid.errorMsg), void 0), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, Object.assign({ helperText: helperText }, tid.helperText), void 0)] }, void 0))] }), void 0));
|
|
126
126
|
}
|
|
127
127
|
exports.TextFieldBase = TextFieldBase;
|