@udixio/ui-react 2.3.3 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +46 -46
- package/package.json +3 -3
- package/src/lib/config/define-config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 2.4.1 (2025-10-17)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated @udixio/tailwind to 2.3.5
|
|
6
|
+
|
|
7
|
+
## 2.4.0 (2025-10-17)
|
|
8
|
+
|
|
9
|
+
### 🚀 Features
|
|
10
|
+
|
|
11
|
+
- **theme:** update variant handling and enhance `UdixioVariant` support ([e413d3d](https://github.com/Udixio/UI/commit/e413d3d))
|
|
12
|
+
|
|
13
|
+
### 🧱 Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated @udixio/tailwind to 2.3.4
|
|
16
|
+
- Updated @udixio/theme to 2.1.0
|
|
17
|
+
|
|
18
|
+
### ❤️ Thank You
|
|
19
|
+
|
|
20
|
+
- Joël VIGREUX
|
|
21
|
+
|
|
1
22
|
## 2.3.3 (2025-10-16)
|
|
2
23
|
|
|
3
24
|
### 🩹 Fixes
|
package/dist/index.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
3
3
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
4
4
|
* Copyright 2025 Fonticons, Inc.
|
|
5
|
-
*/var mt={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},ae={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},ht={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const pt=({variant:e="standard",className:t,children:n,title:o,position:r="right",extended:c,divider:d,onExtendedChange:a,closeIcon:f=ae,transition:l,...y})=>{l={duration:.3,...l};const[h,s]=i.useState(c??!0),m=Le({transition:l,title:o,position:r,closeIcon:f,className:t,children:n,onExtendedChange:a,divider:d,isExtended:h,extended:h,variant:e});i.useEffect(()=>{a==null||a(h??!1)},[h]),i.useEffect(()=>{c!=null&&s(c)},[c]);const x={close:{width:0},open:{width:"auto"}},v=()=>u.jsxs(u.Fragment,{children:[u.jsx(k.AnimatePresence,{children:e=="modal"&&h&&u.jsx(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:l,onClick:()=>s(!1),className:m.overlay})}),u.jsx(k.AnimatePresence,{children:h&&u.jsxs("div",{...y,className:m.slideSheet,style:{transition:l.duration+"s"},children:[u.jsxs(k.motion.div,{variants:x,initial:c===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[u.jsxs("div",{className:m.header,children:[o&&u.jsx("p",{className:m.title,children:o}),u.jsx(z,{size:"small",label:"close",icon:f,onClick:()=>s(!1),className:m.closeButton})]}),u.jsx("div",{className:m.content,style:{transition:l.duration+"s"},children:n})]}),(d==null&&e=="standard"?!0:d)&&u.jsx(qe,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?fe.createPortal(v(),document.body):v()},yt=({message:e,className:t,duration:n,closeIcon:o=ae,onClose:r,...c})=>{const[d,a]=i.useState(!0),f=Ie({className:t,closeIcon:o,duration:n,isVisible:d,onClose:r,message:e});i.useEffect(()=>{n&&setTimeout(()=>{l()},n)},[n]);const l=()=>{a(!1),r==null||r()};return u.jsx(k.AnimatePresence,{children:d&&u.jsx(k.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:f.snackbar,...c,children:u.jsxs("div",{className:f.container,children:[u.jsx("p",{className:f.supportingText,children:e}),u.jsx(z,{onClick:()=>l(),className:f.icon,icon:o,label:"close the snackbar"})]})})})},xt=({selected:e=!1,className:t,activeIcon:n,disabled:o=!1,inactiveIcon:r,onChange:c,onClick:d,onKeyDown:a,ref:f,...l})=>{const[y,h]=i.useState(e),s=j=>{o||(x(),d&&d(j))},m=j=>{o||((j.key===" "||j.key==="Enter")&&(j.preventDefault(),x()),a&&a(j))},x=()=>{h(!y),c==null||c(!y)},v=Re({className:t,isSelected:y,activeIcon:n,inactiveIcon:r,disabled:o,selected:y,onChange:c}),w=i.useRef(null),L=f||w;return u.jsxs(k.motion.div,{role:"switch","aria-checked":y,tabIndex:o?-1:0,onKeyDown:m,onClick:s,ref:L,className:v.switch,...l,children:[u.jsx("input",{type:"hidden",value:y?"1":"0"}),u.jsxs(k.motion.div,{layout:!0,style:{translate:y?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:v.handleContainer,children:[u.jsx("div",{className:v.handle,children:(y?n:r)&&u.jsx(_,{className:v.icon,icon:y?n:r})}),u.jsx("div",{className:v.handleStateLayer})]})]})},Oe=({className:e,onClick:t,label:n,variant:o="primary",href:r,icon:c,selectedTab:d,setSelectedTab:a,tabsId:f,index:l,onTabSelected:y,scrollable:h=!1,selected:s=!1,ref:m,...x})=>{const v=i.useRef(null),w=m||v,[L,j]=i.useState(s);i.useEffect(()=>{s&&d==null?j(!0):j(d==l&&l!=null)},[d]),i.useEffect(()=>{d==l&&y&&y({ref:w,index:l||0,label:n,icon:c})},[d]);const M=r?"a":"button",E=$=>{a&&a(l??null),t&&t($)},N=ke({className:e,onTabSelected:y,scrollable:h,selectedTab:d,index:l,tabsId:f,selected:L,variant:o,icon:c,label:n,isSelected:L,setSelectedTab:a,href:r});return u.jsxs(M,{...x,role:"tab","aria-selected":L,ref:w,href:r,className:N.tab,onClick:E,...x,children:[u.jsx("span",{className:N.stateLayer,children:u.jsx(J,{colorName:o==="primary"&&L?"primary":"on-surface",triggerRef:w})}),u.jsxs("span",{className:N.content,children:[c&&u.jsx(_,{icon:c,className:N.icon}),u.jsx("span",{className:N.label,children:n}),L&&u.jsx(k.motion.span,{layoutId:`underline-${f}`,className:N.underline,transition:{duration:.3}})]})]})},gt=({variant:e="primary",onTabSelected:t,children:n,className:o,selectedTab:r,setSelectedTab:c,scrollable:d=!1})=>{const[a,f]=i.useState(null);let l;r==0||r!=null?l=r:l=a;const y=c||f,h=i.Children.toArray(n).filter(w=>i.isValidElement(w)&&w.type===Oe),s=i.useRef(null),m=w=>{if(t==null||t(w),d){const L=s.current,j=w.ref.current;if(L&&j){const M=j.offsetLeft+j.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:M,behavior:"smooth"})}}},x=i.useMemo(()=>oe(),[]),v=$e({children:n,onTabSelected:t,scrollable:d,selectedTab:l,setSelectedTab:y,className:o,variant:e});return u.jsx("div",{ref:s,role:"tablist",className:v.tabs,children:h.map((w,L)=>i.cloneElement(w,{key:L,index:L,variant:e,selectedTab:l,setSelectedTab:y,tabsId:x,onTabSelected:m,scrollable:d}))})},vt=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:o,suffix:r,name:c,label:d,className:a,supportingText:f,trailingIcon:l,leadingIcon:y,type:h="text",textLine:s="singleLine",autoComplete:m="on",onChange:x,value:v,showSupportingText:w=!1,...L})=>{const[j,M]=i.useState(v??""),[E,N]=i.useState(!1),[$,D]=i.useState(!1),[P,I]=i.useState(w);i.useEffect(()=>{M(v??"")},[v]),i.useEffect(()=>{n!=null&&n.length?D(!0):D(!1)},[n]),i.useEffect(()=>{w?I(w):f!=null&&f.length?I(!0):I(!1)},[P,f]),i.useEffect(()=>{E&&D(!1)},[E]);const g=i.useRef(null),C=()=>{g.current&&!E&&g.current.focus()},q=()=>{N(!0)},H=B=>{const A=B.target.value;M(A),D(!1),typeof x=="function"&&x(A)},X=()=>{N(!1)},O=Ce({showSupportingText:P,isFocused:E,showErrorIcon:$,disabled:t,name:c,label:d,autoComplete:m,className:a,onChange:x,placeholder:o,supportingText:f,type:h,leadingIcon:y,trailingIcon:l,variant:e,errorText:n,value:j,suffix:r,textLine:s}),[K]=i.useState(oe());let S,b;switch(s){case"multiLine":b=Ke,S={};break;case"textAreas":b="textarea",S={};break;case"singleLine":default:b="input",S={type:h};break}return u.jsxs("div",{className:O.textField,...L,children:[u.jsxs("fieldset",{onClick:C,className:O.content,children:[u.jsx("div",{className:O.stateLayer}),y&&u.jsx("div",{className:O.leadingIcon,children:i.isValidElement(y)?y:u.jsx(_,{className:"w-5 h-5",icon:y})}),!(!E&&!j.length||e=="filled")&&u.jsx(k.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!E&&!j.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:u.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:u.jsx(k.motion.span,{className:O.label,transition:{duration:.3},layoutId:K,children:d})})}),u.jsxs("div",{className:"flex-1 relative",children:[(!E&&!j.length||e=="filled")&&u.jsx(k.motion.label,{htmlFor:c,className:p("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!E&&!j.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!E&&!j.length))}),transition:{duration:.3},children:u.jsx(k.motion.span,{className:O.label,transition:{duration:.3},layoutId:e=="outlined"?K:void 0,children:d})}),u.jsx(b,{ref:g,value:j,onChange:H,className:O.input,id:c,name:c,placeholder:E?o??void 0:"",onFocus:q,onBlur:X,disabled:t,autoComplete:m,"aria-invalid":!!(n!=null&&n.length),"aria-label":d,...S})]}),u.jsx("div",{className:O.activeIndicator}),!$&&u.jsxs(u.Fragment,{children:[l&&u.jsx("div",{onClick:B=>{B.stopPropagation()},className:O.trailingIcon,children:i.isValidElement(l)?l:u.jsx(_,{className:"h-5",icon:l})}),!l&&r&&u.jsx("span",{className:O.suffix,children:r})]}),$&&u.jsx("div",{className:p(O.trailingIcon,{" absolute right-0":!l}),children:u.jsx(_,{className:"h-5 text-error",icon:mt})})]}),P&&u.jsx("p",{className:O.supportingText,children:n!=null&&n.length?n:f!=null&&f.length?f:" "})]})},wt=F("navigationRailItem",({isSelected:e,icon:t,label:n,variant:o})=>({navigationRailItem:p(" group flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":o=="vertical","gap-0 h-[66px]":o=="horizontal"}),container:p(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":o=="horizontal","gap-0 ":o=="vertical","p-4":!n},n&&["px-4",{"py-1 ":o=="vertical","py-4 ":o=="horizontal"}]),stateLayer:p(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:p("size-6 flex"),label:p("w-fit mx-auto text-nowrap",{"text-label-large ":o=="horizontal","text-label-medium":o=="vertical"})})),He=({label:e})=>u.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:u.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Ue=({className:e,onClick:t,label:n,variant:o="vertical",href:r,icon:c,selectedItem:d,setSelectedItem:a,index:f,onItemSelected:l,selected:y=!1,ref:h,transition:s,isExtended:m,iconSelected:x,style:v,extendedOnly:w,children:L,...j})=>{L&&(n=L);const M=i.useRef(null),E=h||M,[N,$]=i.useState(y);i.useEffect(()=>{y&&d==null?$(!0):$(d==f&&f!=null)},[d]),i.useEffect(()=>{d==f&&l&&l({ref:E,index:f||0,label:n,icon:c})},[d]);const D=r?"a":"button",P=g=>{a&&a(f??null),t&&t(g)},I=wt({isExtended:m,extendedOnly:w,className:e,onItemSelected:l,selectedItem:d,index:f,transition:s,selected:N,variant:o,icon:c,label:n,isSelected:N,setSelectedItem:a,href:r,children:n,iconSelected:x});return s={duration:.3,...s},w&&!m?null:u.jsxs(D,{...j,role:"tab","aria-selected":N,ref:E,href:r,className:I.navigationRailItem,onClick:P,style:{transition:s.duration+"s",...v},children:[u.jsxs(k.motion.div,{style:{transition:o=="horizontal"?s.duration+`s, gap ${s.duration/2}s ${s.duration-s.duration/2}s`:s.duration+`s, gap ${s.duration/3}s ${s.duration-s.duration/3}s`},transition:s,className:I.container,children:[u.jsx(k.motion.div,{layout:!0,className:I.stateLayer}),c&&u.jsx(_,{icon:N?x:c,className:I.icon}),u.jsx(k.AnimatePresence,{children:o=="horizontal"&&(()=>{const g={width:0,opacity:0,transition:{...s}},C={width:"auto",opacity:1,transition:{...s,opacity:{duration:s.duration/2,delay:s.duration-s.duration/2}}};return u.jsx(k.motion.span,{initial:g,animate:C,exit:g,className:I.label,children:n})})()})]}),u.jsx(k.AnimatePresence,{children:o=="vertical"&&(()=>{const g={height:0,opacity:0,transition:{...s,opacity:{duration:0}}},C={height:"auto",opacity:1,transition:{...s,opacity:{duration:s.duration/3,delay:s.duration-s.duration/3}}};return u.jsx(k.motion.span,{initial:C,animate:C,exit:g,className:I.label,transition:s,children:n})})()})]})},bt=F("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:p("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:p("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:p(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),St=({variant:e="standard",onItemSelected:t,children:n,className:o,selectedItem:r,extended:c,alignment:d="top",menu:a={closed:{icon:ht,label:"Open menu"},opened:{icon:ae,label:"Close menu"}},style:f,onExtendedChange:l,transition:y,setSelectedItem:h})=>{const[s,m]=i.useState(null),[x,v]=i.useState(c);let w;r==0||r!=null?w=r:w=s;const L=h||m,j=i.useRef(null),M=I=>{t==null||t(I)};function E(I){const g=[];return i.Children.forEach(I,C=>{i.isValidElement(C)&&C.type===i.Fragment?g.push(...E(C.props.children)):g.push(C)}),g}const N=E(n),$=N.filter(I=>i.isValidElement(I)&&I.type===ne),D=bt({children:n,onItemSelected:t,selectedItem:w,setSelectedItem:L,className:o,variant:e,extended:x,isExtended:x,alignment:d,menu:a,transition:y,onExtendedChange:l});y={duration:.3,...y};const P=i.useRef(!1);return P.current=!1,i.useEffect(()=>{l==null||l(x??!1)},[x]),u.jsxs("div",{style:{transition:y.duration+"s",...f},ref:j,className:D.navigationRail,children:[u.jsxs("div",{className:D.header,children:[u.jsx(z,{onClick:()=>v(!x),label:x?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:D.menuIcon,icon:x?a.opened.icon:a==null?void 0:a.closed.icon}),$.length>0&&i.cloneElement($[0],{transition:y,isExtended:x,className:"!shadow-none mx-5 "+$[0].props.className})]}),u.jsx("div",{className:D.segments,children:(()=>{let I=0;return N.map(g=>i.isValidElement(g)&&g.type===Ue?i.cloneElement(g,{key:I,index:I++,variant:x?"horizontal":"vertical",selectedItem:w,setSelectedItem:L,onItemSelected:M,transition:y,extendedOnly:P.current,isExtended:x}):i.isValidElement(g)&&g.type===ne?null:i.isValidElement(g)&&g.type===He?(P.current=!0,x?i.cloneElement(g,{}):null):g)})()}),u.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function jt(e){return Q.defineConfig({variant:Q.Variants.Fidelity,...e,plugins:[new Q.FontPlugin(e),new me.TailwindPlugin(e)]})}exports.AnimateOnScrollInit=st;exports.Button=We;exports.Card=lt;exports.Carousel=at;exports.CarouselItem=Fe;exports.CustomScroll=De;exports.Divider=qe;exports.Fab=ne;exports.Icon=_;exports.IconButton=z;exports.NavigationRail=St;exports.NavigationRailItem=Ue;exports.NavigationRailSection=He;exports.ProgressIndicator=Pe;exports.RippleEffect=J;exports.SideSheet=pt;exports.Slider=ft;exports.SmoothScroll=Ze;exports.Snackbar=yt;exports.Switch=xt;exports.SyncedFixedWrapper=Ae;exports.Tab=Oe;exports.Tabs=gt;exports.TextField=vt;exports.ThemeProvider=ze;exports.ToolTip=le;exports.animateOnScroll=ot;exports.buttonStyle=xe;exports.cardStyle=ge;exports.carouselItemStyle=ve;exports.carouselStyle=we;exports.classNames=p;exports.classnames=pe;exports.customScrollStyle=Be;exports.defaultClassNames=F;exports.defineConfig=jt;exports.dividerStyle=be;exports.fabStyle=Se;exports.getClassNames=ye;exports.iconButtonStyle=je;exports.initAnimateOnScroll=se;exports.normalize=Ve;exports.progressIndicatorStyle=Ee;exports.sideSheetStyle=Le;exports.sliderStyle=Ne;exports.snackbarStyle=Ie;exports.switchStyle=Re;exports.tabStyle=ke;exports.tabsStyle=$e;exports.textFieldStyle=Ce;exports.toolStyle=Me;
|
|
5
|
+
*/var mt={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},ae={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},ht={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const pt=({variant:e="standard",className:t,children:n,title:o,position:r="right",extended:c,divider:d,onExtendedChange:a,closeIcon:f=ae,transition:l,...y})=>{l={duration:.3,...l};const[h,s]=i.useState(c??!0),m=Le({transition:l,title:o,position:r,closeIcon:f,className:t,children:n,onExtendedChange:a,divider:d,isExtended:h,extended:h,variant:e});i.useEffect(()=>{a==null||a(h??!1)},[h]),i.useEffect(()=>{c!=null&&s(c)},[c]);const x={close:{width:0},open:{width:"auto"}},v=()=>u.jsxs(u.Fragment,{children:[u.jsx(k.AnimatePresence,{children:e=="modal"&&h&&u.jsx(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:l,onClick:()=>s(!1),className:m.overlay})}),u.jsx(k.AnimatePresence,{children:h&&u.jsxs("div",{...y,className:m.slideSheet,style:{transition:l.duration+"s"},children:[u.jsxs(k.motion.div,{variants:x,initial:c===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[u.jsxs("div",{className:m.header,children:[o&&u.jsx("p",{className:m.title,children:o}),u.jsx(z,{size:"small",label:"close",icon:f,onClick:()=>s(!1),className:m.closeButton})]}),u.jsx("div",{className:m.content,style:{transition:l.duration+"s"},children:n})]}),(d==null&&e=="standard"?!0:d)&&u.jsx(qe,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?fe.createPortal(v(),document.body):v()},yt=({message:e,className:t,duration:n,closeIcon:o=ae,onClose:r,...c})=>{const[d,a]=i.useState(!0),f=Ie({className:t,closeIcon:o,duration:n,isVisible:d,onClose:r,message:e});i.useEffect(()=>{n&&setTimeout(()=>{l()},n)},[n]);const l=()=>{a(!1),r==null||r()};return u.jsx(k.AnimatePresence,{children:d&&u.jsx(k.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:f.snackbar,...c,children:u.jsxs("div",{className:f.container,children:[u.jsx("p",{className:f.supportingText,children:e}),u.jsx(z,{onClick:()=>l(),className:f.icon,icon:o,label:"close the snackbar"})]})})})},xt=({selected:e=!1,className:t,activeIcon:n,disabled:o=!1,inactiveIcon:r,onChange:c,onClick:d,onKeyDown:a,ref:f,...l})=>{const[y,h]=i.useState(e),s=j=>{o||(x(),d&&d(j))},m=j=>{o||((j.key===" "||j.key==="Enter")&&(j.preventDefault(),x()),a&&a(j))},x=()=>{h(!y),c==null||c(!y)},v=Re({className:t,isSelected:y,activeIcon:n,inactiveIcon:r,disabled:o,selected:y,onChange:c}),w=i.useRef(null),L=f||w;return u.jsxs(k.motion.div,{role:"switch","aria-checked":y,tabIndex:o?-1:0,onKeyDown:m,onClick:s,ref:L,className:v.switch,...l,children:[u.jsx("input",{type:"hidden",value:y?"1":"0"}),u.jsxs(k.motion.div,{layout:!0,style:{translate:y?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:v.handleContainer,children:[u.jsx("div",{className:v.handle,children:(y?n:r)&&u.jsx(_,{className:v.icon,icon:y?n:r})}),u.jsx("div",{className:v.handleStateLayer})]})]})},Oe=({className:e,onClick:t,label:n,variant:o="primary",href:r,icon:c,selectedTab:d,setSelectedTab:a,tabsId:f,index:l,onTabSelected:y,scrollable:h=!1,selected:s=!1,ref:m,...x})=>{const v=i.useRef(null),w=m||v,[L,j]=i.useState(s);i.useEffect(()=>{s&&d==null?j(!0):j(d==l&&l!=null)},[d]),i.useEffect(()=>{d==l&&y&&y({ref:w,index:l||0,label:n,icon:c})},[d]);const M=r?"a":"button",E=$=>{a&&a(l??null),t&&t($)},N=ke({className:e,onTabSelected:y,scrollable:h,selectedTab:d,index:l,tabsId:f,selected:L,variant:o,icon:c,label:n,isSelected:L,setSelectedTab:a,href:r});return u.jsxs(M,{...x,role:"tab","aria-selected":L,ref:w,href:r,className:N.tab,onClick:E,...x,children:[u.jsx("span",{className:N.stateLayer,children:u.jsx(J,{colorName:o==="primary"&&L?"primary":"on-surface",triggerRef:w})}),u.jsxs("span",{className:N.content,children:[c&&u.jsx(_,{icon:c,className:N.icon}),u.jsx("span",{className:N.label,children:n}),L&&u.jsx(k.motion.span,{layoutId:`underline-${f}`,className:N.underline,transition:{duration:.3}})]})]})},gt=({variant:e="primary",onTabSelected:t,children:n,className:o,selectedTab:r,setSelectedTab:c,scrollable:d=!1})=>{const[a,f]=i.useState(null);let l;r==0||r!=null?l=r:l=a;const y=c||f,h=i.Children.toArray(n).filter(w=>i.isValidElement(w)&&w.type===Oe),s=i.useRef(null),m=w=>{if(t==null||t(w),d){const L=s.current,j=w.ref.current;if(L&&j){const M=j.offsetLeft+j.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:M,behavior:"smooth"})}}},x=i.useMemo(()=>oe(),[]),v=$e({children:n,onTabSelected:t,scrollable:d,selectedTab:l,setSelectedTab:y,className:o,variant:e});return u.jsx("div",{ref:s,role:"tablist",className:v.tabs,children:h.map((w,L)=>i.cloneElement(w,{key:L,index:L,variant:e,selectedTab:l,setSelectedTab:y,tabsId:x,onTabSelected:m,scrollable:d}))})},vt=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:o,suffix:r,name:c,label:d,className:a,supportingText:f,trailingIcon:l,leadingIcon:y,type:h="text",textLine:s="singleLine",autoComplete:m="on",onChange:x,value:v,showSupportingText:w=!1,...L})=>{const[j,M]=i.useState(v??""),[E,N]=i.useState(!1),[$,D]=i.useState(!1),[P,I]=i.useState(w);i.useEffect(()=>{M(v??"")},[v]),i.useEffect(()=>{n!=null&&n.length?D(!0):D(!1)},[n]),i.useEffect(()=>{w?I(w):f!=null&&f.length?I(!0):I(!1)},[P,f]),i.useEffect(()=>{E&&D(!1)},[E]);const g=i.useRef(null),C=()=>{g.current&&!E&&g.current.focus()},q=()=>{N(!0)},H=B=>{const A=B.target.value;M(A),D(!1),typeof x=="function"&&x(A)},X=()=>{N(!1)},O=Ce({showSupportingText:P,isFocused:E,showErrorIcon:$,disabled:t,name:c,label:d,autoComplete:m,className:a,onChange:x,placeholder:o,supportingText:f,type:h,leadingIcon:y,trailingIcon:l,variant:e,errorText:n,value:j,suffix:r,textLine:s}),[K]=i.useState(oe());let S,b;switch(s){case"multiLine":b=Ke,S={};break;case"textAreas":b="textarea",S={};break;case"singleLine":default:b="input",S={type:h};break}return u.jsxs("div",{className:O.textField,...L,children:[u.jsxs("fieldset",{onClick:C,className:O.content,children:[u.jsx("div",{className:O.stateLayer}),y&&u.jsx("div",{className:O.leadingIcon,children:i.isValidElement(y)?y:u.jsx(_,{className:"w-5 h-5",icon:y})}),!(!E&&!j.length||e=="filled")&&u.jsx(k.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!E&&!j.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:u.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:u.jsx(k.motion.span,{className:O.label,transition:{duration:.3},layoutId:K,children:d})})}),u.jsxs("div",{className:"flex-1 relative",children:[(!E&&!j.length||e=="filled")&&u.jsx(k.motion.label,{htmlFor:c,className:p("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!E&&!j.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!E&&!j.length))}),transition:{duration:.3},children:u.jsx(k.motion.span,{className:O.label,transition:{duration:.3},layoutId:e=="outlined"?K:void 0,children:d})}),u.jsx(b,{ref:g,value:j,onChange:H,className:O.input,id:c,name:c,placeholder:E?o??void 0:"",onFocus:q,onBlur:X,disabled:t,autoComplete:m,"aria-invalid":!!(n!=null&&n.length),"aria-label":d,...S})]}),u.jsx("div",{className:O.activeIndicator}),!$&&u.jsxs(u.Fragment,{children:[l&&u.jsx("div",{onClick:B=>{B.stopPropagation()},className:O.trailingIcon,children:i.isValidElement(l)?l:u.jsx(_,{className:"h-5",icon:l})}),!l&&r&&u.jsx("span",{className:O.suffix,children:r})]}),$&&u.jsx("div",{className:p(O.trailingIcon,{" absolute right-0":!l}),children:u.jsx(_,{className:"h-5 text-error",icon:mt})})]}),P&&u.jsx("p",{className:O.supportingText,children:n!=null&&n.length?n:f!=null&&f.length?f:" "})]})},wt=F("navigationRailItem",({isSelected:e,icon:t,label:n,variant:o})=>({navigationRailItem:p(" group flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":o=="vertical","gap-0 h-[66px]":o=="horizontal"}),container:p(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":o=="horizontal","gap-0 ":o=="vertical","p-4":!n},n&&["px-4",{"py-1 ":o=="vertical","py-4 ":o=="horizontal"}]),stateLayer:p(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:p("size-6 flex"),label:p("w-fit mx-auto text-nowrap",{"text-label-large ":o=="horizontal","text-label-medium":o=="vertical"})})),He=({label:e})=>u.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:u.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Ue=({className:e,onClick:t,label:n,variant:o="vertical",href:r,icon:c,selectedItem:d,setSelectedItem:a,index:f,onItemSelected:l,selected:y=!1,ref:h,transition:s,isExtended:m,iconSelected:x,style:v,extendedOnly:w,children:L,...j})=>{L&&(n=L);const M=i.useRef(null),E=h||M,[N,$]=i.useState(y);i.useEffect(()=>{y&&d==null?$(!0):$(d==f&&f!=null)},[d]),i.useEffect(()=>{d==f&&l&&l({ref:E,index:f||0,label:n,icon:c})},[d]);const D=r?"a":"button",P=g=>{a&&a(f??null),t&&t(g)},I=wt({isExtended:m,extendedOnly:w,className:e,onItemSelected:l,selectedItem:d,index:f,transition:s,selected:N,variant:o,icon:c,label:n,isSelected:N,setSelectedItem:a,href:r,children:n,iconSelected:x});return s={duration:.3,...s},w&&!m?null:u.jsxs(D,{...j,role:"tab","aria-selected":N,ref:E,href:r,className:I.navigationRailItem,onClick:P,style:{transition:s.duration+"s",...v},children:[u.jsxs(k.motion.div,{style:{transition:o=="horizontal"?s.duration+`s, gap ${s.duration/2}s ${s.duration-s.duration/2}s`:s.duration+`s, gap ${s.duration/3}s ${s.duration-s.duration/3}s`},transition:s,className:I.container,children:[u.jsx(k.motion.div,{layout:!0,className:I.stateLayer}),c&&u.jsx(_,{icon:N?x:c,className:I.icon}),u.jsx(k.AnimatePresence,{children:o=="horizontal"&&(()=>{const g={width:0,opacity:0,transition:{...s}},C={width:"auto",opacity:1,transition:{...s,opacity:{duration:s.duration/2,delay:s.duration-s.duration/2}}};return u.jsx(k.motion.span,{initial:g,animate:C,exit:g,className:I.label,children:n})})()})]}),u.jsx(k.AnimatePresence,{children:o=="vertical"&&(()=>{const g={height:0,opacity:0,transition:{...s,opacity:{duration:0}}},C={height:"auto",opacity:1,transition:{...s,opacity:{duration:s.duration/3,delay:s.duration-s.duration/3}}};return u.jsx(k.motion.span,{initial:C,animate:C,exit:g,className:I.label,transition:s,children:n})})()})]})},bt=F("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:p("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:p("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:p(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),St=({variant:e="standard",onItemSelected:t,children:n,className:o,selectedItem:r,extended:c,alignment:d="top",menu:a={closed:{icon:ht,label:"Open menu"},opened:{icon:ae,label:"Close menu"}},style:f,onExtendedChange:l,transition:y,setSelectedItem:h})=>{const[s,m]=i.useState(null),[x,v]=i.useState(c);let w;r==0||r!=null?w=r:w=s;const L=h||m,j=i.useRef(null),M=I=>{t==null||t(I)};function E(I){const g=[];return i.Children.forEach(I,C=>{i.isValidElement(C)&&C.type===i.Fragment?g.push(...E(C.props.children)):g.push(C)}),g}const N=E(n),$=N.filter(I=>i.isValidElement(I)&&I.type===ne),D=bt({children:n,onItemSelected:t,selectedItem:w,setSelectedItem:L,className:o,variant:e,extended:x,isExtended:x,alignment:d,menu:a,transition:y,onExtendedChange:l});y={duration:.3,...y};const P=i.useRef(!1);return P.current=!1,i.useEffect(()=>{l==null||l(x??!1)},[x]),u.jsxs("div",{style:{transition:y.duration+"s",...f},ref:j,className:D.navigationRail,children:[u.jsxs("div",{className:D.header,children:[u.jsx(z,{onClick:()=>v(!x),label:x?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:D.menuIcon,icon:x?a.opened.icon:a==null?void 0:a.closed.icon}),$.length>0&&i.cloneElement($[0],{transition:y,isExtended:x,className:"!shadow-none mx-5 "+$[0].props.className})]}),u.jsx("div",{className:D.segments,children:(()=>{let I=0;return N.map(g=>i.isValidElement(g)&&g.type===Ue?i.cloneElement(g,{key:I,index:I++,variant:x?"horizontal":"vertical",selectedItem:w,setSelectedItem:L,onItemSelected:M,transition:y,extendedOnly:P.current,isExtended:x}):i.isValidElement(g)&&g.type===ne?null:i.isValidElement(g)&&g.type===He?(P.current=!0,x?i.cloneElement(g,{}):null):g)})()}),u.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function jt(e){return Q.defineConfig({variant:Q.Variants.Udixio,...e,plugins:[new Q.FontPlugin(e),new me.TailwindPlugin(e)]})}exports.AnimateOnScrollInit=st;exports.Button=We;exports.Card=lt;exports.Carousel=at;exports.CarouselItem=Fe;exports.CustomScroll=De;exports.Divider=qe;exports.Fab=ne;exports.Icon=_;exports.IconButton=z;exports.NavigationRail=St;exports.NavigationRailItem=Ue;exports.NavigationRailSection=He;exports.ProgressIndicator=Pe;exports.RippleEffect=J;exports.SideSheet=pt;exports.Slider=ft;exports.SmoothScroll=Ze;exports.Snackbar=yt;exports.Switch=xt;exports.SyncedFixedWrapper=Ae;exports.Tab=Oe;exports.Tabs=gt;exports.TextField=vt;exports.ThemeProvider=ze;exports.ToolTip=le;exports.animateOnScroll=ot;exports.buttonStyle=xe;exports.cardStyle=ge;exports.carouselItemStyle=ve;exports.carouselStyle=we;exports.classNames=p;exports.classnames=pe;exports.customScrollStyle=Be;exports.defaultClassNames=F;exports.defineConfig=jt;exports.dividerStyle=be;exports.fabStyle=Se;exports.getClassNames=ye;exports.iconButtonStyle=je;exports.initAnimateOnScroll=se;exports.normalize=Ve;exports.progressIndicatorStyle=Ee;exports.sideSheetStyle=Le;exports.sliderStyle=Ne;exports.snackbarStyle=Ie;exports.switchStyle=Re;exports.tabStyle=ke;exports.tabsStyle=$e;exports.textFieldStyle=Ce;exports.toolStyle=Me;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as f, jsxs as A, Fragment as te } from "react/jsx-runtime";
|
|
|
2
2
|
import { clsx as ve } from "clsx";
|
|
3
3
|
import { extendTailwindMerge as Ie } from "tailwind-merge";
|
|
4
4
|
import K, { useState as S, useEffect as R, useRef as D, useLayoutEffect as we, isValidElement as ee, cloneElement as oe, useMemo as ke, Children as Se, Fragment as $e } from "react";
|
|
5
|
-
import { motion as
|
|
5
|
+
import { motion as H, AnimatePresence as Q, useScroll as Me, useMotionValueEvent as fe, motionValue as Ce, useTransform as me } from "motion/react";
|
|
6
6
|
import { throttle as Re } from "throttle-debounce";
|
|
7
7
|
import { animate as Be } from "motion";
|
|
8
8
|
import { createPortal as xe } from "react-dom";
|
|
@@ -35,8 +35,8 @@ const Le = Ie({
|
|
|
35
35
|
font: ["font"]
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}), h = (...e) => Le(ve(e)),
|
|
39
|
-
function
|
|
38
|
+
}), h = (...e) => Le(ve(e)), He = (...e) => Le(ve(e));
|
|
39
|
+
function Fe(e) {
|
|
40
40
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
41
41
|
}
|
|
42
42
|
const Oe = (e) => {
|
|
@@ -57,7 +57,7 @@ const Oe = (e) => {
|
|
|
57
57
|
const n = t;
|
|
58
58
|
return Object.entries(t).map((l) => {
|
|
59
59
|
let [r, c] = l;
|
|
60
|
-
c = c.reverse(), r == e.default && c.unshift("relative"), c.unshift(
|
|
60
|
+
c = c.reverse(), r == e.default && c.unshift("relative"), c.unshift(Fe(r)), n[r] = He(...c);
|
|
61
61
|
}), n;
|
|
62
62
|
}, j = (e, t) => (n) => Oe({
|
|
63
63
|
classNameList: [n.className, t],
|
|
@@ -882,7 +882,7 @@ const Oe = (e) => {
|
|
|
882
882
|
)
|
|
883
883
|
] }),
|
|
884
884
|
(e === "circular-determinate" || e == "circular-indeterminate") && /* @__PURE__ */ f(
|
|
885
|
-
|
|
885
|
+
H.svg,
|
|
886
886
|
{
|
|
887
887
|
width: "48",
|
|
888
888
|
height: "48",
|
|
@@ -897,7 +897,7 @@ const Oe = (e) => {
|
|
|
897
897
|
className: d.progressIndicator,
|
|
898
898
|
...r,
|
|
899
899
|
children: /* @__PURE__ */ f(
|
|
900
|
-
|
|
900
|
+
H.circle,
|
|
901
901
|
{
|
|
902
902
|
cx: "50%",
|
|
903
903
|
cy: "50%",
|
|
@@ -973,7 +973,7 @@ const Oe = (e) => {
|
|
|
973
973
|
i(!1);
|
|
974
974
|
};
|
|
975
975
|
return /* @__PURE__ */ f(Q, { mode: "wait", children: (c || !c && !l) && /* @__PURE__ */ f(
|
|
976
|
-
|
|
976
|
+
H.div,
|
|
977
977
|
{
|
|
978
978
|
style: {
|
|
979
979
|
position: "absolute",
|
|
@@ -1029,7 +1029,7 @@ const Oe = (e) => {
|
|
|
1029
1029
|
draggable: c = !1,
|
|
1030
1030
|
throttleDuration: i = 75
|
|
1031
1031
|
}) => {
|
|
1032
|
-
var P,
|
|
1032
|
+
var P, F;
|
|
1033
1033
|
const s = D(null), u = D(null), [a, p] = S({
|
|
1034
1034
|
width: null,
|
|
1035
1035
|
height: null
|
|
@@ -1148,14 +1148,14 @@ const Oe = (e) => {
|
|
|
1148
1148
|
"div",
|
|
1149
1149
|
{
|
|
1150
1150
|
ref: u,
|
|
1151
|
-
style: t === "vertical" ? { height: ((P = o == null ? void 0 : o.current) == null ? void 0 : P.height) ?? "100%" } : { width: ((
|
|
1151
|
+
style: t === "vertical" ? { height: ((P = o == null ? void 0 : o.current) == null ? void 0 : P.height) ?? "100%" } : { width: ((F = o == null ? void 0 : o.current) == null ? void 0 : F.width) ?? "100%" },
|
|
1152
1152
|
className: V.track,
|
|
1153
1153
|
children: e
|
|
1154
1154
|
}
|
|
1155
1155
|
),
|
|
1156
1156
|
o.current && m.current && /* @__PURE__ */ A(te, { children: [
|
|
1157
1157
|
t === "vertical" && m.current.height > o.current.height && /* @__PURE__ */ f(
|
|
1158
|
-
|
|
1158
|
+
H.div,
|
|
1159
1159
|
{
|
|
1160
1160
|
className: "flex-none",
|
|
1161
1161
|
style: {
|
|
@@ -1164,7 +1164,7 @@ const Oe = (e) => {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
),
|
|
1166
1166
|
t === "horizontal" && m.current.width > o.current.width && /* @__PURE__ */ f(
|
|
1167
|
-
|
|
1167
|
+
H.div,
|
|
1168
1168
|
{
|
|
1169
1169
|
className: "flex-none",
|
|
1170
1170
|
style: {
|
|
@@ -1701,7 +1701,7 @@ const Xt = Ne, Yt = Ne, ht = ({
|
|
|
1701
1701
|
children: t
|
|
1702
1702
|
});
|
|
1703
1703
|
return /* @__PURE__ */ f(
|
|
1704
|
-
|
|
1704
|
+
H.div,
|
|
1705
1705
|
{
|
|
1706
1706
|
ref: s,
|
|
1707
1707
|
animate: { width: n + "px" },
|
|
@@ -1749,18 +1749,18 @@ const Xt = Ne, Yt = Ne, ht = ({
|
|
|
1749
1749
|
(T) => (T - J) / Math.abs(U[1] - U[0])
|
|
1750
1750
|
);
|
|
1751
1751
|
}
|
|
1752
|
-
let
|
|
1752
|
+
let F = y.map((U, J) => {
|
|
1753
1753
|
if (!I[J].current || !v.current) return 0;
|
|
1754
1754
|
let ne = J / (y.length - 1);
|
|
1755
1755
|
return ne > 1 && (ne = 1), ne < 0 && (ne = 0), ne;
|
|
1756
1756
|
});
|
|
1757
|
-
|
|
1757
|
+
F = P(F, x);
|
|
1758
1758
|
let $ = ((((O = o.current) == null ? void 0 : O.clientWidth) ?? b) - (i[0] + s)) / (i[1] + s);
|
|
1759
|
-
return
|
|
1759
|
+
return F.map((U, J) => ({ value: Math.abs(U), originalIndex: J })).sort((U, J) => U.value - J.value).forEach((U, J) => {
|
|
1760
1760
|
J === 0 && V(U.originalIndex);
|
|
1761
1761
|
let T = pt($, [0, 1], [0, i[1]]);
|
|
1762
|
-
T < i[0] && (T = i[0]), $--,
|
|
1763
|
-
}),
|
|
1762
|
+
T < i[0] && (T = i[0]), $--, F[U.originalIndex] = T;
|
|
1763
|
+
}), F;
|
|
1764
1764
|
}, I = D([]).current, [M, V] = S(0);
|
|
1765
1765
|
R(() => {
|
|
1766
1766
|
u && u(M);
|
|
@@ -1806,7 +1806,7 @@ const Xt = Ne, Yt = Ne, ht = ({
|
|
|
1806
1806
|
onScroll: X,
|
|
1807
1807
|
scrollSize: q,
|
|
1808
1808
|
children: /* @__PURE__ */ f(
|
|
1809
|
-
|
|
1809
|
+
H.div,
|
|
1810
1810
|
{
|
|
1811
1811
|
className: d.track,
|
|
1812
1812
|
ref: v,
|
|
@@ -1942,7 +1942,7 @@ const Ee = ({
|
|
|
1942
1942
|
return /* @__PURE__ */ A(te, { children: [
|
|
1943
1943
|
W,
|
|
1944
1944
|
/* @__PURE__ */ f(Q, { children: w && /* @__PURE__ */ f(st, { targetRef: o, children: /* @__PURE__ */ f(
|
|
1945
|
-
|
|
1945
|
+
H.div,
|
|
1946
1946
|
{
|
|
1947
1947
|
initial: { opacity: d ? 1 : 0 },
|
|
1948
1948
|
animate: { opacity: 1 },
|
|
@@ -1953,7 +1953,7 @@ const Ee = ({
|
|
|
1953
1953
|
onMouseEnter: B,
|
|
1954
1954
|
onMouseLeave: N,
|
|
1955
1955
|
children: /* @__PURE__ */ A(
|
|
1956
|
-
|
|
1956
|
+
H.div,
|
|
1957
1957
|
{
|
|
1958
1958
|
className: k.container,
|
|
1959
1959
|
layoutId: "tool-tip",
|
|
@@ -2067,7 +2067,7 @@ const Ee = ({
|
|
|
2067
2067
|
) }),
|
|
2068
2068
|
/* @__PURE__ */ f(Z, { icon: i, className: d.icon }),
|
|
2069
2069
|
/* @__PURE__ */ f(Q, { children: s && /* @__PURE__ */ f(
|
|
2070
|
-
|
|
2070
|
+
H.span,
|
|
2071
2071
|
{
|
|
2072
2072
|
variants: w,
|
|
2073
2073
|
initial: "hidden",
|
|
@@ -2271,9 +2271,9 @@ const Ee = ({
|
|
|
2271
2271
|
b = m(x);
|
|
2272
2272
|
} else
|
|
2273
2273
|
return;
|
|
2274
|
-
n != null ? x = Math.round((x - d()) / n) * n + d() : s && (x = s.reduce((P,
|
|
2275
|
-
let O =
|
|
2276
|
-
return O = Math.abs(O - x), U = Math.abs(U - x), O < U ?
|
|
2274
|
+
n != null ? x = Math.round((x - d()) / n) * n + d() : s && (x = s.reduce((P, F, $) => {
|
|
2275
|
+
let O = F.value === 1 / 0 ? o() : F.value === -1 / 0 ? d() : F.value, U = P.value === 1 / 0 ? o() : P.value === -1 / 0 ? d() : P.value;
|
|
2276
|
+
return O = Math.abs(O - x), U = Math.abs(U - x), O < U ? F : P;
|
|
2277
2277
|
}).value), x >= o() && (x = o(!0)), x <= d() && (x = d(!0)), b = m(x), N(x), M(b), a && a(x);
|
|
2278
2278
|
}, [G, Y] = S(0);
|
|
2279
2279
|
return R(() => {
|
|
@@ -2301,7 +2301,7 @@ const Ee = ({
|
|
|
2301
2301
|
if (n)
|
|
2302
2302
|
q({ value: B - n });
|
|
2303
2303
|
else if (s) {
|
|
2304
|
-
const x = s.slice(0).reverse().find((P,
|
|
2304
|
+
const x = s.slice(0).reverse().find((P, F, $) => B === 1 / 0 ? F === 1 : P.value < B);
|
|
2305
2305
|
x && q({ value: x.value });
|
|
2306
2306
|
}
|
|
2307
2307
|
break;
|
|
@@ -2331,7 +2331,7 @@ const Ee = ({
|
|
|
2331
2331
|
}
|
|
2332
2332
|
),
|
|
2333
2333
|
/* @__PURE__ */ f("div", { className: C.handle, children: /* @__PURE__ */ f(Q, { children: v && /* @__PURE__ */ f(
|
|
2334
|
-
|
|
2334
|
+
H.div,
|
|
2335
2335
|
{
|
|
2336
2336
|
className: C.valueIndicator,
|
|
2337
2337
|
initial: "hidden",
|
|
@@ -2363,8 +2363,8 @@ const Ee = ({
|
|
|
2363
2363
|
className: "w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",
|
|
2364
2364
|
children: s && s.map((b, x) => {
|
|
2365
2365
|
let P = null;
|
|
2366
|
-
const
|
|
2367
|
-
return $ <= I -
|
|
2366
|
+
const F = (v ? 9 : 10) / G * 100, $ = m(b.value);
|
|
2367
|
+
return $ <= I - F ? P = !0 : $ >= I + F && (P = !1), /* @__PURE__ */ f(
|
|
2368
2368
|
"div",
|
|
2369
2369
|
{
|
|
2370
2370
|
className: h(C.dot, {
|
|
@@ -2443,7 +2443,7 @@ const Kt = ({
|
|
|
2443
2443
|
}
|
|
2444
2444
|
}, v = () => /* @__PURE__ */ A(te, { children: [
|
|
2445
2445
|
/* @__PURE__ */ f(Q, { children: e == "modal" && m && /* @__PURE__ */ f(
|
|
2446
|
-
|
|
2446
|
+
H.div,
|
|
2447
2447
|
{
|
|
2448
2448
|
initial: { opacity: 0 },
|
|
2449
2449
|
animate: { opacity: 1 },
|
|
@@ -2461,7 +2461,7 @@ const Kt = ({
|
|
|
2461
2461
|
style: { transition: a.duration + "s" },
|
|
2462
2462
|
children: [
|
|
2463
2463
|
/* @__PURE__ */ A(
|
|
2464
|
-
|
|
2464
|
+
H.div,
|
|
2465
2465
|
{
|
|
2466
2466
|
variants: y,
|
|
2467
2467
|
initial: c === !1 ? "open" : "close",
|
|
@@ -2524,7 +2524,7 @@ const Kt = ({
|
|
|
2524
2524
|
s(!1), r == null || r();
|
|
2525
2525
|
};
|
|
2526
2526
|
return /* @__PURE__ */ f(Q, { children: i && /* @__PURE__ */ f(
|
|
2527
|
-
|
|
2527
|
+
H.div,
|
|
2528
2528
|
{
|
|
2529
2529
|
initial: { height: 0 },
|
|
2530
2530
|
animate: { height: "auto" },
|
|
@@ -2574,7 +2574,7 @@ const Kt = ({
|
|
|
2574
2574
|
onChange: c
|
|
2575
2575
|
}), w = D(null), E = u || w;
|
|
2576
2576
|
return /* @__PURE__ */ A(
|
|
2577
|
-
|
|
2577
|
+
H.div,
|
|
2578
2578
|
{
|
|
2579
2579
|
role: "switch",
|
|
2580
2580
|
"aria-checked": p,
|
|
@@ -2587,7 +2587,7 @@ const Kt = ({
|
|
|
2587
2587
|
children: [
|
|
2588
2588
|
/* @__PURE__ */ f("input", { type: "hidden", value: p ? "1" : "0" }),
|
|
2589
2589
|
/* @__PURE__ */ A(
|
|
2590
|
-
|
|
2590
|
+
H.div,
|
|
2591
2591
|
{
|
|
2592
2592
|
layout: !0,
|
|
2593
2593
|
style: { translate: p ? "50%" : "-50%" },
|
|
@@ -2680,7 +2680,7 @@ const Kt = ({
|
|
|
2680
2680
|
c && /* @__PURE__ */ f(Z, { icon: c, className: I.icon }),
|
|
2681
2681
|
/* @__PURE__ */ f("span", { className: I.label, children: n }),
|
|
2682
2682
|
E && /* @__PURE__ */ f(
|
|
2683
|
-
|
|
2683
|
+
H.span,
|
|
2684
2684
|
{
|
|
2685
2685
|
layoutId: `underline-${u}`,
|
|
2686
2686
|
className: I.underline,
|
|
@@ -2771,8 +2771,8 @@ const Kt = ({
|
|
|
2771
2771
|
}, X = () => {
|
|
2772
2772
|
I(!0);
|
|
2773
2773
|
}, q = (P) => {
|
|
2774
|
-
const
|
|
2775
|
-
B(
|
|
2774
|
+
const F = P.target.value;
|
|
2775
|
+
B(F), V(!1), typeof y == "function" && y(F);
|
|
2776
2776
|
}, G = () => {
|
|
2777
2777
|
I(!1);
|
|
2778
2778
|
}, Y = tt({
|
|
@@ -2814,7 +2814,7 @@ const Kt = ({
|
|
|
2814
2814
|
/* @__PURE__ */ f("div", { className: Y.stateLayer }),
|
|
2815
2815
|
p && /* @__PURE__ */ f("div", { className: Y.leadingIcon, children: K.isValidElement(p) ? p : /* @__PURE__ */ f(Z, { className: "w-5 h-5", icon: p }) }),
|
|
2816
2816
|
!(!N && !L.length || e == "filled") && /* @__PURE__ */ f(
|
|
2817
|
-
|
|
2817
|
+
H.legend,
|
|
2818
2818
|
{
|
|
2819
2819
|
variants: {
|
|
2820
2820
|
hidden: { width: 0, padding: 0 },
|
|
@@ -2825,7 +2825,7 @@ const Kt = ({
|
|
|
2825
2825
|
className: "max-w-full ml-2 px-2 text-body-small h-0",
|
|
2826
2826
|
transition: { duration: 0.2 },
|
|
2827
2827
|
children: /* @__PURE__ */ f("span", { className: "transform inline-flex -translate-y-1/2", children: /* @__PURE__ */ f(
|
|
2828
|
-
|
|
2828
|
+
H.span,
|
|
2829
2829
|
{
|
|
2830
2830
|
className: Y.label,
|
|
2831
2831
|
transition: { duration: 0.3 },
|
|
@@ -2837,7 +2837,7 @@ const Kt = ({
|
|
|
2837
2837
|
),
|
|
2838
2838
|
/* @__PURE__ */ A("div", { className: "flex-1 relative", children: [
|
|
2839
2839
|
(!N && !L.length || e == "filled") && /* @__PURE__ */ f(
|
|
2840
|
-
|
|
2840
|
+
H.label,
|
|
2841
2841
|
{
|
|
2842
2842
|
htmlFor: c,
|
|
2843
2843
|
className: h(
|
|
@@ -2849,7 +2849,7 @@ const Kt = ({
|
|
|
2849
2849
|
),
|
|
2850
2850
|
transition: { duration: 0.3 },
|
|
2851
2851
|
children: /* @__PURE__ */ f(
|
|
2852
|
-
|
|
2852
|
+
H.span,
|
|
2853
2853
|
{
|
|
2854
2854
|
className: Y.label,
|
|
2855
2855
|
transition: { duration: 0.3 },
|
|
@@ -3021,7 +3021,7 @@ const Kt = ({
|
|
|
3021
3021
|
style: { transition: o.duration + "s", ...v },
|
|
3022
3022
|
children: [
|
|
3023
3023
|
/* @__PURE__ */ A(
|
|
3024
|
-
|
|
3024
|
+
H.div,
|
|
3025
3025
|
{
|
|
3026
3026
|
style: {
|
|
3027
3027
|
transition: l == "horizontal" ? o.duration + `s, gap ${o.duration / 2}s ${o.duration - o.duration / 2}s` : o.duration + `s, gap ${o.duration / 3}s ${o.duration - o.duration / 3}s`
|
|
@@ -3029,7 +3029,7 @@ const Kt = ({
|
|
|
3029
3029
|
transition: o,
|
|
3030
3030
|
className: k.container,
|
|
3031
3031
|
children: [
|
|
3032
|
-
/* @__PURE__ */ f(
|
|
3032
|
+
/* @__PURE__ */ f(H.div, { layout: !0, className: k.stateLayer }),
|
|
3033
3033
|
c && /* @__PURE__ */ f(
|
|
3034
3034
|
Z,
|
|
3035
3035
|
{
|
|
@@ -3056,7 +3056,7 @@ const Kt = ({
|
|
|
3056
3056
|
}
|
|
3057
3057
|
};
|
|
3058
3058
|
return /* @__PURE__ */ f(
|
|
3059
|
-
|
|
3059
|
+
H.span,
|
|
3060
3060
|
{
|
|
3061
3061
|
initial: g,
|
|
3062
3062
|
animate: C,
|
|
@@ -3091,7 +3091,7 @@ const Kt = ({
|
|
|
3091
3091
|
}
|
|
3092
3092
|
};
|
|
3093
3093
|
return /* @__PURE__ */ f(
|
|
3094
|
-
|
|
3094
|
+
H.span,
|
|
3095
3095
|
{
|
|
3096
3096
|
initial: C,
|
|
3097
3097
|
animate: C,
|
|
@@ -3225,7 +3225,7 @@ const Kt = ({
|
|
|
3225
3225
|
};
|
|
3226
3226
|
function Tt(e) {
|
|
3227
3227
|
return We({
|
|
3228
|
-
variant: Ae.
|
|
3228
|
+
variant: Ae.Udixio,
|
|
3229
3229
|
...e,
|
|
3230
3230
|
plugins: [new Pe(e), new be(e)]
|
|
3231
3231
|
});
|
|
@@ -3263,7 +3263,7 @@ export {
|
|
|
3263
3263
|
Ye as carouselItemStyle,
|
|
3264
3264
|
je as carouselStyle,
|
|
3265
3265
|
h as classNames,
|
|
3266
|
-
|
|
3266
|
+
He as classnames,
|
|
3267
3267
|
ot as customScrollStyle,
|
|
3268
3268
|
j as defaultClassNames,
|
|
3269
3269
|
Tt as defineConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@udixio/ui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"react": "^19.1.1",
|
|
38
38
|
"react-dom": "^19.1.1",
|
|
39
|
-
"@udixio/
|
|
40
|
-
"@udixio/
|
|
39
|
+
"@udixio/tailwind": "2.3.5",
|
|
40
|
+
"@udixio/theme": "2.1.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
@@ -9,7 +9,7 @@ import { TailwindPlugin } from '@udixio/tailwind';
|
|
|
9
9
|
|
|
10
10
|
export function defineConfig(configObject: ConfigInterface): ConfigTheme {
|
|
11
11
|
return defineConfigTheme({
|
|
12
|
-
variant: Variants.
|
|
12
|
+
variant: Variants.Udixio,
|
|
13
13
|
...configObject,
|
|
14
14
|
plugins: [new FontPlugin(configObject), new TailwindPlugin(configObject)],
|
|
15
15
|
});
|