@cypress-design/vue-alert 0.5.5 → 1.0.0
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 +6 -5
- package/Alert.rootstory.tsx +10 -10
- package/Alert.vue +5 -5
- package/CHANGELOG.md +13 -0
- package/dist/Alert.vue.d.ts +15 -14
- package/dist/Alert.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +64 -153
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@cypress-design/vue-icon"),require("@cypress-design/details-animation")):typeof define=="function"&&define.amd?define(["vue","@cypress-design/vue-icon","@cypress-design/details-animation"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.Alert=r(e.Vue,e.CyIcon,e.CyDetailsAnimation))})(this,function(e,r,g){"use strict";const f={xs:"py-[4px] px-[8px] leading-[22px] text-[14px]",sm:"py-[8px] px-[12px] leading-[22px] text-[14px]",md:"py-[12px] px-[16px] leading-[24px] text-[16px]",lg:"p-[16px] leading-[24px] text-[16px]"},y="lg",x={neutral:{headerClass:"text-gray-800 bg-gray-100",bodyClass:"bg-gray-50 text-gray-500",borderClass:"border-gray-100",detailsHeaderClass:"text-gray-600",iconCloseColor:"gray-600",iconColor:"gray-500",iconChevronColor:"gray-300"},info:{headerClass:"text-indigo-700 bg-indigo-100",bodyClass:"bg-indigo-50 text-indigo-500",borderClass:"border-indigo-100",detailsHeaderClass:"text-indigo-600",iconCloseColor:"indigo-500",iconColor:"indigo-500",iconChevronColor:"indigo-300"},warning:{headerClass:"text-orange-700 bg-orange-100",bodyClass:"bg-orange-50 text-orange-500",borderClass:"border-orange-100",detailsHeaderClass:"text-orange-600",iconCloseColor:"orange-500",iconColor:"orange-400",iconChevronColor:"orange-300"},error:{headerClass:"text-red-700 bg-red-100",bodyClass:"bg-red-50 text-red-500",borderClass:"border-red-100",detailsHeaderClass:"text-red-600",iconCloseColor:"red-500",iconColor:"red-400",iconChevronColor:"red-300"},success:{headerClass:"text-jade-700 bg-jade-100",bodyClass:"bg-jade-50 text-jade-600",borderClass:"border-jade-100",detailsHeaderClass:"text-jade-600",iconCloseColor:"jade-600",iconColor:"jade-500",iconChevronColor:"jade-300"},clear:{wrapperClass:"border-gray-50 bg-white border text-gray-700",headerClass:"",bodyClass:"border-gray-50 border-t",borderClass:"border-gray-50",detailsHeaderClass:"text-gray-700",iconCloseColor:"gray-600",iconColor:"gray-500",iconChevronColor:"gray-300"}},u="info",b="Additional details",h={class:"flex-1 font-medium"};return e.defineComponent({__name:"Alert",props:{variant:{default:void 0},type:{default:u},detailsTitle:{default:b},dismissible:{type:Boolean},noIcon:{type:Boolean},notRounded:{type:Boolean},duration:{},size:{default:y}},emits:["dismiss"],setup(k,{emit:V}){const d=e.ref(!1),c=e.useSlots(),B=V,t=k,C=e.computed(()=>t.variant??t.type),n=e.ref(null),i=e.ref(null),o=e.computed(()=>x[C.value]??{});let a;e.onMounted(()=>{t.duration&&(a=setTimeout(m,t.duration))}),e.onMounted(()=>{n.value&&i.value&&new g.DetailsAnimation(n.value,i.value)}),e.onUnmounted(()=>{a&&clearTimeout(a)});function m(){d.value=!0,B("dismiss"),a&&(clearTimeout(a),a=void 0)}const l=e.computed(()=>({strokeColor:o.value.iconColor,class:"my-[4px] mr-[8px]"})),p=e.computed(()=>{switch(C.value){case"info":return null;case"success":return()=>e.h(r.IconCheckmarkOutline,l.value);case"warning":return()=>e.h(r.IconWarningCircle,l.value);case"error":return()=>e.h(r.IconWarningCircle,l.value);default:return null}}),N=e.computed(()=>f[t.size]??{});return(s,j)=>d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["overflow-hidden text-left",[o.value.wrapperClass,{rounded:!t.notRounded}]])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",[o.value.headerClass,N.value]])},[e.renderSlot(s.$slots,"icon",e.normalizeProps(e.guardReactiveProps(l.value)),()=>[!t.noIcon&&p.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),e.normalizeProps(e.mergeProps({key:0},l.value)),null,16)):e.createCommentVNode("",!0)]),e.createElementVNode("div",h,[e.renderSlot(s.$slots,"default")]),s.dismissible?(e.openBlock(),e.createElementBlock("button",{key:0,class:"m-[4px] ml-[8px] h-[16px]","aria-label":"Dismiss",onClick:m},[e.createVNode(e.unref(r.IconActionDeleteLarge),{"stroke-color":o.value.iconCloseColor},null,8,["stroke-color"])])):e.createCommentVNode("",!0)],2),e.unref(c).body?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-[16px]",o.value.bodyClass])},[e.renderSlot(s.$slots,"body")],2)):e.createCommentVNode("",!0),e.unref(c).details?(e.openBlock(),e.createElementBlock("details",{key:1,ref_key:"detailsRef",ref:n,class:e.normalizeClass(["p-[16px] border-t border-t-1",[o.value.bodyClass,o.value.borderClass]])},[e.createElementVNode("summary",{class:e.normalizeClass(["flex font-medium cursor-pointer details-none",o.value.detailsHeaderClass])},[e.createVNode(e.unref(r.IconChevronDownSmall),{strokeColor:o.value.iconChevronColor,class:"icon my-[4px] mr-[8px] transition transform -rotate-90 open:rotate-0"},null,8,["strokeColor"]),e.createTextVNode(" "+e.toDisplayString(t.detailsTitle),1)],2),e.createElementVNode("div",{ref_key:"contentRef",ref:i},[e.createElementVNode("div",null,[e.renderSlot(s.$slots,"details")])],512)],2)):e.createCommentVNode("",!0),s.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(o.value.bodyClass)},[e.renderSlot(s.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
|
3
3
|
|
|
4
|
-
/* <wind-keep class="my-[4px] mr-[8px] overflow-hidden text-left rounded flex flex-1 font-medium m-[4px] ml-[8px] h-[16px] p-[16px] border-t cursor-pointer transition transform -rotate-90 open:rotate-0 py-[4px] px-[8px] leading-[22px] text-[14px] py-[8px] px-[12px] py-[12px] px-[16px] leading-[24px] text-[16px] text-gray-800 bg-gray-100 bg-gray-50 text-gray-500 border-gray-100 text-gray-600 text-indigo-700 bg-indigo-100 bg-indigo-50 text-indigo-500 border-indigo-100 text-indigo-600 text-orange-700 bg-orange-100 bg-orange-50 text-orange-500 border-orange-100 text-orange-600 text-red-700 bg-red-100 bg-red-50 text-red-500 border-red-100 text-red-600 border-gray-50 bg-white border text-gray-700"> */
|
|
4
|
+
/* <wind-keep class="my-[4px] mr-[8px] overflow-hidden text-left rounded flex flex-1 font-medium m-[4px] ml-[8px] h-[16px] p-[16px] border-t cursor-pointer details-none transition transform -rotate-90 open:rotate-0 py-[4px] px-[8px] leading-[22px] text-[14px] py-[8px] px-[12px] py-[12px] px-[16px] leading-[24px] text-[16px] text-gray-800 bg-gray-100 bg-gray-50 text-gray-500 border-gray-100 text-gray-600 text-indigo-700 bg-indigo-100 bg-indigo-50 text-indigo-500 border-indigo-100 text-indigo-600 text-orange-700 bg-orange-100 bg-orange-50 text-orange-500 border-orange-100 text-orange-600 text-red-700 bg-red-100 bg-red-50 text-red-500 border-red-100 text-red-600 text-jade-700 bg-jade-100 bg-jade-50 text-jade-600 border-jade-100 border-gray-50 bg-white border text-gray-700 icon-dark-gray-600 icon-dark-gray-500 icon-dark-gray-300 icon-dark-indigo-500 icon-dark-indigo-300 icon-dark-orange-500 icon-dark-orange-400 icon-dark-orange-300 icon-dark-red-500 icon-dark-red-400 icon-dark-red-300 icon-dark-jade-600 icon-dark-jade-500 icon-dark-jade-300"> */
|