amotify 0.2.205 → 0.2.206

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
- import{b as o,c as l,d as D}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as z}from"react/jsx-runtime";import{UUID as S}from"jmini";import{useState as M}from"react";import I from"../../atoms/Box";import{Row as U}from"../../mols";import{Label as A}from"../Button";import{OptionalInputWrapper as W,BoxWrapper as P,CoreEffects as N}from"./core";import{InputSwitchClasses as g}from"../../@styles/componentClasses";function H(e){let{value:n,states:s}=e,{required:x}=s,r=[];return x&&!n&&r.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!r.filter(({type:f})=>f=="invalid").length,notice:r}}const O=e=>{let B=e,{componentId:n,color:s="posi",required:x,form:r,id:f,enableFormSubmit:E,checkValidationAtFirst:q,onChange:F,onKeyDown:T,onValidate:K,onValidateDelay:$,onUpdateValue:G,onUpdateValidValue:J,onUserAction:Q,size:R="regular",value:L="",icon:V="",isApply:p=!1}=B,t=D(B,["componentId","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","size","value","icon","isApply"]),[u,c]=M({componentId:e.componentId||"",dataValue:L,eventType:"init",eventID:S()}),[v,k]=M({ok:!1,notice:[]}),d=!!u.dataValue;N.CommonEffects({type:"switch",states:e,val_status:u,set_status:c,val_validate:v,set_validate:k,SystemValidation:H});let y="middle",w=5,C=3;return p&&(C=4),z(P,{val_status:u,set_status:c,val_validate:v,states:e,children:[a(I,l(o({htmlTag:"input",type:"checkbox","data-component-id":u.componentId,checked:u.dataValue,className:g("Input"),id:f,onKeyDown:i=>{T&&T(i),E&&N.SubmitForm(i,r)},onChange:i=>{let{checked:m}=i.target;v.ok&&k({ok:!1,notice:[]}),c(_=>l(o({},_),{dataValue:m,eventType:"update",eventID:S()})),F&&F(i)}},t),{onFocus:i=>{t!=null&&t.onFocus&&(t==null||t.onFocus(i)),c(m=>l(o({},m),{eventID:S(),isFocusing:!0}))},onBlur:i=>{t!=null&&t.onBlur&&(t==null||t.onBlur(i)),c(m=>l(o({},m),{eventID:S(),isFocusing:!1}))}})),a(A.Plain,{tabIndex:-1,htmlFor:f,padding:"1/4",transition:y,borderRadius:"1.tone.primary",className:g("Label"),children:a(I,l(o({},p?{padding:"1/4",isRounded:!0,backgroundColor:d?s:"layer.3"}:{}),{children:z(U.Center,{unitHeight:R=="small"?2:R=="regular"?2.5:R=="large"?3:0,position:"relative",freeCSS:{aspectRatio:(w+C)/w},children:[!p&&a(I,{position:"absolute",backgroundColor:d?s:"layer.5",isRounded:!0,transition:y,width:1,opacity:"middle",className:g("Bar"),freeCSS:{height:"40%"}}),a(I,{position:"absolute",top:0,backgroundColor:!p&&d?s:"white",transition:y,isRounded:!0,flexCenter:!0,boxShadow:"1.remark",className:g("Dot"),freeCSS:{height:"100%",aspectRatio:"1",left:d?`calc(${C.ratio(w+C)}%)`:0},children:V&&a(I,{transition:y,flexCenter:!0,fontColor:d?p?s:"white":"6.clear",children:V})})]})}))})]})},b=e=>{let n=o({},e);return n.value=!!n.value,n.color=n.color||"theme",a(W,{componentId:n.componentId,children:O,states:n})},h=b;h.S=e=>a(b,l(o({},e),{size:"small"})),h.R=e=>a(b,l(o({},e),{size:"regular"})),h.L=e=>a(b,l(o({},e),{size:"large"}));export{h as Switch,h as default};
1
+ import{b as a,c as i,d as V}from"../../chunk-C5N2D3ZX.js";import{jsx as t,jsxs as U}from"react/jsx-runtime";import{UUID as k}from"jmini";import{useState as D}from"react";import c from"../../atoms/Box";import{Row as L}from"../../mols";import{Label as A}from"../Button";import{OptionalInputWrapper as W,BoxWrapper as P,CoreEffects as B}from"./core";import{InputSwitchClasses as f}from"../../@styles/componentClasses";function H(e){let{value:o,states:n}=e,{required:b}=n,s=[];return b&&!o&&s.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!s.filter(({type:m})=>m=="invalid").length,notice:s}}const O=e=>{let T=e,{componentId:o,color:n="posi",required:b,form:s,id:m,enableFormSubmit:M,checkValidationAtFirst:q,onChange:R,onKeyDown:w,onValidate:K,onValidateDelay:$,onUpdateValue:G,onUpdateValidValue:J,onUserAction:Q,size:C="regular",value:_="",icon:x="",isApply:l=!1}=T,N=V(T,["componentId","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","size","value","icon","isApply"]),[r,S]=D({componentId:e.componentId||"",dataValue:_,eventType:"init",eventID:k()}),[v,F]=D({ok:!1,notice:[]}),p=!!r.dataValue;B.CommonEffects({type:"switch",states:e,val_status:r,set_status:S,val_validate:v,set_validate:F,SystemValidation:H});let h="middle",g=5,I=3;return l&&(I=4),U(P,{val_status:r,set_status:S,val_validate:v,states:e,children:[t(c,a({htmlTag:"input",type:"checkbox","data-component-id":r.componentId,checked:r.dataValue,className:f("Input"),id:m,onKeyDown:u=>{w&&w(u),M&&B.SubmitForm(u,s)},onChange:u=>{let{checked:z}=u.target;v.ok&&F({ok:!1,notice:[]}),S(E=>i(a({},E),{dataValue:z,eventType:"update",eventID:k()})),R&&R(u)}},N)),t(A.Plain,{tabIndex:-1,htmlFor:m,padding:"1/4",transition:h,borderRadius:"1.tone.primary",className:f("Label"),children:t(c,i(a({},l?{padding:"1/4",isRounded:!0,backgroundColor:p?n:"layer.3"}:{}),{children:U(L.Center,{unitHeight:C=="small"?2:C=="regular"?2.5:C=="large"?3:0,position:"relative",freeCSS:{aspectRatio:(g+I)/g},children:[!l&&t(c,{position:"absolute",backgroundColor:p?n:"layer.5",isRounded:!0,transition:h,width:1,opacity:"middle",className:f("Bar"),freeCSS:{height:"40%"}}),t(c,{position:"absolute",top:0,backgroundColor:!l&&p?n:"white",transition:h,isRounded:!0,flexCenter:!0,boxShadow:"1.remark",className:f("Dot"),freeCSS:{height:"100%",aspectRatio:"1",left:p?`calc(${I.ratio(g+I)}%)`:0},children:x&&t(c,{transition:h,flexCenter:!0,fontColor:p?l?n:"white":"6.clear",children:x})})]})}))})]})},y=e=>{let o=a({},e);return o.value=!!o.value,o.color=o.color||"theme",t(W,{componentId:o.componentId,children:O,states:o})},d=y;d.S=e=>t(y,i(a({},e),{size:"small"})),d.R=e=>t(y,i(a({},e),{size:"regular"})),d.L=e=>t(y,i(a({},e),{size:"large"}));export{d as Switch,d as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.2.205",
3
+ "version": "0.2.206",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",
@@ -90,7 +90,7 @@
90
90
  "@fortawesome/free-solid-svg-icons": "^6.7.2",
91
91
  "@fortawesome/react-fontawesome": "^0.2.2",
92
92
  "dotenv": "^17.0.1",
93
- "jmini": "^0.0.91",
93
+ "jmini": "^0.0.95",
94
94
  "react": "^18.3.1"
95
95
  },
96
96
  "devDependencies": {