superdesk-ui-framework 3.1.15 → 3.1.16
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/app/styles/components/_sd-loader.scss +18 -5
- package/app-typescript/components/Loader.tsx +23 -5
- package/dist/components/Index.tsx +6 -1
- package/dist/components/Loader.tsx +24 -0
- package/dist/examples.bundle.js +163 -88
- package/dist/superdesk-ui.bundle.css +13 -6
- package/dist/superdesk-ui.bundle.js +80 -75
- package/examples/pages/components/Index.tsx +6 -1
- package/examples/pages/components/Loader.tsx +24 -0
- package/package.json +1 -1
- package/react/components/Loader.d.ts +11 -3
- package/react/components/Loader.js +6 -2
@@ -1,6 +1,24 @@
|
|
1
1
|
// Animated loader
|
2
2
|
|
3
|
+
.sd-loader--inline {
|
4
|
+
display: inline-flex;
|
5
|
+
width: 100%;
|
6
|
+
min-width: 90px;
|
7
|
+
height: 100%;
|
8
|
+
min-height: 30px;
|
9
|
+
|
10
|
+
// inlining img/three-dots.svg as base64 encoded URL to have loader ready on application start
|
11
|
+
// otherwise, loader image would only start downloading when it already needs to be shown
|
12
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMTIwIDMwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiM3YjdiN2IiPjxjaXJjbGUgY3g9IjE1IiBjeT0iMTUiIHI9IjE1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSIxNSIgdG89IjE1IiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxNTs5OzE1IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjEiIHRvPSIxIiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxOy41OzEiIGNhbGNNb2RlPSJsaW5lYXIiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPjwvY2lyY2xlPjxjaXJjbGUgY3g9IjYwIiBjeT0iMTUiIHI9IjkiIGZpbGwtb3BhY2l0eT0iMC4zIj48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSI5IiB0bz0iOSIgYmVnaW49IjBzIiBkdXI9IjAuOHMiIHZhbHVlcz0iOTsxNTs5IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjAuNSIgdG89IjAuNSIgYmVnaW49IjBzIiBkdXI9IjAuOHMiIHZhbHVlcz0iLjU7MTsuNSIgY2FsY01vZGU9ImxpbmVhciIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIC8+PC9jaXJjbGU+PGNpcmNsZSBjeD0iMTA1IiBjeT0iMTUiIHI9IjE1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSIxNSIgdG89IjE1IiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxNTs5OzE1IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjEiIHRvPSIxIiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxOy41OzEiIGNhbGNNb2RlPSJsaW5lYXIiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPjwvY2lyY2xlPjwvc3ZnPg==");
|
13
|
+
|
14
|
+
background-repeat: no-repeat;
|
15
|
+
background-position: center center;
|
16
|
+
background-size: 60px;
|
17
|
+
background-color: var(--sd-colour-overlay-actioning);
|
18
|
+
}
|
19
|
+
|
3
20
|
.sd-loader {
|
21
|
+
@extend .sd-loader--inline;
|
4
22
|
content: '';
|
5
23
|
display: block;
|
6
24
|
position: absolute;
|
@@ -9,9 +27,4 @@
|
|
9
27
|
inset-block-end: 0;
|
10
28
|
inset-inline-start: 0;
|
11
29
|
z-index: 99999;
|
12
|
-
background-image: url(../img/three-dots.svg);
|
13
|
-
background-repeat: no-repeat;
|
14
|
-
background-position: center center;
|
15
|
-
background-size: 60px;
|
16
|
-
background-color: var(--sd-colour-overlay-actioning);
|
17
30
|
}
|
@@ -1,18 +1,36 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
|
3
|
-
interface
|
4
|
-
overlay
|
3
|
+
interface IPropsOverlay {
|
4
|
+
overlay: true;
|
5
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
5
6
|
}
|
6
7
|
|
8
|
+
interface IPropsInline {
|
9
|
+
overlay?: false;
|
10
|
+
width?: React.CSSProperties['width'];
|
11
|
+
height?: React.CSSProperties['height'];
|
12
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
13
|
+
}
|
14
|
+
|
15
|
+
type IProps = IPropsOverlay | IPropsInline;
|
16
|
+
|
7
17
|
export class Loader extends React.Component<IProps> {
|
8
18
|
render() {
|
9
|
-
|
10
19
|
if (this.props.overlay) {
|
11
20
|
return (
|
12
|
-
<div className=
|
21
|
+
<div className="sd-loader" style={{backgroundColor: this.props.backgroundColor}} />
|
13
22
|
);
|
14
23
|
} else {
|
15
|
-
return
|
24
|
+
return (
|
25
|
+
<div
|
26
|
+
className="sd-loader--inline"
|
27
|
+
style={{
|
28
|
+
width: this.props.width,
|
29
|
+
height: this.props.height,
|
30
|
+
backgroundColor: this.props.backgroundColor,
|
31
|
+
}}
|
32
|
+
/>
|
33
|
+
);
|
16
34
|
}
|
17
35
|
}
|
18
36
|
}
|
@@ -84,6 +84,7 @@ import { BorderUtilitiesDoc } from './utilities/BorderUtilities';
|
|
84
84
|
import { OpacityUtilitiesDoc } from './utilities/OpacityUtilities';
|
85
85
|
import { ObjectFitUtilitiesDoc } from './utilities/ObjectFitUtilities';
|
86
86
|
import { ObjectPositionUtilitiesDoc } from './utilities/ObjectPositionUtilities';
|
87
|
+
import LoaderDoc from './Loader';
|
87
88
|
|
88
89
|
|
89
90
|
interface IPages {
|
@@ -181,7 +182,11 @@ const pages: IPages = {
|
|
181
182
|
"illustration-button": {
|
182
183
|
name: 'Illustration Button',
|
183
184
|
component: IllustrationButtonDoc,
|
184
|
-
}
|
185
|
+
},
|
186
|
+
"loader": {
|
187
|
+
name: 'Loader',
|
188
|
+
component: LoaderDoc,
|
189
|
+
},
|
185
190
|
}
|
186
191
|
},
|
187
192
|
navigationComponents: {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as Markup from '../../js/react';
|
3
|
+
import {Loader} from '../../../app-typescript';
|
4
|
+
|
5
|
+
export default class LoaderDoc extends React.Component {
|
6
|
+
render() {
|
7
|
+
return (
|
8
|
+
<section className='docs-page__container'>
|
9
|
+
<h2 className='docs-page__h2'>Loader</h2>
|
10
|
+
|
11
|
+
<Markup.ReactMarkup>
|
12
|
+
<Markup.ReactMarkupPreview>
|
13
|
+
<Loader />
|
14
|
+
</Markup.ReactMarkupPreview>
|
15
|
+
|
16
|
+
<Markup.ReactMarkupCode>{`
|
17
|
+
<Loader />
|
18
|
+
`}
|
19
|
+
</Markup.ReactMarkupCode>
|
20
|
+
</Markup.ReactMarkup>
|
21
|
+
</section>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
}
|