@qoretechnologies/reqore 0.30.19 → 0.31.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/.github/workflows/beta_release.yml +6 -0
- package/.github/workflows/tests.yml +1 -1
- package/__tests__/table.test.tsx +1 -1
- package/dist/components/Effect/index.d.ts +1 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +5 -2
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +2 -2
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +7 -3
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +2 -1
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +2 -2
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts +6 -5
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +23 -34
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Spinner/index.d.ts +17 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Spinner/index.js +33 -0
- package/dist/components/Spinner/index.js.map +1 -0
- package/package.json +11 -3
- package/src/components/Effect/index.tsx +6 -3
- package/src/components/Header/index.tsx +9 -2
- package/src/components/Icon/index.tsx +17 -1
- package/src/components/Message/index.tsx +16 -6
- package/src/components/Notifications/notification.tsx +10 -3
- package/src/components/Paragraph/index.tsx +34 -18
- package/src/components/Spinner/index.tsx +62 -0
- package/src/stories/Header/Header.stories.tsx +6 -1
- package/src/stories/Message/Message.stories.tsx +6 -0
- package/src/stories/Notifications/Notification.stories.tsx +1 -7
- package/src/stories/Panel/Panel.stories.tsx +2 -1
- package/src/stories/Paragraph/Paragraph.stories.tsx +73 -0
- package/src/stories/Spacer/Spacer.stories.tsx +0 -1
- package/src/stories/Spinner/Spinner.stories.tsx +63 -0
- package/tests.json +1 -1
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getGradientMix,
|
|
12
12
|
getReadableColorFrom,
|
|
13
13
|
} from '../../helpers/colors';
|
|
14
|
+
import { isStringSize } from '../../helpers/utils';
|
|
14
15
|
import { IWithReqoreMinimal } from '../../types/global';
|
|
15
16
|
|
|
16
17
|
export type TReqoreEffectColorManipulation = 'darken' | 'lighten';
|
|
@@ -66,7 +67,7 @@ export interface IReqoreEffect extends IReqoreEffectFilters {
|
|
|
66
67
|
spaced?: number;
|
|
67
68
|
weight?: number | 'thin' | 'light' | 'normal' | 'bold' | 'thick';
|
|
68
69
|
uppercase?: boolean;
|
|
69
|
-
textSize?: TSizes;
|
|
70
|
+
textSize?: TSizes | string;
|
|
70
71
|
textAlign?: 'left' | 'center' | 'right';
|
|
71
72
|
glow?: {
|
|
72
73
|
size?: number;
|
|
@@ -126,7 +127,7 @@ export const StyledEffect = styled.span`
|
|
|
126
127
|
const gradientDirectionOrShape =
|
|
127
128
|
gradientType === 'linear'
|
|
128
129
|
? effect.gradient.direction || 'to right'
|
|
129
|
-
: effect.gradient.shape || 'circle'
|
|
130
|
+
: `${effect.gradient.shape || 'circle'} ${effect.gradient.direction || 'at center'}`;
|
|
130
131
|
let gradient = `${gradientType}-gradient(${gradientDirectionOrShape}${gradientColors}) padding-box`;
|
|
131
132
|
let gradientActive = `${gradientType}-gradient(${gradientDirectionOrShape}${gradientColorsActive}) padding-box`;
|
|
132
133
|
|
|
@@ -288,7 +289,9 @@ export const StyledEffect = styled.span`
|
|
|
288
289
|
${({ effect }: IReqoreTextEffectProps) =>
|
|
289
290
|
effect && effect.textSize
|
|
290
291
|
? css`
|
|
291
|
-
font-size: ${
|
|
292
|
+
font-size: ${isStringSize(effect.textSize)
|
|
293
|
+
? `${TEXT_FROM_SIZE[effect.textSize]}px`
|
|
294
|
+
: effect.textSize} !important;
|
|
292
295
|
`
|
|
293
296
|
: undefined}
|
|
294
297
|
|
|
@@ -45,7 +45,7 @@ export const StyledHeader = styled(StyledTextEffect)`
|
|
|
45
45
|
`;
|
|
46
46
|
|
|
47
47
|
export const ReqoreHeading = memo(
|
|
48
|
-
({ size, children, customTheme, intent, ...
|
|
48
|
+
({ size, children, customTheme, intent, className, ...rest }: IReqoreHeadingProps) => {
|
|
49
49
|
const theme = useReqoreTheme('main', customTheme, intent);
|
|
50
50
|
const _size: number = isStringSize(size) ? HEADER_SIZE_TO_NUMBER[size] : size;
|
|
51
51
|
const HTMLheaderElement = useMemo(() => {
|
|
@@ -53,7 +53,14 @@ export const ReqoreHeading = memo(
|
|
|
53
53
|
}, [_size]);
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
|
-
<StyledHeader
|
|
56
|
+
<StyledHeader
|
|
57
|
+
as={HTMLheaderElement}
|
|
58
|
+
theme={theme}
|
|
59
|
+
intent={intent}
|
|
60
|
+
{...rest}
|
|
61
|
+
_size={_size}
|
|
62
|
+
className={`${className || ''} reqore-heading`}
|
|
63
|
+
>
|
|
57
64
|
{children}
|
|
58
65
|
</StyledHeader>
|
|
59
66
|
);
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, memo, useContext } from 'react';
|
|
|
2
2
|
import { IconContext } from 'react-icons';
|
|
3
3
|
import { IconBaseProps, IconType } from 'react-icons/lib';
|
|
4
4
|
import * as RemixIcons from 'react-icons/ri';
|
|
5
|
-
import styled, { css } from 'styled-components';
|
|
5
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
6
6
|
import { ReqoreThemeContext } from '../..';
|
|
7
7
|
import { ICON_FROM_SIZE, PADDING_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
8
8
|
import { getColorFromMaybeString } from '../../helpers/colors';
|
|
@@ -25,8 +25,18 @@ export interface IReqoreIconProps
|
|
|
25
25
|
margin?: 'right' | 'left' | 'both';
|
|
26
26
|
image?: string;
|
|
27
27
|
rounded?: boolean;
|
|
28
|
+
animation?: 'spin' | 'heartbeat';
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
const SpinKeyframes = keyframes`
|
|
32
|
+
0% {
|
|
33
|
+
transform: rotate(0deg);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
transform: rotate(360deg);
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
30
40
|
export const StyledIconWrapper = styled(StyledEffect)<{ margin: 'right' | 'left' | 'both' }>`
|
|
31
41
|
display: inline-block;
|
|
32
42
|
flex: 0 0 auto;
|
|
@@ -54,6 +64,12 @@ export const StyledIconWrapper = styled(StyledEffect)<{ margin: 'right' | 'left'
|
|
|
54
64
|
img {
|
|
55
65
|
width: 100%;
|
|
56
66
|
}
|
|
67
|
+
|
|
68
|
+
${({ animation }) =>
|
|
69
|
+
animation === 'spin' &&
|
|
70
|
+
css`
|
|
71
|
+
animation: ${SpinKeyframes} 1s linear infinite;
|
|
72
|
+
`}
|
|
57
73
|
`;
|
|
58
74
|
|
|
59
75
|
const ReqoreIcon = memo(
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
StyledReqoreNotification,
|
|
30
30
|
typeToIcon,
|
|
31
31
|
} from '../Notifications/notification';
|
|
32
|
+
import { ReqoreSpinner } from '../Spinner';
|
|
32
33
|
|
|
33
34
|
export interface IReqoreMessageProps
|
|
34
35
|
extends IWithReqoreCustomTheme,
|
|
@@ -147,12 +148,21 @@ const ReqoreMessage = memo(
|
|
|
147
148
|
>
|
|
148
149
|
{leftIcon ? (
|
|
149
150
|
<StyledIconWrapper intent={intent} size={size} theme={theme}>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
{intent === 'pending' ? (
|
|
152
|
+
<ReqoreSpinner
|
|
153
|
+
size={size}
|
|
154
|
+
iconColor={iconColor}
|
|
155
|
+
type={5}
|
|
156
|
+
iconMargin={flat && minimal ? 'right' : 'both'}
|
|
157
|
+
/>
|
|
158
|
+
) : (
|
|
159
|
+
<ReqoreIcon
|
|
160
|
+
icon={leftIcon}
|
|
161
|
+
margin={flat && minimal ? 'right' : 'both'}
|
|
162
|
+
size={size}
|
|
163
|
+
color={iconColor}
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
156
166
|
</StyledIconWrapper>
|
|
157
167
|
) : null}
|
|
158
168
|
<StyledNotificationContentWrapper size={size} theme={theme}>
|
|
@@ -26,6 +26,7 @@ import { IReqoreIconName } from '../../types/icons';
|
|
|
26
26
|
import { StyledEffect } from '../Effect';
|
|
27
27
|
import { ReqoreHeading } from '../Header';
|
|
28
28
|
import ReqoreIcon from '../Icon';
|
|
29
|
+
import { ReqoreSpinner } from '../Spinner';
|
|
29
30
|
|
|
30
31
|
export type IReqoreNotificationType = TReqoreIntent;
|
|
31
32
|
|
|
@@ -244,8 +245,6 @@ const ReqoreNotification = forwardRef<HTMLDivElement, IReqoreNotificationProps>(
|
|
|
244
245
|
const [internalTimeout, setInternalTimeout] = useState(null);
|
|
245
246
|
const theme = useReqoreTheme('main', customTheme, type || intent, 'notifications');
|
|
246
247
|
|
|
247
|
-
console.log(theme, customTheme, intent);
|
|
248
|
-
|
|
249
248
|
const transitions = useTransition(true, {
|
|
250
249
|
from: { opacity: 0, transform: 'scale(0.9)' },
|
|
251
250
|
enter: { opacity: 1, transform: 'scale(1)' },
|
|
@@ -301,7 +300,15 @@ const ReqoreNotification = forwardRef<HTMLDivElement, IReqoreNotificationProps>(
|
|
|
301
300
|
>
|
|
302
301
|
{type || intent || icon ? (
|
|
303
302
|
<StyledIconWrapper type={type || intent} size={size}>
|
|
304
|
-
|
|
303
|
+
{intent === 'pending' || type === 'pending' ? (
|
|
304
|
+
<ReqoreSpinner size={size} type={5} iconMargin={'both'} />
|
|
305
|
+
) : (
|
|
306
|
+
<ReqoreIcon
|
|
307
|
+
icon={icon || typeToIcon[type || intent]}
|
|
308
|
+
margin={'both'}
|
|
309
|
+
size={size}
|
|
310
|
+
/>
|
|
311
|
+
)}
|
|
305
312
|
</StyledIconWrapper>
|
|
306
313
|
) : null}
|
|
307
314
|
<StyledNotificationContentWrapper size={size} theme={theme}>
|
|
@@ -1,25 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
4
|
+
import { isStringSize } from '../../helpers/utils';
|
|
5
|
+
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
6
|
+
import { IReqoreIntent, IWithReqoreCustomTheme, IWithReqoreEffect } from '../../types/global';
|
|
7
|
+
import { StyledTextEffect } from '../Effect';
|
|
4
8
|
|
|
5
|
-
export interface
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
export interface IReqoreParagraphProps
|
|
10
|
+
extends React.HTMLAttributes<HTMLParagraphElement>,
|
|
11
|
+
IWithReqoreCustomTheme,
|
|
12
|
+
IWithReqoreEffect,
|
|
13
|
+
IReqoreIntent {
|
|
14
|
+
size?: TSizes | string;
|
|
8
15
|
}
|
|
9
16
|
|
|
10
|
-
const
|
|
17
|
+
export const StyledParagraph = styled(StyledTextEffect)`
|
|
11
18
|
margin: 0;
|
|
12
19
|
padding: 0;
|
|
13
|
-
color: ${intent ? theme.intents[intent] :
|
|
20
|
+
color: ${({ theme, intent }) => (intent ? theme.intents[intent] : 'inherit')};
|
|
21
|
+
font-size: ${({ _size }) => (isStringSize(_size) ? `${TEXT_FROM_SIZE[_size]}px` : _size)};
|
|
14
22
|
`;
|
|
15
23
|
|
|
16
|
-
export const ReqoreP
|
|
17
|
-
({ className, ...
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
export const ReqoreP = memo(
|
|
25
|
+
({ size, children, customTheme, intent, className, ...props }: IReqoreParagraphProps) => {
|
|
26
|
+
const theme = useReqoreTheme('main', customTheme, intent);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<StyledParagraph
|
|
30
|
+
as='p'
|
|
31
|
+
theme={theme}
|
|
32
|
+
intent={intent}
|
|
33
|
+
{...props}
|
|
34
|
+
_size={size}
|
|
35
|
+
className={`${className || ''} reqore-paragraph`}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
</StyledParagraph>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { ReqoreIcon, ReqoreP } from '../..';
|
|
3
|
+
import { TSizes } from '../../constants/sizes';
|
|
4
|
+
import { TReqoreIntent } from '../../constants/theme';
|
|
5
|
+
import { IWithReqoreEffect } from '../../types/global';
|
|
6
|
+
import ReqoreControlGroup from '../ControlGroup';
|
|
7
|
+
import { IReqoreEffect, TReqoreEffectColor } from '../Effect';
|
|
8
|
+
|
|
9
|
+
export interface IReqoreSpinnerProps extends IWithReqoreEffect {
|
|
10
|
+
size?: TSizes | string;
|
|
11
|
+
intent?: TReqoreIntent;
|
|
12
|
+
children?: any;
|
|
13
|
+
type?: 2 | 3 | 4 | 5;
|
|
14
|
+
iconColor?: TReqoreEffectColor;
|
|
15
|
+
labelEffect?: IReqoreEffect;
|
|
16
|
+
iconMargin?: 'right' | 'left' | 'both';
|
|
17
|
+
centered?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ReqoreSpinner = ({
|
|
21
|
+
size,
|
|
22
|
+
intent,
|
|
23
|
+
children,
|
|
24
|
+
type,
|
|
25
|
+
iconColor,
|
|
26
|
+
labelEffect,
|
|
27
|
+
effect,
|
|
28
|
+
iconMargin,
|
|
29
|
+
centered,
|
|
30
|
+
}: IReqoreSpinnerProps) => {
|
|
31
|
+
const renderContent = useCallback(() => {
|
|
32
|
+
return (
|
|
33
|
+
<ReqoreIcon
|
|
34
|
+
icon={!type ? 'LoaderLine' : `Loader${type}Line`}
|
|
35
|
+
color={iconColor || intent}
|
|
36
|
+
size={size}
|
|
37
|
+
effect={effect}
|
|
38
|
+
animation='spin'
|
|
39
|
+
className='reqore-spinner'
|
|
40
|
+
margin={iconMargin || (children ? 'right' : undefined)}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}, [size, intent, type, children, iconColor]);
|
|
44
|
+
|
|
45
|
+
if (children) {
|
|
46
|
+
return (
|
|
47
|
+
<ReqoreControlGroup vertical={centered} horizontalAlign={centered ? 'center' : undefined}>
|
|
48
|
+
{renderContent()}
|
|
49
|
+
<ReqoreP
|
|
50
|
+
size={size}
|
|
51
|
+
intent={intent}
|
|
52
|
+
effect={labelEffect}
|
|
53
|
+
className='reqore-spinner-wrapper'
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</ReqoreP>
|
|
57
|
+
</ReqoreControlGroup>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return <>{renderContent()}</>;
|
|
62
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { IReqoreHeadingProps } from '../../components/Header';
|
|
3
|
-
import { ReqoreHeading } from '../../index';
|
|
3
|
+
import { ReqoreHeading, ReqoreVerticalSpacer } from '../../index';
|
|
4
4
|
import { IntentArg } from '../utils/args';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -16,18 +16,23 @@ const Template: Story<IReqoreHeadingProps> = (args) => {
|
|
|
16
16
|
<ReqoreHeading size={1} {...args}>
|
|
17
17
|
This is a heading
|
|
18
18
|
</ReqoreHeading>
|
|
19
|
+
<ReqoreVerticalSpacer height={10} />
|
|
19
20
|
<ReqoreHeading size={2} {...args}>
|
|
20
21
|
This is a heading
|
|
21
22
|
</ReqoreHeading>
|
|
23
|
+
<ReqoreVerticalSpacer height={10} />
|
|
22
24
|
<ReqoreHeading size={3} {...args}>
|
|
23
25
|
This is a heading
|
|
24
26
|
</ReqoreHeading>
|
|
27
|
+
<ReqoreVerticalSpacer height={10} />
|
|
25
28
|
<ReqoreHeading size={4} {...args}>
|
|
26
29
|
This is a heading
|
|
27
30
|
</ReqoreHeading>
|
|
31
|
+
<ReqoreVerticalSpacer height={10} />
|
|
28
32
|
<ReqoreHeading size={5} {...args}>
|
|
29
33
|
This is a heading
|
|
30
34
|
</ReqoreHeading>
|
|
35
|
+
<ReqoreVerticalSpacer height={10} />
|
|
31
36
|
<ReqoreHeading size={6} {...args}>
|
|
32
37
|
This is a heading
|
|
33
38
|
</ReqoreHeading>
|
|
@@ -65,6 +65,12 @@ Opaque.args = {
|
|
|
65
65
|
intent: 'info',
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
export const Pending: Story<IReqoreMessageProps> = Template.bind({});
|
|
69
|
+
Pending.args = {
|
|
70
|
+
opaque: true,
|
|
71
|
+
intent: 'pending',
|
|
72
|
+
};
|
|
73
|
+
|
|
68
74
|
export const CustomTheme: Story<IReqoreMessageProps> = Template.bind({});
|
|
69
75
|
CustomTheme.args = {
|
|
70
76
|
customTheme: {
|
|
@@ -24,13 +24,7 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
24
24
|
content="Hello, I am a very simple notification. Look at me, look at me? Isn't this great?"
|
|
25
25
|
onClick={noop}
|
|
26
26
|
/>
|
|
27
|
-
<ReqoreNotification
|
|
28
|
-
{...args}
|
|
29
|
-
type='pending'
|
|
30
|
-
icon='TimerLine'
|
|
31
|
-
content='I am still waiting'
|
|
32
|
-
onClick={noop}
|
|
33
|
-
/>
|
|
27
|
+
<ReqoreNotification {...args} type='pending' content='I am still waiting' onClick={noop} />
|
|
34
28
|
<ReqoreNotification
|
|
35
29
|
{...args}
|
|
36
30
|
type='success'
|
|
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import ReqoreInput, { IReqoreInputProps } from '../../components/Input';
|
|
4
4
|
import { IReqorePanelAction, IReqorePanelProps, ReqorePanel } from '../../components/Panel';
|
|
5
5
|
import { ReqoreVerticalSpacer } from '../../components/Spacer';
|
|
6
|
-
import {
|
|
6
|
+
import { FlatArg, IconArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
7
7
|
|
|
8
8
|
const { createArg } = argManager<IReqorePanelProps>();
|
|
9
9
|
|
|
@@ -359,6 +359,7 @@ WithEffect.args = {
|
|
|
359
359
|
gradient: {
|
|
360
360
|
type: 'radial',
|
|
361
361
|
shape: 'ellipse',
|
|
362
|
+
direction: 'at bottom center',
|
|
362
363
|
colors: { 0: '#670079', 100: '#180222' },
|
|
363
364
|
animate: 'hover',
|
|
364
365
|
},
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
|
+
import { IReqoreParagraphProps } from '../../components/Paragraph';
|
|
3
|
+
import { ReqoreParagraph, ReqoreVerticalSpacer } from '../../index';
|
|
4
|
+
import { IntentArg } from '../utils/args';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Paragraph',
|
|
8
|
+
argTypes: {
|
|
9
|
+
...IntentArg,
|
|
10
|
+
},
|
|
11
|
+
} as Meta;
|
|
12
|
+
|
|
13
|
+
const Template: Story<IReqoreParagraphProps> = (args) => {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<ReqoreParagraph size='tiny' {...args}>
|
|
17
|
+
This is a paragraph of some text
|
|
18
|
+
</ReqoreParagraph>
|
|
19
|
+
<ReqoreVerticalSpacer height={10} />
|
|
20
|
+
<ReqoreParagraph size='small' {...args}>
|
|
21
|
+
This is a paragraph of some text
|
|
22
|
+
</ReqoreParagraph>
|
|
23
|
+
<ReqoreVerticalSpacer height={10} />
|
|
24
|
+
<ReqoreParagraph size='normal' {...args}>
|
|
25
|
+
This is a paragraph of some text
|
|
26
|
+
</ReqoreParagraph>
|
|
27
|
+
<ReqoreVerticalSpacer height={10} />
|
|
28
|
+
<ReqoreParagraph size='big' {...args}>
|
|
29
|
+
This is a paragraph of some text
|
|
30
|
+
</ReqoreParagraph>
|
|
31
|
+
<ReqoreVerticalSpacer height={10} />
|
|
32
|
+
<ReqoreParagraph size='huge' {...args}>
|
|
33
|
+
This is a paragraph of some text
|
|
34
|
+
</ReqoreParagraph>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Basic = Template.bind({});
|
|
40
|
+
export const Success = Template.bind({});
|
|
41
|
+
Success.args = {
|
|
42
|
+
intent: 'success',
|
|
43
|
+
};
|
|
44
|
+
export const Danger = Template.bind({});
|
|
45
|
+
Danger.args = {
|
|
46
|
+
intent: 'danger',
|
|
47
|
+
};
|
|
48
|
+
export const Warning = Template.bind({});
|
|
49
|
+
Warning.args = {
|
|
50
|
+
intent: 'warning',
|
|
51
|
+
};
|
|
52
|
+
export const Info = Template.bind({});
|
|
53
|
+
Info.args = {
|
|
54
|
+
intent: 'info',
|
|
55
|
+
};
|
|
56
|
+
export const Pending = Template.bind({});
|
|
57
|
+
Pending.args = {
|
|
58
|
+
intent: 'pending',
|
|
59
|
+
};
|
|
60
|
+
export const Muted = Template.bind({});
|
|
61
|
+
Muted.args = {
|
|
62
|
+
intent: 'muted',
|
|
63
|
+
};
|
|
64
|
+
export const Effect = Template.bind({});
|
|
65
|
+
Effect.args = {
|
|
66
|
+
effect: {
|
|
67
|
+
gradient: { colors: { 0: '#5e0acc', 100: '#c008c0' } },
|
|
68
|
+
spaced: 4,
|
|
69
|
+
weight: 'bold',
|
|
70
|
+
uppercase: true,
|
|
71
|
+
textSize: '40px',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
|
+
import { IReqoreSpinnerProps, ReqoreSpinner } from '../../components/Spinner';
|
|
3
|
+
import { ReqoreControlGroup } from '../../index';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Spinner',
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
const Template: Story<IReqoreSpinnerProps> = (args) => {
|
|
10
|
+
return (
|
|
11
|
+
<ReqoreControlGroup vertical gapSize='huge'>
|
|
12
|
+
<ReqoreSpinner {...args}>{args.children}</ReqoreSpinner>
|
|
13
|
+
<ReqoreSpinner type={2} {...args}>
|
|
14
|
+
{args.children}
|
|
15
|
+
</ReqoreSpinner>
|
|
16
|
+
<ReqoreSpinner type={3} {...args}>
|
|
17
|
+
{args.children}
|
|
18
|
+
</ReqoreSpinner>
|
|
19
|
+
<ReqoreSpinner type={4} {...args}>
|
|
20
|
+
{args.children}
|
|
21
|
+
</ReqoreSpinner>
|
|
22
|
+
<ReqoreSpinner type={5} {...args}>
|
|
23
|
+
{args.children}
|
|
24
|
+
</ReqoreSpinner>
|
|
25
|
+
<ReqoreSpinner intent='info' {...args}>
|
|
26
|
+
{args.children}
|
|
27
|
+
</ReqoreSpinner>
|
|
28
|
+
<ReqoreSpinner type={2} size='small' {...args}>
|
|
29
|
+
{args.children}
|
|
30
|
+
</ReqoreSpinner>
|
|
31
|
+
<ReqoreSpinner {...args} type={3} iconColor='success:lighten:2' size='50px'>
|
|
32
|
+
{args.children}
|
|
33
|
+
</ReqoreSpinner>
|
|
34
|
+
<ReqoreSpinner
|
|
35
|
+
{...args}
|
|
36
|
+
type={4}
|
|
37
|
+
iconColor='#f21616'
|
|
38
|
+
labelEffect={{ gradient: { colors: 'warning' } }}
|
|
39
|
+
size='big'
|
|
40
|
+
>
|
|
41
|
+
{args.children}
|
|
42
|
+
</ReqoreSpinner>
|
|
43
|
+
<ReqoreSpinner {...args} type={5} iconColor='#987df4'>
|
|
44
|
+
{args.children}
|
|
45
|
+
</ReqoreSpinner>
|
|
46
|
+
<ReqoreSpinner {...args} type={5} effect={{ blur: 2 }} iconColor='pending'>
|
|
47
|
+
{args.children}
|
|
48
|
+
</ReqoreSpinner>
|
|
49
|
+
</ReqoreControlGroup>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Basic = Template.bind({});
|
|
54
|
+
export const WithLabel = Template.bind({});
|
|
55
|
+
WithLabel.args = {
|
|
56
|
+
children: 'Loading...',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Centered = Template.bind({});
|
|
60
|
+
Centered.args = {
|
|
61
|
+
children: 'Loading...',
|
|
62
|
+
centered: true,
|
|
63
|
+
};
|