nitro_sg 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/components/Avatar/Avatar.jsx +96 -0
- data/components/Avatar/styles.scss +54 -0
- data/components/Avatar/styles.scss.flow +14 -0
- data/components/Badge/Badge.jsx +40 -0
- data/components/Badge/badges.scss +167 -0
- data/components/Badge/labels.scss +121 -0
- data/components/Badge/styles.scss +4 -0
- data/components/Badge/styles.scss.flow +38 -0
- data/components/Banner/Banner.jsx +54 -0
- data/components/Banner/styles.scss +75 -0
- data/components/Banner/styles.scss.flow +19 -0
- data/components/Button/Button.jsx +75 -0
- data/components/Card/Card.jsx +44 -0
- data/components/CircleButton/CircleButton.jsx +51 -0
- data/components/CircleButton/CircleButtonStory.jsx +25 -0
- data/components/CircleButton/styles.scss +33 -0
- data/components/CircleButton/styles.scss.flow +6 -0
- data/components/CollapsibleCard/CollapsibleCard.jsx +108 -0
- data/components/Color/Color.jsx +55 -0
- data/components/Color/styles.scss +6 -0
- data/components/Color/styles.scss.flow +5 -0
- data/components/ColorPickerInput/ColorPickerInput.jsx +99 -0
- data/components/ColorPickerInput/colorPickerInput.scss +10 -0
- data/components/ColorPickerInput/colorPickerInput.scss.flow +6 -0
- data/components/DOBInput/index.jsx +35 -0
- data/components/DOBInput/story.jsx +20 -0
- data/components/DOBInput/styles.scss +11 -0
- data/components/DOBInput/styles.scss.flow +7 -0
- data/components/DatePicker/DatePicker.jsx +156 -0
- data/components/DatePicker/styles.scss +6 -0
- data/components/DatePicker/styles.scss.flow +5 -0
- data/components/DateTimePicker/DateTimePicker.jsx +109 -0
- data/components/DateTimePicker/story-styles.scss +3 -0
- data/components/DateTimePicker/story-styles.scss.flow +5 -0
- data/components/DateTimePicker/styles.scss +1 -0
- data/components/DateTimePicker/styles.scss.flow +5 -0
- data/components/Errors/Errors.jsx +38 -0
- data/components/FileCard/FileCard.jsx +183 -0
- data/components/FileCard/styles.scss +81 -0
- data/components/FileCard/styles.scss.flow +12 -0
- data/components/Flip/Flip.jsx +50 -0
- data/components/Flip/styles.scss +41 -0
- data/components/Flip/styles.scss.flow +11 -0
- data/components/FlyoutPanel/FlyoutPanel.jsx +34 -0
- data/components/FlyoutPanel/flyout_panel.scss +33 -0
- data/components/FlyoutPanel/flyout_panel.scss.flow +11 -0
- data/components/Grade/Grade.jsx +55 -0
- data/components/Grade/grade.scss +39 -0
- data/components/Grade/grade.scss.flow +6 -0
- data/components/Highlight/Highlight.jsx +39 -0
- data/components/Highlight/styles.scss +24 -0
- data/components/Highlight/styles.scss.flow +17 -0
- data/components/Icon/Icon.jsx +54 -0
- data/components/IconToggle/IconToggle.jsx +56 -0
- data/components/Milestones/MilestoneItem.jsx +47 -0
- data/components/Milestones/Milestones.jsx +51 -0
- data/components/Milestones/milestones.scss +19 -0
- data/components/Milestones/milestones.scss.flow +7 -0
- data/components/Milestones/milestones_item.scss +157 -0
- data/components/Milestones/milestones_item.scss.flow +13 -0
- data/components/Milestones/milestones_variables.scss +11 -0
- data/components/MonogramAvatar/MonogramAvatar.jsx +91 -0
- data/components/MonogramAvatar/monogram_avatar.scss +54 -0
- data/components/MonogramAvatar/monogram_avatar.scss.flow +10 -0
- data/components/Panel/Panel.jsx +159 -0
- data/components/Panel/panel.scss +32 -0
- data/components/Panel/panel.scss.flow +12 -0
- data/components/PanelGroup/PanelGroup.jsx +121 -0
- data/components/PanelGroup/PanelGroup.scss +96 -0
- data/components/PanelGroup/PanelGroup.scss.flow +6 -0
- data/components/SearchCollectionSelect/SearchCollectionSelect.jsx +29 -0
- data/components/SearchCollectionSelect/searchCollectionSelect.scss +0 -0
- data/components/Spinner/Spinner.jsx +80 -0
- data/components/Spinner/spinner.scss +6 -0
- data/components/Spinner/spinner.scss.flow +5 -0
- data/components/StepMeter/StepMeter.jsx +75 -0
- data/components/StepMeter/step_meter.scss +120 -0
- data/components/StepMeter/step_meter.scss.flow +9 -0
- data/components/Survey/Survey.jsx +190 -0
- data/components/Survey/survey.scss +75 -0
- data/components/Survey/survey.scss.flow +11 -0
- data/components/Tab/Tab.jsx +70 -0
- data/components/Tab/tab.scss +25 -0
- data/components/Tab/tab.scss.flow +6 -0
- data/components/TabList/TabList.jsx +35 -0
- data/components/TabList/tabList.scss +5 -0
- data/components/TabList/tabList.scss.flow +5 -0
- data/components/Text/Text.jsx +53 -0
- data/components/Text/styles.scss +3 -0
- data/components/Text/styles.scss.flow +123 -0
- data/components/Text/text.scss +35 -0
- data/components/TextInput/TextInput.jsx +95 -0
- data/components/TextInput/form-control.scss +96 -0
- data/components/TextInput/styles.scss +3 -0
- data/components/TextInput/styles.scss.flow +7 -0
- data/components/TimePicker/TimePicker.jsx +218 -0
- data/components/TimePicker/styles.scss +1 -0
- data/components/TimePicker/styles.scss.flow +5 -0
- data/components/ToggleButton/ToggleButton.jsx +68 -0
- data/components/ToggleButton/toggleButton.scss +70 -0
- data/components/ToggleButton/toggleButton.scss.flow +14 -0
- data/components/UserStamp/UserStamp.jsx +40 -0
- data/components/UserStamp/styles.scss +6 -0
- data/components/UserStamp/styles.scss.flow +7 -0
- data/components/Wip/Wip.jsx +34 -0
- data/components/index.js +33 -0
- data/components/types.js +21 -0
- data/lib/nitro_sg/version.rb +1 -1
- metadata +108 -1
@@ -0,0 +1 @@
|
|
1
|
+
.dateTimePicker {}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import { uniqueId } from 'lodash'
|
5
|
+
import { Alert } from 'react-bootstrap'
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Errors
|
9
|
+
* Displays the given {@messages} in a list format, inside a red alert box.
|
10
|
+
*
|
11
|
+
* @param {Array<String>} props.messages The error messages to be displayed
|
12
|
+
*/
|
13
|
+
|
14
|
+
type Props = {
|
15
|
+
messages: Array<string>,
|
16
|
+
}
|
17
|
+
|
18
|
+
export default class Errors extends React.Component<Props> {
|
19
|
+
static defaultProps = {
|
20
|
+
messages: ["Something went wong"]
|
21
|
+
}
|
22
|
+
props: Props
|
23
|
+
render() {
|
24
|
+
const { messages } = this.props
|
25
|
+
return (
|
26
|
+
<Alert
|
27
|
+
bsStyle="danger"
|
28
|
+
className="errors"
|
29
|
+
>
|
30
|
+
<ul>
|
31
|
+
{messages.map(m => (
|
32
|
+
<li key={uniqueId()}>{m}</li>
|
33
|
+
))}
|
34
|
+
</ul>
|
35
|
+
</Alert>
|
36
|
+
)
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,183 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React, { Component } from 'react'
|
4
|
+
import classnames from 'classnames'
|
5
|
+
|
6
|
+
import Icon from '../Icon/Icon'
|
7
|
+
import Panel from '../Panel/Panel'
|
8
|
+
import Text from '../Text/Text'
|
9
|
+
|
10
|
+
import { Popover, OverlayTrigger } from 'react-bootstrap'
|
11
|
+
|
12
|
+
import styles from './styles.scss'
|
13
|
+
|
14
|
+
type FileType = 'file-excel' | 'file-pdf' | 'file-word' | 'file-image' | 'file-powerpoint' | 'file-video' | 'file-text' | 'file-zip' | 'file-code' | 'file-sound' | 'file'
|
15
|
+
|
16
|
+
type Props = {
|
17
|
+
className: string,
|
18
|
+
description: string,
|
19
|
+
displayName: string,
|
20
|
+
downloadUrl: string,
|
21
|
+
layout: string,
|
22
|
+
openNewTab: boolean,
|
23
|
+
type: FileType,
|
24
|
+
hasProtection: boolean,
|
25
|
+
hasAccess: boolean,
|
26
|
+
children: Array<Component>
|
27
|
+
}
|
28
|
+
|
29
|
+
export default class FileCard extends React.Component<Props> {
|
30
|
+
static defaultProps = {
|
31
|
+
className: '',
|
32
|
+
layout: 'vertical',
|
33
|
+
openNewTab: false,
|
34
|
+
type: 'file',
|
35
|
+
hasProtection: false,
|
36
|
+
hasAccess: true,
|
37
|
+
}
|
38
|
+
props: Props
|
39
|
+
|
40
|
+
renderIcon() {
|
41
|
+
const {
|
42
|
+
downloadUrl,
|
43
|
+
openNewTab,
|
44
|
+
displayName,
|
45
|
+
type,
|
46
|
+
hasAccess,
|
47
|
+
} = this.props
|
48
|
+
const IconComponent = (
|
49
|
+
<Icon
|
50
|
+
className={styles[`icon-large`]}
|
51
|
+
label=''
|
52
|
+
name={`${type}`}
|
53
|
+
size='lg'
|
54
|
+
title={displayName}
|
55
|
+
/>
|
56
|
+
)
|
57
|
+
return (
|
58
|
+
<If condition={downloadUrl && hasAccess}>
|
59
|
+
<a
|
60
|
+
href={downloadUrl}
|
61
|
+
target={openNewTab ? '_blank' : '_parent'}
|
62
|
+
>
|
63
|
+
{IconComponent}
|
64
|
+
</a>
|
65
|
+
<Else/>
|
66
|
+
{IconComponent}
|
67
|
+
</If>
|
68
|
+
)
|
69
|
+
}
|
70
|
+
|
71
|
+
renderDisplayName() {
|
72
|
+
const {
|
73
|
+
displayName,
|
74
|
+
downloadUrl,
|
75
|
+
openNewTab
|
76
|
+
} = this.props
|
77
|
+
const DisplayNameComponent = (
|
78
|
+
<Text
|
79
|
+
bold='true'
|
80
|
+
color={'ink-light'}
|
81
|
+
>{displayName}</Text>
|
82
|
+
)
|
83
|
+
return (
|
84
|
+
<h5 className='m-0'>
|
85
|
+
<If condition={downloadUrl}>
|
86
|
+
<a
|
87
|
+
href={downloadUrl}
|
88
|
+
target={openNewTab ? '_blank' : '_parent'}
|
89
|
+
>
|
90
|
+
{DisplayNameComponent}
|
91
|
+
</a>
|
92
|
+
<Else/>
|
93
|
+
{DisplayNameComponent}
|
94
|
+
</If>
|
95
|
+
</h5>
|
96
|
+
)
|
97
|
+
}
|
98
|
+
|
99
|
+
renderDescription() {
|
100
|
+
const {
|
101
|
+
description
|
102
|
+
} = this.props
|
103
|
+
return (
|
104
|
+
<p className='m-0'>
|
105
|
+
<Text color={'ink-lighter'}>{description}</Text>
|
106
|
+
</p>
|
107
|
+
)
|
108
|
+
}
|
109
|
+
|
110
|
+
renderLockIcon() {
|
111
|
+
const { hasAccess, hasProtection } = this.props
|
112
|
+
const lock = hasAccess ? 'unlock' : 'lock'
|
113
|
+
|
114
|
+
if (!hasProtection) {
|
115
|
+
return null
|
116
|
+
}
|
117
|
+
|
118
|
+
const popoverPrivacy = (
|
119
|
+
<Popover id="privacy-protected">
|
120
|
+
{'Privacy Protected'}
|
121
|
+
</Popover>
|
122
|
+
);
|
123
|
+
|
124
|
+
if (hasAccess) {
|
125
|
+
return (
|
126
|
+
<div>
|
127
|
+
<Icon
|
128
|
+
name={lock}
|
129
|
+
size={'lg'}
|
130
|
+
/>
|
131
|
+
</div>
|
132
|
+
)
|
133
|
+
} else {
|
134
|
+
return (
|
135
|
+
<OverlayTrigger
|
136
|
+
overlay={popoverPrivacy}
|
137
|
+
placement="top"
|
138
|
+
trigger={['hover', 'focus']}
|
139
|
+
>
|
140
|
+
<div>
|
141
|
+
<Icon
|
142
|
+
name={lock}
|
143
|
+
size={'lg'}
|
144
|
+
/>
|
145
|
+
</div>
|
146
|
+
</OverlayTrigger>
|
147
|
+
)
|
148
|
+
}
|
149
|
+
|
150
|
+
}
|
151
|
+
|
152
|
+
render() {
|
153
|
+
const {
|
154
|
+
className,
|
155
|
+
description,
|
156
|
+
displayName,
|
157
|
+
layout,
|
158
|
+
children
|
159
|
+
} = this.props
|
160
|
+
const css = [
|
161
|
+
className,
|
162
|
+
styles['file-card'],
|
163
|
+
styles[`layout-${layout}`],
|
164
|
+
]
|
165
|
+
return (
|
166
|
+
<Panel bodyClass={'p-0'}>
|
167
|
+
<div className={classnames(css)}>
|
168
|
+
<div className={styles['lock']}>
|
169
|
+
{this.renderLockIcon()}
|
170
|
+
</div>
|
171
|
+
<div className={styles['file-type-box']}>
|
172
|
+
{this.renderIcon()}
|
173
|
+
</div>
|
174
|
+
<div className={styles['file-content-box']}>
|
175
|
+
<If condition={displayName}>{this.renderDisplayName()}</If>
|
176
|
+
<If condition={description}>{this.renderDescription()}</If>
|
177
|
+
<If condition={children}>{children}</If>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</Panel>
|
181
|
+
)
|
182
|
+
}
|
183
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
@import "base-mixins/_all.scss";
|
2
|
+
@import "base-variables/_all.scss";
|
3
|
+
|
4
|
+
$file-icon-size: 80px;
|
5
|
+
|
6
|
+
.file-card {
|
7
|
+
height: 100%;
|
8
|
+
display: flex;
|
9
|
+
flex-direction: column;
|
10
|
+
|
11
|
+
.lock {
|
12
|
+
position: absolute;
|
13
|
+
top: $space-small;
|
14
|
+
right: $space-small;
|
15
|
+
color: $gray-5;
|
16
|
+
}
|
17
|
+
|
18
|
+
.file-type-box {
|
19
|
+
padding: $space-largest $space-large $space-jumbo;
|
20
|
+
text-align: center;
|
21
|
+
|
22
|
+
.icon-large {
|
23
|
+
font-size: $file-icon-size;
|
24
|
+
line-height: $file-icon-size;
|
25
|
+
display: block;
|
26
|
+
color: $power-royal;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
.file-content-box {
|
31
|
+
padding: $space-large $space-large;
|
32
|
+
border-top: 1px solid $gray-2;
|
33
|
+
|
34
|
+
display: flex;
|
35
|
+
flex-grow: 1;
|
36
|
+
flex-direction: column;
|
37
|
+
justify-content: flex-start;
|
38
|
+
align-items: flex-start;
|
39
|
+
}
|
40
|
+
|
41
|
+
&.layout-{
|
42
|
+
&vertical {}
|
43
|
+
&horizontal {
|
44
|
+
display: flex;
|
45
|
+
flex-direction: row;
|
46
|
+
|
47
|
+
.file-type-box {
|
48
|
+
width: $file-icon-size;
|
49
|
+
box-sizing: border-box;
|
50
|
+
border-right: 1px solid $gray-2;
|
51
|
+
vertical-align: middle;
|
52
|
+
padding: $space-large;
|
53
|
+
flex: 0 0 $file-icon-size;
|
54
|
+
|
55
|
+
.icon-large {
|
56
|
+
font-size: $file-icon-size/2.5;
|
57
|
+
line-height: $file-icon-size - $space-large;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
.file-content-box {
|
61
|
+
border-top: 0;
|
62
|
+
vertical-align: middle;
|
63
|
+
padding: $space-base $space-large;
|
64
|
+
flex: 0 0 calc(100% - #{$file-icon-size});
|
65
|
+
|
66
|
+
h5 {
|
67
|
+
line-height: 17.5px;
|
68
|
+
height: 17.5px;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
&::after {
|
73
|
+
content: '';
|
74
|
+
clear: both;
|
75
|
+
float: none;
|
76
|
+
display: block;
|
77
|
+
width: 100%;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// @flow
|
2
|
+
/* This file is automatically generated by css-modules-flow-types */
|
3
|
+
declare module.exports: {|
|
4
|
+
+'file-card': string;
|
5
|
+
+'file-content-box': string;
|
6
|
+
+'file-type-box': string;
|
7
|
+
+'hidden-xxs': string;
|
8
|
+
+'icon-large': string;
|
9
|
+
+'layout-horizontal': string;
|
10
|
+
+'lock': string;
|
11
|
+
+'visible-xxs': string;
|
12
|
+
|};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import classname from 'classnames'
|
5
|
+
|
6
|
+
import styles from './styles.scss'
|
7
|
+
|
8
|
+
type FlipProps = {
|
9
|
+
children: React.ChildrenArray<React.Element<typeof FlipFront | typeof FlipBack>>,
|
10
|
+
flipped: boolean,
|
11
|
+
}
|
12
|
+
|
13
|
+
type FlipSideProps = {
|
14
|
+
children?: React.Node,
|
15
|
+
className?: string,
|
16
|
+
}
|
17
|
+
|
18
|
+
const Flip = ({ children, flipped }: FlipProps) => (
|
19
|
+
<div className={styles['flip-container']}>
|
20
|
+
<div className={
|
21
|
+
classname({
|
22
|
+
[styles['flip']]: flipped,
|
23
|
+
[styles['flap']]: !flipped,
|
24
|
+
})
|
25
|
+
}
|
26
|
+
>
|
27
|
+
{children}
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
)
|
31
|
+
|
32
|
+
// eslint-disable-next-line react/no-multi-comp
|
33
|
+
const FlipFront = ({
|
34
|
+
children,
|
35
|
+
className,
|
36
|
+
}: FlipSideProps) => (
|
37
|
+
<div className={classname(styles.front, className)}>{children}</div>
|
38
|
+
)
|
39
|
+
|
40
|
+
// eslint-disable-next-line react/no-multi-comp
|
41
|
+
const FlipBack = ({
|
42
|
+
children,
|
43
|
+
className,
|
44
|
+
}: FlipSideProps) => (
|
45
|
+
<div className={classname(styles.back, className)}>{children}</div>
|
46
|
+
)
|
47
|
+
|
48
|
+
Flip.Front = FlipFront
|
49
|
+
Flip.Back = FlipBack
|
50
|
+
export default Flip
|
@@ -0,0 +1,41 @@
|
|
1
|
+
@import "base-mixins/_all.scss";
|
2
|
+
@import "base-variables/_all.scss";
|
3
|
+
|
4
|
+
.flip-container {
|
5
|
+
perspective: 1000px;
|
6
|
+
height: 100%;
|
7
|
+
}
|
8
|
+
|
9
|
+
.flip {
|
10
|
+
@include rotateY(180deg);
|
11
|
+
@include transition(0.6s);
|
12
|
+
transform-style: preserve-3d;
|
13
|
+
|
14
|
+
position: relative;
|
15
|
+
}
|
16
|
+
|
17
|
+
.flap {
|
18
|
+
@include rotateY(0deg);
|
19
|
+
@include transition(0.6s);
|
20
|
+
transform-style: preserve-3d;
|
21
|
+
|
22
|
+
position: relative;
|
23
|
+
height: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
.front, .back {
|
27
|
+
@include backface-visibility(hidden);
|
28
|
+
height: 100%;
|
29
|
+
}
|
30
|
+
|
31
|
+
.front {
|
32
|
+
z-index: 2;
|
33
|
+
@include rotateY(0deg);
|
34
|
+
}
|
35
|
+
|
36
|
+
.back {
|
37
|
+
@include rotateY(180deg);
|
38
|
+
position: absolute;
|
39
|
+
top: 0;
|
40
|
+
left: 0;
|
41
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// @flow
|
2
|
+
/* This file is automatically generated by css-modules-flow-types */
|
3
|
+
declare module.exports: {|
|
4
|
+
+'back': string;
|
5
|
+
+'flap': string;
|
6
|
+
+'flip': string;
|
7
|
+
+'flip-container': string;
|
8
|
+
+'front': string;
|
9
|
+
+'hidden-xxs': string;
|
10
|
+
+'visible-xxs': string;
|
11
|
+
|};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import classNames from 'classnames'
|
5
|
+
|
6
|
+
import styles from './flyout_panel.scss'
|
7
|
+
|
8
|
+
type FlyoutPanelProps = {|
|
9
|
+
className: ?string,
|
10
|
+
position: "left" | "right",
|
11
|
+
show: ?boolean,
|
12
|
+
children: string,
|
13
|
+
|}
|
14
|
+
|
15
|
+
const FlyoutPanel = ({ position, show, children, className }: FlyoutPanelProps) => {
|
16
|
+
const positionClass = position == "right" ? styles.right : styles.left
|
17
|
+
const classes = classNames(
|
18
|
+
styles['flyout-panel'],
|
19
|
+
positionClass,
|
20
|
+
className,
|
21
|
+
"col-md-5",
|
22
|
+
show ? styles.open : null
|
23
|
+
)
|
24
|
+
const scrollClasses = classNames(styles['scroll-inner-box'], 'p-5', 'pt-2')
|
25
|
+
return (
|
26
|
+
<div className={classes}>
|
27
|
+
<div className={scrollClasses}>
|
28
|
+
{children}
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
)
|
32
|
+
}
|
33
|
+
|
34
|
+
export default FlyoutPanel
|