@phila/phila-ui-checkbox 1.0.0-beta.11 → 1.0.0-beta.12
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/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +43 -45
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.tooltip[data-v-af4a0398]{position:relative;display:inline-flex;flex-direction:column;align-items:flex-start;border-radius:var(--border-radius-xs);filter:drop-shadow(0px 1px 2px rgba(0,0,0,.3)) drop-shadow(0px 1px 3px rgba(0,0,0,.15));--tooltip-bg: var(--Schemes-On-Primary);background-color:var(--tooltip-bg);color:var(--Schemes-On-Background)}.tooltip.tooltip--grey[data-v-af4a0398]{--tooltip-bg: var(--Schemes-Surface-Container-Lowest);color:var(--Schemes-On-Surface)}.tooltip.tooltip--plain[data-v-af4a0398]{--tail-height: 10px;padding:var(--spacing-2xs) var(--spacing-xs);justify-content:center;width:max-content;max-width:min(18rem,calc(100vw - 3rem))}.tooltip.tooltip--rich[data-v-af4a0398]{--tail-height: 12px;padding:var(--spacing-s) var(--spacing-m);width:max-content;min-width:11.25rem;max-width:min(25rem,calc(100vw - 3rem));gap:var(--spacing-xs)}.tooltip .tooltip__tail[data-v-af4a0398]{position:absolute;width:20px;height:var(--tail-height);background-color:var(--tooltip-bg)}.tooltip.tooltip--top-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--top-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--top-center .tooltip__tail[data-v-af4a0398]{clip-path:polygon(0 0,100% 0,50% 100%);bottom:calc(-1 * var(--tail-height) + 1px)}.tooltip.tooltip--bottom-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-center .tooltip__tail[data-v-af4a0398]{clip-path:polygon(50% 0,0 100%,100% 100%);top:calc(-1 * var(--tail-height) + 1px)}.tooltip.tooltip--top-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-left .tooltip__tail[data-v-af4a0398]{left:8px}.tooltip.tooltip--top-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-right .tooltip__tail[data-v-af4a0398]{right:8px}.tooltip.tooltip--top-center .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-center .tooltip__tail[data-v-af4a0398]{left:50%;transform:translate(-50%)}.tooltip__plain-row[data-v-af4a0398],.tooltip__title-row[data-v-af4a0398]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-xs);width:100%}.tooltip__title-row h6[data-v-af4a0398]{flex:1}.tooltip__dismiss[data-v-af4a0398]{margin-left:auto;flex-shrink:0}.tooltip-trigger[data-v-
|
|
1
|
+
.tooltip[data-v-af4a0398]{position:relative;display:inline-flex;flex-direction:column;align-items:flex-start;border-radius:var(--border-radius-xs);filter:drop-shadow(0px 1px 2px rgba(0,0,0,.3)) drop-shadow(0px 1px 3px rgba(0,0,0,.15));--tooltip-bg: var(--Schemes-On-Primary);background-color:var(--tooltip-bg);color:var(--Schemes-On-Background)}.tooltip.tooltip--grey[data-v-af4a0398]{--tooltip-bg: var(--Schemes-Surface-Container-Lowest);color:var(--Schemes-On-Surface)}.tooltip.tooltip--plain[data-v-af4a0398]{--tail-height: 10px;padding:var(--spacing-2xs) var(--spacing-xs);justify-content:center;width:max-content;max-width:min(18rem,calc(100vw - 3rem))}.tooltip.tooltip--rich[data-v-af4a0398]{--tail-height: 12px;padding:var(--spacing-s) var(--spacing-m);width:max-content;min-width:11.25rem;max-width:min(25rem,calc(100vw - 3rem));gap:var(--spacing-xs)}.tooltip .tooltip__tail[data-v-af4a0398]{position:absolute;width:20px;height:var(--tail-height);background-color:var(--tooltip-bg)}.tooltip.tooltip--top-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--top-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--top-center .tooltip__tail[data-v-af4a0398]{clip-path:polygon(0 0,100% 0,50% 100%);bottom:calc(-1 * var(--tail-height) + 1px)}.tooltip.tooltip--bottom-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-center .tooltip__tail[data-v-af4a0398]{clip-path:polygon(50% 0,0 100%,100% 100%);top:calc(-1 * var(--tail-height) + 1px)}.tooltip.tooltip--top-left .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-left .tooltip__tail[data-v-af4a0398]{left:8px}.tooltip.tooltip--top-right .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-right .tooltip__tail[data-v-af4a0398]{right:8px}.tooltip.tooltip--top-center .tooltip__tail[data-v-af4a0398],.tooltip.tooltip--bottom-center .tooltip__tail[data-v-af4a0398]{left:50%;transform:translate(-50%)}.tooltip__plain-row[data-v-af4a0398],.tooltip__title-row[data-v-af4a0398]{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-xs);width:100%}.tooltip__title-row h6[data-v-af4a0398]{flex:1}.tooltip__dismiss[data-v-af4a0398]{margin-left:auto;flex-shrink:0}.tooltip-trigger[data-v-a68ae692]{position:relative;display:inline-block}.tooltip-positioner[data-v-a68ae692]{position:fixed;z-index:10010;width:max-content}.checkbox-svg .checkbox-bg{fill:var(--Schemes-Surface-Bright, #fafafa);stroke:var(--Schemes-Border, #cfcfcf);stroke-width:1}.checkbox-svg .checkbox-check{stroke:none;fill:none}.checkbox-svg--checked .checkbox-bg{fill:var(--Schemes-Primary, #0f33f5);stroke:var(--Schemes-Primary, #0f33f5)}.checkbox-svg--checked .checkbox-check{stroke:var(--Schemes-On-Primary, #ffffff);stroke-width:2}.philaCheckbox-row[data-v-6d41adb5]{display:inline-flex;align-items:center;gap:var(--spacing-xs, .5rem)}.philaCheckbox[data-v-6d41adb5]{position:relative;display:inline-block;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.philaCheckbox__visual[data-v-6d41adb5]{display:flex;align-items:center;gap:var(--spacing-s, .75rem)}.philaCheckbox__info[data-v-6d41adb5]{display:inline-flex;align-items:center;padding:0;border:none;background:none;cursor:help;color:var(--Schemes-On-Surface-Variant, inherit)}.philaCheckbox--icon-only .philaCheckbox__visual[data-v-6d41adb5]{gap:0}.philaCheckbox input[data-v-6d41adb5]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}[data-v-6d41adb5] .checkbox-svg{flex-shrink:0;overflow:visible}.philaCheckbox[data-v-6d41adb5]:focus-within{outline:2px solid var(--Schemes-Primary, #0f33f5);outline-offset:2px}.philaCheckbox-enabled[data-v-6d41adb5]:hover .checkbox-svg .checkbox-bg{stroke:var(--Schemes-Primary, #0f33f5);stroke-width:2}.philaCheckbox-error[data-v-6d41adb5] .checkbox-svg .checkbox-bg{stroke:var(--Schemes-Error, #cc0406);stroke-width:2}.philaCheckbox-disabled[data-v-6d41adb5]{cursor:not-allowed;color:var(--Schemes-Surface-Variant, #a2a2a2)}.philaCheckbox-disabled[data-v-6d41adb5] .checkbox-svg .checkbox-bg{stroke:var(--Schemes-Surface-Dim, #cfcfcf);stroke-width:1;fill:var(--Schemes-Surface-Bright, #fafafa)}.philaCheckbox-disabled[data-v-6d41adb5] .checkbox-svg--checked .checkbox-bg{fill:var(--Schemes-Surface-Dim, #cfcfcf);stroke:var(--Schemes-Surface-Dim, #cfcfcf)}.philaCheckbox-disabled[data-v-6d41adb5] .checkbox-svg--checked .checkbox-check{stroke:var(--Schemes-Surface-Bright, #fafafa);stroke-width:2}.group-container[data-v-dfb87f32]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-xs, .5rem)}.labels-container[data-v-dfb87f32]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-2xs, .25rem);align-self:stretch}span[data-v-dfb87f32]{display:block}.checkbox-container[data-v-dfb87f32]{display:flex;padding:var(--spacing-m, 1rem);flex-direction:column;align-items:flex-start;gap:var(--Radio-margin-bottom, 1rem);align-self:stretch}.checkbox-container-error[data-v-dfb87f32]{border-radius:var(--border-radius-m, .75rem)}.error-message[data-v-dfb87f32]{display:flex;align-items:center;gap:var(--spacing-s, .75rem);align-self:stretch;font-weight:600}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),p=require("@phila/phila-ui-core"),E=require("@phila/phila-ui-core/icons"),F=["disabled"],z=e.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(l){const o=l,t=s=>"href"in s&&s.href!==void 0||"to"in s&&s.to!==void 0,a=e.computed(()=>p.cn("phila-button",`phila-button--${o.variant}`,o.size&&`is-${o.size}`,o.iconOnly&&"icon-button",o.iconOnly&&o.variant==="standard"&&"icon-button--standard",o.className)),n=e.computed(()=>t(o)?"to"in o&&o.to!==void 0?{to:o.to,disabled:o.disabled,className:a.value}:{href:o.href,target:o.target,rel:o.rel,disabled:o.disabled,className:a.value}:{}),c=e.computed(()=>({icon:o.icon,src:o.src,iconRight:o.iconRight,iconOnly:o.iconOnly,text:o.text,size:o.size}));return(s,h)=>t(o)?(e.openBlock(),e.createBlock(e.unref(p.BaseLink),e.mergeProps({key:0},{...n.value,...s.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(p.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:o.disabled,class:a.value},s.$attrs),[e.createVNode(e.unref(p.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])]),_:3},16)],16,F))}}),U=["id"],q={key:0,class:"tooltip__tail","aria-hidden":"true"},G={key:1,class:"tooltip__plain-row has-text-body-small"},H={key:0,class:"tooltip__title-row"},j={key:0},W=e.defineComponent({__name:"TooltipBubble",props:{id:{},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"top-center"},title:{},dismissable:{type:Boolean,default:!1},className:{}},emits:["dismiss"],setup(l){const o=l,t=e.computed(()=>p.cn("tooltip","content","resets-link-colors",`tooltip--${o.type}`,`tooltip--${o.color}`,o.tail&&`tooltip--${o.placement}`,o.className));return(a,n)=>(e.openBlock(),e.createElementBlock("div",{id:l.id,class:e.normalizeClass(t.value),role:"tooltip"},[l.tail?(e.openBlock(),e.createElementBlock("div",q)):e.createCommentVNode("",!0),l.type==="plain"?(e.openBlock(),e.createElementBlock("div",G,[e.renderSlot(a.$slots,"default",{},void 0,!0),l.dismissable?(e.openBlock(),e.createBlock(e.unref(z),{key:0,class:"tooltip__dismiss",variant:"standard",size:"extra-small","icon-only":!0,icon:e.unref(E.IconClose),"aria-label":"Dismiss tooltip",onClick:n[0]||(n[0]=c=>a.$emit("dismiss"))},null,8,["icon"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.title||l.dismissable?(e.openBlock(),e.createElementBlock("div",H,[l.title?(e.openBlock(),e.createElementBlock("h6",j,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),l.dismissable?(e.openBlock(),e.createBlock(e.unref(z),{key:1,class:"tooltip__dismiss",variant:"standard",size:"extra-small","icon-only":!0,icon:e.unref(E.IconClose),"aria-label":"Dismiss tooltip",onClick:n[1]||(n[1]=c=>a.$emit("dismiss"))},null,8,["icon"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default",{},void 0,!0)],64))],10,U))}}),I=(l,o)=>{const t=l.__vccOpts||l;for(const[a,n]of o)t[a]=n;return t},K=I(W,[["__scopeId","data-v-af4a0398"]]),N=8,w=8,X=e.defineComponent({__name:"Tooltip",props:{trigger:{default:"hover"},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"auto"},title:{},dismissable:{type:Boolean},className:{}},setup(l,{expose:o}){const t=l,a=e.useId(),n=e.ref(!1),c=e.ref(null),s=e.ref(null),h=e.ref("top-center"),k=e.ref({top:0,left:0});let r=null;const m=()=>{const i=c.value?.getBoundingClientRect();if(!i)return"top-center";const{innerWidth:u,innerHeight:x}=window,y=i.top,$=x-i.bottom,_=s.value?.getBoundingClientRect().height??0,B=(_>0?y>=_:y>=$)?"top":"bottom",v=i.left+i.width/2,A=v<u/3?"left":v>u*2/3?"right":"center";return`${B}-${A}`};function d(){const i=c.value?.getBoundingClientRect(),u=s.value?.getBoundingClientRect();if(!i||!u)return;const{innerWidth:x,innerHeight:y}=window,[$,_]=h.value.split("-");let B=$==="top"?i.top-N-u.height:i.bottom+N,v;_==="center"?v=i.left+i.width/2-u.width/2:_==="left"?v=i.left-N:v=i.right+N-u.width,v=Math.min(Math.max(v,w),x-w-u.width),B=Math.min(Math.max(B,w),y-w-u.height),k.value={top:B,left:v}}const g=i=>{i.key==="Escape"&&f()},b=i=>{const u=i.target,x=c.value?.contains(u),y=s.value?.contains(u);!x&&!y&&f()},C=()=>{n.value&&d()},V=async()=>{r&&(clearTimeout(r),r=null),h.value=t.placement==="auto"?m():t.placement,n.value=!0,document.addEventListener("keydown",g),t.trigger==="click"&&document.addEventListener("click",b),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),await e.nextTick(),t.placement==="auto"&&(h.value=m()),d()},f=()=>{n.value=!1,r&&(clearTimeout(r),r=null),document.removeEventListener("keydown",g),document.removeEventListener("click",b),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)},S=()=>{if(t.trigger!=="hover")return f();r=setTimeout(f,100)},R=()=>{r&&(clearTimeout(r),r=null)},D=()=>{n.value?f():V()};e.onUnmounted(f),o({show:V,hide:f});const P=e.computed(()=>({type:t.type,color:t.color,tail:t.tail,placement:h.value,title:t.title,dismissable:t.dismissable})),O=e.computed(()=>({top:`${k.value.top}px`,left:`${k.value.left}px`,visibility:n.value?"visible":"hidden"}));return(i,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",e.mergeProps({ref_key:"wrapperEl",ref:c,class:e.unref(p.cn)("tooltip-trigger",t.className)},l.trigger==="click"?{onClick:D}:{onMouseenter:V,onMouseleave:S,onFocusin:V,onFocusout:f}),[e.renderSlot(i.$slots,"default",{tooltipId:e.unref(a),isOpen:n.value},void 0,!0)],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"bubbleEl",ref:s,class:"tooltip-positioner",style:e.normalizeStyle(O.value),onMouseenter:R,onMouseleave:S},[e.createVNode(K,e.mergeProps(P.value,{id:e.unref(a),onDismiss:f}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"body",{},void 0,!0)]),_:3},16,["id"])],36)]))],64))}}),Y=I(X,[["__scopeId","data-v-591a1092"]]),T=e.defineComponent({__name:"CheckboxIcon",props:{checked:{type:Boolean}},setup(l){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["checkbox-svg",{"checkbox-svg--checked":l.checked}]),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{class:"checkbox-bg",x:"1",y:"1",width:"18",height:"18",rx:"3",ry:"3"},null,-1),e.createElementVNode("path",{class:"checkbox-check",d:"M 4.5 10 L 8.5 14 L 15.5 6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),Z={class:"philaCheckbox-row"},J={class:"philaCheckbox__visual"},Q={key:0},ee=["name","value","checked","disabled"],te={type:"button",class:"philaCheckbox__info","aria-label":"More information"},oe=e.defineComponent({__name:"Checkbox",props:{name:{},value:{type:[String,Number,Boolean]},modelValue:{type:[Boolean,Array]},text:{},tooltip:{},disabled:{type:Boolean},error:{type:Boolean},indeterminate:{type:Boolean},className:{}},emits:["update:modelValue","change","focus","blur"],setup(l,{emit:o}){const t=l,a=o,n=e.ref(null);e.watchEffect(()=>{n.value&&(n.value.indeterminate=t.indeterminate??!1)});const c=e.computed(()=>Array.isArray(t.modelValue)?t.modelValue.includes(t.value):!!t.modelValue);function s(k){if(Array.isArray(t.modelValue)){const r=[...t.modelValue],m=t.value,d=r.indexOf(m);d===-1?r.push(m):r.splice(d,1),a("update:modelValue",r)}else a("update:modelValue",!t.modelValue);a("change",k)}const h=e.computed(()=>p.cn("philaCheckbox","has-text-body-default",t.className,!t.disabled&&"philaCheckbox-enabled",t.disabled&&"philaCheckbox-disabled",t.error&&"philaCheckbox-error",!t.text&&"philaCheckbox--icon-only"));return(k,r)=>(e.openBlock(),e.createElementBlock("span",Z,[e.createElementVNode("label",{class:e.normalizeClass(h.value)},[e.createElementVNode("span",J,[e.createVNode(T,{checked:c.value},null,8,["checked"]),t.text?(e.openBlock(),e.createElementBlock("span",Q,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"inputRef",ref:n,type:"checkbox",name:t.name,value:t.value,checked:c.value,disabled:t.disabled,onChange:s,onFocus:r[0]||(r[0]=m=>a("focus",m)),onBlur:r[1]||(r[1]=m=>a("blur",m))},null,40,ee)],2),t.tooltip?(e.openBlock(),e.createBlock(e.unref(Y),{key:0,trigger:"hover",class:"philaCheckbox__tooltip"},{body:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tooltip),1)]),default:e.withCtx(()=>[e.createElementVNode("button",te,[e.createVNode(e.unref(p.Icon),{icon:e.unref(E.IconCircleInfo),size:"small",inline:"",decorative:""},null,8,["icon"])])]),_:1})):e.createCommentVNode("",!0)]))}}),L=(l,o)=>{const t=l.__vccOpts||l;for(const[a,n]of o)t[a]=n;return t},M=L(oe,[["__scopeId","data-v-6d41adb5"]]),le={class:"labels-container"},ne={class:"has-text-body-default"},ae={key:0,class:"error-message has-text-error content"},re=e.defineComponent({__name:"CheckboxGroup",props:{groupLabel:{},description:{},choices:{},modelValue:{},error:{type:Boolean},errorMessage:{},disabled:{type:Boolean},className:{}},emits:["update:modelValue"],setup(l,{emit:o}){const t=l,a=o,n=p.generateRandomId(),c=e.computed(()=>p.cn("group-container",t.className)),s=e.computed(()=>p.cn("checkbox-container",t.error&&"checkbox-container-error has-background-error")),h=e.computed(()=>p.cn("has-text-label-default",t.error&&"has-text-error"));function k(r,m){const d={};for(const g of t.choices){const b=String(g.value);d[b]=b===String(r)?m:!!t.modelValue?.[b]}a("update:modelValue",d)}return(r,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value)},[e.createElementVNode("div",le,[e.createElementVNode("span",{class:e.normalizeClass(h.value)},e.toDisplayString(l.groupLabel),3),e.createElementVNode("span",ne,e.toDisplayString(l.description),1)]),e.createElementVNode("div",{class:e.normalizeClass(s.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.choices,(d,g)=>(e.openBlock(),e.createBlock(M,{key:e.unref(n)+g,name:e.unref(n),value:d.value,text:d.text,tooltip:d.tooltip,"model-value":t.modelValue?.[String(d.value)]??!1,disabled:t.disabled,error:t.error,"onUpdate:modelValue":b=>k(d.value,b)},null,8,["name","value","text","tooltip","model-value","disabled","error","onUpdate:modelValue"]))),128)),t.error?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(p.Icon),{style:{height:"fit-content",width:"fit-content",padding:"0"},size:"large",inline:"","aria-hidden":"true",icon:e.unref(E.IconCircleExclamation)},null,8,["icon"]),e.createTextVNode(" "+e.toDisplayString(l.errorMessage),1)])):e.createCommentVNode("",!0)],2)],2))}}),ie=L(re,[["__scopeId","data-v-dfb87f32"]]);exports.Checkbox=M;exports.CheckboxGroup=ie;exports.CheckboxIcon=T;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),p=require("@phila/phila-ui-core"),E=require("@phila/phila-ui-core/icons"),F=["disabled"],z=e.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},icon:{},src:{},svgRaw:{}},setup(l){const o=l,t=s=>"href"in s&&s.href!==void 0||"to"in s&&s.to!==void 0,a=e.computed(()=>p.cn("phila-button",`phila-button--${o.variant}`,o.size&&`is-${o.size}`,o.iconOnly&&"icon-button",o.iconOnly&&o.variant==="standard"&&"icon-button--standard",o.className)),n=e.computed(()=>t(o)?"to"in o&&o.to!==void 0?{to:o.to,disabled:o.disabled,className:a.value}:{href:o.href,target:o.target,rel:o.rel,disabled:o.disabled,className:a.value}:{}),c=e.computed(()=>({icon:o.icon,src:o.src,iconRight:o.iconRight,iconOnly:o.iconOnly,text:o.text,size:o.size}));return(s,h)=>t(o)?(e.openBlock(),e.createBlock(e.unref(p.BaseLink),e.mergeProps({key:0},{...n.value,...s.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(p.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:o.disabled,class:a.value},s.$attrs),[e.createVNode(e.unref(p.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.text),1)])]),_:3},16)],16,F))}}),U=["id"],q={key:0,class:"tooltip__tail","aria-hidden":"true"},G={key:1,class:"tooltip__plain-row has-text-body-small"},H={key:0,class:"tooltip__title-row"},j={key:0},W=e.defineComponent({__name:"TooltipBubble",props:{id:{},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"top-center"},title:{},dismissable:{type:Boolean,default:!1},className:{}},emits:["dismiss"],setup(l){const o=l,t=e.computed(()=>p.cn("tooltip","content","resets-link-colors",`tooltip--${o.type}`,`tooltip--${o.color}`,o.tail&&`tooltip--${o.placement}`,o.className));return(a,n)=>(e.openBlock(),e.createElementBlock("div",{id:l.id,class:e.normalizeClass(t.value),role:"tooltip"},[l.tail?(e.openBlock(),e.createElementBlock("div",q)):e.createCommentVNode("",!0),l.type==="plain"?(e.openBlock(),e.createElementBlock("div",G,[e.renderSlot(a.$slots,"default",{},void 0,!0),l.dismissable?(e.openBlock(),e.createBlock(e.unref(z),{key:0,class:"tooltip__dismiss",variant:"standard",size:"extra-small","icon-only":!0,icon:e.unref(E.IconClose),"aria-label":"Dismiss tooltip",onClick:n[0]||(n[0]=c=>a.$emit("dismiss"))},null,8,["icon"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l.title||l.dismissable?(e.openBlock(),e.createElementBlock("div",H,[l.title?(e.openBlock(),e.createElementBlock("h6",j,e.toDisplayString(l.title),1)):e.createCommentVNode("",!0),l.dismissable?(e.openBlock(),e.createBlock(e.unref(z),{key:1,class:"tooltip__dismiss",variant:"standard",size:"extra-small","icon-only":!0,icon:e.unref(E.IconClose),"aria-label":"Dismiss tooltip",onClick:n[1]||(n[1]=c=>a.$emit("dismiss"))},null,8,["icon"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default",{},void 0,!0)],64))],10,U))}}),I=(l,o)=>{const t=l.__vccOpts||l;for(const[a,n]of o)t[a]=n;return t},J=I(W,[["__scopeId","data-v-af4a0398"]]),N=8,w=8,K=e.defineComponent({__name:"Tooltip",props:{trigger:{default:"hover"},type:{default:"plain"},color:{default:"default"},tail:{type:Boolean,default:!1},placement:{default:"auto"},title:{},dismissable:{type:Boolean},className:{}},setup(l,{expose:o}){const t=l,a=e.useId(),n=e.ref(!1),c=e.ref(null),s=e.ref(null),h=e.ref("top-center"),k=e.ref({top:0,left:0});let r=null;const m=()=>{const i=c.value?.getBoundingClientRect();if(!i)return"top-center";const{innerWidth:u,innerHeight:x}=window,y=i.top,$=x-i.bottom,_=s.value?.getBoundingClientRect().height??0,B=(_>0?y>=_:y>=$)?"top":"bottom",v=i.left+i.width/2,A=v<u/3?"left":v>u*2/3?"right":"center";return`${B}-${A}`};function d(){const i=c.value?.getBoundingClientRect(),u=s.value?.getBoundingClientRect();if(!i||!u)return;const{innerWidth:x,innerHeight:y}=window,[$,_]=h.value.split("-");let B=$==="top"?i.top-N-u.height:i.bottom+N,v;_==="center"?v=i.left+i.width/2-u.width/2:_==="left"?v=i.left-N:v=i.right+N-u.width,v=Math.min(Math.max(v,w),x-w-u.width),B=Math.min(Math.max(B,w),y-w-u.height),k.value={top:B,left:v}}const g=i=>{i.key==="Escape"&&f()},b=i=>{const u=i.target,x=c.value?.contains(u),y=s.value?.contains(u);!x&&!y&&f()},C=()=>{n.value&&d()},V=async()=>{r&&(clearTimeout(r),r=null),h.value=t.placement==="auto"?m():t.placement,n.value=!0,document.addEventListener("keydown",g),t.trigger==="click"&&document.addEventListener("click",b),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),await e.nextTick(),t.placement==="auto"&&(h.value=m()),d()},f=()=>{n.value=!1,r&&(clearTimeout(r),r=null),document.removeEventListener("keydown",g),document.removeEventListener("click",b),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)},S=()=>{if(t.trigger!=="hover")return f();r=setTimeout(f,100)},R=()=>{r&&(clearTimeout(r),r=null)},D=()=>{n.value?f():V()};e.onUnmounted(f),o({show:V,hide:f});const P=e.computed(()=>({type:t.type,color:t.color,tail:t.tail,placement:h.value,title:t.title,dismissable:t.dismissable})),O=e.computed(()=>({top:`${k.value.top}px`,left:`${k.value.left}px`,visibility:n.value?"visible":"hidden"}));return(i,u)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({ref_key:"wrapperEl",ref:c,class:e.unref(p.cn)("tooltip-trigger",t.className)},l.trigger==="click"?{onClick:D}:{onMouseenter:V,onMouseleave:S,onFocusin:V,onFocusout:f}),[e.renderSlot(i.$slots,"default",{tooltipId:e.unref(a),isOpen:n.value},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"bubbleEl",ref:s,class:"tooltip-positioner",style:e.normalizeStyle(O.value),onMouseenter:R,onMouseleave:S},[e.createVNode(J,e.mergeProps(P.value,{id:e.unref(a),onDismiss:f}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"body",{},void 0,!0)]),_:3},16,["id"])],36)]))],16))}}),Q=I(K,[["__scopeId","data-v-a68ae692"]]),T=e.defineComponent({__name:"CheckboxIcon",props:{checked:{type:Boolean}},setup(l){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["checkbox-svg",{"checkbox-svg--checked":l.checked}]),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[...t[0]||(t[0]=[e.createElementVNode("rect",{class:"checkbox-bg",x:"1",y:"1",width:"18",height:"18",rx:"3",ry:"3"},null,-1),e.createElementVNode("path",{class:"checkbox-check",d:"M 4.5 10 L 8.5 14 L 15.5 6","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))}}),X={class:"philaCheckbox-row"},Y={class:"philaCheckbox__visual"},Z={key:0},ee=["name","value","checked","disabled"],te={type:"button",class:"philaCheckbox__info","aria-label":"More information"},oe=e.defineComponent({__name:"Checkbox",props:{name:{},value:{type:[String,Number,Boolean]},modelValue:{type:[Boolean,Array]},text:{},tooltip:{},disabled:{type:Boolean},error:{type:Boolean},indeterminate:{type:Boolean},className:{}},emits:["update:modelValue","change","focus","blur"],setup(l,{emit:o}){const t=l,a=o,n=e.ref(null);e.watchEffect(()=>{n.value&&(n.value.indeterminate=t.indeterminate??!1)});const c=e.computed(()=>Array.isArray(t.modelValue)?t.modelValue.includes(t.value):!!t.modelValue);function s(k){if(Array.isArray(t.modelValue)){const r=[...t.modelValue],m=t.value,d=r.indexOf(m);d===-1?r.push(m):r.splice(d,1),a("update:modelValue",r)}else a("update:modelValue",!t.modelValue);a("change",k)}const h=e.computed(()=>p.cn("philaCheckbox","has-text-body-default",t.className,!t.disabled&&"philaCheckbox-enabled",t.disabled&&"philaCheckbox-disabled",t.error&&"philaCheckbox-error",!t.text&&"philaCheckbox--icon-only"));return(k,r)=>(e.openBlock(),e.createElementBlock("span",X,[e.createElementVNode("label",{class:e.normalizeClass(h.value)},[e.createElementVNode("span",Y,[e.createVNode(T,{checked:c.value},null,8,["checked"]),t.text?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"inputRef",ref:n,type:"checkbox",name:t.name,value:t.value,checked:c.value,disabled:t.disabled,onChange:s,onFocus:r[0]||(r[0]=m=>a("focus",m)),onBlur:r[1]||(r[1]=m=>a("blur",m))},null,40,ee)],2),t.tooltip?(e.openBlock(),e.createBlock(e.unref(Q),{key:0,trigger:"hover",class:"philaCheckbox__tooltip"},{body:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tooltip),1)]),default:e.withCtx(()=>[e.createElementVNode("button",te,[e.createVNode(e.unref(p.Icon),{icon:e.unref(E.IconCircleInfo),size:"small",inline:"",decorative:""},null,8,["icon"])])]),_:1})):e.createCommentVNode("",!0)]))}}),L=(l,o)=>{const t=l.__vccOpts||l;for(const[a,n]of o)t[a]=n;return t},M=L(oe,[["__scopeId","data-v-6d41adb5"]]),le={class:"labels-container"},ne={class:"has-text-body-default"},ae={key:0,class:"error-message has-text-error content"},re=e.defineComponent({__name:"CheckboxGroup",props:{groupLabel:{},description:{},choices:{},modelValue:{},error:{type:Boolean},errorMessage:{},disabled:{type:Boolean},className:{}},emits:["update:modelValue"],setup(l,{emit:o}){const t=l,a=o,n=p.generateRandomId(),c=e.computed(()=>p.cn("group-container",t.className)),s=e.computed(()=>p.cn("checkbox-container",t.error&&"checkbox-container-error has-background-error")),h=e.computed(()=>p.cn("has-text-label-default",t.error&&"has-text-error"));function k(r,m){const d={};for(const g of t.choices){const b=String(g.value);d[b]=b===String(r)?m:!!t.modelValue?.[b]}a("update:modelValue",d)}return(r,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value)},[e.createElementVNode("div",le,[e.createElementVNode("span",{class:e.normalizeClass(h.value)},e.toDisplayString(l.groupLabel),3),e.createElementVNode("span",ne,e.toDisplayString(l.description),1)]),e.createElementVNode("div",{class:e.normalizeClass(s.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.choices,(d,g)=>(e.openBlock(),e.createBlock(M,{key:e.unref(n)+g,name:e.unref(n),value:d.value,text:d.text,tooltip:d.tooltip,"model-value":t.modelValue?.[String(d.value)]??!1,disabled:t.disabled,error:t.error,"onUpdate:modelValue":b=>k(d.value,b)},null,8,["name","value","text","tooltip","model-value","disabled","error","onUpdate:modelValue"]))),128)),t.error?(e.openBlock(),e.createElementBlock("div",ae,[e.createVNode(e.unref(p.Icon),{style:{height:"fit-content",width:"fit-content",padding:"0"},size:"large",inline:"","aria-hidden":"true",icon:e.unref(E.IconCircleExclamation)},null,8,["icon"]),e.createTextVNode(" "+e.toDisplayString(l.errorMessage),1)])):e.createCommentVNode("",!0)],2)],2))}}),ie=L(re,[["__scopeId","data-v-dfb87f32"]]);exports.Checkbox=M;exports.CheckboxGroup=ie;exports.CheckboxIcon=T;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as M, useId as ne, ref as V, onUnmounted as se, computed as f, createElementBlock as p, openBlock as i,
|
|
2
|
-
import { cn as w, BaseLink as pe, ActionContent as
|
|
3
|
-
import { IconClose as
|
|
4
|
-
import './index.css';const fe = ["disabled"],
|
|
1
|
+
import { defineComponent as M, useId as ne, ref as V, onUnmounted as se, computed as f, createElementBlock as p, openBlock as i, mergeProps as F, unref as c, renderSlot as I, createBlock as z, Teleport as ie, createElementVNode as v, normalizeStyle as re, createVNode as L, withCtx as N, nextTick as ce, normalizeClass as E, createCommentVNode as x, Fragment as X, toDisplayString as C, normalizeProps as W, guardReactiveProps as j, createTextVNode as H, watchEffect as de, renderList as ue } from "vue";
|
|
2
|
+
import { cn as w, BaseLink as pe, ActionContent as J, Icon as Y, generateRandomId as me } from "@phila/phila-ui-core";
|
|
3
|
+
import { IconClose as K, IconCircleInfo as he, IconCircleExclamation as ve } from "@phila/phila-ui-core/icons";
|
|
4
|
+
import './index.css';const fe = ["disabled"], Q = /* @__PURE__ */ M({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "PhlButton",
|
|
7
7
|
props: {
|
|
@@ -49,11 +49,11 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
49
49
|
size: t.size
|
|
50
50
|
})
|
|
51
51
|
);
|
|
52
|
-
return (r, b) => e(t) ? (i(),
|
|
52
|
+
return (r, b) => e(t) ? (i(), z(c(pe), F({ key: 0 }, { ...l.value, ...r.$attrs }, { role: "button" }), {
|
|
53
53
|
default: N(() => [
|
|
54
|
-
L(c(
|
|
54
|
+
L(c(J), W(j(d.value)), {
|
|
55
55
|
default: N(() => [
|
|
56
|
-
|
|
56
|
+
I(r.$slots, "default", {}, () => [
|
|
57
57
|
H(C(t.text), 1)
|
|
58
58
|
])
|
|
59
59
|
]),
|
|
@@ -67,9 +67,9 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
67
67
|
disabled: t.disabled,
|
|
68
68
|
class: a.value
|
|
69
69
|
}, r.$attrs), [
|
|
70
|
-
L(c(
|
|
70
|
+
L(c(J), W(j(d.value)), {
|
|
71
71
|
default: N(() => [
|
|
72
|
-
|
|
72
|
+
I(r.$slots, "default", {}, () => [
|
|
73
73
|
H(C(t.text), 1)
|
|
74
74
|
])
|
|
75
75
|
]),
|
|
@@ -119,41 +119,41 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
119
119
|
}, [
|
|
120
120
|
o.tail ? (i(), p("div", ye)) : x("", !0),
|
|
121
121
|
o.type === "plain" ? (i(), p("div", ge, [
|
|
122
|
-
|
|
123
|
-
o.dismissable ? (i(),
|
|
122
|
+
I(a.$slots, "default", {}, void 0, !0),
|
|
123
|
+
o.dismissable ? (i(), z(c(Q), {
|
|
124
124
|
key: 0,
|
|
125
125
|
class: "tooltip__dismiss",
|
|
126
126
|
variant: "standard",
|
|
127
127
|
size: "extra-small",
|
|
128
128
|
"icon-only": !0,
|
|
129
|
-
icon: c(
|
|
129
|
+
icon: c(K),
|
|
130
130
|
"aria-label": "Dismiss tooltip",
|
|
131
131
|
onClick: l[0] || (l[0] = (d) => a.$emit("dismiss"))
|
|
132
132
|
}, null, 8, ["icon"])) : x("", !0)
|
|
133
|
-
])) : (i(), p(
|
|
133
|
+
])) : (i(), p(X, { key: 2 }, [
|
|
134
134
|
o.title || o.dismissable ? (i(), p("div", ke, [
|
|
135
135
|
o.title ? (i(), p("h6", _e, C(o.title), 1)) : x("", !0),
|
|
136
|
-
o.dismissable ? (i(),
|
|
136
|
+
o.dismissable ? (i(), z(c(Q), {
|
|
137
137
|
key: 1,
|
|
138
138
|
class: "tooltip__dismiss",
|
|
139
139
|
variant: "standard",
|
|
140
140
|
size: "extra-small",
|
|
141
141
|
"icon-only": !0,
|
|
142
|
-
icon: c(
|
|
142
|
+
icon: c(K),
|
|
143
143
|
"aria-label": "Dismiss tooltip",
|
|
144
144
|
onClick: l[1] || (l[1] = (d) => a.$emit("dismiss"))
|
|
145
145
|
}, null, 8, ["icon"])) : x("", !0)
|
|
146
146
|
])) : x("", !0),
|
|
147
|
-
|
|
147
|
+
I(a.$slots, "default", {}, void 0, !0)
|
|
148
148
|
], 64))
|
|
149
149
|
], 10, be));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
151
|
+
}), Z = (o, t) => {
|
|
152
152
|
const e = o.__vccOpts || o;
|
|
153
153
|
for (const [a, l] of t)
|
|
154
154
|
e[a] = l;
|
|
155
155
|
return e;
|
|
156
|
-
}, Ce = /* @__PURE__ */
|
|
156
|
+
}, Ce = /* @__PURE__ */ Z(xe, [["__scopeId", "data-v-af4a0398"]]), P = 8, D = 8, we = /* @__PURE__ */ M({
|
|
157
157
|
__name: "Tooltip",
|
|
158
158
|
props: {
|
|
159
159
|
trigger: { default: "hover" },
|
|
@@ -192,7 +192,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
192
192
|
n && (clearTimeout(n), n = null), b.value = e.placement === "auto" ? h() : e.placement, l.value = !0, document.addEventListener("keydown", B), e.trigger === "click" && document.addEventListener("click", _), window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), await ce(), e.placement === "auto" && (b.value = h()), u();
|
|
193
193
|
}, y = () => {
|
|
194
194
|
l.value = !1, n && (clearTimeout(n), n = null), document.removeEventListener("keydown", B), document.removeEventListener("click", _), window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
|
|
195
|
-
},
|
|
195
|
+
}, G = () => {
|
|
196
196
|
if (e.trigger !== "hover") return y();
|
|
197
197
|
n = setTimeout(y, 100);
|
|
198
198
|
}, ee = () => {
|
|
@@ -213,43 +213,41 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
213
213
|
left: `${k.value.left}px`,
|
|
214
214
|
visibility: l.value ? "visible" : "hidden"
|
|
215
215
|
}));
|
|
216
|
-
return (s, m) => (i(), p(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
], 16),
|
|
230
|
-
(i(), I(ie, { to: "body" }, [
|
|
216
|
+
return (s, m) => (i(), p("span", F(
|
|
217
|
+
{
|
|
218
|
+
ref_key: "wrapperEl",
|
|
219
|
+
ref: d,
|
|
220
|
+
class: c(w)("tooltip-trigger", e.className)
|
|
221
|
+
},
|
|
222
|
+
o.trigger === "click" ? { onClick: te } : { onMouseenter: A, onMouseleave: G, onFocusin: A, onFocusout: y }
|
|
223
|
+
), [
|
|
224
|
+
I(s.$slots, "default", {
|
|
225
|
+
tooltipId: c(a),
|
|
226
|
+
isOpen: l.value
|
|
227
|
+
}, void 0, !0),
|
|
228
|
+
(i(), z(ie, { to: "body" }, [
|
|
231
229
|
v("div", {
|
|
232
230
|
ref_key: "bubbleEl",
|
|
233
231
|
ref: r,
|
|
234
232
|
class: "tooltip-positioner",
|
|
235
233
|
style: re(le.value),
|
|
236
234
|
onMouseenter: ee,
|
|
237
|
-
onMouseleave:
|
|
235
|
+
onMouseleave: G
|
|
238
236
|
}, [
|
|
239
237
|
L(Ce, F(oe.value, {
|
|
240
238
|
id: c(a),
|
|
241
239
|
onDismiss: y
|
|
242
240
|
}), {
|
|
243
241
|
default: N(() => [
|
|
244
|
-
|
|
242
|
+
I(s.$slots, "body", {}, void 0, !0)
|
|
245
243
|
]),
|
|
246
244
|
_: 3
|
|
247
245
|
}, 16, ["id"])
|
|
248
246
|
], 36)
|
|
249
247
|
]))
|
|
250
|
-
],
|
|
248
|
+
], 16));
|
|
251
249
|
}
|
|
252
|
-
}), Be = /* @__PURE__ */
|
|
250
|
+
}), Be = /* @__PURE__ */ Z(we, [["__scopeId", "data-v-a68ae692"]]), $e = /* @__PURE__ */ M({
|
|
253
251
|
__name: "CheckboxIcon",
|
|
254
252
|
props: {
|
|
255
253
|
checked: { type: Boolean }
|
|
@@ -343,7 +341,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
343
341
|
onBlur: n[1] || (n[1] = (h) => a("blur", h))
|
|
344
342
|
}, null, 40, Ie)
|
|
345
343
|
], 2),
|
|
346
|
-
e.tooltip ? (i(),
|
|
344
|
+
e.tooltip ? (i(), z(c(Be), {
|
|
347
345
|
key: 0,
|
|
348
346
|
trigger: "hover",
|
|
349
347
|
class: "philaCheckbox__tooltip"
|
|
@@ -353,7 +351,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
353
351
|
]),
|
|
354
352
|
default: N(() => [
|
|
355
353
|
v("button", ze, [
|
|
356
|
-
L(c(
|
|
354
|
+
L(c(Y), {
|
|
357
355
|
icon: c(he),
|
|
358
356
|
size: "small",
|
|
359
357
|
inline: "",
|
|
@@ -365,12 +363,12 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
365
363
|
})) : x("", !0)
|
|
366
364
|
]));
|
|
367
365
|
}
|
|
368
|
-
}),
|
|
366
|
+
}), q = (o, t) => {
|
|
369
367
|
const e = o.__vccOpts || o;
|
|
370
368
|
for (const [a, l] of t)
|
|
371
369
|
e[a] = l;
|
|
372
370
|
return e;
|
|
373
|
-
}, Me = /* @__PURE__ */
|
|
371
|
+
}, Me = /* @__PURE__ */ q(Le, [["__scopeId", "data-v-6d41adb5"]]), Re = { class: "labels-container" }, Te = { class: "has-text-body-default" }, Oe = {
|
|
374
372
|
key: 0,
|
|
375
373
|
class: "error-message has-text-error content"
|
|
376
374
|
}, Se = /* @__PURE__ */ M({
|
|
@@ -408,7 +406,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
408
406
|
v("div", {
|
|
409
407
|
class: E(r.value)
|
|
410
408
|
}, [
|
|
411
|
-
(i(!0), p(
|
|
409
|
+
(i(!0), p(X, null, ue(e.choices, (u, B) => (i(), z(Me, {
|
|
412
410
|
key: c(l) + B,
|
|
413
411
|
name: c(l),
|
|
414
412
|
value: u.value,
|
|
@@ -420,7 +418,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
420
418
|
"onUpdate:modelValue": (_) => k(u.value, _)
|
|
421
419
|
}, null, 8, ["name", "value", "text", "tooltip", "model-value", "disabled", "error", "onUpdate:modelValue"]))), 128)),
|
|
422
420
|
e.error ? (i(), p("div", Oe, [
|
|
423
|
-
L(c(
|
|
421
|
+
L(c(Y), {
|
|
424
422
|
style: { height: "fit-content", width: "fit-content", padding: "0" },
|
|
425
423
|
size: "large",
|
|
426
424
|
inline: "",
|
|
@@ -432,7 +430,7 @@ import './index.css';const fe = ["disabled"], Z = /* @__PURE__ */ M({
|
|
|
432
430
|
], 2)
|
|
433
431
|
], 2));
|
|
434
432
|
}
|
|
435
|
-
}), Fe = /* @__PURE__ */
|
|
433
|
+
}), Fe = /* @__PURE__ */ q(Se, [["__scopeId", "data-v-dfb87f32"]]);
|
|
436
434
|
export {
|
|
437
435
|
Me as Checkbox,
|
|
438
436
|
Fe as CheckboxGroup,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-checkbox",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A checkbox input.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@phila/phila-ui-core": "3.0.0-beta.9",
|
|
32
|
-
"@phila/phila-ui-tooltip": "0.1.0-beta.
|
|
32
|
+
"@phila/phila-ui-tooltip": "0.1.0-beta.12"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^24.0.0",
|