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.
Files changed (141) hide show
  1. package/app/index.js +1 -0
  2. package/app/scripts/modals.js +23 -9
  3. package/app/styles/_buttons.scss +17 -0
  4. package/app/styles/_modals.scss +23 -17
  5. package/app/styles/_tooltips.scss +66 -0
  6. package/app/styles/app.scss +1 -0
  7. package/app/styles/components/_sd-toaster.scss +6 -5
  8. package/app/styles/form-elements/_inputs.scss +1 -0
  9. package/app/styles/form-elements/_select-grid.scss +77 -0
  10. package/app/styles/pr-superdesk-theme.scss +3 -1
  11. package/app/styles/primereact/_pr-menu.scss +38 -0
  12. package/app/styles/primereact/_pr-skeleton.scss +35 -0
  13. package/app/styles/variables/_colors.scss +30 -18
  14. package/app-typescript/components/Button.tsx +2 -2
  15. package/app-typescript/components/DropdownFirst.tsx +2 -2
  16. package/app-typescript/components/IconPicker.tsx +277 -0
  17. package/app-typescript/components/ListItemLoader.tsx +30 -0
  18. package/app-typescript/components/Menu.tsx +149 -0
  19. package/app-typescript/components/PropsList.tsx +2 -2
  20. package/app-typescript/components/Radio.tsx +19 -10
  21. package/app-typescript/components/SelectGrid.tsx +233 -0
  22. package/app-typescript/components/SelectWithTemplate.tsx +0 -2
  23. package/app-typescript/components/Skeleton.tsx +48 -0
  24. package/app-typescript/components/Toast.tsx +31 -5
  25. package/app-typescript/components/ToastMessage.tsx +9 -16
  26. package/app-typescript/components/ToastText.tsx +2 -4
  27. package/app-typescript/components/ToastWrapper.tsx +4 -4
  28. package/app-typescript/components/Togglebox.tsx +108 -0
  29. package/app-typescript/components/Tooltip.tsx +25 -1
  30. package/app-typescript/index.ts +8 -0
  31. package/dist/components/modals.html +180 -4
  32. package/dist/examples.bundle.css +52 -36
  33. package/dist/examples.bundle.js +5527 -2989
  34. package/dist/react/Alerts.tsx +4 -4
  35. package/dist/react/Autocomplete.tsx +17 -17
  36. package/dist/react/Badges.tsx +4 -4
  37. package/dist/react/BigIconFont.tsx +3 -3
  38. package/dist/react/ButtonGroups.tsx +6 -6
  39. package/dist/react/Buttons.tsx +11 -11
  40. package/dist/react/Carousel.tsx +15 -15
  41. package/dist/react/Checkboxs.tsx +10 -10
  42. package/dist/react/DatePicker.tsx +6 -6
  43. package/dist/react/Dropdowns.tsx +15 -15
  44. package/dist/react/EmptyStates.tsx +4 -4
  45. package/dist/react/GridItem.tsx +8 -8
  46. package/dist/react/GridList.tsx +3 -3
  47. package/dist/react/IconButtons.tsx +3 -3
  48. package/dist/react/IconFont.tsx +10 -9
  49. package/dist/react/IconLabels.tsx +4 -4
  50. package/dist/react/IconPicker.tsx +65 -0
  51. package/dist/react/Index.tsx +27 -2
  52. package/dist/react/Inputs.tsx +9 -9
  53. package/dist/react/Labels.tsx +6 -6
  54. package/dist/react/LeftNavigations.tsx +6 -6
  55. package/dist/react/ListItems.tsx +34 -0
  56. package/dist/react/Menu.tsx +159 -0
  57. package/dist/react/Modal.tsx +9 -9
  58. package/dist/react/NavButtons.tsx +7 -7
  59. package/dist/react/Popover.tsx +5 -5
  60. package/dist/react/Radios.tsx +29 -29
  61. package/dist/react/SelectGrid.tsx +121 -0
  62. package/dist/react/Selects.tsx +8 -8
  63. package/dist/react/Switch.tsx +5 -5
  64. package/dist/react/Tabs.tsx +12 -12
  65. package/dist/react/TimePicker.tsx +4 -4
  66. package/dist/react/Toasts.tsx +44 -56
  67. package/dist/react/Togglebox.tsx +51 -0
  68. package/dist/react/Tooltips.tsx +48 -4
  69. package/dist/superdesk-ui.bundle.css +3771 -94
  70. package/dist/superdesk-ui.bundle.js +4468 -2037
  71. package/dist/vendor.bundle.js +53380 -53380
  72. package/examples/pages/components/modals.html +180 -4
  73. package/examples/pages/react/Alerts.tsx +4 -4
  74. package/examples/pages/react/Autocomplete.tsx +17 -17
  75. package/examples/pages/react/Badges.tsx +4 -4
  76. package/examples/pages/react/BigIconFont.tsx +3 -3
  77. package/examples/pages/react/ButtonGroups.tsx +6 -6
  78. package/examples/pages/react/Buttons.tsx +11 -11
  79. package/examples/pages/react/Carousel.tsx +15 -15
  80. package/examples/pages/react/Checkboxs.tsx +10 -10
  81. package/examples/pages/react/DatePicker.tsx +6 -6
  82. package/examples/pages/react/Dropdowns.tsx +15 -15
  83. package/examples/pages/react/EmptyStates.tsx +4 -4
  84. package/examples/pages/react/GridItem.tsx +8 -8
  85. package/examples/pages/react/GridList.tsx +3 -3
  86. package/examples/pages/react/IconButtons.tsx +3 -3
  87. package/examples/pages/react/IconFont.tsx +10 -9
  88. package/examples/pages/react/IconLabels.tsx +4 -4
  89. package/examples/pages/react/IconPicker.tsx +65 -0
  90. package/examples/pages/react/Index.tsx +27 -2
  91. package/examples/pages/react/Inputs.tsx +9 -9
  92. package/examples/pages/react/Labels.tsx +6 -6
  93. package/examples/pages/react/LeftNavigations.tsx +6 -6
  94. package/examples/pages/react/ListItems.tsx +34 -0
  95. package/examples/pages/react/Menu.tsx +159 -0
  96. package/examples/pages/react/Modal.tsx +9 -9
  97. package/examples/pages/react/NavButtons.tsx +7 -7
  98. package/examples/pages/react/Popover.tsx +5 -5
  99. package/examples/pages/react/Radios.tsx +29 -29
  100. package/examples/pages/react/SelectGrid.tsx +121 -0
  101. package/examples/pages/react/Selects.tsx +8 -8
  102. package/examples/pages/react/Switch.tsx +5 -5
  103. package/examples/pages/react/Tabs.tsx +12 -12
  104. package/examples/pages/react/TimePicker.tsx +4 -4
  105. package/examples/pages/react/Toasts.tsx +44 -56
  106. package/examples/pages/react/Togglebox.tsx +51 -0
  107. package/examples/pages/react/Tooltips.tsx +48 -4
  108. package/package.json +2 -2
  109. package/patches/@superdesk+primereact+5.0.2-4.patch +13 -0
  110. package/react/components/Button.d.ts +1 -1
  111. package/react/components/Button.js +2 -1
  112. package/react/components/DropdownFirst.js +1 -1
  113. package/react/components/IconPicker.d.ts +24 -0
  114. package/react/components/IconPicker.js +283 -0
  115. package/react/components/ListItemLoader.d.ts +4 -0
  116. package/react/components/ListItemLoader.js +62 -0
  117. package/react/components/Menu.d.ts +59 -0
  118. package/react/components/Menu.js +92 -0
  119. package/react/components/PropsList.d.ts +1 -1
  120. package/react/components/PropsList.js +1 -1
  121. package/react/components/Radio.d.ts +8 -7
  122. package/react/components/Radio.js +1 -1
  123. package/react/components/SelectGrid.d.ts +45 -0
  124. package/react/components/SelectGrid.js +179 -0
  125. package/react/components/SelectWithTemplate.js +0 -1
  126. package/react/components/Skeleton.d.ts +30 -0
  127. package/react/components/Skeleton.js +55 -0
  128. package/react/components/Toast.d.ts +15 -0
  129. package/react/components/Toast.js +69 -0
  130. package/react/components/ToastMessage.d.ts +18 -0
  131. package/react/components/ToastMessage.js +66 -0
  132. package/react/components/ToastText.d.ts +9 -0
  133. package/react/components/ToastText.js +42 -0
  134. package/react/components/ToastWrapper.d.ts +31 -0
  135. package/react/components/ToastWrapper.js +116 -0
  136. package/react/components/Togglebox.d.ts +27 -0
  137. package/react/components/Togglebox.js +76 -0
  138. package/react/components/Tooltip.d.ts +2 -5
  139. package/react/components/Tooltip.js +48 -7
  140. package/react/index.d.ts +7 -0
  141. package/react/index.js +14 -0
@@ -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: any;
9
- value2: any;
10
- value3: any;
11
- value4: any;
12
- value5: any;
13
- value6: any;
14
- value7: any;
15
- value8: any;
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: true,
24
- value2: true,
25
- value3: true,
26
- value4: true,
27
- value5: true,
28
- value6: true,
29
- value7: true,
30
- value8: true,
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' isRequered={true} type='T' default='/' description='The value of the checked button.'/>
372
- <Prop name='options' isRequered={true} type='Array' default='/' description='Array of Radio options.'/>
373
- <Prop name='options label' isRequered={true} type='string' default='/' description='Label text value for Radio.'/>
374
- <Prop name='options value' isRequered={true} type='T' default='/' description='Value of the Radio.'/>
375
- <Prop name='options disabled' isRequered={false} type='boolean' default='false' description='Disables the Radio, preventing mouse events.'/>
376
- <Prop name='labelSide' isRequered={false} type='left | right' default='right' description='Position of label relative to the button.'/>
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' isRequered={true} type='any' default='/' description='The value of the checked button.'/>
381
- <Prop name='options' isRequered={true} type='Array<option>' default='/' description='Array of RadioButton options.'/>
382
- <Prop name='option label' isRequered={true} type='string' default='/' description='Label text value for RadioButton.'/>
383
- <Prop name='option value' isRequered={true} type='any' default='/' description='Value of the Radio.'/>
384
- <Prop name='option disabled' isRequered={false} type='boolean' default='false' description='Disables the Radio, preventing mouse events.'/>
385
- <Prop name='option labelHidden' isRequered={false} type='boolean' default='false' description='Hides visually the label and adds an aria-label for screen-reader support.'/>
386
- <Prop name='option icon' isRequered={false} type='string' default='/' description='Icon class name without the icon- part.'/>
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 &#x3C;button /&#x3E; 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;
@@ -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' isRequered={false} type='string' default='/' description='Item value' />
86
- <Prop name='label' isRequered={false} type='string' default='/' description='Input label' />
87
- <Prop name='info' isRequered={false} type='string' default='/' description='Hint text' />
88
- <Prop name='error' isRequered={false} type='string' default='/' description='Error text' />
89
- <Prop name='inlineLabel' isRequered={false} type='boolean' default='false' description='Position labels as inline' />
90
- <Prop name='required' isRequered={false} type='boolean' default='false' description='Mark field as required' />
91
- <Prop name='disabled' isRequered={false} type='boolean' default='false' description='Mark field as disabled' />
92
- <Prop name='invalid' isRequered={false} type='boolean' default='false' description='Mark field as 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
  )
@@ -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' isRequered={true} type='string' default='/' description='Label text value.'/>
144
- <Prop name='label side' isRequered={false} type='left | right' default='right' description='Position of label relative to the button.'/>
145
- <Prop name='disabled' isRequered={false} type='boolean' default='false' description='The disabled state of t.'/>
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' isRequered={false} type='vertical | horizontal' default='vertical' description='Orientation of Switch components inside the group.'/>
150
- <Prop name='align' isRequered={false} type='left | right' default='left' description='Alignment of Switch components inside the group.'/>
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' isRequered={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
194
- <Prop name='tablist theme' isRequered={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
195
- <Prop name='tab label' isRequered={false} type='string' default='/' description='Text value of 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' isRequered={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
201
- <Prop name='tabs theme' isRequered={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
202
- <Prop name='tabs ariaLabel' isRequered={false} type='string' default='/' description='Text value of aria-label'/>
203
- <Prop name='tabs onClick' isRequered={true} type='function' default='/' description='Use to return value of clicked label'/>
204
- <Prop name='tablabel indexValue' isRequered={true} type='number' default='/' description='Index value of label'/>
205
- <Prop name='tablabel label' isRequered={true} type='string' default='/' description='Text value of Tab 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' isRequered={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
208
- <Prop name='tabcontent activePanel' isRequered={true} type='number' default='/' description='Index value of active Tab'/>
209
- <Prop name='tabpanel indexValue' isRequered={true} type='number' default='/' description='Index value of Tab Panel'/>
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' isRequered={true} type='string' default='/' description='Item value' />
71
- <Prop name='required' isRequered={false} type='boolean' default='false' description='Mark field as required' />
72
- <Prop name='disabled' isRequered={false} type='boolean' default='false' description='Mark field as 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' isRequered={true} type='function' default='/' description='Returns value of time input' />
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 { Toasted } from '../../../app-typescript/components/Toast';
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
- this.toast.notify("I'm a tasty default Toast message!", {});
10
+ toasted.notify("I'm a tasty default Toast message!", {position: 'top'});
13
11
  }
14
12
 
15
13
  // all positions
16
14
  showAll = () => {
17
- this.toast.notify('Position top', { position: 'top' });
18
- this.toast.notify('Position top-left', { position: 'top-left' });
19
- this.toast.notify('Position top-right', { position: 'top-right' });
20
- this.toast.notify('Position bottom', { position: 'bottom' });
21
- this.toast.notify('Position bottom-left', { position: 'bottom-left' });
22
- this.toast.notify('Position bottom-right', { position: 'bottom-right' });
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
- this.toast.notify("Curabitur blandit tempus porttitor.", { duration: 3000 });
25
+ toasted.notify("Curabitur blandit tempus porttitor.", { duration: 3000 });
28
26
  }
29
27
  showNull = () => {
30
- this.toast.notify("Curabitur blandit tempus porttitor.", {});
28
+ toasted.notify("Curabitur blandit tempus porttitor.", {});
31
29
  }
32
30
 
33
31
  // coloring and icon
34
32
  showSuccess = () => {
35
- this.toast.notify("I'm a tasty default Toast message!", { type: 'success', icon: 'ok'});
33
+ toasted.notify("I'm a tasty default Toast message!", { type: 'success', icon: 'ok'});
36
34
  }
37
35
  showAlert = () => {
38
- this.toast.notify("Danger! Condimentum ridiculus ultricies ornare mollis.", { type: 'alert', icon: 'exclamation-sign', position: 'bottom'});
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
- this.toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-s' });
41
+ toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-s' });
44
42
  }
45
43
  showSizeM = () => {
46
- this.toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-m' });
44
+ toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-m' });
47
45
  }
48
46
  showSizeL = () => {
49
- this.toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-l' });
47
+ toasted.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-l' });
50
48
  }
51
49
  showSizeXL = () => {
52
- this.toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-xl' });
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
- this.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' });
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
- this.toast.notify(
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
- const toast = new Toasted();
78
+ import {toasted} from 'superdesk-ui-framework/react';
81
79
 
82
- toast.notify("I'm a tasty default Toast message!", {});
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
- const toast = new Toasted();
97
-
98
- toast.notify("I'm a tasty default Toast message!", {});
99
-
100
- toast.notify('Position top', { position: 'top' });
101
- toast.notify('Position top-left', { position: 'top-left' });
102
- toast.notify('Position top-right', { position: 'top-right' });
103
- toast.notify('Position bottom', { position: 'bottom' });
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
- const toast = new Toasted();
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
- const toast = new Toasted();
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
- const toast = new Toasted();
162
-
163
- toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-s' });
164
- toast.notify("Et harum quidem rerum facilis est et expedita distinctio.", { position: 'top-left', size: 'fixed-m' });
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
- const toast = new Toasted();
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' isRequered={true} type='string | React.ReactNode' default='normal' description='Message value or custom message element'/>
204
- <Prop name='icon' isRequered={false} type='string' default='' description='Icon class name without the icon- part.'/>
205
- <Prop name='type' isRequered={false} type='default | primary | success | warning | alert | highlight | light' default='default' description='Default + semantic colour variations (e.g. primary, success etc.).'/>
206
- <Prop name='position' isRequered={false} type='top | bottom | top-right | top-left | bottom-right | bottom-left' default='top' description='Position of the toast'/>
207
- <Prop name='size' isRequered={false} type='fixed-s | fixed-m | fixed-l | fixed-xl' default='normal' description='Specifies a different sizes of toast.'/>
208
- <Prop name='duration' isRequered={false} type='number | null' default='null' description='Specifies a duration time of toast.'/>
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;