@plusscommunities/pluss-core-web 1.3.3-beta.0 → 1.4.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/dist/index.cjs.js +28 -3
- package/dist/index.esm.js +28 -4
- package/dist/index.umd.js +31 -7
- package/package.json +1 -1
- package/src/colours.js +2 -2
- package/src/components/InputGroup.js +18 -0
- package/src/components/index.js +1 -0
package/dist/index.cjs.js
CHANGED
|
@@ -28,6 +28,7 @@ var reactRouter = require('react-router');
|
|
|
28
28
|
var reactBootstrap = require('react-bootstrap');
|
|
29
29
|
var reactLottie = require('@crello/react-lottie');
|
|
30
30
|
var reactCsv = require('react-csv');
|
|
31
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
31
32
|
|
|
32
33
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
33
34
|
|
|
@@ -51,6 +52,7 @@ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
|
51
52
|
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
52
53
|
var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
|
|
53
54
|
var Dropzone__default = /*#__PURE__*/_interopDefaultLegacy(Dropzone);
|
|
55
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
54
56
|
|
|
55
57
|
var CoreConfig = {
|
|
56
58
|
env: {
|
|
@@ -1635,8 +1637,8 @@ var LINEGREY = COLOUR_BRANDING_INACTIVE; // const BORDER_LINE_GREY = COLOUR_BRAN
|
|
|
1635
1637
|
// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
|
|
1636
1638
|
// const COLOUR_DARKBLUE = '#191e78';
|
|
1637
1639
|
// const COLOUR_PURPLE = '#6e79c5';
|
|
1638
|
-
|
|
1639
|
-
// const COLOUR_GREEN = '#00cc9c';
|
|
1640
|
+
|
|
1641
|
+
var COLOUR_RED = '#c02743'; // const COLOUR_GREEN = '#00cc9c';
|
|
1640
1642
|
// const COLOUR_TANGERINE = '#ff8c75';
|
|
1641
1643
|
// const COLOUR_CITRON = '#bdbd27';
|
|
1642
1644
|
// const COLOUR_GRAPEFRUIT = '#ff6363';
|
|
@@ -1657,6 +1659,7 @@ var colours = /*#__PURE__*/Object.freeze({
|
|
|
1657
1659
|
COLOUR_DUSK_LIGHT: COLOUR_DUSK_LIGHT,
|
|
1658
1660
|
COLOUR_DUSK_LIGHTER: COLOUR_DUSK_LIGHTER,
|
|
1659
1661
|
LINEGREY: LINEGREY,
|
|
1662
|
+
COLOUR_RED: COLOUR_RED,
|
|
1660
1663
|
COLOUR_BRANDING_MAIN: COLOUR_BRANDING_MAIN,
|
|
1661
1664
|
COLOUR_BRANDING_OFF: COLOUR_BRANDING_OFF,
|
|
1662
1665
|
COLOUR_BRANDING_ACTION: COLOUR_BRANDING_ACTION,
|
|
@@ -10883,6 +10886,27 @@ var ExportCsvPopup = /*#__PURE__*/function (_Component) {
|
|
|
10883
10886
|
return ExportCsvPopup;
|
|
10884
10887
|
}(React.Component);
|
|
10885
10888
|
|
|
10889
|
+
var _excluded = ["id", "label", "help", "showError", "required"];
|
|
10890
|
+
|
|
10891
|
+
function InputGroup(_ref) {
|
|
10892
|
+
var id = _ref.id,
|
|
10893
|
+
label = _ref.label,
|
|
10894
|
+
help = _ref.help,
|
|
10895
|
+
showError = _ref.showError,
|
|
10896
|
+
required = _ref.required,
|
|
10897
|
+
props = _objectWithoutProperties__default['default'](_ref, _excluded);
|
|
10898
|
+
|
|
10899
|
+
return /*#__PURE__*/React__default['default'].createElement(reactBootstrap.FormGroup, {
|
|
10900
|
+
controlId: id,
|
|
10901
|
+
validationState: showError ? 'error' : null
|
|
10902
|
+
}, /*#__PURE__*/React__default['default'].createElement(reactBootstrap.ControlLabel, null, /*#__PURE__*/React__default['default'].createElement("span", null, label), required && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
10903
|
+
style: {
|
|
10904
|
+
color: COLOUR_RED,
|
|
10905
|
+
marginLeft: 5
|
|
10906
|
+
}
|
|
10907
|
+
}, "*")), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.FormControl, props), help && /*#__PURE__*/React__default['default'].createElement(reactBootstrap.HelpBlock, null, help));
|
|
10908
|
+
}
|
|
10909
|
+
|
|
10886
10910
|
var index = /*#__PURE__*/Object.freeze({
|
|
10887
10911
|
__proto__: null,
|
|
10888
10912
|
AddButton: AddButton,
|
|
@@ -10922,7 +10946,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
10922
10946
|
OptionsSection: OptionsSection,
|
|
10923
10947
|
DropdownInput: DropdownInput,
|
|
10924
10948
|
MakerPopup: exportObj,
|
|
10925
|
-
ExportCsvPopup: ExportCsvPopup
|
|
10949
|
+
ExportCsvPopup: ExportCsvPopup,
|
|
10950
|
+
InputGroup: InputGroup
|
|
10926
10951
|
});
|
|
10927
10952
|
|
|
10928
10953
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
package/dist/index.esm.js
CHANGED
|
@@ -21,9 +21,10 @@ import { connect } from 'react-redux';
|
|
|
21
21
|
import Textarea from 'react-textarea-autosize';
|
|
22
22
|
import Dropzone from 'react-dropzone';
|
|
23
23
|
import { withRouter } from 'react-router';
|
|
24
|
-
import { MenuItem, DropdownButton } from 'react-bootstrap';
|
|
24
|
+
import { MenuItem, DropdownButton, FormGroup, ControlLabel, FormControl, HelpBlock } from 'react-bootstrap';
|
|
25
25
|
import { Lottie } from '@crello/react-lottie';
|
|
26
26
|
import { CSVLink } from 'react-csv';
|
|
27
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
27
28
|
|
|
28
29
|
var CoreConfig = {
|
|
29
30
|
env: {
|
|
@@ -1608,8 +1609,8 @@ var LINEGREY = COLOUR_BRANDING_INACTIVE; // const BORDER_LINE_GREY = COLOUR_BRAN
|
|
|
1608
1609
|
// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
|
|
1609
1610
|
// const COLOUR_DARKBLUE = '#191e78';
|
|
1610
1611
|
// const COLOUR_PURPLE = '#6e79c5';
|
|
1611
|
-
|
|
1612
|
-
// const COLOUR_GREEN = '#00cc9c';
|
|
1612
|
+
|
|
1613
|
+
var COLOUR_RED = '#c02743'; // const COLOUR_GREEN = '#00cc9c';
|
|
1613
1614
|
// const COLOUR_TANGERINE = '#ff8c75';
|
|
1614
1615
|
// const COLOUR_CITRON = '#bdbd27';
|
|
1615
1616
|
// const COLOUR_GRAPEFRUIT = '#ff6363';
|
|
@@ -1630,6 +1631,7 @@ var colours = /*#__PURE__*/Object.freeze({
|
|
|
1630
1631
|
COLOUR_DUSK_LIGHT: COLOUR_DUSK_LIGHT,
|
|
1631
1632
|
COLOUR_DUSK_LIGHTER: COLOUR_DUSK_LIGHTER,
|
|
1632
1633
|
LINEGREY: LINEGREY,
|
|
1634
|
+
COLOUR_RED: COLOUR_RED,
|
|
1633
1635
|
COLOUR_BRANDING_MAIN: COLOUR_BRANDING_MAIN,
|
|
1634
1636
|
COLOUR_BRANDING_OFF: COLOUR_BRANDING_OFF,
|
|
1635
1637
|
COLOUR_BRANDING_ACTION: COLOUR_BRANDING_ACTION,
|
|
@@ -10856,6 +10858,27 @@ var ExportCsvPopup = /*#__PURE__*/function (_Component) {
|
|
|
10856
10858
|
return ExportCsvPopup;
|
|
10857
10859
|
}(Component);
|
|
10858
10860
|
|
|
10861
|
+
var _excluded = ["id", "label", "help", "showError", "required"];
|
|
10862
|
+
|
|
10863
|
+
function InputGroup(_ref) {
|
|
10864
|
+
var id = _ref.id,
|
|
10865
|
+
label = _ref.label,
|
|
10866
|
+
help = _ref.help,
|
|
10867
|
+
showError = _ref.showError,
|
|
10868
|
+
required = _ref.required,
|
|
10869
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
10870
|
+
|
|
10871
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
10872
|
+
controlId: id,
|
|
10873
|
+
validationState: showError ? 'error' : null
|
|
10874
|
+
}, /*#__PURE__*/React.createElement(ControlLabel, null, /*#__PURE__*/React.createElement("span", null, label), required && /*#__PURE__*/React.createElement("span", {
|
|
10875
|
+
style: {
|
|
10876
|
+
color: COLOUR_RED,
|
|
10877
|
+
marginLeft: 5
|
|
10878
|
+
}
|
|
10879
|
+
}, "*")), /*#__PURE__*/React.createElement(FormControl, props), help && /*#__PURE__*/React.createElement(HelpBlock, null, help));
|
|
10880
|
+
}
|
|
10881
|
+
|
|
10859
10882
|
var index = /*#__PURE__*/Object.freeze({
|
|
10860
10883
|
__proto__: null,
|
|
10861
10884
|
AddButton: AddButton,
|
|
@@ -10895,7 +10918,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
10895
10918
|
OptionsSection: OptionsSection,
|
|
10896
10919
|
DropdownInput: DropdownInput,
|
|
10897
10920
|
MakerPopup: exportObj,
|
|
10898
|
-
ExportCsvPopup: ExportCsvPopup
|
|
10921
|
+
ExportCsvPopup: ExportCsvPopup,
|
|
10922
|
+
InputGroup: InputGroup
|
|
10899
10923
|
});
|
|
10900
10924
|
|
|
10901
10925
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/toConsumableArray'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/regenerator'), require('lodash'), require('axios'), require('aws-amplify'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('jquery'), require('moment'), require('js-cookie'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/inherits'), require('@babel/runtime/helpers/possibleConstructorReturn'), require('@babel/runtime/helpers/getPrototypeOf'), require('react-fontawesome'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('react-redux'), require('react-textarea-autosize'), require('react-dropzone'), require('react-router'), require('react-bootstrap'), require('@crello/react-lottie'), require('react-csv')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/toConsumableArray', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/regenerator', 'lodash', 'axios', 'aws-amplify', '@babel/runtime/helpers/defineProperty', 'react', 'jquery', 'moment', 'js-cookie', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/inherits', '@babel/runtime/helpers/possibleConstructorReturn', '@babel/runtime/helpers/getPrototypeOf', 'react-fontawesome', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', 'react-redux', 'react-textarea-autosize', 'react-dropzone', 'react-router', 'react-bootstrap', '@crello/react-lottie', 'react-csv'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@plusscommunities/pluss-core-web'] = {}, global._toConsumableArray, global._asyncToGenerator, global._regeneratorRuntime, global._, global.axios, global.awsAmplify, global._defineProperty, global.React, global.$, global.moment, global.Cookies, global._classCallCheck, global._createClass, global._inherits, global._possibleConstructorReturn, global._getPrototypeOf, global.FontAwesome, global._extends, global._assertThisInitialized, global.reactRedux, global.Textarea, global.Dropzone, global.reactRouter, global.reactBootstrap, global.reactLottie, global.reactCsv));
|
|
5
|
-
}(this, (function (exports, _toConsumableArray, _asyncToGenerator, _regeneratorRuntime, _, axios, awsAmplify, _defineProperty, React, $, moment, Cookies, _classCallCheck, _createClass, _inherits, _possibleConstructorReturn, _getPrototypeOf, FontAwesome, _extends, _assertThisInitialized, reactRedux, Textarea, Dropzone, reactRouter, reactBootstrap, reactLottie, reactCsv) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/toConsumableArray'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/regenerator'), require('lodash'), require('axios'), require('aws-amplify'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('jquery'), require('moment'), require('js-cookie'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/inherits'), require('@babel/runtime/helpers/possibleConstructorReturn'), require('@babel/runtime/helpers/getPrototypeOf'), require('react-fontawesome'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('react-redux'), require('react-textarea-autosize'), require('react-dropzone'), require('react-router'), require('react-bootstrap'), require('@crello/react-lottie'), require('react-csv'), require('@babel/runtime/helpers/objectWithoutProperties')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/toConsumableArray', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/regenerator', 'lodash', 'axios', 'aws-amplify', '@babel/runtime/helpers/defineProperty', 'react', 'jquery', 'moment', 'js-cookie', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/inherits', '@babel/runtime/helpers/possibleConstructorReturn', '@babel/runtime/helpers/getPrototypeOf', 'react-fontawesome', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', 'react-redux', 'react-textarea-autosize', 'react-dropzone', 'react-router', 'react-bootstrap', '@crello/react-lottie', 'react-csv', '@babel/runtime/helpers/objectWithoutProperties'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@plusscommunities/pluss-core-web'] = {}, global._toConsumableArray, global._asyncToGenerator, global._regeneratorRuntime, global._, global.axios, global.awsAmplify, global._defineProperty, global.React, global.$, global.moment, global.Cookies, global._classCallCheck, global._createClass, global._inherits, global._possibleConstructorReturn, global._getPrototypeOf, global.FontAwesome, global._extends, global._assertThisInitialized, global.reactRedux, global.Textarea, global.Dropzone, global.reactRouter, global.reactBootstrap, global.reactLottie, global.reactCsv, global._objectWithoutProperties));
|
|
5
|
+
}(this, (function (exports, _toConsumableArray, _asyncToGenerator, _regeneratorRuntime, _, axios, awsAmplify, _defineProperty, React, $, moment, Cookies, _classCallCheck, _createClass, _inherits, _possibleConstructorReturn, _getPrototypeOf, FontAwesome, _extends, _assertThisInitialized, reactRedux, Textarea, Dropzone, reactRouter, reactBootstrap, reactLottie, reactCsv, _objectWithoutProperties) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
27
27
|
var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
|
|
28
28
|
var Dropzone__default = /*#__PURE__*/_interopDefaultLegacy(Dropzone);
|
|
29
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
29
30
|
|
|
30
31
|
var CoreConfig = {
|
|
31
32
|
env: {
|
|
@@ -1610,8 +1611,8 @@
|
|
|
1610
1611
|
// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
|
|
1611
1612
|
// const COLOUR_DARKBLUE = '#191e78';
|
|
1612
1613
|
// const COLOUR_PURPLE = '#6e79c5';
|
|
1613
|
-
|
|
1614
|
-
// const COLOUR_GREEN = '#00cc9c';
|
|
1614
|
+
|
|
1615
|
+
var COLOUR_RED = '#c02743'; // const COLOUR_GREEN = '#00cc9c';
|
|
1615
1616
|
// const COLOUR_TANGERINE = '#ff8c75';
|
|
1616
1617
|
// const COLOUR_CITRON = '#bdbd27';
|
|
1617
1618
|
// const COLOUR_GRAPEFRUIT = '#ff6363';
|
|
@@ -1632,6 +1633,7 @@
|
|
|
1632
1633
|
COLOUR_DUSK_LIGHT: COLOUR_DUSK_LIGHT,
|
|
1633
1634
|
COLOUR_DUSK_LIGHTER: COLOUR_DUSK_LIGHTER,
|
|
1634
1635
|
LINEGREY: LINEGREY,
|
|
1636
|
+
COLOUR_RED: COLOUR_RED,
|
|
1635
1637
|
COLOUR_BRANDING_MAIN: COLOUR_BRANDING_MAIN,
|
|
1636
1638
|
COLOUR_BRANDING_OFF: COLOUR_BRANDING_OFF,
|
|
1637
1639
|
COLOUR_BRANDING_ACTION: COLOUR_BRANDING_ACTION,
|
|
@@ -10858,6 +10860,27 @@
|
|
|
10858
10860
|
return ExportCsvPopup;
|
|
10859
10861
|
}(React.Component);
|
|
10860
10862
|
|
|
10863
|
+
var _excluded = ["id", "label", "help", "showError", "required"];
|
|
10864
|
+
|
|
10865
|
+
function InputGroup(_ref) {
|
|
10866
|
+
var id = _ref.id,
|
|
10867
|
+
label = _ref.label,
|
|
10868
|
+
help = _ref.help,
|
|
10869
|
+
showError = _ref.showError,
|
|
10870
|
+
required = _ref.required,
|
|
10871
|
+
props = _objectWithoutProperties__default['default'](_ref, _excluded);
|
|
10872
|
+
|
|
10873
|
+
return /*#__PURE__*/React__default['default'].createElement(reactBootstrap.FormGroup, {
|
|
10874
|
+
controlId: id,
|
|
10875
|
+
validationState: showError ? 'error' : null
|
|
10876
|
+
}, /*#__PURE__*/React__default['default'].createElement(reactBootstrap.ControlLabel, null, /*#__PURE__*/React__default['default'].createElement("span", null, label), required && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
10877
|
+
style: {
|
|
10878
|
+
color: COLOUR_RED,
|
|
10879
|
+
marginLeft: 5
|
|
10880
|
+
}
|
|
10881
|
+
}, "*")), /*#__PURE__*/React__default['default'].createElement(reactBootstrap.FormControl, props), help && /*#__PURE__*/React__default['default'].createElement(reactBootstrap.HelpBlock, null, help));
|
|
10882
|
+
}
|
|
10883
|
+
|
|
10861
10884
|
var index = /*#__PURE__*/Object.freeze({
|
|
10862
10885
|
__proto__: null,
|
|
10863
10886
|
AddButton: AddButton,
|
|
@@ -10897,7 +10920,8 @@
|
|
|
10897
10920
|
OptionsSection: OptionsSection,
|
|
10898
10921
|
DropdownInput: DropdownInput,
|
|
10899
10922
|
MakerPopup: exportObj,
|
|
10900
|
-
ExportCsvPopup: ExportCsvPopup
|
|
10923
|
+
ExportCsvPopup: ExportCsvPopup,
|
|
10924
|
+
InputGroup: InputGroup
|
|
10901
10925
|
});
|
|
10902
10926
|
|
|
10903
10927
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
package/package.json
CHANGED
package/src/colours.js
CHANGED
|
@@ -31,7 +31,7 @@ const LINEGREY = COLOUR_BRANDING_INACTIVE;
|
|
|
31
31
|
// const COLOUR_BLUE_ALPHA10 = 'rgba(0, 131, 238, 0.1)';
|
|
32
32
|
// const COLOUR_DARKBLUE = '#191e78';
|
|
33
33
|
// const COLOUR_PURPLE = '#6e79c5';
|
|
34
|
-
|
|
34
|
+
const COLOUR_RED = '#c02743';
|
|
35
35
|
// const COLOUR_GREEN = '#00cc9c';
|
|
36
36
|
// const COLOUR_TANGERINE = '#ff8c75';
|
|
37
37
|
// const COLOUR_CITRON = '#bdbd27';
|
|
@@ -109,7 +109,7 @@ export {
|
|
|
109
109
|
// COLOUR_BLUE_ALPHA10,
|
|
110
110
|
// COLOUR_DARKBLUE,
|
|
111
111
|
// COLOUR_PURPLE,
|
|
112
|
-
|
|
112
|
+
COLOUR_RED,
|
|
113
113
|
// COLOUR_TANGERINE,
|
|
114
114
|
// COLOUR_CITRON,
|
|
115
115
|
// COLOUR_GRAPEFRUIT,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormGroup, FormControl, ControlLabel, HelpBlock } from 'react-bootstrap';
|
|
3
|
+
import { COLOUR_RED } from '../colours';
|
|
4
|
+
|
|
5
|
+
function InputGroup({ id, label, help, showError, required, ...props }) {
|
|
6
|
+
return (
|
|
7
|
+
<FormGroup controlId={id} validationState={showError ? 'error' : null}>
|
|
8
|
+
<ControlLabel>
|
|
9
|
+
<span>{label}</span>
|
|
10
|
+
{required && <span style={{ color: COLOUR_RED, marginLeft: 5 }}>*</span>}
|
|
11
|
+
</ControlLabel>
|
|
12
|
+
<FormControl {...props} />
|
|
13
|
+
{help && <HelpBlock>{help}</HelpBlock>}
|
|
14
|
+
</FormGroup>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { InputGroup };
|
package/src/components/index.js
CHANGED