@homebound/beam 2.402.0 → 2.404.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.cjs
CHANGED
|
@@ -12467,8 +12467,16 @@ var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
|
|
|
12467
12467
|
function ToggleChipGroup(props) {
|
|
12468
12468
|
const { fieldProps } = usePresentationContext();
|
|
12469
12469
|
const { labelLeftFieldWidth = "50%" } = fieldProps ?? {};
|
|
12470
|
-
const {
|
|
12471
|
-
|
|
12470
|
+
const {
|
|
12471
|
+
values,
|
|
12472
|
+
label,
|
|
12473
|
+
labelStyle = fieldProps?.labelStyle ?? "above",
|
|
12474
|
+
options,
|
|
12475
|
+
required,
|
|
12476
|
+
xss,
|
|
12477
|
+
readonly = false
|
|
12478
|
+
} = props;
|
|
12479
|
+
const state = (0, import_react_stately16.useCheckboxGroupState)({ ...props, isReadOnly: readonly, value: values });
|
|
12472
12480
|
const { groupProps, labelProps } = (0, import_react_aria39.useCheckboxGroup)(props, state);
|
|
12473
12481
|
const tid = useTestIds(props, "toggleChip");
|
|
12474
12482
|
const labelSuffix = useLabelSuffix(required, false);
|
|
@@ -12495,6 +12503,7 @@ function ToggleChipGroup(props) {
|
|
|
12495
12503
|
selected: state.value.includes(o.value),
|
|
12496
12504
|
label: o.label,
|
|
12497
12505
|
disabled: o.disabled,
|
|
12506
|
+
readonly: o.readonly,
|
|
12498
12507
|
startAdornment: o.startAdornment,
|
|
12499
12508
|
xss,
|
|
12500
12509
|
...tid[o.value]
|
|
@@ -12506,10 +12515,21 @@ function ToggleChipGroup(props) {
|
|
|
12506
12515
|
] });
|
|
12507
12516
|
}
|
|
12508
12517
|
function ToggleChip2(props) {
|
|
12509
|
-
const {
|
|
12518
|
+
const {
|
|
12519
|
+
label,
|
|
12520
|
+
value,
|
|
12521
|
+
groupState,
|
|
12522
|
+
selected: isSelected,
|
|
12523
|
+
disabled = false,
|
|
12524
|
+
readonly = false,
|
|
12525
|
+
startAdornment,
|
|
12526
|
+
xss,
|
|
12527
|
+
...others
|
|
12528
|
+
} = props;
|
|
12510
12529
|
const isDisabled = !!disabled;
|
|
12530
|
+
const isReadOnly = !!readonly;
|
|
12511
12531
|
const ref = (0, import_react64.useRef)(null);
|
|
12512
|
-
const { inputProps } = (0, import_react_aria39.useCheckboxGroupItem)({ value, "aria-label": label, isDisabled }, groupState, ref);
|
|
12532
|
+
const { inputProps } = (0, import_react_aria39.useCheckboxGroupItem)({ value, "aria-label": label, isReadOnly, isDisabled }, groupState, ref);
|
|
12513
12533
|
const { isFocusVisible, focusProps } = (0, import_react_aria39.useFocusRing)();
|
|
12514
12534
|
const tooltip = resolveTooltip(disabled);
|
|
12515
12535
|
return maybeTooltip({
|
|
@@ -12523,7 +12543,7 @@ function ToggleChip2(props) {
|
|
|
12523
12543
|
...isSelected ? {
|
|
12524
12544
|
...Css.color(xss?.color ?? "rgba(255,255,255,1)" /* White */).bgColor(xss?.backgroundColor ?? "rgba(29, 78, 216, 1)" /* Blue700 */).$,
|
|
12525
12545
|
":hover:not([data-disabled='true'])": Css.bgColor(xss?.backgroundColor ?? "rgba(30, 64, 175, 1)" /* Blue800 */).$
|
|
12526
|
-
} : { ":hover:not([data-disabled='true'])": Css.bgGray300.$ },
|
|
12546
|
+
} : { ":hover:not([data-disabled='true'])": Css.if(!groupState.isReadOnly).bgGray300.$ },
|
|
12527
12547
|
...isFocusVisible ? Css.bshFocus.$ : {}
|
|
12528
12548
|
},
|
|
12529
12549
|
"data-selected": isSelected,
|