@homebound/beam 2.402.0 → 2.403.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/index.cjs +25 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7034,11 +7034,13 @@ type ToggleChipItemProps = {
|
|
|
7034
7034
|
* If a ReactNode, it's treated as a "disabled reason" that's shown in a tooltip.
|
|
7035
7035
|
*/
|
|
7036
7036
|
disabled?: boolean | ReactNode;
|
|
7037
|
+
readonly?: boolean;
|
|
7037
7038
|
};
|
|
7038
7039
|
interface ToggleChipGroupProps extends Pick<PresentationFieldProps, "labelStyle"> {
|
|
7039
7040
|
label: string;
|
|
7040
7041
|
options: ToggleChipItemProps[];
|
|
7041
7042
|
values: string[];
|
|
7043
|
+
readonly?: boolean;
|
|
7042
7044
|
required?: boolean;
|
|
7043
7045
|
onChange: (values: string[]) => void;
|
|
7044
7046
|
xss?: ToggleChipXss;
|
package/dist/index.d.ts
CHANGED
|
@@ -7034,11 +7034,13 @@ type ToggleChipItemProps = {
|
|
|
7034
7034
|
* If a ReactNode, it's treated as a "disabled reason" that's shown in a tooltip.
|
|
7035
7035
|
*/
|
|
7036
7036
|
disabled?: boolean | ReactNode;
|
|
7037
|
+
readonly?: boolean;
|
|
7037
7038
|
};
|
|
7038
7039
|
interface ToggleChipGroupProps extends Pick<PresentationFieldProps, "labelStyle"> {
|
|
7039
7040
|
label: string;
|
|
7040
7041
|
options: ToggleChipItemProps[];
|
|
7041
7042
|
values: string[];
|
|
7043
|
+
readonly?: boolean;
|
|
7042
7044
|
required?: boolean;
|
|
7043
7045
|
onChange: (values: string[]) => void;
|
|
7044
7046
|
xss?: ToggleChipXss;
|
package/dist/index.js
CHANGED
|
@@ -12104,8 +12104,16 @@ import { jsx as jsx76, jsxs as jsxs42 } from "@emotion/react/jsx-runtime";
|
|
|
12104
12104
|
function ToggleChipGroup(props) {
|
|
12105
12105
|
const { fieldProps } = usePresentationContext();
|
|
12106
12106
|
const { labelLeftFieldWidth = "50%" } = fieldProps ?? {};
|
|
12107
|
-
const {
|
|
12108
|
-
|
|
12107
|
+
const {
|
|
12108
|
+
values,
|
|
12109
|
+
label,
|
|
12110
|
+
labelStyle = fieldProps?.labelStyle ?? "above",
|
|
12111
|
+
options,
|
|
12112
|
+
required,
|
|
12113
|
+
xss,
|
|
12114
|
+
readonly = false
|
|
12115
|
+
} = props;
|
|
12116
|
+
const state = useCheckboxGroupState2({ ...props, isReadOnly: readonly, value: values });
|
|
12109
12117
|
const { groupProps, labelProps } = useCheckboxGroup2(props, state);
|
|
12110
12118
|
const tid = useTestIds(props, "toggleChip");
|
|
12111
12119
|
const labelSuffix = useLabelSuffix(required, false);
|
|
@@ -12132,6 +12140,7 @@ function ToggleChipGroup(props) {
|
|
|
12132
12140
|
selected: state.value.includes(o.value),
|
|
12133
12141
|
label: o.label,
|
|
12134
12142
|
disabled: o.disabled,
|
|
12143
|
+
readonly: o.readonly,
|
|
12135
12144
|
startAdornment: o.startAdornment,
|
|
12136
12145
|
xss,
|
|
12137
12146
|
...tid[o.value]
|
|
@@ -12143,10 +12152,21 @@ function ToggleChipGroup(props) {
|
|
|
12143
12152
|
] });
|
|
12144
12153
|
}
|
|
12145
12154
|
function ToggleChip2(props) {
|
|
12146
|
-
const {
|
|
12155
|
+
const {
|
|
12156
|
+
label,
|
|
12157
|
+
value,
|
|
12158
|
+
groupState,
|
|
12159
|
+
selected: isSelected,
|
|
12160
|
+
disabled = false,
|
|
12161
|
+
readonly = false,
|
|
12162
|
+
startAdornment,
|
|
12163
|
+
xss,
|
|
12164
|
+
...others
|
|
12165
|
+
} = props;
|
|
12147
12166
|
const isDisabled = !!disabled;
|
|
12167
|
+
const isReadOnly = !!readonly;
|
|
12148
12168
|
const ref = useRef34(null);
|
|
12149
|
-
const { inputProps } = useCheckboxGroupItem2({ value, "aria-label": label, isDisabled }, groupState, ref);
|
|
12169
|
+
const { inputProps } = useCheckboxGroupItem2({ value, "aria-label": label, isReadOnly, isDisabled }, groupState, ref);
|
|
12150
12170
|
const { isFocusVisible, focusProps } = useFocusRing9();
|
|
12151
12171
|
const tooltip = resolveTooltip(disabled);
|
|
12152
12172
|
return maybeTooltip({
|
|
@@ -12160,7 +12180,7 @@ function ToggleChip2(props) {
|
|
|
12160
12180
|
...isSelected ? {
|
|
12161
12181
|
...Css.color(xss?.color ?? "rgba(255,255,255,1)" /* White */).bgColor(xss?.backgroundColor ?? "rgba(29, 78, 216, 1)" /* Blue700 */).$,
|
|
12162
12182
|
":hover:not([data-disabled='true'])": Css.bgColor(xss?.backgroundColor ?? "rgba(30, 64, 175, 1)" /* Blue800 */).$
|
|
12163
|
-
} : { ":hover:not([data-disabled='true'])": Css.bgGray300.$ },
|
|
12183
|
+
} : { ":hover:not([data-disabled='true'])": Css.if(!groupState.isReadOnly).bgGray300.$ },
|
|
12164
12184
|
...isFocusVisible ? Css.bshFocus.$ : {}
|
|
12165
12185
|
},
|
|
12166
12186
|
"data-selected": isSelected,
|