@cypress-design/vue-checkbox 0.3.0 → 0.3.2
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.
- package/.turbo/turbo-build.log +13 -0
- package/CHANGELOG.md +117 -0
- package/Checkbox.rootstory.tsx +9 -0
- package/Checkbox.vue +54 -25
- package/CheckboxVue.cy.tsx +43 -4
- package/ReadMe.md +19 -0
- package/dist/Checkbox.vue.d.ts +21 -6
- package/dist/Checkbox.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +116 -0
- package/dist/index.es.mjs.map +1 -0
- package/dist/index.umd.js +3 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +9 -4
- package/tsconfig.build.json +2 -1
- package/tsconfig.json +11 -1
- package/Checkbox.stories.mdx +0 -75
- package/dist/index.es.js +0 -102
- package/dist/index.es.js.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue"),require("@cypress-design/icon-registry")):typeof define=="function"&&define.amd?define(["vue","@cypress-design/icon-registry"],a):(e=typeof globalThis<"u"?globalThis:e||self,e.Checkbox=a(e.Vue,e.CyIconRegistry))})(this,function(e,a){"use strict";function f(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(l,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return l.default=t,Object.freeze(l)}const p=f(a),h=({body:t,compiledClasses:l,size:n,class:o,interactiveColorsOnGroup:u,...i})=>{const c=Object.keys(i).reduce((m,s)=>(!a.ICON_COLOR_PROP_NAMES.includes(s)&&s!=="name"&&(m[s]=i[s]),m),{}),b={width:n,height:n,viewBox:`0 0 ${n} ${n}`,fill:"none",innerHTML:t,...c};return l.length&&(b.class=l.join(" ")),b},g=t=>{const{sizeWithDefault:l,compiledClasses:n}=p.getComponentAttributes({...t,availableSizes:["16"]}),o={16:'<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8.5 7.5 11 11 5" class="icon-dark"/>'}[l];if(!o)throw Error(`Icon "checkmark-small" is not available in size ${l}`);return e.h("svg",h({...t,size:l,body:o,compiledClasses:n}))},r={wrapper:"relative flex items-center",hiddenInput:"absolute inset-0 w-0 h-0 opacity-0",labelTag:"flex items-center",visibleCheckbox:"border border-solid rounded h-[16px] w-[16px] flex flex-shrink-0 items-center text-white",trueLabel:"block ml-[8px] text-[16px] leading-[24px] font-light select-none"},d={indigo:"border-indigo-500 bg-indigo-400",jade:"border-jade-500 bg-jade-400",red:"border-red-500 bg-red-400",disabled:"border-gray-200 bg-gray-100",empty:"border-gray-200 bg-white"},k={class:"relative flex items-center"},y=["id","name","disabled","checked"],C=["for"];function x(){return String(Date.now().toString(32)+Math.random().toString(16)).replace(/\./g,"")}return e.defineComponent({__name:"Checkbox",props:{id:{default:()=>x()},name:null,checked:{type:Boolean},color:{default:"indigo"},disabled:{type:Boolean},modelValue:{type:Boolean},label:null},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.ref(n.modelValue||n.checked);function u(){o.value=!o.value,l("update:modelValue",o.value)}const i=e.computed(()=>n.disabled?d.disabled:o.value?d[n.color]:d.empty);return(c,b)=>(e.openBlock(),e.createElementBlock("span",k,[e.createElementVNode("input",{id:t.id,class:e.normalizeClass(e.unref(r).hiddenInput),name:t.name||t.id,type:"checkbox",onChange:u,disabled:n.disabled,checked:o.value},null,42,y),e.createElementVNode("label",{class:e.normalizeClass(e.unref(r).labelTag),for:t.id},[o.value?(e.openBlock(),e.createBlock(e.unref(g),{key:0,strokeColor:"white",class:"absolute"})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass([e.unref(i),e.unref(r).visibleCheckbox])},null,2),e.renderSlot(c.$slots,"label",{},()=>[t.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(r).trueLabel,t.disabled?"text-gray-500":"text-gray-800 dark:text-gray-200"])},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0)])],10,C)]))}})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
|
3
|
+
|
|
4
|
+
/* <wind-keep class="relative flex items-center absolute text-gray-500 text-gray-800 dark:text-gray-200 icon-dark-white inset-0 w-0 h-0 opacity-0 border border-solid rounded h-[16px] w-[16px] flex-shrink-0 text-white block ml-[8px] text-[16px] leading-[24px] font-light select-none border-indigo-500 bg-indigo-400 border-jade-500 bg-jade-400 border-red-500 bg-red-400 border-gray-200 bg-gray-100 bg-white"> */
|