UNPKG

vdk-components

Version:

React component library built with TypeScript and SCSS

3 lines (2 loc) 948 B
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).VDKSwitch={},e.jsxRuntime)}(this,(function(e,s){"use strict";e.Switch=function(e){var i=e.checked,t=void 0!==i&&i,c=e.disabled,n=void 0!==c&&c,a=e.loading,d=void 0!==a&&a,l=e.label,o=e.onChange,h=e.className,r=["switch",t?"switch--checked":"",n?"switch--disabled":"",d?"switch--loading":"",void 0===h?"":h].filter(Boolean).join(" ");return s.jsxs("label",{className:r,children:[s.jsx("input",{type:"checkbox",checked:t,disabled:n||d,onChange:function(e){n||d||!o||o(e.target.checked)},className:"switch__input"}),s.jsx("span",{className:"switch__slider"}),l&&s.jsx("span",{className:"switch__label",children:l}),d&&s.jsx("span",{className:"switch__loader"})]})}})); //# sourceMappingURL=index.umd.js.map