@phila/phila-ui-search 1.1.1-beta.0 → 1.1.1-beta.1

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 +1 @@
1
- {"version":3,"file":"Search.vue.d.ts","sourceRoot":"","sources":["../src/Search.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;AAiJ3C,wBAQG"}
1
+ {"version":3,"file":"Search.vue.d.ts","sourceRoot":"","sources":["../src/Search.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;AAwJ3C,wBAQG"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),n=require("@phila/phila-ui-core");var y={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},b=y;const x=["disabled"],k=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:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(d){const t=d,r=l=>"href"in l&&l.href!==void 0||"to"in l&&l.to!==void 0,a=e.computed(()=>n.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),s=e.computed(()=>r(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:a.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:a.value}:{}),c=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(l,u)=>r(t)?(e.openBlock(),e.createBlock(e.unref(n.BaseLink),e.mergeProps({key:0},{...s.value,...l.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:t.disabled,class:a.value},l.$attrs),[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)],16,x))}});var N={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},V=N,B={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},C=B;const z=["for"],S={class:"state-layer"},P={class:"content"},$={class:"input-text-container"},D=["id","placeholder"],R={key:1,class:"has-text-body-small phila-supporting-text"},w={key:2,class:"has-text-body-small phila-error-text"},E=e.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},supportingText:{default:""},placeholder:{default:""},leadingIcon:{default:""},trailingIcon:{default:""},error:{default(){return[]}}},emits:["update:modelValue"],setup(d,{emit:t}){const r=e.useAttrs(),a=d,s=e.computed(()=>typeof a.error=="string"?a.error:a.error[0]),c=e.toRef(a,"id"),l=t,u=e.ref(""),i=e.computed({get:()=>a.modelValue!==void 0?a.modelValue:u.value,set:o=>{l("update:modelValue",o),u.value=o}}),p=e.computed(()=>{const o=["default-class"];return r.disabled!=null&&o.push("phila-input--disabled"),s.value&&o.push("phila-input--error"),r.required!=null&&o.push("phila-input--required"),n.cn(...o)}),v=e.computed(()=>{const o=[];return i.value!==""&&o.push("phila-text-field--filled"),a.className&&o.push(a.className),n.cn(...o)}),f=e.ref(null),g=o=>{o.target.closest("button")||f.value?.focus()};return(o,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["phila-input",p.value])},[a.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"has-text-label-small phila-label"},e.toDisplayString(a.label),9,z)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["phila-text-field",v.value]),onClick:g},[e.createElementVNode("div",S,[a.leadingIcon?(e.openBlock(),e.createBlock(e.unref(n.Icon),{key:0,"icon-class":a.leadingIcon,inline:"",decorative:""},null,8,["icon-class"])):e.createCommentVNode("",!0),e.createElementVNode("div",P,[e.createElementVNode("div",$,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:c.value,ref_key:"inputRef",ref:f,"onUpdate:modelValue":m[0]||(m[0]=h=>i.value=h),class:"phila-text-field-input has-text-body-default",placeholder:a.placeholder},e.unref(r)),null,16,D),[[e.vModelDynamic,i.value]])])]),i.value!=""?(e.openBlock(),e.createBlock(e.unref(k),{key:1,variant:"standard",size:"small","icon-only":"","icon-definition":e.unref(C),onClick:m[1]||(m[1]=h=>i.value="")},null,8,["icon-definition"])):e.createCommentVNode("",!0),a.trailingIcon?(e.openBlock(),e.createBlock(e.unref(n.Icon),{key:2,size:"small","icon-class":a.trailingIcon,inline:"",decorative:""},null,8,["icon-class"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"trailing-action")])],2),a.supportingText?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(a.supportingText),1)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(e.unref(n.Icon),{"icon-definition":e.unref(V),size:"small",inline:"",decorative:""},null,8,["icon-definition"]),e.createTextVNode(" "+e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0)],2))}}),_=["disabled"],O=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:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(d){const t=d,r=l=>"href"in l&&l.href!==void 0||"to"in l&&l.to!==void 0,a=e.computed(()=>n.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),s=e.computed(()=>r(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:a.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:a.value}:{}),c=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(l,u)=>r(t)?(e.openBlock(),e.createBlock(e.unref(n.BaseLink),e.mergeProps({key:0},{...s.value,...l.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:t.disabled,class:a.value},l.$attrs),[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(c.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)],16,_))}}),T=e.defineComponent({inheritAttrs:!1,__name:"Search",props:{modelValue:{default:void 0},placeholder:{default:"Search by title or keyword"},className:{}},emits:["update:modelValue","search"],setup(d,{emit:t}){const r=e.useAttrs(),a=d,s=t,c=e.computed({get:()=>a.modelValue,set:u=>s("update:modelValue",u)}),l=e.computed(()=>n.cn("default-class",a.className));return(u,i)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["search",l.value]},e.unref(r)),[e.createVNode(e.unref(E),{modelValue:c.value,"onUpdate:modelValue":i[1]||(i[1]=p=>c.value=p),"class-name":"phila-text-field--search",placeholder:d.placeholder,onKeydown:i[2]||(i[2]=e.withKeys(p=>s("search"),["enter"]))},{"trailing-action":e.withCtx(()=>[e.createVNode(e.unref(O),{variant:"standard",size:"small","icon-only":"","icon-definition":e.unref(b),"aria-label":"Search","class-name":"phila-button--search",onClick:i[0]||(i[0]=p=>s("search"))},null,8,["icon-definition"])]),_:1},8,["modelValue","placeholder"])],16))}});exports.Search=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),n=require("@phila/phila-ui-core");var y={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},x=y;const k=["disabled"],N=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:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(c){const t=c,i=l=>"href"in l&&l.href!==void 0||"to"in l&&l.to!==void 0,a=e.computed(()=>n.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),r=e.computed(()=>i(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:a.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:a.value}:{}),s=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(l,p)=>i(t)?(e.openBlock(),e.createBlock(e.unref(n.BaseLink),e.mergeProps({key:0},{...r.value,...l.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:t.disabled,class:a.value},l.$attrs),[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)],16,k))}});var V={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},B=V,C={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},z=C;const S=["for"],P={class:"state-layer"},$={class:"content"},D={class:"input-text-container"},w=["id","placeholder","aria-label"],E={key:1,class:"has-text-body-small phila-supporting-text"},O={key:2,class:"has-text-body-small phila-error-text"},R=e.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},supportingText:{default:""},placeholder:{default:""},leadingIcon:{default:""},trailingIcon:{default:""},error:{default(){return[]}}},emits:["update:modelValue"],setup(c,{emit:t}){const i=e.useAttrs(),a=c,r=e.computed(()=>typeof a.error=="string"?a.error:a.error[0]),s=e.toRef(a,"id"),l=t,p=e.ref(""),u=e.computed({get:()=>a.modelValue!==void 0?a.modelValue:p.value,set:o=>{l("update:modelValue",o),p.value=o}}),m=e.computed(()=>{const o=["default-class"];return i.disabled!=null&&o.push("phila-input--disabled"),r.value&&o.push("phila-input--error"),i.required!=null&&o.push("phila-input--required"),n.cn(...o)}),d=e.computed(()=>{const o=[];return u.value!==""&&o.push("phila-text-field--filled"),a.className&&o.push(a.className),n.cn(...o)}),f=e.computed(()=>{if(!(a.label||i["aria-label"]))return a.placeholder||void 0}),v=e.ref(null),g=o=>{o.target.closest("button")||v.value?.focus()};return(o,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["phila-input",m.value])},[a.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:s.value,class:"has-text-label-small phila-label"},e.toDisplayString(a.label),9,S)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["phila-text-field",d.value]),onClick:g},[e.createElementVNode("div",P,[a.leadingIcon?(e.openBlock(),e.createBlock(e.unref(n.Icon),{key:0,"icon-class":a.leadingIcon,inline:"",decorative:""},null,8,["icon-class"])):e.createCommentVNode("",!0),e.createElementVNode("div",$,[e.createElementVNode("div",D,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:s.value,ref_key:"inputRef",ref:v,"onUpdate:modelValue":h[0]||(h[0]=b=>u.value=b),class:"phila-text-field-input has-text-body-default",placeholder:a.placeholder,"aria-label":f.value},e.unref(i)),null,16,w),[[e.vModelDynamic,u.value]])])]),u.value!=""?(e.openBlock(),e.createBlock(e.unref(N),{key:1,variant:"standard",size:"small","icon-only":"","icon-definition":e.unref(z),onClick:h[1]||(h[1]=b=>u.value="")},null,8,["icon-definition"])):e.createCommentVNode("",!0),a.trailingIcon?(e.openBlock(),e.createBlock(e.unref(n.Icon),{key:2,size:"small","icon-class":a.trailingIcon,inline:"",decorative:""},null,8,["icon-class"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"trailing-action")])],2),a.supportingText?(e.openBlock(),e.createElementBlock("div",E,e.toDisplayString(a.supportingText),1)):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(e.unref(n.Icon),{"icon-definition":e.unref(B),size:"small",inline:"",decorative:""},null,8,["icon-definition"]),e.createTextVNode(" "+e.toDisplayString(r.value),1)])):e.createCommentVNode("",!0)],2))}}),_=["disabled"],T=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:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(c){const t=c,i=l=>"href"in l&&l.href!==void 0||"to"in l&&l.to!==void 0,a=e.computed(()=>n.cn("phila-button",`phila-button--${t.variant}`,t.size&&`is-${t.size}`,t.iconOnly&&"icon-button",t.iconOnly&&t.variant==="standard"&&"icon-button--standard",t.className)),r=e.computed(()=>i(t)?"to"in t&&t.to!==void 0?{to:t.to,disabled:t.disabled,className:a.value}:{href:t.href,target:t.target,rel:t.rel,disabled:t.disabled,className:a.value}:{}),s=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,iconRight:t.iconRight,iconOnly:t.iconOnly,text:t.text,size:t.size}));return(l,p)=>i(t)?(e.openBlock(),e.createBlock(e.unref(n.BaseLink),e.mergeProps({key:0},{...r.value,...l.$attrs},{role:"button"}),{default:e.withCtx(()=>[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1,type:"button",disabled:t.disabled,class:a.value},l.$attrs),[e.createVNode(e.unref(n.ActionContent),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},16)],16,_))}}),A=e.defineComponent({inheritAttrs:!1,__name:"Search",props:{modelValue:{default:void 0},placeholder:{default:"Search by title or keyword"},className:{}},emits:["update:modelValue","search"],setup(c,{emit:t}){const i=e.useAttrs(),a=c,r=t,s=e.computed({get:()=>a.modelValue,set:m=>r("update:modelValue",m)}),l=e.computed(()=>i["aria-label"]),p=e.computed(()=>Object.fromEntries(Object.entries(i).filter(([m])=>m!=="aria-label"))),u=e.computed(()=>n.cn("default-class",a.className));return(m,d)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["search",u.value]},p.value),[e.createVNode(e.unref(R),{modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=f=>s.value=f),"class-name":"phila-text-field--search",placeholder:c.placeholder,"aria-label":l.value,onKeydown:d[2]||(d[2]=e.withKeys(f=>r("search"),["enter"]))},{"trailing-action":e.withCtx(()=>[e.createVNode(e.unref(T),{variant:"standard",size:"small","icon-only":"","icon-definition":e.unref(x),"aria-label":"Search","class-name":"phila-button--search",onClick:d[0]||(d[0]=f=>r("search"))},null,8,["icon-definition"])]),_:1},8,["modelValue","placeholder","aria-label"])],16))}});exports.Search=A;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as O, useAttrs as I, computed as o, toRef as P, ref as L, createElementBlock as p, openBlock as s, normalizeClass as w, createCommentVNode as y, createElementVNode as x, toDisplayString as m, createBlock as z, renderSlot as k, unref as l, withDirectives as q, mergeProps as b, vModelDynamic as E, createVNode as v, createTextVNode as N, withCtx as h, normalizeProps as C, guardReactiveProps as _, withKeys as K } from "vue";
2
- import { cn as V, Icon as R, BaseLink as M, ActionContent as B } from "@phila/phila-ui-core";
3
- import './index.css';var U = {
1
+ import { defineComponent as D, useAttrs as I, computed as n, toRef as E, ref as M, createElementBlock as p, openBlock as o, normalizeClass as A, createCommentVNode as g, createElementVNode as k, toDisplayString as m, createBlock as N, renderSlot as V, unref as l, withDirectives as j, mergeProps as x, vModelDynamic as K, createVNode as h, createTextVNode as $, withCtx as v, normalizeProps as _, guardReactiveProps as B, withKeys as U } from "vue";
2
+ import { cn as C, Icon as L, BaseLink as T, ActionContent as R } from "@phila/phila-ui-core";
3
+ import './index.css';var q = {
4
4
  prefix: "fas",
5
5
  iconName: "magnifying-glass",
6
6
  icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
7
- }, G = U;
8
- const j = ["disabled"], F = /* @__PURE__ */ O({
7
+ }, G = q;
8
+ const F = ["disabled"], H = /* @__PURE__ */ D({
9
9
  inheritAttrs: !1,
10
10
  __name: "PhlButton",
11
11
  props: {
@@ -26,25 +26,25 @@ const j = ["disabled"], F = /* @__PURE__ */ O({
26
26
  src: {},
27
27
  svgRaw: {}
28
28
  },
29
- setup(u) {
30
- const e = u, r = (a) => "href" in a && a.href !== void 0 || "to" in a && a.to !== void 0, t = o(() => V(
29
+ setup(d) {
30
+ const e = d, s = (t) => "href" in t && t.href !== void 0 || "to" in t && t.to !== void 0, a = n(() => C(
31
31
  "phila-button",
32
32
  `phila-button--${e.variant}`,
33
33
  e.size && `is-${e.size}`,
34
34
  e.iconOnly && "icon-button",
35
35
  e.iconOnly && e.variant === "standard" && "icon-button--standard",
36
36
  e.className
37
- )), c = o(() => r(e) ? "to" in e && e.to !== void 0 ? {
37
+ )), r = n(() => s(e) ? "to" in e && e.to !== void 0 ? {
38
38
  to: e.to,
39
39
  disabled: e.disabled,
40
- className: t.value
40
+ className: a.value
41
41
  } : {
42
42
  href: e.href,
43
43
  target: e.target,
44
44
  rel: e.rel,
45
45
  disabled: e.disabled,
46
- className: t.value
47
- } : {}), d = o(
46
+ className: a.value
47
+ } : {}), c = n(
48
48
  () => ({
49
49
  iconDefinition: e.iconDefinition,
50
50
  iconClass: e.iconClass,
@@ -55,51 +55,51 @@ const j = ["disabled"], F = /* @__PURE__ */ O({
55
55
  size: e.size
56
56
  })
57
57
  );
58
- return (a, f) => r(e) ? (s(), z(l(M), b({ key: 0 }, { ...c.value, ...a.$attrs }, { role: "button" }), {
59
- default: h(() => [
60
- v(l(B), C(_(d.value)), {
61
- default: h(() => [
62
- k(a.$slots, "default", {}, () => [
63
- N(m(e.text), 1)
58
+ return (t, b) => s(e) ? (o(), N(l(T), x({ key: 0 }, { ...r.value, ...t.$attrs }, { role: "button" }), {
59
+ default: v(() => [
60
+ h(l(R), _(B(c.value)), {
61
+ default: v(() => [
62
+ V(t.$slots, "default", {}, () => [
63
+ $(m(e.text), 1)
64
64
  ])
65
65
  ]),
66
66
  _: 3
67
67
  }, 16)
68
68
  ]),
69
69
  _: 3
70
- }, 16)) : (s(), p("button", b({
70
+ }, 16)) : (o(), p("button", x({
71
71
  key: 1,
72
72
  type: "button",
73
73
  disabled: e.disabled,
74
- class: t.value
75
- }, a.$attrs), [
76
- v(l(B), C(_(d.value)), {
77
- default: h(() => [
78
- k(a.$slots, "default", {}, () => [
79
- N(m(e.text), 1)
74
+ class: a.value
75
+ }, t.$attrs), [
76
+ h(l(R), _(B(c.value)), {
77
+ default: v(() => [
78
+ V(t.$slots, "default", {}, () => [
79
+ $(m(e.text), 1)
80
80
  ])
81
81
  ]),
82
82
  _: 3
83
83
  }, 16)
84
- ], 16, j));
84
+ ], 16, F));
85
85
  }
86
86
  });
87
- var H = {
87
+ var J = {
88
88
  prefix: "fas",
89
89
  iconName: "circle-exclamation",
90
90
  icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]
91
- }, J = H, Q = {
91
+ }, Q = J, W = {
92
92
  prefix: "fas",
93
93
  iconName: "xmark",
94
94
  icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
95
- }, W = Q;
96
- const X = ["for"], Y = { class: "state-layer" }, Z = { class: "content" }, ee = { class: "input-text-container" }, te = ["id", "placeholder"], ae = {
95
+ }, X = W;
96
+ const Y = ["for"], Z = { class: "state-layer" }, ee = { class: "content" }, ae = { class: "input-text-container" }, te = ["id", "placeholder", "aria-label"], le = {
97
97
  key: 1,
98
98
  class: "has-text-body-small phila-supporting-text"
99
- }, le = {
99
+ }, ie = {
100
100
  key: 2,
101
101
  class: "has-text-body-small phila-error-text"
102
- }, ie = /* @__PURE__ */ O({
102
+ }, ne = /* @__PURE__ */ D({
103
103
  inheritAttrs: !1,
104
104
  __name: "TextField",
105
105
  props: {
@@ -116,85 +116,89 @@ const X = ["for"], Y = { class: "state-layer" }, Z = { class: "content" }, ee =
116
116
  } }
117
117
  },
118
118
  emits: ["update:modelValue"],
119
- setup(u, { emit: e }) {
120
- const r = I(), t = u, c = o(() => typeof t.error == "string" ? t.error : t.error[0]), d = P(t, "id"), a = e, f = L(""), n = o({
121
- get: () => t.modelValue !== void 0 ? t.modelValue : f.value,
119
+ setup(d, { emit: e }) {
120
+ const s = I(), a = d, r = n(() => typeof a.error == "string" ? a.error : a.error[0]), c = E(a, "id"), t = e, b = M(""), f = n({
121
+ get: () => a.modelValue !== void 0 ? a.modelValue : b.value,
122
122
  set: (i) => {
123
- a("update:modelValue", i), f.value = i;
123
+ t("update:modelValue", i), b.value = i;
124
124
  }
125
- }), g = o(() => {
125
+ }), y = n(() => {
126
126
  const i = ["default-class"];
127
- return r.disabled != null && i.push("phila-input--disabled"), c.value && i.push("phila-input--error"), r.required != null && i.push("phila-input--required"), V(...i);
128
- }), T = o(() => {
127
+ return s.disabled != null && i.push("phila-input--disabled"), r.value && i.push("phila-input--error"), s.required != null && i.push("phila-input--required"), C(...i);
128
+ }), u = n(() => {
129
129
  const i = [];
130
- return n.value !== "" && i.push("phila-text-field--filled"), t.className && i.push(t.className), V(...i);
131
- }), D = L(null), A = (i) => {
132
- i.target.closest("button") || D.value?.focus();
130
+ return f.value !== "" && i.push("phila-text-field--filled"), a.className && i.push(a.className), C(...i);
131
+ }), z = n(() => {
132
+ if (!(a.label || s["aria-label"]))
133
+ return a.placeholder || void 0;
134
+ }), S = M(null), P = (i) => {
135
+ i.target.closest("button") || S.value?.focus();
133
136
  };
134
- return (i, $) => (s(), p("div", {
135
- class: w(["phila-input", g.value])
137
+ return (i, O) => (o(), p("div", {
138
+ class: A(["phila-input", y.value])
136
139
  }, [
137
- t.label ? (s(), p("label", {
140
+ a.label ? (o(), p("label", {
138
141
  key: 0,
139
- for: d.value,
142
+ for: c.value,
140
143
  class: "has-text-label-small phila-label"
141
- }, m(t.label), 9, X)) : y("", !0),
142
- x("div", {
143
- class: w(["phila-text-field", T.value]),
144
- onClick: A
144
+ }, m(a.label), 9, Y)) : g("", !0),
145
+ k("div", {
146
+ class: A(["phila-text-field", u.value]),
147
+ onClick: P
145
148
  }, [
146
- x("div", Y, [
147
- t.leadingIcon ? (s(), z(l(R), {
149
+ k("div", Z, [
150
+ a.leadingIcon ? (o(), N(l(L), {
148
151
  key: 0,
149
- "icon-class": t.leadingIcon,
152
+ "icon-class": a.leadingIcon,
150
153
  inline: "",
151
154
  decorative: ""
152
- }, null, 8, ["icon-class"])) : y("", !0),
153
- x("div", Z, [
154
- x("div", ee, [
155
- q(x("input", b({
156
- id: d.value,
155
+ }, null, 8, ["icon-class"])) : g("", !0),
156
+ k("div", ee, [
157
+ k("div", ae, [
158
+ j(k("input", x({
159
+ id: c.value,
157
160
  ref_key: "inputRef",
158
- ref: D,
159
- "onUpdate:modelValue": $[0] || ($[0] = (S) => n.value = S),
161
+ ref: S,
162
+ "onUpdate:modelValue": O[0] || (O[0] = (w) => f.value = w),
160
163
  class: "phila-text-field-input has-text-body-default",
161
- placeholder: t.placeholder
162
- }, l(r)), null, 16, te), [
163
- [E, n.value]
164
+ placeholder: a.placeholder,
165
+ "aria-label": z.value
166
+ }, l(s)), null, 16, te), [
167
+ [K, f.value]
164
168
  ])
165
169
  ])
166
170
  ]),
167
- n.value != "" ? (s(), z(l(F), {
171
+ f.value != "" ? (o(), N(l(H), {
168
172
  key: 1,
169
173
  variant: "standard",
170
174
  size: "small",
171
175
  "icon-only": "",
172
- "icon-definition": l(W),
173
- onClick: $[1] || ($[1] = (S) => n.value = "")
174
- }, null, 8, ["icon-definition"])) : y("", !0),
175
- t.trailingIcon ? (s(), z(l(R), {
176
+ "icon-definition": l(X),
177
+ onClick: O[1] || (O[1] = (w) => f.value = "")
178
+ }, null, 8, ["icon-definition"])) : g("", !0),
179
+ a.trailingIcon ? (o(), N(l(L), {
176
180
  key: 2,
177
181
  size: "small",
178
- "icon-class": t.trailingIcon,
182
+ "icon-class": a.trailingIcon,
179
183
  inline: "",
180
184
  decorative: ""
181
- }, null, 8, ["icon-class"])) : y("", !0),
182
- k(i.$slots, "trailing-action")
185
+ }, null, 8, ["icon-class"])) : g("", !0),
186
+ V(i.$slots, "trailing-action")
183
187
  ])
184
188
  ], 2),
185
- t.supportingText ? (s(), p("div", ae, m(t.supportingText), 1)) : y("", !0),
186
- c.value ? (s(), p("div", le, [
187
- v(l(R), {
188
- "icon-definition": l(J),
189
+ a.supportingText ? (o(), p("div", le, m(a.supportingText), 1)) : g("", !0),
190
+ r.value ? (o(), p("div", ie, [
191
+ h(l(L), {
192
+ "icon-definition": l(Q),
189
193
  size: "small",
190
194
  inline: "",
191
195
  decorative: ""
192
196
  }, null, 8, ["icon-definition"]),
193
- N(" " + m(c.value), 1)
194
- ])) : y("", !0)
197
+ $(" " + m(r.value), 1)
198
+ ])) : g("", !0)
195
199
  ], 2));
196
200
  }
197
- }), ne = ["disabled"], se = /* @__PURE__ */ O({
201
+ }), se = ["disabled"], oe = /* @__PURE__ */ D({
198
202
  inheritAttrs: !1,
199
203
  __name: "PhlButton",
200
204
  props: {
@@ -215,25 +219,25 @@ const X = ["for"], Y = { class: "state-layer" }, Z = { class: "content" }, ee =
215
219
  src: {},
216
220
  svgRaw: {}
217
221
  },
218
- setup(u) {
219
- const e = u, r = (a) => "href" in a && a.href !== void 0 || "to" in a && a.to !== void 0, t = o(() => V(
222
+ setup(d) {
223
+ const e = d, s = (t) => "href" in t && t.href !== void 0 || "to" in t && t.to !== void 0, a = n(() => C(
220
224
  "phila-button",
221
225
  `phila-button--${e.variant}`,
222
226
  e.size && `is-${e.size}`,
223
227
  e.iconOnly && "icon-button",
224
228
  e.iconOnly && e.variant === "standard" && "icon-button--standard",
225
229
  e.className
226
- )), c = o(() => r(e) ? "to" in e && e.to !== void 0 ? {
230
+ )), r = n(() => s(e) ? "to" in e && e.to !== void 0 ? {
227
231
  to: e.to,
228
232
  disabled: e.disabled,
229
- className: t.value
233
+ className: a.value
230
234
  } : {
231
235
  href: e.href,
232
236
  target: e.target,
233
237
  rel: e.rel,
234
238
  disabled: e.disabled,
235
- className: t.value
236
- } : {}), d = o(
239
+ className: a.value
240
+ } : {}), c = n(
237
241
  () => ({
238
242
  iconDefinition: e.iconDefinition,
239
243
  iconClass: e.iconClass,
@@ -244,35 +248,35 @@ const X = ["for"], Y = { class: "state-layer" }, Z = { class: "content" }, ee =
244
248
  size: e.size
245
249
  })
246
250
  );
247
- return (a, f) => r(e) ? (s(), z(l(M), b({ key: 0 }, { ...c.value, ...a.$attrs }, { role: "button" }), {
248
- default: h(() => [
249
- v(l(B), C(_(d.value)), {
250
- default: h(() => [
251
- k(a.$slots, "default", {}, () => [
252
- N(m(e.text), 1)
251
+ return (t, b) => s(e) ? (o(), N(l(T), x({ key: 0 }, { ...r.value, ...t.$attrs }, { role: "button" }), {
252
+ default: v(() => [
253
+ h(l(R), _(B(c.value)), {
254
+ default: v(() => [
255
+ V(t.$slots, "default", {}, () => [
256
+ $(m(e.text), 1)
253
257
  ])
254
258
  ]),
255
259
  _: 3
256
260
  }, 16)
257
261
  ]),
258
262
  _: 3
259
- }, 16)) : (s(), p("button", b({
263
+ }, 16)) : (o(), p("button", x({
260
264
  key: 1,
261
265
  type: "button",
262
266
  disabled: e.disabled,
263
- class: t.value
264
- }, a.$attrs), [
265
- v(l(B), C(_(d.value)), {
266
- default: h(() => [
267
- k(a.$slots, "default", {}, () => [
268
- N(m(e.text), 1)
267
+ class: a.value
268
+ }, t.$attrs), [
269
+ h(l(R), _(B(c.value)), {
270
+ default: v(() => [
271
+ V(t.$slots, "default", {}, () => [
272
+ $(m(e.text), 1)
269
273
  ])
270
274
  ]),
271
275
  _: 3
272
276
  }, 16)
273
- ], 16, ne));
277
+ ], 16, se));
274
278
  }
275
- }), ce = /* @__PURE__ */ O({
279
+ }), de = /* @__PURE__ */ D({
276
280
  inheritAttrs: !1,
277
281
  __name: "Search",
278
282
  props: {
@@ -281,37 +285,38 @@ const X = ["for"], Y = { class: "state-layer" }, Z = { class: "content" }, ee =
281
285
  className: {}
282
286
  },
283
287
  emits: ["update:modelValue", "search"],
284
- setup(u, { emit: e }) {
285
- const r = I(), t = u, c = e, d = o({
286
- get: () => t.modelValue,
287
- set: (f) => c("update:modelValue", f)
288
- }), a = o(() => V("default-class", t.className));
289
- return (f, n) => (s(), p("div", b({
290
- class: ["search", a.value]
291
- }, l(r)), [
292
- v(l(ie), {
293
- modelValue: d.value,
294
- "onUpdate:modelValue": n[1] || (n[1] = (g) => d.value = g),
288
+ setup(d, { emit: e }) {
289
+ const s = I(), a = d, r = e, c = n({
290
+ get: () => a.modelValue,
291
+ set: (y) => r("update:modelValue", y)
292
+ }), t = n(() => s["aria-label"]), b = n(() => Object.fromEntries(Object.entries(s).filter(([y]) => y !== "aria-label"))), f = n(() => C("default-class", a.className));
293
+ return (y, u) => (o(), p("div", x({
294
+ class: ["search", f.value]
295
+ }, b.value), [
296
+ h(l(ne), {
297
+ modelValue: c.value,
298
+ "onUpdate:modelValue": u[1] || (u[1] = (z) => c.value = z),
295
299
  "class-name": "phila-text-field--search",
296
- placeholder: u.placeholder,
297
- onKeydown: n[2] || (n[2] = K((g) => c("search"), ["enter"]))
300
+ placeholder: d.placeholder,
301
+ "aria-label": t.value,
302
+ onKeydown: u[2] || (u[2] = U((z) => r("search"), ["enter"]))
298
303
  }, {
299
- "trailing-action": h(() => [
300
- v(l(se), {
304
+ "trailing-action": v(() => [
305
+ h(l(oe), {
301
306
  variant: "standard",
302
307
  size: "small",
303
308
  "icon-only": "",
304
309
  "icon-definition": l(G),
305
310
  "aria-label": "Search",
306
311
  "class-name": "phila-button--search",
307
- onClick: n[0] || (n[0] = (g) => c("search"))
312
+ onClick: u[0] || (u[0] = (z) => r("search"))
308
313
  }, null, 8, ["icon-definition"])
309
314
  ]),
310
315
  _: 1
311
- }, 8, ["modelValue", "placeholder"])
316
+ }, 8, ["modelValue", "placeholder", "aria-label"])
312
317
  ], 16));
313
318
  }
314
319
  });
315
320
  export {
316
- ce as Search
321
+ de as Search
317
322
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-search",
3
- "version": "1.1.1-beta.0",
3
+ "version": "1.1.1-beta.1",
4
4
  "type": "module",
5
5
  "description": "a search bar",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@phila/phila-ui-core": "2.3.1-beta.0",
36
- "@phila/phila-ui-text-field": "1.1.1-beta.0",
36
+ "@phila/phila-ui-text-field": "1.1.1-beta.1",
37
37
  "@phila/phila-ui-button": "2.2.1-beta.0"
38
38
  },
39
39
  "devDependencies": {