superdesk-ui-framework 3.0.20 → 3.0.23
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/_icon-font.scss +4 -7
- package/app/styles/interface-elements/_side-panel.scss +6 -5
- package/app-typescript/components/Icon.tsx +1 -1
- package/app-typescript/components/IconButton.tsx +12 -6
- package/app-typescript/components/Layouts/Panel.tsx +48 -19
- package/app-typescript/components/Rotate.tsx +20 -0
- package/app-typescript/index.ts +1 -0
- package/dist/examples.bundle.css +766 -6
- package/dist/examples.bundle.js +1319 -1251
- package/dist/react/Panel.tsx +34 -15
- package/dist/superdesk-ui.bundle.css +2303 -22
- package/dist/superdesk-ui.bundle.js +1239 -1172
- package/dist/vendor.bundle.js +18 -18
- package/examples/pages/react/Panel.tsx +34 -15
- package/package.json +1 -1
- package/react/components/Icon.d.ts +1 -1
- package/react/components/Layouts/Panel.d.ts +2 -1
- package/react/components/Layouts/Panel.js +17 -14
- package/react/components/Rotate.d.ts +9 -0
- package/react/components/Rotate.js +55 -0
- package/react/index.d.ts +1 -0
- package/react/index.js +5 -3
@@ -86,12 +86,6 @@ $icon-base-size: 16px;
|
|
86
86
|
.icon--green {
|
87
87
|
color: $green !important;
|
88
88
|
}
|
89
|
-
.icon--rotate-180 {
|
90
|
-
transform: rotate(180deg);
|
91
|
-
}
|
92
|
-
.icon--rotate-90 {
|
93
|
-
transform: rotate(90deg);
|
94
|
-
}
|
95
89
|
.icon--full-opacity {
|
96
90
|
opacity: 1 !important;
|
97
91
|
}
|
@@ -330,7 +324,10 @@ $sd-icon-font: (
|
|
330
324
|
&.color--white {
|
331
325
|
color: hsla(214, 13%, 90, 1) !important;
|
332
326
|
}
|
333
|
-
|
327
|
+
|
328
|
+
&.scale--1\.5x {
|
329
|
+
--icon-base-size: 24px
|
330
|
+
}
|
334
331
|
&.scale--2x {
|
335
332
|
--icon-base-size: 32px
|
336
333
|
}
|
@@ -43,6 +43,9 @@ $side-panel-Bg-200: var(--sd-colour-panel-bg--200);
|
|
43
43
|
position: relative;
|
44
44
|
min-height: 4.8rem;
|
45
45
|
}
|
46
|
+
.side-panel__header-wrapper {
|
47
|
+
display: flex;
|
48
|
+
}
|
46
49
|
.side-panel__sliding-toolbar {
|
47
50
|
@include sliding-toolbar; // See mixins.scss for details
|
48
51
|
&.side-panel__sliding-toolbar {
|
@@ -53,7 +56,6 @@ $side-panel-Bg-200: var(--sd-colour-panel-bg--200);
|
|
53
56
|
}
|
54
57
|
}
|
55
58
|
}
|
56
|
-
|
57
59
|
.side-panel__heading {
|
58
60
|
padding-inline-start: $sd-base-increment * 2;
|
59
61
|
padding-inline-end: $sd-base-increment * 2;
|
@@ -70,10 +72,9 @@ $side-panel-Bg-200: var(--sd-colour-panel-bg--200);
|
|
70
72
|
letter-spacing: 0.01em;
|
71
73
|
}
|
72
74
|
}
|
73
|
-
.side-
|
74
|
-
|
75
|
-
|
76
|
-
inset-block-start: $sd-base-increment;
|
75
|
+
.side-panel__btn-group {
|
76
|
+
padding-inline: 0.8rem;
|
77
|
+
padding-block: 0.8rem;
|
77
78
|
z-index: 2;
|
78
79
|
color: var(--color-text-light);
|
79
80
|
}
|
@@ -5,7 +5,7 @@ interface IProps {
|
|
5
5
|
size?: 'small' | 'big'; // defaults to 'small'
|
6
6
|
type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'light' | 'white';
|
7
7
|
className?: string;
|
8
|
-
scale?: '2x' | '3x' | '4x';
|
8
|
+
scale?: '1.5x' | '2x' | '3x' | '4x';
|
9
9
|
ariaHidden?: boolean;
|
10
10
|
color?: string;
|
11
11
|
}
|
@@ -25,20 +25,26 @@ export class IconButton extends React.PureComponent<IProps> {
|
|
25
25
|
[`icn-btn--${this.props.style}`]: this.props.style || this.props.style !== undefined,
|
26
26
|
'icn-btn--disabled': this.props.disabled,
|
27
27
|
});
|
28
|
+
|
28
29
|
return (
|
29
30
|
<Tooltip
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
text={this.props.ariaValue}
|
32
|
+
flow={this.props.toolTipFlow}
|
33
|
+
appendToBody={this.props.toolTipAppend}
|
34
|
+
disabled={this.props.disabled}
|
35
|
+
>
|
34
36
|
<button
|
35
37
|
id={this.props.id}
|
36
38
|
tabIndex={0}
|
37
39
|
onClick={this.props.onClick}
|
38
40
|
className={classes}
|
39
41
|
disabled={this.props.disabled}
|
40
|
-
aria-label={this.props.ariaValue}
|
41
|
-
|
42
|
+
aria-label={this.props.ariaValue}
|
43
|
+
>
|
44
|
+
<Icon
|
45
|
+
name={this.props.icon}
|
46
|
+
ariaHidden={true}
|
47
|
+
/>
|
42
48
|
</button>
|
43
49
|
</Tooltip>
|
44
50
|
);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { Icon } from '../Icon';
|
3
2
|
import { IconButton } from '../IconButton';
|
4
3
|
import { Spinner, LoadingOverlay } from '../Spinner';
|
5
4
|
import classNames from 'classnames';
|
5
|
+
import {ButtonGroup} from '../ButtonGroup';
|
6
6
|
|
7
7
|
// ============= Panel ============ //
|
8
8
|
|
@@ -23,11 +23,13 @@ export default class Panel extends React.PureComponent<IPropsPanel> {
|
|
23
23
|
[`side-panel--${this.props.background}`]:
|
24
24
|
this.props.background !== 'light' && this.props.background !== undefined,
|
25
25
|
}, this.props.className);
|
26
|
+
|
26
27
|
let classes2 = classNames('side-panel__container', {
|
27
28
|
[`side-panel__container--${this.props.side}`]: this.props.side,
|
28
29
|
[`side-panel__container--${this.props.size}`]: this.props.size,
|
29
30
|
[`panel-open`]: this.props.open,
|
30
31
|
});
|
32
|
+
|
31
33
|
return (
|
32
34
|
<div className={classes2} data-theme={this.props.theme ? `${this.props.theme}-ui` : null}>
|
33
35
|
<div className={classes}>
|
@@ -47,6 +49,7 @@ interface IPropsPanelHeader {
|
|
47
49
|
theme?: 'light-ui' | 'dark-ui'; // defaults to 'light
|
48
50
|
className?: string;
|
49
51
|
onClose?(): void;
|
52
|
+
iconButtons?: Array<React.ReactNode>;
|
50
53
|
}
|
51
54
|
|
52
55
|
class PanelHeader extends React.PureComponent<IPropsPanelHeader> {
|
@@ -61,22 +64,43 @@ class PanelHeader extends React.PureComponent<IPropsPanelHeader> {
|
|
61
64
|
[`side-panel__header--${this.props.color}`]: this.props.color || this.props.color !== undefined,
|
62
65
|
'side-panel__header--has-close': this.props.onClose,
|
63
66
|
}, this.props.className);
|
67
|
+
|
64
68
|
let style = {
|
65
|
-
zIndex:
|
69
|
+
zIndex: this.props.zIndex ? this.props.zIndex : 10,
|
66
70
|
};
|
71
|
+
|
67
72
|
let defaultTheme = darkColors.includes(this.props.color || '') ? 'dark-ui' : null;
|
68
73
|
|
69
74
|
return (
|
70
75
|
<div data-theme={this.props.theme || defaultTheme} className={classes} style={style}>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
<div className='side-panel__header-wrapper'>
|
77
|
+
{this.props.title != null
|
78
|
+
&& <div className="side-panel__header-inner">
|
79
|
+
<h3 className="side-panel__heading">{this.props.title}</h3>
|
80
|
+
</div>
|
81
|
+
}
|
82
|
+
|
83
|
+
{(this.props.onClose == null && this.props.iconButtons == null)
|
84
|
+
|| (
|
85
|
+
<ButtonGroup
|
86
|
+
align='end'
|
87
|
+
spaces='no-space'
|
88
|
+
className='side-panel__btn-group'
|
89
|
+
>
|
90
|
+
{this.props.iconButtons != null
|
91
|
+
&& this.props.iconButtons
|
92
|
+
}
|
93
|
+
{this.props.onClose != null
|
94
|
+
&& <IconButton
|
95
|
+
icon='close-small'
|
96
|
+
ariaValue='Close'
|
97
|
+
onClick={this.props.onClose}
|
98
|
+
/>
|
99
|
+
}
|
100
|
+
</ButtonGroup>
|
101
|
+
)
|
102
|
+
}
|
103
|
+
</div>
|
80
104
|
{this.props.children}
|
81
105
|
</div>
|
82
106
|
);
|
@@ -95,15 +119,15 @@ class PanelContent extends React.PureComponent<IPropsPanelContent> {
|
|
95
119
|
render() {
|
96
120
|
return (
|
97
121
|
<div className="side-panel__content">
|
98
|
-
{this.props.loading
|
99
|
-
<LoadingOverlay>
|
122
|
+
{this.props.loading
|
123
|
+
&& <LoadingOverlay>
|
100
124
|
<Spinner size="large" />
|
101
|
-
</LoadingOverlay>
|
125
|
+
</LoadingOverlay>
|
102
126
|
}
|
103
|
-
{this.props.empty
|
104
|
-
<LoadingOverlay>
|
127
|
+
{this.props.empty
|
128
|
+
&& <LoadingOverlay>
|
105
129
|
{this.props.emptyTemplate}
|
106
|
-
</LoadingOverlay>
|
130
|
+
</LoadingOverlay>
|
107
131
|
}
|
108
132
|
{this.props.children}
|
109
133
|
</div>
|
@@ -203,6 +227,11 @@ class PanelTools extends React.PureComponent<IPropsPanelTools> {
|
|
203
227
|
}
|
204
228
|
|
205
229
|
export {
|
206
|
-
Panel,
|
207
|
-
|
230
|
+
Panel,
|
231
|
+
PanelHeader,
|
232
|
+
PanelContent,
|
233
|
+
PanelContentBlock,
|
234
|
+
PanelFooter,
|
235
|
+
PanelHeaderSlidingToolbar,
|
236
|
+
PanelTools,
|
208
237
|
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
interface IPropsRotate {
|
4
|
+
children: React.ReactNode;
|
5
|
+
degrees: number;
|
6
|
+
}
|
7
|
+
|
8
|
+
export class Rotate extends React.PureComponent<IPropsRotate> {
|
9
|
+
render() {
|
10
|
+
return (
|
11
|
+
<div
|
12
|
+
style={{
|
13
|
+
transform: `rotate(${this.props.degrees}deg)`,
|
14
|
+
}}
|
15
|
+
>
|
16
|
+
{this.props.children}
|
17
|
+
</div>
|
18
|
+
);
|
19
|
+
}
|
20
|
+
}
|
package/app-typescript/index.ts
CHANGED
@@ -17,6 +17,7 @@ export { AvatarContentImage } from './components/avatar/avatar-image';
|
|
17
17
|
export { AvatarGroup } from './components/avatar/avatar-group';
|
18
18
|
export { Avatar } from './components/avatar/avatar';
|
19
19
|
export { AvatarPlaceholder } from './components/avatar/avatar-placeholder';
|
20
|
+
export { Rotate } from './components/Rotate';
|
20
21
|
export { IconButton } from './components/IconButton';
|
21
22
|
export { IconLabel } from './components/IconLabel';
|
22
23
|
export { Tooltip } from './components/Tooltip';
|