@bothub-chat/ui 2.60.0-feat-switcher-d33a5e2f-480e-4276-bd89-749aede06de5 → 2.60.0-feat-switcher-52ce3f48-af9f-4d6d-bf8c-6649d2e0f077

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as i}from"react";import{SwitcherContainer as o,SwitcherSlider as c,SwitcherOption as l}from"./styled.js";const s=({options:s,defaultOption:u=0,onChange:d,className:f})=>{const[m,a]=n(u),[p,h]=n(0),[w,g]=n(0),v=r(null),C=r(null),j=r(null);i(()=>{k()},[m]),i(()=>{const e=()=>{k()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[m]);const k=()=>{const e=[C,j][m];if(e.current&&v.current){const t=v.current.getBoundingClientRect(),n=e.current.getBoundingClientRect(),r=n.left-t.left,{width:i}=n;h(r),g(i)}},x=()=>{a(e=>0===e?1:0),null==d||d(0===m?1:0)};return e(o,{ref:v,className:f,children:[t(c,{position:p,width:w}),t(l,{ref:C,isActive:0===m,onClick:x,children:s[0]}),t(l,{ref:j,isActive:1===m,onClick:x,children:s[1]})]})};export{s as SwitcherSelect};
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as r,useEffect as i}from"react";import{SwitcherContainer as o,SwitcherSlider as c,SwitcherOption as l}from"./styled.js";const s=({options:s,defaultOption:u=0,onChange:d,className:f})=>{const[m,a]=t(u),[p,h]=t(0),[w,g]=t(0),C=r(null),v=r(null),j=r(null);i(()=>{k()},[m]),i(()=>{const e=()=>{k()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[m]);const k=()=>{const e=[v,j][m];if(e.current&&C.current){const n=C.current.getBoundingClientRect(),t=e.current.getBoundingClientRect(),r=t.left-n.left,{width:i}=t;h(r),g(i)}},x=()=>{a(e=>0===e?1:0),null==d||d(0===m?1:0)};return e(o,{ref:C,className:f,children:[n(c,{position:p,width:w}),n(l,{ref:v,onClick:x,children:s[0]}),n(l,{ref:j,onClick:x,children:s[1]})]})};export{s as SwitcherSelect};
@@ -282,7 +282,7 @@ export declare const SwitcherContainer: import("styled-components").IStyledCompo
282
282
  onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
283
283
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
284
284
  }>;
285
- export declare const SwitcherOption: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
285
+ export declare const SwitcherOption: import("styled-components").IStyledComponent<"web", {
286
286
  variant?: import("../typography").TypographyVariant | undefined;
287
287
  component?: import("../typography").TypographyComponent | undefined;
288
288
  align?: import("../typography").TypographyAlign | undefined;
@@ -571,9 +571,7 @@ export declare const SwitcherOption: import("styled-components").IStyledComponen
571
571
  onTransitionStart?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
572
572
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
573
573
  ref?: import("react").Ref<HTMLSpanElement> | undefined;
574
- }, {
575
- isActive: boolean;
576
- }>>;
574
+ }>;
577
575
  export declare const SwitcherSlider: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
578
576
  position: number;
579
577
  width: number;
@@ -21,3 +21,4 @@ type TariffCardEnterpriseProps = {
21
21
  };
22
22
  export declare const TariffCard: React.FC<TariffCardProps | TariffCardEnterpriseProps>;
23
23
  export { TariffCardEnterpriseButton, TariffCardArrow } from './styled';
24
+ export { type TariffType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bothub-chat/ui",
3
- "version": "2.60.0-feat-switcher-d33a5e2f-480e-4276-bd89-749aede06de5",
3
+ "version": "2.60.0-feat-switcher-52ce3f48-af9f-4d6d-bf8c-6649d2e0f077",
4
4
  "description": "Bothub UI Components",
5
5
  "keywords": [
6
6
  "bot",