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

40 lines
1.7 KiB
Plaintext

import {useId as $83Elw$useId, useLabels as $83Elw$useLabels} from "@react-aria/utils";
/*
* Copyright 2020 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 $d191a55c9702f145$export$8467354a121f1b9f(props) {
let { id: id, label: label, 'aria-labelledby': ariaLabelledby, 'aria-label': ariaLabel, labelElementType: labelElementType = 'label' } = props;
id = (0, $83Elw$useId)(id);
let labelId = (0, $83Elw$useId)();
let labelProps = {};
if (label) {
ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;
labelProps = {
id: labelId,
htmlFor: labelElementType === 'label' ? id : undefined
};
} else if (!ariaLabelledby && !ariaLabel) console.warn('If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility');
let fieldProps = (0, $83Elw$useLabels)({
id: id,
'aria-label': ariaLabel,
'aria-labelledby': ariaLabelledby
});
return {
labelProps: labelProps,
fieldProps: fieldProps
};
}
export {$d191a55c9702f145$export$8467354a121f1b9f as useLabel};
//# sourceMappingURL=useLabel.module.js.map