@councilbox/councilbox-ui 0.0.11 → 0.1.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/HOCs/useWindowSize.js +8 -5
- package/dist/build-index.js +48 -0
- package/dist/components/Avatar/Avatar.js +1 -6
- package/dist/components/Button/Button.js +40 -8
- package/dist/components/Button/button.css +1 -1
- 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 +235 -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 +6 -2
- package/dist/components/InputPassword/InputPassword.js +4 -4
- package/dist/components/InputText/InputText.css +1 -1
- package/dist/components/InputText/InputText.js +16 -15
- 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 +216 -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 -35
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.
|
|
6
|
+
exports.default = exports.HeaderAllButtons = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -11,9 +11,32 @@ var _Header = _interopRequireDefault(require("./Header"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
+
var IMGS = {
|
|
15
|
+
cbx: 'https://api.councilbox.com/static/img/logo-xs.png',
|
|
16
|
+
empty: ''
|
|
17
|
+
};
|
|
18
|
+
var IMGS2 = {
|
|
19
|
+
ovac: 'https://ovac.pre.councilbox.com/static/media/logo.1752d54e.svg',
|
|
20
|
+
abanca: 'https://api.councilbox.com/subdomains/logo/abanca_logo.png',
|
|
21
|
+
empty: ''
|
|
22
|
+
};
|
|
14
23
|
var _default = {
|
|
15
24
|
title: 'Example/Header',
|
|
16
|
-
component: _Header.default
|
|
25
|
+
component: _Header.default,
|
|
26
|
+
argTypes: {
|
|
27
|
+
logoLeft: {
|
|
28
|
+
control: {
|
|
29
|
+
type: 'select'
|
|
30
|
+
},
|
|
31
|
+
options: IMGS
|
|
32
|
+
},
|
|
33
|
+
logoRight: {
|
|
34
|
+
control: {
|
|
35
|
+
type: 'select'
|
|
36
|
+
},
|
|
37
|
+
options: IMGS2
|
|
38
|
+
}
|
|
39
|
+
}
|
|
17
40
|
};
|
|
18
41
|
exports.default = _default;
|
|
19
42
|
|
|
@@ -22,11 +45,9 @@ var Template = function Template(args) {
|
|
|
22
45
|
};
|
|
23
46
|
|
|
24
47
|
Template.displayName = "Template";
|
|
25
|
-
var
|
|
26
|
-
exports.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.LoggedOut = LoggedOut;
|
|
32
|
-
LoggedOut.args = {};
|
|
48
|
+
var HeaderAllButtons = Template.bind({});
|
|
49
|
+
exports.HeaderAllButtons = HeaderAllButtons;
|
|
50
|
+
_Header.default.args = {
|
|
51
|
+
logoLeft: '',
|
|
52
|
+
logoRight: ''
|
|
53
|
+
};
|
|
@@ -1,26 +1,128 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
.App-header {
|
|
2
|
+
justify-content: space-between;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
height: 4rem;
|
|
5
|
+
width: 100%;
|
|
6
|
+
border-bottom: 1px solid gainsboro;
|
|
7
|
+
background: white;
|
|
8
|
+
box-shadow: 0px 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
|
|
9
|
+
padding: 0 var(--spacing16)
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
vertical-align: top;
|
|
12
|
+
.cbx-header-first-block {
|
|
13
|
+
max-width: 13.75rem;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
.cbx-header-first-block,
|
|
17
|
+
.App-header,
|
|
18
|
+
.cbx-header-second-block,
|
|
19
|
+
.cbx-header-third-block,
|
|
20
|
+
.cbx-header-first-container-app-logo-empty,
|
|
21
|
+
.cbx-header-third-button-user-logo,
|
|
22
|
+
.cbx-header-third-container,
|
|
23
|
+
.cbx-header-third-button-container {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
.cbx-header-first-container-app-logo-empty span,
|
|
29
|
+
.cbx-header-first-container-app-logo {
|
|
30
|
+
margin-left: var(--spacing12);
|
|
26
31
|
}
|
|
32
|
+
|
|
33
|
+
.cbx-header-first-button-left i {
|
|
34
|
+
color: var(--gray3);
|
|
35
|
+
font-size: 1.125rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cbx-header-third-logo-right, .App-logo {
|
|
39
|
+
display: block;
|
|
40
|
+
/* rem aqui */
|
|
41
|
+
max-width: 7.813rem;
|
|
42
|
+
max-height: 2.5rem;
|
|
43
|
+
width: auto;
|
|
44
|
+
height: auto;
|
|
45
|
+
user-select: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.cbx-header-second-block,
|
|
49
|
+
.cbx-header-first-block {
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cbx-header-second-block,
|
|
54
|
+
.cbx-header-second-container-text,
|
|
55
|
+
.cbx-header-first-block,
|
|
56
|
+
.cbx-header-first-container-app-logo-text-empty,
|
|
57
|
+
.cbx-header-first-container-app-logo-empty {
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cbx-header-second-container-lock {
|
|
63
|
+
color: var(--gray3);
|
|
64
|
+
margin-right: var(--spacing24);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cbx-header-second-container-lock i {
|
|
68
|
+
font-size: 1.25rem
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cbx-header-second-container-text {
|
|
72
|
+
margin-right: var(--spacing4);
|
|
73
|
+
text-align: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.cbx-header-second-container-more,
|
|
77
|
+
.cbx-header-third-button-user-logo,
|
|
78
|
+
.cbx-header-third-button-user i {
|
|
79
|
+
color: var(--gray3)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cbx-header-second-button-more i,
|
|
83
|
+
.cbx-header-third-button-user-logo,
|
|
84
|
+
.cbx-header-second-button-icon-logout i,
|
|
85
|
+
.cbx-header-third-button-user i {
|
|
86
|
+
font-size: 1.313rem
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.cbx-header-second-container-finish,
|
|
90
|
+
.cbx-header-third-button-user-logo {
|
|
91
|
+
margin-left: var(--spacing4)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.cbx-header-second-button-icon-logout i {
|
|
95
|
+
color: var(--primary);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cbx-header-third-block {
|
|
99
|
+
justify-content: flex-end
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cbx-header-third-button-user,
|
|
103
|
+
.cbx-header-third-button-user-logo {
|
|
104
|
+
background: var(--gray1) !important
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.cbx-header-button,
|
|
108
|
+
.cbx-header-first-app-logo-empty,
|
|
109
|
+
.cbx-header-third-button-user-logo {
|
|
110
|
+
width: var(--spacing40);
|
|
111
|
+
height: var(--spacing40);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cbx-header-button {
|
|
115
|
+
border: none !important;
|
|
116
|
+
outline: none !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cbx-header-button:focus {
|
|
120
|
+
border: none !important;
|
|
121
|
+
outline: none !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.cbx-header-third-button-user-logo {
|
|
125
|
+
border-radius: 50%;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
font-weight: 400;
|
|
128
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./IconButton.css");
|
|
17
|
+
|
|
18
|
+
var _excluded = ["id", "className", "onClick", "icon", "backgroundColor", "styles"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
var IconButton = function IconButton(_ref) {
|
|
35
|
+
var id = _ref.id,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
onClick = _ref.onClick,
|
|
38
|
+
icon = _ref.icon,
|
|
39
|
+
backgroundColor = _ref.backgroundColor,
|
|
40
|
+
styles = _ref.styles,
|
|
41
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
44
|
+
id: id,
|
|
45
|
+
className: className,
|
|
46
|
+
onClick: onClick,
|
|
47
|
+
sx: _objectSpread({
|
|
48
|
+
width: 'var(--spacing40)',
|
|
49
|
+
height: 'var(--spacing40)',
|
|
50
|
+
fontSize: '21px',
|
|
51
|
+
background: backgroundColor
|
|
52
|
+
}, styles)
|
|
53
|
+
}, props), icon);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
IconButton.displayName = "IconButton";
|
|
57
|
+
IconButton.propTypes = {
|
|
58
|
+
id: _propTypes.default.string,
|
|
59
|
+
className: _propTypes.default.string,
|
|
60
|
+
onClick: _propTypes.default.func,
|
|
61
|
+
icon: _propTypes.default.node,
|
|
62
|
+
backgroundColor: _propTypes.default.string
|
|
63
|
+
};
|
|
64
|
+
IconButton.defaultProps = {
|
|
65
|
+
id: '',
|
|
66
|
+
className: '',
|
|
67
|
+
onClick: Function.prototype,
|
|
68
|
+
icon: undefined,
|
|
69
|
+
backgroundColor: ''
|
|
70
|
+
};
|
|
71
|
+
var _default = IconButton;
|
|
72
|
+
exports.default = _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Example/IconButton',
|
|
16
|
+
component: _IconButton.default
|
|
17
|
+
};
|
|
18
|
+
exports.default = _default;
|
|
19
|
+
|
|
20
|
+
var Template = function Template(args) {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, args);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
Template.displayName = "Template";
|
|
25
|
+
var Default = Template.bind({});
|
|
26
|
+
exports.Default = Default;
|
|
27
|
+
Default.args = {};
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
.cbx-inputPassword-icon-button, .cbx-inputPassword-icon-size {
|
|
18
18
|
width: var(--spacing24);
|
|
19
19
|
height: var(--spacing24);
|
|
20
|
-
border: none;
|
|
21
|
-
outline: none;
|
|
20
|
+
border: none!important;
|
|
21
|
+
outline: none!important;
|
|
22
|
+
}
|
|
22
23
|
|
|
24
|
+
.cbx-inputPassword-icon-button:focus, .cbx-inputPassword-icon-size:focus {
|
|
25
|
+
border: none!important;
|
|
26
|
+
outline: none!important;
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -69,14 +69,14 @@ var InputPassword = function InputPassword(_ref) {
|
|
|
69
69
|
var themeData = (0, _CouncilboxThemeContext.useCouncilboxTheme)();
|
|
70
70
|
|
|
71
71
|
var getColorPercent = function getColorPercent(percent) {
|
|
72
|
-
var color = themeData.theme.colors.
|
|
72
|
+
var color = themeData.theme.colors.error;
|
|
73
73
|
|
|
74
74
|
if (percent > 30 && percent < 90) {
|
|
75
75
|
color = themeData.theme.colors.warnig600;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
if (percent >= 90) {
|
|
79
|
-
color = themeData.theme.colors.
|
|
79
|
+
color = themeData.theme.colors.success;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return color;
|
|
@@ -111,12 +111,12 @@ var InputPassword = function InputPassword(_ref) {
|
|
|
111
111
|
}, showPassword ? /*#__PURE__*/_react.default.createElement(_VisibilityOff.default, {
|
|
112
112
|
className: "cbx-inputPassword-icon-size",
|
|
113
113
|
sx: {
|
|
114
|
-
color: disabled ? 'var(--
|
|
114
|
+
color: disabled ? 'var(--gray3)' : 'black'
|
|
115
115
|
}
|
|
116
116
|
}) : /*#__PURE__*/_react.default.createElement(_Visibility.default, {
|
|
117
117
|
className: "cbx-inputPassword-icon-size",
|
|
118
118
|
sx: {
|
|
119
|
-
color: disabled ? 'var(--
|
|
119
|
+
color: disabled ? 'var(--gray3)' : 'black'
|
|
120
120
|
}
|
|
121
121
|
}))
|
|
122
122
|
}
|
|
@@ -57,16 +57,16 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
|
57
57
|
top: '-4px'
|
|
58
58
|
},
|
|
59
59
|
'& .Mui-error': {
|
|
60
|
-
color: theme.palette.
|
|
60
|
+
color: theme.palette.error
|
|
61
61
|
},
|
|
62
62
|
'& .MuiInputLabel-shrink': {
|
|
63
63
|
top: '1px'
|
|
64
64
|
},
|
|
65
65
|
'& .MuiOutlinedInput-root': {
|
|
66
|
-
color: theme.palette.
|
|
66
|
+
color: theme.palette.gray5,
|
|
67
67
|
paddingRight: 'var(--spacing8)',
|
|
68
68
|
'& fieldset': {
|
|
69
|
-
borderColor: theme.palette.
|
|
69
|
+
borderColor: theme.palette.gray3,
|
|
70
70
|
borderWidth: '1px',
|
|
71
71
|
'& legend': {
|
|
72
72
|
'& span': {
|
|
@@ -76,15 +76,15 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
'&:hover fieldset': {
|
|
79
|
-
borderColor: theme.palette.
|
|
79
|
+
borderColor: theme.palette.gray3,
|
|
80
80
|
borderWidth: '2px'
|
|
81
81
|
},
|
|
82
82
|
'&:active fieldset': {
|
|
83
|
-
borderColor: theme.palette.
|
|
83
|
+
borderColor: theme.palette.gray4,
|
|
84
84
|
borderWidth: '2px'
|
|
85
85
|
},
|
|
86
86
|
'&.Mui-focused fieldset': {
|
|
87
|
-
borderColor: theme.palette.
|
|
87
|
+
borderColor: theme.palette.gray4,
|
|
88
88
|
borderWidth: '2px'
|
|
89
89
|
},
|
|
90
90
|
'&:focus-visible': {
|
|
@@ -92,28 +92,29 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
|
92
92
|
'& fieldset': {
|
|
93
93
|
outline: 'none',
|
|
94
94
|
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.primary.main),
|
|
95
|
-
border: "2px solid ".concat(theme.palette.
|
|
95
|
+
border: "2px solid ".concat(theme.palette.gray4)
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
'& .MuiOutlinedInput-root.Mui-error': {
|
|
100
100
|
'& fieldset': {
|
|
101
|
-
borderColor: theme.palette.
|
|
101
|
+
borderColor: theme.palette.error
|
|
102
102
|
},
|
|
103
103
|
'&:hover fieldset': {
|
|
104
|
-
borderColor: theme.palette.
|
|
104
|
+
borderColor: theme.palette.error,
|
|
105
105
|
borderWidth: '2px'
|
|
106
106
|
},
|
|
107
107
|
'&:active fieldset': {
|
|
108
|
-
borderColor: theme.palette.
|
|
108
|
+
borderColor: theme.palette.error,
|
|
109
109
|
borderWidth: '2px'
|
|
110
110
|
},
|
|
111
111
|
'&.Mui-focused fieldset': {
|
|
112
|
-
borderColor: theme.palette.
|
|
112
|
+
borderColor: theme.palette.error,
|
|
113
113
|
borderWidth: '2px'
|
|
114
114
|
},
|
|
115
115
|
'&:focus-visible': {
|
|
116
|
-
|
|
116
|
+
// falta revisar esto
|
|
117
|
+
borderColor: theme.palette.gray4,
|
|
117
118
|
borderWidth: '2px',
|
|
118
119
|
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.primary.main)
|
|
119
120
|
}
|
|
@@ -169,16 +170,16 @@ var InputText = function InputText(_ref2) {
|
|
|
169
170
|
className: "cbx-inputText-items-center"
|
|
170
171
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
171
172
|
className: 'cbx-inputText-infoBtn ri-information-line',
|
|
172
|
-
color: 'var(--
|
|
173
|
+
color: 'var(--error)'
|
|
173
174
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
174
175
|
variant: "XS",
|
|
175
|
-
color: 'var(--
|
|
176
|
+
color: 'var(--error)'
|
|
176
177
|
}, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
177
178
|
className: "cbx-inputText-items-center"
|
|
178
179
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
179
180
|
className: 'cbx-inputText-infoBtn ri-information-line'
|
|
180
181
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
181
|
-
color: !disabled ? 'var(--
|
|
182
|
+
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
182
183
|
variant: "XS"
|
|
183
184
|
}, helper))),
|
|
184
185
|
InputProps: {
|
|
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
|
+
};
|