@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 1.19 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/Feedback/Rating.css');const e=require("./index.cjs244.js");;/* empty css */const r=require("./index.cjs248.js"),o=require("./index.cjs246.js"),t=5,x=r.lodashExports.range(1,t+1);function c({onClick:i,rating:n=0}){const l=s=>s<=n;return e.jsxRuntimeExports.jsxs("fieldset",{className:"rating",children:[e.jsxRuntimeExports.jsx("legend",{className:"visually-hidden",children:"Valutazione"}),x.map((s,a)=>e.jsxRuntimeExports.jsxs("button",{onClick:()=>i(s),className:o.clsx("star black-focus",{active:l(s)}),"aria-label":`${s} ${s===1?"punto":"punti"} di valutazione su ${t} punti`,children:[e.jsxRuntimeExports.jsx("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",className:"icon icon-sm",children:e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("path",{d:"M12,1.7L9.5,9.2H1.6L8,13.9l-2.4,7.6l6.4-4.7l6.4,4.7L16,13.9l6.4-4.7h-7.9L12,1.7z"})})}),e.jsxRuntimeExports.jsxs("span",{className:"visually-hidden",children:["Valuta ",s," stelle su ",t]})]},a))]})}exports.Rating=c;
//# sourceMappingURL=index.cjs442.js.map