superdesk-ui-framework 3.0.1-beta.3 → 3.0.1-beta.30
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/fonts/sd_icons.eot +0 -0
- package/app/fonts/sd_icons.svg +14 -7
- package/app/fonts/sd_icons.ttf +0 -0
- package/app/fonts/sd_icons.woff +0 -0
- package/app/scripts/toggleBoxNext.js +1 -1
- package/app/styles/_big-icon-font.scss +1 -1
- package/app/styles/_buttons.scss +11 -6
- package/app/styles/_content-divider.scss +63 -8
- package/app/styles/_helpers.scss +24 -1
- package/app/styles/_icon-font.scss +17 -10
- package/app/styles/_labels.scss +0 -1
- package/app/styles/_master-desk.scss +3 -2
- package/app/styles/_modals.scss +6 -3
- package/app/styles/_normalize.scss +4 -0
- package/app/styles/_sd-tag-input.scss +256 -296
- package/app/styles/_simple-list.scss +0 -2
- package/app/styles/_table-list.scss +116 -12
- package/app/styles/app.scss +1 -0
- package/app/styles/components/_list-item.scss +36 -17
- package/app/styles/components/_sd-collapse-box.scss +6 -6
- package/app/styles/components/_sd-comment-box.scss +8 -4
- package/app/styles/components/_sd-editor-popup.scss +4 -4
- package/app/styles/components/_sd-grid-item.scss +30 -16
- package/app/styles/components/_sd-media-carousel.scss +37 -2
- package/app/styles/components/_sd-photo-preview.scss +3 -3
- package/app/styles/components/_sd-searchbar.scss +7 -0
- package/app/styles/components/_subnav.scss +470 -470
- package/app/styles/design-tokens/_design-tokens-general.scss +1 -1
- package/app/styles/design-tokens/_new-colors.scss +30 -13
- package/app/styles/dropdowns/_basic-dropdown.scss +6 -0
- package/app/styles/form-elements/_forms-general.scss +81 -7
- package/app/styles/form-elements/_input-wrap.scss +138 -0
- package/app/styles/form-elements/_inputs.scss +368 -110
- package/app/styles/grids/_grid-layout.scss +34 -1
- package/app/styles/interface-elements/_side-panel.scss +1 -1
- package/app/styles/layout/_basic-layout.scss +2 -2
- package/app/styles/layout/_editor.scss +10 -4
- package/app/styles/primereact/_pr-datepicker.scss +4 -2
- package/app/styles/primereact/_pr-dialog.scss +5 -0
- package/app/styles/primereact/_pr-dropdown.scss +17 -1
- package/app/styles/primereact/_pr-menu.scss +6 -5
- package/app/styles/variables/_colors.scss +21 -21
- package/app-typescript/components/Badge.tsx +3 -2
- package/app-typescript/components/ContentDivider.tsx +3 -0
- package/app-typescript/components/DatePicker.tsx +40 -52
- package/app-typescript/components/Dropdown.tsx +127 -82
- package/app-typescript/components/DurationInput.tsx +400 -0
- package/app-typescript/components/EmptyState.tsx +2 -1
- package/app-typescript/components/Form/FormLabel.tsx +8 -1
- package/app-typescript/components/Form/FormRowNew.tsx +41 -0
- package/app-typescript/components/Form/InputBase.tsx +95 -0
- package/app-typescript/components/Form/InputNew.tsx +107 -0
- package/app-typescript/components/Form/InputWrapper.tsx +79 -0
- package/app-typescript/components/Form/index.tsx +4 -0
- package/app-typescript/components/Input.tsx +28 -45
- package/app-typescript/components/Label.tsx +65 -10
- package/app-typescript/components/Layouts/AuthoringContainer.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrame.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrameRightBar.tsx +21 -2
- package/app-typescript/components/Layouts/AuthoringInnerHeader.tsx +1 -1
- package/app-typescript/components/Layouts/AuthoringMain.tsx +4 -2
- package/app-typescript/components/Layouts/CoreLayout.tsx +2 -1
- package/app-typescript/components/Layouts/CoreLayoutMain.tsx +7 -1
- package/app-typescript/components/Layouts/Layout.tsx +1 -1
- package/app-typescript/components/LeftMenu.tsx +127 -122
- package/app-typescript/components/Lists/ContentList.tsx +66 -33
- package/app-typescript/components/Lists/TableList.tsx +348 -151
- package/app-typescript/components/Menu.tsx +2 -2
- package/app-typescript/components/MultiSelect.tsx +37 -50
- package/app-typescript/components/NavButton.tsx +2 -1
- package/app-typescript/components/Navigation/BottomNav.tsx +3 -2
- package/app-typescript/components/SearchBar.tsx +39 -12
- package/app-typescript/components/Select.tsx +23 -41
- package/app-typescript/components/SelectWithTemplate.tsx +32 -7
- package/app-typescript/components/Spacer.tsx +87 -0
- package/app-typescript/components/TimePicker.tsx +38 -15
- package/app-typescript/components/TreeSelect.tsx +546 -212
- package/app-typescript/index.ts +6 -1
- package/dist/examples.bundle.css +344 -71
- package/dist/examples.bundle.js +48203 -45174
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/dist/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/dist/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/dist/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/dist/react/Badges.tsx +18 -0
- package/dist/react/ContentDivider.tsx +22 -18
- package/dist/react/ContentList.tsx +200 -18
- package/dist/react/DatePicker.tsx +21 -1
- package/dist/react/Dropdowns.tsx +580 -48
- package/dist/react/DurationInput.tsx +108 -0
- package/dist/react/Index.tsx +5 -0
- package/dist/react/Inputs.tsx +147 -2
- package/dist/react/Labels.tsx +51 -1
- package/dist/react/LeftNavigations.tsx +71 -44
- package/dist/react/MultiSelect.tsx +10 -7
- package/dist/react/NavButtons.tsx +31 -1
- package/dist/react/SelectWithTemplate.tsx +6 -1
- package/dist/react/TableList.tsx +79 -186
- package/dist/react/TimePicker.tsx +22 -12
- package/dist/react/Togglebox.tsx +1 -1
- package/dist/react/TreeSelect.tsx +295 -51
- package/dist/react/tree-select/TreeSelect.tsx +273 -0
- package/dist/react/tree-select/example-1.tsx +71 -0
- package/dist/react/tree-select/example-2.tsx +59 -0
- package/dist/sd_icons.eot +0 -0
- package/dist/sd_icons.svg +14 -7
- package/dist/sd_icons.ttf +0 -0
- package/dist/sd_icons.woff +0 -0
- package/dist/superdesk-ui.bundle.css +2282 -782
- package/dist/superdesk-ui.bundle.js +37312 -21800
- package/dist/vendor.bundle.js +27 -27
- package/examples/css/docs-page.css +4 -4
- package/examples/index.js +4 -0
- package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/examples/pages/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/examples/pages/react/Badges.tsx +18 -0
- package/examples/pages/react/ContentDivider.tsx +22 -18
- package/examples/pages/react/ContentList.tsx +200 -18
- package/examples/pages/react/DatePicker.tsx +21 -1
- package/examples/pages/react/Dropdowns.tsx +580 -48
- package/examples/pages/react/DurationInput.tsx +108 -0
- package/examples/pages/react/Index.tsx +5 -0
- package/examples/pages/react/Inputs.tsx +147 -2
- package/examples/pages/react/Labels.tsx +51 -1
- package/examples/pages/react/LeftNavigations.tsx +71 -44
- package/examples/pages/react/MultiSelect.tsx +10 -7
- package/examples/pages/react/NavButtons.tsx +31 -1
- package/examples/pages/react/SelectWithTemplate.tsx +6 -1
- package/examples/pages/react/TableList.tsx +79 -186
- package/examples/pages/react/TimePicker.tsx +22 -12
- package/examples/pages/react/Togglebox.tsx +1 -1
- package/examples/pages/react/TreeSelect.tsx +295 -51
- package/examples/pages/react/tree-select/TreeSelect.tsx +273 -0
- package/examples/pages/react/tree-select/example-1.tsx +71 -0
- package/examples/pages/react/tree-select/example-2.tsx +59 -0
- package/package.json +5 -5
- package/react/components/Badge.d.ts +1 -0
- package/react/components/Badge.js +2 -2
- package/react/components/ContentDivider.d.ts +1 -0
- package/react/components/ContentDivider.js +2 -0
- package/react/components/DatePicker.d.ts +1 -0
- package/react/components/DatePicker.js +6 -22
- package/react/components/Dropdown.d.ts +6 -5
- package/react/components/Dropdown.js +57 -30
- package/react/components/DurationInput.d.ts +42 -0
- package/react/components/DurationInput.js +364 -0
- package/react/components/EmptyState.d.ts +1 -0
- package/react/components/EmptyState.js +1 -1
- package/react/components/Form/FormLabel.d.ts +4 -1
- package/react/components/Form/FormLabel.js +9 -3
- package/react/components/Form/FormRowNew.d.ts +12 -0
- package/react/components/Form/FormRowNew.js +67 -0
- package/react/components/Form/InputBase.d.ts +41 -0
- package/react/components/Form/InputBase.js +86 -0
- package/react/components/Form/InputNew.d.ts +45 -0
- package/react/components/Form/InputNew.js +75 -0
- package/react/components/Form/InputWrapper.d.ts +28 -0
- package/react/components/Form/InputWrapper.js +91 -0
- package/react/components/Form/index.d.ts +4 -0
- package/react/components/Form/index.js +9 -1
- package/react/components/Input.js +5 -34
- package/react/components/Label.d.ts +2 -0
- package/react/components/Label.js +34 -3
- package/react/components/Layouts/AuthoringContainer.d.ts +1 -0
- package/react/components/Layouts/AuthoringContainer.js +1 -1
- package/react/components/Layouts/AuthoringFrame.d.ts +1 -0
- package/react/components/Layouts/AuthoringFrame.js +1 -1
- package/react/components/Layouts/AuthoringFrameRightBar.d.ts +9 -2
- package/react/components/Layouts/AuthoringFrameRightBar.js +14 -3
- package/react/components/Layouts/AuthoringInnerHeader.js +1 -1
- package/react/components/Layouts/AuthoringMain.js +1 -1
- package/react/components/Layouts/CoreLayout.d.ts +1 -0
- package/react/components/Layouts/CoreLayout.js +1 -1
- package/react/components/Layouts/CoreLayoutMain.d.ts +1 -0
- package/react/components/Layouts/CoreLayoutMain.js +8 -1
- package/react/components/Layouts/Layout.js +1 -1
- package/react/components/LeftMenu.d.ts +3 -1
- package/react/components/LeftMenu.js +8 -1
- package/react/components/Lists/ContentList.d.ts +51 -0
- package/react/components/Lists/ContentList.js +110 -0
- package/react/components/Lists/TableList.d.ts +64 -0
- package/react/components/Lists/TableList.js +240 -0
- package/react/components/Menu.js +1 -1
- package/react/components/MultiSelect.d.ts +40 -0
- package/react/components/MultiSelect.js +70 -0
- package/react/components/NavButton.d.ts +1 -1
- package/react/components/Navigation/BottomNav.d.ts +1 -0
- package/react/components/Navigation/BottomNav.js +2 -2
- package/react/components/SearchBar.d.ts +3 -2
- package/react/components/SearchBar.js +28 -4
- package/react/components/Select.d.ts +1 -1
- package/react/components/Select.js +4 -26
- package/react/components/SelectWithTemplate.d.ts +11 -1
- package/react/components/SelectWithTemplate.js +19 -10
- package/react/components/TimePicker.d.ts +11 -1
- package/react/components/TimePicker.js +10 -3
- package/react/components/TreeSelect.d.ts +82 -0
- package/react/components/TreeSelect.js +521 -0
- package/react/index.d.ts +6 -0
- package/react/index.js +16 -3
- package/.vscode/settings.json +0 -5
- package/app-typescript/dist/components/Alert.d.ts +0 -16
- package/app-typescript/dist/components/Autocomplete.d.ts +0 -48
- package/app-typescript/dist/components/Avatar.d.ts +0 -33
- package/app-typescript/dist/components/Badge.d.ts +0 -13
- package/app-typescript/dist/components/Button.d.ts +0 -23
- package/app-typescript/dist/components/ButtonGroup.d.ts +0 -12
- package/app-typescript/dist/components/CheckButtonGroup.d.ts +0 -11
- package/app-typescript/dist/components/CheckGroup.d.ts +0 -9
- package/app-typescript/dist/components/Checkbox.d.ts +0 -19
- package/app-typescript/dist/components/CheckboxButton.d.ts +0 -19
- package/app-typescript/dist/components/DatePicker.d.ts +0 -37
- package/app-typescript/dist/components/Divider.d.ts +0 -9
- package/app-typescript/dist/components/DonutChart.d.ts +0 -12
- package/app-typescript/dist/components/Dropdown.d.ts +0 -28
- package/app-typescript/dist/components/DropdownFirst.d.ts +0 -42
- package/app-typescript/dist/components/EmptyState.d.ts +0 -11
- package/app-typescript/dist/components/FormLabel.d.ts +0 -9
- package/app-typescript/dist/components/Genie.d.ts +0 -13
- package/app-typescript/dist/components/GridItem.d.ts +0 -69
- package/app-typescript/dist/components/GridList.d.ts +0 -14
- package/app-typescript/dist/components/HeadingText.d.ts +0 -10
- package/app-typescript/dist/components/HelloWorld.d.ts +0 -8
- package/app-typescript/dist/components/Icon.d.ts +0 -12
- package/app-typescript/dist/components/IconButton.d.ts +0 -12
- package/app-typescript/dist/components/IconLabel.d.ts +0 -11
- package/app-typescript/dist/components/Input.d.ts +0 -24
- package/app-typescript/dist/components/Label.d.ts +0 -15
- package/app-typescript/dist/components/LeftMenu.d.ts +0 -26
- package/app-typescript/dist/components/Loader.d.ts +0 -8
- package/app-typescript/dist/components/NavButton.d.ts +0 -15
- package/app-typescript/dist/components/Popover.d.ts +0 -13
- package/app-typescript/dist/components/PropsList.d.ts +0 -15
- package/app-typescript/dist/components/Radio.d.ts +0 -19
- package/app-typescript/dist/components/RadioButton.d.ts +0 -20
- package/app-typescript/dist/components/Select.d.ts +0 -29
- package/app-typescript/dist/components/SelectWithTemplate.d.ts +0 -32
- package/app-typescript/dist/components/SlidingToolbar.d.ts +0 -8
- package/app-typescript/dist/components/StrechBar.d.ts +0 -4
- package/app-typescript/dist/components/SubNav.d.ts +0 -10
- package/app-typescript/dist/components/Switch.d.ts +0 -12
- package/app-typescript/dist/components/TabCustom.d.ts +0 -25
- package/app-typescript/dist/components/TabList.d.ts +0 -22
- package/app-typescript/dist/components/Tag.d.ts +0 -9
- package/app-typescript/dist/components/TagInput.d.ts +0 -7
- package/app-typescript/dist/components/TagInputTest.d.ts +0 -18
- package/app-typescript/dist/components/TimePicker.d.ts +0 -11
- package/app-typescript/dist/components/Tooltip.d.ts +0 -11
- package/app-typescript/dist/components/_Positioner.d.ts +0 -27
- package/app-typescript/dist/index.d.ts +0 -56
- package/patches/@superdesk+primereact+5.0.2-4.patch +0 -57
- package/yarn-error.log +0 -111
@@ -0,0 +1,79 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import classNames from 'classnames';
|
3
|
+
|
4
|
+
interface IPropsBase {
|
5
|
+
label?: string;
|
6
|
+
children: React.ReactNode;
|
7
|
+
maxLength?: number;
|
8
|
+
info?: string;
|
9
|
+
error?: string;
|
10
|
+
required?: boolean;
|
11
|
+
disabled?: boolean;
|
12
|
+
invalid?: boolean;
|
13
|
+
inlineLabel?: boolean;
|
14
|
+
labelHidden?: boolean;
|
15
|
+
tabindex?: number;
|
16
|
+
fullWidth?: boolean;
|
17
|
+
boxedStyle?: boolean;
|
18
|
+
boxedLable?: boolean;
|
19
|
+
value?: string | number;
|
20
|
+
htmlId?: string;
|
21
|
+
size?: 'medium' | 'large' | 'x-large'; // default: 'medium'
|
22
|
+
}
|
23
|
+
|
24
|
+
interface IState {
|
25
|
+
value: string | number;
|
26
|
+
}
|
27
|
+
|
28
|
+
export class InputWrapper extends React.Component<IPropsBase, IState> {
|
29
|
+
constructor(props: IPropsBase) {
|
30
|
+
super(props);
|
31
|
+
|
32
|
+
this.state = {
|
33
|
+
value: this.props.value ?? '',
|
34
|
+
};
|
35
|
+
}
|
36
|
+
|
37
|
+
render() {
|
38
|
+
const classes = classNames('sd-input', {
|
39
|
+
'sd-input--inline-label': this.props.inlineLabel,
|
40
|
+
'sd-input--required': this.props.required,
|
41
|
+
'sd-input--disabled': this.props.disabled,
|
42
|
+
'sd-input--full-width': this.props.fullWidth,
|
43
|
+
'sd-input--invalid': this.props.invalid,
|
44
|
+
'sd-input--medium': this.props.size === undefined,
|
45
|
+
[`sd-input--${this.props.size}`]: this.props.size || this.props.size !== undefined,
|
46
|
+
'sd-input--boxed-style': this.props.boxedStyle,
|
47
|
+
'sd-input--boxed-label': this.props.boxedLable,
|
48
|
+
});
|
49
|
+
const labelClasses = classNames('sd-input__label', {
|
50
|
+
'a11y-only': this.props.labelHidden,
|
51
|
+
'sd-input__label--boxed': this.props.boxedLable,
|
52
|
+
});
|
53
|
+
|
54
|
+
return (
|
55
|
+
<div className={classes}>
|
56
|
+
<label className={labelClasses} htmlFor={this.props.htmlId} id={this.props.htmlId + 'label'}
|
57
|
+
tabIndex={this.props.tabindex === undefined ? undefined : -1}>
|
58
|
+
{this.props.label}
|
59
|
+
</label>
|
60
|
+
<div className="sd-input__input-container">
|
61
|
+
{this.props.children}
|
62
|
+
</div>
|
63
|
+
{this.props.maxLength
|
64
|
+
? <div className='sd-input__char-count'>
|
65
|
+
{this.props.value?.toString().length} / {this.props.maxLength}
|
66
|
+
</div>
|
67
|
+
: null}
|
68
|
+
<div className='sd-input__message-box'>
|
69
|
+
{this.props.info && !this.props.invalid && !this.props.invalid
|
70
|
+
? <div className='sd-input__hint'>{this.props.info}</div>
|
71
|
+
: null}
|
72
|
+
{this.props.invalid || this.props.invalid
|
73
|
+
? <div className='sd-input__message'>{this.props.error}</div>
|
74
|
+
: null}
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
);
|
78
|
+
}
|
79
|
+
}
|
@@ -3,3 +3,7 @@ export { FormGroup } from './FormGroup';
|
|
3
3
|
export { FormItem } from './FormItem';
|
4
4
|
export { FormText } from './FormText';
|
5
5
|
export { FormLabel } from './FormLabel';
|
6
|
+
export { InputWrapper } from './InputWrapper';
|
7
|
+
export { InputBase } from './InputBase';
|
8
|
+
export { InputNew } from './InputNew';
|
9
|
+
export { FormRowNew } from './FormRowNew';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import classNames from 'classnames';
|
2
|
+
// import classNames from 'classnames';
|
3
3
|
import nextId from "react-id-generator";
|
4
|
+
import { InputWrapper } from './Form';
|
4
5
|
|
5
6
|
interface IPropsBase {
|
6
7
|
label?: string;
|
@@ -79,53 +80,35 @@ export class Input extends React.Component<IProps, IState> {
|
|
79
80
|
}
|
80
81
|
|
81
82
|
render() {
|
82
|
-
const classes = classNames('sd-input', {
|
83
|
-
'sd-input--inline-label': this.props.inlineLabel,
|
84
|
-
'sd-input--required': this.props.required,
|
85
|
-
'sd-input--disabled': this.props.disabled,
|
86
|
-
'sd-input--full-width': this.props.fullWidth,
|
87
|
-
'sd-input--invalid': this.props.invalid || this.state.invalid,
|
88
|
-
'sd-input--medium': this.props.size === undefined,
|
89
|
-
[`sd-input--${this.props.size}`]: this.props.size || this.props.size !== undefined,
|
90
|
-
'sd-input--boxed-style': this.props.boxedStyle,
|
91
|
-
'sd-input--boxed-label': this.props.boxedLable,
|
92
|
-
});
|
93
|
-
const labelClasses = classNames('sd-input__label', {
|
94
|
-
'a11y-only': this.props.labelHidden,
|
95
|
-
'sd-input__label--boxed': this.props.boxedLable,
|
96
|
-
});
|
97
83
|
|
98
84
|
return (
|
99
|
-
<
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
85
|
+
<InputWrapper
|
86
|
+
label={this.props.label}
|
87
|
+
error={this.props.error}
|
88
|
+
required={this.props.required}
|
89
|
+
disabled={this.props.disabled}
|
90
|
+
value={this.state.value}
|
91
|
+
invalid={this.props.invalid}
|
92
|
+
info={this.props.info}
|
93
|
+
maxLength={this.props.maxLength}
|
94
|
+
inlineLabel={this.props.inlineLabel}
|
95
|
+
labelHidden={this.props.labelHidden}
|
96
|
+
size={this.props.size ?? 'medium'}
|
97
|
+
fullWidth={this.props.fullWidth}
|
98
|
+
htmlId={this.htmlId}
|
99
|
+
boxedStyle={this.props.boxedStyle}
|
100
|
+
boxedLable={this.props.boxedLable}
|
101
|
+
tabindex={this.props.tabindex}>
|
105
102
|
<input className='sd-input__input'
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
{this.props.maxLength ?
|
116
|
-
<div className='sd-input__char-count'>
|
117
|
-
{this.state.value.toString().length} / {this.props.maxLength}
|
118
|
-
</div>
|
119
|
-
: null}
|
120
|
-
|
121
|
-
<div className='sd-input__message-box'>
|
122
|
-
{this.props.info && !this.props.invalid && !this.state.invalid ?
|
123
|
-
<div className='sd-input__hint'>{this.props.info}</div> : null}
|
124
|
-
{this.props.invalid || this.state.invalid ?
|
125
|
-
<div className='sd-input__message'>{this.props.error}</div>
|
126
|
-
: null}
|
127
|
-
</div>
|
128
|
-
</div>
|
103
|
+
type={this.props.type ?? 'text'}
|
104
|
+
id={this.htmlId}
|
105
|
+
value={this.state.value}
|
106
|
+
aria-describedby={this.htmlId + 'label'}
|
107
|
+
tabIndex={this.props.tabindex}
|
108
|
+
onChange={this.handleChange}
|
109
|
+
placeholder={this.props.placeholder}
|
110
|
+
disabled={this.props.disabled} />
|
111
|
+
</InputWrapper>
|
129
112
|
);
|
130
113
|
}
|
131
114
|
}
|
@@ -8,6 +8,7 @@ interface IProps {
|
|
8
8
|
size?: 'small' | 'normal' | 'large'; // defaults to 'normal'
|
9
9
|
onClick?(): void;
|
10
10
|
noTransform?: boolean;
|
11
|
+
hexColor?: string;
|
11
12
|
style?: 'filled' | 'hollow' | 'translucent'; // defaults to 'filled'
|
12
13
|
}
|
13
14
|
export class Label extends React.PureComponent<IProps> {
|
@@ -21,17 +22,71 @@ export class Label extends React.PureComponent<IProps> {
|
|
21
22
|
[`hollow-${this.props.color}`]: this.props.color && this.props.style === 'hollow',
|
22
23
|
});
|
23
24
|
if (this.props.link || this.props.onClick) {
|
24
|
-
|
25
|
-
|
26
|
-
{
|
27
|
-
|
28
|
-
|
25
|
+
if (this.props.style === 'hollow') {
|
26
|
+
return (
|
27
|
+
<a className={classes}
|
28
|
+
href={this.props.link}
|
29
|
+
onClick={this.props.onClick}
|
30
|
+
style={{color: this.props.hexColor, borderColor: this.props.hexColor}}>
|
31
|
+
{this.props.text}
|
32
|
+
</a>
|
33
|
+
);
|
34
|
+
} else if (this.props.style === 'translucent') {
|
35
|
+
return (
|
36
|
+
<a className={classes}
|
37
|
+
href={this.props.link}
|
38
|
+
onClick={this.props.onClick}
|
39
|
+
style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}>
|
40
|
+
{this.props.text}
|
41
|
+
</a>
|
42
|
+
);
|
43
|
+
} else {
|
44
|
+
return (
|
45
|
+
<a className={classes}
|
46
|
+
href={this.props.link}
|
47
|
+
onClick={this.props.onClick} style={{backgroundColor: this.props.hexColor}}>
|
48
|
+
{this.props.text}
|
49
|
+
</a>
|
50
|
+
);
|
51
|
+
}
|
29
52
|
} else {
|
30
|
-
|
31
|
-
|
32
|
-
{
|
33
|
-
|
34
|
-
|
53
|
+
if (this.props.style === 'hollow') {
|
54
|
+
return (
|
55
|
+
<span className={classes}
|
56
|
+
style={{color: this.props.hexColor, borderColor: this.props.hexColor}}>
|
57
|
+
{this.props.text}
|
58
|
+
</span>
|
59
|
+
);
|
60
|
+
} else if (this.props.style === 'translucent') {
|
61
|
+
return (
|
62
|
+
<span className={classes}
|
63
|
+
style={{color: this.props.hexColor, backgroundColor: `${this.props.hexColor}33`}}>
|
64
|
+
{this.props.text}
|
65
|
+
</span>
|
66
|
+
);
|
67
|
+
} else {
|
68
|
+
return (
|
69
|
+
<span className={classes}
|
70
|
+
style={this.props.hexColor
|
71
|
+
? {backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor)}
|
72
|
+
: undefined}>
|
73
|
+
{this.props.text}
|
74
|
+
</span>
|
75
|
+
);
|
76
|
+
}
|
35
77
|
}
|
36
78
|
}
|
37
79
|
}
|
80
|
+
|
81
|
+
export function getTextColor(backgroundColor: string): 'black' | 'white' | undefined {
|
82
|
+
if (backgroundColor) {
|
83
|
+
const r = parseInt(backgroundColor.substr(1, 2), 16);
|
84
|
+
const g = parseInt(backgroundColor.substr(3, 2), 16);
|
85
|
+
const b = parseInt(backgroundColor.substr(5, 2), 16);
|
86
|
+
const yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
|
87
|
+
|
88
|
+
return (yiq >= 128) ? 'black' : 'white';
|
89
|
+
} else {
|
90
|
+
return;
|
91
|
+
}
|
92
|
+
}
|
@@ -6,6 +6,7 @@ interface IProps {
|
|
6
6
|
side?: 'left' | 'right';
|
7
7
|
background?: 'transparent' | 'light' | 'grey' | 'dark';
|
8
8
|
open?: boolean;
|
9
|
+
large?: boolean;
|
9
10
|
}
|
10
11
|
|
11
12
|
export class AuthoringContainer extends React.PureComponent<IProps> {
|
@@ -18,7 +19,7 @@ export class AuthoringContainer extends React.PureComponent<IProps> {
|
|
18
19
|
});
|
19
20
|
return (
|
20
21
|
<div className={classes}>
|
21
|
-
<div className='sd-editor__container'>
|
22
|
+
<div className={`sd-editor__container ${this.props.large ? 'sd-editor__container--large' : ''}`}>
|
22
23
|
{this.props.children}
|
23
24
|
</div>
|
24
25
|
</div>
|
@@ -16,6 +16,7 @@ interface IProps {
|
|
16
16
|
header?: React.ReactNode;
|
17
17
|
main?: React.ReactNode;
|
18
18
|
sideBar?: React.ReactNode;
|
19
|
+
sideBarClosed?: boolean;
|
19
20
|
sidePanel?: React.ReactNode;
|
20
21
|
sideOverlay?: React.ReactNode;
|
21
22
|
sideOverlayOpen?: boolean;
|
@@ -56,7 +57,7 @@ export class AuthoringFrame extends React.PureComponent<IProps> {
|
|
56
57
|
</AuthoringFrameSidePanelOverlay>
|
57
58
|
)}
|
58
59
|
{this.props.sideBar && (
|
59
|
-
<AuthoringFrameRightBar>
|
60
|
+
<AuthoringFrameRightBar closed={this.props.sideBarClosed}>
|
60
61
|
{this.props.sideBar}
|
61
62
|
</AuthoringFrameRightBar>
|
62
63
|
)}
|
@@ -2,12 +2,31 @@ import * as React from 'react';
|
|
2
2
|
|
3
3
|
interface IProps {
|
4
4
|
children?: React.ReactNode;
|
5
|
+
closed?: boolean;
|
5
6
|
}
|
6
7
|
|
7
|
-
|
8
|
+
interface IState {
|
9
|
+
children?: React.ReactNode;
|
10
|
+
closed?: boolean;
|
11
|
+
}
|
12
|
+
|
13
|
+
export class AuthoringFrameRightBar extends React.PureComponent<IProps, IState> {
|
14
|
+
constructor(props: IProps) {
|
15
|
+
super(props);
|
16
|
+
this.state = {
|
17
|
+
closed: this.props.closed ? this.props.closed : false,
|
18
|
+
};
|
19
|
+
}
|
20
|
+
componentDidUpdate(prevProps: Readonly<IProps>): void {
|
21
|
+
if (prevProps.closed !== this.props.closed) {
|
22
|
+
this.setState({
|
23
|
+
closed: this.props.closed,
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
8
27
|
render() {
|
9
28
|
return (
|
10
|
-
<div className="sd-editor-grid__sidetabs-bar">
|
29
|
+
!this.state.closed && <div className="sd-editor-grid__sidetabs-bar">
|
11
30
|
{this.props.children}
|
12
31
|
</div>
|
13
32
|
);
|
@@ -31,8 +31,10 @@ export class AuthoringMain extends React.PureComponent<IProps> {
|
|
31
31
|
)}
|
32
32
|
<AuthoringMainContent>
|
33
33
|
{this.props.authoringHeader && (
|
34
|
-
<AuthoringInnerHeader
|
35
|
-
{this.props.
|
34
|
+
<AuthoringInnerHeader
|
35
|
+
headerPadding={this.props.headerPadding}
|
36
|
+
collapsed={this.props.headerCollapsed}>
|
37
|
+
{this.props.authoringHeader}
|
36
38
|
</AuthoringInnerHeader>
|
37
39
|
)}
|
38
40
|
{this.props.authoringBookmarks && (
|
@@ -22,6 +22,7 @@ interface IProps {
|
|
22
22
|
menuId?: string;
|
23
23
|
ariaControls?: string;
|
24
24
|
buttonAnimation?: 'spin' | 'squeeze' | 'none';
|
25
|
+
editorFullWidth?: boolean;
|
25
26
|
}
|
26
27
|
|
27
28
|
export class CoreLayout extends React.PureComponent<IProps> {
|
@@ -43,7 +44,7 @@ export class CoreLayout extends React.PureComponent<IProps> {
|
|
43
44
|
{this.props.topMenu}
|
44
45
|
</CoreLayoutTopMenu>
|
45
46
|
)}
|
46
|
-
<CoreLayoutMain>
|
47
|
+
<CoreLayoutMain editorFullWidth={this.props.editorFullWidth}>
|
47
48
|
{this.props.children}
|
48
49
|
</CoreLayoutMain>
|
49
50
|
{this.props.footer && (
|
@@ -1,14 +1,20 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import classNames from 'classnames';
|
2
3
|
|
3
4
|
interface IProps {
|
4
5
|
children?: React.ReactNode;
|
5
6
|
id?: string;
|
7
|
+
editorFullWidth?: boolean;
|
6
8
|
}
|
7
9
|
|
8
10
|
export class CoreLayoutMain extends React.PureComponent<IProps> {
|
9
11
|
render() {
|
12
|
+
const classes = classNames('sd-content sd-content-wrapper', {
|
13
|
+
'sd-content-wrapper--editor-full': this.props.editorFullWidth,
|
14
|
+
},
|
15
|
+
);
|
10
16
|
return (
|
11
|
-
<section id={this.props.id} className=
|
17
|
+
<section id={this.props.id} className={classes}>
|
12
18
|
{this.props.children}
|
13
19
|
</section>
|
14
20
|
);
|