@bolio-ui/core 1.0.8 → 1.0.9
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/ButtonDropdown/index.js +31 -31
- package/dist/Input/InputBlockLabel.d.ts +2 -1
- package/dist/Input/InputProps.d.ts +2 -0
- package/dist/Input/index.js +50 -34
- package/dist/Input/styles.d.ts +1 -1
- package/dist/Select/index.js +30 -23
- package/dist/Select/styles.d.ts +1 -1
- package/dist/Textarea/index.js +27 -13
- package/dist/index.js +111 -88
- package/esm/ButtonDropdown/ButtonDropdown.js +8 -8
- package/esm/ButtonDropdown/styles.js +23 -23
- package/esm/Input/Input.js +17 -16
- package/esm/Input/InputBlockLabel.d.ts +2 -1
- package/esm/Input/InputBlockLabel.js +6 -5
- package/esm/Input/InputProps.d.ts +2 -0
- package/esm/Input/styles.d.ts +1 -1
- package/esm/Input/styles.js +27 -13
- package/esm/Select/Select.js +10 -10
- package/esm/Select/styles.d.ts +1 -1
- package/esm/Select/styles.js +20 -13
- package/package.json +1 -1
|
@@ -79,31 +79,31 @@ function ButtonDropdownComponent(_ref) {
|
|
|
79
79
|
ref: ref,
|
|
80
80
|
onClick: stopPropagation
|
|
81
81
|
}, props, {
|
|
82
|
-
className: _JSXStyle.dynamic([["
|
|
82
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]]) + " " + (props && props.className != null && props.className || useClasses('btn-dropdown', className) || "")
|
|
83
83
|
}), mainItemChildren, /*#__PURE__*/React.createElement("details", {
|
|
84
84
|
open: visible,
|
|
85
|
-
className: _JSXStyle.dynamic([["
|
|
85
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]])
|
|
86
86
|
}, /*#__PURE__*/React.createElement("summary", {
|
|
87
87
|
onClick: clickHandler,
|
|
88
|
-
className: _JSXStyle.dynamic([["
|
|
88
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]])
|
|
89
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: _JSXStyle.dynamic([["
|
|
90
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]]) + " " + "dropdown-box"
|
|
91
91
|
}, icon ? /*#__PURE__*/React.createElement("span", {
|
|
92
92
|
style: {
|
|
93
93
|
color: disabled || loading ? theme.palette.error : colors.color,
|
|
94
94
|
height: SCALES.height(2.5),
|
|
95
95
|
width: SCALES.height(2.5)
|
|
96
96
|
},
|
|
97
|
-
className: _JSXStyle.dynamic([["
|
|
97
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]]) + " " + "dropdown-icon"
|
|
98
98
|
}, icon) : /*#__PURE__*/React.createElement(ButtonDropdownIcon, {
|
|
99
99
|
color: disabled || loading ? theme.palette.accents_4 : colors.color,
|
|
100
100
|
height: SCALES.height(2.5)
|
|
101
101
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className: _JSXStyle.dynamic([["
|
|
102
|
+
className: _JSXStyle.dynamic([["2141984301", [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]]]) + " " + "content"
|
|
103
103
|
}, itemChildrenWithoutMain)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
104
|
-
id: "
|
|
104
|
+
id: "2141984301",
|
|
105
105
|
dynamic: [colors.borderColor, theme.layout.radius, SCALES.height(2.5), auto ? 'min-content' : SCALES.width(10.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.font(0.875), colors.hoverBorder, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius, SCALES.height(2.5), colors.color, bgColor, SCALES.height(2.5), colors.borderLeftColor, disabled || loading ? 'not-allowed' : 'pointer', colors.hoverBorder, colors.hoverBgColor, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, theme.palette.background, theme.layout.radius, theme.layout.radius, theme.layout.radius, theme.layout.radius]
|
|
106
|
-
}, ".btn-dropdown.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;box-sizing:border-box;border
|
|
106
|
+
}, ".btn-dropdown.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;box-sizing:border-box;border-radius:".concat(theme.layout.radius, ";--bolio-ui-dropdown-height:").concat(SCALES.height(2.5), ";--bolio-ui-dropdown-min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";--bolio-ui-dropdown-padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";--bolio-ui-dropdown-font-size:").concat(SCALES.font(0.875), ";}.btn-dropdown.__jsx-style-dynamic-selector>button{border-top-left-radius:").concat(theme.layout.radius, ";border-bottom-left-radius:").concat(theme.layout.radius, ";}details.__jsx-style-dynamic-selector{border-top-right-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";overflow:hidden;}.dropdown-box.__jsx-style-dynamic-selector{height:").concat(SCALES.height(2.5), ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;}summary.__jsx-style-dynamic-selector{box-sizing:border-box;-webkit-tap-highlight-color:transparent;list-style:none;outline:none;color:").concat(colors.color, ";background-color:").concat(bgColor, ";height:").concat(SCALES.height(2.5), ";cursor:").concat(disabled || loading ? 'not-allowed' : 'pointer', ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:auto;padding:0 1px;-webkit-transition:background 0.2s ease 0s,border-color 0.2s ease 0s;transition:background 0.2s ease 0s,border-color 0.2s ease 0s;}.content.__jsx-style-dynamic-selector{position:absolute;right:0;left:0;z-index:90;width:100%;border-radius:").concat(theme.layout.radius, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";-webkit-transform:translateY(").concat(theme.layout.gapHalf, ");-ms-transform:translateY(").concat(theme.layout.gapHalf, ");transform:translateY(").concat(theme.layout.gapHalf, ");background-color:").concat(theme.palette.background, ";}.content.__jsx-style-dynamic-selector>button:first-of-type{border-top-left-radius:").concat(theme.layout.radius, ";border-top-right-radius:").concat(theme.layout.radius, ";}.content.__jsx-style-dynamic-selector>button:last-of-type{border-bottom-left-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";}.dropdown-icon.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transform:scale(0.6);-ms-transform:scale(0.6);transform:scale(0.6);}"))));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
ButtonDropdownComponent.displayName = 'BolioUIButtonDropdown';
|
|
@@ -5,56 +5,56 @@ export var getColor = function getColor(palette, type) {
|
|
|
5
5
|
"default": {
|
|
6
6
|
color: palette.foreground,
|
|
7
7
|
bgColor: palette.accents_2,
|
|
8
|
-
borderColor: palette.
|
|
9
|
-
borderLeftColor: palette.
|
|
10
|
-
hoverBgColor: palette.
|
|
11
|
-
hoverBorder: palette.
|
|
8
|
+
borderColor: palette.accents_3,
|
|
9
|
+
borderLeftColor: palette.accents_3,
|
|
10
|
+
hoverBgColor: palette.accents_3,
|
|
11
|
+
hoverBorder: palette.accents_7
|
|
12
12
|
},
|
|
13
13
|
primary: {
|
|
14
14
|
color: palette.primaryDark,
|
|
15
|
-
bgColor: palette.
|
|
16
|
-
borderColor: palette.
|
|
17
|
-
borderLeftColor: palette.
|
|
15
|
+
bgColor: palette.primaryLight,
|
|
16
|
+
borderColor: palette.primary,
|
|
17
|
+
borderLeftColor: palette.primary,
|
|
18
18
|
hoverBgColor: palette.primaryLight,
|
|
19
19
|
hoverBorder: palette.primary
|
|
20
20
|
},
|
|
21
21
|
secondary: {
|
|
22
22
|
color: palette.secondaryDark,
|
|
23
|
-
bgColor: palette.
|
|
24
|
-
borderColor: palette.
|
|
25
|
-
borderLeftColor: palette.
|
|
23
|
+
bgColor: palette.secondaryLight,
|
|
24
|
+
borderColor: palette.secondary,
|
|
25
|
+
borderLeftColor: palette.secondary,
|
|
26
26
|
hoverBgColor: palette.secondaryLight,
|
|
27
27
|
hoverBorder: palette.secondary
|
|
28
28
|
},
|
|
29
29
|
success: {
|
|
30
30
|
color: palette.successDark,
|
|
31
|
-
bgColor: palette.
|
|
32
|
-
borderColor: palette.
|
|
33
|
-
borderLeftColor: palette.
|
|
31
|
+
bgColor: palette.successLight,
|
|
32
|
+
borderColor: palette.success,
|
|
33
|
+
borderLeftColor: palette.success,
|
|
34
34
|
hoverBgColor: palette.successLight,
|
|
35
35
|
hoverBorder: palette.success
|
|
36
36
|
},
|
|
37
37
|
warning: {
|
|
38
38
|
color: palette.warningDark,
|
|
39
|
-
bgColor: palette.
|
|
40
|
-
borderColor: palette.
|
|
41
|
-
borderLeftColor: palette.
|
|
39
|
+
bgColor: palette.warningLight,
|
|
40
|
+
borderColor: palette.warning,
|
|
41
|
+
borderLeftColor: palette.warning,
|
|
42
42
|
hoverBgColor: palette.warningLight,
|
|
43
43
|
hoverBorder: palette.warning
|
|
44
44
|
},
|
|
45
45
|
error: {
|
|
46
46
|
color: palette.errorDark,
|
|
47
|
-
bgColor: palette.
|
|
48
|
-
borderColor: palette.
|
|
49
|
-
borderLeftColor: palette.
|
|
47
|
+
bgColor: palette.errorLight,
|
|
48
|
+
borderColor: palette.error,
|
|
49
|
+
borderLeftColor: palette.error,
|
|
50
50
|
hoverBgColor: palette.errorLight,
|
|
51
51
|
hoverBorder: palette.error
|
|
52
52
|
},
|
|
53
53
|
info: {
|
|
54
54
|
color: palette.infoDark,
|
|
55
|
-
bgColor: palette.
|
|
56
|
-
borderColor: palette.
|
|
57
|
-
borderLeftColor: palette.
|
|
55
|
+
bgColor: palette.infoLight,
|
|
56
|
+
borderColor: palette.info,
|
|
57
|
+
borderLeftColor: palette.info,
|
|
58
58
|
hoverBgColor: palette.infoLight,
|
|
59
59
|
hoverBorder: palette.info
|
|
60
60
|
}
|
|
@@ -65,7 +65,7 @@ export var getColor = function getColor(palette, type) {
|
|
|
65
65
|
borderColor: palette.accents_4,
|
|
66
66
|
borderLeftColor: palette.accents_4,
|
|
67
67
|
hoverBgColor: palette.accents_3,
|
|
68
|
-
hoverBorder: palette.
|
|
68
|
+
hoverBorder: palette.accents_4
|
|
69
69
|
});
|
|
70
70
|
return type ? colors[type] : colors["default"];
|
|
71
71
|
};
|
package/esm/Input/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
var _excluded = ["label", "labelRight", "type", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "rounded", "backgroundColor", "borderColor", "hoverBorder"];
|
|
4
|
+
var _excluded = ["label", "labelRight", "type", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "rounded", "backgroundColor", "borderColor", "hoverBorder", "error", "errorMessage"];
|
|
5
5
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
6
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import useTheme from '../use-theme';
|
|
@@ -47,6 +47,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
47
47
|
backgroundColor = _ref.backgroundColor,
|
|
48
48
|
borderColor = _ref.borderColor,
|
|
49
49
|
hoverBorder = _ref.hoverBorder,
|
|
50
|
+
error = _ref.error,
|
|
51
|
+
errorMessage = _ref.errorMessage,
|
|
50
52
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
53
|
|
|
52
54
|
var theme = useTheme();
|
|
@@ -77,13 +79,10 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
77
79
|
}, [label, labelRight]);
|
|
78
80
|
var iconClasses = useMemo(function () {
|
|
79
81
|
return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
|
|
80
|
-
}, [icon, iconRight]);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// } = useMemo(() => getColors(theme.palette, type), [theme.palette, type])
|
|
85
|
-
|
|
86
|
-
var colors = getColors(theme.palette, type);
|
|
82
|
+
}, [icon, iconRight]);
|
|
83
|
+
var colors = useMemo(function () {
|
|
84
|
+
return getColors(theme.palette, type, disabled);
|
|
85
|
+
}, [theme.palette, type, disabled]);
|
|
87
86
|
|
|
88
87
|
var changeHandler = function changeHandler(event) {
|
|
89
88
|
if (disabled || readOnly) return;
|
|
@@ -138,11 +137,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
138
137
|
var inputProps = _extends({}, props, controlledValue);
|
|
139
138
|
|
|
140
139
|
return /*#__PURE__*/React.createElement("div", {
|
|
141
|
-
className: _JSXStyle.dynamic([["
|
|
140
|
+
className: _JSXStyle.dynamic([["2075686027", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), rounded ? '25px' : theme.layout.radius, borderColor ? borderColor : colors.borderColor, backgroundColor ? backgroundColor : colors.bgColor, hoverBorder ? hoverBorder : colors.hoverBorder, backgroundColor ? backgroundColor : colors.hoverBgColor, colors.hoverBorder, SCALES.font(0.875), colors.color, theme.palette.accents_3, theme.palette.background, colors.color]]]) + " " + "with-label"
|
|
142
141
|
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
143
|
-
className: _JSXStyle.dynamic([["
|
|
142
|
+
className: _JSXStyle.dynamic([["2075686027", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), rounded ? '25px' : theme.layout.radius, borderColor ? borderColor : colors.borderColor, backgroundColor ? backgroundColor : colors.bgColor, hoverBorder ? hoverBorder : colors.hoverBorder, backgroundColor ? backgroundColor : colors.hoverBgColor, colors.hoverBorder, SCALES.font(0.875), colors.color, theme.palette.accents_3, theme.palette.background, colors.color]]]) + " " + (useClasses('input-container', className) || "")
|
|
144
143
|
}, label && /*#__PURE__*/React.createElement(InputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
145
|
-
className: _JSXStyle.dynamic([["
|
|
144
|
+
className: _JSXStyle.dynamic([["2075686027", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), rounded ? '25px' : theme.layout.radius, borderColor ? borderColor : colors.borderColor, backgroundColor ? backgroundColor : colors.bgColor, hoverBorder ? hoverBorder : colors.hoverBorder, backgroundColor ? backgroundColor : colors.hoverBgColor, colors.hoverBorder, SCALES.font(0.875), colors.color, theme.palette.accents_3, theme.palette.background, colors.color]]]) + " " + (useClasses('input-wrapper', {
|
|
146
145
|
hover: hover,
|
|
147
146
|
disabled: disabled
|
|
148
147
|
}, labelClasses) || "")
|
|
@@ -159,7 +158,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
159
158
|
onChange: changeHandler,
|
|
160
159
|
autoComplete: autoComplete
|
|
161
160
|
}, inputProps, {
|
|
162
|
-
className: _JSXStyle.dynamic([["
|
|
161
|
+
className: _JSXStyle.dynamic([["2075686027", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), rounded ? '25px' : theme.layout.radius, borderColor ? borderColor : colors.borderColor, backgroundColor ? backgroundColor : colors.bgColor, hoverBorder ? hoverBorder : colors.hoverBorder, backgroundColor ? backgroundColor : colors.hoverBgColor, colors.hoverBorder, SCALES.font(0.875), colors.color, theme.palette.accents_3, theme.palette.background, colors.color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
|
|
163
162
|
disabled: disabled
|
|
164
163
|
}, iconClasses) || "")
|
|
165
164
|
})), clearable && /*#__PURE__*/React.createElement(InputClearIcon, {
|
|
@@ -170,10 +169,12 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
170
169
|
icon: iconRight
|
|
171
170
|
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(InputLabel, {
|
|
172
171
|
isRight: true
|
|
173
|
-
}, labelRight)), /*#__PURE__*/React.createElement(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
}, labelRight)), error && /*#__PURE__*/React.createElement(InputBlockLabel, {
|
|
173
|
+
error: error
|
|
174
|
+
}, errorMessage), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
175
|
+
id: "2075686027",
|
|
176
|
+
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), rounded ? '25px' : theme.layout.radius, borderColor ? borderColor : colors.borderColor, backgroundColor ? backgroundColor : colors.bgColor, hoverBorder ? hoverBorder : colors.hoverBorder, backgroundColor ? backgroundColor : colors.hoverBgColor, colors.hoverBorder, SCALES.font(0.875), colors.color, theme.palette.accents_3, theme.palette.background, colors.color]
|
|
177
|
+
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'initial'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, 'initial'), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(rounded ? '25px' : theme.layout.radius, ";border:1px solid ").concat(borderColor ? borderColor : colors.borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;background:").concat(backgroundColor ? backgroundColor : colors.bgColor, ";}.input-wrapper.active.__jsx-style-dynamic-selector,.input-wrapper.__jsx-style-dynamic-selector:hover{border:1px solid ").concat(hoverBorder ? hoverBorder : colors.hoverBorder, ";background:").concat(backgroundColor ? backgroundColor : colors.hoverBgColor, ";}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(colors.hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0 4px;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(colors.color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme.palette.background, " inset !important;-webkit-text-fill-color:").concat(colors.color, " !important;}")));
|
|
177
178
|
});
|
|
178
179
|
InputComponent.defaultProps = defaultProps;
|
|
179
180
|
InputComponent.displayName = 'BolioUIInput';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
export interface InputBlockLabelLabel {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
+
error?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare function InputBlockLabelComponent({ children }: InputBlockLabelLabel): JSX.Element;
|
|
6
|
+
declare function InputBlockLabelComponent({ children, error }: InputBlockLabelLabel): JSX.Element;
|
|
6
7
|
declare namespace InputBlockLabelComponent {
|
|
7
8
|
var displayName: string;
|
|
8
9
|
}
|
|
@@ -3,14 +3,15 @@ import React from 'react';
|
|
|
3
3
|
import useTheme from '../use-theme';
|
|
4
4
|
|
|
5
5
|
function InputBlockLabelComponent(_ref) {
|
|
6
|
-
var children = _ref.children
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
error = _ref.error;
|
|
7
8
|
var theme = useTheme();
|
|
8
9
|
return /*#__PURE__*/React.createElement("label", {
|
|
9
|
-
className: _JSXStyle.dynamic([["
|
|
10
|
+
className: _JSXStyle.dynamic([["3490168518", [error ? theme.palette.error : theme.palette.accents_6, error && '0.5em', error ? '0.875rem' : '1em']]])
|
|
10
11
|
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
11
|
-
id: "
|
|
12
|
-
dynamic: [theme.palette.accents_6]
|
|
13
|
-
}, "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
|
|
12
|
+
id: "3490168518",
|
|
13
|
+
dynamic: [error ? theme.palette.error : theme.palette.accents_6, error && '0.5em', error ? '0.875rem' : '1em']
|
|
14
|
+
}, "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(error ? theme.palette.error : theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;margin-bottom:").concat(error && '0.5em', ";font-size:").concat(error ? '0.875rem' : '1em', ";line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
InputBlockLabelComponent.displayName = 'BolioUIInputBlockLabel';
|
package/esm/Input/styles.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export declare type InputColor = {
|
|
|
6
6
|
hoverBgColor: string;
|
|
7
7
|
hoverBorder: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const getColors: (palette: BolioUIThemesPalette, status?: "success" | "primary" | "secondary" | "error" | "warning" | "info" | "default" | undefined) => InputColor;
|
|
9
|
+
export declare const getColors: (palette: BolioUIThemesPalette, status?: "success" | "primary" | "secondary" | "error" | "warning" | "info" | "default" | undefined, disabled?: boolean | undefined, readOnly?: boolean | undefined) => InputColor;
|
package/esm/Input/styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var getColors = function getColors(palette, status) {
|
|
1
|
+
export var getColors = function getColors(palette, status, disabled, readOnly) {
|
|
2
2
|
var colors = {
|
|
3
3
|
"default": {
|
|
4
4
|
color: palette.foreground,
|
|
@@ -9,47 +9,61 @@ export var getColors = function getColors(palette, status) {
|
|
|
9
9
|
},
|
|
10
10
|
primary: {
|
|
11
11
|
color: palette.primaryDark,
|
|
12
|
-
bgColor: palette.
|
|
13
|
-
borderColor: palette.
|
|
12
|
+
bgColor: palette.primaryLight,
|
|
13
|
+
borderColor: palette.primary,
|
|
14
14
|
hoverBgColor: palette.primaryLight,
|
|
15
15
|
hoverBorder: palette.primary
|
|
16
16
|
},
|
|
17
17
|
secondary: {
|
|
18
18
|
color: palette.secondaryDark,
|
|
19
|
-
bgColor: palette.
|
|
20
|
-
borderColor: palette.
|
|
19
|
+
bgColor: palette.secondaryLight,
|
|
20
|
+
borderColor: palette.secondary,
|
|
21
21
|
hoverBgColor: palette.secondaryLight,
|
|
22
22
|
hoverBorder: palette.secondary
|
|
23
23
|
},
|
|
24
24
|
success: {
|
|
25
25
|
color: palette.successDark,
|
|
26
|
-
bgColor: palette.
|
|
27
|
-
borderColor: palette.
|
|
26
|
+
bgColor: palette.successLight,
|
|
27
|
+
borderColor: palette.success,
|
|
28
28
|
hoverBgColor: palette.successLight,
|
|
29
29
|
hoverBorder: palette.success
|
|
30
30
|
},
|
|
31
31
|
warning: {
|
|
32
32
|
color: palette.warningDark,
|
|
33
|
-
bgColor: palette.
|
|
34
|
-
borderColor: palette.
|
|
33
|
+
bgColor: palette.warningLight,
|
|
34
|
+
borderColor: palette.warning,
|
|
35
35
|
hoverBgColor: palette.warningLight,
|
|
36
36
|
hoverBorder: palette.warning
|
|
37
37
|
},
|
|
38
38
|
error: {
|
|
39
39
|
color: palette.errorDark,
|
|
40
|
-
bgColor: palette.
|
|
41
|
-
borderColor: palette.
|
|
40
|
+
bgColor: palette.errorLight,
|
|
41
|
+
borderColor: palette.error,
|
|
42
42
|
hoverBgColor: palette.errorLight,
|
|
43
43
|
hoverBorder: palette.error
|
|
44
44
|
},
|
|
45
45
|
info: {
|
|
46
46
|
color: palette.infoDark,
|
|
47
|
-
bgColor: palette.
|
|
48
|
-
borderColor: palette.
|
|
47
|
+
bgColor: palette.infoLight,
|
|
48
|
+
borderColor: palette.info,
|
|
49
49
|
hoverBgColor: palette.infoLight,
|
|
50
50
|
hoverBorder: palette.info
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
if (disabled) return {
|
|
54
|
+
color: palette.accents_5,
|
|
55
|
+
bgColor: palette.accents_3,
|
|
56
|
+
borderColor: palette.accents_4,
|
|
57
|
+
hoverBgColor: palette.accents_3,
|
|
58
|
+
hoverBorder: palette.accents_4
|
|
59
|
+
};
|
|
60
|
+
if (readOnly) return {
|
|
61
|
+
color: palette.foreground,
|
|
62
|
+
bgColor: palette.accents_2,
|
|
63
|
+
borderColor: palette.accents_3,
|
|
64
|
+
hoverBgColor: palette.accents_2,
|
|
65
|
+
hoverBorder: palette.accents_6
|
|
66
|
+
};
|
|
53
67
|
if (!status) return colors["default"];
|
|
54
68
|
return colors[status];
|
|
55
69
|
};
|
package/esm/Select/Select.js
CHANGED
|
@@ -92,8 +92,8 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
92
92
|
return value.length === 0;
|
|
93
93
|
}, [value]);
|
|
94
94
|
var colors = useMemo(function () {
|
|
95
|
-
return getColors(theme.palette, type);
|
|
96
|
-
}, [theme.palette, type]);
|
|
95
|
+
return getColors(theme.palette, type, disabled);
|
|
96
|
+
}, [theme.palette, type, disabled]);
|
|
97
97
|
|
|
98
98
|
var updateVisible = function updateVisible(next) {
|
|
99
99
|
onDropdownVisibleChange(next);
|
|
@@ -201,7 +201,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
201
201
|
onClick: clickHandler,
|
|
202
202
|
onMouseDown: mouseDownHandler
|
|
203
203
|
}, props, {
|
|
204
|
-
className: _JSXStyle.dynamic([["
|
|
204
|
+
className: _JSXStyle.dynamic([["12953029", [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
205
205
|
}), /*#__PURE__*/React.createElement(SelectInput, {
|
|
206
206
|
ref: inputRef,
|
|
207
207
|
visible: visible,
|
|
@@ -210,11 +210,11 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
210
210
|
return setSelectFocus(true);
|
|
211
211
|
}
|
|
212
212
|
}), isEmpty && /*#__PURE__*/React.createElement("span", {
|
|
213
|
-
className: _JSXStyle.dynamic([["
|
|
213
|
+
className: _JSXStyle.dynamic([["12953029", [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]]]) + " " + "value placeholder"
|
|
214
214
|
}, /*#__PURE__*/React.createElement(Ellipsis, {
|
|
215
215
|
height: "var(--select-height)"
|
|
216
216
|
}, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
|
|
217
|
-
className: _JSXStyle.dynamic([["
|
|
217
|
+
className: _JSXStyle.dynamic([["12953029", [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]]]) + " " + "value"
|
|
218
218
|
}, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
|
|
219
219
|
gap: 0.5
|
|
220
220
|
}, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
|
|
@@ -225,13 +225,13 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
|
|
|
225
225
|
disableMatchWidth: disableMatchWidth,
|
|
226
226
|
getPopupContainer: getPopupContainer
|
|
227
227
|
}, children), !pure && /*#__PURE__*/React.createElement("div", {
|
|
228
|
-
className: _JSXStyle.dynamic([["
|
|
228
|
+
className: _JSXStyle.dynamic([["12953029", [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]]]) + " " + "icon"
|
|
229
229
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
230
|
-
className: _JSXStyle.dynamic([["
|
|
230
|
+
className: _JSXStyle.dynamic([["12953029", [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]]])
|
|
231
231
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
232
|
-
id: "
|
|
233
|
-
dynamic: [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius,
|
|
234
|
-
}, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(colors.borderColor, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(
|
|
232
|
+
id: "12953029",
|
|
233
|
+
dynamic: [disabled ? 'not-allowed' : 'pointer', colors.borderColor, theme.layout.radius, colors.bgColor, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), colors.hoverBorder, colors.hoverBgColor, colors.color, colors.color, colors.color, SCALES.font(0.775), theme.layout.gapQuarter, visible ? '180' : '0', colors.color]
|
|
234
|
+
}, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(colors.borderColor, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(colors.bgColor, ";--select-font-size:").concat(SCALES.font(0.875), ";--select-height:").concat(SCALES.height(2.25), ";min-width:11.5em;width:").concat(SCALES.width(1, 'initial'), ";height:var(--select-height);padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.multiple.__jsx-style-dynamic-selector{height:auto;min-height:var(--select-height);padding:").concat(SCALES.pt(0.334), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0.334), " ").concat(SCALES.pl(0.667), ";}.select.active.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover{border-color:").concat(colors.hoverBorder, ";background-color:").concat(colors.hoverBgColor, ";}.select.active.icon.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover .icon.__jsx-style-dynamic-selector{color:").concat(colors.color, ";}.value.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0;margin-right:1.25em;font-size:var(--select-font-size);color:").concat(colors.color, ";width:calc(100% - 1.25em);}.value.__jsx-style-dynamic-selector>div,.value.__jsx-style-dynamic-selector>div:hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}.placeholder.__jsx-style-dynamic-selector{color:").concat(colors.color, ";font-size:").concat(SCALES.font(0.775), ";}.icon.__jsx-style-dynamic-selector{position:absolute;right:").concat(theme.layout.gapQuarter, ";font-size:var(--select-font-size);top:50%;bottom:0;-webkit-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);-ms-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);pointer-events:none;-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(colors.color, ";}"))));
|
|
235
235
|
});
|
|
236
236
|
SelectComponent.defaultProps = defaultProps;
|
|
237
237
|
SelectComponent.displayName = 'BolioUISelect';
|
package/esm/Select/styles.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export declare type SelectColor = {
|
|
|
6
6
|
hoverBgColor: string;
|
|
7
7
|
hoverBorder: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const getColors: (palette: BolioUIThemesPalette, status?: "success" | "primary" | "secondary" | "error" | "warning" | "info" | "default" | undefined) => SelectColor;
|
|
9
|
+
export declare const getColors: (palette: BolioUIThemesPalette, status?: "success" | "primary" | "secondary" | "error" | "warning" | "info" | "default" | undefined, disabled?: boolean | undefined) => SelectColor;
|
package/esm/Select/styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var getColors = function getColors(palette, status) {
|
|
1
|
+
export var getColors = function getColors(palette, status, disabled) {
|
|
2
2
|
var colors = {
|
|
3
3
|
"default": {
|
|
4
4
|
color: palette.foreground,
|
|
@@ -9,47 +9,54 @@ export var getColors = function getColors(palette, status) {
|
|
|
9
9
|
},
|
|
10
10
|
primary: {
|
|
11
11
|
color: palette.primaryDark,
|
|
12
|
-
bgColor: palette.
|
|
13
|
-
borderColor: palette.
|
|
12
|
+
bgColor: palette.primaryLight,
|
|
13
|
+
borderColor: palette.primary,
|
|
14
14
|
hoverBgColor: palette.primaryLight,
|
|
15
15
|
hoverBorder: palette.primary
|
|
16
16
|
},
|
|
17
17
|
secondary: {
|
|
18
18
|
color: palette.secondaryDark,
|
|
19
|
-
bgColor: palette.
|
|
20
|
-
borderColor: palette.
|
|
19
|
+
bgColor: palette.secondaryLight,
|
|
20
|
+
borderColor: palette.secondary,
|
|
21
21
|
hoverBgColor: palette.secondaryLight,
|
|
22
22
|
hoverBorder: palette.secondary
|
|
23
23
|
},
|
|
24
24
|
success: {
|
|
25
25
|
color: palette.successDark,
|
|
26
|
-
bgColor: palette.
|
|
27
|
-
borderColor: palette.
|
|
26
|
+
bgColor: palette.successLight,
|
|
27
|
+
borderColor: palette.success,
|
|
28
28
|
hoverBgColor: palette.successLight,
|
|
29
29
|
hoverBorder: palette.success
|
|
30
30
|
},
|
|
31
31
|
warning: {
|
|
32
32
|
color: palette.warningDark,
|
|
33
|
-
bgColor: palette.
|
|
34
|
-
borderColor: palette.
|
|
33
|
+
bgColor: palette.warningLight,
|
|
34
|
+
borderColor: palette.warning,
|
|
35
35
|
hoverBgColor: palette.warningLight,
|
|
36
36
|
hoverBorder: palette.warning
|
|
37
37
|
},
|
|
38
38
|
error: {
|
|
39
39
|
color: palette.errorDark,
|
|
40
|
-
bgColor: palette.
|
|
41
|
-
borderColor: palette.
|
|
40
|
+
bgColor: palette.errorLight,
|
|
41
|
+
borderColor: palette.error,
|
|
42
42
|
hoverBgColor: palette.errorLight,
|
|
43
43
|
hoverBorder: palette.error
|
|
44
44
|
},
|
|
45
45
|
info: {
|
|
46
46
|
color: palette.infoDark,
|
|
47
|
-
bgColor: palette.
|
|
48
|
-
borderColor: palette.
|
|
47
|
+
bgColor: palette.infoLight,
|
|
48
|
+
borderColor: palette.info,
|
|
49
49
|
hoverBgColor: palette.infoLight,
|
|
50
50
|
hoverBorder: palette.info
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
if (disabled) return {
|
|
54
|
+
color: palette.accents_5,
|
|
55
|
+
bgColor: palette.accents_3,
|
|
56
|
+
borderColor: palette.accents_4,
|
|
57
|
+
hoverBgColor: palette.accents_3,
|
|
58
|
+
hoverBorder: palette.accents_4
|
|
59
|
+
};
|
|
53
60
|
if (!status) return colors["default"];
|
|
54
61
|
return colors[status];
|
|
55
62
|
};
|