@phila/phila-ui-switch 0.0.5-beta.0 → 0.0.5-beta.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.vue.d.ts","sourceRoot":"","sources":["../src/Switch.vue"],"names":[],"mappings":"AAyMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA6F3C,iBAAS,cAAc;WAgET,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;oBAWnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Switch.vue.d.ts","sourceRoot":"","sources":["../src/Switch.vue"],"names":[],"mappings":"AAoMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA6F3C,iBAAS,cAAc;WAgET,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;oBAWnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .switch[data-v-752a1efa]{display:inline-flex;align-items:center;cursor:pointer;position:relative}.switch--disabled[data-v-752a1efa]{cursor:not-allowed;opacity:.6}.switch-input[data-v-752a1efa]{position:absolute;opacity:0;width:0;height:0;margin:0;padding:0;border:none;outline:none}.switch-track[data-v-752a1efa]{display:inline-block;position:relative;background:var(--Schemes-Surface-Container-Highest, #ababab);transition:background-color .2s ease;display:flex;width:2rem;height:1.125rem;padding:var(--scale-xxsmall, .125rem);justify-content:flex-end;align-items:center;border-radius:var(--Radius-scale-radius-xl, 2rem);box-sizing:border-box}.switch-thumb[data-v-752a1efa]{width:.875rem;height:.875rem;flex-shrink:0;background-color:var(--Schemes-On-Primary, #ffffff);border-radius:var(--Radius-scale-radius-xl, 2rem);box-sizing:border-box;position:absolute;top:50%;left:var(--scale-xxsmall, .125rem);transform:translateY(-50%);transition:transform .2s ease}.switch-label[data-v-752a1efa]{padding-left:var(--scale-small, .5rem);color:var(--Schemes-On-Surface, #000);font-family:var(--Body-Default-font-body-default-family, Montserrat);font-size:var(--Body-Default-font-body-default-size, 1rem);font-style:normal;font-weight:400;line-height:var(--Body-Default-font-body-default-lineheight, 1.5rem)}.switch--checked .switch-track[data-v-752a1efa]{background:var(--Schemes-Primary, #003282)}.switch--checked .switch-thumb[data-v-752a1efa]{transform:translateY(-50%) translate(calc(2rem - .875rem - var(--scale-xxsmall, .125rem) - var(--scale-xxsmall, .125rem)))}.switch-input:focus+.switch-track[data-v-752a1efa]{outline:2px solid var(--Schemes-Primary, #003282);outline-offset:2px}.switch--disabled .switch-track[data-v-752a1efa]{background:var(--Schemes-Surface-Container, #e2e2e2)}.switch--disabled .switch-thumb[data-v-752a1efa]{background-color:var(--Schemes-On-Inverse-Surface, #f1f1f1)}.switch--disabled .switch-label[data-v-752a1efa]{color:var(--Schemes-Surface-Container-Highest, #ababab)}
1
+ .switch[data-v-54324aae]{display:inline-flex;align-items:center;cursor:pointer;position:relative}.switch--disabled[data-v-54324aae]{cursor:not-allowed;opacity:.6}.switch-input[data-v-54324aae]{position:absolute;opacity:0;width:0;height:0;margin:0;padding:0;border:none;outline:none}.switch-track[data-v-54324aae]{display:inline-block;position:relative;background:var(--Schemes-Surface-Container);transition:background-color .2s ease;display:flex;width:2rem;height:1.125rem;padding:var(--scale-25);justify-content:flex-end;align-items:center;border-radius:var(--border-radius-2xl);box-sizing:border-box}.switch-thumb[data-v-54324aae]{width:.875rem;height:.875rem;flex-shrink:0;background-color:var(--Schemes-On-Primary, #ffffff);border-radius:var(--border-radius-2xl);box-sizing:border-box;position:absolute;top:50%;left:var(--scale-25);transform:translateY(-50%);transition:transform .2s ease}.switch-label[data-v-54324aae]{padding-left:var(--scale-100);color:var(--Schemes-On-Surface, #000);font-family:var(--Body-Default-font-body-default-family, Montserrat);font-size:var(--Body-Default-font-body-default-size, 1rem);font-style:normal;font-weight:400;line-height:var(--Body-Default-font-body-default-lineheight, 1.5rem)}.switch--checked .switch-track[data-v-54324aae]{background:var(--Schemes-Primary, #003282)}.switch--checked .switch-thumb[data-v-54324aae]{transform:translateY(-50%) translate(calc(2rem - .875rem - var(--scale-25) - var(--scale-25)))}.switch-input:focus+.switch-track[data-v-54324aae]{outline:2px solid var(--Schemes-Primary, #003282);outline-offset:2px}.switch--disabled .switch-track[data-v-54324aae]{background:var(--Schemes-Surface-Container-Low)}.switch--disabled .switch-label[data-v-54324aae]{color:var(--Schemes-On-Surface-Low)}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),r=require("@phila/phila-ui-core"),v=["for"],w=["id","name","checked","disabled","autofocus","aria-label","aria-labelledby","value"],y=["id"],V=e.defineComponent({__name:"Switch",props:{id:{default:()=>r.generateRandomId("switch-input")},name:{default:"switch-input"},modelValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:!0},offValue:{type:[String,Number,Boolean],default:!1},autofocus:{type:Boolean,default:!1},ariaLabel:{default:"Switch input"},className:{}},emits:["update:modelValue","change","focus","blur"],setup(a,{expose:u,emit:c}){const t=a,o=c,n=e.ref(),s=e.computed(()=>typeof t.modelValue=="boolean"?t.modelValue:t.modelValue===t.value),f=e.computed(()=>s.value?t.value:t.offValue),m=l=>{const i=l.target.checked?t.value:t.offValue;o("update:modelValue",i),o("change",i,l)},b=l=>{o("focus",l)},h=l=>{o("blur",l)};u({focus:async()=>{await e.nextTick(),n.value?.focus()},blur:async()=>{await e.nextTick(),n.value?.blur()}});const p=e.computed(()=>r.cn("switch",s.value&&"switch--checked",t.disabled&&"switch--disabled",t.className));return(l,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(p.value),for:a.id},[e.createElementVNode("input",{id:a.id,ref_key:"inputRef",ref:n,name:a.name,type:"checkbox",checked:s.value,disabled:a.disabled,autofocus:a.autofocus,"aria-label":a.ariaLabel,"aria-labelledby":`${a.id}-label`,value:f.value,class:"switch-input",onChange:m,onFocus:b,onBlur:h},null,40,w),d[0]||(d[0]=e.createElementVNode("span",{class:"switch-track"},[e.createElementVNode("span",{class:"switch-thumb"})],-1)),e.createElementVNode("span",{id:`${a.id}-label`,class:"switch-label"},[e.renderSlot(l.$slots,"default",{},void 0,!0)],8,y)],10,v))}}),g=(a,u)=>{const c=a.__vccOpts||a;for(const[t,o]of u)c[t]=o;return c},k=g(V,[["__scopeId","data-v-752a1efa"]]);exports.Switch=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),r=require("@phila/phila-ui-core"),v=["for"],w=["id","name","checked","disabled","autofocus","aria-label","aria-labelledby","value"],y=["id"],V=e.defineComponent({__name:"Switch",props:{id:{default:()=>r.generateRandomId("switch-input")},name:{default:"switch-input"},modelValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:!0},offValue:{type:[String,Number,Boolean],default:!1},autofocus:{type:Boolean,default:!1},ariaLabel:{default:"Switch input"},className:{}},emits:["update:modelValue","change","focus","blur"],setup(a,{expose:u,emit:c}){const t=a,o=c,n=e.ref(),s=e.computed(()=>typeof t.modelValue=="boolean"?t.modelValue:t.modelValue===t.value),f=e.computed(()=>s.value?t.value:t.offValue),m=l=>{const i=l.target.checked?t.value:t.offValue;o("update:modelValue",i),o("change",i,l)},b=l=>{o("focus",l)},h=l=>{o("blur",l)};u({focus:async()=>{await e.nextTick(),n.value?.focus()},blur:async()=>{await e.nextTick(),n.value?.blur()}});const p=e.computed(()=>r.cn("switch",s.value&&"switch--checked",t.disabled&&"switch--disabled",t.className));return(l,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(p.value),for:a.id},[e.createElementVNode("input",{id:a.id,ref_key:"inputRef",ref:n,name:a.name,type:"checkbox",checked:s.value,disabled:a.disabled,autofocus:a.autofocus,"aria-label":a.ariaLabel,"aria-labelledby":`${a.id}-label`,value:f.value,class:"switch-input",onChange:m,onFocus:b,onBlur:h},null,40,w),d[0]||(d[0]=e.createElementVNode("span",{class:"switch-track"},[e.createElementVNode("span",{class:"switch-thumb"})],-1)),e.createElementVNode("span",{id:`${a.id}-label`,class:"switch-label"},[e.renderSlot(l.$slots,"default",{},void 0,!0)],8,y)],10,v))}}),g=(a,u)=>{const c=a.__vccOpts||a;for(const[t,o]of u)c[t]=o;return c},k=g(V,[["__scopeId","data-v-54324aae"]]);exports.Switch=k;
package/dist/index.mjs CHANGED
@@ -69,7 +69,7 @@ import './index.css';const x = ["for"], C = ["id", "name", "checked", "disabled"
69
69
  for (const [a, l] of u)
70
70
  o[a] = l;
71
71
  return o;
72
- }, O = /* @__PURE__ */ E($, [["__scopeId", "data-v-752a1efa"]]);
72
+ }, O = /* @__PURE__ */ E($, [["__scopeId", "data-v-54324aae"]]);
73
73
  export {
74
74
  O as Switch
75
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-switch",
3
- "version": "0.0.5-beta.0",
3
+ "version": "0.0.5-beta.2",
4
4
  "type": "module",
5
5
  "description": "City of Philadelphia switch input component",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "vue": "^3.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@phila/phila-ui-core": "2.3.3-beta.0"
31
+ "@phila/phila-ui-core": "2.4.0-beta.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^24.0.0",