/*
 * Copyright (c) 2018, 2025, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULENAME="oj-tsx-rating-gauge-size";const DESCRIPTION="The use of the <oj-rating-gauge> 'size' property set to enumerated value 'fit' is a "+"Redwood theme anti-pattern. The UX recommendation is to use an 'sm', 'md', or 'lg' value instead. "+"For interactive gauges, 'sm' and 'md' sizes are not recommended, since the touch target sizes are not "+"large enough to meet the accessibility guidelines.";const SHORT_DESCRIPTION="Do not use <oj-rating-gauge> with the 'size' property set to 'fit' in Redwood";const MSG="<oj-rating-gauge> property 'size' value of 'fit' is an anti-pattern in Redwood.";const FIT="fit";const JSX_SPREAD_ATTRIBUTE="JSXSpreadAttribute";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-rating-gauge size=>":this._onSize}}_onSize(ruleCtx,tsxProp){if(tsxProp.node.type===JSX_SPREAD_ATTRIBUTE){return}if(this._tsxUtils.isPropertyString(tsxProp)){let propVal=tsxProp.valueRaw;if(propVal.substring(1).startsWith(FIT)){let issue=new ruleCtx.Issue(MSG);this._tsxUtils.setIssuePropValuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}module.exports=Rule;