@capillarytech/blaze-ui 0.1.6-alpha.49 → 0.1.6-alpha.5
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/CapHeading/CapHeading.js +71 -0
- package/CapHeading/index.js +1 -0
- package/CapHeading/styles.js +125 -0
- package/CapInfoNote/CapInfoNote.js +54 -0
- package/CapInfoNote/index.js +1 -0
- package/CapInfoNote/styles.js +63 -0
- package/CapInput/CapInput.js +1 -1
- package/CapInput/Number.js +1 -1
- package/CapInput/Search.js +1 -1
- package/CapInput/TextArea.js +1 -1
- package/CapInput/loadable.js +9 -0
- package/CapLabel/CapLabel.js +81 -101
- package/CapLabel/index.js +1 -3
- package/CapLabel/styles.js +212 -250
- package/CapRow/CapRow.js +10 -111
- package/CapRow/index.js +1 -3
- package/CapRow/styles.js +6 -47
- package/CapTable/loadable.js +4 -4
- package/CapTable/styles.js +1 -1
- package/CapTooltip/CapTooltip.js +25 -87
- package/CapTooltip/index.js +1 -3
- package/CapTooltip/styles.js +27 -19
- package/CapUnifiedSelect/CapUnifiedSelect.js +66 -308
- package/CapUnifiedSelect/index.js +4 -1
- package/CapUnifiedSelect/loadable.js +3 -0
- package/CapUnifiedSelect/styles.js +151 -255
- package/dist/235.index.js +2 -0
- package/dist/235.index.js.LICENSE.txt +29 -0
- package/dist/603.index.js +1 -0
- package/dist/CapInput/CapInput.js +66 -0
- package/dist/CapInput/Number.js +42 -0
- package/dist/CapInput/Search.js +35 -0
- package/dist/CapInput/TextArea.js +42 -0
- package/dist/CapInput/index.js +15 -0
- package/dist/CapInput/messages.js +32 -0
- package/dist/CapInput/styles.js +11 -0
- package/dist/CapTable/CapTable.js +148 -0
- package/dist/CapTable/index.js +9 -0
- package/dist/CapTable/loadable.js +23 -0
- package/dist/CapTable/styles.js +26 -0
- package/dist/LocaleHoc/index.js +40 -0
- package/dist/esm/CapHeading/CapHeading.js +41 -0
- package/dist/esm/CapHeading/index.js +1 -0
- package/dist/esm/CapHeading/styles.js +123 -0
- package/dist/esm/CapInfoNote/CapInfoNote.js +62 -0
- package/dist/esm/CapInfoNote/index.js +1 -0
- package/dist/esm/CapInfoNote/styles.js +6 -0
- package/dist/esm/CapInput/CapInput.js +57 -0
- package/dist/esm/CapInput/Number.js +35 -0
- package/dist/esm/CapInput/Search.js +28 -0
- package/dist/esm/CapInput/TextArea.js +35 -0
- package/dist/esm/CapInput/index.js +8 -0
- package/dist/esm/CapInput/loadable.js +9 -0
- package/dist/esm/CapInput/messages.js +25 -0
- package/dist/esm/CapInput/styles.js +3 -0
- package/dist/esm/CapLabel/CapLabel.js +50 -0
- package/dist/esm/CapLabel/index.js +1 -0
- package/dist/esm/CapLabel/styles.js +219 -0
- package/dist/esm/CapRow/CapRow.js +22 -0
- package/dist/esm/CapRow/index.js +1 -0
- package/dist/esm/CapRow/styles.js +5 -0
- package/dist/esm/CapTable/CapTable.js +140 -0
- package/dist/esm/CapTable/index.js +2 -0
- package/dist/esm/CapTable/loadable.js +12 -0
- package/dist/esm/CapTable/styles.js +17 -0
- package/dist/esm/CapTooltip/CapTooltip.js +34 -0
- package/dist/esm/CapTooltip/index.js +1 -0
- package/dist/esm/CapTooltip/styles.js +6 -0
- package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +101 -0
- package/dist/esm/CapUnifiedSelect/index.js +3 -0
- package/dist/esm/CapUnifiedSelect/loadable.js +4 -0
- package/dist/esm/CapUnifiedSelect/messages.js +23 -0
- package/dist/esm/CapUnifiedSelect/styles.js +15 -0
- package/dist/esm/LocaleHoc/index.js +31 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/styled/index.js +5 -0
- package/dist/esm/styled/variables.js +88 -0
- package/dist/esm/translations/en.js +329 -0
- package/dist/index.js +39 -0
- package/dist/index.js.LICENSE.txt +7 -0
- package/dist/styled/index.js +22 -0
- package/dist/styled/variables.js +94 -0
- package/dist/translations/en.js +335 -0
- package/index.js +1 -12
- package/package.json +11 -5
- package/.DS_Store +0 -0
- package/CapIcon/CapIcon.js +0 -183
- package/CapIcon/index.js +0 -3
- package/CapIcon/styles.js +0 -76
- package/CapSkeleton/CapSkeleton.js +0 -17
- package/CapSkeleton/index.js +0 -1
- package/CapSpin/CapSpin.js +0 -23
- package/CapSpin/index.js +0 -1
- package/CapTestSelect/CapTestSelect.js +0 -47
- package/CapTestSelect/index.js +0 -1
- package/CapTooltipWithInfo/CapTooltipWithInfo.js +0 -82
- package/CapTooltipWithInfo/index.js +0 -3
- package/CapTooltipWithInfo/styles.js +0 -22
- package/assets/upload.svg +0 -3
- package/utils/index.js +0 -1
- package/utils/withStyles.js +0 -24
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import * as styledVars from '../styled/variables';
|
|
3
|
+
var headings = {
|
|
4
|
+
h0: {
|
|
5
|
+
fontSize: '28px',
|
|
6
|
+
fontWeight: '500',
|
|
7
|
+
color: styledVars.CAP_G01,
|
|
8
|
+
lineHeight: '36px'
|
|
9
|
+
},
|
|
10
|
+
h1: {
|
|
11
|
+
fontSize: '24px',
|
|
12
|
+
fontWeight: '500',
|
|
13
|
+
color: styledVars.CAP_G01,
|
|
14
|
+
lineHeight: '32px'
|
|
15
|
+
},
|
|
16
|
+
h2: {
|
|
17
|
+
fontSize: '20px',
|
|
18
|
+
fontWeight: '500',
|
|
19
|
+
color: styledVars.CAP_G01,
|
|
20
|
+
lineHeight: '28px'
|
|
21
|
+
},
|
|
22
|
+
h3: {
|
|
23
|
+
fontSize: '16px',
|
|
24
|
+
fontWeight: '500',
|
|
25
|
+
color: styledVars.CAP_G01,
|
|
26
|
+
lineHeight: '24px'
|
|
27
|
+
},
|
|
28
|
+
h4: {
|
|
29
|
+
fontSize: '14px',
|
|
30
|
+
fontWeight: '500',
|
|
31
|
+
color: styledVars.CAP_G01,
|
|
32
|
+
lineHeight: '20px'
|
|
33
|
+
},
|
|
34
|
+
h5: {
|
|
35
|
+
fontSize: '14px',
|
|
36
|
+
fontWeight: 'normal',
|
|
37
|
+
color: styledVars.CAP_G01,
|
|
38
|
+
lineHeight: '20px'
|
|
39
|
+
},
|
|
40
|
+
h6: {
|
|
41
|
+
color: styledVars.CAP_G04,
|
|
42
|
+
fontSize: '14px',
|
|
43
|
+
fontWeight: 'normal',
|
|
44
|
+
lineHeight: '20px'
|
|
45
|
+
},
|
|
46
|
+
h7: {
|
|
47
|
+
fontSize: '20px',
|
|
48
|
+
fontWeight: '500',
|
|
49
|
+
color: styledVars.CAP_G04,
|
|
50
|
+
lineHeight: '28px'
|
|
51
|
+
},
|
|
52
|
+
h8: {
|
|
53
|
+
fontSize: '14px',
|
|
54
|
+
fontWeight: '400',
|
|
55
|
+
color: styledVars.CAP_G01,
|
|
56
|
+
lineHeight: '20px'
|
|
57
|
+
},
|
|
58
|
+
h9: {
|
|
59
|
+
fontSize: '14px',
|
|
60
|
+
fontWeight: '500',
|
|
61
|
+
color: styledVars.CAP_WHITE,
|
|
62
|
+
lineHeight: '20px'
|
|
63
|
+
},
|
|
64
|
+
h10: {
|
|
65
|
+
fontSize: '12px',
|
|
66
|
+
fontWeight: '500',
|
|
67
|
+
color: styledVars.CAP_G01,
|
|
68
|
+
lineHeight: '16px'
|
|
69
|
+
},
|
|
70
|
+
label1: {
|
|
71
|
+
color: styledVars.CAP_G04,
|
|
72
|
+
fontSize: '12px',
|
|
73
|
+
fontWeight: 'normal',
|
|
74
|
+
lineHeight: '20px'
|
|
75
|
+
},
|
|
76
|
+
label2: {
|
|
77
|
+
color: styledVars.CAP_G01,
|
|
78
|
+
fontSize: '12px',
|
|
79
|
+
fontWeight: 'normal',
|
|
80
|
+
lineHeight: '20px'
|
|
81
|
+
},
|
|
82
|
+
label3: {
|
|
83
|
+
color: styledVars.CAP_G05,
|
|
84
|
+
fontSize: '12px',
|
|
85
|
+
fontWeight: 'normal',
|
|
86
|
+
lineHeight: '20px'
|
|
87
|
+
},
|
|
88
|
+
label4: {
|
|
89
|
+
color: styledVars.CAP_G04,
|
|
90
|
+
fontSize: '12px',
|
|
91
|
+
fontWeight: 'normal',
|
|
92
|
+
lineHeight: '16px'
|
|
93
|
+
},
|
|
94
|
+
label5: {
|
|
95
|
+
color: styledVars.CAP_G04,
|
|
96
|
+
fontSize: '16px',
|
|
97
|
+
fontWeight: 'normal',
|
|
98
|
+
lineHeight: '24px'
|
|
99
|
+
},
|
|
100
|
+
label6: {
|
|
101
|
+
color: styledVars.CAP_G01,
|
|
102
|
+
fontSize: '16px',
|
|
103
|
+
fontWeight: 'normal',
|
|
104
|
+
lineHeight: '24px'
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var headingStyles = css(["font-size:", ";font-weight:", ";color:", ";line-height:", ";margin:0;padding:0;"], function (props) {
|
|
108
|
+
return headings[props.type].fontSize;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return headings[props.type].fontWeight;
|
|
111
|
+
}, function (props) {
|
|
112
|
+
return headings[props.type].color;
|
|
113
|
+
}, function (props) {
|
|
114
|
+
return headings[props.type].lineHeight;
|
|
115
|
+
});
|
|
116
|
+
export var HeadingWrapper = styled.div.withConfig({
|
|
117
|
+
displayName: "HeadingWrapper",
|
|
118
|
+
componentId: "sc-14c6fxa-0"
|
|
119
|
+
})(["", ""], headingStyles);
|
|
120
|
+
export var HeadingSpan = styled.span.withConfig({
|
|
121
|
+
displayName: "HeadingSpan",
|
|
122
|
+
componentId: "sc-14c6fxa-1"
|
|
123
|
+
})(["", " display:inline-block;"], headingStyles);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["message", "style", "noteText", "type", "className"];
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import PropTypes from 'prop-types';
|
|
13
|
+
import { Alert } from 'antd';
|
|
14
|
+
import { InfoNoteWrapper } from './styles';
|
|
15
|
+
import CapLabel from '../CapLabel';
|
|
16
|
+
import CapRow from '../CapRow';
|
|
17
|
+
var Note = function Note(_ref) {
|
|
18
|
+
var noteText = _ref.noteText;
|
|
19
|
+
return /*#__PURE__*/React.createElement(CapLabel.Inline, {
|
|
20
|
+
type: "label4",
|
|
21
|
+
className: "note-text"
|
|
22
|
+
}, noteText);
|
|
23
|
+
};
|
|
24
|
+
Note.propTypes = {
|
|
25
|
+
noteText: PropTypes.string
|
|
26
|
+
};
|
|
27
|
+
var CapInfoNote = function CapInfoNote(_ref2) {
|
|
28
|
+
var message = _ref2.message,
|
|
29
|
+
style = _ref2.style,
|
|
30
|
+
noteText = _ref2.noteText,
|
|
31
|
+
_ref2$type = _ref2.type,
|
|
32
|
+
type = _ref2$type === void 0 ? 'info' : _ref2$type,
|
|
33
|
+
className = _ref2.className,
|
|
34
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
35
|
+
return /*#__PURE__*/React.createElement(InfoNoteWrapper, null, /*#__PURE__*/React.createElement(Alert, _extends({
|
|
36
|
+
message: /*#__PURE__*/React.createElement(CapRow, {
|
|
37
|
+
className: "note-message-container"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Note, {
|
|
39
|
+
noteText: noteText
|
|
40
|
+
}), ":", /*#__PURE__*/React.createElement(CapRow, {
|
|
41
|
+
className: "message-text"
|
|
42
|
+
}, message)),
|
|
43
|
+
className: className,
|
|
44
|
+
type: type,
|
|
45
|
+
showIcon: true,
|
|
46
|
+
style: _objectSpread({
|
|
47
|
+
marginTop: '0.857rem',
|
|
48
|
+
marginBottom: '0.857rem'
|
|
49
|
+
}, style)
|
|
50
|
+
}, rest)));
|
|
51
|
+
};
|
|
52
|
+
CapInfoNote.propTypes = {
|
|
53
|
+
message: PropTypes.node,
|
|
54
|
+
style: PropTypes.object,
|
|
55
|
+
noteText: PropTypes.string,
|
|
56
|
+
type: PropTypes.string,
|
|
57
|
+
className: PropTypes.string
|
|
58
|
+
};
|
|
59
|
+
CapInfoNote.defaultProps = {
|
|
60
|
+
type: 'info'
|
|
61
|
+
};
|
|
62
|
+
export default CapInfoNote;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CapInfoNote';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import * as styledVars from '../styled/variables';
|
|
3
|
+
export var InfoNoteWrapper = styled.div.withConfig({
|
|
4
|
+
displayName: "InfoNoteWrapper",
|
|
5
|
+
componentId: "sc-1b8g28t-0"
|
|
6
|
+
})([".note-text{padding-left:", ";white-space:nowrap;line-height:inherit;}.note-message-container{display:flex;.message-text{margin-left:0.22rem;}}.ant-alert{padding:8px 12px;border-radius:", ";.ant-alert-icon{font-size:", ";top:9px;}&.ant-alert-info{background-color:", ";border:1px solid ", ";.ant-alert-icon{color:", ";}}&.ant-alert-success{background-color:", ";border:1px solid ", ";.ant-alert-icon{color:", ";}}&.ant-alert-warning{background-color:", ";border:1px solid ", ";.ant-alert-icon{color:", ";}}&.ant-alert-error{background-color:", ";border:1px solid ", ";.ant-alert-icon{color:", ";}}}"], styledVars.CAP_SPACE_24, styledVars.RADIUS_04, styledVars.ICON_SIZE_S, styledVars.CAP_G09, styledVars.CAP_G07, styledVars.CAP_G01, styledVars.CAP_COLOR_01, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.base, styledVars.CAP_COLOR_02, styledVars.CAP_ORANGE, styledVars.CAP_ORANGE, styledVars.CAP_COLOR_05, styledVars.CAP_RED, styledVars.CAP_RED);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var _excluded = ["alwaysShowFocus", "errorMessage", "isVerified", "suffix", "showSuffix"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React, { useRef, useEffect } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Input } from 'antd';
|
|
8
|
+
import { WarningOutlined, CheckCircleOutlined } from '@ant-design/icons';
|
|
9
|
+
import styled from 'styled-components';
|
|
10
|
+
import * as styledVars from '../styled/variables';
|
|
11
|
+
var StyledIcon = styled.span.withConfig({
|
|
12
|
+
displayName: "StyledIcon",
|
|
13
|
+
componentId: "sc-1ghbg8a-0"
|
|
14
|
+
})(["color:", ";color:", ";"], function (props) {
|
|
15
|
+
return props.status === "error" && styledVars.CAP_RED;
|
|
16
|
+
}, function (props) {
|
|
17
|
+
return props.status === "success" && styledVars.CAP_PRIMARY.base;
|
|
18
|
+
});
|
|
19
|
+
var CapInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
20
|
+
var alwaysShowFocus = props.alwaysShowFocus,
|
|
21
|
+
errorMessage = props.errorMessage,
|
|
22
|
+
isVerified = props.isVerified,
|
|
23
|
+
suffix = props.suffix,
|
|
24
|
+
_props$showSuffix = props.showSuffix,
|
|
25
|
+
showSuffix = _props$showSuffix === void 0 ? true : _props$showSuffix,
|
|
26
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
27
|
+
var inputRef = useRef(null);
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (alwaysShowFocus && inputRef.current) {
|
|
30
|
+
inputRef.current.focus();
|
|
31
|
+
}
|
|
32
|
+
}, [alwaysShowFocus]);
|
|
33
|
+
var inputSuffix = errorMessage && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
34
|
+
status: "error"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(WarningOutlined, null)) || isVerified && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
36
|
+
status: "success"
|
|
37
|
+
}, /*#__PURE__*/React.createElement(CheckCircleOutlined, null)) || suffix || null;
|
|
38
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {
|
|
39
|
+
ref: ref || inputRef,
|
|
40
|
+
suffix: showSuffix === false ? null : inputSuffix,
|
|
41
|
+
status: errorMessage ? 'error' : undefined
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
CapInput.displayName = 'CapInput';
|
|
45
|
+
CapInput.propTypes = {
|
|
46
|
+
alwaysShowFocus: PropTypes.bool,
|
|
47
|
+
errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
48
|
+
isVerified: PropTypes.bool,
|
|
49
|
+
size: PropTypes.oneOf(['large', 'middle', 'small']),
|
|
50
|
+
suffix: PropTypes.node,
|
|
51
|
+
showSuffix: PropTypes.bool
|
|
52
|
+
};
|
|
53
|
+
CapInput.defaultProps = {
|
|
54
|
+
size: 'large',
|
|
55
|
+
showSuffix: true
|
|
56
|
+
};
|
|
57
|
+
export default CapInput;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _excluded = ["size"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { InputNumber } from 'antd';
|
|
8
|
+
var CapInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
|
+
var _props$size = props.size,
|
|
10
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
11
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement(InputNumber, _extends({}, rest, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
size: size
|
|
15
|
+
}));
|
|
16
|
+
});
|
|
17
|
+
CapInputNumber.displayName = 'CapInputNumber';
|
|
18
|
+
CapInputNumber.propTypes = {
|
|
19
|
+
size: PropTypes.oneOf(['large', 'middle', 'small']),
|
|
20
|
+
min: PropTypes.number,
|
|
21
|
+
max: PropTypes.number,
|
|
22
|
+
step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
23
|
+
precision: PropTypes.number,
|
|
24
|
+
decimalSeparator: PropTypes.string,
|
|
25
|
+
formatter: PropTypes.func,
|
|
26
|
+
parser: PropTypes.func,
|
|
27
|
+
controls: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
|
|
28
|
+
keyboard: PropTypes.bool,
|
|
29
|
+
stringMode: PropTypes.bool
|
|
30
|
+
};
|
|
31
|
+
CapInputNumber.defaultProps = {
|
|
32
|
+
size: 'large',
|
|
33
|
+
keyboard: true
|
|
34
|
+
};
|
|
35
|
+
export default CapInputNumber;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var _excluded = ["size"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Input } from 'antd';
|
|
8
|
+
var Search = Input.Search;
|
|
9
|
+
var CapInputSearch = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
|
+
var _props$size = props.size,
|
|
11
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
13
|
+
return /*#__PURE__*/React.createElement(Search, _extends({}, rest, {
|
|
14
|
+
ref: ref,
|
|
15
|
+
size: size
|
|
16
|
+
}));
|
|
17
|
+
});
|
|
18
|
+
CapInputSearch.displayName = 'CapInputSearch';
|
|
19
|
+
CapInputSearch.propTypes = {
|
|
20
|
+
size: PropTypes.oneOf(['large', 'middle', 'small']),
|
|
21
|
+
enterButton: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
22
|
+
loading: PropTypes.bool,
|
|
23
|
+
onSearch: PropTypes.func
|
|
24
|
+
};
|
|
25
|
+
CapInputSearch.defaultProps = {
|
|
26
|
+
size: 'large'
|
|
27
|
+
};
|
|
28
|
+
export default CapInputSearch;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _excluded = ["size"];
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Input } from 'antd';
|
|
8
|
+
var TextArea = Input.TextArea;
|
|
9
|
+
var CapInputTextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
|
+
var _props$size = props.size,
|
|
11
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
12
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
13
|
+
return /*#__PURE__*/React.createElement(TextArea, _extends({}, rest, {
|
|
14
|
+
ref: ref,
|
|
15
|
+
size: size
|
|
16
|
+
}));
|
|
17
|
+
});
|
|
18
|
+
CapInputTextArea.displayName = 'CapInputTextArea';
|
|
19
|
+
CapInputTextArea.propTypes = {
|
|
20
|
+
size: PropTypes.oneOf(['large', 'middle', 'small']),
|
|
21
|
+
autoSize: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
22
|
+
minRows: PropTypes.number,
|
|
23
|
+
maxRows: PropTypes.number
|
|
24
|
+
})]),
|
|
25
|
+
rows: PropTypes.number,
|
|
26
|
+
maxLength: PropTypes.number,
|
|
27
|
+
showCount: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
28
|
+
formatter: PropTypes.func
|
|
29
|
+
})])
|
|
30
|
+
};
|
|
31
|
+
CapInputTextArea.defaultProps = {
|
|
32
|
+
size: 'large',
|
|
33
|
+
rows: 4
|
|
34
|
+
};
|
|
35
|
+
export default CapInputTextArea;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* CapInput Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the CapInput component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
var scope = 'blaze.components.CapInput';
|
|
8
|
+
export default defineMessages({
|
|
9
|
+
placeholder: {
|
|
10
|
+
id: "".concat(scope, ".placeholder"),
|
|
11
|
+
defaultMessage: 'Enter text...'
|
|
12
|
+
},
|
|
13
|
+
searchPlaceholder: {
|
|
14
|
+
id: "".concat(scope, ".searchPlaceholder"),
|
|
15
|
+
defaultMessage: 'Search...'
|
|
16
|
+
},
|
|
17
|
+
textAreaPlaceholder: {
|
|
18
|
+
id: "".concat(scope, ".textAreaPlaceholder"),
|
|
19
|
+
defaultMessage: 'Enter your text here...'
|
|
20
|
+
},
|
|
21
|
+
numberPlaceholder: {
|
|
22
|
+
id: "".concat(scope, ".numberPlaceholder"),
|
|
23
|
+
defaultMessage: 'Enter number...'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
import * as styledVars from '../styled/variables';
|
|
3
|
+
export var inputStyles = css(["&.ant-input,&.ant-input-affix-wrapper,&.ant-input-number,&.ant-input-textarea{font-family:", ";border-radius:", ";transition:", ";&:hover{border-color:", ";}&:focus,&.ant-input-affix-wrapper-focused{border-color:", ";box-shadow:none;}&.ant-input-status-error,&.ant-input-affix-wrapper-status-error,&.ant-input-number-status-error{border-color:", ";&:hover{border-color:", ";}&:focus,&.ant-input-affix-wrapper-focused{border-color:", ";box-shadow:none;}}&.ant-input-disabled,&.ant-input-affix-wrapper-disabled{background-color:", ";cursor:not-allowed;}}&.ant-input-lg,&.ant-input-affix-wrapper-lg{font-size:14px;padding:10px 12px;}&.ant-input-textarea{.ant-input{font-family:", ";}}&.ant-input-number{width:100%;.ant-input-number-handler-wrap{opacity:1;}}&.ant-input-search{.ant-input-search-button{background-color:", ";border-color:", ";&:hover{background-color:", ";border-color:", ";}}}"], styledVars.FONT_FAMILY, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_G11, styledVars.CAP_G01, styledVars.CAP_RED, styledVars.CAP_RED, styledVars.CAP_RED, styledVars.CAP_G08, styledVars.FONT_FAMILY, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.hover, styledVars.CAP_PRIMARY.hover);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var _excluded = ["type", "children", "fontWeight", "lineHeight"],
|
|
2
|
+
_excluded2 = ["type", "children", "fontWeight", "lineHeight"];
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { LabelWrapper, LabelInline } from './styles';
|
|
9
|
+
var CapLabel = function CapLabel(_ref) {
|
|
10
|
+
var _ref$type = _ref.type,
|
|
11
|
+
type = _ref$type === void 0 ? 'label1' : _ref$type,
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
fontWeight = _ref.fontWeight,
|
|
14
|
+
lineHeight = _ref.lineHeight,
|
|
15
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
return /*#__PURE__*/React.createElement(LabelWrapper, _extends({
|
|
17
|
+
type: type,
|
|
18
|
+
fontWeight: fontWeight,
|
|
19
|
+
lineHeight: lineHeight
|
|
20
|
+
}, rest), children);
|
|
21
|
+
};
|
|
22
|
+
CapLabel.propTypes = {
|
|
23
|
+
type: PropTypes.oneOf(['label1', 'label2', 'label3', 'label4', 'label5', 'label6', 'label7', 'label8', 'label9', 'label10', 'label11', 'label12', 'label13', 'label14', 'label15', 'label16', 'label17', 'label18', 'label19', 'label20', 'label21', 'label22', 'label23', 'label24', 'label25', 'label26', 'label27', 'label28', 'label29', 'label30', 'label31', 'label32', 'label33']),
|
|
24
|
+
children: PropTypes.node,
|
|
25
|
+
fontWeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
26
|
+
lineHeight: PropTypes.string
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Inline span version
|
|
30
|
+
var CapLabelInline = function CapLabelInline(_ref2) {
|
|
31
|
+
var _ref2$type = _ref2.type,
|
|
32
|
+
type = _ref2$type === void 0 ? 'label1' : _ref2$type,
|
|
33
|
+
children = _ref2.children,
|
|
34
|
+
fontWeight = _ref2.fontWeight,
|
|
35
|
+
lineHeight = _ref2.lineHeight,
|
|
36
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
37
|
+
return /*#__PURE__*/React.createElement(LabelInline, _extends({
|
|
38
|
+
type: type,
|
|
39
|
+
fontWeight: fontWeight,
|
|
40
|
+
lineHeight: lineHeight
|
|
41
|
+
}, rest), children);
|
|
42
|
+
};
|
|
43
|
+
CapLabelInline.propTypes = {
|
|
44
|
+
type: PropTypes.oneOf(['label1', 'label2', 'label3', 'label4', 'label5', 'label6', 'label7', 'label8', 'label9', 'label10', 'label11', 'label12', 'label13', 'label14', 'label15', 'label16', 'label17', 'label18', 'label19', 'label20', 'label21', 'label22', 'label23', 'label24', 'label25', 'label26', 'label27', 'label28', 'label29', 'label30', 'label31', 'label32', 'label33']),
|
|
45
|
+
children: PropTypes.node,
|
|
46
|
+
fontWeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
47
|
+
lineHeight: PropTypes.string
|
|
48
|
+
};
|
|
49
|
+
CapLabel.Inline = CapLabelInline;
|
|
50
|
+
export default CapLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CapLabel';
|