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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/components/Avatar/Avatar.jsx +96 -0
  3. data/components/Avatar/styles.scss +54 -0
  4. data/components/Avatar/styles.scss.flow +14 -0
  5. data/components/Badge/Badge.jsx +40 -0
  6. data/components/Badge/badges.scss +167 -0
  7. data/components/Badge/labels.scss +121 -0
  8. data/components/Badge/styles.scss +4 -0
  9. data/components/Badge/styles.scss.flow +38 -0
  10. data/components/Banner/Banner.jsx +54 -0
  11. data/components/Banner/styles.scss +75 -0
  12. data/components/Banner/styles.scss.flow +19 -0
  13. data/components/Button/Button.jsx +75 -0
  14. data/components/Card/Card.jsx +44 -0
  15. data/components/CircleButton/CircleButton.jsx +51 -0
  16. data/components/CircleButton/CircleButtonStory.jsx +25 -0
  17. data/components/CircleButton/styles.scss +33 -0
  18. data/components/CircleButton/styles.scss.flow +6 -0
  19. data/components/CollapsibleCard/CollapsibleCard.jsx +108 -0
  20. data/components/Color/Color.jsx +55 -0
  21. data/components/Color/styles.scss +6 -0
  22. data/components/Color/styles.scss.flow +5 -0
  23. data/components/ColorPickerInput/ColorPickerInput.jsx +99 -0
  24. data/components/ColorPickerInput/colorPickerInput.scss +10 -0
  25. data/components/ColorPickerInput/colorPickerInput.scss.flow +6 -0
  26. data/components/DOBInput/index.jsx +35 -0
  27. data/components/DOBInput/story.jsx +20 -0
  28. data/components/DOBInput/styles.scss +11 -0
  29. data/components/DOBInput/styles.scss.flow +7 -0
  30. data/components/DatePicker/DatePicker.jsx +156 -0
  31. data/components/DatePicker/styles.scss +6 -0
  32. data/components/DatePicker/styles.scss.flow +5 -0
  33. data/components/DateTimePicker/DateTimePicker.jsx +109 -0
  34. data/components/DateTimePicker/story-styles.scss +3 -0
  35. data/components/DateTimePicker/story-styles.scss.flow +5 -0
  36. data/components/DateTimePicker/styles.scss +1 -0
  37. data/components/DateTimePicker/styles.scss.flow +5 -0
  38. data/components/Errors/Errors.jsx +38 -0
  39. data/components/FileCard/FileCard.jsx +183 -0
  40. data/components/FileCard/styles.scss +81 -0
  41. data/components/FileCard/styles.scss.flow +12 -0
  42. data/components/Flip/Flip.jsx +50 -0
  43. data/components/Flip/styles.scss +41 -0
  44. data/components/Flip/styles.scss.flow +11 -0
  45. data/components/FlyoutPanel/FlyoutPanel.jsx +34 -0
  46. data/components/FlyoutPanel/flyout_panel.scss +33 -0
  47. data/components/FlyoutPanel/flyout_panel.scss.flow +11 -0
  48. data/components/Grade/Grade.jsx +55 -0
  49. data/components/Grade/grade.scss +39 -0
  50. data/components/Grade/grade.scss.flow +6 -0
  51. data/components/Highlight/Highlight.jsx +39 -0
  52. data/components/Highlight/styles.scss +24 -0
  53. data/components/Highlight/styles.scss.flow +17 -0
  54. data/components/Icon/Icon.jsx +54 -0
  55. data/components/IconToggle/IconToggle.jsx +56 -0
  56. data/components/Milestones/MilestoneItem.jsx +47 -0
  57. data/components/Milestones/Milestones.jsx +51 -0
  58. data/components/Milestones/milestones.scss +19 -0
  59. data/components/Milestones/milestones.scss.flow +7 -0
  60. data/components/Milestones/milestones_item.scss +157 -0
  61. data/components/Milestones/milestones_item.scss.flow +13 -0
  62. data/components/Milestones/milestones_variables.scss +11 -0
  63. data/components/MonogramAvatar/MonogramAvatar.jsx +91 -0
  64. data/components/MonogramAvatar/monogram_avatar.scss +54 -0
  65. data/components/MonogramAvatar/monogram_avatar.scss.flow +10 -0
  66. data/components/Panel/Panel.jsx +159 -0
  67. data/components/Panel/panel.scss +32 -0
  68. data/components/Panel/panel.scss.flow +12 -0
  69. data/components/PanelGroup/PanelGroup.jsx +121 -0
  70. data/components/PanelGroup/PanelGroup.scss +96 -0
  71. data/components/PanelGroup/PanelGroup.scss.flow +6 -0
  72. data/components/SearchCollectionSelect/SearchCollectionSelect.jsx +29 -0
  73. data/components/SearchCollectionSelect/searchCollectionSelect.scss +0 -0
  74. data/components/Spinner/Spinner.jsx +80 -0
  75. data/components/Spinner/spinner.scss +6 -0
  76. data/components/Spinner/spinner.scss.flow +5 -0
  77. data/components/StepMeter/StepMeter.jsx +75 -0
  78. data/components/StepMeter/step_meter.scss +120 -0
  79. data/components/StepMeter/step_meter.scss.flow +9 -0
  80. data/components/Survey/Survey.jsx +190 -0
  81. data/components/Survey/survey.scss +75 -0
  82. data/components/Survey/survey.scss.flow +11 -0
  83. data/components/Tab/Tab.jsx +70 -0
  84. data/components/Tab/tab.scss +25 -0
  85. data/components/Tab/tab.scss.flow +6 -0
  86. data/components/TabList/TabList.jsx +35 -0
  87. data/components/TabList/tabList.scss +5 -0
  88. data/components/TabList/tabList.scss.flow +5 -0
  89. data/components/Text/Text.jsx +53 -0
  90. data/components/Text/styles.scss +3 -0
  91. data/components/Text/styles.scss.flow +123 -0
  92. data/components/Text/text.scss +35 -0
  93. data/components/TextInput/TextInput.jsx +95 -0
  94. data/components/TextInput/form-control.scss +96 -0
  95. data/components/TextInput/styles.scss +3 -0
  96. data/components/TextInput/styles.scss.flow +7 -0
  97. data/components/TimePicker/TimePicker.jsx +218 -0
  98. data/components/TimePicker/styles.scss +1 -0
  99. data/components/TimePicker/styles.scss.flow +5 -0
  100. data/components/ToggleButton/ToggleButton.jsx +68 -0
  101. data/components/ToggleButton/toggleButton.scss +70 -0
  102. data/components/ToggleButton/toggleButton.scss.flow +14 -0
  103. data/components/UserStamp/UserStamp.jsx +40 -0
  104. data/components/UserStamp/styles.scss +6 -0
  105. data/components/UserStamp/styles.scss.flow +7 -0
  106. data/components/Wip/Wip.jsx +34 -0
  107. data/components/index.js +33 -0
  108. data/components/types.js +21 -0
  109. data/lib/nitro_sg/version.rb +1 -1
  110. metadata +108 -1
@@ -0,0 +1,4 @@
1
+ @import "base-mixins/_all.scss";
2
+ @import "base-variables/_all.scss";
3
+ @import "labels.scss";
4
+ @import "badges.scss";
@@ -0,0 +1,38 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'active': string;
5
+ +'badge': string;
6
+ +'badge-bitter': string;
7
+ +'badge-danger': string;
8
+ +'badge-default': string;
9
+ +'badge-info': string;
10
+ +'badge-inverse': string;
11
+ +'badge-primary': string;
12
+ +'badge-success': string;
13
+ +'badge-warning': string;
14
+ +'btn': string;
15
+ +'btn-group-xs': string;
16
+ +'btn-xs': string;
17
+ +'hidden-xxs': string;
18
+ +'label': string;
19
+ +'label-danger': string;
20
+ +'label-default': string;
21
+ +'label-info': string;
22
+ +'label-inverse': string;
23
+ +'label-primary': string;
24
+ +'label-success': string;
25
+ +'label-warning': string;
26
+ +'list-group-item': string;
27
+ +'nav-pills': string;
28
+ +'pill': string;
29
+ +'pill-bitter': string;
30
+ +'pill-danger': string;
31
+ +'pill-default': string;
32
+ +'pill-info': string;
33
+ +'pill-inverse': string;
34
+ +'pill-primary': string;
35
+ +'pill-success': string;
36
+ +'pill-warning': string;
37
+ +'visible-xxs': string;
38
+ |};
@@ -0,0 +1,54 @@
1
+ /* @flow */
2
+
3
+ import React from "react"
4
+ import classnames from "classnames"
5
+
6
+ import styles from "./styles.scss"
7
+
8
+ export type BannerProps = {
9
+ closeable?: boolean,
10
+ children: string | React.Node | Array<React.Node>,
11
+ onClose: () => void,
12
+ position: "top" | "bottom",
13
+ show?: boolean,
14
+ style: "info" | "success" | "warning" | "danger",
15
+ }
16
+
17
+ const Banner = ({
18
+ closeable,
19
+ children,
20
+ onClose,
21
+ position,
22
+ show,
23
+ style,
24
+ }: BannerProps) => {
25
+ const css = classnames([
26
+ styles[`banner-${style}`],
27
+ styles[show ? `show-${position}` : `hide-${position}`],
28
+ ])
29
+ return (
30
+ <div className={css}>
31
+
32
+ { children }
33
+
34
+ <If condition={closeable}>
35
+ <button
36
+ className={classnames(styles.close, "close")}
37
+ onClick={onClose}
38
+ >
39
+ {`×`}
40
+ </button>
41
+ </If>
42
+
43
+ </div>
44
+ )
45
+ }
46
+
47
+ Banner.defaultProps = {
48
+ closeable: true,
49
+ position: "top",
50
+ show: false,
51
+ style: "info",
52
+ }
53
+
54
+ export default Banner
@@ -0,0 +1,75 @@
1
+ @import "base-mixins/_all.scss";
2
+ @import "base-variables/_all.scss";
3
+
4
+ $notifyHeight: 64px;
5
+
6
+ @mixin banner {
7
+ position: fixed;
8
+ left: 0;
9
+ right: 0;
10
+ z-index: 1000;
11
+ text-align: center;
12
+ height: $notifyHeight;
13
+ padding: $space-base * 1.5 $space-base * 2;
14
+ color: $sky-lighter;
15
+ font-size: $font-large;
16
+ @include transition-property(top, bottom);
17
+ @include transition-duration(.5s);
18
+ @include transition-timing-function(ease);
19
+
20
+ @include tablet-and-below {
21
+ font-size: $font-base;
22
+ padding: $space-base * 2;
23
+ &-close {
24
+ font-size: $font-small;
25
+ }
26
+ }
27
+
28
+ a {
29
+ color: $sky-lighter;
30
+ text-decoration: underline;
31
+ }
32
+ }
33
+
34
+ .banner {
35
+ &-info {
36
+ @include banner;
37
+ background: $power-blue;
38
+ }
39
+ &-success {
40
+ @include banner;
41
+ background: $power-green;
42
+ }
43
+ &-warning {
44
+ @include banner;
45
+ background: $dark-orange;
46
+ }
47
+ &-danger {
48
+ @include banner;
49
+ background: $power-red;
50
+ }
51
+ }
52
+
53
+ .close {
54
+ color: $sky-lighter;
55
+ opacity: 1;
56
+ font-size: $font-largest;
57
+ font-weight: 300;
58
+ }
59
+
60
+ .show {
61
+ &-top {
62
+ top: 0;
63
+ }
64
+ &-bottom {
65
+ bottom: 0;
66
+ }
67
+ }
68
+ .hide {
69
+ &-top {
70
+ top: -$notifyHeight;
71
+ }
72
+ &-bottom {
73
+ bottom: -$notifyHeight;
74
+ }
75
+ }
@@ -0,0 +1,19 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'banner-danger': string;
5
+ +'banner-danger-close': string;
6
+ +'banner-info': string;
7
+ +'banner-info-close': string;
8
+ +'banner-success': string;
9
+ +'banner-success-close': string;
10
+ +'banner-warning': string;
11
+ +'banner-warning-close': string;
12
+ +'close': string;
13
+ +'hidden-xxs': string;
14
+ +'hide-bottom': string;
15
+ +'hide-top': string;
16
+ +'show-bottom': string;
17
+ +'show-top': string;
18
+ +'visible-xxs': string;
19
+ |};
@@ -0,0 +1,75 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import classnames from 'classnames'
5
+ import { IconType } from "../types"
6
+
7
+ type Props = {
8
+ className: string,
9
+ disabled: boolean,
10
+ icon: IconType,
11
+ onClick: () => mixed,
12
+ text: string,
13
+ type: "anchor" | "button" | "submit" | "",
14
+ }
15
+
16
+ export default class Button extends React.Component<Props> {
17
+ static defaultProps = {
18
+ text: "button",
19
+ }
20
+ props: Props
21
+ createElementTag = () => {
22
+ const {
23
+ className,
24
+ disabled,
25
+ icon,
26
+ onClick,
27
+ text,
28
+ type
29
+ } = this.props
30
+ let tag
31
+ let props = {}
32
+ switch(type) {
33
+ case "anchor":
34
+ tag = "a"
35
+ break
36
+ case "button":
37
+ tag = "input"
38
+ props.type = "button"
39
+ props.value = text
40
+ break
41
+ case "submit":
42
+ tag = "input"
43
+ props.type = "submit"
44
+ props.value = text
45
+ break
46
+ default:
47
+ tag = "span"
48
+ break
49
+ }
50
+ const css = [
51
+ "btn",
52
+ className,
53
+
54
+ ]
55
+ props.onClick = onClick
56
+ props.className = classnames(css)
57
+ if(disabled) props.disabled = true
58
+
59
+ const element = React.createElement(tag, props)
60
+
61
+ if(tag === "input") {
62
+ return <element.type {...element.props} />
63
+ } else {
64
+ return (
65
+ <element.type {...element.props}>
66
+ <If condition={icon}>{icon}</If>
67
+ {text}
68
+ </element.type>
69
+ )
70
+ }
71
+ }
72
+ render() {
73
+ return this.createElementTag()
74
+ }
75
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+
4
+
5
+ export type CardProps = {
6
+ children: string | React.Node | Array<React.Node>,
7
+ shadow?: Boolean,
8
+ shadowShallow?: Boolean,
9
+ shadowDeep?: Boolean,
10
+ shadowDeeper?: Boolean,
11
+ shadowDeepest?: Boolean,
12
+ }
13
+
14
+ export default class Card extends React.Component<Props> {
15
+ static defaultProps = {
16
+ children: null,
17
+ shadow: false,
18
+ shadowShallow: false,
19
+ shadowDeep: false,
20
+ shadowDeeper: false,
21
+ shadowDeepest: false,
22
+ }
23
+ props: Props
24
+ render() {
25
+ const {
26
+ children,
27
+ className,
28
+ shadow,
29
+ shadowShallow,
30
+ shadowDeep,
31
+ shadowDeeper,
32
+ shadowDeepest,
33
+ } = this.props
34
+ const css = classnames([
35
+ "card",
36
+ className,
37
+ ])
38
+ return (
39
+ <div className={css}>
40
+ { children }
41
+ </div>
42
+ )
43
+ }
44
+ }
@@ -0,0 +1,51 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import Icon from '../Icon/Icon.jsx'
5
+ import classnames from 'classnames'
6
+
7
+ type Props = {
8
+ className:string,
9
+ iconName:string,
10
+ size:string,
11
+ color: string,
12
+ iconColor:string,
13
+ name:string,
14
+
15
+ }
16
+
17
+ export default class CircleButton extends React.Component<Props> {
18
+ static defaultProps = {
19
+ color:"",
20
+ size:"",
21
+ textColor:"",
22
+ iconName:"",
23
+ className:"circlebutton",
24
+
25
+
26
+ }
27
+ props: Props
28
+
29
+ render() {
30
+
31
+ const {
32
+ size,
33
+ color,
34
+ iconName,
35
+ iconColor,
36
+ className,
37
+ } = this.props
38
+
39
+
40
+
41
+ return (
42
+
43
+ <div>
44
+ <button className={`${classnames(color,iconColor,className)} circlebutton-${size} border-0 shadow-default`}>
45
+ <Icon name={iconName}/>
46
+ </button>
47
+ </div>
48
+ )
49
+
50
+ }
51
+ }
@@ -0,0 +1,25 @@
1
+ import React from "react"
2
+ import CircleButton from "./CircleButton"
3
+ import { text, select,} from "@storybook/addon-knobs"
4
+
5
+
6
+
7
+
8
+ export default function CircleButtonStory(stories) {
9
+ stories.add("Circle Button",
10
+ () => {
11
+ const props = {
12
+ className: text("className", "circlebutton"),
13
+ size: select("sizeOption",['md','lg',],'md'),
14
+ iconColor:text("iconColor","text-white"),
15
+ iconName: text("iconName","plus"),
16
+ color:text("color","bg-power-green"),
17
+ }
18
+
19
+
20
+
21
+ return (<CircleButton {...props}/>
22
+ )
23
+ }
24
+ )
25
+ }
@@ -0,0 +1,33 @@
1
+ $circleButtonSizes:
2
+ "md" 48px 16px,
3
+ "lg" 56px 20px;
4
+
5
+ // @mixin config-sizes($prefix){
6
+ // @each $size in $circleButtonSizes($prefix) {
7
+ // .#{$prefix}-#{nth($size,1)} {
8
+ // text-align: center;
9
+ // border-radius: 100%;
10
+ // height: #{nth($size, 1)};
11
+ // width: #{nth($size, 1)};
12
+ // font-size: #{nth($size, 2)};
13
+ // }
14
+ // }
15
+ // }
16
+ //
17
+ // @include config-sizes("circleButton");
18
+
19
+ .circleButton-md {
20
+ text-align: center;
21
+ border-radius: 100%;
22
+ height: 48px;
23
+ width: 48px;
24
+ font-size: 16px;
25
+ }
26
+
27
+ .circleButton-lg {
28
+ text-align: center;
29
+ border-radius: 100%;
30
+ height: 56px;
31
+ width: 56px;
32
+ font-size: 20px;
33
+ }
@@ -0,0 +1,6 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'circleButton-lg': string;
5
+ +'circleButton-md': string;
6
+ |};
@@ -0,0 +1,108 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+ import Card from '../Card/Card'
4
+ import Icon from '../Icon/Icon'
5
+ import AnimateHeight from 'react-animate-height'
6
+ import { Button } from "react-bootstrap"
7
+
8
+
9
+ export type CollapsibleCardProps = {
10
+ children: React.ChildrenArray<React.Element<typeof Main | Content >>,
11
+ className: string,
12
+ }
13
+
14
+ const CollapsibleCardMain = () => null;
15
+ const CollapsibleCardContent = () => null;
16
+
17
+ class CollapsibleCard extends React.Component<Props> {
18
+ static CollapsibleCardMain: Function
19
+ static CollapsibleCardContent: Function
20
+
21
+ static defaultProps = {
22
+ children: null,
23
+ }
24
+
25
+ props: Props
26
+
27
+ state = {
28
+ height: 0,
29
+ }
30
+
31
+ constructor() {
32
+ super()
33
+ }
34
+
35
+ toggleExpand() {
36
+ const { height } = this.state;
37
+
38
+ this.setState({
39
+ height: height === 0 ? 'auto' : 0,
40
+ })
41
+ }
42
+
43
+ renderTop() {
44
+ const { children } = this.props;
45
+ const content = React.Children.map(children, child => {
46
+ if (child.type.displayName === 'CollapsibleCardMain' || child.type.name === 'CollapsibleCardMain') {
47
+ return React.cloneElement(child)
48
+ }
49
+ });
50
+ return (
51
+ <div className="collapsible-card-top-content">{content.length > 0 ? content[0].props.children : '' }</div>
52
+ );
53
+ }
54
+
55
+ renderContent() {
56
+ const { children } = this.props;
57
+ const height = this.state.height;
58
+ const content = React.Children.map(children, child => {
59
+ if (child.type.displayName === 'CollapsibleCardContent' || child.type.name === 'CollapsibleCardContent') {
60
+ return React.cloneElement(child)
61
+ }
62
+ });
63
+ return (
64
+ <AnimateHeight
65
+ duration={ 500 }
66
+ height={ height }
67
+ className="collapsible-card-hidden"
68
+ >
69
+ <div className="collapsible-card-hidden-content">
70
+ {content.length > 0 ? content[0].props.children : '' }
71
+ </div>
72
+ </AnimateHeight>
73
+ );
74
+ }
75
+
76
+ render() {
77
+ const {
78
+ children,
79
+ className,
80
+ main,
81
+ } = this.props
82
+ const { height } = this.state
83
+ const css = classnames([
84
+ "collapsible-card",
85
+ className
86
+ ])
87
+
88
+
89
+
90
+ return (
91
+ <Card className={css}>
92
+ {this.renderTop()}
93
+ <Button className={'btn-default btn-card-toggle'} onClick={() => this.toggleExpand()} >
94
+ <If condition={height === 0}>
95
+ <Icon name="chevron-down" />
96
+ <Else/>
97
+ <Icon name="chevron-up" />
98
+ </If>
99
+ </Button>
100
+ {this.renderContent()}
101
+ </Card>
102
+ )
103
+ }
104
+ }
105
+
106
+ CollapsibleCard.Main = CollapsibleCardMain
107
+ CollapsibleCard.Content = CollapsibleCardContent
108
+ export default CollapsibleCard