@homebound/beam 2.344.0 → 2.344.1
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/Label.js
CHANGED
|
@@ -12,7 +12,13 @@ const src_1 = require("..");
|
|
|
12
12
|
/** An internal helper component for rendering form labels. */
|
|
13
13
|
function LabelComponent(props) {
|
|
14
14
|
const { labelProps, label, hidden, suffix, contrast = false, tooltip, inline, xss, ...others } = props;
|
|
15
|
-
const labelEl = ((0, jsx_runtime_1.jsxs)("label", { ...labelProps, ...others, css: {
|
|
15
|
+
const labelEl = ((0, jsx_runtime_1.jsxs)("label", { ...labelProps, ...others, css: {
|
|
16
|
+
...Css_1.Css.dif.aic.gap1.sm.gray700
|
|
17
|
+
.mbPx(inline ? 0 : 4)
|
|
18
|
+
.if(contrast)
|
|
19
|
+
.white.if(!inline).asfs.$,
|
|
20
|
+
...xss,
|
|
21
|
+
}, children: [label, suffix && ` ${suffix}`, tooltip && ((0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)(src_1.Icon, { icon: "infoCircle", tooltip: tooltip, inc: 2, color: contrast ? Css_1.Palette.White : Css_1.Palette.Gray700 }) }))] }));
|
|
16
22
|
return hidden ? (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: labelEl }) : labelEl;
|
|
17
23
|
}
|
|
18
24
|
exports.Label = react_1.default.memo(LabelComponent);
|
|
@@ -97,7 +97,7 @@ function TextFieldBase(props) {
|
|
|
97
97
|
}, onFocus);
|
|
98
98
|
const showFocus = (isFocused && !inputProps.readOnly) || forceFocus;
|
|
99
99
|
const showHover = (isHovered && !inputProps.disabled && !inputProps.readOnly && !isFocused) || forceHover;
|
|
100
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { css: fieldStyles.container, ...groupProps, ...focusWithinProps, children: [label && labelStyle !== "inline" && ((0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: labelProps, hidden: labelStyle === "hidden" || compound, label: label, suffix: labelSuffix, contrast: contrast, ...tid.label })), (0, components_1.maybeTooltip)({
|
|
100
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { css: fieldStyles.container, ...groupProps, ...focusWithinProps, children: [label && labelStyle !== "inline" && ((0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: labelProps, hidden: labelStyle === "hidden" || compound, label: label, inline: labelStyle !== "above", suffix: labelSuffix, contrast: contrast, ...tid.label })), (0, components_1.maybeTooltip)({
|
|
101
101
|
title: tooltip,
|
|
102
102
|
placement: "top",
|
|
103
103
|
children: inputProps.readOnly ? ((0, jsx_runtime_1.jsxs)("div", { css: {
|
|
@@ -14,7 +14,7 @@ function ToggleChipGroup(props) {
|
|
|
14
14
|
const state = (0, react_stately_1.useCheckboxGroupState)({ ...props, value: values });
|
|
15
15
|
const { groupProps, labelProps } = (0, react_aria_1.useCheckboxGroup)(props, state);
|
|
16
16
|
const tid = (0, useTestIds_1.useTestIds)(props, "toggleChip");
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...groupProps, css: Css_1.Css.relative.df.fdc.if(labelStyle === "left").fdr.maxw100.$, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, hidden: hideLabel }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.gap1.add("flexWrap", "wrap").if(labelStyle === "left").ml2.$, children: options.map((o) => ((0, jsx_runtime_1.jsx)(ToggleChip, { value: o.value, groupState: state, selected: state.value.includes(o.value), label: o.label, disabled: o.disabled, ...tid[o.value] }, o.value))) })] }));
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...groupProps, css: Css_1.Css.relative.df.fdc.if(labelStyle === "left").fdr.maxw100.$, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, hidden: hideLabel, inline: labelStyle === "left" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.gap1.add("flexWrap", "wrap").if(labelStyle === "left").ml2.$, children: options.map((o) => ((0, jsx_runtime_1.jsx)(ToggleChip, { value: o.value, groupState: state, selected: state.value.includes(o.value), label: o.label, disabled: o.disabled, ...tid[o.value] }, o.value))) })] }));
|
|
18
18
|
}
|
|
19
19
|
exports.ToggleChipGroup = ToggleChipGroup;
|
|
20
20
|
function ToggleChip(props) {
|