najwer23morsels 0.20.0 → 0.20.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.
Files changed (2) hide show
  1. package/lib/Select.js +1 -1
  2. package/package.json +1 -1
package/lib/Select.js CHANGED
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n,useId as r,useMemo as l}from"react";import{I as a}from"./Input-CLpVviKw.js";import{s as i}from"./style-inject.es-CrVRO2OA.js";import"./TextBox-CWSg4nm8.js";import"./Validator.js";var s={n23mSelect:"Select-module_n23mSelect__2Xjs2",icon:"Select-module_icon__EyueR",iconRotate:"Select-module_iconRotate__IuY-d",dropdownWrapper:"Select-module_dropdownWrapper__4xq1b",open:"Select-module_open__r2R21",dropdown:"Select-module_dropdown__cDzJX",dropdownItem:"Select-module_dropdownItem__RBpMK"};i('@layer n23mSelect{.Select-module_n23mSelect__2Xjs2{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;position:relative;& input{cursor:pointer;padding-right:40px}.Select-module_icon__EyueR{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" xml:space="preserve"><g style="stroke:none;stroke-width:1px;fill-rule:nonzero;opacity:1"><path d="M90 24.25a3.499 3.499 0 0 0-5.974-2.475L45 60.8 5.975 21.775a3.5 3.5 0 1 0-4.95 4.95l41.5 41.5a3.499 3.499 0 0 0 4.949 0l41.5-41.5A3.487 3.487 0 0 0 90 24.25z" style="stroke:none;stroke-width:1" transform="matrix(2.81 0 0 2.81 1.407 1.407)"/></g></svg>\') no-repeat 100%;background-position:calc(100% - 10px) 50%;background-size:18px;cursor:pointer;display:inline-block;height:40px;position:absolute;right:2px;top:22px;transform:rotate(0deg);transition:transform .1s ease-in-out;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:40px;&.Select-module_iconRotate__IuY-d{transform:rotate(180deg);transition:transform .1s ease-in-out}}.Select-module_dropdownWrapper__4xq1b{background-color:#fff;border-radius:5px;display:none;margin-top:65px;position:absolute;top:0;width:100%;z-index:3;&.Select-module_open__r2R21{display:block}.Select-module_dropdown__cDzJX{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:#fff;border-radius:5px;box-shadow:0 4px 8px 0 rgba(0,0,0,.24),0 6px 20px 0 rgba(0,0,0,.19);cursor:pointer;max-height:200px;overflow-y:auto;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;&:has(.Select-module_dropdownItem__RBpMK){border:1px solid var(--input-cb,#000)}.Select-module_dropdownItem__RBpMK{background:#fff;border-bottom:1px solid var(--input-cb,#000);box-sizing:border-box;color:var(--input-c,#000);font-family:var(--n23mFontFamily,var(--iff));font-size:16px;font-weight:500;padding:10px;width:100%;&:hover{background-color:#f5f5f5}&:not(:first-child){border-top:none}&:last-child{border-bottom:unset}}}}}}');const d=({className:i,name:d,disabled:p,style:c,options:u,initialValue:m,validatorOptions:b,placeholder:h,onBlur:_,label:x="Select",...f})=>{const[g,w]=t(m?.label??""),[v,k]=t(m?.value??""),[y,S]=t(!1),j=n(null),R=r(),I=l(()=>u.filter(e=>e.label.toLowerCase().includes(g.toLowerCase())),[u,g]);return e("div",{className:[s.n23mSelect,"n23mSelect",i].filter(Boolean).join(" "),...f,style:{...c},children:[o("div",{className:[s.icon,y?s.iconRotate:""].join(" "),onMouseDown:e=>{e.preventDefault(),j.current?.focus(),S(e=>!e)}}),o(a,{name:d,type:"hidden",kind:"input",validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"value"}}],value:v}),o(a,{id:R,inputRef:j,label:x,type:"text",kind:"select",disabled:p,placeholder:h,value:g,onChange:e=>{const o=e.currentTarget.value;w(o),k(""),S(!0)},onClick:()=>{S(e=>!e),w(""),k("")},onBlur:e=>{S(!1),_?.(e,{value:v,label:g})},validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"label"}}],"aria-autocomplete":"list","aria-expanded":y,"aria-controls":`${d}-listbox`,role:"combobox"}),o("div",{className:[s.dropdownWrapper,y?s.open:""].join(" "),children:o("div",{className:[s.dropdown].join(" "),children:I.map(e=>o("div",{className:s.dropdownItem,onMouseDown:o=>{(e=>{k(e.value),w(e.label),S(!1)})(e)},children:e.label},e.value))})})]})};export{d as Select};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useRef as n,useId as r,useMemo as l}from"react";import{I as a}from"./Input-CLpVviKw.js";import{s as i}from"./style-inject.es-CrVRO2OA.js";import"./TextBox-CWSg4nm8.js";import"./Validator.js";var s={n23mSelect:"Select-module_n23mSelect__2Xjs2",icon:"Select-module_icon__EyueR",iconRotate:"Select-module_iconRotate__IuY-d",dropdownWrapper:"Select-module_dropdownWrapper__4xq1b",open:"Select-module_open__r2R21",dropdown:"Select-module_dropdown__cDzJX",dropdownItem:"Select-module_dropdownItem__RBpMK"};i('@layer n23mSelect{.Select-module_n23mSelect__2Xjs2{--iff:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;position:relative;& input{cursor:pointer;padding-right:40px}.Select-module_icon__EyueR{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" xml:space="preserve"><g style="stroke:none;stroke-width:1px;fill-rule:nonzero;opacity:1"><path d="M90 24.25a3.499 3.499 0 0 0-5.974-2.475L45 60.8 5.975 21.775a3.5 3.5 0 1 0-4.95 4.95l41.5 41.5a3.499 3.499 0 0 0 4.949 0l41.5-41.5A3.487 3.487 0 0 0 90 24.25z" style="stroke:none;stroke-width:1" transform="matrix(2.81 0 0 2.81 1.407 1.407)"/></g></svg>\') no-repeat 100%;background-position:calc(100% - 10px) 50%;background-size:18px;cursor:pointer;display:inline-block;height:40px;position:absolute;right:2px;top:22px;transform:rotate(0deg);transition:transform .1s ease-in-out;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:40px;&.Select-module_iconRotate__IuY-d{transform:rotate(180deg);transition:transform .1s ease-in-out}}.Select-module_dropdownWrapper__4xq1b{background-color:#fff;border-radius:5px;display:none;margin-top:65px;position:absolute;top:0;width:100%;z-index:3;&.Select-module_open__r2R21{display:block}.Select-module_dropdown__cDzJX{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background:#fff;border-radius:5px;box-shadow:0 4px 8px 0 rgba(0,0,0,.24),0 6px 20px 0 rgba(0,0,0,.19);cursor:pointer;max-height:200px;overflow-y:auto;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;&:has(.Select-module_dropdownItem__RBpMK){border:1px solid var(--input-cb,#000)}.Select-module_dropdownItem__RBpMK{background:#fff;border-bottom:1px solid var(--input-cb,#000);box-sizing:border-box;color:var(--input-c,#000);font-family:var(--n23mFontFamily,var(--iff));font-size:16px;font-weight:500;padding:10px;width:100%;&:hover{background-color:#f5f5f5}&:not(:first-child){border-top:none}&:last-child{border-bottom:unset}}}}}}');const d=({className:i,name:d,disabled:p,style:c,options:u,initialValue:m,validatorOptions:b,placeholder:h,onBlur:_,label:x="Select",...f})=>{const[g,w]=t(m?.label??""),[v,k]=t(m?.value??""),[y,S]=t(!1),j=n(null),R=r(),I=l(()=>u.filter(e=>e.label.toLowerCase().includes(g.toLowerCase())),[u,g]);return e("div",{className:[s.n23mSelect,"n23mSelect",i].filter(Boolean).join(" "),...f,style:{...c},children:[o("div",{className:[s.icon,y?s.iconRotate:""].join(" "),onMouseDown:e=>{e.preventDefault(),j.current?.focus(),S(e=>!e),w(""),k("")}}),o(a,{name:d,type:"hidden",kind:"input",validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"value"}}],value:v}),o(a,{id:R,inputRef:j,label:x,type:"text",kind:"select",disabled:p,placeholder:h,value:g,onChange:e=>{const o=e.currentTarget.value;w(o),k(""),S(!0)},onClick:()=>{S(e=>!e),w(""),k("")},onBlur:e=>{S(!1),_?.(e,{value:v,label:g})},validatorOptions:[...b??[],{type:"existsInOptions",options:{options:u,matchBy:"label"}}],"aria-autocomplete":"list","aria-expanded":y,"aria-controls":`${d}-listbox`,role:"combobox"}),o("div",{className:[s.dropdownWrapper,y?s.open:""].join(" "),children:o("div",{className:[s.dropdown].join(" "),children:I.map(e=>o("div",{className:s.dropdownItem,onMouseDown:o=>{(e=>{k(e.value),w(e.label),S(!1)})(e)},children:e.label},e.value))})})]})};export{d as Select};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najwer23morsels",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.ts",