@solibo/solibo-ui 1.0.17 → 1.0.18

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-Lq3pr85X.cjs"),X=require("../../index-lALToPBm.cjs"),pe=require("../list/index.cjs"),E=require("../../index-CXge5nFf.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function be(t){return a.isValidElement(t)&&t.type===a.Fragment}function _e(t){return a.isValidElement(t)&&t.type===E.Select}function W(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(be(n))s.push(...W(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function he(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function ye(t,i){const r=he(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function xe(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ge(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function je(t){if(_e(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const ve="_combobox_jkdyb_3",we="_dropdown_jkdyb_27",ke="_empty_jkdyb_30",Se="_group_jkdyb_31",Ne="_placeholder_jkdyb_32",Ce="_filter_jkdyb_40",Ee="_native_jkdyb_52",Ve="_option_jkdyb_62",Le="_options_jkdyb_84",Re="_panel_jkdyb_108",$e="_selected_jkdyb_132",Be="_text_jkdyb_136",Ie="_trigger_jkdyb_144",qe="_minimal_jkdyb_180",Pe="_inline_jkdyb_235",De="_label_jkdyb_267",o={combobox:ve,"combobox-input":"_combobox-input_jkdyb_12",dropdown:we,empty:ke,group:Se,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:qe,inline:Pe,label:De,"inline-field":"_inline-field_jkdyb_273"};function Y(t,i){return{"--icon-svg":de.iconSVG(t).replace("currentColor",i)}}const Fe=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=je(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,j=E.sanitizeSelectProps(ne),{className:re,...se}=j,M=a.useRef(null),Q=a.useRef(null),v=a.useId(),z=a.useRef(null),m=a.useRef(null),y=W(R.children),x=B!=null,I=ge(y,B,te),[q,P]=a.useState(()=>I),[u,p]=a.useState(!1),[w,k]=a.useState(""),S=x?String(B):q,O={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,N=xe(y,S),le=Y("chevron",T),oe=Y("search",T),A=ye(y,w),b=w.trim(),C=!!(r&&s&&b&&s.isValid(b)),ie=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===S,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===q)&&P(I)},[I,q,x,y]),a.useEffect(()=>{var e;if(!u){k("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=Q.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{x||P(e.target.value),$==null||$(e)},D=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;k(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(b),K())},ce=e=>{var U;x||P(e);const d=z.current;if(!d){D();return}const _=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;_==null||_.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():D()},ue=e=>{e.key==="Escape"&&D(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:g.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ue,ref:Q,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:g.t(o.native,re),onChange:ae,ref:z,tabIndex:-1,value:S,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":j["aria-label"]??c??L,className:o["combobox-input"],disabled:j.disabled,onChange:e=>{k(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${v} ${v}-value`:void 0,className:g.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:j.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${v}-value`,children:G(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>k(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:g.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":V(s.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(b)})})}),A.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:g.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:v,children:ie}),J]}):J};exports.Dropdown=Fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-Lq3pr85X.cjs"),X=require("../../index-BOiGSTKz.cjs"),pe=require("../list/index.cjs"),E=require("../../index-CXge5nFf.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function be(t){return a.isValidElement(t)&&t.type===a.Fragment}function _e(t){return a.isValidElement(t)&&t.type===E.Select}function W(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(be(n))s.push(...W(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function he(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function ye(t,i){const r=he(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function xe(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ge(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function je(t){if(_e(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const ve="_combobox_jkdyb_3",we="_dropdown_jkdyb_27",ke="_empty_jkdyb_30",Se="_group_jkdyb_31",Ne="_placeholder_jkdyb_32",Ce="_filter_jkdyb_40",Ee="_native_jkdyb_52",Ve="_option_jkdyb_62",Le="_options_jkdyb_84",Re="_panel_jkdyb_108",$e="_selected_jkdyb_132",Be="_text_jkdyb_136",Ie="_trigger_jkdyb_144",qe="_minimal_jkdyb_180",Pe="_inline_jkdyb_235",De="_label_jkdyb_267",o={combobox:ve,"combobox-input":"_combobox-input_jkdyb_12",dropdown:we,empty:ke,group:Se,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:qe,inline:Pe,label:De,"inline-field":"_inline-field_jkdyb_273"};function Y(t,i){return{"--icon-svg":de.iconSVG(t).replace("currentColor",i)}}const Fe=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=je(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,j=E.sanitizeSelectProps(ne),{className:re,...se}=j,M=a.useRef(null),Q=a.useRef(null),v=a.useId(),z=a.useRef(null),m=a.useRef(null),y=W(R.children),x=B!=null,I=ge(y,B,te),[q,P]=a.useState(()=>I),[u,p]=a.useState(!1),[w,k]=a.useState(""),S=x?String(B):q,O={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,N=xe(y,S),le=Y("chevron",T),oe=Y("search",T),A=ye(y,w),b=w.trim(),C=!!(r&&s&&b&&s.isValid(b)),ie=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===S,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===q)&&P(I)},[I,q,x,y]),a.useEffect(()=>{var e;if(!u){k("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=Q.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{x||P(e.target.value),$==null||$(e)},D=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;k(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(b),K())},ce=e=>{var U;x||P(e);const d=z.current;if(!d){D();return}const _=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;_==null||_.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():D()},ue=e=>{e.key==="Escape"&&D(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:g.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ue,ref:Q,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:g.t(o.native,re),onChange:ae,ref:z,tabIndex:-1,value:S,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":j["aria-label"]??c??L,className:o["combobox-input"],disabled:j.disabled,onChange:e=>{k(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${v} ${v}-value`:void 0,className:g.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:j.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${v}-value`,children:G(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>k(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:g.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":V(s.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(b)})})}),A.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:g.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:v,children:ie}),J]}):J};exports.Dropdown=Fe;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -3,7 +3,7 @@ import { t as v } from "../../classix-DG18itHa.js";
3
3
  import be, { Children as he, isValidElement as x, useRef as V, useId as _e, useState as Q, useEffect as z } from "react";
4
4
  import { Button as M } from "../button/index.js";
5
5
  import { i as ye } from "../../icons-BkaMeh-J.js";
6
- import { f as ge, I as ve } from "../../index-C-ESxR26.js";
6
+ import { f as ge, I as ve } from "../../index-DMGGDV9J.js";
7
7
  import { List as xe } from "../list/index.js";
8
8
  import { S as ke, s as we, r as ee } from "../../index-Rm3D-iwf.js";
9
9
  import '../../assets/index37.css';function I(t) {
@@ -1,4 +1,4 @@
1
- "use strict";require('../../assets/index39.css');var m0=Object.defineProperty;var b0=(n,e,t)=>e in n?m0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Gt=(n,e,t)=>b0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),q=require("react"),$s=require("react-dom"),Ur=require("../../classix-5H4IWnMA.cjs"),y0=require("../file/index.cjs"),Ue=require("../button/index.cjs"),_0=require("../dropzone/index.cjs"),ze=require("../icon/index.cjs"),Ws=require("../../index-lALToPBm.cjs"),x0=require("../toolbar/index.cjs");function v0(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const qu=v0(q);function hn(n){return{}}const mu={},w0={},Ia={},It={},tn={},Mn={},nn={},bu={},ii={},Rn={},Bn={},Ge={},Ji={},Xi={},S0={},Pa={},T0={},Da={},C0={},La={},Ma={},zr={},E0={},Ra={},Ba={},Fa={},k0={},N0={},A0={},Hs={},ja={},O0={},qa={},Ua={},I0={},yu={},Zi={},si={},P0={},D0={},mr={},br={},L0={},M0={},R0={},Fe=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,B0=Fe&&"documentMode"in document?document.documentMode:null,Pe=Fe&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_t=Fe&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!Fe||!("InputEvent"in window)||B0)&&"getTargetRanges"in new window.InputEvent("input"),_u=Fe&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Xn=Fe&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,F0=Fe&&/Android/.test(navigator.userAgent),za=Fe&&/^(?=.*Chrome).*/i.test(navigator.userAgent),j0=Fe&&F0&&za,Qi=Fe&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!za,Zn=1,wt=3,Dt=0,$a=1,sn=2,q0=0,U0=1,z0=2,Wr=4,Hr=8,Yi=128,$0=112|(3|Wr|Hr)|Yi,es=1,ts=2,ns=3,rs=4,us=5,is=6,xu=_u||Xn||Qi?" ":"​",rt=`
1
+ "use strict";require('../../assets/index39.css');var m0=Object.defineProperty;var b0=(n,e,t)=>e in n?m0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Gt=(n,e,t)=>b0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),q=require("react"),$s=require("react-dom"),Ur=require("../../classix-5H4IWnMA.cjs"),y0=require("../file/index.cjs"),Ue=require("../button/index.cjs"),_0=require("../dropzone/index.cjs"),ze=require("../icon/index.cjs"),Ws=require("../../index-BOiGSTKz.cjs"),x0=require("../toolbar/index.cjs");function v0(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const qu=v0(q);function hn(n){return{}}const mu={},w0={},Ia={},It={},tn={},Mn={},nn={},bu={},ii={},Rn={},Bn={},Ge={},Ji={},Xi={},S0={},Pa={},T0={},Da={},C0={},La={},Ma={},zr={},E0={},Ra={},Ba={},Fa={},k0={},N0={},A0={},Hs={},ja={},O0={},qa={},Ua={},I0={},yu={},Zi={},si={},P0={},D0={},mr={},br={},L0={},M0={},R0={},Fe=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,B0=Fe&&"documentMode"in document?document.documentMode:null,Pe=Fe&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_t=Fe&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!Fe||!("InputEvent"in window)||B0)&&"getTargetRanges"in new window.InputEvent("input"),_u=Fe&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Xn=Fe&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,F0=Fe&&/Android/.test(navigator.userAgent),za=Fe&&/^(?=.*Chrome).*/i.test(navigator.userAgent),j0=Fe&&F0&&za,Qi=Fe&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!za,Zn=1,wt=3,Dt=0,$a=1,sn=2,q0=0,U0=1,z0=2,Wr=4,Hr=8,Yi=128,$0=112|(3|Wr|Hr)|Yi,es=1,ts=2,ns=3,rs=4,us=5,is=6,xu=_u||Xn||Qi?" ":"​",rt=`
2
2
 
3
3
  `,W0=_t?" ":xu,Wa="֑-߿יִ-﷽ﹰ-ﻼ",Ha="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",H0=new RegExp("^[^"+Ha+"]*["+Wa+"]"),V0=new RegExp("^[^"+Wa+"]*["+Ha+"]"),Lt={bold:1,code:16,highlight:Yi,italic:2,strikethrough:Wr,subscript:32,superscript:64,underline:Hr},G0={directionless:1,unmergeable:2},Vs={center:ts,end:is,justify:rs,left:es,right:ns,start:us},K0={[ts]:"center",[is]:"end",[rs]:"justify",[es]:"left",[ns]:"right",[us]:"start"},J0={normal:0,segmented:2,token:1},X0={[q0]:"normal",[z0]:"segmented",[U0]:"token"};function Z0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R=Z0(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Vr(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Q0=100;let oi=!1,ss=0;function Y0(n){ss=n.timeStamp}function Uu(n,e,t){const r=n.nodeName==="BR",u=e.__lexicalLineBreak;return u&&(n===u||r&&n.previousSibling===u)||r&&wu(n,t)!==void 0}function ef(n,e,t){const r=Oe(t._window);let u=null,i=null;r!==null&&r.anchorNode===n&&(u=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&fs(e,s,u,i,!1)}function tf(n,e,t){if(D(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===wt&&t.isAttached()}function nf(n,e,t,r){for(let u=n;u&&!bf(u);u=Yn(u)){const i=wu(u,e);if(i!==void 0){const s=he(i,t);if(s)return re(s)?void 0:[u,s]}else if(u===r)return[r,el(t)]}}function Va(n,e,t){oi=!0;const r=performance.now()-ss>Q0;try{Ce(n,()=>{const u=j()||function(c){return c.getEditorState().read(()=>{const d=j();return d!==null?d.clone():null})}(n),i=new Map,s=n.getRootElement(),o=n._editorState,a=n._blockCursorElement;let l=!1,f="";for(let c=0;c<e.length;c++){const d=e[c],p=d.type,m=d.target,g=nf(m,n,o,s);if(!g)continue;const[y,b]=g;if(p==="characterData")r&&M(b)&&tf(u,m,b)&&ef(m,b,n);else if(p==="childList"){l=!0;const v=d.addedNodes;for(let S=0;S<v.length;S++){const I=v[S],T=Qa(I),P=I.parentNode;if(P!=null&&I!==a&&T===null&&!Uu(I,P,n)){if(_t){const $=I.innerText||I.nodeValue;$&&(f+=$)}P.removeChild(I)}}const w=d.removedNodes,C=w.length;if(C>0){let S=0;for(let I=0;I<C;I++){const T=w[I];(Uu(T,m,n)||a===T)&&(m.appendChild(T),S++)}C!==S&&i.set(y,b)}}}if(i.size>0)for(const[c,d]of i)d.reconcileObservedMutation(c,n);const h=t.takeRecords();if(h.length>0){for(let c=0;c<h.length;c++){const d=h[c],p=d.addedNodes,m=d.target;for(let g=0;g<p.length;g++){const y=p[g],b=y.parentNode;b==null||y.nodeName!=="BR"||Uu(y,m,n)||b.removeChild(y)}}t.takeRecords()}u!==null&&(l&&(u.dirty=!0,Ae(u)),_t&&ul(n)&&u.insertRawText(f))})}finally{oi=!1}}function Ga(n){const e=n._observer;e!==null&&Va(n,e.takeRecords(),e)}function Ka(n){(function(e){ss===0&&Tu(e).addEventListener("textInput",Y0,!0)})(n),n._observer=new MutationObserver((e,t)=>{Va(n,e,t)})}function Gs(n,e){const t=n.__mode,r=n.__format,u=n.__style,i=e.__mode,s=e.__format,o=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||u!==null&&u!==o)}function Ks(n,e){const t=n.mergeWithSibling(e),r=oe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Js(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&M(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Gs(e,r)){r=Ks(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&M(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Gs(r,t)){r=Ks(r,t);break}break}t.remove()}}else r.remove()}function Ja(n){return Xs(n.anchor),Xs(n.focus),n}function Xs(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,u;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),u=!0):(r=e.getChildAtIndex(t),u=!1),M(r)){n.set(r.__key,u?r.getTextContentSize():0,"text");break}if(!k(r))break;n.set(r.__key,u?r.getChildrenSize():0,"element")}}let rf=1;const uf=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function os(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return re(on(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&vu(e)==null)}function Qn(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!os(e)&&Xa(e)===n}catch{return!1}}function as(n){return n instanceof Au}function Xa(n){let e=n;for(;e!=null;){const t=vu(e);if(as(t))return t;e=Yn(e)}return null}function vu(n){return n?n.__lexicalEditor:null}function At(n){return n.isToken()||n.isSegmented()}function sf(n){return n.nodeType===wt}function Gr(n){let e=n;for(;e!=null;){if(sf(e))return e;e=e.firstChild}return null}function Kr(n,e,t){const r=Lt[e];if(t!==null&&(n&r)==(t&r))return n;let u=n^r;return e==="subscript"?u&=-65:e==="superscript"&&(u&=-33),u}function Za(n){return M(n)||xt(n)||re(n)}function of(n,e){if(e!=null)return void(n.__key=e);ve(),Tl();const t=oe(),r=ot(),u=""+rf++;r._nodeMap.set(u,n),k(n)?t._dirtyElements.set(u,!0):t._dirtyLeaves.add(u),t._cloneNotNeeded.add(u),t._dirtyType=$a,n.__key=u}function Pt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),u=n.getPreviousSibling(),i=n.getNextSibling();if(u===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=u.getWritable();if(i!==null){const o=i.getWritable();o.__prev=s.__key,s.__next=o.__key}else s.__next=null;t.__prev=null}if(i===null)if(u!==null){const s=u.getWritable();r.__last=u.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(u!==null){const o=u.getWritable();o.__next=s.__key,s.__prev=o.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Jr(n){Tl();const e=n.getLatest(),t=e.__parent,r=ot(),u=oe(),i=r._nodeMap,s=u._dirtyElements;t!==null&&function(a,l,f){let h=a;for(;h!==null;){if(f.has(h))return;const c=l.get(h);if(c===void 0)break;f.set(h,!1),h=c.__parent}}(t,i,s);const o=e.__key;u._dirtyType=$a,k(n)?s.set(o,!0):u._dirtyLeaves.add(o)}function me(n){ve();const e=oe(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=he(t);r!==null&&r.getWritable()}if(n!==null){const r=he(n);r!==null&&r.getWritable()}}}function gt(){return ur()?null:oe()._compositionKey}function he(n,e){const t=(e||ot())._nodeMap.get(n);return t===void 0?null:t}function Qa(n,e){const t=wu(n,oe());return t!==void 0?he(t,e):null}function wu(n,e){return n[`__lexicalKey_${e._key}`]}function on(n,e){let t=n;for(;t!=null;){const r=Qa(t,e);if(r!==null)return r;t=Yn(t)}return null}function Ya(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Zs(n){return n.read(()=>ce().getTextContent())}function ce(){return el(ot())}function el(n){return n._nodeMap.get("root")}function Ae(n){ve();const e=ot();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Yt(n){const e=oe(),t=function(r,u){let i=r;for(;i!=null;){const s=wu(i,u);if(s!==void 0)return s;i=Yn(i)}return null}(n,e);return t===null?n===e.getRootElement()?he("root"):null:he(t)}function Qs(n,e){return e?n.getTextContentSize():0}function tl(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function ls(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function rl(n){return n.nodeType===wt?n.nodeValue:null}function cs(n,e,t){const r=Oe(e._window);if(r===null)return;const u=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(u!==null){let o=rl(u);const a=on(u);if(o!==null&&M(a)){if(o===xu&&t){const l=t.length;o=t,i=l,s=l}o!==null&&fs(a,o,i,s,n)}}}function fs(n,e,t,r,u){let i=n;if(i.isAttached()&&(u||!i.isDirty())){const s=i.isComposing();let o=e;(s||u)&&e[e.length-1]===xu&&(o=e.slice(0,-1));const a=i.getTextContent();if(u||o!==a){if(o===""){if(me(null),_u||Xn||Qi)i.remove();else{const m=oe();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const l=i.getParent(),f=rr(),h=i.getTextContentSize(),c=gt(),d=i.getKey();if(i.isToken()||c!==null&&d===c&&!s||D(f)&&(l!==null&&!l.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===n.__key&&f.anchor.offset===0&&!i.canInsertTextBefore()&&!s||f.focus.key===n.__key&&f.focus.offset===h&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const p=j();if(!D(p)||t===null||r===null)return void i.setTextContent(o);if(p.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=le(i.getTextContent());i.replace(m),i=m}i.setTextContent(o)}}}function af(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),u=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||u||function(i){const s=i.getPreviousSibling();return(M(s)||k(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||u)}function Ys(n){return n==="ArrowLeft"}function eo(n){return n==="ArrowRight"}function En(n,e){return Pe?n:e}function to(n){return n==="Enter"}function _n(n){return n==="Backspace"}function xn(n){return n==="Delete"}function no(n,e,t){return n.toLowerCase()==="a"&&En(e,t)}function lf(){const n=ce();Ae(Ja(n.select(0,n.getChildrenSize())))}function Nn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const u=n[e];if(typeof u=="string"){const i=Vr(u);return t[e]=i,i}return u}function ds(n,e,t,r,u){if(t.size===0)return;const i=r.__type,s=r.__key,o=e.get(i);o===void 0&&R(33,i);const a=o.klass;let l=n.get(a);l===void 0&&(l=new Map,n.set(a,l));const f=l.get(s),h=f==="destroyed"&&u==="created";(f===void 0||h)&&l.set(s,h?"updated":u)}function ro(n,e,t){const r=n.getParent();let u=t,i=n;return r!==null&&(e&&t===0?(u=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(u=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?u-1:u)}function Fn(n,e){const t=n.offset;if(n.type==="element")return ro(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const u=e?r.getPreviousSibling():r.getNextSibling();return u===null?ro(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):u}}return null}function ul(n){const e=Tu(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function F(n,e,t){return kl(n,e,t)}function Su(n){return!ye(n)&&!n.isLastChild()&&!n.isInline()}function Xr(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&R(75,e),t}function Yn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function An(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Tu(n){const e=n._window;return e===null&&R(78),e}function cf(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return ye(n)||k(n)&&n.isShadowRoot()}function St(n){const e=oe(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&R(200,n.constructor.name,t);const{replace:u,replaceWithKlass:i}=r;if(u!==null){const s=u(n),o=s.constructor;return i!==null?s instanceof i||R(201,i.name,i.getType(),o.name,o.getType(),n.constructor.name,t):s instanceof n.constructor&&o!==n.constructor||R(202,o.name,o.getType(),n.constructor.name,t),s.__key===n.__key&&R(203,n.constructor.name,t,o.name,o.getType()),s}return n}function zu(n,e){!ye(n.getParent())||k(e)||re(e)||R(99)}function $u(n){return(re(n)||k(n)&&!n.canBeEmpty())&&!n.isInline()}function hs(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function ff(n,e,t){let r=n._blockCursorElement;if(D(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const u=t.anchor,i=u.getNode(),s=u.offset;let o=!1,a=null;if(s===i.getChildrenSize())$u(i.getChildAtIndex(s-1))&&(o=!0);else{const l=i.getChildAtIndex(s);if(l!==null&&$u(l)){const f=l.getPreviousSibling();(f===null||$u(f))&&(o=!0,a=n.getElementByKey(l.__key))}}if(o){const l=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(f){const h=f.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let d=h.blockCursor;if(d!==void 0){if(typeof d=="string"){const p=Vr(d);d=h.blockCursor=p}d!==void 0&&c.classList.add(...d)}return c}(n._config)),e.style.caretColor="transparent",void(a===null?l.appendChild(r):l.insertBefore(r,a))}}r!==null&&hs(r,n,e)}function Oe(n){return Fe?(n||window).getSelection():null}function df(n){return Ut(n)&&n.tagName==="A"}function Ut(n){return n.nodeType===1}function uo(n){return n.nodeType===11}function ai(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Zr(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function ht(n){if(re(n)&&!n.isInline())return!0;if(!k(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||xt(e)||M(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function vn(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function hf(){return oe()}const io=new WeakMap,pf=new Map;function gf(n){if(!n._readOnly&&n.isEmpty())return pf;n._readOnly||R(192);let e=io.get(n);if(!e){e=new Map,io.set(n,e);for(const[t,r]of n._nodeMap){const u=r.__type;let i=e.get(u);i||(i=new Map,e.set(u,i)),i.set(t,r)}}return e}function ps(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function mf(n,e){const t=(parseInt(n.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function bf(n){return n.__lexicalUnmanaged===!0}function il(n,e,t,r,u,i){let s=n.getFirstChild();for(;s!==null;){const o=s.__key;s.__parent===e&&(k(s)&&il(s,o,t,r,u,i),t.has(o)||i.delete(o),u.push(o)),s=s.getNextSibling()}}let vt,_e,jn,Cu,li,ci,Mt,Be,fi,qn,de="",be="",We=null,De="",tt="",sl=!1,Un=!1,Lr=null;function Qr(n,e){const t=Mt.get(n);if(e!==null){const r=pi(n);r.parentNode===e&&e.removeChild(r)}if(Be.has(n)||_e._keyToDOMMap.delete(n),k(t)){const r=eu(t,Mt);di(r,0,r.length-1,null)}t!==void 0&&ds(qn,jn,Cu,t,"destroyed")}function di(n,e,t,r){let u=e;for(;u<=t;++u){const i=n[u];i!==void 0&&Qr(i,r)}}function Nt(n,e){n.setProperty("text-align",e)}const yf="40px";function ol(n,e){const t=vt.theme.indent;if(typeof t=="string"){const u=n.classList.contains(t);e>0&&!u?n.classList.add(t):e<1&&u&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||yf;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function al(n,e){const t=n.style;e===0?Nt(t,""):e===es?Nt(t,"left"):e===ts?Nt(t,"center"):e===ns?Nt(t,"right"):e===rs?Nt(t,"justify"):e===us?Nt(t,"start"):e===is&&Nt(t,"end")}function Yr(n,e){const t=Be.get(n);t===void 0&&R(60);const r=t.createDOM(vt,_e);if(function(u,i,s){const o=s._keyToDOMMap;(function(a,l,f){a[`__lexicalKey_${l._key}`]=f})(i,s,u),o.set(u,i)}(n,r,_e),M(t)?r.setAttribute("data-lexical-text","true"):re(t)&&r.setAttribute("data-lexical-decorator","true"),k(t)){const u=t.__indent,i=t.__size;if(u!==0&&ol(r,u),i!==0){const o=i-1;(function(a,l,f,h){const c=be;be="",hi(a,f,0,l,f.getDOMSlot(h)),cl(f,h),be=c})(eu(t,Be),o,t,r)}const s=t.__format;s!==0&&al(r,s),t.isInline()||ll(null,t,r),Su(t)&&(de+=rt,tt+=rt)}else{const u=t.getTextContent();if(re(t)){const i=t.decorate(_e,vt);i!==null&&fl(n,i),r.contentEditable="false"}else M(t)&&(t.isDirectionless()||(be+=u));de+=u,tt+=u}return e!==null&&e.insertChild(r),ds(qn,jn,Cu,t,"created"),r}function hi(n,e,t,r,u){const i=de;de="";let s=t;for(;s<=r;++s){Yr(n[s],u);const o=Be.get(n[s]);o!==null&&M(o)&&(We===null&&(We=o.getFormat()),De===""&&(De=o.getStyle()))}Su(e)&&(de+=rt),u.element.__lexicalTextContent=de,de=i+de}function so(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return xt(r)?"line-break":re(r)&&r.isInline()?"decorator":null}return"empty"}return null}function ll(n,e,t){const r=so(n,Mt),u=so(e,Be);r!==u&&e.getDOMSlot(t).setManagedLineBreak(u)}function cl(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==be||r!==Lr){const i=be==="",s=i?Lr:(u=be,H0.test(u)?"rtl":V0.test(u)?"ltr":null);if(s!==r){const o=e.classList,a=vt.theme;let l=r!==null?a[r]:void 0,f=s!==null?a[s]:void 0;if(l!==void 0){if(typeof l=="string"){const h=Vr(l);l=a[r]=h}o.remove(...l)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(f!==void 0){if(typeof f=="string"){const h=Vr(f);f=a[s]=h}f!==void 0&&o.add(...f)}e.dir=s}Un||(n.getWritable().__dir=s)}Lr=s,e.__lexicalDirTextContent=be,e.__lexicalDir=s}var u}function _f(n,e,t){const r=be;var u;be="",We=null,De="",function(i,s,o){const a=de,l=i.__size,f=s.__size;de="";const h=o.element;if(l===1&&f===1){const c=i.__first,d=s.__first;if(c===d)kn(c,h);else{const m=pi(c),g=Yr(d,null);try{h.replaceChild(g,m)}catch(y){if(typeof y=="object"&&y!=null){const b=`${y.toString()} Parent: ${h.tagName}, new child: {tag: ${g.tagName} key: ${d}}, old child: {tag: ${m.tagName}, key: ${c}}.`;throw new Error(b)}throw y}Qr(c,null)}const p=Be.get(d);M(p)&&(We===null&&(We=p.getFormat()),De===""&&(De=p.getStyle()))}else{const c=eu(i,Mt),d=eu(s,Be);if(c.length!==l&&R(227),d.length!==f&&R(228),l===0)f!==0&&hi(d,s,0,f-1,o);else if(f===0){if(l!==0){const p=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;di(c,0,l-1,p?null:h),p&&(h.textContent="")}}else(function(p,m,g,y,b,v){const w=y-1,C=b-1;let S,I,T=v.getFirstChild(),P=0,$=0;for(;P<=w&&$<=C;){const N=m[P],B=g[$];if(N===B)T=Wu(kn(B,v.element)),P++,$++;else{S===void 0&&(S=new Set(m)),I===void 0&&(I=new Set(g));const O=I.has(N),A=S.has(B);if(O)if(A){const U=Xr(_e,B);U===T?T=Wu(kn(B,v.element)):(v.withBefore(T).insertChild(U),kn(B,v.element)),P++,$++}else Yr(B,v.withBefore(T)),$++;else T=Wu(pi(N)),Qr(N,v.element),P++}const x=Be.get(B);x!==null&&M(x)&&(We===null&&(We=x.getFormat()),De===""&&(De=x.getStyle()))}const _=P>w,E=$>C;if(_&&!E){const N=g[C+1],B=N===void 0?null:_e.getElementByKey(N);hi(g,p,$,C,v.withBefore(B))}else E&&!_&&di(m,P,w,v.element)})(s,c,d,l,f,o)}Su(s)&&(de+=rt),h.__lexicalTextContent=de,de=a+de}(n,e,e.getDOMSlot(t)),cl(e,t),Bt(u=e)&&We!=null&&We!==u.__textFormat&&!Un&&(u.setTextFormat(We),u.setTextStyle(De)),function(i){Bt(i)&&De!==""&&De!==i.__textStyle&&!Un&&i.setTextStyle(De)}(e),be=r}function eu(n,e){const t=[];let r=n.__first;for(;r!==null;){const u=e.get(r);u===void 0&&R(101),t.push(r),r=u.__next}return t}function kn(n,e){const t=Mt.get(n);let r=Be.get(n);t!==void 0&&r!==void 0||R(61);const u=sl||ci.has(n)||li.has(n),i=Xr(_e,n);if(t===r&&!u){if(k(t)){const s=i.__lexicalTextContent;s!==void 0&&(de+=s,tt+=s);const o=i.__lexicalDirTextContent;o!==void 0&&(be+=o)}else{const s=t.getTextContent();M(t)&&!t.isDirectionless()&&(be+=s),tt+=s,de+=s}return i}if(t!==r&&u&&ds(qn,jn,Cu,r,"updated"),r.updateDOM(t,i,vt)){const s=Yr(n,null);return e===null&&R(62),e.replaceChild(s,i),Qr(n,null),s}if(k(t)&&k(r)){const s=r.__indent;s!==t.__indent&&ol(i,s);const o=r.__format;o!==t.__format&&al(i,o),u&&(_f(t,r,i),ye(r)||r.isInline()||ll(t,r,i)),Su(r)&&(de+=rt,tt+=rt)}else{const s=r.getTextContent();if(re(r)){const o=r.decorate(_e,vt);o!==null&&fl(n,o)}else M(r)&&!r.isDirectionless()&&(be+=s);de+=s,tt+=s}if(!Un&&ye(r)&&r.__cachedText!==tt){const s=r.getWritable();s.__cachedText=tt,r=s}return i}function fl(n,e){let t=_e._pendingDecorators;const r=_e._decorators;if(t===null){if(r[n]===e)return;t=Ya(_e)}t[n]=e}function Wu(n){let e=n.nextSibling;return e!==null&&e===_e._blockCursorElement&&(e=e.nextSibling),e}function xf(n,e,t,r,u,i){de="",tt="",be="",sl=r===sn,Lr=null,_e=t,vt=t._config,jn=t._nodes,Cu=_e._listeners.mutation,li=u,ci=i,Mt=n._nodeMap,Be=e._nodeMap,Un=e._readOnly,fi=new Map(t._keyToDOMMap);const s=new Map;return qn=s,kn("root",null),_e=void 0,jn=void 0,li=void 0,ci=void 0,Mt=void 0,Be=void 0,vt=void 0,fi=void 0,qn=void 0,s}function pi(n){const e=fi.get(n);return e===void 0&&R(75,n),e}const Ze=Object.freeze({}),gi=30,mi=[["keydown",function(n,e){if(On=n.timeStamp,dl=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:u,metaKey:i,altKey:s}=n;if(!F(e,S0,n)&&t!=null){if(function(o,a,l,f){return eo(o)&&!a&&!f&&!l}(t,u,s,i))F(e,Pa,n);else if(function(o,a,l,f,h){return eo(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))F(e,T0,n);else if(function(o,a,l,f){return Ys(o)&&!a&&!f&&!l}(t,u,s,i))F(e,Da,n);else if(function(o,a,l,f,h){return Ys(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))F(e,C0,n);else if(function(o,a,l){return function(f){return f==="ArrowUp"}(o)&&!a&&!l}(t,u,i))F(e,La,n);else if(function(o,a,l){return function(f){return f==="ArrowDown"}(o)&&!a&&!l}(t,u,i))F(e,Ma,n);else if(function(o,a){return to(o)&&a}(t,r))In=!0,F(e,zr,n);else if(function(o){return o===" "}(t))F(e,E0,n);else if(function(o,a){return Pe&&a&&o.toLowerCase()==="o"}(t,u))n.preventDefault(),In=!0,F(e,tn,!0);else if(function(o,a){return to(o)&&!a}(t,r))In=!1,F(e,zr,n);else if(function(o,a,l,f){return Pe?!a&&!l&&(_n(o)||o.toLowerCase()==="h"&&f):!(f||a||l)&&_n(o)}(t,s,i,u))_n(t)?F(e,Ra,n):(n.preventDefault(),F(e,It,!0));else if(function(o){return o==="Escape"}(t))F(e,Ba,n);else if(function(o,a,l,f,h){return Pe?!(l||f||h)&&(xn(o)||o.toLowerCase()==="d"&&a):!(a||f||h)&&xn(o)}(t,u,r,s,i))xn(t)?F(e,Fa,n):(n.preventDefault(),F(e,It,!1));else if(function(o,a,l){return _n(o)&&(Pe?a:l)}(t,s,u))n.preventDefault(),F(e,Rn,!0);else if(function(o,a,l){return xn(o)&&(Pe?a:l)}(t,s,u))n.preventDefault(),F(e,Rn,!1);else if(function(o,a){return Pe&&a&&_n(o)}(t,i))n.preventDefault(),F(e,Bn,!0);else if(function(o,a){return Pe&&a&&xn(o)}(t,i))n.preventDefault(),F(e,Bn,!1);else if(function(o,a,l,f){return o.toLowerCase()==="b"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"bold");else if(function(o,a,l,f){return o.toLowerCase()==="u"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"underline");else if(function(o,a,l,f){return o.toLowerCase()==="i"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"italic");else if(function(o,a,l,f){return o==="Tab"&&!a&&!l&&!f}(t,s,u,i))F(e,k0,n);else if(function(o,a,l,f){return o.toLowerCase()==="z"&&!a&&En(l,f)}(t,r,i,u))n.preventDefault(),F(e,Ji,void 0);else if(function(o,a,l,f){return Pe?o.toLowerCase()==="z"&&l&&a:o.toLowerCase()==="y"&&f||o.toLowerCase()==="z"&&f&&a}(t,r,i,u))n.preventDefault(),F(e,Xi,void 0);else{const o=e._editorState._selection;o===null||D(o)?!_t&&no(t,i,u)&&(n.preventDefault(),F(e,si,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="c"&&(Pe?f:h)}(t,r,i,u)?(n.preventDefault(),F(e,yu,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="x"&&(Pe?f:h)}(t,r,i,u)?(n.preventDefault(),F(e,Zi,n)):no(t,i,u)&&(n.preventDefault(),F(e,si,n))}(function(o,a,l,f){return o||a||l||f})(u,r,s,i)&&F(e,R0,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Ce(e,()=>{re(on(t))||(yi=!0)})}],["compositionstart",function(n,e){Ce(e,()=>{const t=j();if(D(t)&&!e.isComposing()){const r=t.anchor,u=t.anchor.getNode();me(r.key),(n.timeStamp<On+gi||r.type==="element"||!t.isCollapsed()||u.getFormat()!==t.format||M(u)&&u.getStyle()!==t.style)&&F(e,nn,W0)}})}],["compositionend",function(n,e){_t?wn=!0:Ce(e,()=>{Hu(e,n.data)})}],["input",function(n,e){n.stopPropagation(),Ce(e,()=>{const t=j(),r=n.data,u=ml(n);if(r!=null&&D(t)&&gl(t,u,r,n.timeStamp,!1)){wn&&(Hu(e,r),wn=!1);const i=t.anchor.getNode(),s=Oe(e._window);if(s===null)return;const o=t.isBackward(),a=o?t.anchor.offset:t.focus.offset,l=o?t.focus.offset:t.anchor.offset;$r&&!t.isCollapsed()&&M(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===rl(s.anchorNode)||F(e,nn,r);const f=r.length;_t&&f>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=f),_u||Xn||Qi||!e.isComposing()||(On=0,me(null))}else cs(!1,e,r!==null?r:void 0),wn&&(Hu(e,r||void 0),wn=!1);ve(),Ga(oe())}),Xt=null}],["click",function(n,e){Ce(e,()=>{const t=j(),r=Oe(e._window),u=rr();if(r){if(D(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!ye(s)&&ce().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&u!==null&&t.is(u)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(k(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===Zn||s===wt)&&Ae(ms(u,r,e,n))}}}F(e,Ia,n)})}],["cut",Ze],["copy",Ze],["dragstart",Ze],["dragover",Ze],["dragend",Ze],["paste",Ze],["focus",Ze],["blur",Ze],["drop",Ze]];$r&&mi.push(["beforeinput",(n,e)=>function(t,r){const u=t.inputType,i=ml(t);u==="deleteCompositionText"||_t&&ul(r)||u!=="insertCompositionText"&&Ce(r,()=>{const s=j();if(u==="deleteContentBackward"){if(s===null){const d=rr();if(!D(d))return;Ae(d.clone())}if(D(s)){const d=s.anchor.key===s.focus.key;if(o=t.timeStamp,dl==="MediaLast"&&o<On+gi&&r.isComposing()&&d){if(me(null),On=0,setTimeout(()=>{Ce(r,()=>{me(null)})},gi),D(s)){const p=s.anchor.getNode();p.markDirty(),s.format=p.getFormat(),M(p)||R(142),s.style=p.getStyle()}}else{me(null),t.preventDefault();const p=s.anchor.getNode(),m=p.getTextContent(),g=p.canInsertTextAfter(),y=s.anchor.offset===0&&s.focus.offset===m.length;j0&&d&&!y&&g||F(r,It,!0)}return}}var o;if(!D(s))return;const a=t.data;Xt!==null&&cs(!1,r,Xt),s.dirty&&Xt===null||!s.isCollapsed()||ye(s.anchor.getNode())||i===null||s.applyDOMRange(i),Xt=null;const l=s.anchor,f=s.focus,h=l.getNode(),c=f.getNode();if(u!=="insertText"&&u!=="insertTranspose")switch(t.preventDefault(),u){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":F(r,nn,t);break;case"insertFromComposition":me(null),F(r,nn,t);break;case"insertLineBreak":me(null),F(r,tn,!1);break;case"insertParagraph":me(null),In&&!Xn?(In=!1,F(r,tn,!1)):F(r,Mn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":F(r,bu,t);break;case"deleteByComposition":(function(d,p){return d!==p||k(d)||k(p)||!d.isToken()||!p.isToken()})(h,c)&&F(r,ii,t);break;case"deleteByDrag":case"deleteByCut":F(r,ii,t);break;case"deleteContent":F(r,It,!1);break;case"deleteWordBackward":F(r,Rn,!0);break;case"deleteWordForward":F(r,Rn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":F(r,Bn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":F(r,Bn,!1);break;case"formatStrikeThrough":F(r,Ge,"strikethrough");break;case"formatBold":F(r,Ge,"bold");break;case"formatItalic":F(r,Ge,"italic");break;case"formatUnderline":F(r,Ge,"underline");break;case"historyUndo":F(r,Ji,void 0);break;case"historyRedo":F(r,Xi,void 0)}else{if(a===`
4
4
  `)t.preventDefault(),F(r,tn,!1);else if(a===rt)t.preventDefault(),F(r,Mn,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(d)}else a!=null&&gl(s,i,a,t.timeStamp,!0)?(t.preventDefault(),F(r,nn,a)):Xt=a;hl=t.timeStamp}})}(n,e)]);let On=0,dl=null,hl=0,Xt=null;const tu=new WeakMap;let bi=!1,yi=!1,In=!1,wn=!1,pl=[0,"",0,"root",0];function gl(n,e,t,r,u){const i=n.anchor,s=n.focus,o=i.getNode(),a=oe(),l=Oe(a._window),f=l!==null?l.anchorNode:null,h=i.key,c=a.getElementByKey(h),d=t.length;return h!==s.key||!M(o)||(!u&&(!$r||hl<r+50)||o.isDirty()&&d<2||tl(t))&&i.offset!==s.offset&&!o.isComposing()||At(o)||o.isDirty()&&d>1||(u||!$r)&&c!==null&&!o.isComposing()&&f!==Gr(c)||l!==null&&e!==null&&(!e.collapsed||e.startContainer!==l.anchorNode||e.startOffset!==l.anchorOffset)||o.getFormat()!==n.format||o.getStyle()!==n.style||af(n,o)}function oo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===wt&&e!==0&&e!==n.nodeValue.length}function ao(n,e,t){const{anchorNode:r,anchorOffset:u,focusNode:i,focusOffset:s}=n;bi&&(bi=!1,oo(r,u)&&oo(i,s))||Ce(e,()=>{if(!t)return void Ae(null);if(!Qn(e,r,i))return;const o=j();if(D(o)){const a=o.anchor,l=a.getNode();if(o.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(o.dirty=!0);const f=Tu(e).event,h=f?f.timeStamp:performance.now(),[c,d,p,m,g]=pl,y=ce(),b=e.isComposing()===!1&&y.getTextContent()==="";if(h<g+200&&a.offset===p&&a.key===m)o.format=c,o.style=d;else if(a.type==="text")M(l)||R(141),o.format=l.getFormat(),o.style=l.getStyle();else if(a.type==="element"&&!b){const v=a.getNode();o.style="",v instanceof pn&&v.getChildrenSize()===0?(o.format=v.getTextFormat(),o.style=v.getTextStyle()):o.format=0}}else{const f=a.key,h=o.focus.key,c=o.getNodes(),d=c.length,p=o.isBackward(),m=p?s:u,g=p?u:s,y=p?h:f,b=p?f:h;let v=$0,w=!1;for(let C=0;C<d;C++){const S=c[C],I=S.getTextContentSize();if(M(S)&&I!==0&&!(C===0&&S.__key===y&&m===I||C===d-1&&S.__key===b&&g===0)&&(w=!0,v&=S.getFormat(),v===0))break}o.format=w?v:0}}F(e,mu,void 0)})}function ml(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Hu(n,e){const t=n._compositionKey;if(me(null),t!==null&&e!=null){if(e===""){const r=he(t),u=Gr(n.getElementByKey(t));return void(u!==null&&u.nodeValue!==null&&M(r)&&fs(r,u.nodeValue,null,null,!0))}if(e[e.length-1]===`
@@ -10,7 +10,7 @@ import { File as I0 } from "../file/index.js";
10
10
  import { Button as $e } from "../button/index.js";
11
11
  import { Dropzone as P0 } from "../dropzone/index.js";
12
12
  import { Icon as We } from "../icon/index.js";
13
- import { I as Xs } from "../../index-C-ESxR26.js";
13
+ import { I as Xs } from "../../index-DMGGDV9J.js";
14
14
  import { Toolbar as D0 } from "../toolbar/index.js";
15
15
  function yn(n) {
16
16
  return {};
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("react");require("../../icons-Lq3pr85X.cjs");require("../../use-touched-Bq5Gjbpz.cjs");const e=require("../../index-lALToPBm.cjs");exports.Input=e.Input;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("react");require("../../icons-Lq3pr85X.cjs");require("../../use-touched-Bq5Gjbpz.cjs");const e=require("../../index-BOiGSTKz.cjs");exports.Input=e.Input;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -3,7 +3,7 @@ import "../../classix-DG18itHa.js";
3
3
  import "react";
4
4
  import "../../icons-BkaMeh-J.js";
5
5
  import "../../use-touched-B999bBr8.js";
6
- import { I as a } from "../../index-C-ESxR26.js";
6
+ import { I as a } from "../../index-DMGGDV9J.js";
7
7
  export {
8
8
  a as Input
9
9
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),m=require("../button/index.cjs"),w=require("../checkbox/index.cjs"),B=require("../chip/index.cjs"),I=require("../collapsible/index.cjs"),T=require("../controls/index.cjs"),H=require("../dialog/index.cjs"),P=require("../header/index.cjs"),z=require("../../index-lALToPBm.cjs"),A="_search_1rde5_3",E="_controls_1rde5_15",J="_chips_1rde5_35",K="_radio_1rde5_101",n={search:A,controls:E,chips:J,"filter-dialog":"_filter-dialog_1rde5_42","filter-groups":"_filter-groups_1rde5_47","filter-group":"_filter-group_1rde5_47","filter-option":"_filter-option_1rde5_83","option-copy":"_option-copy_1rde5_89",radio:K,"collapsible-options":"_collapsible-options_1rde5_128"},L=({closeLabel:q="Close",filterButtonLabel:x="Filters",filterDialogColumns:f=1,filterDialogTitle:k="Filters",filterGroups:d=[],onChange:$,onSelectedFiltersChange:o,removeFilterLabel:M=i=>`Remove ${i.label} filter`,resetLabel:O="Reset",searchLabel:C="Search",searchPlaceholder:D="Search",selectedFilters:t=[],value:R=""})=>{const i=b.useId(),[j,r]=b.useState(!1),S=b.useMemo(()=>new Map(d.flatMap(e=>{var l;return[...e.options,...((l=e.collapsible)==null?void 0:l.options)??[]]}).map(e=>[e.value,e])),[d]),h=t.flatMap(e=>{const l=S.get(e);return l?[l]:[]}),_=(e,l,s)=>{var N;if(!o)return;const p=new Set([...(s==null?void 0:s.options.map(c=>c.value))??[],...((N=s==null?void 0:s.collapsible)==null?void 0:N.options.map(c=>c.value))??[]]),y=t.filter(c=>!p.has(c));if(l&&(s==null?void 0:s.defaultValue)===e){o(y);return}o(l?(s==null?void 0:s.control)==="radio"||(s==null?void 0:s.selectionMode)==="single"?[...y,e]:[...new Set([...t,e])]:t.filter(c=>c!==e))},v=(e,l)=>{var s;return t.includes(e)||l.defaultValue===e&&![...l.options,...((s=l.collapsible)==null?void 0:s.options)??[]].some(p=>t.includes(p.value))},u=(e,l)=>a.jsx("div",{className:n["filter-option"],"data-component":"renderfilter",children:l.control==="radio"?a.jsxs("label",{className:n.radio,children:[a.jsx("input",{checked:v(e.value,l),name:`${i}-filter-${l.label??"group"}`,onChange:s=>_(e.value,s.target.checked,l),type:"radio"}),a.jsxs("span",{className:n["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]})]}):a.jsx(w.Checkbox,{checked:v(e.value,l),label:a.jsxs("span",{className:n["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]}),onChange:s=>_(e.value,s.target.checked,l)})},e.value);return a.jsxs("div",{className:n.search,"data-component":"search",children:[a.jsxs("div",{className:n.controls,children:[a.jsx(z.Input,{"aria-label":C,icon:"search",onChange:e=>$(e.target.value),placeholder:D,type:"search",value:R}),d.length>0&&a.jsx(m.Button,{"aria-expanded":j,"aria-haspopup":"dialog",badge:h.length,icon:"funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),h.length>0&&a.jsxs("div",{"aria-label":x,className:n.chips,children:[h.map(e=>a.jsx(B.Chip,{accessibleLabel:M(e),label:e.label,onDelete:()=>_(e.value,!1)},e.value)),a.jsx(m.Button,{onClick:()=>o==null?void 0:o([]),variant:"tertiary",children:O})]}),j&&a.jsx(H.Dialog,{"aria-labelledby":i,className:n["filter-dialog"],controls:a.jsx(T.Controls,{children:a.jsx(m.Button,{onClick:()=>r(!1),children:q})}),header:a.jsx(P.Header,{children:a.jsx("h2",{id:i,children:k})}),open:!0,setOpen:r,children:a.jsx("div",{className:n["filter-groups"],"data-columns":f,children:d.map((e,l)=>a.jsxs("section",{"aria-labelledby":e.label?`${i}-${l}`:void 0,className:n["filter-group"],"data-column-span":e.columnSpan??1,role:e.control==="radio"?"radiogroup":"group",children:[e.label&&a.jsx("h3",{id:`${i}-${l}`,children:e.label}),e.options.map(s=>u(s,e)),e.collapsible&&a.jsx(I.Collapsible,{summary:e.collapsible.label,children:a.jsx("div",{className:n["collapsible-options"],children:e.collapsible.options.map(s=>u(s,e))})})]},e.label??l))})})]})};exports.Search=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),m=require("../button/index.cjs"),w=require("../checkbox/index.cjs"),B=require("../chip/index.cjs"),I=require("../collapsible/index.cjs"),T=require("../controls/index.cjs"),H=require("../dialog/index.cjs"),P=require("../header/index.cjs"),z=require("../../index-BOiGSTKz.cjs"),A="_search_1rde5_3",E="_controls_1rde5_15",J="_chips_1rde5_35",K="_radio_1rde5_101",n={search:A,controls:E,chips:J,"filter-dialog":"_filter-dialog_1rde5_42","filter-groups":"_filter-groups_1rde5_47","filter-group":"_filter-group_1rde5_47","filter-option":"_filter-option_1rde5_83","option-copy":"_option-copy_1rde5_89",radio:K,"collapsible-options":"_collapsible-options_1rde5_128"},L=({closeLabel:q="Close",filterButtonLabel:x="Filters",filterDialogColumns:f=1,filterDialogTitle:k="Filters",filterGroups:d=[],onChange:$,onSelectedFiltersChange:o,removeFilterLabel:M=i=>`Remove ${i.label} filter`,resetLabel:O="Reset",searchLabel:C="Search",searchPlaceholder:D="Search",selectedFilters:t=[],value:R=""})=>{const i=b.useId(),[j,r]=b.useState(!1),S=b.useMemo(()=>new Map(d.flatMap(e=>{var l;return[...e.options,...((l=e.collapsible)==null?void 0:l.options)??[]]}).map(e=>[e.value,e])),[d]),h=t.flatMap(e=>{const l=S.get(e);return l?[l]:[]}),_=(e,l,s)=>{var N;if(!o)return;const p=new Set([...(s==null?void 0:s.options.map(c=>c.value))??[],...((N=s==null?void 0:s.collapsible)==null?void 0:N.options.map(c=>c.value))??[]]),y=t.filter(c=>!p.has(c));if(l&&(s==null?void 0:s.defaultValue)===e){o(y);return}o(l?(s==null?void 0:s.control)==="radio"||(s==null?void 0:s.selectionMode)==="single"?[...y,e]:[...new Set([...t,e])]:t.filter(c=>c!==e))},v=(e,l)=>{var s;return t.includes(e)||l.defaultValue===e&&![...l.options,...((s=l.collapsible)==null?void 0:s.options)??[]].some(p=>t.includes(p.value))},u=(e,l)=>a.jsx("div",{className:n["filter-option"],"data-component":"renderfilter",children:l.control==="radio"?a.jsxs("label",{className:n.radio,children:[a.jsx("input",{checked:v(e.value,l),name:`${i}-filter-${l.label??"group"}`,onChange:s=>_(e.value,s.target.checked,l),type:"radio"}),a.jsxs("span",{className:n["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]})]}):a.jsx(w.Checkbox,{checked:v(e.value,l),label:a.jsxs("span",{className:n["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]}),onChange:s=>_(e.value,s.target.checked,l)})},e.value);return a.jsxs("div",{className:n.search,"data-component":"search",children:[a.jsxs("div",{className:n.controls,children:[a.jsx(z.Input,{"aria-label":C,icon:"search",onChange:e=>$(e.target.value),placeholder:D,type:"search",value:R}),d.length>0&&a.jsx(m.Button,{"aria-expanded":j,"aria-haspopup":"dialog",badge:h.length,icon:"funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),h.length>0&&a.jsxs("div",{"aria-label":x,className:n.chips,children:[h.map(e=>a.jsx(B.Chip,{accessibleLabel:M(e),label:e.label,onDelete:()=>_(e.value,!1)},e.value)),a.jsx(m.Button,{onClick:()=>o==null?void 0:o([]),variant:"tertiary",children:O})]}),j&&a.jsx(H.Dialog,{"aria-labelledby":i,className:n["filter-dialog"],controls:a.jsx(T.Controls,{children:a.jsx(m.Button,{onClick:()=>r(!1),children:q})}),header:a.jsx(P.Header,{children:a.jsx("h2",{id:i,children:k})}),open:!0,setOpen:r,children:a.jsx("div",{className:n["filter-groups"],"data-columns":f,children:d.map((e,l)=>a.jsxs("section",{"aria-labelledby":e.label?`${i}-${l}`:void 0,className:n["filter-group"],"data-column-span":e.columnSpan??1,role:e.control==="radio"?"radiogroup":"group",children:[e.label&&a.jsx("h3",{id:`${i}-${l}`,children:e.label}),e.options.map(s=>u(s,e)),e.collapsible&&a.jsx(I.Collapsible,{summary:e.collapsible.label,children:a.jsx("div",{className:n["collapsible-options"],children:e.collapsible.options.map(s=>u(s,e))})})]},e.label??l))})})]})};exports.Search=L;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -7,7 +7,7 @@ import { Collapsible as A } from "../collapsible/index.js";
7
7
  import { Controls as E } from "../controls/index.js";
8
8
  import { Dialog as J } from "../dialog/index.js";
9
9
  import { Header as K } from "../header/index.js";
10
- import { I as L } from "../../index-C-ESxR26.js";
10
+ import { I as L } from "../../index-DMGGDV9J.js";
11
11
  import '../../assets/index9.css';const P = "_search_1rde5_3", Q = "_controls_1rde5_15", U = "_chips_1rde5_35", V = "_radio_1rde5_101", o = {
12
12
  search: P,
13
13
  controls: Q,
@@ -0,0 +1,2 @@
1
+ "use strict";require('./assets/index45.css');const o=require("react/jsx-runtime"),d=require("./classix-5H4IWnMA.cjs"),p=require("react"),V=require("./icons-Lq3pr85X.cjs"),E=require("./use-touched-Bq5Gjbpz.cjs");function w(t){return t&&`${t[0].toLocaleUpperCase()}${t.slice(1)}`}function S(t){const n=w(t);return n&&!n.endsWith(":")?`${n}:`:n}const G="_input_p0mz8_3",H="_touched_p0mz8_43",U="_label_p0mz8_48",W="_inline_p0mz8_69",k="_code_p0mz8_86",s={input:G,touched:H,label:U,inline:W,code:k};function A({className:t,defaultCountryCode:n="+47",disabled:c=!1,icon:g,label:h,onBlur:T,placeholder:f,ref:j,required:m,style:v,type:e="text",variant:_="default",...L}){const[x,b]=p.useState(""),[u,z]=p.useState(""),{name:I,onChange:a,pattern:$,value:l,...F}=L,{touched:B,onBlur:P}=E.useTouched(l===""),r=g&&e!=="radio"&&e!=="datetime-local"?g:void 0,N=h&&_==="inline"?S(h):h,q=r?{...v,"--icon-svg":V.iconSVG(r,!0)}:v,C=E.composeEventHandlers(P,T);p.useEffect(()=>{if(a&&e==="tel"){const i={name:I,value:u?(x||n).split(" ").join("")+u.split(" ").join(""):void 0};a({target:i,currentTarget:i})}},[x,n,I,a,u,e]),p.useEffect(()=>{e==="tel"&&!l&&(z(""),b(""))},[e,l]);const R=o.jsxs(o.Fragment,{children:[o.jsx("input",{disabled:c,hidden:!0,onChange:a,pattern:void 0,placeholder:f,ref:j,type:e,value:l}),o.jsx("input",{type:"text",className:d.t(s.code,s.input),disabled:c,maxLength:5,onChange:i=>b(i.target.value),placeholder:n,value:x}),o.jsx("input",{...F,type:"tel",className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,maxLength:14,name:void 0,onChange:i=>z(i.target.value),onBlur:C,pattern:$,required:m,style:q,value:u})]});return o.jsxs("label",{className:d.t(s.label,_==="inline"&&s.inline),"data-component":"input",children:[N&&o.jsx("span",{"data-required":m&&_!=="inline"?!0:void 0,children:N}),e==="tel"?R:o.jsx("input",{...L,ref:j,className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,onBlur:C,placeholder:f,required:m,style:q,type:e})]})}exports.Input=A;exports.formatInlineLabel=S;
2
+ //# sourceMappingURL=index-BOiGSTKz.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-lALToPBm.cjs","sources":["../src/lib/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/lib/compose-event-handlers';\nimport { formatInlineLabel } from '@/lib/text';\nimport { useTouched } from '@/lib/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon, true),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && <span data-required={required || undefined}>{displayLabel}</span>}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAm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,UAAWiC,EAAAA,EAAGC,EAAOE,MAAO3C,EAAWsB,GAAWmB,EAAOnB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAAvB,EACA,OAAQ2B,EACR,YAAAvB,EACA,SAAAE,EACA,MAAOmB,EACP,KAAAjB,CAAA,CAAW,CAAA,EAGjB,CAEJ"}
1
+ {"version":3,"file":"index-BOiGSTKz.cjs","sources":["../src/lib/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/lib/compose-event-handlers';\nimport { formatInlineLabel } from '@/lib/text';\nimport { useTouched } from '@/lib/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon, true),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC,EACjE,CAEO,SAASC,EAAkBH,EAAuB,CACvD,MAAMI,EAAQL,EAAsBC,CAAK,EACzC,OAAOI,GAAS,CAACA,EAAMC,SAAS,GAAG,EAAI,GAAGD,CAAK,IAAMA,CACvD,0JCuBO,SAASE,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,KAAAA,EACAN,MAAAA,EACAO,OAAQC,EACRC,YAAAA,EACAC,IAAAA,EACAC,SAAAA,EACAC,MAAAA,EACAC,KAAAA,EAAO,OACPC,QAAAA,EAAU,UACV,GAAGC,CACO,EAAG,CACb,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,KAAAA,EAAMC,SAAAA,EAAUC,QAAAA,EAAS3B,MAAAA,EAAO,GAAG4B,CAAAA,EAAcT,EACnD,CAAEU,QAAAA,EAASlB,OAAAA,CAAAA,EAAWmB,EAAAA,WAAW9B,IAAU,EAAE,EAC7C+B,EAAYrB,GAAQO,IAAS,SAAWA,IAAS,iBAAmBP,EAAOsB,OAC3EC,EAAe7B,GAASc,IAAY,SAAWf,EAAkBC,CAAK,EAAIA,EAQ1E8B,EAAqBH,EACvB,CACE,GAAGf,EACH,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OAAQoC,EACR,QAAAT,EACA,SAAAZ,EACA,MAAOmB,EACP,MAAOX,CAAAA,CAAY,CAAA,EAEvB,EAGF,OACEqB,EAAAA,KAAC,QAAA,CAAM,UAAWG,EAAAA,EAAGC,EAAO5C,MAAOc,IAAY,UAAY8B,EAAOI,MAAM,EAAE,iBAAA,QACvEnB,SAAAA,CAAAA,GACCa,EAAAA,IAAC,QAAK,gBAAe/B,GAAYG,IAAY,SAAW,GAAOc,OAC5DC,SAAAA,CAAAA,CACH,EAEDhB,IAAS,MACR0B,EAEAG,EAAAA,IAAC,QAAA,CACC,GAAI3B,EACJ,IAAAL,EACA,UAAWiC,EAAAA,EAAGC,EAAOE,MAAO3C,EAAWsB,GAAWmB,EAAOnB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAAvB,EACA,OAAQ2B,EACR,YAAAvB,EACA,SAAAE,EACA,MAAOmB,EACP,KAAAjB,CAAA,CAAW,CAAA,EAGjB,CAEJ"}
@@ -0,0 +1,76 @@
1
+ import { jsxs as $, Fragment as G, jsx as c } from "react/jsx-runtime";
2
+ import { t as p } from "./classix-DG18itHa.js";
3
+ import { useState as E, useEffect as F } from "react";
4
+ import { i as H } from "./icons-BkaMeh-J.js";
5
+ import { u as U, c as W } from "./use-touched-B999bBr8.js";
6
+ import './assets/index45.css';function k(t) {
7
+ return t && `${t[0].toLocaleUpperCase()}${t.slice(1)}`;
8
+ }
9
+ function A(t) {
10
+ const e = k(t);
11
+ return e && !e.endsWith(":") ? `${e}:` : e;
12
+ }
13
+ const D = "_input_p0mz8_3", J = "_touched_p0mz8_43", K = "_label_p0mz8_48", M = "_inline_p0mz8_69", O = "_code_p0mz8_86", o = {
14
+ input: D,
15
+ touched: J,
16
+ label: K,
17
+ inline: M,
18
+ code: O
19
+ };
20
+ function q({
21
+ className: t,
22
+ defaultCountryCode: e = "+47",
23
+ disabled: s = !1,
24
+ icon: f,
25
+ label: m,
26
+ onBlur: P,
27
+ placeholder: g,
28
+ ref: v,
29
+ required: d,
30
+ style: x,
31
+ type: n = "text",
32
+ variant: h = "default",
33
+ ...z
34
+ }) {
35
+ const [_, L] = E(""), [a, b] = E(""), {
36
+ name: B,
37
+ onChange: l,
38
+ pattern: S,
39
+ value: u,
40
+ ...T
41
+ } = z, {
42
+ touched: I,
43
+ onBlur: V
44
+ } = U(u === ""), r = f && n !== "radio" && n !== "datetime-local" ? f : void 0, N = m && h === "inline" ? A(m) : m, j = r ? {
45
+ ...x,
46
+ "--icon-svg": H(r, !0)
47
+ } : x, C = W(V, P);
48
+ F(() => {
49
+ if (l && n === "tel") {
50
+ const i = {
51
+ name: B,
52
+ value: a ? (_ || e).split(" ").join("") + a.split(" ").join("") : void 0
53
+ };
54
+ l({
55
+ target: i,
56
+ currentTarget: i
57
+ });
58
+ }
59
+ }, [_, e, B, l, a, n]), F(() => {
60
+ n === "tel" && !u && (b(""), L(""));
61
+ }, [n, u]);
62
+ const w = /* @__PURE__ */ $(G, { children: [
63
+ /* @__PURE__ */ c("input", { disabled: s, hidden: !0, onChange: l, pattern: void 0, placeholder: g, ref: v, type: n, value: u }),
64
+ /* @__PURE__ */ c("input", { type: "text", className: p(o.code, o.input), disabled: s, maxLength: 5, onChange: (i) => L(i.target.value), placeholder: e, value: _ }),
65
+ /* @__PURE__ */ c("input", { ...T, type: "tel", className: p(o.input, t, I && o.touched), "data-icon": r ? "true" : void 0, disabled: s, maxLength: 14, name: void 0, onChange: (i) => b(i.target.value), onBlur: C, pattern: S, required: d, style: j, value: a })
66
+ ] });
67
+ return /* @__PURE__ */ $("label", { className: p(o.label, h === "inline" && o.inline), "data-component": "input", children: [
68
+ N && /* @__PURE__ */ c("span", { "data-required": d && h !== "inline" ? !0 : void 0, children: N }),
69
+ n === "tel" ? w : /* @__PURE__ */ c("input", { ...z, ref: v, className: p(o.input, t, I && o.touched), "data-icon": r ? "true" : void 0, disabled: s, onBlur: C, placeholder: g, required: d, style: j, type: n })
70
+ ] });
71
+ }
72
+ export {
73
+ q as I,
74
+ A as f
75
+ };
76
+ //# sourceMappingURL=index-DMGGDV9J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DMGGDV9J.js","sources":["../src/lib/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/lib/compose-event-handlers';\nimport { formatInlineLabel } from '@/lib/text';\nimport { useTouched } from '@/lib/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon, true),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":";;;;;AAAO,SAASA,EAAsBC,GAAuB;AAC3D,SAAOA,KAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC;AACjE;AAEO,SAASC,EAAkBH,GAAuB;AACvD,QAAMI,IAAQL,EAAsBC,CAAK;AACzC,SAAOI,KAAS,CAACA,EAAMC,SAAS,GAAG,IAAI,GAAGD,CAAK,MAAMA;AACvD;;;;;;;;ACuBO,SAASE,EAAM;AAAA,EACpBC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAN,OAAAA;AAAAA,EACAO,QAAQC;AAAAA,EACRC,aAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,SAAAA,IAAU;AAAA,EACV,GAAGC;AACO,GAAG;AACb,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAE,GAC3C,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C;AAAA,IAAEG,MAAAA;AAAAA,IAAMC,UAAAA;AAAAA,IAAUC,SAAAA;AAAAA,IAAS3B,OAAAA;AAAAA,IAAO,GAAG4B;AAAAA,EAAAA,IAAcT,GACnD;AAAA,IAAEU,SAAAA;AAAAA,IAASlB,QAAAA;AAAAA,EAAAA,IAAWmB,EAAW9B,MAAU,EAAE,GAC7C+B,IAAYrB,KAAQO,MAAS,WAAWA,MAAS,mBAAmBP,IAAOsB,QAC3EC,IAAe7B,KAASc,MAAY,WAAWf,EAAkBC,CAAK,IAAIA,GAQ1E8B,IAAqBH,IACvB;AAAA,IACE,GAAGf;AA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AAW,IACX,MAAMuB,QACN,UAAWmB,CAAAA,MAAM3B,EAAe2B,EAAEZ,OAAOvC,KAAK,GAC9C,QAAQoC,GACR,SAAAT,GACA,UAAAZ,GACA,OAAOmB,GACP,OAAOX,EAAAA,CAAY;AAAA,EAAA,GAEvB;AAGF,SACE,gBAAAqB,EAAC,SAAA,EAAM,WAAWG,EAAGC,EAAO5C,OAAOc,MAAY,YAAY8B,EAAOI,MAAM,GAAE,kBAAA,SACvEnB,UAAAA;AAAAA,IAAAA,KACC,gBAAAa,EAAC,UAAK,iBAAe/B,KAAYG,MAAY,WAAW,KAAOc,QAC5DC,UAAAA,EAAAA,CACH;AAAA,IAEDhB,MAAS,QACR0B,IAEA,gBAAAG,EAAC,SAAA,EACC,GAAI3B,GACJ,KAAAL,GACA,WAAWiC,EAAGC,EAAOE,OAAO3C,GAAWsB,KAAWmB,EAAOnB,OAAO,GAChE,aAAWE,IAAY,SAASC,QAChC,UAAAvB,GACA,QAAQ2B,GACR,aAAAvB,GACA,UAAAE,GACA,OAAOmB,GACP,MAAAjB,EAAA,CAAW;AAAA,EAAA,GAGjB;AAEJ;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const o=require("./components/app-link/index.cjs"),t=require("./components/aside/index.cjs"),r=require("./components/avatar/index.cjs"),i=require("./components/badge/index.cjs"),s=require("./components/banner/index.cjs"),c=require("./components/branding/index.cjs"),_=require("./components/button/index.cjs"),p=require("./components/card/index.cjs"),a=require("./components/checkbox/index.cjs"),d=require("./components/chip/index.cjs"),u=require("./components/collapsible/index.cjs"),m=require("./components/controls/index.cjs"),l=require("./components/croppable/index.cjs"),x=require("./components/dialog/index.cjs"),q=require("./components/dropdown/index.cjs"),g=require("./components/dropzone/index.cjs"),b=require("./components/editor/index.cjs"),T=require("./components/empty-state/index.cjs"),h=require("./components/fieldset/index.cjs"),S=require("./components/figure/index.cjs"),v=require("./components/file/index.cjs"),C=require("./components/footer/index.cjs"),L=require("./components/form/index.cjs"),F=require("./components/graph/index.cjs"),I=require("./components/group/index.cjs"),f=require("./components/header/index.cjs"),k=require("./components/icon/index.cjs"),B=require("./components/iframe/index.cjs"),M=require("./components/image/index.cjs"),A=require("./index-lALToPBm.cjs"),D=require("./components/link/index.cjs"),y=require("./components/list/index.cjs"),O=require("./components/loading/index.cjs"),P=require("./components/menu/index.cjs"),j=require("./components/message/index.cjs"),w=require("./components/messages/index.cjs"),e=require("./components/nav/index.cjs"),E=require("./components/object/index.cjs"),G=require("./components/popover/index.cjs"),N=require("./components/portal/index.cjs"),z=require("./components/search/index.cjs"),H=require("./index-CXge5nFf.cjs"),n=require("./components/sortable/index.cjs"),W=require("./components/table/index.cjs"),J=require("./components/textarea/index.cjs"),K=require("./components/toast/index.cjs"),Q=require("./components/toasts/index.cjs"),R=require("./components/toggle/index.cjs"),U=require("./components/toolbar/index.cjs"),V=require("./components/tooltip/index.cjs"),X=require("./components/widget/index.cjs");exports.AppLink=o.AppLink;exports.Aside=t.Aside;exports.Avatar=r.Avatar;exports.Badge=i.Badge;exports.Banner=s.Banner;exports.Branding=c.Branding;exports.Button=_.Button;exports.Card=p.Card;exports.Checkbox=a.Checkbox;exports.Chip=d.Chip;exports.Collapsible=u.Collapsible;exports.Controls=m.Controls;exports.Croppable=l.Croppable;exports.Dialog=x.Dialog;exports.Dropdown=q.Dropdown;exports.Dropzone=g.Dropzone;exports.Editor=b.Editor;exports.EmptyState=T.EmptyState;exports.Fieldset=h.Fieldset;exports.Figure=S.Figure;exports.File=v.File;exports.Footer=C.Footer;exports.Form=L.Form;exports.Graph=F.Graph;exports.Group=I.Group;exports.Header=f.Header;exports.Icon=k.Icon;exports.Iframe=B.Iframe;exports.Image=M.Image;exports.Input=A.Input;exports.Link=D.Link;exports.List=y.List;exports.Loading=O.Loading;exports.Menu=P.Menu;exports.Message=j.Message;exports.Messages=w.Messages;exports.Nav=e.Nav;exports.NavLabel=e.NavLabel;exports.Object=E.Object;exports.Popover=G.Popover;exports.Portal=N.Portal;exports.Search=z.Search;exports.Select=H.Select;exports.Sortable=n.Sortable;exports.useOptionalSortableItem=n.useOptionalSortableItem;exports.Table=W.Table;exports.Textarea=J.Textarea;exports.Toast=K.Toast;exports.Toasts=Q.Toasts;exports.Toggle=R.Toggle;exports.Toolbar=U.Toolbar;exports.Tooltip=V.Tooltip;exports.Widget=X.Widget;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const o=require("./components/app-link/index.cjs"),t=require("./components/aside/index.cjs"),r=require("./components/avatar/index.cjs"),i=require("./components/badge/index.cjs"),s=require("./components/banner/index.cjs"),c=require("./components/branding/index.cjs"),_=require("./components/button/index.cjs"),p=require("./components/card/index.cjs"),a=require("./components/checkbox/index.cjs"),d=require("./components/chip/index.cjs"),u=require("./components/collapsible/index.cjs"),m=require("./components/controls/index.cjs"),l=require("./components/croppable/index.cjs"),x=require("./components/dialog/index.cjs"),q=require("./components/dropdown/index.cjs"),g=require("./components/dropzone/index.cjs"),b=require("./components/editor/index.cjs"),T=require("./components/empty-state/index.cjs"),h=require("./components/fieldset/index.cjs"),S=require("./components/figure/index.cjs"),v=require("./components/file/index.cjs"),C=require("./components/footer/index.cjs"),L=require("./components/form/index.cjs"),F=require("./components/graph/index.cjs"),I=require("./components/group/index.cjs"),f=require("./components/header/index.cjs"),k=require("./components/icon/index.cjs"),B=require("./components/iframe/index.cjs"),M=require("./components/image/index.cjs"),A=require("./index-BOiGSTKz.cjs"),D=require("./components/link/index.cjs"),y=require("./components/list/index.cjs"),O=require("./components/loading/index.cjs"),P=require("./components/menu/index.cjs"),j=require("./components/message/index.cjs"),w=require("./components/messages/index.cjs"),e=require("./components/nav/index.cjs"),E=require("./components/object/index.cjs"),G=require("./components/popover/index.cjs"),N=require("./components/portal/index.cjs"),z=require("./components/search/index.cjs"),H=require("./index-CXge5nFf.cjs"),n=require("./components/sortable/index.cjs"),W=require("./components/table/index.cjs"),J=require("./components/textarea/index.cjs"),K=require("./components/toast/index.cjs"),Q=require("./components/toasts/index.cjs"),R=require("./components/toggle/index.cjs"),U=require("./components/toolbar/index.cjs"),V=require("./components/tooltip/index.cjs"),X=require("./components/widget/index.cjs");exports.AppLink=o.AppLink;exports.Aside=t.Aside;exports.Avatar=r.Avatar;exports.Badge=i.Badge;exports.Banner=s.Banner;exports.Branding=c.Branding;exports.Button=_.Button;exports.Card=p.Card;exports.Checkbox=a.Checkbox;exports.Chip=d.Chip;exports.Collapsible=u.Collapsible;exports.Controls=m.Controls;exports.Croppable=l.Croppable;exports.Dialog=x.Dialog;exports.Dropdown=q.Dropdown;exports.Dropzone=g.Dropzone;exports.Editor=b.Editor;exports.EmptyState=T.EmptyState;exports.Fieldset=h.Fieldset;exports.Figure=S.Figure;exports.File=v.File;exports.Footer=C.Footer;exports.Form=L.Form;exports.Graph=F.Graph;exports.Group=I.Group;exports.Header=f.Header;exports.Icon=k.Icon;exports.Iframe=B.Iframe;exports.Image=M.Image;exports.Input=A.Input;exports.Link=D.Link;exports.List=y.List;exports.Loading=O.Loading;exports.Menu=P.Menu;exports.Message=j.Message;exports.Messages=w.Messages;exports.Nav=e.Nav;exports.NavLabel=e.NavLabel;exports.Object=E.Object;exports.Popover=G.Popover;exports.Portal=N.Portal;exports.Search=z.Search;exports.Select=H.Select;exports.Sortable=n.Sortable;exports.useOptionalSortableItem=n.useOptionalSortableItem;exports.Table=W.Table;exports.Textarea=J.Textarea;exports.Toast=K.Toast;exports.Toasts=Q.Toasts;exports.Toggle=R.Toggle;exports.Toolbar=U.Toolbar;exports.Tooltip=V.Tooltip;exports.Widget=X.Widget;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { Header as _ } from "./components/header/index.js";
27
27
  import { Icon as oo } from "./components/icon/index.js";
28
28
  import { Iframe as eo } from "./components/iframe/index.js";
29
29
  import { Image as po } from "./components/image/index.js";
30
- import { I as xo } from "./index-C-ESxR26.js";
30
+ import { I as xo } from "./index-DMGGDV9J.js";
31
31
  import { Link as ao } from "./components/link/index.js";
32
32
  import { List as io } from "./components/list/index.js";
33
33
  import { Loading as no } from "./components/loading/index.js";
package/dist/tokens.json CHANGED
@@ -365,7 +365,7 @@
365
365
  },
366
366
  "com.solibo": {
367
367
  "packageName": "@solibo/solibo-ui",
368
- "packageVersion": "1.0.17"
368
+ "packageVersion": "1.0.18"
369
369
  }
370
370
  },
371
371
  "$name": "Solibo UI Tokens",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "pnpm run tokens:build && vite build --watch",
@@ -1,76 +0,0 @@
1
- import { jsxs as $, Fragment as G, jsx as a } from "react/jsx-runtime";
2
- import { t as p } from "./classix-DG18itHa.js";
3
- import { useState as E, useEffect as F } from "react";
4
- import { i as H } from "./icons-BkaMeh-J.js";
5
- import { u as U, c as W } from "./use-touched-B999bBr8.js";
6
- import './assets/index45.css';function k(t) {
7
- return t && `${t[0].toLocaleUpperCase()}${t.slice(1)}`;
8
- }
9
- function A(t) {
10
- const e = k(t);
11
- return e && !e.endsWith(":") ? `${e}:` : e;
12
- }
13
- const D = "_input_p0mz8_3", J = "_touched_p0mz8_43", K = "_label_p0mz8_48", M = "_inline_p0mz8_69", O = "_code_p0mz8_86", o = {
14
- input: D,
15
- touched: J,
16
- label: K,
17
- inline: M,
18
- code: O
19
- };
20
- function q({
21
- className: t,
22
- defaultCountryCode: e = "+47",
23
- disabled: c = !1,
24
- icon: _,
25
- label: m,
26
- onBlur: P,
27
- placeholder: f,
28
- ref: g,
29
- required: d,
30
- style: v,
31
- type: n = "text",
32
- variant: x = "default",
33
- ...z
34
- }) {
35
- const [h, L] = E(""), [s, b] = E(""), {
36
- name: B,
37
- onChange: l,
38
- pattern: S,
39
- value: r,
40
- ...T
41
- } = z, {
42
- touched: I,
43
- onBlur: V
44
- } = U(r === ""), u = _ && n !== "radio" && n !== "datetime-local" ? _ : void 0, N = m && x === "inline" ? A(m) : m, j = u ? {
45
- ...v,
46
- "--icon-svg": H(u, !0)
47
- } : v, C = W(V, P);
48
- F(() => {
49
- if (l && n === "tel") {
50
- const i = {
51
- name: B,
52
- value: s ? (h || e).split(" ").join("") + s.split(" ").join("") : void 0
53
- };
54
- l({
55
- target: i,
56
- currentTarget: i
57
- });
58
- }
59
- }, [h, e, B, l, s, n]), F(() => {
60
- n === "tel" && !r && (b(""), L(""));
61
- }, [n, r]);
62
- const w = /* @__PURE__ */ $(G, { children: [
63
- /* @__PURE__ */ a("input", { disabled: c, hidden: !0, onChange: l, pattern: void 0, placeholder: f, ref: g, type: n, value: r }),
64
- /* @__PURE__ */ a("input", { type: "text", className: p(o.code, o.input), disabled: c, maxLength: 5, onChange: (i) => L(i.target.value), placeholder: e, value: h }),
65
- /* @__PURE__ */ a("input", { ...T, type: "tel", className: p(o.input, t, I && o.touched), "data-icon": u ? "true" : void 0, disabled: c, maxLength: 14, name: void 0, onChange: (i) => b(i.target.value), onBlur: C, pattern: S, required: d, style: j, value: s })
66
- ] });
67
- return /* @__PURE__ */ $("label", { className: p(o.label, x === "inline" && o.inline), "data-component": "input", children: [
68
- N && /* @__PURE__ */ a("span", { "data-required": d || void 0, children: N }),
69
- n === "tel" ? w : /* @__PURE__ */ a("input", { ...z, ref: g, className: p(o.input, t, I && o.touched), "data-icon": u ? "true" : void 0, disabled: c, onBlur: C, placeholder: f, required: d, style: j, type: n })
70
- ] });
71
- }
72
- export {
73
- q as I,
74
- A as f
75
- };
76
- //# sourceMappingURL=index-C-ESxR26.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-C-ESxR26.js","sources":["../src/lib/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/lib/compose-event-handlers';\nimport { formatInlineLabel } from '@/lib/text';\nimport { useTouched } from '@/lib/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon, true),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && <span data-required={required || undefined}>{displayLabel}</span>}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":";;;;;AAAO,SAASA,EAAsBC,GAAuB;AAC3D,SAAOA,KAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EA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Y,YAAY8B,EAAOI,MAAM,GAAE,kBAAA,SACvEnB,UAAAA;AAAAA,IAAAA,KAAgB,gBAAAa,EAAC,QAAA,EAAK,iBAAe/B,KAAYiB,QAAYC,UAAAA,GAAa;AAAA,IAC1EhB,MAAS,QACR0B,IAEA,gBAAAG,EAAC,SAAA,EACC,GAAI3B,GACJ,KAAAL,GACA,WAAWiC,EAAGC,EAAOE,OAAO3C,GAAWsB,KAAWmB,EAAOnB,OAAO,GAChE,aAAWE,IAAY,SAASC,QAChC,UAAAvB,GACA,QAAQ2B,GACR,aAAAvB,GACA,UAAAE,GACA,OAAOmB,GACP,MAAAjB,EAAA,CAAW;AAAA,EAAA,GAGjB;AAEJ;"}
@@ -1,2 +0,0 @@
1
- "use strict";require('./assets/index45.css');const o=require("react/jsx-runtime"),d=require("./classix-5H4IWnMA.cjs"),p=require("react"),V=require("./icons-Lq3pr85X.cjs"),E=require("./use-touched-Bq5Gjbpz.cjs");function w(t){return t&&`${t[0].toLocaleUpperCase()}${t.slice(1)}`}function S(t){const n=w(t);return n&&!n.endsWith(":")?`${n}:`:n}const G="_input_p0mz8_3",H="_touched_p0mz8_43",U="_label_p0mz8_48",W="_inline_p0mz8_69",k="_code_p0mz8_86",s={input:G,touched:H,label:U,inline:W,code:k};function A({className:t,defaultCountryCode:n="+47",disabled:c=!1,icon:x,label:h,onBlur:T,placeholder:g,ref:v,required:m,style:f,type:e="text",variant:j="default",...L}){const[_,b]=p.useState(""),[u,z]=p.useState(""),{name:I,onChange:a,pattern:$,value:l,...F}=L,{touched:B,onBlur:P}=E.useTouched(l===""),r=x&&e!=="radio"&&e!=="datetime-local"?x:void 0,N=h&&j==="inline"?S(h):h,q=r?{...f,"--icon-svg":V.iconSVG(r,!0)}:f,C=E.composeEventHandlers(P,T);p.useEffect(()=>{if(a&&e==="tel"){const i={name:I,value:u?(_||n).split(" ").join("")+u.split(" ").join(""):void 0};a({target:i,currentTarget:i})}},[_,n,I,a,u,e]),p.useEffect(()=>{e==="tel"&&!l&&(z(""),b(""))},[e,l]);const R=o.jsxs(o.Fragment,{children:[o.jsx("input",{disabled:c,hidden:!0,onChange:a,pattern:void 0,placeholder:g,ref:v,type:e,value:l}),o.jsx("input",{type:"text",className:d.t(s.code,s.input),disabled:c,maxLength:5,onChange:i=>b(i.target.value),placeholder:n,value:_}),o.jsx("input",{...F,type:"tel",className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,maxLength:14,name:void 0,onChange:i=>z(i.target.value),onBlur:C,pattern:$,required:m,style:q,value:u})]});return o.jsxs("label",{className:d.t(s.label,j==="inline"&&s.inline),"data-component":"input",children:[N&&o.jsx("span",{"data-required":m||void 0,children:N}),e==="tel"?R:o.jsx("input",{...L,ref:v,className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,onBlur:C,placeholder:g,required:m,style:q,type:e})]})}exports.Input=A;exports.formatInlineLabel=S;
2
- //# sourceMappingURL=index-lALToPBm.cjs.map