@anker-in/headless-ui 0.0.27-alpha.93 → 0.0.27-alpha.94

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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
3
- import type { Swiper as SwiperType } from 'swiper/types';
3
+ import { type SwiperRef } from 'swiper/react';
4
4
  declare const MarqueeItem: {
5
5
  ({ data, configuration }: MarqueeItemProps): import("react/jsx-runtime").JSX.Element;
6
6
  displayName: string;
@@ -11,7 +11,7 @@ declare const MarqueeImageContent: {
11
11
  };
12
12
  declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextContentProps & React.RefAttributes<HTMLDivElement>>;
13
13
  declare const _default: {
14
- (props: Omit<MarqueeProps & React.RefAttributes<SwiperType>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
14
+ (props: Omit<MarqueeProps & React.RefAttributes<SwiperRef>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
15
15
  className?: string;
16
16
  data?: Record<string, any>;
17
17
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var M=Object.create;var o=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var a in r)o(e,a,{get:r[a],enumerable:!0})},d=(e,r,a,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of C(r))!N.call(e,s)&&s!==a&&o(e,s,{get:()=>r[s],enumerable:!(p=q(r,s))||p.enumerable});return e};var g=(e,r,a)=>(a=e!=null?M(S(e)):{},d(r||!e||!e.__esModule?o(a,"default",{value:e,enumerable:!0}):a,e)),I=e=>d(o({},"__esModule",{value:!0}),e);var h={};P(h,{MarqueeImageContent:()=>m,MarqueeItem:()=>l,MarqueeTextContent:()=>n,default:()=>T});module.exports=I(h);var t=require("react/jsx-runtime"),w=g(require("react")),u=require("../../components/index.js"),i=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),c=require("swiper/react"),y=require("swiper/modules");const f=w.default.forwardRef(({data:e,className:r},a)=>(0,t.jsx)(c.Swiper,{direction:"horizontal",className:(0,i.cn)("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",r),id:"Marquee"+e?.key,modules:[y.Autoplay],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((p,s)=>(0,t.jsx)(c.SwiperSlide,{children:(0,t.jsx)(l,{data:p})},p?.id+"SwiperSlide"+s))}));f.displayName="Marquee";const l=({data:e,configuration:r})=>(0,t.jsxs)(t.Fragment,{children:[e.type==="image"&&(0,t.jsx)(m,{image:e?.image,imageClassName:r?.imageClassName}),e.type==="text"&&(0,t.jsx)(n,{text:e?.text,textClassName:r?.textClassName})]});l.displayName="MarqueeItem";const m=({image:e,imageClassName:r})=>(0,t.jsx)("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:(0,t.jsx)(u.Picture,{source:e?.url,alt:e?.alt||"",imgClassName:(0,i.cn)("object-cover",r)})});m.displayName="MarqueeImageContent";const n=w.default.forwardRef(({text:e,textClassName:r},a)=>(0,t.jsx)(u.Text,{as:"div",ref:a,html:e,className:(0,i.cn)("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",r)}));n.displayName="MarqueeTextContent";var T=(0,x.withStyles)(f);
1
+ "use strict";"use client";var q=Object.create;var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},d=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of C(t))!S.call(e,s)&&s!==a&&i(e,s,{get:()=>t[s],enumerable:!(o=y(t,s))||o.enumerable});return e};var g=(e,t,a)=>(a=e!=null?q(N(e)):{},d(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),I=e=>d(i({},"__esModule",{value:!0}),e);var v={};P(v,{MarqueeImageContent:()=>m,MarqueeItem:()=>l,MarqueeTextContent:()=>n,default:()=>h});module.exports=I(v);var r=require("react/jsx-runtime"),f=g(require("react")),u=require("../../components/index.js"),p=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),c=require("swiper/react"),M=require("swiper/modules");const w=f.default.forwardRef(({data:e,className:t},a)=>(0,r.jsx)(c.Swiper,{direction:"horizontal",className:(0,p.cn)("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",t),ref:a,id:"Marquee"+e?.key,modules:[M.Autoplay],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((o,s)=>(0,r.jsx)(c.SwiperSlide,{children:(0,r.jsx)(l,{data:o})},o?.id+"SwiperSlide"+s))}));w.displayName="Marquee";const l=({data:e,configuration:t})=>(0,r.jsxs)(r.Fragment,{children:[e.type==="image"&&(0,r.jsx)(m,{image:e?.image,imageClassName:t?.imageClassName}),e.type==="text"&&(0,r.jsx)(n,{text:e?.text,textClassName:t?.textClassName})]});l.displayName="MarqueeItem";const m=({image:e,imageClassName:t})=>(0,r.jsx)("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:(0,r.jsx)(u.Picture,{source:e?.url,alt:e?.alt||"",imgClassName:(0,p.cn)("object-cover",t)})});m.displayName="MarqueeImageContent";const n=f.default.forwardRef(({text:e,textClassName:t},a)=>(0,r.jsx)(u.Text,{as:"div",ref:a,html:e,className:(0,p.cn)("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",t)}));n.displayName="MarqueeTextContent";var h=(0,x.withStyles)(w);
2
2
  //# sourceMappingURL=Marquee.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Marquee/Marquee.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper/types'\nimport { Autoplay } from 'swiper/modules'\n\nconst Marquee = React.forwardRef<SwiperType, MarqueeProps>(({ data, className }, ref) => {\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withStyles(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAN,GA0CU,IAAAO,EAAA,6BAzCVC,EAAkB,oBAClBC,EAA8B,qCAC9BC,EAAmB,kCACnBC,EAA2B,kCAG3BH,EAAoC,wBAEpCI,EAAyB,0BAEzB,MAAMC,EAAU,EAAAC,QAAM,WAAqC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,OAE7E,OAAC,UACC,UAAU,aACV,aAAW,MACT,0GACAD,CACF,EACA,GAAI,UAAYD,GAAM,IACtB,QAAS,CAAC,UAAQ,EAClB,SAAU,CACR,MAAO,EACP,qBAAsB,GACtB,iBAAkBA,GAAM,gBAC1B,EACA,KAAM,GACN,eAAgB,GAChB,eAAc,GACd,cAAc,OACd,MAAOA,GAAM,OAAS,IACtB,YAAa,CACX,EAAG,CACD,aAAc,MAChB,EACA,KAAM,CACJ,aAAc,MAChB,CACF,EAEC,SAAAA,GAAM,OAAO,IAAI,CAACG,EAAMC,OACvB,OAAC,eACC,mBAAChB,EAAA,CAAY,KAAMe,EAAM,GADTA,GAAM,GAAK,cAAgBC,CAE7C,CACD,EACH,CAEH,EACDN,EAAQ,YAAc,UAEtB,MAAMV,EAAc,CAAC,CAAE,KAAAY,EAAM,cAAAK,CAAc,OAEvC,oBACG,UAAAL,EAAK,OAAS,YACb,OAACb,EAAA,CAAoB,MAAOa,GAAM,MAAO,eAAgBK,GAAe,eAAgB,EAEzFL,EAAK,OAAS,WAAU,OAACX,EAAA,CAAmB,KAAMW,GAAM,KAAM,cAAeK,GAAe,cAAe,GAC9G,EAIJjB,EAAY,YAAc,cAE1B,MAAMD,EAAsB,CAAC,CAAE,MAAAmB,EAAO,eAAAC,CAAe,OAEjD,OAAC,OAAI,UAAU,4CACb,mBAAC,WAAQ,OAAQD,GAAO,IAAK,IAAKA,GAAO,KAAO,GAAI,gBAAc,MAAG,eAAgBC,CAAc,EAAG,EACxG,EAIJpB,EAAoB,YAAc,sBAElC,MAAME,EAAqB,EAAAU,QAAM,WAAoD,CAAC,CAAE,KAAAS,EAAM,cAAAC,CAAc,EAAGP,OAE3G,OAAC,QACC,GAAG,MACH,IAAKA,EACL,KAAMM,EACN,aAAW,MAAG,oFAAqFC,CAAa,EAClH,CAEH,EAEDpB,EAAmB,YAAc,qBAEjC,IAAOC,KAAQ,cAAWQ,CAAO",
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Autoplay } from 'swiper/modules'\n\nconst Marquee = React.forwardRef<SwiperRef, MarqueeProps>(({ data, className }, ref) => {\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n ref={ref}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withStyles(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,E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G,EAIJpB,EAAoB,YAAc,sBAElC,MAAME,EAAqB,EAAAU,QAAM,WAAoD,CAAC,CAAE,KAAAS,EAAM,cAAAC,CAAc,EAAGP,OAE3G,OAAC,QACC,GAAG,MACH,IAAKA,EACL,KAAMM,EACN,aAAW,MAAG,oFAAqFC,CAAa,EAClH,CAEH,EAEDpB,EAAmB,YAAc,qBAEjC,IAAOC,KAAQ,cAAWQ,CAAO",
6
6
  "names": ["Marquee_exports", "__export", "MarqueeImageContent", "MarqueeItem", "MarqueeTextContent", "Marquee_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_modules", "Marquee", "React", "data", "className", "ref", "item", "index", "configuration", "image", "imageClassName", "text", "textClassName"]
7
7
  }
@@ -4,7 +4,7 @@ import type { MarqueeProps } from '../biz-components/Marquee/type.js';
4
4
  declare const meta: {
5
5
  title: string;
6
6
  component: {
7
- (props: Omit<MarqueeProps & React.RefAttributes<import("swiper/types").Swiper>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
7
+ (props: Omit<MarqueeProps & React.RefAttributes<import("swiper/react").SwiperRef>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
8
8
  className?: string;
9
9
  data?: Record<string, any>;
10
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
3
- import type { Swiper as SwiperType } from 'swiper/types';
3
+ import { type SwiperRef } from 'swiper/react';
4
4
  declare const MarqueeItem: {
5
5
  ({ data, configuration }: MarqueeItemProps): import("react/jsx-runtime").JSX.Element;
6
6
  displayName: string;
@@ -11,7 +11,7 @@ declare const MarqueeImageContent: {
11
11
  };
12
12
  declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextContentProps & React.RefAttributes<HTMLDivElement>>;
13
13
  declare const _default: {
14
- (props: Omit<MarqueeProps & React.RefAttributes<SwiperType>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
14
+ (props: Omit<MarqueeProps & React.RefAttributes<SwiperRef>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
15
15
  className?: string;
16
16
  data?: Record<string, any>;
17
17
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as M,jsx as t,jsxs as q}from"react/jsx-runtime";import m from"react";import{Picture as c,Text as w}from"../../components/index.js";import{cn as a}from"../../helpers/utils.js";import{withStyles as d}from"../../shared/Styles.js";import{Swiper as f,SwiperSlide as x}from"swiper/react";import{Autoplay as y}from"swiper/modules";const n=m.forwardRef(({data:e,className:r},i)=>t(f,{direction:"horizontal",className:a("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",r),id:"Marquee"+e?.key,modules:[y],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((l,u)=>t(x,{children:t(s,{data:l})},l?.id+"SwiperSlide"+u))}));n.displayName="Marquee";const s=({data:e,configuration:r})=>q(M,{children:[e.type==="image"&&t(p,{image:e?.image,imageClassName:r?.imageClassName}),e.type==="text"&&t(o,{text:e?.text,textClassName:r?.textClassName})]});s.displayName="MarqueeItem";const p=({image:e,imageClassName:r})=>t("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:t(c,{source:e?.url,alt:e?.alt||"",imgClassName:a("object-cover",r)})});p.displayName="MarqueeImageContent";const o=m.forwardRef(({text:e,textClassName:r},i)=>t(w,{as:"div",ref:i,html:e,className:a("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",r)}));o.displayName="MarqueeTextContent";var T=d(n);export{p as MarqueeImageContent,s as MarqueeItem,o as MarqueeTextContent,T as default};
1
+ "use client";import{Fragment as q,jsx as r,jsxs as y}from"react/jsx-runtime";import m from"react";import{Picture as c,Text as f}from"../../components/index.js";import{cn as s}from"../../helpers/utils.js";import{withStyles as d}from"../../shared/Styles.js";import{Swiper as w,SwiperSlide as x}from"swiper/react";import{Autoplay as M}from"swiper/modules";const n=m.forwardRef(({data:e,className:t},a)=>r(w,{direction:"horizontal",className:s("laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear",t),ref:a,id:"Marquee"+e?.key,modules:[M],autoplay:{delay:1,disableOnInteraction:!1,reverseDirection:e?.reverseDirection},loop:!0,allowTouchMove:!1,centeredSlides:!0,slidesPerView:"auto",speed:e?.speed||3e3,breakpoints:{0:{spaceBetween:"24px"},1025:{spaceBetween:"64px"}},children:e?.items?.map((l,u)=>r(x,{children:r(o,{data:l})},l?.id+"SwiperSlide"+u))}));n.displayName="Marquee";const o=({data:e,configuration:t})=>y(q,{children:[e.type==="image"&&r(i,{image:e?.image,imageClassName:t?.imageClassName}),e.type==="text"&&r(p,{text:e?.text,textClassName:t?.textClassName})]});o.displayName="MarqueeItem";const i=({image:e,imageClassName:t})=>r("div",{className:"laptop:w-[120px] h-full w-[72px] shrink-0",children:r(c,{source:e?.url,alt:e?.alt||"",imgClassName:s("object-cover",t)})});i.displayName="MarqueeImageContent";const p=m.forwardRef(({text:e,textClassName:t},a)=>r(f,{as:"div",ref:a,html:e,className:s("text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]",t)}));p.displayName="MarqueeTextContent";var h=d(n);export{i as MarqueeImageContent,o as MarqueeItem,p as MarqueeTextContent,h as default};
2
2
  //# sourceMappingURL=Marquee.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Marquee/Marquee.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper/types'\nimport { Autoplay } from 'swiper/modules'\n\nconst Marquee = React.forwardRef<SwiperType, MarqueeProps>(({ data, className }, ref) => {\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withStyles(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
5
- "mappings": "aA0CU,OAUN,YAAAA,EAVM,OAAAC,EAUN,QAAAC,MAVM,oBAzCV,OAAOC,MAAW,QAClB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAG3B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAS,YAAAC,MAAgB,iBAEzB,MAAMC,EAAUR,EAAM,WAAqC,CAAC,CAAE,KAAAS,EAAM,UAAAC,CAAU,EAAGC,IAE7Eb,EAACO,EAAA,CACC,UAAU,aACV,UAAWF,EACT,0GACAO,CACF,EACA,GAAI,UAAYD,GAAM,IACtB,QAAS,CAACF,CAAQ,EAClB,SAAU,CACR,MAAO,EACP,qBAAsB,GACtB,iBAAkBE,GAAM,gBAC1B,EACA,KAAM,GACN,eAAgB,GAChB,eAAc,GACd,cAAc,OACd,MAAOA,GAAM,OAAS,IACtB,YAAa,CACX,EAAG,CACD,aAAc,MAChB,EACA,KAAM,CACJ,aAAc,MAChB,CACF,EAEC,SAAAA,GAAM,OAAO,IAAI,CAACG,EAAMC,IACvBf,EAACQ,EAAA,CACC,SAAAR,EAACgB,EAAA,CAAY,KAAMF,EAAM,GADTA,GAAM,GAAK,cAAgBC,CAE7C,CACD,EACH,CAEH,EACDL,EAAQ,YAAc,UAEtB,MAAMM,EAAc,CAAC,CAAE,KAAAL,EAAM,cAAAM,CAAc,IAEvChB,EAAAF,EAAA,CACG,UAAAY,EAAK,OAAS,SACbX,EAACkB,EAAA,CAAoB,MAAOP,GAAM,MAAO,eAAgBM,GAAe,eAAgB,EAEzFN,EAAK,OAAS,QAAUX,EAACmB,EAAA,CAAmB,KAAMR,GAAM,KAAM,cAAeM,GAAe,cAAe,GAC9G,EAIJD,EAAY,YAAc,cAE1B,MAAME,EAAsB,CAAC,CAAE,MAAAE,EAAO,eAAAC,CAAe,IAEjDrB,EAAC,OAAI,UAAU,4CACb,SAAAA,EAACG,EAAA,CAAQ,OAAQiB,GAAO,IAAK,IAAKA,GAAO,KAAO,GAAI,aAAcf,EAAG,eAAgBgB,CAAc,EAAG,EACxG,EAIJH,EAAoB,YAAc,sBAElC,MAAMC,EAAqBjB,EAAM,WAAoD,CAAC,CAAE,KAAAoB,EAAM,cAAAC,CAAc,EAAGV,IAE3Gb,EAACI,EAAA,CACC,GAAG,MACH,IAAKS,EACL,KAAMS,EACN,UAAWjB,EAAG,oFAAqFkB,CAAa,EAClH,CAEH,EAEDJ,EAAmB,YAAc,qBAEjC,IAAOK,EAAQlB,EAAWI,CAAO",
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js'\n\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Autoplay } from 'swiper/modules'\n\nconst Marquee = React.forwardRef<SwiperRef, MarqueeProps>(({ data, className }, ref) => {\n return (\n <Swiper\n direction=\"horizontal\"\n className={cn(\n 'laptop:h-[80px] h-[48px] w-full items-center [&_.swiper-slide]:!w-auto [&_.swiper-wrapper]:!ease-linear',\n className\n )}\n ref={ref}\n id={'Marquee' + data?.key}\n modules={[Autoplay]}\n autoplay={{\n delay: 1,\n disableOnInteraction: false,\n reverseDirection: data?.reverseDirection,\n }}\n loop={true}\n allowTouchMove={false}\n centeredSlides\n slidesPerView=\"auto\"\n speed={data?.speed || 3000}\n breakpoints={{\n 0: {\n spaceBetween: '24px',\n },\n 1025: {\n spaceBetween: '64px',\n },\n }}\n >\n {data?.items?.map((item, index) => (\n <SwiperSlide key={item?.id + 'SwiperSlide' + index}>\n <MarqueeItem data={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\nMarquee.displayName = 'Marquee'\n\nconst MarqueeItem = ({ data, configuration }: MarqueeItemProps) => {\n return (\n <>\n {data.type === 'image' && (\n <MarqueeImageContent image={data?.image} imageClassName={configuration?.imageClassName} />\n )}\n {data.type === 'text' && <MarqueeTextContent text={data?.text} textClassName={configuration?.textClassName} />}\n </>\n )\n}\n\nMarqueeItem.displayName = 'MarqueeItem'\n\nconst MarqueeImageContent = ({ image, imageClassName }: MarqueeImageContentProps) => {\n return (\n <div className=\"laptop:w-[120px] h-full w-[72px] shrink-0\">\n <Picture source={image?.url} alt={image?.alt || ''} imgClassName={cn('object-cover', imageClassName)} />\n </div>\n )\n}\n\nMarqueeImageContent.displayName = 'MarqueeImageContent'\n\nconst MarqueeTextContent = React.forwardRef<HTMLDivElement, MarqueeTextContentProps>(({ text, textClassName }, ref) => {\n return (\n <Text\n as=\"div\"\n ref={ref}\n html={text}\n className={cn('text-lines-2 flex size-full items-center justify-center font-medium leading-[1.2]', textClassName)}\n />\n )\n})\n\nMarqueeTextContent.displayName = 'MarqueeTextContent'\n\nexport default withStyles(Marquee)\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent }\n"],
5
+ "mappings": "aA0CU,OAUN,YAAAA,EAVM,OAAAC,EAUN,QAAAC,MAVM,oBAzCV,OAAOC,MAAW,QAClB,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAG3B,OAAS,UAAAC,EAAQ,eAAAC,MAAmC,eACpD,OAAS,YAAAC,MAAgB,iBAEzB,MAAMC,EAAUR,EAAM,WAAoC,CAAC,CAAE,KAAAS,EAAM,UAAAC,CAAU,EA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AAc,qBAEjC,IAAOK,EAAQlB,EAAWI,CAAO",
6
6
  "names": ["Fragment", "jsx", "jsxs", "React", "Picture", "Text", "cn", "withStyles", "Swiper", "SwiperSlide", "Autoplay", "Marquee", "data", "className", "ref", "item", "index", "MarqueeItem", "configuration", "MarqueeImageContent", "MarqueeTextContent", "image", "imageClassName", "text", "textClassName", "Marquee_default"]
7
7
  }
@@ -4,7 +4,7 @@ import type { MarqueeProps } from '../biz-components/Marquee/type.js';
4
4
  declare const meta: {
5
5
  title: string;
6
6
  component: {
7
- (props: Omit<MarqueeProps & React.RefAttributes<import("swiper/types").Swiper>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
7
+ (props: Omit<MarqueeProps & React.RefAttributes<import("swiper/react").SwiperRef>, keyof import("../shared/Styles.js").StylesProps> & Partial<import("../shared/Styles.js").StylesProps> & {
8
8
  className?: string;
9
9
  data?: Record<string, any>;
10
10
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "0.0.27-alpha.93",
3
+ "version": "0.0.27-alpha.94",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",