superdesk-ui-framework 2.4.14 → 2.4.18
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/index.js +1 -0
- package/app/scripts/modals.js +22 -9
- package/app/styles/_accessibility.scss +3 -2
- package/app/styles/_buttons.scss +17 -0
- package/app/styles/_modals.scss +23 -17
- package/app/styles/_tooltips.scss +66 -0
- package/app/styles/app.scss +1 -0
- package/app/styles/components/_sd-toaster.scss +6 -5
- package/app/styles/form-elements/_inputs.scss +1 -0
- package/app/styles/form-elements/_select-grid.scss +77 -0
- package/app/styles/pr-superdesk-theme.scss +3 -1
- package/app/styles/primereact/_pr-menu.scss +38 -0
- package/app/styles/primereact/_pr-skeleton.scss +35 -0
- package/app/styles/variables/_colors.scss +30 -18
- package/app-typescript/components/Button.tsx +2 -2
- package/app-typescript/components/Dropdown.tsx +0 -1
- package/app-typescript/components/DropdownFirst.tsx +2 -2
- package/app-typescript/components/IconPicker.tsx +277 -0
- package/app-typescript/components/Input.tsx +8 -3
- package/app-typescript/components/ListItemLoader.tsx +30 -0
- package/app-typescript/components/Menu.tsx +149 -0
- package/app-typescript/components/PropsList.tsx +2 -2
- package/app-typescript/components/Radio.tsx +19 -10
- package/app-typescript/components/Select.tsx +6 -3
- package/app-typescript/components/SelectGrid.tsx +233 -0
- package/app-typescript/components/SelectWithTemplate.tsx +0 -2
- package/app-typescript/components/Skeleton.tsx +48 -0
- package/app-typescript/components/Tag.tsx +2 -2
- package/app-typescript/components/Toast.tsx +31 -5
- package/app-typescript/components/ToastMessage.tsx +9 -16
- package/app-typescript/components/ToastText.tsx +2 -4
- package/app-typescript/components/ToastWrapper.tsx +4 -4
- package/app-typescript/components/Togglebox.tsx +108 -0
- package/app-typescript/components/Tooltip.tsx +25 -1
- package/app-typescript/index.ts +8 -0
- package/dist/components/modals.html +180 -4
- package/dist/examples.bundle.css +52 -36
- package/dist/examples.bundle.js +5775 -3059
- package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +14 -1
- package/dist/react/Alerts.tsx +4 -4
- package/dist/react/Autocomplete.tsx +17 -17
- package/dist/react/Badges.tsx +4 -4
- package/dist/react/BigIconFont.tsx +3 -3
- package/dist/react/ButtonGroups.tsx +6 -6
- package/dist/react/Buttons.tsx +11 -11
- package/dist/react/Carousel.tsx +15 -15
- package/dist/react/Checkboxs.tsx +10 -10
- package/dist/react/DatePicker.tsx +6 -6
- package/dist/react/Dropdowns.tsx +15 -15
- package/dist/react/EmptyStates.tsx +4 -4
- package/dist/react/GridItem.tsx +8 -8
- package/dist/react/GridList.tsx +3 -3
- package/dist/react/IconButtons.tsx +3 -3
- package/dist/react/IconFont.tsx +10 -9
- package/dist/react/IconLabels.tsx +4 -4
- package/dist/react/IconPicker.tsx +65 -0
- package/dist/react/Index.tsx +27 -2
- package/dist/react/Inputs.tsx +29 -11
- package/dist/react/Labels.tsx +6 -6
- package/dist/react/LeftNavigations.tsx +6 -6
- package/dist/react/ListItems.tsx +34 -0
- package/dist/react/Menu.tsx +159 -0
- package/dist/react/Modal.tsx +9 -9
- package/dist/react/NavButtons.tsx +7 -7
- package/dist/react/Popover.tsx +5 -5
- package/dist/react/Radios.tsx +29 -29
- package/dist/react/SelectGrid.tsx +121 -0
- package/dist/react/Selects.tsx +31 -9
- package/dist/react/Switch.tsx +5 -5
- package/dist/react/Tabs.tsx +12 -12
- package/dist/react/TimePicker.tsx +4 -4
- package/dist/react/Toasts.tsx +44 -56
- package/dist/react/Togglebox.tsx +51 -0
- package/dist/react/Tooltips.tsx +48 -4
- package/dist/superdesk-ui.bundle.css +3774 -96
- package/dist/superdesk-ui.bundle.js +4503 -2050
- package/dist/vendor.bundle.js +53312 -53308
- package/examples/pages/components/modals.html +180 -4
- package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +14 -1
- package/examples/pages/react/Alerts.tsx +4 -4
- package/examples/pages/react/Autocomplete.tsx +17 -17
- package/examples/pages/react/Badges.tsx +4 -4
- package/examples/pages/react/BigIconFont.tsx +3 -3
- package/examples/pages/react/ButtonGroups.tsx +6 -6
- package/examples/pages/react/Buttons.tsx +11 -11
- package/examples/pages/react/Carousel.tsx +15 -15
- package/examples/pages/react/Checkboxs.tsx +10 -10
- package/examples/pages/react/DatePicker.tsx +6 -6
- package/examples/pages/react/Dropdowns.tsx +15 -15
- package/examples/pages/react/EmptyStates.tsx +4 -4
- package/examples/pages/react/GridItem.tsx +8 -8
- package/examples/pages/react/GridList.tsx +3 -3
- package/examples/pages/react/IconButtons.tsx +3 -3
- package/examples/pages/react/IconFont.tsx +10 -9
- package/examples/pages/react/IconLabels.tsx +4 -4
- package/examples/pages/react/IconPicker.tsx +65 -0
- package/examples/pages/react/Index.tsx +27 -2
- package/examples/pages/react/Inputs.tsx +29 -11
- package/examples/pages/react/Labels.tsx +6 -6
- package/examples/pages/react/LeftNavigations.tsx +6 -6
- package/examples/pages/react/ListItems.tsx +34 -0
- package/examples/pages/react/Menu.tsx +159 -0
- package/examples/pages/react/Modal.tsx +9 -9
- package/examples/pages/react/NavButtons.tsx +7 -7
- package/examples/pages/react/Popover.tsx +5 -5
- package/examples/pages/react/Radios.tsx +29 -29
- package/examples/pages/react/SelectGrid.tsx +121 -0
- package/examples/pages/react/Selects.tsx +31 -9
- package/examples/pages/react/Switch.tsx +5 -5
- package/examples/pages/react/Tabs.tsx +12 -12
- package/examples/pages/react/TimePicker.tsx +4 -4
- package/examples/pages/react/Toasts.tsx +44 -56
- package/examples/pages/react/Togglebox.tsx +51 -0
- package/examples/pages/react/Tooltips.tsx +48 -4
- package/package.json +2 -2
- package/patches/@superdesk+primereact+5.0.2-4.patch +13 -0
- package/react/components/Button.d.ts +1 -1
- package/react/components/Button.js +2 -1
- package/react/components/Dropdown.js +0 -1
- package/react/components/DropdownFirst.js +1 -1
- package/react/components/IconPicker.d.ts +24 -0
- package/react/components/IconPicker.js +283 -0
- package/react/components/Input.d.ts +2 -1
- package/react/components/Input.js +4 -1
- package/react/components/ListItemLoader.d.ts +4 -0
- package/react/components/ListItemLoader.js +62 -0
- package/react/components/Menu.d.ts +59 -0
- package/react/components/Menu.js +92 -0
- package/react/components/PropsList.d.ts +1 -1
- package/react/components/PropsList.js +1 -1
- package/react/components/Radio.d.ts +8 -7
- package/react/components/Radio.js +1 -1
- package/react/components/Select.d.ts +2 -1
- package/react/components/Select.js +4 -2
- package/react/components/SelectGrid.d.ts +45 -0
- package/react/components/SelectGrid.js +179 -0
- package/react/components/SelectWithTemplate.js +0 -1
- package/react/components/Skeleton.d.ts +30 -0
- package/react/components/Skeleton.js +55 -0
- package/react/components/Tag.js +1 -1
- package/react/components/Toast.d.ts +15 -0
- package/react/components/Toast.js +69 -0
- package/react/components/ToastMessage.d.ts +18 -0
- package/react/components/ToastMessage.js +66 -0
- package/react/components/ToastText.d.ts +9 -0
- package/react/components/ToastText.js +42 -0
- package/react/components/ToastWrapper.d.ts +31 -0
- package/react/components/ToastWrapper.js +116 -0
- package/react/components/Togglebox.d.ts +27 -0
- package/react/components/Togglebox.js +76 -0
- package/react/components/Tooltip.d.ts +2 -5
- package/react/components/Tooltip.js +48 -7
- package/react/index.d.ts +7 -0
- package/react/index.js +14 -0
@@ -59,13 +59,13 @@ export class PopoverDoc extends React.Component {
|
|
59
59
|
|
60
60
|
<h3 className="docs-page__h3">Props</h3>
|
61
61
|
<PropsList>
|
62
|
-
<Prop name='title'
|
63
|
-
<Prop name='triggerSelector'
|
64
|
-
<Prop name='displayCloseButton'
|
65
|
-
<Prop name='placement'
|
62
|
+
<Prop name='title' isRequired={true} type='string' default='null' description='Title of the popover component.' />
|
63
|
+
<Prop name='triggerSelector' isRequired={true} type='string' default='null' description='ID selector for an element that will be used to toggle the popover.' />
|
64
|
+
<Prop name='displayCloseButton' isRequired={false} type='boolean' default='true' description='Show or hide the close button.' />
|
65
|
+
<Prop name='placement' isRequired={false}
|
66
66
|
type='auto | auto-end | auto-start | bottom | bottom-end | bottom-start | left | left-end | left-start | right | right-end | right-start | top | top-end | top-start'
|
67
67
|
default='auto' description='Define the placement of the Popover.' />
|
68
|
-
<Prop name='zIndex'
|
68
|
+
<Prop name='zIndex' isRequired={false} type='number' default='null' description='Defines the z-index of the Popover.' />
|
69
69
|
</PropsList>
|
70
70
|
</section>
|
71
71
|
)
|
@@ -5,14 +5,14 @@ import * as Components from '../playgrounds/react-playgrounds/components/Index';
|
|
5
5
|
import { Radio, RadioButton, CheckGroup, CheckButtonGroup, Alert, Prop, PropsList } from '../../../app-typescript';
|
6
6
|
|
7
7
|
interface IState {
|
8
|
-
value1
|
9
|
-
value2
|
10
|
-
value3
|
11
|
-
value4
|
12
|
-
value5
|
13
|
-
value6
|
14
|
-
value7
|
15
|
-
value8
|
8
|
+
value1?: string;
|
9
|
+
value2?: string;
|
10
|
+
value3?: string;
|
11
|
+
value4?: string;
|
12
|
+
value5?: string;
|
13
|
+
value6?: string;
|
14
|
+
value7?: string;
|
15
|
+
value8?: string;
|
16
16
|
}
|
17
17
|
|
18
18
|
export default class RadiosDoc extends React.Component<{}, IState> {
|
@@ -20,14 +20,14 @@ export default class RadiosDoc extends React.Component<{}, IState> {
|
|
20
20
|
super(props);
|
21
21
|
|
22
22
|
this.state = {
|
23
|
-
value1:
|
24
|
-
value2:
|
25
|
-
value3:
|
26
|
-
value4:
|
27
|
-
value5:
|
28
|
-
value6:
|
29
|
-
value7:
|
30
|
-
value8:
|
23
|
+
value1: undefined,
|
24
|
+
value2: undefined,
|
25
|
+
value3: undefined,
|
26
|
+
value4: undefined,
|
27
|
+
value5: undefined,
|
28
|
+
value6: undefined,
|
29
|
+
value7: undefined,
|
30
|
+
value8: undefined,
|
31
31
|
};
|
32
32
|
}
|
33
33
|
render() {
|
@@ -368,22 +368,22 @@ export default class RadiosDoc extends React.Component<{}, IState> {
|
|
368
368
|
<h3 className="docs-page__h3">Props</h3>
|
369
369
|
<p className="docs-page__paragraph">Radio</p>
|
370
370
|
<PropsList>
|
371
|
-
<Prop name='value'
|
372
|
-
<Prop name='options'
|
373
|
-
<Prop name='options label'
|
374
|
-
<Prop name='options value'
|
375
|
-
<Prop name='options disabled'
|
376
|
-
<Prop name='labelSide'
|
371
|
+
<Prop name='value' isRequired={true} type='T' default='/' description='The value of the checked button.'/>
|
372
|
+
<Prop name='options' isRequired={true} type='Array' default='/' description='Array of Radio options.'/>
|
373
|
+
<Prop name='options label' isRequired={true} type='string' default='/' description='Label text value for Radio.'/>
|
374
|
+
<Prop name='options value' isRequired={true} type='T' default='/' description='Value of the Radio.'/>
|
375
|
+
<Prop name='options disabled' isRequired={false} type='boolean' default='false' description='Disables the Radio, preventing mouse events.'/>
|
376
|
+
<Prop name='labelSide' isRequired={false} type='left | right' default='right' description='Position of label relative to the button.'/>
|
377
377
|
</PropsList>
|
378
378
|
<p className="docs-page__paragraph">Radio Button</p>
|
379
379
|
<PropsList>
|
380
|
-
<Prop name='value'
|
381
|
-
<Prop name='options'
|
382
|
-
<Prop name='option label'
|
383
|
-
<Prop name='option value'
|
384
|
-
<Prop name='option disabled'
|
385
|
-
<Prop name='option labelHidden'
|
386
|
-
<Prop name='option icon'
|
380
|
+
<Prop name='value' isRequired={true} type='any' default='/' description='The value of the checked button.'/>
|
381
|
+
<Prop name='options' isRequired={true} type='Array<option>' default='/' description='Array of RadioButton options.'/>
|
382
|
+
<Prop name='option label' isRequired={true} type='string' default='/' description='Label text value for RadioButton.'/>
|
383
|
+
<Prop name='option value' isRequired={true} type='any' default='/' description='Value of the Radio.'/>
|
384
|
+
<Prop name='option disabled' isRequired={false} type='boolean' default='false' description='Disables the Radio, preventing mouse events.'/>
|
385
|
+
<Prop name='option labelHidden' isRequired={false} type='boolean' default='false' description='Hides visually the label and adds an aria-label for screen-reader support.'/>
|
386
|
+
<Prop name='option icon' isRequired={false} type='string' default='/' description='Icon class name without the icon- part.'/>
|
387
387
|
</PropsList>
|
388
388
|
</section>
|
389
389
|
)
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import * as Markup from "../../js/react";
|
3
|
+
import { SelectGrid, Alert, PropsList, Prop } from "../../../app-typescript";
|
4
|
+
|
5
|
+
const SelectGridDocs = () => {
|
6
|
+
const letters = [
|
7
|
+
{ value: 'A', label: 'A' },
|
8
|
+
{ value: 'B', label: 'B' },
|
9
|
+
{ value: 'C', label: 'C' },
|
10
|
+
{ value: 'D', label: 'D' },
|
11
|
+
{ value: 'E', label: 'E' },
|
12
|
+
{ value: 'F', label: 'F' },
|
13
|
+
{ value: 'G', label: 'G' },
|
14
|
+
{ value: 'H', label: 'H' },
|
15
|
+
{ value: 'K', label: 'K' },
|
16
|
+
{ value: 'L', label: 'L' },
|
17
|
+
{ value: 'M', label: 'M' },
|
18
|
+
{ value: 'N', label: 'N' },
|
19
|
+
{ value: 'O', label: 'O' },
|
20
|
+
{ value: 'P', label: 'P' },
|
21
|
+
{ value: 'R', label: 'R' },
|
22
|
+
{ value: 'S', label: 'S' },
|
23
|
+
{ value: 'T', label: 'T' },
|
24
|
+
{ value: 'U', label: 'U' }
|
25
|
+
];
|
26
|
+
|
27
|
+
const [selectedItem, setSelectedItem] = React.useState(letters[0]);
|
28
|
+
|
29
|
+
return (
|
30
|
+
<section className="docs-page__container">
|
31
|
+
<h2 className="docs-page__h2">Select Grid</h2>
|
32
|
+
<p className="docs-page__paragraph">Universal select component with grid display of items. You can define your own trigger and item template.</p>
|
33
|
+
<p className="docs-page__paragraph">IconPicker is built on top of it.</p>
|
34
|
+
<Markup.ReactMarkupCodePreview>{`
|
35
|
+
<SelectGrid
|
36
|
+
label="Label"
|
37
|
+
filterPlaceholder="Search..."
|
38
|
+
getItems={(searchString) => {
|
39
|
+
return new Promise((resolve) => {
|
40
|
+
resolve([{ value: 'value', label: 'Label' }]);
|
41
|
+
});
|
42
|
+
}}
|
43
|
+
onChange={(value) => { }}
|
44
|
+
itemTemplate={({ item }) => <div />}
|
45
|
+
triggerTemplate={() => <button />}
|
46
|
+
/>
|
47
|
+
`}
|
48
|
+
</Markup.ReactMarkupCodePreview>
|
49
|
+
<Markup.ReactMarkup>
|
50
|
+
<Markup.ReactMarkupPreview>
|
51
|
+
<SelectGrid
|
52
|
+
label="Letter"
|
53
|
+
filterPlaceholder="Search..."
|
54
|
+
getItems={(searchString) => {
|
55
|
+
return new Promise((resolve) => {
|
56
|
+
if (searchString == null) {
|
57
|
+
resolve(letters);
|
58
|
+
} else {
|
59
|
+
resolve(letters.filter(({ label }) => label.toLocaleLowerCase().includes(searchString.toLocaleLowerCase())));
|
60
|
+
}
|
61
|
+
});
|
62
|
+
}}
|
63
|
+
onChange={(value) => {
|
64
|
+
setSelectedItem(value);
|
65
|
+
}}
|
66
|
+
itemTemplate={({ item }) => <div style={{ fontSize: '20px' }}>{item.label}</div>}
|
67
|
+
triggerTemplate={({ onClick }) => <button className="btn" onClick={onClick}>{selectedItem.label}</button>}
|
68
|
+
|
69
|
+
/>
|
70
|
+
</Markup.ReactMarkupPreview>
|
71
|
+
<Markup.ReactMarkupCode>{`
|
72
|
+
const letters = [
|
73
|
+
{ value: 'A', label: 'A' },
|
74
|
+
{ value: 'B', label: 'B' },
|
75
|
+
{ value: 'C', label: 'C' },
|
76
|
+
...
|
77
|
+
];
|
78
|
+
|
79
|
+
const [selectedItem, setSelectedItem] = React.useState(letters[0]);
|
80
|
+
...
|
81
|
+
<SelectGrid
|
82
|
+
label="Letter"
|
83
|
+
filterPlaceholder="Search..."
|
84
|
+
getItems={(searchString) => {
|
85
|
+
return new Promise((resolve) => {
|
86
|
+
if (searchString == null) {
|
87
|
+
resolve(letters);
|
88
|
+
} else {
|
89
|
+
resolve(letters.filter(({ label }) => label.toLocaleLowerCase().includes(searchString.toLocaleLowerCase())));
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}}
|
93
|
+
onChange={(value) => {
|
94
|
+
setSelectedItem(value);
|
95
|
+
}}
|
96
|
+
itemTemplate={({ item }) => <div style={{ fontSize: '20px' }}>{item.label}</div>}
|
97
|
+
triggerTemplate={({ onClick }) => <button className="btn" onClick={onClick}>{selectedItem.label}</button>}
|
98
|
+
|
99
|
+
/>
|
100
|
+
`}</Markup.ReactMarkupCode>
|
101
|
+
</Markup.ReactMarkup>
|
102
|
+
|
103
|
+
<h3 className="docs-page__h3">Props</h3>
|
104
|
+
<PropsList>
|
105
|
+
<Prop name='label' isRequired={true} type='string' default='null' description='Select label' />
|
106
|
+
<Prop name='filterPlaceholder' isRequired={false} type='string' default='Search...' description='Filter placeholder' />
|
107
|
+
<Prop name='getItems' isRequired={true} type='function' default='false' description='Callback function that should return promise which resolves with array of items' />
|
108
|
+
<Prop name='onChange' isRequired={true} type='function' default='false' description='Callback on change event' />
|
109
|
+
<Prop name='itemTemplate' isRequired={true} type='Component' default='null' description='item renderer' />
|
110
|
+
<Prop name='triggerTemplate' isRequired={true} type='Component' default='null' description='trigger button renderer' />
|
111
|
+
</PropsList>
|
112
|
+
<Alert style='hollow' size='normal' type='alert' restoreIcon='info'>
|
113
|
+
1. triggerTemplate should include <button /> with onClick event. Otherwise keyboard controls won't work. <br />
|
114
|
+
2. Item should be an object with at least label and value.
|
115
|
+
</Alert>
|
116
|
+
</section>
|
117
|
+
)
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
export default SelectGridDocs;
|
@@ -37,7 +37,7 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
37
37
|
<p className='docs-page__paragraph'></p>
|
38
38
|
<Markup.ReactMarkup>
|
39
39
|
<Markup.ReactMarkupPreview>
|
40
|
-
<div className='docs-page__content-row
|
40
|
+
<div className='docs-page__content-row'>
|
41
41
|
<div className='form__row'>
|
42
42
|
<CheckGroup>
|
43
43
|
<Checkbox checked={this.state.required} label={{ text: 'Required input' }} onChange={(value) => { this.setState({ required: value }) }} />
|
@@ -63,6 +63,27 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
63
63
|
</div>
|
64
64
|
</div>
|
65
65
|
|
66
|
+
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
67
|
+
<p className="docs-page__paragraph">// Hidden label</p>
|
68
|
+
<div className='form__row'>
|
69
|
+
<Select label='Hidden select label'
|
70
|
+
value='Option 1'
|
71
|
+
error='Error message'
|
72
|
+
info='This is a hint message'
|
73
|
+
inlineLabel={true}
|
74
|
+
labelHidden={true}
|
75
|
+
required={false}
|
76
|
+
disabled={false}
|
77
|
+
invalid={this.state.invalid}
|
78
|
+
onChange={(value) => { console.log(value) }}>
|
79
|
+
<Option>Option 1</Option>
|
80
|
+
<Option>Option 2</Option>
|
81
|
+
<Option>Option 3</Option>
|
82
|
+
<Option>Option 4</Option>
|
83
|
+
</Select>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
66
87
|
</Markup.ReactMarkupPreview>
|
67
88
|
<Markup.ReactMarkupCode>{`
|
68
89
|
<Select label='Select label'
|
@@ -82,14 +103,15 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
82
103
|
|
83
104
|
<h3 className='docs-page__h3'>Props</h3>
|
84
105
|
<PropsList>
|
85
|
-
<Prop name='value'
|
86
|
-
<Prop name='label'
|
87
|
-
<Prop name='info'
|
88
|
-
<Prop name='error'
|
89
|
-
<Prop name='inlineLabel'
|
90
|
-
<Prop name='
|
91
|
-
<Prop name='
|
92
|
-
<Prop name='
|
106
|
+
<Prop name='value' isRequired={false} type='string' default='/' description='Item value' />
|
107
|
+
<Prop name='label' isRequired={false} type='string' default='/' description='Input label' />
|
108
|
+
<Prop name='info' isRequired={false} type='string' default='/' description='Hint text' />
|
109
|
+
<Prop name='error' isRequired={false} type='string' default='/' description='Error text' />
|
110
|
+
<Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline' />
|
111
|
+
<Prop name='labelHidden' isRequired={false} type='boolean' default='false' description='Hide the label. The label will still be accessible to screen-readers.'/>
|
112
|
+
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required' />
|
113
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled' />
|
114
|
+
<Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid' />
|
93
115
|
</PropsList>
|
94
116
|
</section>
|
95
117
|
)
|
@@ -140,14 +140,14 @@ export default class SwitchDoc extends React.Component<{}, IState> {
|
|
140
140
|
<h3 className="docs-page__h3">Props</h3>
|
141
141
|
<p className="docs-page__paragraph">Switch</p>
|
142
142
|
<PropsList>
|
143
|
-
<Prop name='label text'
|
144
|
-
<Prop name='label side'
|
145
|
-
<Prop name='disabled'
|
143
|
+
<Prop name='label text' isRequired={true} type='string' default='/' description='Label text value.'/>
|
144
|
+
<Prop name='label side' isRequired={false} type='left | right' default='right' description='Position of label relative to the button.'/>
|
145
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='The disabled state of t.'/>
|
146
146
|
</PropsList>
|
147
147
|
<p className="docs-page__paragraph">SwitchGroup</p>
|
148
148
|
<PropsList>
|
149
|
-
<Prop name='orientation'
|
150
|
-
<Prop name='align'
|
149
|
+
<Prop name='orientation' isRequired={false} type='vertical | horizontal' default='vertical' description='Orientation of Switch components inside the group.'/>
|
150
|
+
<Prop name='align' isRequired={false} type='left | right' default='left' description='Alignment of Switch components inside the group.'/>
|
151
151
|
</PropsList>
|
152
152
|
</section>
|
153
153
|
)
|
@@ -190,23 +190,23 @@ export default class TabsDoc extends React.Component<{}, IState> {
|
|
190
190
|
|
191
191
|
<h3 className="docs-page__h3">Props</h3>
|
192
192
|
<PropsList>
|
193
|
-
<Prop name='tablist size'
|
194
|
-
<Prop name='tablist theme'
|
195
|
-
<Prop name='tab label'
|
193
|
+
<Prop name='tablist size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
|
194
|
+
<Prop name='tablist theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
|
195
|
+
<Prop name='tab label' isRequired={false} type='string' default='/' description='Text value of Tab label'/>
|
196
196
|
</PropsList>
|
197
197
|
<br/>
|
198
198
|
<h4 className="docs-page__h4">Tabs Custom</h4>
|
199
199
|
<PropsList>
|
200
|
-
<Prop name='tabs size'
|
201
|
-
<Prop name='tabs theme'
|
202
|
-
<Prop name='tabs ariaLabel'
|
203
|
-
<Prop name='tabs onClick'
|
204
|
-
<Prop name='tablabel indexValue'
|
205
|
-
<Prop name='tablabel label'
|
200
|
+
<Prop name='tabs size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
|
201
|
+
<Prop name='tabs theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
|
202
|
+
<Prop name='tabs ariaLabel' isRequired={false} type='string' default='/' description='Text value of aria-label'/>
|
203
|
+
<Prop name='tabs onClick' isRequired={true} type='function' default='/' description='Use to return value of clicked label'/>
|
204
|
+
<Prop name='tablabel indexValue' isRequired={true} type='number' default='/' description='Index value of label'/>
|
205
|
+
<Prop name='tablabel label' isRequired={true} type='string' default='/' description='Text value of Tab label'/>
|
206
206
|
|
207
|
-
<Prop name='tabcontent theme'
|
208
|
-
<Prop name='tabcontent activePanel'
|
209
|
-
<Prop name='tabpanel indexValue'
|
207
|
+
<Prop name='tabcontent theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
|
208
|
+
<Prop name='tabcontent activePanel' isRequired={true} type='number' default='/' description='Index value of active Tab'/>
|
209
|
+
<Prop name='tabpanel indexValue' isRequired={true} type='number' default='/' description='Index value of Tab Panel'/>
|
210
210
|
</PropsList>
|
211
211
|
</section>
|
212
212
|
)
|
@@ -67,14 +67,14 @@ export default class TimePickerDoc extends React.Component {
|
|
67
67
|
|
68
68
|
<h3 className='docs-page__h3'>Props</h3>
|
69
69
|
<PropsList>
|
70
|
-
<Prop name='value'
|
71
|
-
<Prop name='required'
|
72
|
-
<Prop name='disabled'
|
70
|
+
<Prop name='value' isRequired={true} type='string' default='/' description='Item value' />
|
71
|
+
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required' />
|
72
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled' />
|
73
73
|
</PropsList>
|
74
74
|
|
75
75
|
<h3 className='docs-page__h3'>Events</h3>
|
76
76
|
<PropsList>
|
77
|
-
<Prop name='onChange'
|
77
|
+
<Prop name='onChange' isRequired={true} type='function' default='/' description='Returns value of time input' />
|
78
78
|
</PropsList>
|
79
79
|
</section>
|
80
80
|
);
|
@@ -2,62 +2,60 @@ import * as React from 'react';
|
|
2
2
|
|
3
3
|
import * as Markup from '../../js/react';
|
4
4
|
import { HeadingText, Button, Prop, PropsList } from '../../../app-typescript';
|
5
|
-
import {
|
5
|
+
import { toasted } from '../../../app-typescript';
|
6
6
|
|
7
7
|
export default class ToastsDoc extends React.Component {
|
8
|
-
private toast = new Toasted();
|
9
|
-
|
10
8
|
// default
|
11
9
|
showDefault = () => {
|
12
|
-
|
10
|
+
toasted.notify("I'm a tasty default Toast message!", {position: 'top'});
|
13
11
|
}
|
14
12
|
|
15
13
|
// all positions
|
16
14
|
showAll = () => {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
toasted.notify('Position top', { position: 'top' });
|
16
|
+
toasted.notify('Position top-left', { position: 'top-left' });
|
17
|
+
toasted.notify('Position top-right', { position: 'top-right' });
|
18
|
+
toasted.notify('Position bottom', { position: 'bottom' });
|
19
|
+
toasted.notify('Position bottom-left', { position: 'bottom-left' });
|
20
|
+
toasted.notify('Position bottom-right', { position: 'bottom-right' });
|
23
21
|
}
|
24
22
|
|
25
23
|
// duration
|
26
24
|
showDuration = () => {
|
27
|
-
|
25
|
+
toasted.notify("Curabitur blandit tempus porttitor.", { duration: 3000 });
|
28
26
|
}
|
29
27
|
showNull = () => {
|
30
|
-
|
28
|
+
toasted.notify("Curabitur blandit tempus porttitor.", {});
|
31
29
|
}
|
32
30
|
|
33
31
|
// coloring and icon
|
34
32
|
showSuccess = () => {
|
35
|
-
|
33
|
+
toasted.notify("I'm a tasty default Toast message!", { type: 'success', icon: 'ok'});
|
36
34
|
}
|
37
35
|
showAlert = () => {
|
38
|
-
|
36
|
+
toasted.notify("Danger! Condimentum ridiculus ultricies ornare mollis.", { type: 'alert', icon: 'exclamation-sign', position: 'bottom'});
|
39
37
|
}
|
40
38
|
|
41
39
|
// size
|
42
40
|
showSizeS = () => {
|
43
|
-
|
41
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-s' });
|
44
42
|
}
|
45
43
|
showSizeM = () => {
|
46
|
-
|
44
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-m' });
|
47
45
|
}
|
48
46
|
showSizeL = () => {
|
49
|
-
|
47
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-l' });
|
50
48
|
}
|
51
49
|
showSizeXL = () => {
|
52
|
-
|
50
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-xl' });
|
53
51
|
}
|
54
52
|
|
55
53
|
// custom element
|
56
54
|
showCustomHeading = () => {
|
57
|
-
|
55
|
+
toasted.notify(<HeadingText heading='I have Toaster heading!' text='Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.' />, { type: 'primary', icon: 'info-sign', position: 'bottom' });
|
58
56
|
}
|
59
57
|
showAnotherCustomElement = () => {
|
60
|
-
|
58
|
+
toasted.notify(
|
61
59
|
<React.Fragment>
|
62
60
|
<div className="sd-toast__icon"></div>
|
63
61
|
<figure className="sd-toast__avatar avatar">sd</figure>
|
@@ -77,9 +75,9 @@ export default class ToastsDoc extends React.Component {
|
|
77
75
|
<section className="docs-page__container">
|
78
76
|
<h2 className="docs-page__h2">Toasts</h2>
|
79
77
|
<Markup.ReactMarkupCodePreview>{`
|
80
|
-
|
78
|
+
import {toasted} from 'superdesk-ui-framework/react';
|
81
79
|
|
82
|
-
|
80
|
+
toasted.notify("I'm a tasty default Toast message!", {});
|
83
81
|
`}
|
84
82
|
</Markup.ReactMarkupCodePreview>
|
85
83
|
|
@@ -93,16 +91,14 @@ export default class ToastsDoc extends React.Component {
|
|
93
91
|
</div>
|
94
92
|
</Markup.ReactMarkupPreview>
|
95
93
|
<Markup.ReactMarkupCode>{`
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
toast.notify('Position bottom-left', { position: 'bottom-left' });
|
105
|
-
toast.notify('Position bottom-right', { position: 'bottom-right' });
|
94
|
+
toasted.notify("I'm a tasty default Toast message!", {});
|
95
|
+
|
96
|
+
toasted.notify('Position top', { position: 'top' });
|
97
|
+
toasted.notify('Position top-left', { position: 'top-left' });
|
98
|
+
toasted.notify('Position top-right', { position: 'top-right' });
|
99
|
+
toasted.notify('Position bottom', { position: 'bottom' });
|
100
|
+
toasted.notify('Position bottom-left', { position: 'bottom-left' });
|
101
|
+
toasted.notify('Position bottom-right', { position: 'bottom-right' });
|
106
102
|
`}
|
107
103
|
</Markup.ReactMarkupCode>
|
108
104
|
</Markup.ReactMarkup>
|
@@ -118,10 +114,8 @@ export default class ToastsDoc extends React.Component {
|
|
118
114
|
</div>
|
119
115
|
</Markup.ReactMarkupPreview>
|
120
116
|
<Markup.ReactMarkupCode>{`
|
121
|
-
|
122
|
-
|
123
|
-
toast.notify("Curabitur blandit tempus porttitor.", { duration: 3000 });
|
124
|
-
toast.notify("Curabitur blandit tempus porttitor.", {});
|
117
|
+
toasted.notify("Curabitur blandit tempus porttitor.", { duration: 3000 });
|
118
|
+
toasted.notify("Curabitur blandit tempus porttitor.", {});
|
125
119
|
`}
|
126
120
|
</Markup.ReactMarkupCode>
|
127
121
|
</Markup.ReactMarkup>
|
@@ -138,10 +132,8 @@ export default class ToastsDoc extends React.Component {
|
|
138
132
|
</div>
|
139
133
|
</Markup.ReactMarkupPreview>
|
140
134
|
<Markup.ReactMarkupCode>{`
|
141
|
-
|
142
|
-
|
143
|
-
toast.notify("I'm a tasty default Toast message!", { type: 'success', icon: 'ok'});
|
144
|
-
toast.notify("Danger! Condimentum ridiculus ultricies ornare mollis.", { type: 'alert', icon: 'exclamation-sign', position: 'bottom'});
|
135
|
+
toasted.notify("I'm a tasty default Toast message!", { type: 'success', icon: 'ok'});
|
136
|
+
toasted.notify("Danger! Condimentum ridiculus ultricies ornare mollis.", { type: 'alert', icon: 'exclamation-sign', position: 'bottom'});
|
145
137
|
`}
|
146
138
|
</Markup.ReactMarkupCode>
|
147
139
|
</Markup.ReactMarkup>
|
@@ -158,12 +150,10 @@ export default class ToastsDoc extends React.Component {
|
|
158
150
|
</div>
|
159
151
|
</Markup.ReactMarkupPreview>
|
160
152
|
<Markup.ReactMarkupCode>{`
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-l' });
|
166
|
-
toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-xl' });
|
153
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-s' });
|
154
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-m' });
|
155
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-l' });
|
156
|
+
toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-xl' });
|
167
157
|
`}
|
168
158
|
</Markup.ReactMarkupCode>
|
169
159
|
</Markup.ReactMarkup>
|
@@ -178,10 +168,8 @@ export default class ToastsDoc extends React.Component {
|
|
178
168
|
</div>
|
179
169
|
</Markup.ReactMarkupPreview>
|
180
170
|
<Markup.ReactMarkupCode>{`
|
181
|
-
|
182
|
-
|
183
|
-
toast.notify(<HeadingText heading='I have Toaster heading!' text='Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.' />, { type: 'primary', icon: 'info-sign', position: 'bottom' });
|
184
|
-
toast.notify(
|
171
|
+
toasted.notify(<HeadingText heading='I have Toaster heading!' text='Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.' />, { type: 'primary', icon: 'info-sign', position: 'bottom' });
|
172
|
+
toasted.notify(
|
185
173
|
<React.Fragment>
|
186
174
|
<div className="sd-toast__icon"></div>
|
187
175
|
<figure className="sd-toast__avatar avatar">sd</figure>
|
@@ -200,12 +188,12 @@ export default class ToastsDoc extends React.Component {
|
|
200
188
|
|
201
189
|
<h3 className="docs-page__h3">Props</h3>
|
202
190
|
<PropsList>
|
203
|
-
<Prop name='message'
|
204
|
-
<Prop name='icon'
|
205
|
-
<Prop name='type'
|
206
|
-
<Prop name='position'
|
207
|
-
<Prop name='size'
|
208
|
-
<Prop name='duration'
|
191
|
+
<Prop name='message' isRequired={true} type='string | React.ReactNode' default='normal' description='Message value or custom message element'/>
|
192
|
+
<Prop name='icon' isRequired={false} type='string' default='' description='Icon class name without the icon- part.'/>
|
193
|
+
<Prop name='type' isRequired={false} type='default | primary | success | warning | alert | highlight | light' default='default' description='Default + semantic colour variations (e.g. primary, success etc.).'/>
|
194
|
+
<Prop name='position' isRequired={false} type='top | bottom | top-right | top-left | bottom-right | bottom-left' default='top' description='Position of the toast'/>
|
195
|
+
<Prop name='size' isRequired={false} type='fixed-s | fixed-m | fixed-l | fixed-xl' default='normal' description='Specifies a different sizes of toast.'/>
|
196
|
+
<Prop name='duration' isRequired={false} type='number | null' default='null' description='Specifies a duration time of toast.'/>
|
209
197
|
</PropsList>
|
210
198
|
</section>
|
211
199
|
)
|