@councilbox/councilbox-ui 0.1.0 → 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 +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 +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 +28 -0
- package/dist/components/InputPassword/InputPassword.js +37 -162
- package/dist/components/InputPassword/InputPassword.stories.js +33 -2
- package/dist/components/InputText/InputText.css +18 -0
- package/dist/components/InputText/InputText.js +71 -60
- package/dist/components/InputText/InputText.stories.js +26 -2
- 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 -39
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _stylesheet = require("../styles/stylesheet");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
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,7 +33,8 @@ var useWindowSize = function useWindowSize() {
|
|
|
31
33
|
var _React$useState = _react.default.useState({
|
|
32
34
|
size: 'md',
|
|
33
35
|
innerWidth: window.innerWidth,
|
|
34
|
-
innerHeight: window.innerHeight
|
|
36
|
+
innerHeight: window.innerHeight,
|
|
37
|
+
breakpoints: _stylesheet.defaultBreakpoints
|
|
35
38
|
}),
|
|
36
39
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
37
40
|
windowSize = _React$useState2[0],
|
|
@@ -43,13 +46,13 @@ var useWindowSize = function useWindowSize() {
|
|
|
43
46
|
|
|
44
47
|
state.innerWidth = window.innerWidth;
|
|
45
48
|
|
|
46
|
-
if (window.innerWidth
|
|
49
|
+
if (window.innerWidth < _stylesheet.defaultBreakpoints.sm) {
|
|
47
50
|
state.size = 'xs';
|
|
48
|
-
} else if (window.innerWidth
|
|
51
|
+
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.md) {
|
|
49
52
|
state.size = 'sm';
|
|
50
|
-
} else if (window.innerWidth
|
|
53
|
+
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.lg) {
|
|
51
54
|
state.size = 'md';
|
|
52
|
-
} else if (window.innerWidth
|
|
55
|
+
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.xl) {
|
|
53
56
|
state.size = 'lg';
|
|
54
57
|
} else {
|
|
55
58
|
state.size = 'xl';
|
package/dist/build-index.js
CHANGED
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "Button", {
|
|
|
21
21
|
return _Button.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "ButtonBasic", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _ButtonBasic.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "ButtonGroup", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function get() {
|
|
@@ -33,6 +39,18 @@ Object.defineProperty(exports, "Checkbox", {
|
|
|
33
39
|
return _Checkbox.default;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "DrawerPanel", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _DrawerPanel.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "DropDown", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _DropDown.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
36
54
|
Object.defineProperty(exports, "Grid", {
|
|
37
55
|
enumerable: true,
|
|
38
56
|
get: function get() {
|
|
@@ -45,6 +63,12 @@ Object.defineProperty(exports, "Header", {
|
|
|
45
63
|
return _Header.default;
|
|
46
64
|
}
|
|
47
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "IconButton", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _IconButton.default;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
48
72
|
Object.defineProperty(exports, "InputPassword", {
|
|
49
73
|
enumerable: true,
|
|
50
74
|
get: function get() {
|
|
@@ -57,6 +81,12 @@ Object.defineProperty(exports, "InputText", {
|
|
|
57
81
|
return _InputText.default;
|
|
58
82
|
}
|
|
59
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "Modal", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _Modal.default;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
60
90
|
Object.defineProperty(exports, "Radio", {
|
|
61
91
|
enumerable: true,
|
|
62
92
|
get: function get() {
|
|
@@ -69,6 +99,12 @@ Object.defineProperty(exports, "Spacing", {
|
|
|
69
99
|
return _Spacing.default;
|
|
70
100
|
}
|
|
71
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "TextInput", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _TextInput.default;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
72
108
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
73
109
|
enumerable: true,
|
|
74
110
|
get: function get() {
|
|
@@ -94,6 +130,8 @@ var _Header = _interopRequireDefault(require("./components/Header/Header"));
|
|
|
94
130
|
|
|
95
131
|
var _InputPassword = _interopRequireDefault(require("./components/InputPassword/InputPassword"));
|
|
96
132
|
|
|
133
|
+
var _DrawerPanel = _interopRequireDefault(require("./components/DrawerPanel/DrawerPanel"));
|
|
134
|
+
|
|
97
135
|
var _ButtonGroup = _interopRequireDefault(require("./components/ButtonGroup/ButtonGroup"));
|
|
98
136
|
|
|
99
137
|
var _InputText = _interopRequireDefault(require("./components/InputText/InputText"));
|
|
@@ -112,6 +150,16 @@ var _Radio = _interopRequireDefault(require("./components/RadioButton/Radio"));
|
|
|
112
150
|
|
|
113
151
|
var _Spacing = _interopRequireDefault(require("./components/Spacing/Spacing"));
|
|
114
152
|
|
|
153
|
+
var _TextInput = _interopRequireDefault(require("./components/TextInput/TextInput"));
|
|
154
|
+
|
|
155
|
+
var _Modal = _interopRequireDefault(require("./components/Modal/Modal"));
|
|
156
|
+
|
|
157
|
+
var _ButtonBasic = _interopRequireDefault(require("./components/ButtonBasic/ButtonBasic"));
|
|
158
|
+
|
|
159
|
+
var _IconButton = _interopRequireDefault(require("./components/IconButton/IconButton"));
|
|
160
|
+
|
|
161
|
+
var _DropDown = _interopRequireDefault(require("./components/DropDown/DropDown"));
|
|
162
|
+
|
|
115
163
|
var _ThemeProvider = _interopRequireDefault(require("./components/ThemeProvider/ThemeProvider"));
|
|
116
164
|
|
|
117
165
|
var _CouncilboxThemeContext = require("./components/ThemeProvider/CouncilboxThemeContext");
|
|
@@ -17,8 +17,6 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
|
17
17
|
|
|
18
18
|
require("./Avatar.css");
|
|
19
19
|
|
|
20
|
-
var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext");
|
|
21
|
-
|
|
22
20
|
var _excluded = ["backgroundColor", "text", "src", "label", "colorText", "variantText", "fontWeightText", "textAlignText", "variantLabel", "colorLabel", "fontWeightLabel", "textAlignLabel", "sizeAvatar", "sizeText"];
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -73,9 +71,6 @@ var Avatar = function Avatar(_ref) {
|
|
|
73
71
|
sizeText = _ref.sizeText,
|
|
74
72
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
75
73
|
|
|
76
|
-
var _useCouncilboxTheme = (0, _CouncilboxThemeContext.useCouncilboxTheme)(),
|
|
77
|
-
theme = _useCouncilboxTheme.theme;
|
|
78
|
-
|
|
79
74
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
80
75
|
style: {
|
|
81
76
|
display: 'flex',
|
|
@@ -95,7 +90,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
95
90
|
}, stylesAvatar[sizeAvatar]))
|
|
96
91
|
}, props), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
97
92
|
variant: variantText || (!variantText && !!label ? 'XS' : 'M'),
|
|
98
|
-
color: colorText ||
|
|
93
|
+
color: colorText || 'var(--gray4)',
|
|
99
94
|
fontWeight: fontWeightText,
|
|
100
95
|
textAlign: textAlignText
|
|
101
96
|
}, text)), label && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -15,7 +15,13 @@ require("../../styles/main.css");
|
|
|
15
15
|
|
|
16
16
|
require("./button.css");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
19
|
+
|
|
20
|
+
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
21
|
+
|
|
22
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
23
|
+
|
|
24
|
+
var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon", "variantText"];
|
|
19
25
|
|
|
20
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
27
|
|
|
@@ -31,6 +37,36 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
31
37
|
|
|
32
38
|
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
39
|
|
|
40
|
+
var CssButton = (0, _styled.default)(_Button.default)(function () {
|
|
41
|
+
return {
|
|
42
|
+
'& MuiButton-root': {
|
|
43
|
+
paddingTop: 'var(--spacing12)',
|
|
44
|
+
paddingBottom: 'var(--spacing12)',
|
|
45
|
+
paddingLeft: 'var(--spacing24)'
|
|
46
|
+
},
|
|
47
|
+
'& MuiButton-containedPrimary': {
|
|
48
|
+
paddingRight: 'var(--spacing16)'
|
|
49
|
+
},
|
|
50
|
+
'& MuiButton-outlinedPrimary': {
|
|
51
|
+
paddingRight: 'var(--spacing24)',
|
|
52
|
+
'&:hover': {
|
|
53
|
+
boxShadow: '0 0 0 1px var(--primary)'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
'& MuiButton-textPrimary': {
|
|
57
|
+
paddingRight: 'var(--spacing24)',
|
|
58
|
+
'&:hover': {
|
|
59
|
+
backgroundColor: '#FFF',
|
|
60
|
+
boxShadow: '0 0 0 1px white, 0 2px 6px 2px rgba(0,0,0,0.38)'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
'& MuiButton-startIcon': {
|
|
64
|
+
paddingRight: 'var(--spacing8)',
|
|
65
|
+
margin: '0'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
34
70
|
var Button = function Button(_ref) {
|
|
35
71
|
var id = _ref.id,
|
|
36
72
|
text = _ref.text,
|
|
@@ -40,6 +76,7 @@ var Button = function Button(_ref) {
|
|
|
40
76
|
variant = _ref.variant,
|
|
41
77
|
fullWidth = _ref.fullWidth,
|
|
42
78
|
icon = _ref.icon,
|
|
79
|
+
variantText = _ref.variantText,
|
|
43
80
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
81
|
|
|
45
82
|
var buttonVariant;
|
|
@@ -49,50 +86,75 @@ var Button = function Button(_ref) {
|
|
|
49
86
|
if (variant === 'primary') {
|
|
50
87
|
buttonVariant = 'contained';
|
|
51
88
|
background = 'var(--primary)';
|
|
52
|
-
buttonColor = 'var(--
|
|
89
|
+
buttonColor = 'var(--gray1)';
|
|
53
90
|
} else if (variant === 'secondary') {
|
|
54
91
|
buttonVariant = 'outlined';
|
|
55
92
|
buttonColor = 'var(--primary)';
|
|
56
93
|
} else if (variant === 'error') {
|
|
57
94
|
// this better as an state, not a variant
|
|
58
95
|
buttonVariant = 'contained';
|
|
59
|
-
background = 'var(--
|
|
60
|
-
buttonColor = 'var(--
|
|
96
|
+
background = 'var(--error)';
|
|
97
|
+
buttonColor = 'var(--gray1)';
|
|
61
98
|
} else if (variant === 'warning') {
|
|
62
99
|
buttonVariant = 'contained';
|
|
63
|
-
background = 'var(--
|
|
64
|
-
buttonColor = 'var(--
|
|
100
|
+
background = 'var(--warnig)';
|
|
101
|
+
buttonColor = 'var(--gray1)';
|
|
65
102
|
} else if (variant === 'success') {
|
|
66
103
|
buttonVariant = 'contained';
|
|
67
|
-
background = 'var(--
|
|
68
|
-
buttonColor = 'var(--
|
|
104
|
+
background = 'var(--success)';
|
|
105
|
+
buttonColor = 'var(--gray1)';
|
|
69
106
|
} else {
|
|
70
107
|
buttonVariant = 'text';
|
|
71
108
|
buttonColor = 'var(--primary)';
|
|
72
109
|
}
|
|
73
110
|
|
|
74
|
-
|
|
111
|
+
var isSecondaryOrTernary = function isSecondaryOrTernary(variantBtn) {
|
|
112
|
+
return variantBtn === 'secondary' || variantBtn === 'tertiary';
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(CssButton, _extends({
|
|
75
116
|
id: id,
|
|
76
|
-
|
|
117
|
+
sx: {
|
|
118
|
+
minWidth: !isSecondaryOrTernary(variant) ? '140px' : '100px',
|
|
119
|
+
minHeight: '48px',
|
|
120
|
+
boxShadow: 'none',
|
|
121
|
+
letterSpacing: '1px',
|
|
122
|
+
lineHeight: 'normal'
|
|
123
|
+
},
|
|
124
|
+
className: "cbx-button ".concat(isSecondaryOrTernary(variant) && disabled ? 'cbx-button-outlined-disabled' : '', " ").concat(buttonVariant, " ").concat(icon ? 'cbx-button-with-icon' : '', " ").concat(!isSecondaryOrTernary(variant) && "cbx-button-hoverAndAnimation".concat(fullWidth ? '-fullWidth' : '')),
|
|
77
125
|
disabled: loading || disabled,
|
|
78
126
|
variant: buttonVariant,
|
|
79
127
|
style: _objectSpread({
|
|
80
128
|
backgroundColor: background,
|
|
81
|
-
color: buttonColor
|
|
129
|
+
color: buttonColor,
|
|
130
|
+
lineHeight: 'normal'
|
|
82
131
|
}, disabled || loading ? {
|
|
83
|
-
opacity: '0.
|
|
132
|
+
opacity: '0.4'
|
|
84
133
|
} : {}),
|
|
85
134
|
disableFocusRipple: true,
|
|
86
135
|
fullWidth: fullWidth,
|
|
87
136
|
onClick: onClick,
|
|
88
|
-
startIcon: icon
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
137
|
+
startIcon: icon && icon === 'arrow' ? /*#__PURE__*/_react.default.createElement("i", {
|
|
138
|
+
className: "ri-arrow-left-s-line"
|
|
139
|
+
}) : icon
|
|
140
|
+
}, props), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
141
|
+
color: buttonColor,
|
|
142
|
+
variant: variantText
|
|
143
|
+
}, text), buttonVariant === 'contained' && !loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
144
|
+
className: "cbx-button-containerArrow"
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
92
146
|
className: "ri-arrow-right-s-line arrow-primary"
|
|
93
|
-
}), loading && /*#__PURE__*/_react.default.createElement("
|
|
94
|
-
className: "
|
|
95
|
-
}
|
|
147
|
+
})), loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
148
|
+
className: "cbx-button-containerLoading"
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
150
|
+
sx: {
|
|
151
|
+
color: 'white'
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
height: 'var(--spacing24)',
|
|
155
|
+
width: 'var(--spacing24)'
|
|
156
|
+
}
|
|
157
|
+
})));
|
|
96
158
|
};
|
|
97
159
|
|
|
98
160
|
Button.displayName = "Button";
|
|
@@ -104,7 +166,8 @@ Button.propTypes = {
|
|
|
104
166
|
loading: _propTypes.default.bool,
|
|
105
167
|
variant: _propTypes.default.string,
|
|
106
168
|
fullWidth: _propTypes.default.bool,
|
|
107
|
-
icon: _propTypes.default.node
|
|
169
|
+
icon: _propTypes.default.node,
|
|
170
|
+
variantText: _propTypes.default.string
|
|
108
171
|
};
|
|
109
172
|
Button.defaultProps = {
|
|
110
173
|
backgroundColor: null,
|
|
@@ -114,7 +177,8 @@ Button.defaultProps = {
|
|
|
114
177
|
loading: false,
|
|
115
178
|
variant: 'primary',
|
|
116
179
|
fullWidth: false,
|
|
117
|
-
icon: null
|
|
180
|
+
icon: null,
|
|
181
|
+
variantText: ''
|
|
118
182
|
};
|
|
119
183
|
var _default = Button;
|
|
120
184
|
exports.default = _default;
|
|
@@ -3,14 +3,42 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.cbx-button:focus-visible {
|
|
6
|
-
box-shadow: 0 0 0
|
|
6
|
+
box-shadow: inset 0 0 0 2px white, 0px 0px 5px 3px rgb(56 57 140 / 75%);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.
|
|
10
|
-
|
|
9
|
+
.cbx-button-hoverAndAnimation{
|
|
10
|
+
justify-content: start!important;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.cbx-button
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
.cbx-button-hoverAndAnimation-fullWidth{
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cbx-button-containerArrow, .cbx-button-containerLoading {
|
|
18
|
+
width: 15px;
|
|
19
|
+
display: flex;
|
|
20
|
+
height: 100%;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cbx-button-hoverAndAnimation .cbx-button-containerArrow, .cbx-button-hoverAndAnimation-fullWidth .cbx-button-containerArrow, .cbx-button-hoverAndAnimation .cbx-button-containerLoading, .cbx-button-hoverAndAnimation-fullWidth .cbx-button-containerLoading {
|
|
25
|
+
margin-left: var(--spacing24);
|
|
26
|
+
margin-right: var(--spacing8);
|
|
27
|
+
position: relative;
|
|
28
|
+
transition: padding .4s ease-in-out;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.cbx-button-hoverAndAnimation span i , .cbx-button-hoverAndAnimation-fullWidth span i {
|
|
32
|
+
position: absolute;
|
|
33
|
+
transition: .4s ease-in-out;
|
|
34
|
+
left: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cbx-button-hoverAndAnimation:hover span i , .cbx-button-hoverAndAnimation-fullWidth:hover span i {
|
|
38
|
+
padding-left: var(--spacing8);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.cbx-button-outlined-disabled{
|
|
42
|
+
color: var(--gray5)!important;
|
|
43
|
+
border-color: var(--primary)!important;
|
|
16
44
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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 _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./ButtonBasic.css");
|
|
17
|
+
|
|
18
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
19
|
+
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon", "variantText"];
|
|
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 ButtonBasic = function ButtonBasic(_ref) {
|
|
33
|
+
var id = _ref.id,
|
|
34
|
+
text = _ref.text,
|
|
35
|
+
onClick = _ref.onClick,
|
|
36
|
+
disabled = _ref.disabled,
|
|
37
|
+
loading = _ref.loading,
|
|
38
|
+
variant = _ref.variant,
|
|
39
|
+
fullWidth = _ref.fullWidth,
|
|
40
|
+
icon = _ref.icon,
|
|
41
|
+
variantText = _ref.variantText,
|
|
42
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
|
|
44
|
+
var buttonVariant;
|
|
45
|
+
var buttonColor;
|
|
46
|
+
|
|
47
|
+
if (variant === 'primary') {
|
|
48
|
+
buttonVariant = 'contained';
|
|
49
|
+
buttonColor = 'var(--gray1)';
|
|
50
|
+
} else if (variant === 'secondary') {
|
|
51
|
+
buttonVariant = 'outlined';
|
|
52
|
+
buttonColor = 'var(--primary)';
|
|
53
|
+
} else {
|
|
54
|
+
buttonVariant = 'text';
|
|
55
|
+
buttonColor = 'var(--primary)';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
59
|
+
id: id,
|
|
60
|
+
sx: {
|
|
61
|
+
padding: 'var(--spacing8) 22px'
|
|
62
|
+
},
|
|
63
|
+
disabled: loading || disabled,
|
|
64
|
+
variant: buttonVariant,
|
|
65
|
+
disableFocusRipple: true,
|
|
66
|
+
fullWidth: fullWidth,
|
|
67
|
+
onClick: onClick,
|
|
68
|
+
startIcon: icon && icon === 'arrow' ? /*#__PURE__*/_react.default.createElement("i", {
|
|
69
|
+
className: "ri-arrow-left-s-line"
|
|
70
|
+
}) : icon
|
|
71
|
+
}, props), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
72
|
+
color: buttonColor,
|
|
73
|
+
variant: variantText,
|
|
74
|
+
styles: {
|
|
75
|
+
fontWeight: '700',
|
|
76
|
+
fontSize: '15px',
|
|
77
|
+
lineHeight: '26px',
|
|
78
|
+
letterSpacing: '0.46px'
|
|
79
|
+
}
|
|
80
|
+
}, text), loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
81
|
+
className: "cbx-buttonBasic-containerLoading"
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
83
|
+
sx: {
|
|
84
|
+
color: 'white'
|
|
85
|
+
},
|
|
86
|
+
style: {
|
|
87
|
+
width: 'var(--spacing24)',
|
|
88
|
+
height: '100%'
|
|
89
|
+
}
|
|
90
|
+
})));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
ButtonBasic.displayName = "ButtonBasic";
|
|
94
|
+
ButtonBasic.propTypes = {
|
|
95
|
+
backgroundColor: _propTypes.default.string,
|
|
96
|
+
text: _propTypes.default.string.isRequired,
|
|
97
|
+
onClick: _propTypes.default.func,
|
|
98
|
+
disabled: _propTypes.default.bool,
|
|
99
|
+
loading: _propTypes.default.bool,
|
|
100
|
+
variant: _propTypes.default.string,
|
|
101
|
+
fullWidth: _propTypes.default.bool,
|
|
102
|
+
icon: _propTypes.default.node,
|
|
103
|
+
variantText: _propTypes.default.string
|
|
104
|
+
};
|
|
105
|
+
ButtonBasic.defaultProps = {
|
|
106
|
+
backgroundColor: null,
|
|
107
|
+
text: null,
|
|
108
|
+
onClick: undefined,
|
|
109
|
+
disabled: false,
|
|
110
|
+
loading: false,
|
|
111
|
+
variant: 'primary',
|
|
112
|
+
fullWidth: false,
|
|
113
|
+
icon: null,
|
|
114
|
+
variantText: ''
|
|
115
|
+
};
|
|
116
|
+
var _default = ButtonBasic;
|
|
117
|
+
exports.default = _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _ButtonBasic = _interopRequireDefault(require("./ButtonBasic"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var ICONS = {
|
|
15
|
+
none: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null),
|
|
16
|
+
save: /*#__PURE__*/_react.default.createElement("i", {
|
|
17
|
+
className: "ri-save-line"
|
|
18
|
+
}),
|
|
19
|
+
edit: /*#__PURE__*/_react.default.createElement("i", {
|
|
20
|
+
className: "ri-pencil-line"
|
|
21
|
+
}),
|
|
22
|
+
arrowLeft: 'arrow'
|
|
23
|
+
};
|
|
24
|
+
var _default = {
|
|
25
|
+
title: 'Example/ButtonBasic',
|
|
26
|
+
component: _ButtonBasic.default,
|
|
27
|
+
argTypes: {
|
|
28
|
+
loading: {
|
|
29
|
+
options: [true, false],
|
|
30
|
+
control: {
|
|
31
|
+
type: 'radio'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
options: [true, false],
|
|
36
|
+
control: {
|
|
37
|
+
type: 'radio'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
fullWidth: {
|
|
41
|
+
options: [true, false],
|
|
42
|
+
control: {
|
|
43
|
+
type: 'radio'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
variant: {
|
|
47
|
+
options: ['primary', 'secondary', 'tertiary'],
|
|
48
|
+
control: {
|
|
49
|
+
type: 'radio'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
icon: {
|
|
53
|
+
control: {
|
|
54
|
+
type: 'select'
|
|
55
|
+
},
|
|
56
|
+
options: ICONS
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.default = _default;
|
|
61
|
+
|
|
62
|
+
var Template = function Template(args) {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonBasic.default, args);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
Template.displayName = "Template";
|
|
67
|
+
var Default = Template.bind({});
|
|
68
|
+
exports.Default = Default;
|
|
69
|
+
Default.args = {
|
|
70
|
+
text: 'Large',
|
|
71
|
+
variant: 'primary'
|
|
72
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.cbx-DrawerPanel-dialog {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: flex-end;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.cbx-DrawerPanel-toolbar {
|
|
8
|
+
padding: 0 1rem
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cbx-DrawerPanel-iconButton {
|
|
12
|
+
outline: none!important;
|
|
13
|
+
height: 1.5em;
|
|
14
|
+
padding: 0!important;
|
|
15
|
+
margin: 0!important;
|
|
16
|
+
width: 1.5em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.cbx-DrawerPanel-icon {
|
|
20
|
+
color: #fff;
|
|
21
|
+
height: auto!important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cbx-DrawerPanel-typography {
|
|
25
|
+
color:#fff;
|
|
26
|
+
flex: 1!important;
|
|
27
|
+
padding: 1.125rem!important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cbx-DrawerPanel-dialogContent {
|
|
31
|
+
min-width: 40vw;
|
|
32
|
+
max-width: 95vw;
|
|
33
|
+
}
|