@councilbox/councilbox-ui 0.1.0 → 0.1.3
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/HOCs/useWindowSize.js +8 -5
- package/dist/build-index.js +56 -0
- package/dist/components/Avatar/Avatar.js +1 -6
- package/dist/components/Button/Button.js +85 -21
- package/dist/components/Button/Button.stories.js +2 -1
- package/dist/components/Button/button.css +34 -6
- package/dist/components/ButtonBasic/ButtonBasic.css +3 -0
- package/dist/components/ButtonBasic/ButtonBasic.js +117 -0
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +72 -0
- package/dist/components/DrawerPanel/DrawerPanel.css +33 -0
- package/dist/components/DrawerPanel/DrawerPanel.js +165 -0
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +38 -0
- package/dist/components/DrawerPanel/DrawerPanelPrueba.js +52 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +82 -0
- package/dist/components/DropDown/DropDown.css +0 -0
- package/dist/components/DropDown/DropDown.js +162 -0
- package/dist/components/DropDown/DropDown.stories.js +43 -0
- package/dist/components/Header/Header.js +246 -43
- package/dist/components/Header/Header.stories.js +31 -10
- package/dist/components/Header/header.css +121 -19
- package/dist/components/IconButton/IconButton.css +0 -0
- package/dist/components/IconButton/IconButton.js +72 -0
- package/dist/components/IconButton/IconButton.stories.js +27 -0
- package/dist/components/InputPassword/InputPassword.css +28 -0
- package/dist/components/InputPassword/InputPassword.js +38 -163
- package/dist/components/InputPassword/InputPassword.stories.js +33 -2
- package/dist/components/InputText/InputText.css +18 -0
- package/dist/components/InputText/InputText.js +84 -74
- package/dist/components/InputText/InputText.stories.js +26 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.css +0 -0
- package/dist/components/MenuLateralRight/MenuLateralRight.js +30 -0
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +34 -0
- package/dist/components/Modal/Modal.css +0 -0
- package/dist/components/Modal/Modal.js +166 -0
- package/dist/components/Modal/Modal.stories.js +49 -0
- package/dist/components/Spacing/Spacing.js +1 -1
- package/dist/components/TextInput/TextInput.css +12 -0
- package/dist/components/TextInput/TextInput.js +214 -0
- package/dist/components/TextInput/TextInput.stories.js +52 -0
- package/dist/components/ThemeProvider/Colors.js +24 -95
- package/dist/components/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/components/Typography/Typography.js +7 -8
- package/dist/styles/main.css +21 -71
- package/dist/styles/stylesheet.js +6 -39
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DesignMenuLateralRightTemplate = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _MenuLateralRight = _interopRequireDefault(require("./MenuLateralRight"));
|
|
11
|
+
|
|
12
|
+
var _MenuLateralRight2 = _interopRequireDefault(require("./MenuLateralRight.stories"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: 'Example/DropDown',
|
|
18
|
+
component: _MenuLateralRight.default
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var TemplateMenuLateralRight = function TemplateMenuLateralRight(args) {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_MenuLateralRight2.default, args);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
TemplateMenuLateralRight.displayName = "TemplateMenuLateralRight";
|
|
27
|
+
var DesignMenuLateralRightTemplate = TemplateMenuLateralRight.bind({});
|
|
28
|
+
exports.DesignMenuLateralRightTemplate = DesignMenuLateralRightTemplate;
|
|
29
|
+
DesignMenuLateralRightTemplate.parameters = {
|
|
30
|
+
controls: {
|
|
31
|
+
disable: true
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
DesignMenuLateralRightTemplate.args = {};
|
|
File without changes
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
require("./Modal.css");
|
|
15
|
+
|
|
16
|
+
var _material = require("@mui/material");
|
|
17
|
+
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
19
|
+
|
|
20
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
21
|
+
|
|
22
|
+
var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
var Modal = function Modal(_ref) {
|
|
37
|
+
var title = _ref.title,
|
|
38
|
+
fullWidth = _ref.fullWidth,
|
|
39
|
+
_ref$id = _ref.id,
|
|
40
|
+
id = _ref$id === void 0 ? 'modal' : _ref$id,
|
|
41
|
+
fullScreen = _ref.fullScreen,
|
|
42
|
+
buttonAccept = _ref.buttonAccept,
|
|
43
|
+
buttonCancel = _ref.buttonCancel,
|
|
44
|
+
_ref$successAction = _ref.successAction,
|
|
45
|
+
successAction = _ref$successAction === void 0 ? false : _ref$successAction,
|
|
46
|
+
open = _ref.open,
|
|
47
|
+
requestClose = _ref.requestClose,
|
|
48
|
+
loadingAction = _ref.loadingAction,
|
|
49
|
+
acceptAction = _ref.acceptAction,
|
|
50
|
+
cancelAction = _ref.cancelAction,
|
|
51
|
+
body = _ref.body,
|
|
52
|
+
hideAccept = _ref.hideAccept,
|
|
53
|
+
extraActions = _ref.extraActions,
|
|
54
|
+
classNameDialog = _ref.classNameDialog,
|
|
55
|
+
PaperProps = _ref.PaperProps,
|
|
56
|
+
widthModal = _ref.widthModal,
|
|
57
|
+
actions = _ref.actions;
|
|
58
|
+
|
|
59
|
+
var _useCouncilboxTheme = (0, _CouncilboxThemeContext.useCouncilboxTheme)(),
|
|
60
|
+
size = _useCouncilboxTheme.size;
|
|
61
|
+
|
|
62
|
+
var buttons = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, !!buttonCancel && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
63
|
+
sx: {
|
|
64
|
+
border: '1px solid var(--neutral50)'
|
|
65
|
+
},
|
|
66
|
+
variant: "tertiary",
|
|
67
|
+
text: buttonCancel,
|
|
68
|
+
id: "".concat(id, "-button-cancel"),
|
|
69
|
+
onClick: cancelAction || requestClose
|
|
70
|
+
})), extraActions && /*#__PURE__*/_react.default.createElement("div", null, extraActions), !hideAccept && !!buttonAccept && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
71
|
+
text: buttonAccept,
|
|
72
|
+
id: "".concat(id, "-button-accept"),
|
|
73
|
+
loading: loadingAction,
|
|
74
|
+
success: successAction,
|
|
75
|
+
color: "primary",
|
|
76
|
+
onClick: acceptAction
|
|
77
|
+
})));
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_material.Dialog, {
|
|
80
|
+
className: classNameDialog,
|
|
81
|
+
fullWidth: size === 'sm' || fullWidth,
|
|
82
|
+
fullScreen: fullScreen,
|
|
83
|
+
maxWidth: false,
|
|
84
|
+
id: id,
|
|
85
|
+
open: open || false,
|
|
86
|
+
onClose: requestClose,
|
|
87
|
+
PaperProps: {
|
|
88
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, widthModal), PaperProps ? PaperProps.style : {}), size === 'sm' ? {
|
|
89
|
+
margin: 0
|
|
90
|
+
} : {})
|
|
91
|
+
}
|
|
92
|
+
}, !!title && /*#__PURE__*/_react.default.createElement(_material.DialogTitle, {
|
|
93
|
+
sx: {
|
|
94
|
+
padding: '1.5rem'
|
|
95
|
+
}
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
97
|
+
variant: "L",
|
|
98
|
+
sx: {
|
|
99
|
+
fontWeight: '700',
|
|
100
|
+
color: '#333333'
|
|
101
|
+
}
|
|
102
|
+
}, title)), /*#__PURE__*/_react.default.createElement(_material.DialogContent, {
|
|
103
|
+
sx: {
|
|
104
|
+
minWidth: '40vw',
|
|
105
|
+
maxWidth: size === 'sm' ? '100%' : '95vw'
|
|
106
|
+
}
|
|
107
|
+
}, body), (!!buttonCancel || !!buttonAccept) && /*#__PURE__*/_react.default.createElement(_material.DialogActions, {
|
|
108
|
+
sx: {
|
|
109
|
+
padding: '16px',
|
|
110
|
+
margin: '0px',
|
|
111
|
+
minWidth: '25px'
|
|
112
|
+
}
|
|
113
|
+
}, buttons), actions && /*#__PURE__*/_react.default.createElement(_material.DialogActions, {
|
|
114
|
+
sx: {
|
|
115
|
+
padding: '16px',
|
|
116
|
+
margin: '0px',
|
|
117
|
+
minWidth: '25px'
|
|
118
|
+
}
|
|
119
|
+
}, actions));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
Modal.displayName = "Modal";
|
|
123
|
+
var _default = Modal;
|
|
124
|
+
exports.default = _default;
|
|
125
|
+
Modal.propTypes = {
|
|
126
|
+
title: _propTypes.default.string,
|
|
127
|
+
fullWidth: _propTypes.default.bool,
|
|
128
|
+
id: _propTypes.default.string,
|
|
129
|
+
fullScreen: _propTypes.default.bool,
|
|
130
|
+
buttonAccept: _propTypes.default.string,
|
|
131
|
+
buttonCancel: _propTypes.default.string,
|
|
132
|
+
successAction: _propTypes.default.bool,
|
|
133
|
+
open: _propTypes.default.bool,
|
|
134
|
+
requestClose: _propTypes.default.func,
|
|
135
|
+
loadingAction: _propTypes.default.bool,
|
|
136
|
+
acceptAction: _propTypes.default.func,
|
|
137
|
+
cancelAction: _propTypes.default.func,
|
|
138
|
+
body: _propTypes.default.node,
|
|
139
|
+
hideAccept: _propTypes.default.bool,
|
|
140
|
+
extraActions: _propTypes.default.node,
|
|
141
|
+
classNameDialog: _propTypes.default.string,
|
|
142
|
+
PaperProps: _propTypes.default.object,
|
|
143
|
+
widthModal: _propTypes.default.object,
|
|
144
|
+
actions: _propTypes.default.node
|
|
145
|
+
};
|
|
146
|
+
Modal.defaultProps = {
|
|
147
|
+
title: '',
|
|
148
|
+
fullWidth: false,
|
|
149
|
+
id: 'modal',
|
|
150
|
+
fullScreen: false,
|
|
151
|
+
buttonAccept: '',
|
|
152
|
+
buttonCancel: '',
|
|
153
|
+
successAction: false,
|
|
154
|
+
open: false,
|
|
155
|
+
requestClose: undefined,
|
|
156
|
+
loadingAction: false,
|
|
157
|
+
acceptAction: undefined,
|
|
158
|
+
cancelAction: undefined,
|
|
159
|
+
body: '',
|
|
160
|
+
hideAccept: false,
|
|
161
|
+
extraActions: undefined,
|
|
162
|
+
classNameDialog: '',
|
|
163
|
+
PaperProps: {},
|
|
164
|
+
widthModal: {},
|
|
165
|
+
actions: undefined
|
|
166
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/Modal',
|
|
16
|
+
component: _Modal.default,
|
|
17
|
+
argTypes: {
|
|
18
|
+
title: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'text'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
loading: {
|
|
24
|
+
options: [true, false],
|
|
25
|
+
control: {
|
|
26
|
+
type: 'boolean'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.default = _default;
|
|
32
|
+
|
|
33
|
+
var Template = function Template(args) {
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_Modal.default, args);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
Template.displayName = "Template";
|
|
38
|
+
var Default = Template.bind({});
|
|
39
|
+
exports.Default = Default;
|
|
40
|
+
Default.args = {
|
|
41
|
+
title: 'Titulo',
|
|
42
|
+
body: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")),
|
|
43
|
+
open: true,
|
|
44
|
+
buttonCancel: 'Cancelar',
|
|
45
|
+
buttonAccept: 'Aceptar',
|
|
46
|
+
widthModal: {
|
|
47
|
+
width: '50%'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./TextInput.css");
|
|
17
|
+
|
|
18
|
+
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
19
|
+
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "success", "width", "helperText", "fullWidth"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
33
|
+
var theme = _ref.theme;
|
|
34
|
+
return {
|
|
35
|
+
'& label.Mui-focused': {
|
|
36
|
+
color: 'primary',
|
|
37
|
+
borderWidth: '2px',
|
|
38
|
+
background: 'white',
|
|
39
|
+
top: '1px'
|
|
40
|
+
},
|
|
41
|
+
'& .MuiInput-underline:after': {
|
|
42
|
+
borderWidth: '2px'
|
|
43
|
+
},
|
|
44
|
+
'& .MuiFormHelperText-root': {
|
|
45
|
+
marginTop: 'var(--spacing4)',
|
|
46
|
+
marginLeft: '0px',
|
|
47
|
+
marginRight: '0px'
|
|
48
|
+
},
|
|
49
|
+
'& .MuiInputBase-input': {
|
|
50
|
+
height: '24px',
|
|
51
|
+
lineHeight: 'var(--spacing12)',
|
|
52
|
+
paddingRight: 'var(--spacing8)'
|
|
53
|
+
},
|
|
54
|
+
'& .MuiFormLabel-root': {
|
|
55
|
+
top: '-4px'
|
|
56
|
+
},
|
|
57
|
+
'& .Mui-error': {
|
|
58
|
+
color: theme.palette.error
|
|
59
|
+
},
|
|
60
|
+
'& .MuiInputLabel-shrink': {
|
|
61
|
+
top: '1px'
|
|
62
|
+
},
|
|
63
|
+
'& .MuiOutlinedInput-root': {
|
|
64
|
+
color: 'var(--gray4)',
|
|
65
|
+
paddingRight: 'var(--spacing8)',
|
|
66
|
+
'& fieldset': {
|
|
67
|
+
borderColor: 'var(--gray3)',
|
|
68
|
+
borderWidth: '1px',
|
|
69
|
+
'& legend': {
|
|
70
|
+
'& span': {
|
|
71
|
+
paddingLeft: 'var(--spacing4)',
|
|
72
|
+
paddingRight: 'var(--spacing4)'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
'&:hover fieldset': {
|
|
77
|
+
borderColor: 'var(--gray3)',
|
|
78
|
+
borderWidth: '2px'
|
|
79
|
+
},
|
|
80
|
+
'&:active fieldset': {
|
|
81
|
+
borderColor: 'var(--gray4)',
|
|
82
|
+
borderWidth: '2px'
|
|
83
|
+
},
|
|
84
|
+
'&.Mui-focused fieldset': {
|
|
85
|
+
borderColor: 'var(--gray4)',
|
|
86
|
+
borderWidth: '2px'
|
|
87
|
+
},
|
|
88
|
+
'&:focus-visible': {
|
|
89
|
+
outline: 'none',
|
|
90
|
+
'& fieldset': {
|
|
91
|
+
outline: 'none',
|
|
92
|
+
boxShadow: '0 0 0 3px white, 0 0 7px 4px var(--primary)',
|
|
93
|
+
border: '2px solid var(--gray4)'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
'& .MuiOutlinedInput-root.Mui-error': {
|
|
98
|
+
'& fieldset': {
|
|
99
|
+
borderColor: 'var(--error)'
|
|
100
|
+
},
|
|
101
|
+
'&:hover fieldset': {
|
|
102
|
+
borderColor: 'var(--error)',
|
|
103
|
+
borderWidth: '2px'
|
|
104
|
+
},
|
|
105
|
+
'&:active fieldset': {
|
|
106
|
+
borderColor: 'var(--error)',
|
|
107
|
+
borderWidth: '2px'
|
|
108
|
+
},
|
|
109
|
+
'&.Mui-focused fieldset': {
|
|
110
|
+
borderColor: 'var(--error)',
|
|
111
|
+
borderWidth: '2px'
|
|
112
|
+
},
|
|
113
|
+
'&:focus-visible': {
|
|
114
|
+
borderColor: 'var(--gray4)',
|
|
115
|
+
borderWidth: '2px',
|
|
116
|
+
boxShadow: '0 0 0 3px white, 0 0 7px 4px var(--primary)'
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
'& .MuiOutlinedInput-root.Mui-disabled': {
|
|
120
|
+
'& fieldset': {
|
|
121
|
+
borderColor: 'rgba(0,0,0,0.38)',
|
|
122
|
+
borderWidth: '1px'
|
|
123
|
+
},
|
|
124
|
+
'&:hover fieldset': {
|
|
125
|
+
borderColor: 'rgba(0,0,0,0.38)',
|
|
126
|
+
borderWidth: '1px'
|
|
127
|
+
},
|
|
128
|
+
'&:active fieldset': {
|
|
129
|
+
borderColor: 'rgba(0,0,0,0.38)',
|
|
130
|
+
borderWidth: '1px'
|
|
131
|
+
},
|
|
132
|
+
'&.Mui-focused fieldset': {
|
|
133
|
+
borderColor: 'rgba(0,0,0,0.38)',
|
|
134
|
+
borderWidth: '1px'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
var TextInput = function TextInput(_ref2) {
|
|
141
|
+
var id = _ref2.id,
|
|
142
|
+
className = _ref2.className,
|
|
143
|
+
onChange = _ref2.onChange,
|
|
144
|
+
label = _ref2.label,
|
|
145
|
+
disabled = _ref2.disabled,
|
|
146
|
+
error = _ref2.error,
|
|
147
|
+
helper = _ref2.helper,
|
|
148
|
+
success = _ref2.success,
|
|
149
|
+
width = _ref2.width,
|
|
150
|
+
helperText = _ref2.helperText,
|
|
151
|
+
fullWidth = _ref2.fullWidth,
|
|
152
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
153
|
+
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(CssTextField, _extends({
|
|
155
|
+
variant: 'standard',
|
|
156
|
+
id: id,
|
|
157
|
+
className: className,
|
|
158
|
+
sx: {
|
|
159
|
+
minWidth: width || '240px',
|
|
160
|
+
height: '48px'
|
|
161
|
+
},
|
|
162
|
+
label: label,
|
|
163
|
+
fullWidth: fullWidth,
|
|
164
|
+
onChange: onChange,
|
|
165
|
+
disabled: disabled,
|
|
166
|
+
error: error,
|
|
167
|
+
helperText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
+
className: "cbx-TextInput-items-center"
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
170
|
+
className: 'cbx-TextInput-infoBtn ri-information-line',
|
|
171
|
+
color: 'var(--error)'
|
|
172
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
173
|
+
variant: "XS",
|
|
174
|
+
color: 'var(--error)'
|
|
175
|
+
}, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
+
className: "cbx-TextInput-items-center"
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
178
|
+
className: 'cbx-TextInput-infoBtn ri-information-line'
|
|
179
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
180
|
+
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
181
|
+
variant: "XS"
|
|
182
|
+
}, helper))),
|
|
183
|
+
InputProps: {
|
|
184
|
+
endAdornment: success && /*#__PURE__*/_react.default.createElement("i", {
|
|
185
|
+
className: "cbx-TextInput-endAdornment ri-check-line"
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
}, props));
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
TextInput.displayName = "TextInput";
|
|
192
|
+
TextInput.propTypes = {
|
|
193
|
+
label: _propTypes.default.string,
|
|
194
|
+
helper: _propTypes.default.string,
|
|
195
|
+
width: _propTypes.default.string,
|
|
196
|
+
id: _propTypes.default.string,
|
|
197
|
+
className: _propTypes.default.string,
|
|
198
|
+
onChange: _propTypes.default.func,
|
|
199
|
+
disabled: _propTypes.default.bool,
|
|
200
|
+
error: _propTypes.default.string,
|
|
201
|
+
success: _propTypes.default.bool
|
|
202
|
+
};
|
|
203
|
+
TextInput.defaultProps = {
|
|
204
|
+
label: 'Example',
|
|
205
|
+
helper: '',
|
|
206
|
+
width: '',
|
|
207
|
+
id: '',
|
|
208
|
+
className: '',
|
|
209
|
+
onChange: undefined,
|
|
210
|
+
disabled: false,
|
|
211
|
+
error: ''
|
|
212
|
+
};
|
|
213
|
+
var _default = TextInput;
|
|
214
|
+
exports.default = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Success = exports.Helper = exports.Error = exports.Disabled = exports.Default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/TextInput',
|
|
16
|
+
component: _TextInput.default,
|
|
17
|
+
argTypes: {}
|
|
18
|
+
};
|
|
19
|
+
exports.default = _default;
|
|
20
|
+
|
|
21
|
+
var Template = function Template(args) {
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_TextInput.default, args);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
Template.displayName = "Template";
|
|
26
|
+
var Default = Template.bind({});
|
|
27
|
+
exports.Default = Default;
|
|
28
|
+
Default.args = {};
|
|
29
|
+
var Helper = Template.bind({});
|
|
30
|
+
exports.Helper = Helper;
|
|
31
|
+
Helper.args = {
|
|
32
|
+
value: 'Example',
|
|
33
|
+
helper: 'Helper'
|
|
34
|
+
};
|
|
35
|
+
var Success = Template.bind({});
|
|
36
|
+
exports.Success = Success;
|
|
37
|
+
Success.args = {
|
|
38
|
+
value: 'Example',
|
|
39
|
+
success: true
|
|
40
|
+
};
|
|
41
|
+
var Disabled = Template.bind({});
|
|
42
|
+
exports.Disabled = Disabled;
|
|
43
|
+
Disabled.args = {
|
|
44
|
+
value: 'Example',
|
|
45
|
+
disabled: true
|
|
46
|
+
};
|
|
47
|
+
var Error = Template.bind({});
|
|
48
|
+
exports.Error = Error;
|
|
49
|
+
Error.args = {
|
|
50
|
+
value: 'Example',
|
|
51
|
+
error: 'Error'
|
|
52
|
+
};
|
|
@@ -3,100 +3,29 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.colorsThemeBrand = void 0;
|
|
7
7
|
var colorsThemeBrand = {
|
|
8
8
|
primary: '#38398C',
|
|
9
|
-
secondary: '#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
secondary300: '#89F5FC',
|
|
33
|
-
secondary200: '#B5F5F9',
|
|
34
|
-
secondary100: '#D6FDFF',
|
|
35
|
-
secondary50: '#EAFDFF'
|
|
36
|
-
};
|
|
37
|
-
exports.colorsThemeSecondary = colorsThemeSecondary;
|
|
38
|
-
var colorsThemeNeutral = {
|
|
39
|
-
neutral900: '#222222',
|
|
40
|
-
neutral800: '#363636',
|
|
41
|
-
neutral700: '#4D4D4D',
|
|
42
|
-
neutral600: '#616161',
|
|
43
|
-
neutral500: '#767676',
|
|
44
|
-
neutral400: '#8C8C8C',
|
|
45
|
-
neutral300: '#AAAAAA',
|
|
46
|
-
neutral200: '#C7C7C7',
|
|
47
|
-
neutral100: '#E5E5E5',
|
|
48
|
-
neutral50: '#F6F6F6'
|
|
49
|
-
};
|
|
50
|
-
exports.colorsThemeNeutral = colorsThemeNeutral;
|
|
51
|
-
var colorsThemeInfo = {
|
|
52
|
-
info900: '#004BA1',
|
|
53
|
-
info800: '#0064B7',
|
|
54
|
-
info700: '#007AD1',
|
|
55
|
-
info600: '#0B8CE4',
|
|
56
|
-
info500: '#1CA2F9',
|
|
57
|
-
info400: '#55B9F9',
|
|
58
|
-
info300: '#86CAF5',
|
|
59
|
-
info200: '#B8E3FF',
|
|
60
|
-
info100: '#CFEDFF',
|
|
61
|
-
info50: '#E5F5FF'
|
|
62
|
-
};
|
|
63
|
-
exports.colorsThemeInfo = colorsThemeInfo;
|
|
64
|
-
var colorsThemeError = {
|
|
65
|
-
error900: '#960000',
|
|
66
|
-
error800: '#B60000',
|
|
67
|
-
error700: '#D50000',
|
|
68
|
-
error600: '#E80000',
|
|
69
|
-
error500: '#F63D3D',
|
|
70
|
-
error400: '#FE6A6A',
|
|
71
|
-
error300: '#FF8989',
|
|
72
|
-
error200: '#FFB5B5',
|
|
73
|
-
error100: '#FFCFCF',
|
|
74
|
-
error50: '#FFE5E5'
|
|
75
|
-
};
|
|
76
|
-
exports.colorsThemeError = colorsThemeError;
|
|
77
|
-
var colorsThemeWarnig = {
|
|
78
|
-
warnig900: '#843D00',
|
|
79
|
-
warnig800: '#A44D00',
|
|
80
|
-
warnig700: '#C75D00',
|
|
81
|
-
warnig600: '#EA7405',
|
|
82
|
-
warnig500: '#F98C25',
|
|
83
|
-
warnig400: '#FF9D42',
|
|
84
|
-
warnig300: '#FFB65E',
|
|
85
|
-
warnig200: '#FFC988',
|
|
86
|
-
warnig100: '#FDE2B4',
|
|
87
|
-
warnig50: '#FEF4E1'
|
|
88
|
-
};
|
|
89
|
-
exports.colorsThemeWarnig = colorsThemeWarnig;
|
|
90
|
-
var colorsThemeSuccess = {
|
|
91
|
-
success900: '#004800',
|
|
92
|
-
success800: '#006500',
|
|
93
|
-
success700: '#007A00',
|
|
94
|
-
success600: '#138A00',
|
|
95
|
-
success500: '#039928',
|
|
96
|
-
success400: '#43B952',
|
|
97
|
-
success300: '#6AC572',
|
|
98
|
-
success200: '#97D59B',
|
|
99
|
-
success100: '#C0E5C2',
|
|
100
|
-
success50: '#E2F5E3'
|
|
101
|
-
};
|
|
102
|
-
exports.colorsThemeSuccess = colorsThemeSuccess;
|
|
9
|
+
secondary: '#9B9BC5',
|
|
10
|
+
accent: '#6BEAF2',
|
|
11
|
+
success: '#128851',
|
|
12
|
+
error: '#D14642',
|
|
13
|
+
info: '#3B70D8',
|
|
14
|
+
warning: '#EA7405',
|
|
15
|
+
primary75: '#6A6BA9',
|
|
16
|
+
primary50: '#9B9BC5',
|
|
17
|
+
primary25: '#CDCDE2',
|
|
18
|
+
primary10: '#ECECF4',
|
|
19
|
+
accent75: '#90F0F6',
|
|
20
|
+
accent50: '#B4F4F8',
|
|
21
|
+
accent25: '#DAFAFC',
|
|
22
|
+
accent10: '#F1FDFE',
|
|
23
|
+
black: '#000000',
|
|
24
|
+
gray5: '#333333',
|
|
25
|
+
gray4: '#595959',
|
|
26
|
+
gray3: '#767676',
|
|
27
|
+
gray2: '#CCCCCC',
|
|
28
|
+
gray1: '#EEEEEE',
|
|
29
|
+
white: '#FFFFFF'
|
|
30
|
+
};
|
|
31
|
+
exports.colorsThemeBrand = colorsThemeBrand;
|
|
@@ -52,7 +52,7 @@ var _default = function _default(_ref) {
|
|
|
52
52
|
colors = _ref.colors;
|
|
53
53
|
|
|
54
54
|
var _React$useState = React.useState(_objectSpread(_objectSpread({}, defaultTheme), {}, {
|
|
55
|
-
colors: _objectSpread(_objectSpread(
|
|
55
|
+
colors: _objectSpread(_objectSpread({}, _Colors.colorsThemeBrand), colors)
|
|
56
56
|
})),
|
|
57
57
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
58
58
|
state = _React$useState2[0],
|