@indico-data/design-system 2.53.0 → 2.54.0
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.
- package/lib/components/index.d.ts +3 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +8 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +7 -0
- package/lib/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.d.ts +1 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +7 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +6 -0
- package/lib/components/tooltip/Tooltip.d.ts +13 -0
- package/lib/components/tooltip/Tooltip.stories.d.ts +6 -0
- package/lib/index.css +149 -0
- package/lib/index.d.ts +50 -46
- package/lib/index.esm.css +149 -0
- package/lib/index.esm.js +5789 -6001
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5787 -5999
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.mdx +21 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +89 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +25 -0
- package/src/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.tsx +16 -0
- package/src/{legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.ts → components/loading-indicators/BarSpinner/styles/BarSpinner.scss} +11 -11
- package/src/components/loading-indicators/CirclePulse/CirclePulse.mdx +20 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.scss +83 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +78 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +15 -0
- package/src/components/tanstackTable/components/TableBody/TableBody.tsx +1 -1
- package/src/components/tooltip/Tooltip.mdx +25 -0
- package/src/components/tooltip/Tooltip.stories.tsx +113 -0
- package/src/components/tooltip/Tooltip.tsx +38 -0
- package/src/components/tooltip/styles/Tooltip.scss +8 -0
- package/src/index.ts +4 -2
- package/src/styles/globals.scss +9 -0
- package/src/styles/index.scss +3 -0
- package/lib/legacy/components/Tooltip/Tooltip.d.ts +0 -15
- package/lib/legacy/components/Tooltip/Tooltip.stories.d.ts +0 -9
- package/lib/legacy/components/Tooltip/Tooltip.styles.d.ts +0 -1
- package/lib/legacy/components/index.d.ts +0 -2
- package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.d.ts +0 -7
- package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/BarSpinner/BarSpinner.styles.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +0 -12
- package/lib/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.d.ts +0 -7
- package/lib/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.stories.d.ts +0 -10
- package/lib/legacy/components/loading-indicators/CircleSpinner/index.d.ts +0 -1
- package/lib/legacy/components/loading-indicators/index.d.ts +0 -3
- package/src/legacy/components/Tooltip/Tooltip.stories.tsx +0 -107
- package/src/legacy/components/Tooltip/Tooltip.styles.ts +0 -64
- package/src/legacy/components/Tooltip/Tooltip.tsx +0 -70
- package/src/legacy/components/index.ts +0 -2
- package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -14
- package/src/legacy/components/loading-indicators/BarSpinner/BarSpinner.tsx +0 -21
- package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -22
- package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.styles.ts +0 -77
- package/src/legacy/components/loading-indicators/CirclePulse/CirclePulse.tsx +0 -57
- package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.stories.tsx +0 -16
- package/src/legacy/components/loading-indicators/CircleSpinner/CircleSpinner.tsx +0 -36
- package/src/legacy/components/loading-indicators/CircleSpinner/index.ts +0 -1
- package/src/legacy/components/loading-indicators/index.ts +0 -3
- /package/lib/{legacy/components → components}/loading-indicators/BarSpinner/index.d.ts +0 -0
- /package/lib/{legacy/components → components}/loading-indicators/CirclePulse/index.d.ts +0 -0
- /package/lib/{legacy/components/Tooltip → components/tooltip}/index.d.ts +0 -0
- /package/src/{legacy/components → components}/loading-indicators/BarSpinner/index.ts +0 -0
- /package/src/{legacy/components → components}/loading-indicators/CirclePulse/index.ts +0 -0
- /package/src/{legacy/components/Tooltip → components/tooltip}/index.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const StyledTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import { BarSpinner } from './BarSpinner';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof BarSpinner;
|
|
5
|
-
title: string;
|
|
6
|
-
argTypes: {};
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof BarSpinner>;
|
|
10
|
-
export declare const Normal: Story;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const StyledBarSpinner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PermafrostComponent } from '../../../../types';
|
|
3
|
-
type Props = PermafrostComponent & {
|
|
4
|
-
color?: string;
|
|
5
|
-
overallSize?: string | number;
|
|
6
|
-
rippleSize?: string | number;
|
|
7
|
-
showRandomMessage?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare function CirclePulse(props: Props): React.ReactElement;
|
|
10
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import { CirclePulse } from './CirclePulse';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof CirclePulse;
|
|
5
|
-
title: string;
|
|
6
|
-
argTypes: {};
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof CirclePulse>;
|
|
10
|
-
export declare const Normal: Story;
|
|
11
|
-
export declare const CustomColor: Story;
|
|
12
|
-
export declare const WithRandomMessage: Story;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const StyledLoadingIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
|
-
overallsize: string;
|
|
3
|
-
ripplesize: string;
|
|
4
|
-
}>> & string;
|
|
5
|
-
export declare const StyledMessageLoadingIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
-
overallsize: string;
|
|
7
|
-
}>> & string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PermafrostComponent, IconSizes } from '../../../../types';
|
|
3
|
-
type Props = PermafrostComponent & {
|
|
4
|
-
ariaLabel?: string;
|
|
5
|
-
size?: IconSizes;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
fill?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function CircleSpinner(props: Props): React.ReactElement;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import { CircleSpinner } from './CircleSpinner';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof CircleSpinner;
|
|
5
|
-
title: string;
|
|
6
|
-
argTypes: {};
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof CircleSpinner>;
|
|
10
|
-
export declare const Normal: Story;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CircleSpinner } from './CircleSpinner';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { Tooltip } from './Tooltip';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Tooltip> = {
|
|
7
|
-
component: Tooltip,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
title: 'legacy/Tooltip',
|
|
10
|
-
args: {},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof Tooltip>;
|
|
15
|
-
|
|
16
|
-
function RenderQuestionMark(props: any) {
|
|
17
|
-
return (
|
|
18
|
-
<div style={{ height: '500px' }}>
|
|
19
|
-
<Tooltip for="example-tooltip" {...props}>
|
|
20
|
-
This is a paragraph
|
|
21
|
-
</Tooltip>
|
|
22
|
-
|
|
23
|
-
<p data-tip data-for="example-tooltip">
|
|
24
|
-
Hover on text to see tooltip
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function RenderNoQuestionMark(props: any) {
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
<Tooltip for="example-tooltip">
|
|
34
|
-
<p>This is a paragraph</p>
|
|
35
|
-
</Tooltip>
|
|
36
|
-
|
|
37
|
-
<p
|
|
38
|
-
data-tooltip-id="example-tooltip"
|
|
39
|
-
data-tooltip-place={props.place}
|
|
40
|
-
style={{ display: 'inline-block', marginTop: '100px' }}
|
|
41
|
-
>
|
|
42
|
-
Hover on text to see tooltip
|
|
43
|
-
</p>
|
|
44
|
-
</>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const Single: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
questionMark: true,
|
|
51
|
-
for: 'example-tooltip',
|
|
52
|
-
place: 'top',
|
|
53
|
-
clickToShow: false,
|
|
54
|
-
delayHide: 0,
|
|
55
|
-
questionMarkClassName: 'question-mark',
|
|
56
|
-
children: 'This is a paragraph',
|
|
57
|
-
block: false,
|
|
58
|
-
},
|
|
59
|
-
render: (args) => {
|
|
60
|
-
return <RenderQuestionMark {...args} />;
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const NoQuestionMark: Story = {
|
|
65
|
-
args: {
|
|
66
|
-
questionMark: false,
|
|
67
|
-
for: 'example-tooltip',
|
|
68
|
-
place: 'top',
|
|
69
|
-
clickToShow: false,
|
|
70
|
-
delayHide: 0,
|
|
71
|
-
children: 'This is a paragraph',
|
|
72
|
-
block: false,
|
|
73
|
-
},
|
|
74
|
-
render: (args) => {
|
|
75
|
-
return <RenderNoQuestionMark {...args} />;
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const Bottom: Story = {
|
|
80
|
-
args: {
|
|
81
|
-
questionMark: false,
|
|
82
|
-
for: 'example-tooltip',
|
|
83
|
-
place: 'bottom',
|
|
84
|
-
clickToShow: false,
|
|
85
|
-
delayHide: 0,
|
|
86
|
-
children: 'This is a paragraph',
|
|
87
|
-
block: false,
|
|
88
|
-
},
|
|
89
|
-
render: (args) => {
|
|
90
|
-
return <RenderNoQuestionMark {...args} />;
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export const Right: Story = {
|
|
95
|
-
args: {
|
|
96
|
-
questionMark: false,
|
|
97
|
-
for: 'example-tooltip',
|
|
98
|
-
place: 'right',
|
|
99
|
-
clickToShow: false,
|
|
100
|
-
delayHide: 0,
|
|
101
|
-
children: 'This is a paragraph',
|
|
102
|
-
block: false,
|
|
103
|
-
},
|
|
104
|
-
render: (args) => {
|
|
105
|
-
return <RenderNoQuestionMark {...args} />;
|
|
106
|
-
},
|
|
107
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const StyledTooltip = styled.div`
|
|
4
|
-
display: inline-block;
|
|
5
|
-
|
|
6
|
-
i:hover {
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
p {
|
|
11
|
-
line-height: 1.4;
|
|
12
|
-
font-size: 13px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.tool {
|
|
16
|
-
border-radius: 2px !important;
|
|
17
|
-
padding: 8px 11px !important;
|
|
18
|
-
opacity: 1 !important;
|
|
19
|
-
|
|
20
|
-
&.place-left:after {
|
|
21
|
-
border-top: 5px solid transparent !important;
|
|
22
|
-
border-bottom: 5px solid transparent !important;
|
|
23
|
-
right: -6px !important;
|
|
24
|
-
top: 50% !important;
|
|
25
|
-
margin-top: -9px !important;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.place-left:before {
|
|
29
|
-
border-left-width: 8px !important;
|
|
30
|
-
border-left-style: solid !important;
|
|
31
|
-
margin-top: -10px !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.place-right:after {
|
|
35
|
-
border-top: 5px solid transparent !important;
|
|
36
|
-
border-bottom: 5px solid transparent !important;
|
|
37
|
-
left: -6px !important;
|
|
38
|
-
top: 50% !important;
|
|
39
|
-
margin-top: -9px !important;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.place-right:before {
|
|
43
|
-
border-right-width: 8px !important;
|
|
44
|
-
border-right-style: solid !important;
|
|
45
|
-
margin-top: -10px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.place-top:after {
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.place-top:before {
|
|
52
|
-
border-top-width: 8px !important;
|
|
53
|
-
border-top-style: solid !important;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&.place-bottom:after {
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&.place-bottom:before {
|
|
60
|
-
border-bottom-width: 8px !important;
|
|
61
|
-
border-bottom-style: solid !important;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { Icon } from '../../../components/icons/Icon';
|
|
6
|
-
import { PermafrostComponent } from '../../../types';
|
|
7
|
-
import { Tooltip as ReactTooltip } from 'react-tooltip';
|
|
8
|
-
|
|
9
|
-
import { StyledTooltip } from './Tooltip.styles';
|
|
10
|
-
|
|
11
|
-
enum PlacesType {
|
|
12
|
-
top = 'top',
|
|
13
|
-
'top-start' = 'top-start',
|
|
14
|
-
'top-end' = 'top-end',
|
|
15
|
-
right = 'right',
|
|
16
|
-
'right-start' = 'right-start',
|
|
17
|
-
'right-end' = 'right-end',
|
|
18
|
-
bottom = 'bottom',
|
|
19
|
-
'bottom-start' = 'bottom-start',
|
|
20
|
-
'bottom-end' = 'bottom-end',
|
|
21
|
-
left = 'left',
|
|
22
|
-
'left-start' = 'left-start',
|
|
23
|
-
'left-end' = 'left-end',
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type Props = PermafrostComponent & {
|
|
27
|
-
questionMark?: boolean;
|
|
28
|
-
for?: string | null;
|
|
29
|
-
place?: string;
|
|
30
|
-
clickToShow?: boolean;
|
|
31
|
-
delayShow?: number;
|
|
32
|
-
delayHide?: number;
|
|
33
|
-
questionMarkClassName?: string;
|
|
34
|
-
children: React.ReactNode;
|
|
35
|
-
block?: boolean;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Tooltip = (props: Props) => {
|
|
39
|
-
return (
|
|
40
|
-
<StyledTooltip
|
|
41
|
-
className={props.className}
|
|
42
|
-
data-cy={props['data-cy']}
|
|
43
|
-
id={props.id}
|
|
44
|
-
// this was done in a hurry, consider refactor on next pass.
|
|
45
|
-
style={{ display: props.block ? 'block' : 'inline-block' }}
|
|
46
|
-
>
|
|
47
|
-
{props.questionMark && (
|
|
48
|
-
<i
|
|
49
|
-
className={props.questionMarkClassName}
|
|
50
|
-
// data-tip={props.clickToShow ? 'custom show' : ''}
|
|
51
|
-
data-tooltip-id={props.for as string | undefined}
|
|
52
|
-
data-tooltip-place={(props.place as PlacesType) || 'top'}
|
|
53
|
-
>
|
|
54
|
-
<Icon name="fa-question-circle" />
|
|
55
|
-
</i>
|
|
56
|
-
)}
|
|
57
|
-
<ReactTooltip
|
|
58
|
-
className="tool"
|
|
59
|
-
// globalEventOff={props.clickToShow ? 'click' : ''}
|
|
60
|
-
// place={(props.place as PlacesType) || 'top'}
|
|
61
|
-
openOnClick={props.clickToShow}
|
|
62
|
-
id={props.for as string | undefined}
|
|
63
|
-
delayShow={props.delayShow}
|
|
64
|
-
delayHide={props.delayHide}
|
|
65
|
-
>
|
|
66
|
-
{props.children}
|
|
67
|
-
</ReactTooltip>
|
|
68
|
-
</StyledTooltip>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { BarSpinner } from './BarSpinner';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
component: BarSpinner,
|
|
7
|
-
title: 'legacy/Loading/BarSpinner',
|
|
8
|
-
argTypes: {},
|
|
9
|
-
} satisfies Meta<typeof BarSpinner>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof BarSpinner>;
|
|
13
|
-
|
|
14
|
-
export const Normal: Story = {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import type { PermafrostComponent } from '../../../../types';
|
|
6
|
-
|
|
7
|
-
import { StyledBarSpinner } from './BarSpinner.styles';
|
|
8
|
-
|
|
9
|
-
type Props = PermafrostComponent & {
|
|
10
|
-
width?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function BarSpinner(props: Props): React.ReactElement {
|
|
14
|
-
const { className, id, width = '100%' } = props;
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<StyledBarSpinner className={className} data-cy={props['data-cy']} id={id} style={{ width }}>
|
|
18
|
-
<span />
|
|
19
|
-
</StyledBarSpinner>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { CirclePulse } from './CirclePulse';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
component: CirclePulse,
|
|
7
|
-
title: 'legacy/Loading/CirclePulse',
|
|
8
|
-
argTypes: {},
|
|
9
|
-
} satisfies Meta<typeof CirclePulse>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof CirclePulse>;
|
|
13
|
-
|
|
14
|
-
export const Normal: Story = {};
|
|
15
|
-
|
|
16
|
-
export const CustomColor: Story = {
|
|
17
|
-
args: { color: '#f0f' },
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const WithRandomMessage: Story = {
|
|
21
|
-
args: { showRandomMessage: true },
|
|
22
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import styled, { keyframes } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const ripple = (size: string) => keyframes`
|
|
4
|
-
0% {
|
|
5
|
-
width: 0;
|
|
6
|
-
height: 0;
|
|
7
|
-
opacity: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
20% {
|
|
11
|
-
opacity: 1;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
100% {
|
|
15
|
-
width: ${size};
|
|
16
|
-
height: ${size};
|
|
17
|
-
opacity: 0;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
const animationSpeed = 1.4;
|
|
22
|
-
|
|
23
|
-
export const StyledLoadingIndicator = styled.div<{
|
|
24
|
-
overallsize: string;
|
|
25
|
-
ripplesize: string;
|
|
26
|
-
}>`
|
|
27
|
-
display: grid;
|
|
28
|
-
place-items: center;
|
|
29
|
-
|
|
30
|
-
width: ${(props) => props.overallsize};
|
|
31
|
-
height: ${(props) => props.overallsize};
|
|
32
|
-
|
|
33
|
-
margin-left: auto;
|
|
34
|
-
margin-right: auto;
|
|
35
|
-
|
|
36
|
-
&:before,
|
|
37
|
-
&:after {
|
|
38
|
-
content: '';
|
|
39
|
-
border: 4px solid currentColor;
|
|
40
|
-
border-radius: 50%;
|
|
41
|
-
|
|
42
|
-
grid-area: 1 / 1;
|
|
43
|
-
|
|
44
|
-
animation: ${(props) => ripple(props.ripplesize)} ${animationSpeed}s
|
|
45
|
-
cubic-bezier(0, 0.2, 0.8, 1) infinite;
|
|
46
|
-
|
|
47
|
-
@media (prefers-reduced-motion) {
|
|
48
|
-
animation-duration: ${animationSpeed * 2}s;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:after {
|
|
53
|
-
animation-delay: -${animationSpeed / 2}s;
|
|
54
|
-
|
|
55
|
-
@media (prefers-reduced-motion) {
|
|
56
|
-
animation-delay: -${animationSpeed}s;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
|
|
61
|
-
export const StyledMessageLoadingIndicator = styled.div<{ overallsize: string }>`
|
|
62
|
-
display: block;
|
|
63
|
-
|
|
64
|
-
> * {
|
|
65
|
-
margin-left: auto;
|
|
66
|
-
margin-right: auto;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.message {
|
|
70
|
-
text-align: center;
|
|
71
|
-
display: block;
|
|
72
|
-
width: ${(props) => props.overallsize};
|
|
73
|
-
margin-top: -50px;
|
|
74
|
-
|
|
75
|
-
font-style: italic;
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import type { PermafrostComponent } from '../../../../types';
|
|
6
|
-
|
|
7
|
-
import { StyledLoadingIndicator, StyledMessageLoadingIndicator } from './CirclePulse.styles';
|
|
8
|
-
|
|
9
|
-
type Props = PermafrostComponent & {
|
|
10
|
-
color?: string;
|
|
11
|
-
overallSize?: string | number;
|
|
12
|
-
rippleSize?: string | number;
|
|
13
|
-
showRandomMessage?: boolean;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export function CirclePulse(props: Props): React.ReactElement {
|
|
17
|
-
const {
|
|
18
|
-
className,
|
|
19
|
-
color,
|
|
20
|
-
id,
|
|
21
|
-
overallSize = '200px',
|
|
22
|
-
rippleSize = '76px',
|
|
23
|
-
showRandomMessage,
|
|
24
|
-
} = props;
|
|
25
|
-
|
|
26
|
-
const loadingIndicator = () => {
|
|
27
|
-
return (
|
|
28
|
-
<StyledLoadingIndicator
|
|
29
|
-
aria-hidden={true}
|
|
30
|
-
className={className}
|
|
31
|
-
data-cy={props['data-cy']}
|
|
32
|
-
data-testid={props['data-testid']}
|
|
33
|
-
id={id}
|
|
34
|
-
overallsize={returnSizeString(overallSize)}
|
|
35
|
-
ripplesize={returnSizeString(rippleSize)}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
if (showRandomMessage) {
|
|
41
|
-
return (
|
|
42
|
-
<StyledMessageLoadingIndicator overallsize={returnSizeString(overallSize)}>
|
|
43
|
-
{loadingIndicator()}
|
|
44
|
-
</StyledMessageLoadingIndicator>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return loadingIndicator();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function returnSizeString(size: string | number): string {
|
|
52
|
-
if (typeof size === 'number') {
|
|
53
|
-
return `${size}px`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return size;
|
|
57
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { CircleSpinner } from './CircleSpinner';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
component: CircleSpinner,
|
|
7
|
-
title: 'legacy/Loading/CircleSpinner',
|
|
8
|
-
argTypes: {},
|
|
9
|
-
} satisfies Meta<typeof CircleSpinner>;
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof CircleSpinner>;
|
|
13
|
-
|
|
14
|
-
export const Normal: Story = {
|
|
15
|
-
args: {},
|
|
16
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { Icon } from '../../../../components/icons/Icon';
|
|
6
|
-
import type { PermafrostComponent, IconSizes } from '../../../../types';
|
|
7
|
-
|
|
8
|
-
type Props = PermafrostComponent & {
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
size?: IconSizes;
|
|
11
|
-
style?: React.CSSProperties;
|
|
12
|
-
fill?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function CircleSpinner(props: Props): React.ReactElement {
|
|
16
|
-
const { className, fill, id, size = 'sm', style, ariaLabel = 'Loading...' } = props;
|
|
17
|
-
|
|
18
|
-
const loaderStyle: React.CSSProperties = {
|
|
19
|
-
position: 'relative',
|
|
20
|
-
top: '1px',
|
|
21
|
-
color: fill || 'currentColor',
|
|
22
|
-
...style,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<Icon
|
|
27
|
-
name="fa-circle-notch"
|
|
28
|
-
className={`spin ${className || ''}`}
|
|
29
|
-
data-cy={props['data-cy']}
|
|
30
|
-
id={id}
|
|
31
|
-
size={size}
|
|
32
|
-
style={loaderStyle}
|
|
33
|
-
ariaLabel={ariaLabel}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CircleSpinner } from './CircleSpinner';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|