superdesk-ui-framework 2.4.14 → 2.4.15
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 +23 -9
- 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/DropdownFirst.tsx +2 -2
- package/app-typescript/components/IconPicker.tsx +277 -0
- 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/SelectGrid.tsx +233 -0
- package/app-typescript/components/SelectWithTemplate.tsx +0 -2
- package/app-typescript/components/Skeleton.tsx +48 -0
- 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 +5527 -2989
- 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 +9 -9
- 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 +8 -8
- 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 +3771 -94
- package/dist/superdesk-ui.bundle.js +4468 -2037
- package/dist/vendor.bundle.js +53380 -53380
- package/examples/pages/components/modals.html +180 -4
- 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 +9 -9
- 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 +8 -8
- 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/DropdownFirst.js +1 -1
- package/react/components/IconPicker.d.ts +24 -0
- package/react/components/IconPicker.js +283 -0
- 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/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/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
package/dist/react/Index.tsx
CHANGED
@@ -40,10 +40,15 @@ import GridListDoc from './GridList';
|
|
40
40
|
import GridItemDoc from './GridItem';
|
41
41
|
import ModalDoc from './Modal';
|
42
42
|
import CarouselDoc from './Carousel';
|
43
|
+
import ToggleboxDocs from './Togglebox';
|
44
|
+
import ListItemsDoc from './ListItems';
|
45
|
+
import SelectGridDocs from './SelectGrid';
|
46
|
+
import IconPickerDocs from "./IconPicker";
|
43
47
|
|
44
48
|
import * as Playgrounds from '../playgrounds/react-playgrounds/Index';
|
45
|
-
import {SelectWithTemplateDocs} from './SelectWithTemplate';
|
46
|
-
import {PopoverDoc} from './Popover';
|
49
|
+
import { SelectWithTemplateDocs } from './SelectWithTemplate';
|
50
|
+
import { PopoverDoc } from './Popover';
|
51
|
+
import { MenuDocs } from './Menu';
|
47
52
|
|
48
53
|
const pages = {
|
49
54
|
basicComponents: {
|
@@ -96,6 +101,9 @@ const pages = {
|
|
96
101
|
},
|
97
102
|
'carousel': {
|
98
103
|
name: 'Carousel'
|
104
|
+
},
|
105
|
+
'menu': {
|
106
|
+
name: 'Menu',
|
99
107
|
}
|
100
108
|
}
|
101
109
|
},
|
@@ -130,6 +138,12 @@ const pages = {
|
|
130
138
|
'grid-list': {
|
131
139
|
name: 'Grid List'
|
132
140
|
},
|
141
|
+
"togglebox": {
|
142
|
+
name: "Togglebox"
|
143
|
+
},
|
144
|
+
'list-items': {
|
145
|
+
name: 'List items'
|
146
|
+
},
|
133
147
|
}
|
134
148
|
},
|
135
149
|
formComponents: {
|
@@ -147,6 +161,9 @@ const pages = {
|
|
147
161
|
'select': {
|
148
162
|
name: 'Select',
|
149
163
|
},
|
164
|
+
'select-grid': {
|
165
|
+
name: 'Select Grid',
|
166
|
+
},
|
150
167
|
'select-with-template': {
|
151
168
|
name: 'Select with template',
|
152
169
|
},
|
@@ -156,6 +173,9 @@ const pages = {
|
|
156
173
|
'time-picker': {
|
157
174
|
name: 'Time Picker',
|
158
175
|
},
|
176
|
+
'icon-picker': {
|
177
|
+
name: 'Icon Picker',
|
178
|
+
},
|
159
179
|
'switch': {
|
160
180
|
name: 'Switch'
|
161
181
|
},
|
@@ -221,6 +241,11 @@ class ReactDoc extends React.Component {
|
|
221
241
|
<Route path="/react/grid-item" component={GridItemDoc} />
|
222
242
|
<Route path="/react/modal" component={ModalDoc} />
|
223
243
|
<Route path="/react/carousel" component={CarouselDoc} />
|
244
|
+
<Route path="/react/menu" component={MenuDocs} />
|
245
|
+
<Route path="/react/togglebox" component={ToggleboxDocs} />
|
246
|
+
<Route path="/react/list-items" component={ListItemsDoc} />
|
247
|
+
<Route path="/react/select-grid" component={SelectGridDocs} />
|
248
|
+
<Route path="/react/icon-picker" component={IconPickerDocs} />
|
224
249
|
<Route path="/" component={ReactDefault} />
|
225
250
|
</Switch>
|
226
251
|
</main>
|
package/dist/react/Inputs.tsx
CHANGED
@@ -74,15 +74,15 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
74
74
|
|
75
75
|
<h3 className='docs-page__h3'>Props</h3>
|
76
76
|
<PropsList>
|
77
|
-
<Prop name='value'
|
78
|
-
<Prop name='label'
|
79
|
-
<Prop name='maxLength'
|
80
|
-
<Prop name='info'
|
81
|
-
<Prop name='error'
|
82
|
-
<Prop name='inlineLabel'
|
83
|
-
<Prop name='required'
|
84
|
-
<Prop name='disabled'
|
85
|
-
<Prop name='invalid'
|
77
|
+
<Prop name='value' isRequired={false} type='string' default='/' description='Item value'/>
|
78
|
+
<Prop name='label' isRequired={false} type='string' default='/' description='Input label'/>
|
79
|
+
<Prop name='maxLength' isRequired={false} type='number' default='/' description='Sets max length for input text'/>
|
80
|
+
<Prop name='info' isRequired={false} type='string' default='/' description='Hint text'/>
|
81
|
+
<Prop name='error' isRequired={false} type='string' default='/' description='Error text'/>
|
82
|
+
<Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline'/>
|
83
|
+
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required'/>
|
84
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled'/>
|
85
|
+
<Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid'/>
|
86
86
|
</PropsList>
|
87
87
|
</section>
|
88
88
|
)
|
package/dist/react/Labels.tsx
CHANGED
@@ -217,12 +217,12 @@ export default class LabelsDoc extends React.Component {
|
|
217
217
|
|
218
218
|
<h3 className="docs-page__h3">Props</h3>
|
219
219
|
<PropsList>
|
220
|
-
<Prop name='text'
|
221
|
-
<Prop name='type'
|
222
|
-
<Prop name='color'
|
223
|
-
<Prop name='size'
|
224
|
-
<Prop name='noTransform'
|
225
|
-
<Prop name='style'
|
220
|
+
<Prop name='text' isRequired={true} type='string' default='/' description='Label text value'/>
|
221
|
+
<Prop name='type' isRequired={false} type='default | primary | success | warning | alert | highlight | sd-green' default='default' description='Default + semantic colour variations (e.g. primary, success etc.).'/>
|
222
|
+
<Prop name='color' isRequired={false} type='string' default='/' description='Extended color palette from the framework (e.g. red--500); NOTE: The label can have either a Type or Color defined, not both at the same time.'/>
|
223
|
+
<Prop name='size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large label.'/>
|
224
|
+
<Prop name='noTransform' isRequired={false} type='boolean' default='false' description='Transforms text to uppercase.'/>
|
225
|
+
<Prop name='style' isRequired={false} type='filled | hollow | translucent' default='filled' description='Label may have one of these styles - filled (default), hollow or translucent.'/>
|
226
226
|
</PropsList>
|
227
227
|
</section>
|
228
228
|
)
|
@@ -40,12 +40,12 @@ export default class LeftNavigationsDoc extends React.Component<{}> {
|
|
40
40
|
|
41
41
|
<h3 className="docs-page__h3">Props</h3>
|
42
42
|
<PropsList>
|
43
|
-
<Prop name='groups'
|
44
|
-
<Prop name='activeItemId'
|
45
|
-
<Prop name='menugroup label'
|
46
|
-
<Prop name='menugroup items'
|
47
|
-
<Prop name='menuitem id'
|
48
|
-
<Prop name='menuitem label'
|
43
|
+
<Prop name='groups' isRequired={true} type='Array<menugroup>' default='/' description='Array of groups'/>
|
44
|
+
<Prop name='activeItemId' isRequired={true} type='string' default='/' description='Id of active item'/>
|
45
|
+
<Prop name='menugroup label' isRequired={true} type='string' default='/' description='Menugroup label text value.'/>
|
46
|
+
<Prop name='menugroup items' isRequired={true} type='Array<menuitem>' default='/' description='Array of items'/>
|
47
|
+
<Prop name='menuitem id' isRequired={true} type='string' default='/' description='Menugroup id value'/>
|
48
|
+
<Prop name='menuitem label' isRequired={true} type='string' default='/' description='Menugroup label text value.'/>
|
49
49
|
</PropsList>
|
50
50
|
</section>
|
51
51
|
)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import * as Markup from "../../js/react";
|
3
|
+
import { ListItemLoader, PropsList } from "../../../app-typescript";
|
4
|
+
|
5
|
+
export default class ListItemsDoc extends React.Component {
|
6
|
+
render() {
|
7
|
+
return (
|
8
|
+
<section className="docs-page__container">
|
9
|
+
<h2 className="docs-page__h2">List Items</h2>
|
10
|
+
<Markup.ReactMarkupCodePreview>{`
|
11
|
+
<ListItemLoader />
|
12
|
+
`}
|
13
|
+
</Markup.ReactMarkupCodePreview>
|
14
|
+
<h3 className="docs-page__h3 docs-page__h3--small-top-m">Loader type of list items</h3>
|
15
|
+
<p className="docs-page__paragraph">Basic layout structure for list elements. The content inside the elements serves just as an example.</p>
|
16
|
+
<Markup.ReactMarkup>
|
17
|
+
<Markup.ReactMarkupPreview>
|
18
|
+
<div className="docs-page__content-row">
|
19
|
+
<ListItemLoader />
|
20
|
+
</div>
|
21
|
+
</Markup.ReactMarkupPreview>
|
22
|
+
<Markup.ReactMarkupCode>{`
|
23
|
+
<ListItemLoader />
|
24
|
+
`}</Markup.ReactMarkupCode>
|
25
|
+
</Markup.ReactMarkup>
|
26
|
+
|
27
|
+
<h3 className="docs-page__h3">Props</h3>
|
28
|
+
<PropsList>
|
29
|
+
|
30
|
+
</PropsList>
|
31
|
+
</section>
|
32
|
+
)
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
import * as Markup from '../../js/react';
|
4
|
+
|
5
|
+
import {Button, Menu, Prop, PropsList} from '../../../app-typescript';
|
6
|
+
import {IMenuItem} from '../../../app-typescript/components/Menu';
|
7
|
+
|
8
|
+
const menuItems: Array<IMenuItem> = [
|
9
|
+
{
|
10
|
+
label: 'Edit',
|
11
|
+
icon: 'icon-pencil',
|
12
|
+
onClick: () => console.log('action: Edit'),
|
13
|
+
},
|
14
|
+
{
|
15
|
+
label: 'Edit in the new window',
|
16
|
+
icon: 'icon-pencil',
|
17
|
+
onClick: () => console.log('action: Edit in the new window'),
|
18
|
+
},
|
19
|
+
{
|
20
|
+
label: 'Translate',
|
21
|
+
icon: 'icon-globe',
|
22
|
+
children: [
|
23
|
+
{
|
24
|
+
label: 'German',
|
25
|
+
onClick: () => console.log('action: German'),
|
26
|
+
},
|
27
|
+
{
|
28
|
+
label: 'French',
|
29
|
+
onClick: () => console.log('action: French'),
|
30
|
+
},
|
31
|
+
],
|
32
|
+
},
|
33
|
+
{
|
34
|
+
label: 'Export',
|
35
|
+
icon: 'icon-download',
|
36
|
+
disabled: true,
|
37
|
+
onClick: () => console.log('action: Export'),
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: 'Spike item',
|
41
|
+
icon: 'icon-trash',
|
42
|
+
onClick: () => console.log('action: Spike item'),
|
43
|
+
},
|
44
|
+
{separator: true},
|
45
|
+
{
|
46
|
+
label: 'Send to',
|
47
|
+
icon: 'icon-share-alt',
|
48
|
+
onClick: () => console.log('action: Send to'),
|
49
|
+
},
|
50
|
+
{
|
51
|
+
label: 'Export',
|
52
|
+
icon: 'icon-download',
|
53
|
+
onClick: () => console.log('action: Export'),
|
54
|
+
},
|
55
|
+
{
|
56
|
+
label: 'Spike item',
|
57
|
+
icon: 'icon-trash',
|
58
|
+
onClick: () => console.log('action: Spike item'),
|
59
|
+
},
|
60
|
+
];
|
61
|
+
|
62
|
+
export class MenuDocs extends React.Component {
|
63
|
+
render() {
|
64
|
+
return (
|
65
|
+
<section className='docs-page__container'>
|
66
|
+
|
67
|
+
<h2 className='docs-page__h2'>Menu</h2>
|
68
|
+
|
69
|
+
<p className='docs-page__paragraph'></p>
|
70
|
+
<Markup.ReactMarkup>
|
71
|
+
<Markup.ReactMarkupPreview>
|
72
|
+
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
73
|
+
<div className='form__row'>
|
74
|
+
<Menu items={menuItems}>
|
75
|
+
{(toggle) => (
|
76
|
+
<Button
|
77
|
+
text="open menu"
|
78
|
+
onClick={(event) => {
|
79
|
+
toggle(event);
|
80
|
+
}}
|
81
|
+
/>
|
82
|
+
)}
|
83
|
+
</Menu>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</Markup.ReactMarkupPreview>
|
88
|
+
|
89
|
+
<Markup.ReactMarkupCode>{`
|
90
|
+
const menuItems = [
|
91
|
+
{
|
92
|
+
label: 'Action 1',
|
93
|
+
icon: 'icon-globe',
|
94
|
+
children: [
|
95
|
+
{
|
96
|
+
label: 'Action item 2',
|
97
|
+
icon: 'icon-globe',
|
98
|
+
onClick: () => console.log('action: Action item 2'),
|
99
|
+
},
|
100
|
+
],
|
101
|
+
},
|
102
|
+
];
|
103
|
+
|
104
|
+
<Menu items={menuItems}>
|
105
|
+
{(toggle) => (
|
106
|
+
<Button
|
107
|
+
text="open menu"
|
108
|
+
onClick={(event) => {
|
109
|
+
toggle(event);
|
110
|
+
}}
|
111
|
+
/>
|
112
|
+
)}
|
113
|
+
</Menu>
|
114
|
+
`}</Markup.ReactMarkupCode>
|
115
|
+
</Markup.ReactMarkup>
|
116
|
+
|
117
|
+
<h3 className="docs-page__h3">Props</h3>
|
118
|
+
|
119
|
+
<PropsList>
|
120
|
+
<Prop name='items' isRequired={true} type='array' default='' description='Array of objects. Allowed objects are: "Menu branch", "Menu leaf" or "Divider"'/>
|
121
|
+
|
122
|
+
<Prop
|
123
|
+
name='children'
|
124
|
+
isRequired={true}
|
125
|
+
type='function'
|
126
|
+
default=''
|
127
|
+
description='Will have `toggle` function as an argument. Has to return a JSX element that will act a trigger for the menu.'
|
128
|
+
/>
|
129
|
+
</PropsList>
|
130
|
+
|
131
|
+
<p className='docs-page__paragraph'>Menu branch</p>
|
132
|
+
<PropsList>
|
133
|
+
<Prop name='label' isRequired={true} type='string' default='' description='Name for menu group'/>
|
134
|
+
<Prop name='icon' isRequired={false} type='string' default='' description='Available icons are listed in /#/react/icon-font'/>
|
135
|
+
<Prop
|
136
|
+
name='children'
|
137
|
+
isRequired={true}
|
138
|
+
type='array'
|
139
|
+
default=''
|
140
|
+
description='Array of objects. Allowed objects are: "Menu branch", "Menu leaf" or "Divider"'
|
141
|
+
/>
|
142
|
+
</PropsList>
|
143
|
+
|
144
|
+
<p className='docs-page__paragraph'>Menu leaf</p>
|
145
|
+
<PropsList>
|
146
|
+
<Prop name='label' isRequired={true} type='string' default='' description='Name for menu item'/>
|
147
|
+
<Prop name='icon' isRequired={false} type='string' default='' description='Available icons are listed in /#/react/icon-font'/>
|
148
|
+
<Prop name='onClick' isRequired={true} type='function' default='' description=''/>
|
149
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='' description=''/>
|
150
|
+
</PropsList>
|
151
|
+
|
152
|
+
<p className='docs-page__paragraph'>Menu separator</p>
|
153
|
+
<PropsList>
|
154
|
+
<Prop name='separator' isRequired={true} type='boolean' default='' description='Adds a separator between items.'/>
|
155
|
+
</PropsList>
|
156
|
+
</section>
|
157
|
+
)
|
158
|
+
}
|
159
|
+
}
|
package/dist/react/Modal.tsx
CHANGED
@@ -72,15 +72,15 @@ export default class ModalDoc extends React.Component<{}, IState> {
|
|
72
72
|
|
73
73
|
<h3 className="docs-page__h3">Props</h3>
|
74
74
|
<PropsList>
|
75
|
-
<Prop name='id'
|
76
|
-
<Prop name='className'
|
77
|
-
<Prop name='theme'
|
78
|
-
<Prop name='visible'
|
79
|
-
<Prop name='headerTemplate'
|
80
|
-
<Prop name='footerTemplate'
|
81
|
-
<Prop name='closeOnEscape'
|
82
|
-
<Prop name='onShow'
|
83
|
-
<Prop name='onHide'
|
75
|
+
<Prop name='id' isRequired={false} type='string' default='null' description='Unique identifier of the element' />
|
76
|
+
<Prop name='className' isRequired={false} type='string' default='null' description='Style class of the component' />
|
77
|
+
<Prop name='theme' isRequired={false} type='light | dark' default='light' description='Item style' />
|
78
|
+
<Prop name='visible' isRequired={true} type='boolean' default='false' description='Specifies the visibility of the dialog' />
|
79
|
+
<Prop name='headerTemplate' isRequired={false} type='element' default='null' description='Label of header' />
|
80
|
+
<Prop name='footerTemplate' isRequired={false} type='element' default='null' description='Label of footer' />
|
81
|
+
<Prop name='closeOnEscape' isRequired={false} type='boolean' default='null' description='An array of objects to display' />
|
82
|
+
<Prop name='onShow' isRequired={false} type='function' default='null' description='Callback to invoke after modal is opened' />
|
83
|
+
<Prop name='onHide' isRequired={true} type='function' default='null' description='Callback to invoke after modal is closed' />
|
84
84
|
</PropsList>
|
85
85
|
</section>
|
86
86
|
)
|
@@ -59,13 +59,13 @@ export default class NavButtonsDoc extends React.Component {
|
|
59
59
|
|
60
60
|
<h3 className="docs-page__h3">Props</h3>
|
61
61
|
<PropsList>
|
62
|
-
<Prop name='icon'
|
63
|
-
<Prop name='text'
|
64
|
-
<Prop name='iconSize'
|
65
|
-
<Prop name='type'
|
66
|
-
<Prop name='state'
|
67
|
-
<Prop name='theme'
|
68
|
-
<Prop name='value'
|
62
|
+
<Prop name='icon' isRequired={false} type='string' default='/' description='Icon class name without the icon- part.' />
|
63
|
+
<Prop name='text' isRequired={false} type='string' default='/' description='Defines the value for aria-label, for screen-readers accessibility.' />
|
64
|
+
<Prop name='iconSize' isRequired={false} type='small | big' default='small' description='Specifies a small or big button' />
|
65
|
+
<Prop name='type' isRequired={false} type='default | primary | success | warning | alert | highlight | sd-green' default='default' description='Default + semantic colour variations (e.g. primary, success etc.).' />
|
66
|
+
<Prop name='state' isRequired={false} type='normal | active' default='normal' description='Defines the optional state of the button (e.g. active)' />
|
67
|
+
<Prop name='theme' isRequired={false} type='light | dark' default='light' description='Styles nav button for diffrent background.' />
|
68
|
+
<Prop name='value' isRequired={false} type='button | submit | reset' default='button' description='Specifies a value of nav button' />
|
69
69
|
</PropsList>
|
70
70
|
</section>
|
71
71
|
);
|
package/dist/react/Popover.tsx
CHANGED
@@ -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
|
)
|
package/dist/react/Radios.tsx
CHANGED
@@ -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;
|