@performant-software/semantic-components 0.5.1
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/LICENSE +21 -0
- package/README.md +0 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -0
- package/build/main.css +786 -0
- package/index.js +1 -0
- package/package.json +37 -0
- package/src/components/AccordionDataList.css +8 -0
- package/src/components/AccordionDataList.js +224 -0
- package/src/components/AccordionList.css +27 -0
- package/src/components/AccordionList.js +596 -0
- package/src/components/AccordionSelector.css +3 -0
- package/src/components/AccordionSelector.js +359 -0
- package/src/components/ArrowButtons.css +4 -0
- package/src/components/ArrowButtons.js +38 -0
- package/src/components/AssociatedDropdown.css +44 -0
- package/src/components/AssociatedDropdown.js +338 -0
- package/src/components/BooleanIcon.css +0 -0
- package/src/components/BooleanIcon.js +33 -0
- package/src/components/CancelButton.css +0 -0
- package/src/components/CancelButton.js +25 -0
- package/src/components/ColorButton.css +4 -0
- package/src/components/ColorButton.js +34 -0
- package/src/components/ColorPickerModal.css +3 -0
- package/src/components/ColorPickerModal.js +77 -0
- package/src/components/ColumnResize.css +9 -0
- package/src/components/ColumnResize.js +20 -0
- package/src/components/DataList.css +0 -0
- package/src/components/DataList.js +531 -0
- package/src/components/DataTable.css +43 -0
- package/src/components/DataTable.js +596 -0
- package/src/components/DataTableColumnSelector.css +10 -0
- package/src/components/DataTableColumnSelector.js +146 -0
- package/src/components/DateInput.css +6 -0
- package/src/components/DateInput.js +58 -0
- package/src/components/DatePicker.css +72 -0
- package/src/components/DatePicker.js +81 -0
- package/src/components/DescriptorField.css +0 -0
- package/src/components/DescriptorField.js +42 -0
- package/src/components/DownloadButton.css +0 -0
- package/src/components/DownloadButton.js +23 -0
- package/src/components/Draggable.css +0 -0
- package/src/components/Draggable.js +94 -0
- package/src/components/DropdownButton.css +3 -0
- package/src/components/DropdownButton.js +65 -0
- package/src/components/DropdownMenu.css +0 -0
- package/src/components/DropdownMenu.js +68 -0
- package/src/components/EditModal.css +8 -0
- package/src/components/EditModal.js +99 -0
- package/src/components/EditPage.css +7 -0
- package/src/components/EditPage.js +249 -0
- package/src/components/EmbeddedList.css +7 -0
- package/src/components/EmbeddedList.js +278 -0
- package/src/components/FileInputButton.css +0 -0
- package/src/components/FileInputButton.js +54 -0
- package/src/components/FileUpload.css +31 -0
- package/src/components/FileUpload.js +188 -0
- package/src/components/FileUploadModal.css +0 -0
- package/src/components/FileUploadModal.js +408 -0
- package/src/components/FuzzyDate.css +8 -0
- package/src/components/FuzzyDate.js +575 -0
- package/src/components/GoogleMap.css +0 -0
- package/src/components/GoogleMap.js +105 -0
- package/src/components/GooglePlacesSearch.css +0 -0
- package/src/components/GooglePlacesSearch.js +43 -0
- package/src/components/HorizontalCards.css +50 -0
- package/src/components/HorizontalCards.js +226 -0
- package/src/components/ItemCollection.css +3 -0
- package/src/components/ItemCollection.js +159 -0
- package/src/components/ItemList.css +0 -0
- package/src/components/ItemList.js +126 -0
- package/src/components/Items.css +19 -0
- package/src/components/Items.js +365 -0
- package/src/components/ItemsToggle.css +0 -0
- package/src/components/ItemsToggle.js +168 -0
- package/src/components/KeyboardField.css +4 -0
- package/src/components/KeyboardField.js +147 -0
- package/src/components/LazyDocument.css +21 -0
- package/src/components/LazyDocument.js +113 -0
- package/src/components/LazyImage.css +21 -0
- package/src/components/LazyImage.js +119 -0
- package/src/components/LazyVideo.css +21 -0
- package/src/components/LazyVideo.js +131 -0
- package/src/components/LinkButton.css +8 -0
- package/src/components/LinkButton.js +23 -0
- package/src/components/LinkLabel.css +8 -0
- package/src/components/LinkLabel.js +29 -0
- package/src/components/List.css +8 -0
- package/src/components/List.js +761 -0
- package/src/components/ListFilters.css +0 -0
- package/src/components/ListFilters.js +408 -0
- package/src/components/ListLoader.css +8 -0
- package/src/components/ListLoader.js +32 -0
- package/src/components/ListTable.css +3 -0
- package/src/components/ListTable.js +86 -0
- package/src/components/LoginModal.css +7 -0
- package/src/components/LoginModal.js +102 -0
- package/src/components/MasonryGrid.css +48 -0
- package/src/components/MasonryGrid.js +202 -0
- package/src/components/MediaGallery.css +37 -0
- package/src/components/MediaGallery.js +148 -0
- package/src/components/MediaGrid.css +72 -0
- package/src/components/MediaGrid.js +74 -0
- package/src/components/MediaList.css +3 -0
- package/src/components/MediaList.js +98 -0
- package/src/components/ModalDropdown.css +11 -0
- package/src/components/ModalDropdown.js +84 -0
- package/src/components/NestedAccordion.css +41 -0
- package/src/components/NestedAccordion.js +276 -0
- package/src/components/PhotoViewer.css +3 -0
- package/src/components/PhotoViewer.js +36 -0
- package/src/components/PlayButton.css +3 -0
- package/src/components/PlayButton.js +37 -0
- package/src/components/RemoteDropdown.css +13 -0
- package/src/components/RemoteDropdown.js +368 -0
- package/src/components/SaveButton.css +0 -0
- package/src/components/SaveButton.js +31 -0
- package/src/components/Section.css +0 -0
- package/src/components/Section.js +41 -0
- package/src/components/Selectize.css +11 -0
- package/src/components/Selectize.js +297 -0
- package/src/components/SelectizeHeader.css +3 -0
- package/src/components/SelectizeHeader.js +40 -0
- package/src/components/TabbedModal.css +14 -0
- package/src/components/TabbedModal.js +165 -0
- package/src/components/TabsMenu.css +0 -0
- package/src/components/TabsMenu.js +35 -0
- package/src/components/TagsList.css +0 -0
- package/src/components/TagsList.js +43 -0
- package/src/components/Thumbnail.css +0 -0
- package/src/components/Thumbnail.js +47 -0
- package/src/components/Toaster.css +9 -0
- package/src/components/Toaster.js +73 -0
- package/src/components/VideoFrameSelector.css +3 -0
- package/src/components/VideoFrameSelector.js +148 -0
- package/src/components/VideoPlayer.css +3 -0
- package/src/components/VideoPlayer.js +55 -0
- package/src/components/VideoPlayerButton.css +17 -0
- package/src/components/VideoPlayerButton.js +17 -0
- package/src/components/ViewXML.css +0 -0
- package/src/components/ViewXML.js +72 -0
- package/src/i18n/en.json +204 -0
- package/src/i18n/i18n.js +24 -0
- package/src/index.js +76 -0
- package/types/components/AccordionDataList.js.flow +224 -0
- package/types/components/AccordionList.js.flow +596 -0
- package/types/components/AccordionSelector.js.flow +359 -0
- package/types/components/ArrowButtons.js.flow +38 -0
- package/types/components/AssociatedDropdown.js.flow +338 -0
- package/types/components/BooleanIcon.js.flow +33 -0
- package/types/components/CancelButton.js.flow +25 -0
- package/types/components/ColorButton.js.flow +34 -0
- package/types/components/ColorPickerModal.js.flow +77 -0
- package/types/components/ColumnResize.js.flow +20 -0
- package/types/components/DataList.js.flow +531 -0
- package/types/components/DataTable.js.flow +596 -0
- package/types/components/DataTableColumnSelector.js.flow +146 -0
- package/types/components/DataView.js.flow +125 -0
- package/types/components/DateInput.js.flow +58 -0
- package/types/components/DatePicker.js.flow +81 -0
- package/types/components/DescriptorField.js.flow +42 -0
- package/types/components/DownloadButton.js.flow +23 -0
- package/types/components/Draggable.js.flow +94 -0
- package/types/components/DropdownButton.js.flow +65 -0
- package/types/components/DropdownMenu.js.flow +68 -0
- package/types/components/EditModal.js.flow +99 -0
- package/types/components/EditPage.js.flow +249 -0
- package/types/components/EmbeddedList.js.flow +278 -0
- package/types/components/FileInputButton.js.flow +54 -0
- package/types/components/FileUpload.js.flow +188 -0
- package/types/components/FileUploadModal.js.flow +408 -0
- package/types/components/FuzzyDate.js.flow +575 -0
- package/types/components/GoogleMap.js.flow +105 -0
- package/types/components/GooglePlacesSearch.js.flow +43 -0
- package/types/components/HorizontalCards.js.flow +226 -0
- package/types/components/ItemCollection.js.flow +159 -0
- package/types/components/ItemList.js.flow +126 -0
- package/types/components/Items.js.flow +365 -0
- package/types/components/ItemsToggle.js.flow +168 -0
- package/types/components/KeyboardField.js.flow +147 -0
- package/types/components/LazyDocument.js.flow +113 -0
- package/types/components/LazyImage.js.flow +119 -0
- package/types/components/LazyVideo.js.flow +131 -0
- package/types/components/LinkButton.js.flow +23 -0
- package/types/components/LinkLabel.js.flow +29 -0
- package/types/components/List.js.flow +761 -0
- package/types/components/ListFilters.js.flow +408 -0
- package/types/components/ListLoader.js.flow +32 -0
- package/types/components/ListTable.js.flow +86 -0
- package/types/components/LoginModal.js.flow +102 -0
- package/types/components/MasonryGrid.js.flow +202 -0
- package/types/components/MediaGallery.js.flow +148 -0
- package/types/components/MediaGrid.js.flow +74 -0
- package/types/components/MediaList.js.flow +98 -0
- package/types/components/MenuBar.js.flow +77 -0
- package/types/components/MenuSidebar.js.flow +72 -0
- package/types/components/ModalDropdown.js.flow +84 -0
- package/types/components/NestedAccordion.js.flow +276 -0
- package/types/components/PhotoViewer.js.flow +36 -0
- package/types/components/PlayButton.js.flow +37 -0
- package/types/components/RemoteDropdown.js.flow +368 -0
- package/types/components/SaveButton.js.flow +31 -0
- package/types/components/Section.js.flow +41 -0
- package/types/components/Selectize.js.flow +297 -0
- package/types/components/SelectizeHeader.js.flow +40 -0
- package/types/components/TabbedModal.js.flow +165 -0
- package/types/components/TabsMenu.js.flow +35 -0
- package/types/components/TagsList.js.flow +43 -0
- package/types/components/Thumbnail.js.flow +47 -0
- package/types/components/Toaster.js.flow +73 -0
- package/types/components/VideoFrameSelector.js.flow +148 -0
- package/types/components/VideoPlayer.js.flow +55 -0
- package/types/components/VideoPlayerButton.js.flow +17 -0
- package/types/components/ViewXML.js.flow +72 -0
- package/types/hooks/Imageable.js.flow +54 -0
- package/types/i18n/i18n.js.flow +24 -0
- package/types/index.js.flow +78 -0
- package/webpack.config.js +3 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React, { useState, type Node } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
Dimmer,
|
|
6
|
+
Icon,
|
|
7
|
+
Image,
|
|
8
|
+
Loader,
|
|
9
|
+
Segment,
|
|
10
|
+
Transition,
|
|
11
|
+
Visibility
|
|
12
|
+
} from 'semantic-ui-react';
|
|
13
|
+
import i18n from '../i18n/i18n';
|
|
14
|
+
import DownloadButton from './DownloadButton';
|
|
15
|
+
import './LazyDocument.css';
|
|
16
|
+
|
|
17
|
+
type Props = {
|
|
18
|
+
children?: Node,
|
|
19
|
+
dimmable?: boolean,
|
|
20
|
+
duration?: number,
|
|
21
|
+
image?: any,
|
|
22
|
+
preview?: ?string,
|
|
23
|
+
size?: string,
|
|
24
|
+
src?: string
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const LazyDocument = (props: Props) => {
|
|
28
|
+
const [visible, setVisible] = useState(false);
|
|
29
|
+
const [dimmer, setDimmer] = useState(false);
|
|
30
|
+
|
|
31
|
+
if (!visible) {
|
|
32
|
+
return (
|
|
33
|
+
<Visibility
|
|
34
|
+
as='span'
|
|
35
|
+
fireOnMount
|
|
36
|
+
onTopVisible={() => setVisible(true)}
|
|
37
|
+
>
|
|
38
|
+
<Loader
|
|
39
|
+
active
|
|
40
|
+
inline='centered'
|
|
41
|
+
size={props.size}
|
|
42
|
+
/>
|
|
43
|
+
</Visibility>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<Transition
|
|
50
|
+
duration={props.duration}
|
|
51
|
+
visible
|
|
52
|
+
>
|
|
53
|
+
<Dimmer.Dimmable
|
|
54
|
+
as={Segment}
|
|
55
|
+
className='lazy-document'
|
|
56
|
+
compact
|
|
57
|
+
onBlur={() => setDimmer(false)}
|
|
58
|
+
onMouseEnter={() => setDimmer(true)}
|
|
59
|
+
onMouseLeave={() => setDimmer(false)}
|
|
60
|
+
>
|
|
61
|
+
{ props.preview && (
|
|
62
|
+
<Image
|
|
63
|
+
{...props.image}
|
|
64
|
+
src={props.preview}
|
|
65
|
+
size={props.size}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
{ !props.preview && (
|
|
69
|
+
<Image
|
|
70
|
+
{...props.image}
|
|
71
|
+
className='placeholder-image'
|
|
72
|
+
size={props.size}
|
|
73
|
+
>
|
|
74
|
+
<Icon
|
|
75
|
+
name='file alternate outline'
|
|
76
|
+
size='big'
|
|
77
|
+
/>
|
|
78
|
+
</Image>
|
|
79
|
+
)}
|
|
80
|
+
{ (props.src || props.children) && props.dimmable && (
|
|
81
|
+
<Dimmer
|
|
82
|
+
active={dimmer}
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
className='buttons'
|
|
86
|
+
>
|
|
87
|
+
{ props.src && (
|
|
88
|
+
<DownloadButton
|
|
89
|
+
content={i18n.t('LazyDocument.buttons.download')}
|
|
90
|
+
icon='cloud download'
|
|
91
|
+
primary
|
|
92
|
+
url={props.src || ''}
|
|
93
|
+
/>
|
|
94
|
+
)}
|
|
95
|
+
{ props.children }
|
|
96
|
+
</div>
|
|
97
|
+
</Dimmer>
|
|
98
|
+
)}
|
|
99
|
+
</Dimmer.Dimmable>
|
|
100
|
+
</Transition>
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
LazyDocument.defaultProps = {
|
|
106
|
+
dimmable: true,
|
|
107
|
+
duration: 1000,
|
|
108
|
+
preview: undefined,
|
|
109
|
+
size: 'medium',
|
|
110
|
+
src: undefined
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default LazyDocument;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React, { useState, type Node } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Dimmer,
|
|
7
|
+
Icon,
|
|
8
|
+
Image,
|
|
9
|
+
Loader,
|
|
10
|
+
Segment,
|
|
11
|
+
Transition,
|
|
12
|
+
Visibility
|
|
13
|
+
} from 'semantic-ui-react';
|
|
14
|
+
import i18n from '../i18n/i18n';
|
|
15
|
+
import PhotoViewer from './PhotoViewer';
|
|
16
|
+
import './LazyImage.css';
|
|
17
|
+
|
|
18
|
+
type Props = {
|
|
19
|
+
children?: Node,
|
|
20
|
+
dimmable: boolean,
|
|
21
|
+
duration?: number,
|
|
22
|
+
image?: any,
|
|
23
|
+
preview?: string,
|
|
24
|
+
size?: string,
|
|
25
|
+
src?: string
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const LazyImage = (props: Props) => {
|
|
29
|
+
const [visible, setVisible] = useState(false);
|
|
30
|
+
const [modal, setModal] = useState(false);
|
|
31
|
+
const [dimmer, setDimmer] = useState(false);
|
|
32
|
+
|
|
33
|
+
if (!visible) {
|
|
34
|
+
return (
|
|
35
|
+
<Visibility
|
|
36
|
+
as='span'
|
|
37
|
+
fireOnMount
|
|
38
|
+
onTopVisible={() => setVisible(true)}
|
|
39
|
+
>
|
|
40
|
+
<Loader
|
|
41
|
+
active
|
|
42
|
+
inline='centered'
|
|
43
|
+
size={props.size}
|
|
44
|
+
/>
|
|
45
|
+
</Visibility>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Transition
|
|
52
|
+
duration={props.duration}
|
|
53
|
+
visible
|
|
54
|
+
>
|
|
55
|
+
<Dimmer.Dimmable
|
|
56
|
+
as={Segment}
|
|
57
|
+
className='lazy-image'
|
|
58
|
+
compact
|
|
59
|
+
onBlur={() => setDimmer(false)}
|
|
60
|
+
onMouseEnter={() => setDimmer(true)}
|
|
61
|
+
onMouseLeave={() => setDimmer(false)}
|
|
62
|
+
>
|
|
63
|
+
{ props.src && (
|
|
64
|
+
<Image
|
|
65
|
+
{...props.image}
|
|
66
|
+
size={props.size}
|
|
67
|
+
src={props.preview || props.src}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
{ !props.src && (
|
|
71
|
+
<Image
|
|
72
|
+
{...props.image}
|
|
73
|
+
className='placeholder-image'
|
|
74
|
+
size={props.size}
|
|
75
|
+
>
|
|
76
|
+
<Icon
|
|
77
|
+
name='image'
|
|
78
|
+
size='big'
|
|
79
|
+
/>
|
|
80
|
+
</Image>
|
|
81
|
+
)}
|
|
82
|
+
{ (props.src || props.children) && props.dimmable && (
|
|
83
|
+
<Dimmer
|
|
84
|
+
active={dimmer}
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
className='buttons'
|
|
88
|
+
>
|
|
89
|
+
{ props.src && (
|
|
90
|
+
<Button
|
|
91
|
+
content={i18n.t('LazyImage.buttons.view')}
|
|
92
|
+
icon='photo'
|
|
93
|
+
onClick={() => setModal(true)}
|
|
94
|
+
primary
|
|
95
|
+
/>
|
|
96
|
+
)}
|
|
97
|
+
{ props.children }
|
|
98
|
+
</div>
|
|
99
|
+
</Dimmer>
|
|
100
|
+
)}
|
|
101
|
+
</Dimmer.Dimmable>
|
|
102
|
+
</Transition>
|
|
103
|
+
<PhotoViewer
|
|
104
|
+
image={props.src || ''}
|
|
105
|
+
onClose={() => setModal(false)}
|
|
106
|
+
open={modal}
|
|
107
|
+
size='large'
|
|
108
|
+
/>
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
LazyImage.defaultProps = {
|
|
114
|
+
dimmable: true,
|
|
115
|
+
duration: 1000,
|
|
116
|
+
size: 'medium'
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default LazyImage;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React, { useState, type Element, type Node } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Dimmer,
|
|
7
|
+
Icon,
|
|
8
|
+
Image,
|
|
9
|
+
Loader,
|
|
10
|
+
Segment,
|
|
11
|
+
Transition,
|
|
12
|
+
Visibility
|
|
13
|
+
} from 'semantic-ui-react';
|
|
14
|
+
import i18n from '../i18n/i18n';
|
|
15
|
+
import VideoPlayer from './VideoPlayer';
|
|
16
|
+
import './LazyVideo.css';
|
|
17
|
+
|
|
18
|
+
type Props = {
|
|
19
|
+
autoPlay?: boolean,
|
|
20
|
+
children?: Node,
|
|
21
|
+
dimmable: boolean,
|
|
22
|
+
duration?: number,
|
|
23
|
+
embedded?: boolean,
|
|
24
|
+
icon?: string | Element<any>,
|
|
25
|
+
image?: any,
|
|
26
|
+
preview?: ?string,
|
|
27
|
+
size?: string,
|
|
28
|
+
src?: string
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const LazyVideo = (props: Props) => {
|
|
32
|
+
const [visible, setVisible] = useState(false);
|
|
33
|
+
const [modal, setModal] = useState(false);
|
|
34
|
+
const [dimmer, setDimmer] = useState(false);
|
|
35
|
+
|
|
36
|
+
if (!visible) {
|
|
37
|
+
return (
|
|
38
|
+
<Visibility
|
|
39
|
+
as='span'
|
|
40
|
+
fireOnMount
|
|
41
|
+
onTopVisible={() => setVisible(true)}
|
|
42
|
+
>
|
|
43
|
+
<Loader
|
|
44
|
+
active
|
|
45
|
+
inline='centered'
|
|
46
|
+
size={props.size}
|
|
47
|
+
/>
|
|
48
|
+
</Visibility>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
<Transition
|
|
55
|
+
duration={props.duration}
|
|
56
|
+
visible
|
|
57
|
+
>
|
|
58
|
+
<Dimmer.Dimmable
|
|
59
|
+
as={Segment}
|
|
60
|
+
className='lazy-video'
|
|
61
|
+
compact
|
|
62
|
+
onBlur={() => setDimmer(false)}
|
|
63
|
+
onMouseEnter={() => setDimmer(true)}
|
|
64
|
+
onMouseLeave={() => setDimmer(false)}
|
|
65
|
+
>
|
|
66
|
+
{ props.preview && (
|
|
67
|
+
<Image
|
|
68
|
+
{...props.image}
|
|
69
|
+
src={props.preview}
|
|
70
|
+
size={props.size}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
{ !props.preview && (
|
|
74
|
+
<Image
|
|
75
|
+
{...props.image}
|
|
76
|
+
className='placeholder-image'
|
|
77
|
+
size={props.size}
|
|
78
|
+
>
|
|
79
|
+
<Icon
|
|
80
|
+
name='image'
|
|
81
|
+
size='big'
|
|
82
|
+
/>
|
|
83
|
+
</Image>
|
|
84
|
+
)}
|
|
85
|
+
{ (props.src || props.children) && props.dimmable && (
|
|
86
|
+
<Dimmer
|
|
87
|
+
active={dimmer}
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
className='buttons'
|
|
91
|
+
>
|
|
92
|
+
{ props.src && (
|
|
93
|
+
<Button
|
|
94
|
+
content={i18n.t('LazyVideo.buttons.play')}
|
|
95
|
+
icon='video'
|
|
96
|
+
onClick={() => setModal(true)}
|
|
97
|
+
primary
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
{ props.children }
|
|
101
|
+
</div>
|
|
102
|
+
</Dimmer>
|
|
103
|
+
)}
|
|
104
|
+
</Dimmer.Dimmable>
|
|
105
|
+
</Transition>
|
|
106
|
+
{ props.src && (
|
|
107
|
+
<VideoPlayer
|
|
108
|
+
autoPlay={props.autoPlay}
|
|
109
|
+
embedded={props.embedded}
|
|
110
|
+
icon={props.icon}
|
|
111
|
+
onClose={() => setModal(false)}
|
|
112
|
+
open={modal}
|
|
113
|
+
placeholder={props.preview}
|
|
114
|
+
size='large'
|
|
115
|
+
video={props.src}
|
|
116
|
+
/>
|
|
117
|
+
)}
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
LazyVideo.defaultProps = {
|
|
123
|
+
autoPlay: false,
|
|
124
|
+
dimmable: true,
|
|
125
|
+
duration: 1000,
|
|
126
|
+
embedded: false,
|
|
127
|
+
icon: 'right circle arrow',
|
|
128
|
+
size: 'medium'
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default LazyVideo;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Button } from 'semantic-ui-react';
|
|
5
|
+
import './LinkButton.css';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
content: string,
|
|
9
|
+
onClick: () => void
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const LinkButton = (props: Props) => (
|
|
13
|
+
<Button
|
|
14
|
+
basic
|
|
15
|
+
className='link-button'
|
|
16
|
+
compact
|
|
17
|
+
content={props.content}
|
|
18
|
+
onClick={props.onClick.bind(this)}
|
|
19
|
+
type='button'
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default LinkButton;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import LinkButton from './LinkButton';
|
|
5
|
+
import './LinkLabel.css';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
content: string,
|
|
9
|
+
htmlFor: string,
|
|
10
|
+
label: string,
|
|
11
|
+
onClick: () => void
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const LinkLabel = (props: Props) => (
|
|
15
|
+
<>
|
|
16
|
+
<label
|
|
17
|
+
className='link-label'
|
|
18
|
+
htmlFor={props.htmlFor}
|
|
19
|
+
>
|
|
20
|
+
{ props.label }
|
|
21
|
+
</label>
|
|
22
|
+
<LinkButton
|
|
23
|
+
content={props.content}
|
|
24
|
+
onClick={props.onClick.bind(this)}
|
|
25
|
+
/>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default LinkLabel;
|