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/Selects.tsx
CHANGED
@@ -82,14 +82,14 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
82
82
|
|
83
83
|
<h3 className='docs-page__h3'>Props</h3>
|
84
84
|
<PropsList>
|
85
|
-
<Prop name='value'
|
86
|
-
<Prop name='label'
|
87
|
-
<Prop name='info'
|
88
|
-
<Prop name='error'
|
89
|
-
<Prop name='inlineLabel'
|
90
|
-
<Prop name='required'
|
91
|
-
<Prop name='disabled'
|
92
|
-
<Prop name='invalid'
|
85
|
+
<Prop name='value' isRequired={false} type='string' default='/' description='Item value' />
|
86
|
+
<Prop name='label' isRequired={false} type='string' default='/' description='Input label' />
|
87
|
+
<Prop name='info' isRequired={false} type='string' default='/' description='Hint text' />
|
88
|
+
<Prop name='error' isRequired={false} type='string' default='/' description='Error text' />
|
89
|
+
<Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline' />
|
90
|
+
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required' />
|
91
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled' />
|
92
|
+
<Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid' />
|
93
93
|
</PropsList>
|
94
94
|
</section>
|
95
95
|
)
|
package/dist/react/Switch.tsx
CHANGED
@@ -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
|
)
|
package/dist/react/Tabs.tsx
CHANGED
@@ -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
|
);
|
package/dist/react/Toasts.tsx
CHANGED
@@ -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
|
)
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import * as Markup from "../../js/react";
|
3
|
+
import { ToggleBox, PropsList, Prop, Button, Badge } from "../../../app-typescript";
|
4
|
+
|
5
|
+
const ToggleboxDocs = () => {
|
6
|
+
const toggleRef = React.useRef();
|
7
|
+
|
8
|
+
return (
|
9
|
+
<section className="docs-page__container">
|
10
|
+
<h2 className="docs-page__h2">Togglebox</h2>
|
11
|
+
<p className="docs-page__paragraph">Simple toggle box element. It provides toggle() function that can be used with React's ref functionality and control close/open state from outside. Arrow left, Arrow right and Enter are supported keyboard events.</p>
|
12
|
+
<Markup.ReactMarkupCodePreview>{`
|
13
|
+
<ToggleBox title="togglebox title">togglebox content</ToggleBox>
|
14
|
+
`}
|
15
|
+
</Markup.ReactMarkupCodePreview>
|
16
|
+
<Markup.ReactMarkup>
|
17
|
+
<Markup.ReactMarkupPreview>
|
18
|
+
<Button text="Toggle programatically" onClick={() => { toggleRef.current.toggle() }} />
|
19
|
+
<div style={{ marginTop: "2em" }}>
|
20
|
+
<ToggleBox title="Simple togglebox" ref={toggleRef} initiallyOpen={true}>Togglebox content</ToggleBox>
|
21
|
+
<ToggleBox title="With badge" badge={<Badge text='2' type='primary' />}>Togglebox content</ToggleBox>
|
22
|
+
<ToggleBox title="With different badge" badge={<Badge text='!' type='alert' shape='square' />}>Togglebox content</ToggleBox>
|
23
|
+
<ToggleBox title="Togglebox - circled chevron" className="toggle-box--circle">Togglebox content</ToggleBox>
|
24
|
+
</div>
|
25
|
+
</Markup.ReactMarkupPreview>
|
26
|
+
<Markup.ReactMarkupCode>{`
|
27
|
+
<Button text="Toggle programatically" onClick={() => { toggleRef.current.toggle() }} />
|
28
|
+
|
29
|
+
<ToggleBox title="Simple togglebox" ref={toggleRef} initiallyOpen={true}>Togglebox content</ToggleBox>
|
30
|
+
<ToggleBox title="With badge" badge={<Badge text='2' type='primary' />}>Togglebox content</ToggleBox>
|
31
|
+
<ToggleBox title="With different badge" badge={<Badge text='!' type='alert' shape='square' />}>Togglebox content</ToggleBox>
|
32
|
+
<ToggleBox title="Togglebox - circled chevron" className="toggle-box--circle">Togglebox content</ToggleBox>
|
33
|
+
`}</Markup.ReactMarkupCode>
|
34
|
+
</Markup.ReactMarkup>
|
35
|
+
|
36
|
+
<h3 className="docs-page__h3">Props</h3>
|
37
|
+
<PropsList>
|
38
|
+
<Prop name='title' isRequired={true} type='string' default='null' description='Togglebox title' />
|
39
|
+
<Prop name='badge' isRequired={false} type='JSX.Element' default='null' description='Badge' />
|
40
|
+
<Prop name='hideUsingCSS' isRequired={false} type='boolean' default='false' description='Usefull when working with forms. Content of togglebox will be hidden but remain rendered.' />
|
41
|
+
<Prop name='initiallyOpen' isRequired={false} type='boolean' default='false' description='Opens togglebox on initial render' />
|
42
|
+
<Prop name='className' isRequired={false} type='string' default='null' description='Style class of the component' />
|
43
|
+
<Prop name='onOpen' isRequired={false} type='function' default='null' description='Callback on open event' />
|
44
|
+
<Prop name='onClose' isRequired={false} type='function' default='null' description='Callback on close event' />
|
45
|
+
</PropsList>
|
46
|
+
</section>
|
47
|
+
)
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
export default ToggleboxDocs;
|
package/dist/react/Tooltips.tsx
CHANGED
@@ -15,7 +15,8 @@ export default class TooltipDoc extends React.Component {
|
|
15
15
|
</Tooltip>
|
16
16
|
`}
|
17
17
|
</Markup.ReactMarkupCodePreview>
|
18
|
-
<
|
18
|
+
<h3 className="docs-page__h3">Default</h3>
|
19
|
+
<p className="docs-page__paragraph">Chose one of 4 placement options (<code>’left’</code>, <code>’right’</code>, <code>down</code>, and <code>’top’</code>). The default value is <code>’top’</code> and will be rendered so without explicitly specifying it.</p>
|
19
20
|
<Markup.ReactMarkup>
|
20
21
|
<Markup.ReactMarkupPreview>
|
21
22
|
<div className="docs-page__content-row docs-page__content-row--no-margin">
|
@@ -30,7 +31,7 @@ export default class TooltipDoc extends React.Component {
|
|
30
31
|
</Tooltip>
|
31
32
|
<Tooltip text="Right on!" flow='right'>
|
32
33
|
<Button text='right' onClick={() => false} />
|
33
|
-
</Tooltip>
|
34
|
+
</Tooltip>
|
34
35
|
</div>
|
35
36
|
</Markup.ReactMarkupPreview>
|
36
37
|
<Markup.ReactMarkupCode>{`
|
@@ -50,10 +51,53 @@ export default class TooltipDoc extends React.Component {
|
|
50
51
|
</Markup.ReactMarkupCode>
|
51
52
|
</Markup.ReactMarkup>
|
52
53
|
|
54
|
+
<h3 className="docs-page__h3">Appended to body</h3>
|
55
|
+
<p className="docs-page__paragraph">
|
56
|
+
Appends tooltip element to body therefore avoids overflow issues. For performance reasons don't use it if not necessary.
|
57
|
+
</p>
|
58
|
+
<Markup.ReactMarkup>
|
59
|
+
<Markup.ReactMarkupPreview>
|
60
|
+
|
61
|
+
<div className="docs-page__content-row docs-page__content-row--no-margin">
|
62
|
+
|
63
|
+
<div className="docs-page__content-row docs-page__content-row--no-margin" style={{background: "#ebebeb", width: "100%", padding: "5px", overflow: "hidden"}}>
|
64
|
+
<Tooltip text="I'm appended to body" flow='top' appendToBody={true}>
|
65
|
+
<Button text='top' onClick={() => false} />
|
66
|
+
</Tooltip>
|
67
|
+
<Tooltip text="I'm appended to body" flow='down' appendToBody={true}>
|
68
|
+
<Button text='Down' onClick={() => false} />
|
69
|
+
</Tooltip>
|
70
|
+
<Tooltip text="I'm appended to body" flow='left' appendToBody={true}>
|
71
|
+
<Button text='left' onClick={() => false} />
|
72
|
+
</Tooltip>
|
73
|
+
<Tooltip text="I'm appended to body" flow='right' appendToBody={true}>
|
74
|
+
<Button text='right' onClick={() => false} />
|
75
|
+
</Tooltip>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</Markup.ReactMarkupPreview>
|
79
|
+
<Markup.ReactMarkupCode>{`
|
80
|
+
<Tooltip text="I'm appended to body" flow='top' appendToBody={true}>
|
81
|
+
<Button text='top' onClick={() => false} />
|
82
|
+
</Tooltip>
|
83
|
+
<Tooltip text="I'm appended to body" flow='down' appendToBody={true}>
|
84
|
+
<Button text='Down' onClick={() => false} />
|
85
|
+
</Tooltip>
|
86
|
+
<Tooltip text="I'm appended to body" flow='left' appendToBody={true}>
|
87
|
+
<Button text='left' onClick={() => false} />
|
88
|
+
</Tooltip>
|
89
|
+
<Tooltip text="I'm appended to body" flow='right' appendToBody={true}>
|
90
|
+
<Button text='right' onClick={() => false} />
|
91
|
+
</Tooltip>
|
92
|
+
`}
|
93
|
+
</Markup.ReactMarkupCode>
|
94
|
+
</Markup.ReactMarkup>
|
95
|
+
|
53
96
|
<h3 className="docs-page__h3">Props</h3>
|
54
97
|
<PropsList>
|
55
|
-
<Prop name='text'
|
56
|
-
<Prop name='flow'
|
98
|
+
<Prop name='text' isRequired={true} type='string' default='/' description='Tooltip text value.' />
|
99
|
+
<Prop name='flow' isRequired={false} type='top | left | right | down' default='top' description='Position of tooltip text.' />
|
100
|
+
<Prop name='appendToBody' isRequired={false} type='boolean' default='false' description='Appends element to body therefore avoids overflow issues.' />
|
57
101
|
</PropsList>
|
58
102
|
</section>
|
59
103
|
)
|