@kubit-ui-web/react-components 2.0.0-beta.1 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +320 -46
  2. package/dist/cjs/components/carousel/hooks/useCarousel.js +1 -1
  3. package/dist/cjs/components/carousel/hooks/useCarouselKeyNavigation.js +1 -1
  4. package/dist/cjs/components/carousel/hooks/useCarouselSwipe.js +1 -1
  5. package/dist/cjs/components/carousel/hooks/utils/calc.utils.js +1 -1
  6. package/dist/cjs/components/carousel/hooks/utils/dom.utils.js +1 -1
  7. package/dist/cjs/components/popover/hooks/positioning/middlewareUtils.js +1 -1
  8. package/dist/cjs/components/popover/hooks/usePopoverLifecycle.js +1 -1
  9. package/dist/cjs/components/popover/hooks/usePopoverPositioning.js +1 -1
  10. package/dist/cjs/components/popover/popover.js +1 -1
  11. package/dist/cjs/components/text/textStandAlone.js +1 -1
  12. package/dist/cjs/components/tooltip/hooks/useTooltip.js +1 -1
  13. package/dist/cjs/lib/provider/cssProvider/stats/stats.js +1 -1
  14. package/dist/cjs/lib/provider/stylesProvider/stylesProvider.js +1 -1
  15. package/dist/esm/components/carousel/hooks/useCarousel.js +1 -1
  16. package/dist/esm/components/carousel/hooks/useCarouselKeyNavigation.js +1 -1
  17. package/dist/esm/components/carousel/hooks/useCarouselSwipe.js +1 -1
  18. package/dist/esm/components/carousel/hooks/utils/calc.utils.js +1 -1
  19. package/dist/esm/components/carousel/hooks/utils/dom.utils.js +1 -1
  20. package/dist/esm/components/popover/hooks/positioning/middlewareUtils.js +1 -1
  21. package/dist/esm/components/popover/hooks/usePopoverLifecycle.js +1 -1
  22. package/dist/esm/components/popover/hooks/usePopoverPositioning.js +1 -1
  23. package/dist/esm/components/popover/popover.js +1 -1
  24. package/dist/esm/components/text/textStandAlone.js +1 -1
  25. package/dist/esm/components/tooltip/hooks/useTooltip.js +1 -1
  26. package/dist/esm/lib/provider/cssProvider/stats/stats.js +1 -1
  27. package/dist/esm/lib/provider/stylesProvider/stylesProvider.js +2 -2
  28. package/package.json +28 -13
  29. package/dist/cjs/lib/designSystem/kubit/css/kubit.css +0 -1683
  30. package/dist/cjs/lib/designSystem/kubit/css/kubit.min.css +0 -1
  31. package/dist/cjs/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -1
  32. package/dist/cjs/node_modules/react/jsx-runtime.js +0 -1
  33. package/dist/esm/lib/designSystem/kubit/css/kubit.css +0 -1683
  34. package/dist/esm/lib/designSystem/kubit/css/kubit.min.css +0 -1
  35. package/dist/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -1
  36. package/dist/esm/node_modules/react/jsx-runtime.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../_virtual/jsx-runtime.js"),t=require("react"),s=require("../cssProvider/provider.js"),r=t.createContext(void 0),n={lg:992,md:768,sm:576,xl:1200};exports.StylesContext=r,exports.StylesProvider=({breakpoints:o=n,children:i,icons:l={},illustrations:a={},themeSelected:d,bernovaProvider:m,linkId:c="kb-styled-provider",jsInCss:u=!0})=>{const x=o,h=(e=>({onlyDesktop:`(max-width: ${e.xl}px)`,onlyLargeDesktop:`(min-width: ${e.xl}px)`,onlyMobile:`(max-width: ${e.md-1}px)`,onlyTablet:`(min-width: ${e.md}px) and (max-width: ${e.lg-1}px)`}))(o),p=l,v=a,y=t.useMemo(()=>new(m||s.Provider)({jsInCss:u,linkId:c}),[]),[S,C]=t.useState(d||y.themeSelected);y.themeSelected=S||"";return e.jsxRuntimeExports.jsx(r.Provider,{value:{breakpoints:x,changeTheme:e=>{try{y.themeSelected=e,C(e)}catch(t){}},classes:[],currentTheme:S,getComponentStyles:({additionalClassNames:e,component:t,variant:s})=>{try{return y.getComponentStyles({additionalClassNames:e,component:t,variant:s||""})}catch(r){return{}}},icons:p,illustrations:v,mediaQueries:h,themeClassNames:y.classNames,themes:y.allThemes,themeVariables:y.variables},children:i})},exports.useStylesContext=()=>{const e=t.useContext(r);if(!e)throw new Error("useStylesContext must be used within a StylesProvider");return e};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../_virtual/jsx-runtime.js"),t=require("react"),s=require("../cssProvider/provider.js"),r=t.createContext(void 0),n={lg:992,md:768,sm:576,xl:1200};exports.StylesContext=r,exports.StylesProvider=({bernovaProvider:o,breakpoints:i=n,children:l,icons:a={},illustrations:d={},jsInCss:m=!0,linkId:c="kb-styled-provider",themeSelected:u})=>{const x=i,h=(e=>({onlyDesktop:`(max-width: ${e.xl}px)`,onlyLargeDesktop:`(min-width: ${e.xl}px)`,onlyMobile:`(max-width: ${e.md-1}px)`,onlyTablet:`(min-width: ${e.md}px) and (max-width: ${e.lg-1}px)`}))(i),p=a,v=d,y=t.useMemo(()=>new(o||s.Provider)({jsInCss:m,linkId:c}),[]),[S,C]=t.useState(u||y.themeSelected);y.themeSelected=S||"";return e.jsxRuntimeExports.jsx(r.Provider,{value:{breakpoints:x,changeTheme:e=>{try{y.themeSelected=e,C(e)}catch(t){}},classes:[],currentTheme:S,getComponentStyles:({additionalClassNames:e,component:t,variant:s})=>{try{return y.getComponentStyles({additionalClassNames:e,component:t,variant:s||""})}catch(r){return{}}},icons:p,illustrations:v,mediaQueries:h,themeClassNames:y.classNames,themes:y.allThemes,themeVariables:y.variables},children:l})},exports.useStylesContext=()=>{const e=t.useContext(r);if(!e)throw new Error("useStylesContext must be used within a StylesProvider");return e};
@@ -1 +1 @@
1
- import{useRef as e,useCallback as n,useEffect as t}from"react";import{ResizeObserver as r}from"../../../lib/utils/resizeObserver/resizeObserver.js";import{useCarouselKeyNavigation as a}from"./useCarouselKeyNavigation.js";import{useCarouselSwipe as i}from"./useCarouselSwipe.js";import c from"./utils/calc.utils.js";import o from"./utils/constants.js";import s from"./utils/dom.utils.js";const u=({rootContainerRef:u,viewerContainerRef:l,contentContainerRef:d,circular:m=!0,centerMode:g=!1,extraPadding:P=0,elements:f,numElementsPerPage:C,numElementsToSlide:h,defaultPage:w=0,onePageAlign:E="center",allowModifySliceWidth:I=!1,centerExtremesWhenExtraPadding:x=!1,autoFitContainer:R=!1,disabled:p=!1,onNumPagesChange:v,onNumElementsPerPageChange:L,onPageChange:N})=>{const V=e(!0),S=e(w),y=e(w),T=e(C),A=e(0),b=n(e=>{const n=d.current;if(!n||!T.current||e.propertyName!==o.PROPERTY_TO_HANDLE_TRANSITION_END||A.current<1)return;n.setAttribute("data-shifting","false");const{newPage:t}=s.udpateCarouselPositionOnEdge({contentContainer:n,currentPage:y.current,numPages:A.current,numElementsPerPage:T.current,elementsLength:f.length,extraPadding:P});y.current=t,S.current!==y.current&&(S.current=y.current,N?.(y.current));const{firstIndexInView:r,lastIndexInView:a}=c.calcFirstAndLastIndexInCarouselView({elementsLength:f.length,numElementsPerPage:T.current,numElementsToSlide:h,currentPage:y.current,isCircular:m});s.updateContentElementsAriaVisibility({contentContainer:n,firstIndexInView:r,lastIndexInView:a}),g&&s.applyCenterMode({contentContainer:n,firstIndexInView:r,lastIndexInView:a,numElementsPerPage:T.current}),V.current=!0},[f,P,h,m,g,N]),O=n(({newPage:e,animated:n=!0})=>{const t=l.current,r=d.current;if(!t||!r||!V.current||!T.current||!f.length||A.current<1||(m?e<-1:e<0)||(m?e>A.current:e>A.current-1))return;n&&r.setAttribute("data-shifting","true"),s.deleteCenterMode({contentContainer:r}),y.current=e;const{firstIndexInView:a,lastIndexInView:i}=c.calcFirstAndLastIndexInCarouselView({elementsLength:f.length,numElementsPerPage:T.current,numElementsToSlide:h,currentPage:y.current,isCircular:m});I||s.updateViewerWidth({viewerContainer:t,contentContainer:r,firstIndexInView:a,lastIndexInView:i,extraPadding:P});const u=r.style.left,g=c.calcContentContainerLeftPosition({contentContainer:r,numPages:A.current,currentPage:y.current,firstIndexInView:a,extraPadding:P,centerExtremesWhenExtraPadding:x,circular:m});r.style.left=g,n&&u!==g?V.current=!1:b({propertyName:o.PROPERTY_TO_HANDLE_TRANSITION_END})},[f,h,m,I,P,x,b]),M=n(()=>{const e=l.current,n=d.current;e&&n&&T.current&&(I&&(e.style.width="100%",s.updateSlicesWidth({viewerContainer:e,contentContainer:n,centerMode:g,numElementsPerPage:T.current,extraPadding:P})),s.manageCircularClones({contentContainer:n,elementsLength:f.length,numElementsPerPage:T.current,circular:m}),O({newPage:y.current,animated:!1}))},[I,g,m,f,P,O]),_=n(()=>{const e=u.current,n=l.current,t=d.current;if(!e||!n||!t)return;e.style.width="100%";const r=C||c.calcNumElementsPerPage({rootContainer:e,viewerContainer:n,contentContainer:t,elementsLength:f.length,extraPadding:P})||1;R&&(e.style.width="fit-content"),r!==T.current&&(T.current=r,L?.(r));const a=c.calcNumPages({elementsLength:f.length,numElementsPerPage:r,numElementsToSlide:h});A.current!==a&&(A.current=a,v?.(a),y.current=Math.min(Math.max(0,w),a-1)),a<=1&&s.alignOnePageCarousel({rootContainer:e,contentContainer:t,onePageAlign:E,allowModifySliceWidth:I})},[I,f,P,C,h,E,R,L,v,N]),W=n(()=>{_(),M()},[_,M]);return t(()=>{const e=d.current;if(!e)return;W(),window.addEventListener("resize",W);const n=new r(W);return n.observe(e),()=>{window.removeEventListener("resize",W),n.disconnect()}},[W]),t(()=>{const e=d.current;return e?.addEventListener("transitionend",b),()=>{e?.removeEventListener("transitionend",b)}},[b]),i({viewerContainerRef:l,contentContainerRef:d,allowShiftRef:V,circular:m,extraPadding:P,elements:f,numElementsPerPageRef:T,numPagesRef:A,currentPageRef:y,centerExtremesWhenExtraPadding:x,disabled:p,changePage:O}),a({rootContainerRef:u,allowShiftRef:V,circular:m,currentPageRef:y,numPagesRef:A,disabled:p,changePage:O}),{changePage:O,allowShiftRef:V,currentPageRef:y,numElementsPerPageRef:T,numPagesRef:A}};export{u as useCarousel};
1
+ import{useRef as e,useCallback as n,useEffect as t}from"react";import{ResizeObserver as r}from"../../../lib/utils/resizeObserver/resizeObserver.js";import{useCarouselKeyNavigation as a}from"./useCarouselKeyNavigation.js";import{useCarouselSwipe as i}from"./useCarouselSwipe.js";import c from"./utils/calc.utils.js";import o from"./utils/constants.js";import s from"./utils/dom.utils.js";const u=({allowModifySliceWidth:u=!1,autoFitContainer:l=!1,centerExtremesWhenExtraPadding:d=!1,centerMode:m=!1,circular:g=!0,contentContainerRef:P,defaultPage:f=0,disabled:C=!1,elements:h,extraPadding:w=0,numElementsPerPage:E,numElementsToSlide:I,onePageAlign:x="center",onNumElementsPerPageChange:R,onNumPagesChange:p,onPageChange:v,rootContainerRef:L,viewerContainerRef:N})=>{const V=e(!0),S=e(f),y=e(f),T=e(E),A=e(0),b=n(e=>{const n=P.current;if(!n||!T.current||e.propertyName!==o.PROPERTY_TO_HANDLE_TRANSITION_END||A.current<1)return;n.setAttribute("data-shifting","false");const{newPage:t}=s.udpateCarouselPositionOnEdge({contentContainer:n,currentPage:y.current,elementsLength:h.length,extraPadding:w,numElementsPerPage:T.current,numPages:A.current});y.current=t,S.current!==y.current&&(S.current=y.current,v?.(y.current));const{firstIndexInView:r,lastIndexInView:a}=c.calcFirstAndLastIndexInCarouselView({currentPage:y.current,elementsLength:h.length,isCircular:g,numElementsPerPage:T.current,numElementsToSlide:I});s.updateContentElementsAriaVisibility({contentContainer:n,firstIndexInView:r,lastIndexInView:a}),m&&s.applyCenterMode({contentContainer:n,firstIndexInView:r,lastIndexInView:a,numElementsPerPage:T.current}),V.current=!0},[h,w,I,g,m,v]),O=n(({animated:e=!0,newPage:n})=>{const t=N.current,r=P.current;if(!t||!r||!V.current||!T.current||!h.length||A.current<1||(g?n<-1:n<0)||(g?n>A.current:n>A.current-1))return;e&&r.setAttribute("data-shifting","true"),s.deleteCenterMode({contentContainer:r}),y.current=n;const{firstIndexInView:a,lastIndexInView:i}=c.calcFirstAndLastIndexInCarouselView({currentPage:y.current,elementsLength:h.length,isCircular:g,numElementsPerPage:T.current,numElementsToSlide:I});u||s.updateViewerWidth({contentContainer:r,extraPadding:w,firstIndexInView:a,lastIndexInView:i,viewerContainer:t});const l=r.style.left,m=c.calcContentContainerLeftPosition({centerExtremesWhenExtraPadding:d,circular:g,contentContainer:r,currentPage:y.current,extraPadding:w,firstIndexInView:a,numPages:A.current});r.style.left=m,e&&l!==m?V.current=!1:b({propertyName:o.PROPERTY_TO_HANDLE_TRANSITION_END})},[h,I,g,u,w,d,b]),M=n(()=>{const e=N.current,n=P.current;e&&n&&T.current&&(u&&(e.style.width="100%",s.updateSlicesWidth({centerMode:m,contentContainer:n,extraPadding:w,numElementsPerPage:T.current,viewerContainer:e})),s.manageCircularClones({circular:g,contentContainer:n,elementsLength:h.length,numElementsPerPage:T.current}),O({animated:!1,newPage:y.current}))},[u,m,g,h,w,O]),_=n(()=>{const e=L.current,n=N.current,t=P.current;if(!e||!n||!t)return;e.style.width="100%";const r=E||c.calcNumElementsPerPage({contentContainer:t,elementsLength:h.length,extraPadding:w,rootContainer:e,viewerContainer:n})||1;l&&(e.style.width="fit-content"),r!==T.current&&(T.current=r,R?.(r));const a=c.calcNumPages({elementsLength:h.length,numElementsPerPage:r,numElementsToSlide:I});A.current!==a&&(A.current=a,p?.(a),y.current=Math.min(Math.max(0,f),a-1)),a<=1&&s.alignOnePageCarousel({allowModifySliceWidth:u,contentContainer:t,onePageAlign:x,rootContainer:e})},[u,h,w,E,I,x,l,R,p,v]),W=n(()=>{_(),M()},[_,M]);return t(()=>{const e=P.current;if(!e)return;W(),window.addEventListener("resize",W);const n=new r(W);return n.observe(e),()=>{window.removeEventListener("resize",W),n.disconnect()}},[W]),t(()=>{const e=P.current;return e?.addEventListener("transitionend",b),()=>{e?.removeEventListener("transitionend",b)}},[b]),i({allowShiftRef:V,centerExtremesWhenExtraPadding:d,changePage:O,circular:g,contentContainerRef:P,currentPageRef:y,disabled:C,elements:h,extraPadding:w,numElementsPerPageRef:T,numPagesRef:A,viewerContainerRef:N}),a({allowShiftRef:V,changePage:O,circular:g,currentPageRef:y,disabled:C,numPagesRef:A,rootContainerRef:L}),{allowShiftRef:V,changePage:O,currentPageRef:y,numElementsPerPageRef:T,numPagesRef:A}};export{u as useCarousel};
@@ -1 +1 @@
1
- import{useEffect as e}from"react";import{isArrowLeftPressed as r,isArrowRightPressed as n}from"../../../lib/utils/keyboard/keyboard.js";const t=({rootContainerRef:t,allowShiftRef:c,circular:o,currentPageRef:u,numPagesRef:a,disabled:i=!1,changePage:d})=>{e(()=>{if(i)return;const e=e=>{!c.current||a.current<=1||(r(e.key)?c.current&&(o||0!==u.current)&&d({newPage:u.current-1}):n(e.key)&&c.current&&(o||u.current!==a.current-1)&&d({newPage:u.current+1}))},f=t.current;return f?.addEventListener("keydown",e),()=>{f?.removeEventListener("keydown",e)}},[o,d,i])};export{t as useCarouselKeyNavigation};
1
+ import{useEffect as e}from"react";import{isArrowLeftPressed as r,isArrowRightPressed as n}from"../../../lib/utils/keyboard/keyboard.js";const t=({allowShiftRef:t,changePage:c,circular:o,currentPageRef:u,disabled:a=!1,numPagesRef:i,rootContainerRef:d})=>{e(()=>{if(a)return;const e=e=>{!t.current||i.current<=1||(r(e.key)?t.current&&(o||0!==u.current)&&c({newPage:u.current-1}):n(e.key)&&t.current&&(o||u.current!==i.current-1)&&c({newPage:u.current+1}))},f=d.current;return f?.addEventListener("keydown",e),()=>{f?.removeEventListener("keydown",e)}},[o,c,a])};export{t as useCarouselKeyNavigation};
@@ -1 +1 @@
1
- import{useRef as e,useCallback as t,useEffect as r}from"react";import{useScrollBlock as n}from"../../../lib/hooks/useScrollBlock/useScrollBlock.js";import c from"./utils/calc.utils.js";import u from"./utils/constants.js";const s=({contentContainerRef:s,viewerContainerRef:o,allowShiftRef:l,circular:i,extraPadding:a,elements:m,numElementsPerPageRef:v,numPagesRef:E,currentPageRef:d,centerExtremesWhenExtraPadding:h,disabled:f=!1,changePage:L})=>{const p=e(!1),_=e(!1),D=e(!1),R=e(),g=e(0),X=e(0),P=e(0),S=e(0),y=t(()=>{l.current&&(i||d.current!==E.current-1)&&L({newPage:d.current+1})},[i,L]),I=t(()=>{l.current&&(i||0!==d.current)&&L({newPage:d.current-1})},[i,L]),{allowScroll:O,blockScroll:w}=n(),x=t(e=>{const t=s.current;!t||E.current<=1||(R.current=parseFloat(t.style.left||"0"),"touchstart"===e.type?(g.current=e.touches[0].clientX,P.current=e.touches[0].clientX,S.current=e.touches[0].clientY):(g.current=e.clientX,P.current=e.clientX,S.current=e.clientY),p.current=!0)},[]),G=t(e=>{const t=s.current;if(!t||!p.current||!v?.current||E.current<=1)return;let r,n;"touchmove"===e.type?(X.current=g.current-e.touches[0].clientX,g.current=e.touches[0].clientX,r=e.touches[0].clientX-P.current,n=e.touches[0].clientY-S.current):(X.current=g.current-e.clientX,g.current=e.clientX,r=e.clientX-P.current,n=e.clientY-S.current);const o=parseFloat(t.style.left||"0")-X.current;if(_.current||D.current||(Math.abs(r)>u.THRESHOLD_TO_DECIDE_IF_ALLOW_DRAGGING?(_.current=!0,w()):Math.abs(n)>u.THRESHOLD_TO_DECIDE_IF_ALLOW_DRAGGING&&(D.current=!0)),_.current)if(i&&m.length>v.current)t.style.left=`${o}px`;else{const e=c.calcXDistanceBetween2Elements(t.firstChild,t.children[t.children.length-v.current]);if(h)o-a<0&&-o<e-a&&(t.style.left=`${o}px`);else{let r=i?a:0;!i&&a&&d.current===E.current-1&&(r=2*a),o-r<0&&-o<e-r&&(t.style.left=`${o}px`)}}},[w,h,i,m,a]),C=t(()=>{const e=s.current;if(D.current=!1,_.current&&O(),_.current=!1,!e||!p.current||void 0===R.current||E.current<=1)return;p.current=!1;const t=parseFloat(e.style.left||"0");t-R.current<-0?y():t-R.current>u.THRESHOLD_TO_DECIDE_IF_SWIPE_ON_DRAG_ENDS?I():e.style.left=`${R.current}px`},[O,y,I]);r(()=>{if(f)return;const e=o.current,t={passive:!0};return e?.addEventListener("touchstart",x,t),e?.addEventListener("touchend",C,t),e?.addEventListener("touchmove",G,t),e?.addEventListener("mousedown",x,t),e?.addEventListener("mouseup",C,t),e?.addEventListener("mousemove",G,t),e?.addEventListener("mouseleave",C,t),()=>{e?.removeEventListener("touchstart",x,t),e?.removeEventListener("touchend",C,t),e?.removeEventListener("touchmove",G,t),e?.removeEventListener("mousedown",x,t),e?.removeEventListener("mouseup",C,t),e?.removeEventListener("mousemove",G,t),e?.removeEventListener("mouseleave",C,t)}},[x,C,G,f])};export{s as useCarouselSwipe};
1
+ import{useRef as e,useCallback as t,useEffect as r}from"react";import{useScrollBlock as n}from"../../../lib/hooks/useScrollBlock/useScrollBlock.js";import c from"./utils/calc.utils.js";import u from"./utils/constants.js";const s=({allowShiftRef:s,centerExtremesWhenExtraPadding:o,changePage:l,circular:i,contentContainerRef:a,currentPageRef:m,disabled:v=!1,elements:E,extraPadding:d,numElementsPerPageRef:h,numPagesRef:f,viewerContainerRef:L})=>{const p=e(!1),_=e(!1),D=e(!1),R=e(),g=e(0),X=e(0),P=e(0),S=e(0),y=t(()=>{s.current&&(i||m.current!==f.current-1)&&l({newPage:m.current+1})},[i,l]),I=t(()=>{s.current&&(i||0!==m.current)&&l({newPage:m.current-1})},[i,l]),{allowScroll:O,blockScroll:w}=n(),x=t(e=>{const t=a.current;!t||f.current<=1||(R.current=parseFloat(t.style.left||"0"),"touchstart"===e.type?(g.current=e.touches[0].clientX,P.current=e.touches[0].clientX,S.current=e.touches[0].clientY):(g.current=e.clientX,P.current=e.clientX,S.current=e.clientY),p.current=!0)},[]),G=t(e=>{const t=a.current;if(!t||!p.current||!h?.current||f.current<=1)return;let r,n;"touchmove"===e.type?(X.current=g.current-e.touches[0].clientX,g.current=e.touches[0].clientX,r=e.touches[0].clientX-P.current,n=e.touches[0].clientY-S.current):(X.current=g.current-e.clientX,g.current=e.clientX,r=e.clientX-P.current,n=e.clientY-S.current);const s=parseFloat(t.style.left||"0")-X.current;if(_.current||D.current||(Math.abs(r)>u.THRESHOLD_TO_DECIDE_IF_ALLOW_DRAGGING?(_.current=!0,w()):Math.abs(n)>u.THRESHOLD_TO_DECIDE_IF_ALLOW_DRAGGING&&(D.current=!0)),_.current)if(i&&E.length>h.current)t.style.left=`${s}px`;else{const e=c.calcXDistanceBetween2Elements(t.firstChild,t.children[t.children.length-h.current]);if(o)s-d<0&&-s<e-d&&(t.style.left=`${s}px`);else{let r=i?d:0;!i&&d&&m.current===f.current-1&&(r=2*d),s-r<0&&-s<e-r&&(t.style.left=`${s}px`)}}},[w,o,i,E,d]),C=t(()=>{const e=a.current;if(D.current=!1,_.current&&O(),_.current=!1,!e||!p.current||void 0===R.current||f.current<=1)return;p.current=!1;const t=parseFloat(e.style.left||"0");t-R.current<-0?y():t-R.current>u.THRESHOLD_TO_DECIDE_IF_SWIPE_ON_DRAG_ENDS?I():e.style.left=`${R.current}px`},[O,y,I]);r(()=>{if(v)return;const e=L.current,t={passive:!0};return e?.addEventListener("touchstart",x,t),e?.addEventListener("touchend",C,t),e?.addEventListener("touchmove",G,t),e?.addEventListener("mousedown",x,t),e?.addEventListener("mouseup",C,t),e?.addEventListener("mousemove",G,t),e?.addEventListener("mouseleave",C,t),()=>{e?.removeEventListener("touchstart",x,t),e?.removeEventListener("touchend",C,t),e?.removeEventListener("touchmove",G,t),e?.removeEventListener("mousedown",x,t),e?.removeEventListener("mouseup",C,t),e?.removeEventListener("mousemove",G,t),e?.removeEventListener("mouseleave",C,t)}},[x,C,G,v])};export{s as useCarouselSwipe};
@@ -1 +1 @@
1
- const e=({element:e})=>{const t=window.getComputedStyle(e);return parseFloat(t.getPropertyValue("padding-left")||"0")+parseFloat(t.getPropertyValue("padding-right")||"0")},t=(e,t)=>{if(!e||!t)return 0;const n=e.offsetLeft,r=t.offsetLeft;return Math.abs(r-n)},n=({numElementsPerPage:e,numElementsToSlide:t})=>t?Math.max(1,Math.min(t,e)):e,r=({elementsLength:e,numElementsPerPage:t,numElementsToSlide:r})=>{if(e<=t)return 1;const i=n({numElementsToSlide:r,numElementsPerPage:t});return Math.ceil((e-t+i)/i)},i=({elementsLength:e,numElementsPerPage:t,numElementsToSlide:i,currentPage:l,isCircular:s})=>{if(e<=t)return{firstIndexInView:0,lastIndexInView:e-1};const o=n({numElementsToSlide:i,numElementsPerPage:t});let a=l*o+t-1;let d=0;s&&e>t&&(d=t+1,a+=d),l===r({elementsLength:e,numElementsPerPage:t,numElementsToSlide:o})?a=d+e+t-1:l<0?a=d-1:a-d>e-1&&(a=d+e-1);return{firstIndexInView:a-t+1,lastIndexInView:a}},l=({rootContainer:t,viewerContainer:n,contentContainer:r,elementsLength:i,extraPadding:l})=>{const s=r.firstElementChild;if(!s)return;let o=t.offsetWidth;o-=2*l;o-=e({element:n});let a=0;const d=s.offsetLeft;for(let e=0;e<r.children.length;e++){const t=r.children[e];if(d+t.offsetLeft+t.offsetWidth>o)break;a++}return Math.max(Math.min(i,a),1)},s=({contentContainer:e,centerMode:t})=>{let n=0;if(e.childNodes.length<2)return n;const r=e.childNodes[0],i=e.childNodes[1];t&&r.style&&i.style&&(r.style.transition="none",i.style.transition="none",r.style.transform="scale(1)",i.style.transform="scale(1)");const l=r?.getBoundingClientRect()?.right,s=i?.getBoundingClientRect()?.left;return t&&r.style&&i.style&&(r.style.removeProperty("transform"),i.style.removeProperty("transform"),r.offsetHeight,i.offsetHeight,r.style.removeProperty("transition"),i.style.removeProperty("transition")),void 0!==l&&void 0!==s&&(n=Math.abs(l-s)),n},o=({viewerContainer:t,contentContainer:n,centerMode:r,numElementsPerPage:i,extraPadding:l})=>{const o=(i-1)*s({contentContainer:n,centerMode:r}),a=e({element:t});return(t.getBoundingClientRect().width-o-2*l-a)/i},a=({viewerContainer:n,contentContainer:r,firstIndexInView:i,lastIndexInView:l,extraPadding:s})=>{const o=r.children[i],a=r.children[l],d=t(o,a),c=e({element:n});return`${d+a.offsetWidth+2*s+c}px`},d=({contentContainer:e,numPages:n,currentPage:r,firstIndexInView:i,extraPadding:l,centerExtremesWhenExtraPadding:s,circular:o})=>{let a=t(e.firstChild,e.children[i]);return l&&(s||o||0!==r&&r!==n-1?a-=l:o||r!==n-1||(a-=2*l)),-a+"px"},c={calcXDistanceBetween2Elements:t,calcAdjustedNumElementsToSlide:n,calcNumPages:r,calcFirstAndLastIndexInCarouselView:i,calcNumElementsPerPage:l,calcGapBetweenContentContainerElements:s,calcSliceWidth:o,calcViewerWidth:a,calcContentContainerLeftPosition:d};export{n as calcAdjustedNumElementsToSlide,d as calcContentContainerLeftPosition,i as calcFirstAndLastIndexInCarouselView,s as calcGapBetweenContentContainerElements,e as calcHorizontalElementPadding,l as calcNumElementsPerPage,r as calcNumPages,o as calcSliceWidth,a as calcViewerWidth,t as calcXDistanceBetween2Elements,c as default};
1
+ const e=({element:e})=>{const t=window.getComputedStyle(e);return parseFloat(t.getPropertyValue("padding-left")||"0")+parseFloat(t.getPropertyValue("padding-right")||"0")},t=(e,t)=>{if(!e||!t)return 0;const n=e.offsetLeft,r=t.offsetLeft;return Math.abs(r-n)},n=({numElementsPerPage:e,numElementsToSlide:t})=>t?Math.max(1,Math.min(t,e)):e,r=({elementsLength:e,numElementsPerPage:t,numElementsToSlide:r})=>{if(e<=t)return 1;const i=n({numElementsPerPage:t,numElementsToSlide:r});return Math.ceil((e-t+i)/i)},i=({currentPage:e,elementsLength:t,isCircular:i,numElementsPerPage:l,numElementsToSlide:s})=>{if(t<=l)return{firstIndexInView:0,lastIndexInView:t-1};const o=n({numElementsPerPage:l,numElementsToSlide:s});let a=e*o+l-1;let d=0;i&&t>l&&(d=l+1,a+=d),e===r({elementsLength:t,numElementsPerPage:l,numElementsToSlide:o})?a=d+t+l-1:e<0?a=d-1:a-d>t-1&&(a=d+t-1);return{firstIndexInView:a-l+1,lastIndexInView:a}},l=({contentContainer:t,elementsLength:n,extraPadding:r,rootContainer:i,viewerContainer:l})=>{const s=t.firstElementChild;if(!s)return;let o=i.offsetWidth;o-=2*r;o-=e({element:l});let a=0;const d=s.offsetLeft;for(let e=0;e<t.children.length;e++){const n=t.children[e];if(d+n.offsetLeft+n.offsetWidth>o)break;a++}return Math.max(Math.min(n,a),1)},s=({centerMode:e,contentContainer:t})=>{let n=0;if(t.childNodes.length<2)return n;const r=t.childNodes[0],i=t.childNodes[1];e&&r.style&&i.style&&(r.style.transition="none",i.style.transition="none",r.style.transform="scale(1)",i.style.transform="scale(1)");const l=r?.getBoundingClientRect()?.right,s=i?.getBoundingClientRect()?.left;return e&&r.style&&i.style&&(r.style.removeProperty("transform"),i.style.removeProperty("transform"),r.offsetHeight,i.offsetHeight,r.style.removeProperty("transition"),i.style.removeProperty("transition")),void 0!==l&&void 0!==s&&(n=Math.abs(l-s)),n},o=({centerMode:t,contentContainer:n,extraPadding:r,numElementsPerPage:i,viewerContainer:l})=>{const o=(i-1)*s({centerMode:t,contentContainer:n}),a=e({element:l});return(l.getBoundingClientRect().width-o-2*r-a)/i},a=({contentContainer:n,extraPadding:r,firstIndexInView:i,lastIndexInView:l,viewerContainer:s})=>{const o=n.children[i],a=n.children[l],d=t(o,a),c=e({element:s});return`${d+a.offsetWidth+2*r+c}px`},d=({centerExtremesWhenExtraPadding:e,circular:n,contentContainer:r,currentPage:i,extraPadding:l,firstIndexInView:s,numPages:o})=>{let a=t(r.firstChild,r.children[s]);return l&&(e||n||0!==i&&i!==o-1?a-=l:n||i!==o-1||(a-=2*l)),-a+"px"},c={calcAdjustedNumElementsToSlide:n,calcContentContainerLeftPosition:d,calcFirstAndLastIndexInCarouselView:i,calcGapBetweenContentContainerElements:s,calcNumElementsPerPage:l,calcNumPages:r,calcSliceWidth:o,calcViewerWidth:a,calcXDistanceBetween2Elements:t};export{n as calcAdjustedNumElementsToSlide,d as calcContentContainerLeftPosition,i as calcFirstAndLastIndexInCarouselView,s as calcGapBetweenContentContainerElements,e as calcHorizontalElementPadding,l as calcNumElementsPerPage,r as calcNumPages,o as calcSliceWidth,a as calcViewerWidth,t as calcXDistanceBetween2Elements,c as default};
@@ -1 +1 @@
1
- import e from"./calc.utils.js";const t=({viewerContainer:t,contentContainer:n,centerMode:i,numElementsPerPage:r,extraPadding:l})=>{const o=e.calcSliceWidth({viewerContainer:t,contentContainer:n,centerMode:i,numElementsPerPage:r,extraPadding:l});for(let e=0;e<n.childNodes.length;e++){const t=n.childNodes[e];t instanceof HTMLElement&&(t.style.width=`${o}px`)}},n=({contentContainer:e,firstIndexInView:t,lastIndexInView:n})=>{for(let i=0;i<e.children.length;i++)i<t||i>n?e.children[i].setAttribute("inert",""):e.children[i].removeAttribute("inert")},i=({viewerContainer:t,contentContainer:n,firstIndexInView:i,lastIndexInView:r,extraPadding:l})=>{const o=e.calcViewerWidth({viewerContainer:t,contentContainer:n,firstIndexInView:i,lastIndexInView:r,extraPadding:l});t.style.width=o},r=({contentContainer:e,firstIndexInView:t,lastIndexInView:n,numElementsPerPage:i})=>{if(i%2!=0){const i=t+(n-t)/2;e.children[i].setAttribute("data-highlighted","true")}},l=({contentContainer:e})=>{for(let t=0;t<e.children.length;t++)e.children[t].removeAttribute("data-highlighted")},o=({contentContainer:e,elementsLength:t,numElementsPerPage:n,circular:i})=>{if(e.children.length>t){const n=(e.children.length-t)/2;for(let t=0;t<n;t++)e.firstElementChild&&e.removeChild(e.firstElementChild),e.lastElementChild&&e.removeChild(e.lastElementChild)}if(i&&t>n){const t=[],i=[],r=e.children.length,l=n+1;for(let n=0;n<l;n++){const l=e.children[n];l&&t.push(l.cloneNode(!0));const o=e.children[r-1-n];o&&i.push(o.cloneNode(!0))}t.forEach(t=>e.appendChild(t)),i.forEach(t=>e.insertBefore(t,e.firstChild))}},a={center:"center",left:"flex-start",right:"flex-end"},d=({rootContainer:e,contentContainer:t,onePageAlign:n,allowModifySliceWidth:i})=>{i?t.style.justifyContent=a[n]:e.style.justifyContent=a[n]},s=({contentContainer:t,currentPage:n,numPages:i,numElementsPerPage:r,elementsLength:l,extraPadding:o})=>{const a=n===i;if(a||-1===n){const n=a?r+1:l+1;let d=e.calcXDistanceBetween2Elements(t.firstChild,t.children[n]);return d-=o,t.style.left=-d+"px",{newPage:a?0:i-1}}return{newPage:n}},c={updateSlicesWidth:t,updateContentElementsAriaVisibility:n,updateViewerWidth:i,applyCenterMode:r,deleteCenterMode:l,manageCircularClones:o,alignOnePageCarousel:d,udpateCarouselPositionOnEdge:s};export{d as alignOnePageCarousel,r as applyCenterMode,c as default,l as deleteCenterMode,o as manageCircularClones,s as udpateCarouselPositionOnEdge,n as updateContentElementsAriaVisibility,t as updateSlicesWidth,i as updateViewerWidth};
1
+ import e from"./calc.utils.js";const t=({centerMode:t,contentContainer:n,extraPadding:i,numElementsPerPage:r,viewerContainer:l})=>{const o=e.calcSliceWidth({centerMode:t,contentContainer:n,extraPadding:i,numElementsPerPage:r,viewerContainer:l});for(let e=0;e<n.childNodes.length;e++){const t=n.childNodes[e];t instanceof HTMLElement&&(t.style.width=`${o}px`)}},n=({contentContainer:e,firstIndexInView:t,lastIndexInView:n})=>{for(let i=0;i<e.children.length;i++)i<t||i>n?e.children[i].setAttribute("inert",""):e.children[i].removeAttribute("inert")},i=({contentContainer:t,extraPadding:n,firstIndexInView:i,lastIndexInView:r,viewerContainer:l})=>{const o=e.calcViewerWidth({contentContainer:t,extraPadding:n,firstIndexInView:i,lastIndexInView:r,viewerContainer:l});l.style.width=o},r=({contentContainer:e,firstIndexInView:t,lastIndexInView:n,numElementsPerPage:i})=>{if(i%2!=0){const i=t+(n-t)/2;e.children[i].setAttribute("data-highlighted","true")}},l=({contentContainer:e})=>{for(let t=0;t<e.children.length;t++)e.children[t].removeAttribute("data-highlighted")},o=({circular:e,contentContainer:t,elementsLength:n,numElementsPerPage:i})=>{if(t.children.length>n){const e=(t.children.length-n)/2;for(let n=0;n<e;n++)t.firstElementChild&&t.removeChild(t.firstElementChild),t.lastElementChild&&t.removeChild(t.lastElementChild)}if(e&&n>i){const e=[],n=[],r=t.children.length,l=i+1;for(let i=0;i<l;i++){const l=t.children[i];l&&e.push(l.cloneNode(!0));const o=t.children[r-1-i];o&&n.push(o.cloneNode(!0))}e.forEach(e=>t.appendChild(e)),n.forEach(e=>t.insertBefore(e,t.firstChild))}},a={center:"center",left:"flex-start",right:"flex-end"},d=({allowModifySliceWidth:e,contentContainer:t,onePageAlign:n,rootContainer:i})=>{e?t.style.justifyContent=a[n]:i.style.justifyContent=a[n]},s=({contentContainer:t,currentPage:n,elementsLength:i,extraPadding:r,numElementsPerPage:l,numPages:o})=>{const a=n===o;if(a||-1===n){const n=a?l+1:i+1;let d=e.calcXDistanceBetween2Elements(t.firstChild,t.children[n]);return d-=r,t.style.left=-d+"px",{newPage:a?0:o-1}}return{newPage:n}},c={alignOnePageCarousel:d,applyCenterMode:r,deleteCenterMode:l,manageCircularClones:o,udpateCarouselPositionOnEdge:s,updateContentElementsAriaVisibility:n,updateSlicesWidth:t,updateViewerWidth:i};export{d as alignOnePageCarousel,r as applyCenterMode,c as default,l as deleteCenterMode,o as manageCircularClones,s as udpateCarouselPositionOnEdge,n as updateContentElementsAriaVisibility,t as updateSlicesWidth,i as updateViewerWidth};
@@ -1 +1 @@
1
- import{shift as e,offset as t,flip as i,hide as s,arrow as n}from"@floating-ui/dom";import{getPlacementDirection as a}from"../../utils/placement.utils.js";const r=({arrowElement:r,customMiddlewares:d,edgePadding:o,hideWhenDetached:h,isBodyAnchor:m,mainAxisOffset:c,offsetDistance:p,placement:l})=>{let u=[];return u=d?.length?[...d]:m?((i,s)=>{const n=a(i),r=[];return"center"===n?r.push(e({crossAxis:!0,mainAxis:!0,padding:s})):n.startsWith("right")||n.startsWith("left")?r.push(t({alignmentAxis:0,mainAxis:0})):(n.startsWith("bottom")||n.startsWith("top"))&&r.push(t({mainAxis:0})),r})(l,o):((s,n,a)=>{const r=[];return r.push(t({crossAxis:n?.[1]||0,mainAxis:s})),r.push(i({fallbackAxisSideDirection:"start",padding:a})),r.push(e({padding:a})),r})(c,p,o),(({middlewareStack:e,isBodyAnchor:t,hideWhenDetached:i,arrowElement:a,edgePadding:r})=>{!t&&i&&e.push(s()),a&&e.push(n({element:a,padding:r}))})({middlewareStack:u,isBodyAnchor:m,hideWhenDetached:h,arrowElement:r,edgePadding:o}),u},d=({arrowSize:e,hasArrow:t,offsetDistance:i})=>"number"==typeof i?.[0]?i[0]:t?e:0;export{d as calculateMainAxisOffset,r as getMiddlewareStack};
1
+ import{shift as e,offset as t,flip as i,hide as s,arrow as n}from"@floating-ui/dom";import{getPlacementDirection as a}from"../../utils/placement.utils.js";const r=({arrowElement:r,customMiddlewares:d,edgePadding:o,hideWhenDetached:h,isBodyAnchor:m,mainAxisOffset:c,offsetDistance:p,placement:l})=>{let u=[];return u=d?.length?[...d]:m?((i,s)=>{const n=a(i),r=[];return"center"===n?r.push(e({crossAxis:!0,mainAxis:!0,padding:s})):n.startsWith("right")||n.startsWith("left")?r.push(t({alignmentAxis:0,mainAxis:0})):(n.startsWith("bottom")||n.startsWith("top"))&&r.push(t({mainAxis:0})),r})(l,o):((s,n,a)=>{const r=[];return r.push(t({crossAxis:n?.[1]||0,mainAxis:s})),r.push(i({fallbackAxisSideDirection:"start",padding:a})),r.push(e({padding:a})),r})(c,p,o),(({arrowElement:e,edgePadding:t,hideWhenDetached:i,isBodyAnchor:a,middlewareStack:r})=>{!a&&i&&r.push(s()),e&&r.push(n({element:e,padding:t}))})({arrowElement:r,edgePadding:o,hideWhenDetached:h,isBodyAnchor:m,middlewareStack:u}),u},d=({arrowSize:e,hasArrow:t,offsetDistance:i})=>"number"==typeof i?.[0]?i[0]:t?e:0;export{d as calculateMainAxisOffset,r as getMiddlewareStack};
@@ -1 +1 @@
1
- import{useRef as e,useState as r,useCallback as o,useEffect as n}from"react";import{syncInnerAndForwardedRef as l}from"../../../lib/hooks/syncRefs/syncRefs.js";import{useScrollBlock as t}from"../../../lib/hooks/useScrollBlock/useScrollBlock.js";import{convertDurationToNumber as s}from"../../../lib/hooks/useSwipeDown/utils/convertDurationToNumber.js";import{focusFirstDescendant as c}from"../../../lib/utils/focusHandlers/focusHandlers.js";const u=({animationExitDuration:u=200,disableAnimations:i,open:a=!1,disableAutoFocusFirstDescendant:m=!1,disableAutoFocusFirstDescendantAfterClose:d=!0,disableRestoreFocusAfterClose:f=!1,disableScrollBackground:p=!1,preventScrollOnCloseFocus:b=!1,popoverContainerRef:S})=>{const w=e(null),R=e(!1),k=e(null),v=e(null),[F,A]=r(a),[C,D]=r(!1),h=s(u),{allowScroll:j,blockScroll:T}=t(),y=o(()=>{!m&&w.current&&c({element:w.current,preventScroll:!0})},[m]),B=o(()=>{f?d||c({element:document.body}):v.current?.focus({preventScroll:b})},[f,b,d]);n(()=>{a&&(v.current=document.activeElement,A(!0),D(!1))},[a]),n(()=>(!a&&F&&(i?(B(),A(!1),D(!1)):(D(!0),k.current=window.setTimeout(()=>{B(),A(!1),D(!1)},h))),()=>{null!==k.current&&(window.clearTimeout(k.current),k.current=null)}),[a,F,i,h,B]);const g=o(e=>{w.current=e,y(),p&&!R.current&&(R.current=!0,T({elementsToOmit:[w.current]}))},[T,y,p]),x=o(()=>{R.current&&j(),w.current=null},[j]),E=o(e=>{e?g(e):x(),l({forwardedRef:S,innerRef:w})},[S,x,g]);return{isClosing:C,isVisible:F,handleInnerRef:E,popoverRef:w}};export{u as usePopoverLifecycle};
1
+ import{useRef as e,useState as r,useCallback as o,useEffect as n}from"react";import{syncInnerAndForwardedRef as l}from"../../../lib/hooks/syncRefs/syncRefs.js";import{useScrollBlock as t}from"../../../lib/hooks/useScrollBlock/useScrollBlock.js";import{convertDurationToNumber as s}from"../../../lib/hooks/useSwipeDown/utils/convertDurationToNumber.js";import{focusFirstDescendant as c}from"../../../lib/utils/focusHandlers/focusHandlers.js";const u=({animationExitDuration:u=200,disableAnimations:i,disableAutoFocusFirstDescendant:a=!1,disableAutoFocusFirstDescendantAfterClose:m=!0,disableRestoreFocusAfterClose:d=!1,disableScrollBackground:f=!1,open:p=!1,popoverContainerRef:b,preventScrollOnCloseFocus:S=!1})=>{const w=e(null),R=e(!1),k=e(null),v=e(null),[F,A]=r(p),[C,D]=r(!1),h=s(u),{allowScroll:j,blockScroll:T}=t(),y=o(()=>{!a&&w.current&&c({element:w.current,preventScroll:!0})},[a]),B=o(()=>{d?m||c({element:document.body}):v.current?.focus({preventScroll:S})},[d,S,m]);n(()=>{p&&(v.current=document.activeElement,A(!0),D(!1))},[p]),n(()=>(!p&&F&&(i?(B(),A(!1),D(!1)):(D(!0),k.current=window.setTimeout(()=>{B(),A(!1),D(!1)},h))),()=>{null!==k.current&&(window.clearTimeout(k.current),k.current=null)}),[p,F,i,h,B]);const g=o(e=>{w.current=e,y(),f&&!R.current&&(R.current=!0,T({elementsToOmit:[w.current]}))},[T,y,f]),x=o(()=>{R.current&&j(),w.current=null},[j]);return{handleInnerRef:o(e=>{e?g(e):x(),l({forwardedRef:b,innerRef:w})},[b,x,g]),isClosing:C,isVisible:F,popoverRef:w}};export{u as usePopoverLifecycle};
@@ -1 +1 @@
1
- import{useRef as e,useEffect as t,useCallback as r}from"react";import{computePosition as n,autoUpdate as i}from"@floating-ui/dom";import{positionArrow as a}from"./positioning/arrowPositionStyles.js";import{calculateMainAxisOffset as o,getMiddlewareStack as s}from"./positioning/middlewareUtils.js";import{determinePositioningConfig as c}from"./positioning/positionCalculation.js";import{applyPositionStyles as d}from"./positioning/positionStyles.js";const l=({anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:p={},middlewares:f=[],placement:w,ref:h,strategy:g})=>{const{edgePadding:y=0,hideWhenDetached:S,offsetDistance:D}=p,b=e(document.body),P=e(null),E=e({anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:{edgePadding:y,hideWhenDetached:S,offsetDistance:D},middlewares:f,placement:w,ref:h,strategy:g});t(()=>{E.current={anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:{edgePadding:y,hideWhenDetached:S,offsetDistance:D},middlewares:f,placement:w,ref:h,strategy:g}},[l,w,D,y,S,f,g,u,h,m]);const A=r(()=>h?.current&&u&&m?(P.current=h.current.querySelector('[data-kbt-id="popover-arrow"]'),P.current):null,[h,u,m]);t(()=>{const e=()=>{!A()&&u&&m&&h?.current&&requestAnimationFrame(e)};e()},[A,u,m]);const k=r((e,t)=>e&&t?.current&&document.body.contains(t.current),[]),O=r((e,t,r,n,i,o,s,c,l,u,p,f,w,h=[],g=[])=>{e?.current&&(d({edgePadding:s,hasCustomMiddlewares:h.length>0,isBodyAnchor:t,middlewareStack:g,placement:r,ref:e,strategy:o,x:n,y:i}),t||e.current.setAttribute("data-kbt-placement",u),a(!!m,c,l,u,p,f),w?.())},[m]),W=r((e,t,r,n,i,a,c)=>{const d=o({arrowSize:t,hasArrow:!!m,offsetDistance:e}),l=P.current;return{arrowElement:l,middlewareStack:s({arrowElement:l,customMiddlewares:a,edgePadding:n,hideWhenDetached:c?.hideWhenDetached,isBodyAnchor:r,mainAxisOffset:d,offsetDistance:e,placement:i})}},[m]),j=r((e,t,r,n,i,a,o,s,c,d,l,m,u,p=[],f=[])=>{const w=t.hide?.referenceHidden||t.hide?.escaped;e.current&&(e.current.style.opacity=w?"0":"",e.current.style.pointerEvents=w?"none":""),w||O(e,r,n,i,a,o,s,c,t,d,l,m,u,p,f)},[O]),x=r(async()=>{const{anchorElement:e,arrowStyles:t,middlewareOptions:r,middlewares:i,onPositioned:a,placement:o,ref:s,strategy:d}=E.current,l=r?.offsetDistance,m=r?.edgePadding??8,u=t?.size||0,p=e||b.current;if(!s?.current||!k(p,s))return;const f=p===document.body,{arrowElement:w,middlewareStack:h}=W(l,u,f,m,o,i,r||{}),{actualPlacement:g,autoStrategy:y}=c(f,d,o),S="center"===g?"top":g,D=await n(p,s.current,{middleware:h,placement:S,strategy:y}),{middlewareData:P,placement:A,x:O,y:x}=D;j(s,P,f,g,O,x,d,m,w,A,l,u,a,i,h)},[]);t(()=>{if(!u||!h?.current)return;h.current.offsetHeight,x();const e=l??b.current;let t=()=>{};return t=i(e,h.current,x,{ancestorResize:!0,ancestorScroll:!0,animationFrame:!1,elementResize:!0}),()=>{t()}},[u,l,x])};export{l as usePopoverPositioning};
1
+ import{computePosition as e,autoUpdate as t}from"@floating-ui/dom";import{useRef as r,useEffect as n,useCallback as i}from"react";import{positionArrow as a}from"./positioning/arrowPositionStyles.js";import{calculateMainAxisOffset as o,getMiddlewareStack as s}from"./positioning/middlewareUtils.js";import{determinePositioningConfig as c}from"./positioning/positionCalculation.js";import{applyPositionStyles as d}from"./positioning/positionStyles.js";const l=({anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:p={},middlewares:f=[],placement:w,ref:h,strategy:g})=>{const{edgePadding:y=0,hideWhenDetached:S,offsetDistance:D}=p,b=r(document.body),P=r(null),E=r({anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:{edgePadding:y,hideWhenDetached:S,offsetDistance:D},middlewares:f,placement:w,ref:h,strategy:g});n(()=>{E.current={anchorElement:l,arrowStyles:m,isVisible:u,middlewareOptions:{edgePadding:y,hideWhenDetached:S,offsetDistance:D},middlewares:f,placement:w,ref:h,strategy:g}},[l,w,D,y,S,f,g,u,h,m]);const A=i(()=>h?.current&&u&&m?(P.current=h.current.querySelector('[data-kbt-id="popover-arrow"]'),P.current):null,[h,u,m]);n(()=>{const e=()=>{!A()&&u&&m&&h?.current&&requestAnimationFrame(e)};e()},[A,u,m]);const k=i((e,t)=>e&&t?.current&&document.body.contains(t.current),[]),O=i((e,t,r,n,i,o,s,c,l,u,p,f,w,h=[],g=[])=>{e?.current&&(d({edgePadding:s,hasCustomMiddlewares:h.length>0,isBodyAnchor:t,middlewareStack:g,placement:r,ref:e,strategy:o,x:n,y:i}),t||e.current.setAttribute("data-kbt-placement",u),a(!!m,c,l,u,p,f),w?.())},[m]),W=i((e,t,r,n,i,a,c)=>{const d=o({arrowSize:t,hasArrow:!!m,offsetDistance:e}),l=P.current;return{arrowElement:l,middlewareStack:s({arrowElement:l,customMiddlewares:a,edgePadding:n,hideWhenDetached:c?.hideWhenDetached,isBodyAnchor:r,mainAxisOffset:d,offsetDistance:e,placement:i})}},[m]),j=i((e,t,r,n,i,a,o,s,c,d,l,m,u,p=[],f=[])=>{const w=t.hide?.referenceHidden||t.hide?.escaped;e.current&&(e.current.style.opacity=w?"0":"",e.current.style.pointerEvents=w?"none":""),w||O(e,r,n,i,a,o,s,c,t,d,l,m,u,p,f)},[O]),x=i(async()=>{const{anchorElement:t,arrowStyles:r,middlewareOptions:n,middlewares:i,onPositioned:a,placement:o,ref:s,strategy:d}=E.current,l=n?.offsetDistance,m=n?.edgePadding??8,u=r?.size||0,p=t||b.current;if(!s?.current||!k(p,s))return;const f=p===document.body,{arrowElement:w,middlewareStack:h}=W(l,u,f,m,o,i,n||{}),{actualPlacement:g,autoStrategy:y}=c(f,d,o),S="center"===g?"top":g,D=await e(p,s.current,{middleware:h,placement:S,strategy:y}),{middlewareData:P,placement:A,x:O,y:x}=D;j(s,P,f,g,O,x,d,m,w,A,l,u,a,i,h)},[]);n(()=>{if(!u||!h?.current)return;h.current.offsetHeight,x();const e=l??b.current;let r=()=>{};return r=t(e,h.current,x,{ancestorResize:!0,ancestorScroll:!0,animationFrame:!1,elementResize:!0}),()=>{r()}},[u,l,x])};export{l as usePopoverPositioning};
@@ -1 +1 @@
1
- import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as s}from"react";import{useClassName as o}from"../../lib/hooks/useClassName/useClassName.js";import{useTrapFocus as i}from"../../lib/hooks/useTrapFocus/useTrapFocus.js";import{usePopoverInteractions as r}from"./hooks/usePopoverInteractions.js";import{usePopoverLifecycle as l}from"./hooks/usePopoverLifecycle.js";import{usePopoverPositioning as a}from"./hooks/usePopoverPositioning.js";import{PopoverStandAlone as t}from"./popoverStandAlone.js";const n=s(({additionalClasses:s,anchorElement:n,animationExitDuration:p=200,disableAnimations:c=!1,disableAutoFocusFirstDescendant:d=!1,disableAutoFocusFirstDescendantAfterClose:m=!0,disableClickOverlayClose:u=!1,disableEscapeClose:C=!1,disableRestoreFocusAfterClose:b=!1,disableScrollBackground:f=!1,disableTrapFocus:v=!1,middlewareOptions:F,middlewares:A,onClose:k,open:O=!1,preventCloseOnClickElements:j=[],preventScrollOnCloseFocus:E=!1,strategy:h="absolute",popoverContainerRef:R,...g},y)=>{const w=c||!!n,S=o({additionalClassNames:s,component:"POPOVER"}),{isVisible:D,isClosing:P,handleInnerRef:x,popoverRef:V}=l({open:O,disableAnimations:w,disableAutoFocusFirstDescendant:d,disableAutoFocusFirstDescendantAfterClose:m,disableRestoreFocusAfterClose:b,disableScrollBackground:f,preventScrollOnCloseFocus:E,popoverContainerRef:R,animationExitDuration:p});return i({ref:V,trapFocus:!v&&D}),r({disableClickOverlayClose:u,disableEscapeClose:C,isVisible:D,onClose:k,popoverRef:V,preventCloseOnClickElements:j}),a({anchorElement:n,arrowStyles:g.arrowStyles,isVisible:D,middlewareOptions:F,middlewares:A,placement:g.placement,ref:V,strategy:h}),/* @__PURE__ */e.jsx(t,{ref:y,...g,anchorElement:!!n,cssClasses:S,disableAnimations:w,isClosing:P,isVisible:D,middlewareOptions:F,popoverContainerRef:x,strategy:h})});export{n as Popover};
1
+ import{j as e}from"../../_virtual/jsx-runtime.js";import{forwardRef as s}from"react";import{useClassName as o}from"../../lib/hooks/useClassName/useClassName.js";import{useTrapFocus as i}from"../../lib/hooks/useTrapFocus/useTrapFocus.js";import{usePopoverInteractions as r}from"./hooks/usePopoverInteractions.js";import{usePopoverLifecycle as l}from"./hooks/usePopoverLifecycle.js";import{usePopoverPositioning as a}from"./hooks/usePopoverPositioning.js";import{PopoverStandAlone as t}from"./popoverStandAlone.js";const n=s(({additionalClasses:s,anchorElement:n,animationExitDuration:p=200,disableAnimations:c=!1,disableAutoFocusFirstDescendant:d=!1,disableAutoFocusFirstDescendantAfterClose:m=!0,disableClickOverlayClose:u=!1,disableEscapeClose:C=!1,disableRestoreFocusAfterClose:b=!1,disableScrollBackground:f=!1,disableTrapFocus:v=!1,middlewareOptions:F,middlewares:A,onClose:k,open:O=!1,popoverContainerRef:j,preventCloseOnClickElements:E=[],preventScrollOnCloseFocus:h=!1,strategy:R="absolute",...g},y)=>{const w=c||!!n,S=o({additionalClassNames:s,component:"POPOVER"}),{handleInnerRef:D,isClosing:P,isVisible:x,popoverRef:V}=l({animationExitDuration:p,disableAnimations:w,disableAutoFocusFirstDescendant:d,disableAutoFocusFirstDescendantAfterClose:m,disableRestoreFocusAfterClose:b,disableScrollBackground:f,open:O,popoverContainerRef:j,preventScrollOnCloseFocus:h});return i({ref:V,trapFocus:!v&&x}),r({disableClickOverlayClose:u,disableEscapeClose:C,isVisible:x,onClose:k,popoverRef:V,preventCloseOnClickElements:E}),a({anchorElement:n,arrowStyles:g.arrowStyles,isVisible:x,middlewareOptions:F,middlewares:A,placement:g.placement,ref:V,strategy:R}),/* @__PURE__ */e.jsx(t,{ref:y,...g,anchorElement:!!n,cssClasses:S,disableAnimations:w,isClosing:P,isVisible:x,middlewareOptions:F,popoverContainerRef:D,strategy:R})});export{n as Popover};
@@ -1,2 +1,2 @@
1
- import{j as t}from"../../_virtual/jsx-runtime.js";/* empty css */import{forwardRef as r}from"react";import{classNames as e}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as o}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{CustomComponent as s}from"../../lib/components/customComponent/customComponent.js";const i=r(({align:r,children:i,color:a,component:l,cssClasses:m,cursor:c,customAttributes:n,decoration:d,disabled:p,display:u,draggable:x,filter:b,htmlFor:f,id:g,maxTruncatedLines:j,onClick:k,role:C,target:h,textSizeAdjust:A,textWrap:w,transform:W,truncate:y,weight:N,wordBreak:z,wordWrap:B,...F},S)=>{const T=o({...F,...n}),v=e("kbt-text",m?.text,{"kbt-text--disabled":p??!1},{"kbt-text--truncate":y||!!j}),D={color:a,cursor:c,display:u,filter:b,fontWeight:N,textAlign:r,textDecoration:d,textTransform:W,textWrap:w,wordBreak:z,wordWrap:B,textSizeAdjust:A};/* @__PURE__ */
1
+ import{j as t}from"../../_virtual/jsx-runtime.js";/* empty css */import{forwardRef as r}from"react";import{classNames as e}from"../../lib/utils/classNames/classNames.js";import{pickCustomAttributes as o}from"../../lib/utils/pickCustomAttributes/pickCustomAttributes.js";import{CustomComponent as s}from"../../lib/components/customComponent/customComponent.js";const i=r(({align:r,children:i,color:a,component:l,cssClasses:m,cursor:c,customAttributes:n,decoration:d,disabled:p,display:u,draggable:x,filter:b,htmlFor:f,id:g,maxTruncatedLines:j,onClick:k,role:C,target:h,textSizeAdjust:A,textWrap:w,transform:W,truncate:y,weight:N,wordBreak:z,wordWrap:B,...F},S)=>{const T=o({...F,...n}),v=e("kbt-text",m?.text,{"kbt-text--disabled":p??!1},{"kbt-text--truncate":y||!!j}),D={color:a,cursor:c,display:u,filter:b,fontWeight:N,textAlign:r,textDecoration:d,textSizeAdjust:A,textTransform:W,textWrap:w,wordBreak:z,wordWrap:B};/* @__PURE__ */
2
2
  return t.jsx(s,{ref:S,className:v,component:l,"data-testid":"text",draggable:x,htmlFor:f,id:g,role:C,style:D,target:h,onClick:k,...T,children:i})});export{i as TextStandAlone};
@@ -1 +1 @@
1
- import{useRef as e,useState as t,useEffect as o,useCallback as r}from"react";import{flip as s,shift as i,arrow as n}from"@floating-ui/dom";import{useClassName as l}from"../../../lib/hooks/useClassName/useClassName.js";import{useClickOutside as p}from"../../../lib/hooks/useClickOutside/useClickOutside.js";import{useEscPressed as a}from"../../../lib/hooks/useEscPressed/useEscPressed.js";import{useActiveBreakpoints as c}from"../../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{DEVICE_BREAKPOINTS as u}from"../../../lib/types/breakpoints/breakpoints.js";import{POSITIONS as m}from"../../../lib/types/positions/positions.js";import{focusElementOrFirstDescendant as f}from"../../../lib/utils/focusHandlers/focusHandlers.js";import{computePosition as d}from"../positioning/computePosition.js";const y=({align:y=m.TOP,...b})=>{const{device:v,isDesktop:O,isTablet:R}=c(),w=O||R,P=e(null),g=e(!0),T=e(!1),[E,h]=t(!1),[j,k]=t(y),x=l({additionalClassNames:b.additionalClasses,component:"TOOLTIP",variant:b.variant}),C=async()=>{if(!b.labelRef.current||!b.tooltipRef.current)return;const e=b.tooltipRef.current.lastElementChild;try{const t=await d(b.labelRef.current,b.tooltipRef.current,{middleware:[s(),i({padding:4}),n({element:e})],placement:y,strategy:"absolute"}),{middlewareData:o,placement:r,x:l,y:p}=t;k(r),Object.assign(b.tooltipRef.current.style,{left:`${l}px`,top:`${p}px`});const{x:a,y:c}=o.arrow,f={bottom:m.TOP,left:m.RIGHT,right:m.LEFT,top:m.BOTTOM}[j.split("-")[0]],v={bottom:"",left:null!==a?`${a}px`:"",right:"",[f]:`calc(${x.tooltipexternalcontainer?.[u.DESKTOP]?.padding??0} - ${x.arrowposition?.[u.DESKTOP]?.top??"0px"} / 2)`,top:null!==c?`${c}px`:""};e&&e.style&&(e.style.removeProperty("left"),e.style.removeProperty("top"),e.style.removeProperty("right"),e.style.removeProperty("bottom"),Object.assign(e?.style,v))}catch(t){}},L=e=>{b.tooltipRef.current?.contains(e.target)||C()};o(()=>{const e=()=>{C()};return window.addEventListener("scroll",L,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",e)}},[]);const $=r(()=>{if(T.current){if(T.current=!1,g.current=!1,b.tooltipAsModal&&P.current?.focus({preventScroll:!0}),g.current=!0,w){if(!b.tooltipRef.current)return;b.tooltipRef.current.style.display="none"}h(!1),b.onOpenClose?.(!1)}},[v,b.onOpenClose,b.tooltipAsModal]),D=r(e=>{T.current&&(e.stopPropagation(),$())},[$]);return a({disableStopPropagation:!0,onEscPress:D,ref:b.labelRef}),p(b.tooltipRef,$,[b.labelRef.current]),{allowFocusOpenTooltip:g,hideTooltip:$,open:E,placement:j,showTooltip:()=>{if(!T.current){if(T.current=!0,P.current=document.activeElement,w){if(!b.tooltipRef.current)return;b.tooltipRef.current.style.display="flex",C(),f(b.tooltipRef.current,{preventScroll:!0})}h(!0),b.onOpenClose?.(!0)}}}};export{y as useTooltip};
1
+ import{flip as e,shift as t,arrow as o}from"@floating-ui/dom";import{useRef as r,useState as s,useEffect as i,useCallback as n}from"react";import{useClassName as l}from"../../../lib/hooks/useClassName/useClassName.js";import{useClickOutside as p}from"../../../lib/hooks/useClickOutside/useClickOutside.js";import{useEscPressed as a}from"../../../lib/hooks/useEscPressed/useEscPressed.js";import{useActiveBreakpoints as c}from"../../../lib/hooks/useMediaDevice/useActiveBreakpoints.js";import{DEVICE_BREAKPOINTS as u}from"../../../lib/types/breakpoints/breakpoints.js";import{POSITIONS as m}from"../../../lib/types/positions/positions.js";import{focusElementOrFirstDescendant as f}from"../../../lib/utils/focusHandlers/focusHandlers.js";import{computePosition as d}from"../positioning/computePosition.js";const y=({align:y=m.TOP,...b})=>{const{device:v,isDesktop:O,isTablet:R}=c(),w=O||R,P=r(null),g=r(!0),T=r(!1),[E,h]=s(!1),[j,k]=s(y),x=l({additionalClassNames:b.additionalClasses,component:"TOOLTIP",variant:b.variant}),C=async()=>{if(!b.labelRef.current||!b.tooltipRef.current)return;const r=b.tooltipRef.current.lastElementChild;try{const s=await d(b.labelRef.current,b.tooltipRef.current,{middleware:[e(),t({padding:4}),o({element:r})],placement:y,strategy:"absolute"}),{middlewareData:i,placement:n,x:l,y:p}=s;k(n),Object.assign(b.tooltipRef.current.style,{left:`${l}px`,top:`${p}px`});const{x:a,y:c}=i.arrow,f={bottom:m.TOP,left:m.RIGHT,right:m.LEFT,top:m.BOTTOM}[j.split("-")[0]],v={bottom:"",left:null!==a?`${a}px`:"",right:"",[f]:`calc(${x.tooltipexternalcontainer?.[u.DESKTOP]?.padding??0} - ${x.arrowposition?.[u.DESKTOP]?.top??"0px"} / 2)`,top:null!==c?`${c}px`:""};r&&r.style&&(r.style.removeProperty("left"),r.style.removeProperty("top"),r.style.removeProperty("right"),r.style.removeProperty("bottom"),Object.assign(r?.style,v))}catch(s){}},L=e=>{b.tooltipRef.current?.contains(e.target)||C()};i(()=>{const e=()=>{C()};return window.addEventListener("scroll",L,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",e)}},[]);const $=n(()=>{if(T.current){if(T.current=!1,g.current=!1,b.tooltipAsModal&&P.current?.focus({preventScroll:!0}),g.current=!0,w){if(!b.tooltipRef.current)return;b.tooltipRef.current.style.display="none"}h(!1),b.onOpenClose?.(!1)}},[v,b.onOpenClose,b.tooltipAsModal]),D=n(e=>{T.current&&(e.stopPropagation(),$())},[$]);return a({disableStopPropagation:!0,onEscPress:D,ref:b.labelRef}),p(b.tooltipRef,$,[b.labelRef.current]),{allowFocusOpenTooltip:g,hideTooltip:$,open:E,placement:j,showTooltip:()=>{if(!T.current){if(T.current=!0,P.current=document.activeElement,w){if(!b.tooltipRef.current)return;b.tooltipRef.current.style.display="flex",C(),f(b.tooltipRef.current,{preventScroll:!0})}h(!0),b.onOpenClose?.(!0)}}}};export{y as useTooltip};
@@ -1,6 +1,6 @@
1
1
  /* CssThemes */
2
2
  export const cssThemes = {
3
- 'kubit': { css: '/Users/n128691/PROJECTS/ODS/KUBIT/ods-odswpa-web-ui-components/app/src/lib/designSystem/kubit/css/kubit.css', foreign: { before: [], after: [], }, },
3
+ 'kubit': { css: '/Users/n128691/PROJECTS/OPEN_SOURCE/kubit-react-components/src/lib/designSystem/kubit/css/kubit.css', foreign: { before: [], after: [], }, },
4
4
  }
5
5
  /* CssThemes */
6
6
 
@@ -1,2 +1,2 @@
1
- import{j as e}from"../../../_virtual/jsx-runtime.js";import{createContext as t,useContext as s,useMemo as r,useState as n}from"react";import{Provider as i}from"../cssProvider/provider.js";const o=t(void 0),a=()=>{const e=s(o);if(!e)throw new Error("useStylesContext must be used within a StylesProvider");return e},l={lg:992,md:768,sm:576,xl:1200},m=({breakpoints:t=l,children:s,icons:a={},illustrations:m={},themeSelected:d,bernovaProvider:c,linkId:h="kb-styled-provider",jsInCss:p=!0})=>{const x=t,u=(e=>({onlyDesktop:`(max-width: ${e.xl}px)`,onlyLargeDesktop:`(min-width: ${e.xl}px)`,onlyMobile:`(max-width: ${e.md-1}px)`,onlyTablet:`(min-width: ${e.md}px) and (max-width: ${e.lg-1}px)`}))(t),v=a,y=m,b=r(()=>new(c||i)({jsInCss:p,linkId:h}),[]),[w,C]=n(d||b.themeSelected);b.themeSelected=w||"";/* @__PURE__ */
2
- return e.jsx(o.Provider,{value:{breakpoints:x,changeTheme:e=>{try{b.themeSelected=e,C(e)}catch(t){}},classes:[],currentTheme:w,getComponentStyles:({additionalClassNames:e,component:t,variant:s})=>{try{return b.getComponentStyles({additionalClassNames:e,component:t,variant:s||""})}catch(r){return{}}},icons:v,illustrations:y,mediaQueries:u,themeClassNames:b.classNames,themes:b.allThemes,themeVariables:b.variables},children:s})};export{o as StylesContext,m as StylesProvider,a as useStylesContext};
1
+ import{j as e}from"../../../_virtual/jsx-runtime.js";import{createContext as t,useContext as s,useMemo as r,useState as n}from"react";import{Provider as i}from"../cssProvider/provider.js";const o=t(void 0),a=()=>{const e=s(o);if(!e)throw new Error("useStylesContext must be used within a StylesProvider");return e},l={lg:992,md:768,sm:576,xl:1200},m=({bernovaProvider:t,breakpoints:s=l,children:a,icons:m={},illustrations:d={},jsInCss:c=!0,linkId:h="kb-styled-provider",themeSelected:p})=>{const x=s,u=(e=>({onlyDesktop:`(max-width: ${e.xl}px)`,onlyLargeDesktop:`(min-width: ${e.xl}px)`,onlyMobile:`(max-width: ${e.md-1}px)`,onlyTablet:`(min-width: ${e.md}px) and (max-width: ${e.lg-1}px)`}))(s),v=m,y=d,b=r(()=>new(t||i)({jsInCss:c,linkId:h}),[]),[w,C]=n(p||b.themeSelected);b.themeSelected=w||"";/* @__PURE__ */
2
+ return e.jsx(o.Provider,{value:{breakpoints:x,changeTheme:e=>{try{b.themeSelected=e,C(e)}catch(t){}},classes:[],currentTheme:w,getComponentStyles:({additionalClassNames:e,component:t,variant:s})=>{try{return b.getComponentStyles({additionalClassNames:e,component:t,variant:s||""})}catch(r){return{}}},icons:v,illustrations:y,mediaQueries:u,themeClassNames:b.classNames,themes:b.allThemes,themeVariables:b.variables},children:a})};export{o as StylesContext,m as StylesProvider,a as useStylesContext};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubit-ui-web/react-components",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience",
5
5
  "author": {
6
6
  "name": "Kubit",
@@ -55,15 +55,27 @@
55
55
  "*.ico"
56
56
  ],
57
57
  "files": [
58
- "dist",
58
+ "dist/cjs",
59
+ "dist/esm",
60
+ "dist/types",
59
61
  "dist/styles",
60
62
  "package.json",
61
63
  "README.md",
62
64
  "LICENSE.md",
65
+ "CHANGELOG.md",
66
+ "!dist/cjs/lib/designSystem/**/css/*.css",
67
+ "!dist/esm/lib/designSystem/**/css/*.css",
68
+ "!dist/**/*.test.*",
69
+ "!dist/**/*.test.d.ts",
70
+ "!dist/**/*.stories.*",
71
+ "!dist/**/__tests__",
72
+ "!dist/**/__mocks__",
73
+ "!dist/**/__fixtures__",
63
74
  "!dist/**/tests",
64
- "!dist/**/**/*.test.*",
65
75
  "!dist/**/storybook",
66
- "!dist/**/**/stories"
76
+ "!dist/**/node_modules",
77
+ "!dist/**/.tsbuildinfo",
78
+ "!dist/**/*.map"
67
79
  ],
68
80
  "exports": {
69
81
  ".": {
@@ -97,6 +109,8 @@
97
109
  "dev": "vite",
98
110
  "lint": "eslint src",
99
111
  "lint:fix": "eslint src --fix",
112
+ "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
113
+ "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
100
114
  "predist": "rm -rf dist",
101
115
  "dist": "vite build",
102
116
  "test": "yarn lint && yarn typecheck && vitest --coverage.enabled=true --silent --run",
@@ -104,17 +118,19 @@
104
118
  "test:watch": "vitest --watch",
105
119
  "test:coverage": "vitest --coverage.enabled=true --run",
106
120
  "typecheck": "tsc --noEmit",
107
- "validate": "yarn lint && yarn typecheck && yarn dist",
108
- "publish-figma": "npx figma connect publish"
121
+ "validate": "yarn format:check && yarn lint && yarn typecheck && yarn dist",
122
+ "publish-figma": "npx figma connect publish",
123
+ "pack:check": "npm pack --dry-run",
124
+ "pack:size": "npm pack --dry-run 2>&1 | grep -E '(unpacked size|package size|total files)'",
125
+ "pack:analyze": "npm pack && tar -tzf *.tgz | head -50 && rm *.tgz",
126
+ "prepublishOnly": "yarn dist && yarn pack:size"
109
127
  },
110
128
  "peerDependencies": {
111
129
  "react": ">=17.0.0 || >=18.3.1",
112
130
  "react-dom": ">=17.0.0 || >=18.3.1"
113
131
  },
114
132
  "dependencies": {
115
- "@floating-ui/dom": "^1.7.4",
116
- "react": "18.3.1",
117
- "react-dom": "18.3.1"
133
+ "@floating-ui/dom": "^1.7.4"
118
134
  },
119
135
  "devDependencies": {
120
136
  "@figma/code-connect": "^1.3.12",
@@ -128,24 +144,23 @@
128
144
  "@testing-library/react": "^16.3.1",
129
145
  "@testing-library/user-event": "^14.6.1",
130
146
  "@trivago/prettier-plugin-sort-imports": "^6.0.0",
131
- "@types/html-validator": "^5.0.6",
132
147
  "@types/node": "^25.0.3",
133
148
  "@types/react": "^18.3.12",
134
149
  "@types/react-dom": "^18.3.1",
135
150
  "@types/testing-library__jest-dom": "^6.0.0",
136
- "@typescript-eslint/parser": "^8.50.1",
137
151
  "@vitejs/plugin-react": "^5.1.2",
138
152
  "@vitest/coverage-v8": "^4.0.16",
139
153
  "@vitest/ui": "^4.0.16",
140
154
  "bernova": "^0.2.0",
141
155
  "eslint": "^9.39.2",
142
156
  "eslint-config-kubit": "1.2.0",
143
- "eslint-plugin-perfectionist": "^5.1.0",
144
157
  "eslint-plugin-storybook": "10.1.10",
145
158
  "glob": "^13.0.0",
146
159
  "html-validate": "^10.5.0",
147
- "jsdom": "^27.3.0",
160
+ "jsdom": "^27.4.0",
148
161
  "prettier": "^3.7.4",
162
+ "react": "18.3.1",
163
+ "react-dom": "18.3.1",
149
164
  "storybook": "^10.1.10",
150
165
  "storybook-addon-deep-controls": "^0.10.0",
151
166
  "storybook-addon-pseudo-states": "^10.1.10",