react-loader-spinner
Version:
react-spinner-loader provides simple React.js spinner component which can be implemented for async wait operation before data load to the view.
1 lines • 6.51 kB
Source Map (JSON)
{"version":3,"sources":["../src/type.ts","../src/shared/svg-wrapper.tsx","../src/shared/constants.ts","../src/loader/audio.tsx"],"names":["DEFAULT_COLOR","DEFAULT_WAI_ARIA_ATTRIBUTE","SvgWrapper","styled","props","SVG_NAMESPACE","Audio","height","width","color","ariaLabel","wrapperStyle","wrapperClass","visible","jsx","jsxs"],"mappings":"0EAEO,IAAMA,CAAAA,CAAgB,SAAA,CAEhBC,CAAAA,CAA6B,CACxC,YAAa,IAAA,CACb,IAAA,CAAM,aACR,CAAA,CCLO,IAAMC,EAAaC,CAAAA,CAAO,GAAA;AAAA,WAAA,EACpBC,CAAAA,EAAUA,CAAAA,CAAM,QAAA,CAAW,MAAA,CAAS,MAAO,CAAA;ECHjD,IAAMC,CAAAA,CAAgB,iCC+BhBC,CAAAA,CAAuC,CAAC,CACnD,MAAA,CAAAC,CAAAA,CAAS,MACT,KAAA,CAAAC,CAAAA,CAAQ,MACR,KAAA,CAAAC,CAAAA,CAAQT,EACR,SAAA,CAAAU,CAAAA,CAAY,gBACZ,YAAA,CAAAC,CAAAA,CAAe,EAAC,CAChB,YAAA,CAAAC,EACA,OAAA,CAAAC,CAAAA,CAAU,IACZ,CAAA,GACEC,GAAAA,CAACZ,EAAA,CACC,QAAA,CAAUW,EACV,KAAA,CAAO,CAAE,GAAGF,CAAa,CAAA,CACzB,UAAWC,CAAAA,CACX,aAAA,CAAY,gBACZ,YAAA,CAAYF,CAAAA,CACX,GAAGT,CAAAA,CAEJ,QAAA,CAAAc,KAAC,KAAA,CAAA,CACC,MAAA,CAAQ,GAAGR,CAAM,CAAA,CAAA,CACjB,MAAO,CAAA,EAAGC,CAAK,GACf,IAAA,CAAMC,CAAAA,CACN,QAAQ,WAAA,CACR,KAAA,CAAOJ,EACP,aAAA,CAAY,WAAA,CAEZ,UAAAS,GAAAA,CAAC,OAAA,CAA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,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF","file":"audio.mjs","sourcesContent":["import { CSSProperties } from 'react'\n\nexport const DEFAULT_COLOR = '#4fa94d'\n\nexport const DEFAULT_WAI_ARIA_ATTRIBUTE = {\n 'aria-busy': true,\n role: 'progressbar',\n}\n\n// Reuse React's CSSProperties for consistent style typing across components\nexport type Style = CSSProperties\n\n// PrimaryProps includes common props shared by experimental components\nexport interface PrimaryProps {\n height?: string | number\n width?: string | number\n color?: string\n ariaLabel?: string\n wrapperStyle?: CSSProperties\n wrapperClass?: string\n visible?: boolean\n}\n\n\n","import styled from 'styled-components'\n\nexport const SvgWrapper = styled.div<{ $visible: boolean }>`\n display: ${props => (props.$visible ? 'flex' : 'none')};\n`\n","export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'\n","import { FunctionComponent, ReactElement, CSSProperties } from 'react'\nimport { DEFAULT_COLOR, DEFAULT_WAI_ARIA_ATTRIBUTE } from '../type'\nimport { SvgWrapper } from '../shared/svg-wrapper'\nimport { SVG_NAMESPACE } from '../shared/constants'\n\n/**\n * Props for the Audio loader component.\n * \n * The Audio loader displays an animated visualization similar to audio equalizer bars,\n * with four vertical bars that animate up and down at different intervals to create\n * a dynamic audio visualization effect.\n * \n * @interface AudioProps\n */\ninterface AudioProps {\n /** Height of the SVG (number interpreted as px). Defaults to '100'. */\n height?: string | number\n /** Width of the SVG (number interpreted as px). Defaults to '100'. */\n width?: string | number\n /** Primary color applied to the audio bars. Defaults to DEFAULT_COLOR. */\n color?: string\n /** Accessible label announced to screen readers. Defaults to 'audio-loading'. */\n ariaLabel?: string\n /** Inline style object applied to the wrapper element. */\n wrapperStyle?: CSSProperties\n /** CSS class applied to the wrapper for custom styling. */\n wrapperClass?: string\n /** When false, the loader is not rendered. Defaults to true. */\n visible?: boolean\n}\n\nexport const Audio: FunctionComponent<AudioProps> = ({\n height = '100',\n width = '100',\n color = DEFAULT_COLOR,\n ariaLabel = 'audio-loading',\n wrapperStyle = {},\n wrapperClass,\n visible = true,\n}): ReactElement => (\n <SvgWrapper\n $visible={visible}\n style={{ ...wrapperStyle }}\n className={wrapperClass}\n data-testid=\"audio-loading\"\n aria-label={ariaLabel}\n {...DEFAULT_WAI_ARIA_ATTRIBUTE}\n >\n <svg\n height={`${height}`}\n width={`${width}`}\n fill={color}\n viewBox=\"0 0 55 80\"\n xmlns={SVG_NAMESPACE}\n data-testid=\"audio-svg\"\n >\n <title>Audio Visualization</title>\n <desc>Animated representation of audio data</desc>\n <g transform=\"matrix(1 0 0 -1 0 80)\">\n <rect width=\"10\" height=\"20\" rx=\"3\">\n <animate\n attributeName=\"height\"\n begin=\"0s\"\n dur=\"4.3s\"\n values=\"20;45;57;80;64;32;66;45;64;23;66;13;64;56;34;34;2;23;76;79;20\"\n calcMode=\"linear\"\n repeatCount=\"indefinite\"\n />\n </rect>\n <rect x=\"15\" width=\"10\" height=\"80\" rx=\"3\">\n <animate\n attributeName=\"height\"\n begin=\"0s\"\n dur=\"2s\"\n values=\"80;55;33;5;75;23;73;33;12;14;60;80\"\n calcMode=\"linear\"\n repeatCount=\"indefinite\"\n />\n </rect>\n <rect x=\"30\" width=\"10\" height=\"50\" rx=\"3\">\n <animate\n attributeName=\"height\"\n begin=\"0s\"\n dur=\"1.4s\"\n values=\"50;34;78;23;56;23;34;76;80;54;21;50\"\n calcMode=\"linear\"\n repeatCount=\"indefinite\"\n />\n </rect>\n <rect x=\"45\" width=\"10\" height=\"30\" rx=\"3\">\n <animate\n attributeName=\"height\"\n begin=\"0s\"\n dur=\"2s\"\n values=\"30;45;13;80;56;72;45;76;34;23;67;30\"\n calcMode=\"linear\"\n repeatCount=\"indefinite\"\n />\n </rect>\n </g>\n </svg>\n </SvgWrapper>\n)\n"]}