@homebound/beam 2.361.0 → 2.362.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.
|
@@ -4,7 +4,7 @@ import { IconKey } from "./Icon";
|
|
|
4
4
|
export type ChipType = "caution" | "warning" | "success" | "light" | "dark" | "neutral" | "darkMode" | "info";
|
|
5
5
|
export declare const ChipTypes: Record<ChipType, ChipType>;
|
|
6
6
|
export interface ChipProps<X> {
|
|
7
|
-
text:
|
|
7
|
+
text: ReactNode;
|
|
8
8
|
title?: ReactNode;
|
|
9
9
|
xss?: X;
|
|
10
10
|
type?: ChipType;
|
|
@@ -21,12 +21,12 @@ function ToggleChipGroup(props) {
|
|
|
21
21
|
return ((0, jsx_runtime_1.jsxs)("div", { ...groupProps, css: Css_1.Css.relative.df.fdc.if(labelStyle === "left").fdr.gap2.maxw100.jcsb.$, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, hidden: labelStyle === "hidden", inline: labelStyle !== "above" }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.gap1
|
|
22
22
|
.add("flexWrap", "wrap")
|
|
23
23
|
.if(labelStyle === "left")
|
|
24
|
-
.w(labelLeftFieldWidth).$, 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, xss: xss, ...tid[o.value] }, o.value))) })] }));
|
|
24
|
+
.w(labelLeftFieldWidth).$, 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, startAdornment: o.startAdornment, xss: xss, ...tid[o.value] }, o.value))) })] }));
|
|
25
25
|
}
|
|
26
26
|
exports.ToggleChipGroup = ToggleChipGroup;
|
|
27
27
|
function ToggleChip(props) {
|
|
28
28
|
var _a, _b, _c;
|
|
29
|
-
const { label, value, groupState, selected: isSelected, disabled = false, xss, ...others } = props;
|
|
29
|
+
const { label, value, groupState, selected: isSelected, disabled = false, startAdornment, xss, ...others } = props;
|
|
30
30
|
const isDisabled = !!disabled;
|
|
31
31
|
const ref = (0, react_1.useRef)(null);
|
|
32
32
|
const { inputProps } = (0, react_aria_1.useCheckboxGroupItem)({ value, "aria-label": label, isDisabled }, groupState, ref);
|
|
@@ -36,7 +36,8 @@ function ToggleChip(props) {
|
|
|
36
36
|
title: tooltip,
|
|
37
37
|
placement: "top",
|
|
38
38
|
children: ((0, jsx_runtime_1.jsxs)("label", { css: {
|
|
39
|
-
...Css_1.Css.relative.
|
|
39
|
+
...Css_1.Css.relative.dif.gap1.aic.br16.sm.px1.cursorPointer.pyPx(4).bgGray200.if(isDisabled).cursorNotAllowed
|
|
40
|
+
.gray600.pr1.$,
|
|
40
41
|
...(isSelected
|
|
41
42
|
? {
|
|
42
43
|
...Css_1.Css.color((_a = xss === null || xss === void 0 ? void 0 : xss.color) !== null && _a !== void 0 ? _a : Css_1.Palette.White).bgColor((_b = xss === null || xss === void 0 ? void 0 : xss.backgroundColor) !== null && _b !== void 0 ? _b : Css_1.Palette.Blue700).$,
|
|
@@ -44,6 +45,6 @@ function ToggleChip(props) {
|
|
|
44
45
|
}
|
|
45
46
|
: { ":hover:not([data-disabled='true'])": Css_1.Css.bgGray300.$ }),
|
|
46
47
|
...(isFocusVisible ? Css_1.Css.bshFocus.$ : {}),
|
|
47
|
-
}, "data-selected": isSelected, "data-disabled": isDisabled, "aria-disabled": isDisabled, ...others, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ...inputProps, ...focusProps }) }), label] })),
|
|
48
|
+
}, "data-selected": isSelected, "data-disabled": isDisabled, "aria-disabled": isDisabled, ...others, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ...inputProps, ...focusProps }) }), startAdornment, label] })),
|
|
48
49
|
});
|
|
49
50
|
}
|