@wishket/design-system 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),a=require("tailwind-merge"),n=function(e){e=e.checked;return r.jsxs("div",{className:"relative z-10 h-full w-full bg-transparent",children:[r.jsx("div",{className:a.twMerge("absolute left-[4px] top-[6px] h-[2px] origin-top-left rotate-45 rounded bg-white transition-[width] duration-100 ease-linear",e?"w-[6px]":"w-0")}),r.jsx("div",{className:a.twMerge("absolute left-[6px] top-[10px] h-[2px] origin-top-left -rotate-45 rounded bg-white transition-[width] duration-100 ease-linear",e?"w-[9px] delay-100":"w-0 delay-0")})]})},s=function(e){var i=e.type,s=e.disabled,t=e.checked,t=void 0!==t&&t,o=e.isError,c=e.isHover,d=e.isFocused,e=e.className;return r.jsx("div",{className:a.twMerge("relative inline-block aspect-square w-4 ring-1","circle"===i?"rounded-full":"rounded",s&&!t?"ring-w-gray-200 bg-w-gray-50 cursor-not-allowed":s&&t&&!o?"bg-w-cyan-100 ring-w-cyan-100 cursor-not-allowed":s&&t&&o?"bg-w-gray-200 ring-w-gray-200 cursor-not-allowed":t&&d&&!o?"bg-w-cyan-500 ring-w-cyan-500":t||!d||o?!t||s||o?t||s||!o?t&&!s&&o?"ring-w-red-500 bg-w-red-500":!c||s||t||o?"hover:ring-w-cyan-500 ring-w-gray-200 bg-white cursor-pointer":"ring-w-cyan-500":"ring-w-red-500":"bg-w-cyan-500 ring-w-cyan-500":"ring-w-cyan-500",e),role:"checkbox-button",children:r.jsx(n,{checked:t})})};module.exports=function(a){var n=a.checked,n=void 0!==n&&n,t=a.onChange,o=a.disabled,c=void 0!==o&&o,o=a.isError,o=void 0!==o&&o,d=a.isHover,d=void 0!==d&&d,l=a.type,l=void 0===l?"box":l,u=a.className,a=e.__rest(a,["checked","onChange","disabled","isError","isHover","type","className"]),
|
|
2
|
+
"use strict";var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),a=require("tailwind-merge"),n=function(e){e=e.checked;return r.jsxs("div",{className:"relative z-10 h-full w-full bg-transparent",children:[r.jsx("div",{className:a.twMerge("absolute left-[4px] top-[6px] h-[2px] origin-top-left rotate-45 rounded bg-white transition-[width] duration-100 ease-linear",e?"w-[6px]":"w-0")}),r.jsx("div",{className:a.twMerge("absolute left-[6px] top-[10px] h-[2px] origin-top-left -rotate-45 rounded bg-white transition-[width] duration-100 ease-linear",e?"w-[9px] delay-100":"w-0 delay-0")})]})},s=function(e){var i=e.type,s=e.disabled,t=e.checked,t=void 0!==t&&t,o=e.isError,c=e.isHover,d=e.isFocused,e=e.className;return r.jsx("div",{className:a.twMerge("relative inline-block aspect-square w-4 ring-1","circle"===i?"rounded-full":"rounded",s&&!t?"ring-w-gray-200 bg-w-gray-50 cursor-not-allowed":s&&t&&!o?"bg-w-cyan-100 ring-w-cyan-100 cursor-not-allowed":s&&t&&o?"bg-w-gray-200 ring-w-gray-200 cursor-not-allowed":t&&d&&!o?"bg-w-cyan-500 ring-w-cyan-500":t||!d||o?!t||s||o?t||s||!o?t&&!s&&o?"ring-w-red-500 bg-w-red-500":!c||s||t||o?"hover:ring-w-cyan-500 ring-w-gray-200 bg-white cursor-pointer":"ring-w-cyan-500":"ring-w-red-500":"bg-w-cyan-500 ring-w-cyan-500":"ring-w-cyan-500",e),role:"checkbox-button",children:r.jsx(n,{checked:t})})};module.exports=function(a){var n=a.checked,n=void 0!==n&&n,t=a.onChange,o=a.disabled,c=void 0!==o&&o,o=a.isError,o=void 0!==o&&o,d=a.isHover,d=void 0!==d&&d,l=a.type,l=void 0===l?"box":l,u=a.className,a=e.__rest(a,["checked","onChange","disabled","isError","isHover","type","className"]),g=i.useState(!1),w=g[0],b=g[1],g=i.useCallback(function(e){c||t&&t(e)},[t,c]);return r.jsxs("label",{"data-testid":"design-system-checkbox",children:[r.jsx("input",e.__assign({className:"absolute h-0 w-0 opacity-0",type:"checkbox",checked:n,onChange:g,onFocus:function(){b(!0)},onBlur:function(){b(!1)},disabled:c},a)),r.jsx(s,{checked:n,disabled:c,isError:o,isHover:d,isFocused:w,type:l,className:u})]})};
|