@homebound/beam 2.341.0 → 2.342.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.
|
@@ -10,11 +10,11 @@ const Label_1 = require("../components/Label");
|
|
|
10
10
|
const Css_1 = require("../Css");
|
|
11
11
|
const useTestIds_1 = require("../utils/useTestIds");
|
|
12
12
|
function ToggleChipGroup(props) {
|
|
13
|
-
const { values, label, options, hideLabel } = props;
|
|
13
|
+
const { values, label, labelStyle, options, hideLabel } = 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.$, 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").$, 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 }), (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) {
|