nitro_sg 3.0.1 → 3.0.2

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 (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,32 @@
1
+ @import "base-mixins/_all.scss";
2
+ @import "base-variables/_all.scss";
3
+
4
+ .panel {
5
+ &-collapsible {
6
+
7
+ }
8
+ &-title {
9
+ display: flex;
10
+ &-main {
11
+ line-height: $space-base;
12
+ vertical-align: text-bottom;
13
+ &-subtitled {
14
+ vertical-align: middle;
15
+ }
16
+ }
17
+ &-subtitle {
18
+ line-height: $space-base;
19
+ vertical-align: top;
20
+ }
21
+ }
22
+ }
23
+
24
+
25
+ .icon {
26
+ font-size: $font-largest;
27
+ }
28
+
29
+ .toggle {
30
+ font-size: $font-large;
31
+ padding: $space-large;
32
+ }
@@ -0,0 +1,12 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'hidden-xxs': string;
5
+ +'icon': string;
6
+ +'panel-title': string;
7
+ +'panel-title-main': string;
8
+ +'panel-title-main-subtitled': string;
9
+ +'panel-title-subtitle': string;
10
+ +'toggle': string;
11
+ +'visible-xxs': string;
12
+ |};
@@ -0,0 +1,121 @@
1
+ import React from "react"
2
+ import PropTypes from "prop-types"
3
+ import Icon from "../Icon/Icon"
4
+
5
+ import {
6
+ Panel as BootstrapPanel,
7
+ PanelGroup as BootstrapPanelGroup
8
+ } from "react-bootstrap"
9
+
10
+ import Text from '../Text/Text'
11
+
12
+ import "./PanelGroup.scss"
13
+
14
+ type PanelProps = {
15
+ children?: string,
16
+ icon?: any,
17
+ name?: string,
18
+ subtitle?: string,
19
+ title?: string,
20
+ toggleIconName?: string,
21
+ }
22
+
23
+ type PanelGroupProps = {
24
+ activePanel?: string,
25
+ className?: string,
26
+ id?: string,
27
+ inner?: boolean,
28
+ }
29
+
30
+ const Panel = ({ children, icon, name = Math.random(), subtitle, title, notification }: PanelProps, context) => {
31
+ const collapsed = context.activePanel !== name
32
+ const rotateProps = collapsed ? { rotate: 180 } : {}
33
+ const css = collapsed ? "panel-collapsed" : ""
34
+
35
+ return (
36
+ <BootstrapPanel eventKey={name} className={css}>
37
+ <BootstrapPanel.Heading bsStyle="default">
38
+ <BootstrapPanel.Toggle className="panel-toggle">
39
+ <If condition={icon}>
40
+ <div className="heading-icon">{icon}</div>
41
+ </If>
42
+
43
+ <BootstrapPanel.Title>
44
+ <Text className="title" bold>{title}</Text>
45
+
46
+ <If condition={subtitle}>
47
+ <Text color="ink-lightest" className="subtitle">{subtitle}</Text>
48
+ </If>
49
+ </BootstrapPanel.Title>
50
+
51
+ <If condition={notification}>
52
+ {notification}
53
+ </If>
54
+
55
+ <Icon className="icon-toggle" size="lg" {...rotateProps} name={context.toggleIconName} />
56
+ </BootstrapPanel.Toggle>
57
+ </BootstrapPanel.Heading>
58
+
59
+ <BootstrapPanel.Body collapsible>{children}</BootstrapPanel.Body>
60
+ </BootstrapPanel>
61
+ )
62
+ }
63
+
64
+ Panel.defaultProps = {
65
+ title: "",
66
+ toggleIconName: "chevron-up"
67
+ }
68
+
69
+ Panel.contextTypes = {
70
+ activePanel: PropTypes.string,
71
+ toggleIconName: PropTypes.string,
72
+ }
73
+
74
+ export default class PanelGroup extends React.Component<PanelGroupProps> {
75
+ static Panel = Panel
76
+
77
+ static childContextTypes = {
78
+ activePanel: PropTypes.string,
79
+ toggleIconName: PropTypes.string,
80
+ }
81
+
82
+ static defaultProps = {
83
+ id: `${Math.random()}`,
84
+ inner: false,
85
+ onPanelChange: () => {},
86
+ }
87
+
88
+ state = {
89
+ activePanel: this.props.activePanel,
90
+ }
91
+
92
+ getChildContext() {
93
+ return {
94
+ activePanel: this.state.activePanel,
95
+ toggleIconName: this.props.inner ? "angle-up" : "chevron-down "
96
+ }
97
+ }
98
+
99
+ handleSelect = (activePanel) => {
100
+ this.setState({ activePanel }, () => this.props.onPanelChange(activePanel));
101
+ }
102
+
103
+ componentWillReceiveProps({ activePanel }) {
104
+ if (activePanel !== this.props.activePanel) {
105
+ this.setState({ activePanel })
106
+ }
107
+ }
108
+
109
+ render() {
110
+ const { children, id, inner, className } = this.props
111
+ return (
112
+ <BootstrapPanelGroup id={id} accordion
113
+ activeKey={this.state.activePanel}
114
+ className={`nitro-panel-group ${className} ${inner ? "inner-panel-group": ""}`}
115
+ onSelect={this.handleSelect}
116
+ >
117
+ {children}
118
+ </BootstrapPanelGroup>
119
+ );
120
+ }
121
+ }
@@ -0,0 +1,96 @@
1
+ @import "base-mixins/_all.scss";
2
+ @import "base-variables/_all.scss";
3
+
4
+ :global {
5
+ .nitro-panel-group {
6
+ margin-bottom: 0px;
7
+
8
+ .panel {
9
+ box-shadow: none;
10
+ margin-bottom: $space-base;
11
+
12
+ .panel-heading {
13
+ background-color: $white;
14
+
15
+ }
16
+
17
+ .panel-body{
18
+ padding-top: $space-largest;
19
+
20
+ .title {
21
+ font-size: $font-size-base;
22
+ font-weight: $bold;
23
+ }
24
+ }
25
+ }
26
+
27
+ &.inner-panel-group {
28
+ .panel {
29
+ box-shadow: $shadow-default;
30
+
31
+ .panel-toggle {
32
+ padding-top: $space-small;
33
+ padding-bottom: $space-small;
34
+ }
35
+
36
+ &.panel-collapsed {
37
+ box-shadow: none;
38
+ margin-bottom: $space-base;
39
+
40
+ .panel-heading {
41
+ background-color: $sky-lighter;
42
+ }
43
+ }
44
+ .panel-body {
45
+ padding-top: $space-largest;
46
+
47
+ }
48
+ }
49
+ }
50
+
51
+ .panel-heading {
52
+ padding: 0;
53
+ border-color: $sky;
54
+
55
+ .heading-icon {
56
+ margin-right: $space-large;
57
+ }
58
+
59
+ .panel-title {
60
+ display: flex;
61
+ flex-direction: column;
62
+ flex-grow: 1;
63
+ line-height: $space-large;
64
+
65
+ }
66
+
67
+ .heading-icon, .title, .subtitle {
68
+ color: $ink-light;
69
+ }
70
+
71
+ .title {
72
+ font-size: $font-size-large;
73
+ font-weight: $regular;
74
+ line-height: $space-larger;
75
+ }
76
+ .subtitle {
77
+ font-size: $font-size-small;
78
+ }
79
+ }
80
+
81
+ .panel-toggle {
82
+ display: flex;
83
+ padding: 6px 16px;
84
+ align-items: center;
85
+ padding-top: $space-large;
86
+ padding-bottom: $space-large;
87
+
88
+ }
89
+
90
+ .icon-toggle {
91
+ color: $ink-lightest;
92
+ transition: all 0.5s ease;
93
+ margin-left: $space-large;
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,6 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'hidden-xxs': string;
5
+ +'visible-xxs': string;
6
+ |};
@@ -0,0 +1,29 @@
1
+ import React, {Component} from 'react'
2
+
3
+ import Select from 'react-select'
4
+
5
+ type Props = {
6
+ multi?: boolean,
7
+ autosize?: boolean,
8
+ autoload?: boolean,
9
+ async?: boolean,
10
+ disabled?: boolean,
11
+ }
12
+
13
+ export default class SearchCollectionSelect extends Component<Props> {
14
+ static defaultProps = {
15
+ multi: true,
16
+ autosize: true,
17
+ autoload: true,
18
+ async: true,
19
+ disabled: false,
20
+ }
21
+ props: Props
22
+ render() {
23
+ if(this.props.async) {
24
+ return <Select.Async {...this.props}/>;
25
+ } else {
26
+ return <Select {...this.props}/>;
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,80 @@
1
+ import React from "react"
2
+ import classnames from "classnames"
3
+
4
+ import spinnerStyles from "./spinner.scss"
5
+
6
+ type Props = {
7
+ position?: 'centered',
8
+ top?: number,
9
+ right?: number,
10
+ bottom?: number,
11
+ left?: number,
12
+ active?: boolean,
13
+ }
14
+
15
+ export default class Spinner extends React.Component<Props> {
16
+ static defaultProps = {
17
+ top: 90,
18
+ right: 15,
19
+ bottom: null,
20
+ left: null,
21
+ active: true,
22
+ }
23
+ props: Props
24
+ render() {
25
+ const {
26
+ active,
27
+ position,
28
+ top,
29
+ right,
30
+ bottom,
31
+ left
32
+ } = this.props
33
+
34
+ let styles
35
+ if(!position) styles = { top: top, right: right, bottom: bottom, left: left }
36
+
37
+ const css = classnames([
38
+ "Spinner",
39
+ active ? "visible" : "hidden",
40
+ position ? spinnerStyles[position] : null,
41
+ ])
42
+
43
+ return (
44
+ <div
45
+ className={css}
46
+ style={styles}
47
+ >
48
+ <span className="badge">
49
+ <svg
50
+ height="30px"
51
+ id="loader-1"
52
+ style={{ enableBackground: "new 0 0 50 50" }}
53
+ version="1.1"
54
+ viewBox="0 0 50 50"
55
+ width="30px"
56
+ x="0px"
57
+ xmlSpace="preserve"
58
+ y="0px"
59
+ >
60
+ <path
61
+ d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"
62
+ fill="#004976"
63
+ transform="rotate(70 25 25)"
64
+ >
65
+ <animateTransform
66
+ attributeName="transform"
67
+ attributeType="xml"
68
+ dur="0.6s"
69
+ from="0 25 25"
70
+ repeatCount="indefinite"
71
+ to="360 25 25"
72
+ type="rotate"
73
+ />
74
+ </path>
75
+ </svg>
76
+ </span>
77
+ </div>
78
+ )
79
+ }
80
+ }
@@ -0,0 +1,6 @@
1
+ .centered {
2
+ position: absolute;
3
+ text-align: center;
4
+ bottom: 50%;
5
+ right: 50%;
6
+ }
@@ -0,0 +1,5 @@
1
+ // @flow
2
+ /* This file is automatically generated by css-modules-flow-types */
3
+ declare module.exports: {|
4
+ +'centered': string;
5
+ |};
@@ -0,0 +1,75 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { map } from 'lodash'
5
+ import { OverlayTrigger, Tooltip } from 'react-bootstrap'
6
+ import classnames from 'classnames'
7
+
8
+ import Icon from '../Icon/Icon'
9
+ import styles from './step_meter.scss'
10
+
11
+ type States = 'done' | 'started' | 'none'
12
+
13
+ type Step = {|
14
+ id: number,
15
+ name: string,
16
+ state: States,
17
+ |}
18
+
19
+ type Props = {
20
+ className: string,
21
+ steps: Array<Step>,
22
+ type: string,
23
+ }
24
+
25
+ const StepMeter = ({
26
+ steps,
27
+ type,
28
+ className
29
+ }: Props) => {
30
+ const classes = [
31
+ className,
32
+ styles['step-meter'],
33
+ styles[`type-${type}`],
34
+ ]
35
+ return (
36
+ <ul className={classnames(classes)}>
37
+ {
38
+ map(steps, (step, idx) => (
39
+ <Choose>
40
+ <When condition={type == 'simple'}>
41
+ <OverlayTrigger
42
+ key={idx}
43
+ overlay={<Tooltip id={`tooltip-step.name`}>{step.name}</Tooltip>}
44
+ placement="bottom"
45
+ trigger={['hover', 'focus']}
46
+ >
47
+ <li
48
+ className={`text-uppercase ${styles[step.state]}`}
49
+ />
50
+ </OverlayTrigger>
51
+ </When>
52
+ <Otherwise>
53
+ <li
54
+ className={`text-uppercase ${styles[step.state]}`}
55
+ key={idx}
56
+ >
57
+ <If condition={step.state == 'done'}>
58
+ <Icon
59
+ label=""
60
+ name="check"
61
+ />
62
+ </If>
63
+ <span>
64
+ {step.name}
65
+ </span>
66
+ </li>
67
+ </Otherwise>
68
+ </Choose>
69
+ ))
70
+ }
71
+ </ul>
72
+ )
73
+ }
74
+
75
+ export default StepMeter