@easyv/biz-components 1.0.13 → 1.0.14

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,7 +1,9 @@
1
+ import { HTMLProps } from 'react';
1
2
 
2
- export interface VoiceAnimationProps {
3
+ export interface VoiceAnimationProps extends HTMLProps<HTMLDivElement> {
3
4
  className?: string;
4
5
  barNumber?: number;
5
6
  barClassName?: string;
7
+ playStatus?: 'paused' | 'running';
6
8
  }
7
9
  export declare const VoiceAnimation: (props: VoiceAnimationProps) => JSX.Element;
@@ -7,7 +7,7 @@ const getAnimationDelay = (index) => {
7
7
  return `-${animationDelayList[index % durationLength]}s`;
8
8
  };
9
9
  const VoiceAnimation = (props) => {
10
- const { className = "", barNumber = 22, barClassName = "" } = props;
10
+ const { className = "", barNumber = 22, barClassName = "", playStatus, ...rest } = props;
11
11
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
12
12
  "div",
13
13
  {
@@ -15,11 +15,18 @@ const VoiceAnimation = (props) => {
15
15
  "voice-animation biz-flex biz-justify-between biz-items-center biz-w-full biz-h-full",
16
16
  className
17
17
  ),
18
+ ...rest,
18
19
  children: new Array(barNumber).fill(0).map((_, index) => {
19
20
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
20
21
  "div",
21
22
  {
22
- className: `wave-bar biz-h-full biz-rounded-full biz-w-[0.4rem] biz-bg-[#000] ${barClassName}`,
23
+ className: classNames(
24
+ "wave-bar biz-h-full biz-rounded-full biz-w-[0.4rem] biz-bg-[#000]",
25
+ {
26
+ paused: playStatus === "paused"
27
+ },
28
+ barClassName
29
+ ),
23
30
  style: {
24
31
  animationDelay: getAnimationDelay(index)
25
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"voice-animation.es.js","sources":["../../../src/components/voice-animation/voice-animation.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport './index.css';\n\nexport interface VoiceAnimationProps {\n className?: string;\n barNumber?: number;\n barClassName?: string;\n}\nconst animationDelayList = [0.4, 1.2, 0.8, 1.4, 0.8, 0.4, 1.4, 0.4, 1.4, 0.8, 0.4, 1.6];\nconst durationLength = animationDelayList.length;\nconst getAnimationDelay = (index: number) => {\n return `-${animationDelayList[index % durationLength]}s`;\n};\n\nexport const VoiceAnimation = (props: VoiceAnimationProps) => {\n const { className = '', barNumber = 22, barClassName = '' } = props;\n\n return (\n <div\n className={classNames(\n 'voice-animation biz-flex biz-justify-between biz-items-center biz-w-full biz-h-full',\n className,\n )}\n >\n {new Array(barNumber).fill(0).map((_, index) => {\n return (\n <div\n key={index}\n className={`wave-bar biz-h-full biz-rounded-full biz-w-[0.4rem] biz-bg-[#000] ${barClassName}`}\n style={{\n animationDelay: getAnimationDelay(index),\n }}\n ></div>\n );\n })}\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;AAQA,MAAM,qBAAqB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AACtF,MAAM,iBAAiB,mBAAmB;AAC1C,MAAM,oBAAoB,CAAC,UAAkB;AAC3C,SAAO,IAAI,mBAAmB,QAAQ,cAAc,CAAC;AACvD;AAEa,MAAA,iBAAiB,CAAC,UAA+B;AAC5D,QAAM,EAAE,YAAY,IAAI,YAAY,IAAI,eAAe,OAAO;AAG5D,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEC,UAAA,IAAI,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAE5C,eAAAA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAW,qEAAqE,YAAY;AAAA,YAC5F,OAAO;AAAA,cACL,gBAAgB,kBAAkB,KAAK;AAAA,YAAA;AAAA,UACzC;AAAA,UAJK;AAAA,QAKN;AAAA,MAEJ,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
1
+ {"version":3,"file":"voice-animation.es.js","sources":["../../../src/components/voice-animation/voice-animation.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport './index.css';\nimport { HTMLProps } from 'react';\n\nexport interface VoiceAnimationProps extends HTMLProps<HTMLDivElement> {\n className?: string;\n barNumber?: number;\n barClassName?: string;\n playStatus?: 'paused' | 'running';\n}\nconst animationDelayList = [0.4, 1.2, 0.8, 1.4, 0.8, 0.4, 1.4, 0.4, 1.4, 0.8, 0.4, 1.6];\nconst durationLength = animationDelayList.length;\nconst getAnimationDelay = (index: number) => {\n return `-${animationDelayList[index % durationLength]}s`;\n};\n\nexport const VoiceAnimation = (props: VoiceAnimationProps) => {\n const { className = '', barNumber = 22, barClassName = '', playStatus, ...rest } = props;\n\n return (\n <div\n className={classNames(\n 'voice-animation biz-flex biz-justify-between biz-items-center biz-w-full biz-h-full',\n className,\n )}\n {...rest}\n >\n {new Array(barNumber).fill(0).map((_, index) => {\n return (\n <div\n key={index}\n className={classNames(\n 'wave-bar biz-h-full biz-rounded-full biz-w-[0.4rem] biz-bg-[#000]',\n {\n paused: playStatus === 'paused',\n },\n barClassName,\n )}\n style={{\n animationDelay: getAnimationDelay(index),\n }}\n ></div>\n );\n })}\n </div>\n );\n};\n"],"names":["jsx"],"mappings":";;;AAUA,MAAM,qBAAqB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AACtF,MAAM,iBAAiB,mBAAmB;AAC1C,MAAM,oBAAoB,CAAC,UAAkB;AAC3C,SAAO,IAAI,mBAAmB,QAAQ,cAAc,CAAC;AACvD;AAEa,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA,EAAE,YAAY,IAAI,YAAY,IAAI,eAAe,IAAI,YAAY,GAAG,KAAA,IAAS;AAGjF,SAAAA,kCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,UAAA,IAAI,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAE5C,eAAAA,kCAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,gBACE,QAAQ,eAAe;AAAA,cACzB;AAAA,cACA;AAAA,YACF;AAAA,YACA,OAAO;AAAA,cACL,gBAAgB,kBAAkB,KAAK;AAAA,YAAA;AAAA,UACzC;AAAA,UAVK;AAAA,QAWN;AAAA,MAEJ,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}