Files
NapCatQQ/.pnpm-store/v3/files/dd/e54106a0396e090f47bef3df92b6d7b3e93dd183decb8a8d1cf862a31cb6b75c9e063bcd8c47cba068ab3798fc6bbf47128bde0d04358156b8d158ca1fb799
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

59 lines
2.3 KiB
Plaintext

import {useToggleButton as $55f54f7887471b58$export$51e84d46ca0bc451} from "./useToggleButton.mjs";
import {useToolbar as $9iEyV$useToolbar} from "@react-aria/toolbar";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $4547d1bf40011fdf$export$dd5580ae642f110f(props, state, ref) {
let { isDisabled: isDisabled } = props;
let { toolbarProps: toolbarProps } = (0, $9iEyV$useToolbar)(props, ref);
return {
groupProps: {
...toolbarProps,
role: state.selectionMode === 'single' ? 'radiogroup' : toolbarProps.role,
'aria-disabled': isDisabled
}
};
}
function $4547d1bf40011fdf$export$bc53712daae3d6e6(props, state, ref) {
let toggleState = {
isSelected: state.selectedKeys.has(props.id),
defaultSelected: false,
setSelected (isSelected) {
state.setSelected(props.id, isSelected);
},
toggle () {
state.toggleKey(props.id);
}
};
let { isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled, buttonProps: buttonProps } = (0, $55f54f7887471b58$export$51e84d46ca0bc451)({
...props,
id: undefined,
isDisabled: props.isDisabled || state.isDisabled
}, toggleState, ref);
if (state.selectionMode === 'single') {
buttonProps.role = 'radio';
buttonProps['aria-checked'] = toggleState.isSelected;
delete buttonProps['aria-pressed'];
}
return {
isPressed: isPressed,
isSelected: isSelected,
isDisabled: isDisabled,
buttonProps: buttonProps
};
}
export {$4547d1bf40011fdf$export$dd5580ae642f110f as useToggleButtonGroup, $4547d1bf40011fdf$export$bc53712daae3d6e6 as useToggleButtonGroupItem};
//# sourceMappingURL=useToggleButtonGroup.module.js.map