// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 // The MIT License (MIT) /* * This file includes code from react-loader-spinner, which is licensed under the MIT License. * Copyright (c) 2018 Mohan Pd. * https://github.com/mhnpd/react-loader-spinner * See the LICENSE file for more details. */ import React, { FunctionComponent } from 'react'; import { styled } from 'styled-components'; const DEFAULT_COLOR = '#4fa94d'; const DEFAULT_WAI_ARIA_ATTRIBUTE = { 'aria-busy': true, role: 'progressbar', }; type Style = { [key: string]: string; }; interface PrimaryProps { height?: string | number; width?: string | number; ariaLabel?: string; wrapperStyle?: Style; wrapperClass?: string; visible?: boolean; } interface BaseProps extends PrimaryProps { color?: string; } // changed from div to span to fix DOM nesting error const SvgWrapper = styled.span<{ $visible: boolean }>` display: ${(props) => (props.$visible ? 'flex' : 'none')}; `; interface ThreeDotsProps extends BaseProps { radius?: string | number; } export const ThreeDots: FunctionComponent = ({ height = 80, width = 80, radius = 9, color = DEFAULT_COLOR, ariaLabel = 'three-dots-loading', wrapperStyle, wrapperClass, visible = true, }) => ( );