diff --git a/src/components/progress-bar/ProgressBar.stories.js b/src/components/progress-bar/progress-bar.stories.tsx similarity index 73% rename from src/components/progress-bar/ProgressBar.stories.js rename to src/components/progress-bar/progress-bar.stories.tsx index 316a98201..f4eff087d 100644 --- a/src/components/progress-bar/ProgressBar.stories.js +++ b/src/components/progress-bar/progress-bar.stories.tsx @@ -1,16 +1,13 @@ import React from 'react' -import ProgressBar from './ProgressBar.js' +import ProgressBar from './progress-bar.js' -/** - * @type {import('@storybook/react').Meta} - */ -export default { - title: 'Progress Bars' -} +const meta = { + title: 'Progress Bars', + component: ProgressBar +} as const + +export default meta -/** - * @type {import('@storybook/react').StoryObj} - */ export const Colors = () => (
diff --git a/src/components/progress-bar/ProgressBar.js b/src/components/progress-bar/progress-bar.tsx similarity index 50% rename from src/components/progress-bar/ProgressBar.js rename to src/components/progress-bar/progress-bar.tsx index 4af66158c..568d48110 100644 --- a/src/components/progress-bar/ProgressBar.js +++ b/src/components/progress-bar/progress-bar.tsx @@ -1,8 +1,18 @@ import React from 'react' -import PropTypes from 'prop-types' import './ProgressBar.css' -const ProgressBar = ({ bg, br, className, style, width, height, progress, time, ...props }) => { +export interface ProgressBarProps { + className?: string + bg?: string + width?: string + height?: string + br?: string + time?: number + progress?: number + style?: React.CSSProperties +} + +const ProgressBar: React.FC = ({ bg = 'bg-aqua', br = 'br-pill', className, style, width = 'w-100', height = 'h1', progress, time, ...props }) => { return (
{time @@ -12,22 +22,4 @@ const ProgressBar = ({ bg, br, className, style, width, height, progress, time, ) } -ProgressBar.propTypes = { - className: PropTypes.string, - bg: PropTypes.string, - width: PropTypes.string, - height: PropTypes.string, - br: PropTypes.string, - time: PropTypes.number, - progress: PropTypes.number -} - -ProgressBar.defaultProps = { - className: '', - width: 'w-100', - height: 'h1', - bg: 'bg-aqua', - br: 'br-pill' -} - export default ProgressBar diff --git a/src/files/file-import-status/FileImportStatus.js b/src/files/file-import-status/FileImportStatus.js index 5ea3c2a02..539436ad3 100644 --- a/src/files/file-import-status/FileImportStatus.js +++ b/src/files/file-import-status/FileImportStatus.js @@ -11,7 +11,7 @@ import GlyphSmallArrows from '../../icons/GlyphSmallArrow.js' import GlyphTick from '../../icons/GlyphTick.js' import GlyphCancel from '../../icons/GlyphCancel.js' import GlyphSmallCancel from '../../icons/GlyphSmallCancel.js' -import ProgressBar from '../../components/progress-bar/ProgressBar.js' +import ProgressBar from '../../components/progress-bar/progress-bar.js' const Import = (job, t) => [...groupByPath(job?.message?.entries || new Map()).values()].map(item => ( diff --git a/src/files/modals/publish-modal/PublishModal.js b/src/files/modals/publish-modal/PublishModal.js index 2421e9199..06a5e613e 100644 --- a/src/files/modals/publish-modal/PublishModal.js +++ b/src/files/modals/publish-modal/PublishModal.js @@ -7,7 +7,7 @@ import { Modal, ModalActions, ModalBody } from '../../../components/modal/modal' import Icon from '../../../icons/StrokeSpeaker.js' import { connect } from 'redux-bundler-react' import Radio from '../../../components/radio/radio.js' -import ProgressBar from '../../../components/progress-bar/ProgressBar.js' +import ProgressBar from '../../../components/progress-bar/progress-bar.js' import GlyphCopy from '../../../icons/GlyphCopy.js' import GlyphTick from '../../../icons/GlyphTick.js' import './PublishModal.css' diff --git a/src/types/modules.d.ts b/src/types/modules.d.ts new file mode 100644 index 000000000..65ee57500 --- /dev/null +++ b/src/types/modules.d.ts @@ -0,0 +1,9 @@ +declare module '*.css' { + const content: { [className: string]: string } + export default content +} + +declare module '*.module.css' { + const classes: { [key: string]: string } + export default classes +}