@councilbox/councilbox-ui 1.0.0 → 2.0.0
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/useDynamicStyles.js +99 -0
- package/dist/HOCs/useRipple.js +91 -0
- package/dist/build-index.js +8 -0
- package/dist/components/1.Introduction.stories.mdx +2 -1
- package/dist/components/2.Changelog.stories.mdx +7 -0
- package/dist/components/3.Guide.stories.mdx +56 -0
- package/dist/components/Accordion/Accordion.css +39 -1
- package/dist/components/Accordion/Accordion.js +84 -45
- package/dist/components/Accordion/Accordion.stories.js +4 -2
- package/dist/components/Accordion/AccordionOld.css +16 -0
- package/dist/components/Accordion/AccordionOld.js +115 -0
- package/dist/components/Accordion/DesignAccordion.stories.js +38 -0
- package/dist/components/Alert/Alert.css +5 -0
- package/dist/components/Alert/Alert.js +17 -6
- package/dist/components/Avatar/Avatar.css +3 -3
- package/dist/components/Avatar/Avatar.js +36 -20
- package/dist/components/Avatar/AvatarOld.js +138 -0
- package/dist/components/Avatar/DesignAvatar.stories.js +1 -1
- package/dist/components/Block/Block.js +17 -2
- package/dist/components/ButtonBasic/ButtonBasic.css +264 -20
- package/dist/components/ButtonBasic/ButtonBasic.js +85 -110
- package/dist/components/ButtonBasic/ButtonBasicOld.css +41 -0
- package/dist/components/ButtonBasic/ButtonBasicOld.js +231 -0
- package/dist/components/Checkbox/Checkbox.css +101 -22
- package/dist/components/Checkbox/Checkbox.js +119 -63
- package/dist/components/Checkbox/CheckboxOld.css +31 -0
- package/dist/components/Checkbox/CheckboxOld.js +112 -0
- package/dist/components/DragDrop/DragDrop.js +24 -9
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +4 -2
- package/dist/components/DrawerPanel/DrawerPanel.css +76 -36
- package/dist/components/DrawerPanel/DrawerPanel.js +137 -115
- package/dist/components/DrawerPanel/DrawerPanelOld.css +56 -0
- package/dist/components/DrawerPanel/DrawerPanelOld.js +233 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +146 -17
- package/dist/components/DropDown/DropDown.css +96 -1
- package/dist/components/DropDown/DropDown.js +363 -82
- package/dist/components/DropDown/DropDown.stories.js +1 -0
- package/dist/components/DropDown/DropDownOld.css +3 -0
- package/dist/components/DropDown/DropDownOld.js +186 -0
- package/dist/components/DropDown/PopoverPlayground.css +22 -0
- package/dist/components/DropDown/PopoverPlayground.js +235 -0
- package/dist/components/EnhancedTable/EnhancedTable.js +5 -6
- package/dist/components/FabButton/DesignFabButton.stories.js +3 -1
- package/dist/components/FabButton/FabButton.js +25 -5
- package/dist/components/Grid/DesignGrid.stories.js +9 -3
- package/dist/components/Grid/Grid.css +325 -0
- package/dist/components/Grid/Grid.js +57 -16
- package/dist/components/Grid/GridItem.js +31 -13
- package/dist/components/Grid/GridItemOld.js +43 -0
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +53 -0
- package/dist/components/Header/Header.js +144 -115
- package/dist/components/IconButton/DesignIconButton.stories.js +37 -2
- package/dist/components/IconButton/IconButton.css +144 -0
- package/dist/components/IconButton/IconButton.js +177 -50
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +138 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +20 -90
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +43 -0
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +133 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +109 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +316 -77
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +118 -6
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +5 -0
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +178 -0
- package/dist/components/InputPassword/InputPassword.js +10 -20
- package/dist/components/InputText/InputText.css +442 -1
- package/dist/components/InputText/InputText.js +298 -239
- package/dist/components/InputText/InputText.stories.js +12 -3
- package/dist/components/InputText/InputTextOld.css +10 -0
- package/dist/components/InputText/InputTextOld.js +340 -0
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +30 -4
- package/dist/components/InputTextArea/InputTextArea.js +13 -6
- package/dist/components/LoadingSection/LoadingSection.css +44 -2
- package/dist/components/LoadingSection/LoadingSection.js +63 -9
- package/dist/components/MenuItem/DesignMenuItem.stories.js +1 -0
- package/dist/components/MenuItem/MenuItem.css +31 -6
- package/dist/components/MenuItem/MenuItem.js +95 -50
- package/dist/components/MenuItem/MenuItemOld.js +139 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +60 -40
- package/dist/components/MenuLateralRight/MenuLateralRight.js +32 -12
- package/dist/components/Modal/DesignModal.stories.js +54 -0
- package/dist/components/Modal/Modal.css +81 -2
- package/dist/components/Modal/Modal.js +112 -80
- package/dist/components/Modal/Modal.stories.js +13 -2
- package/dist/components/Modal/ModalOld.css +3 -0
- package/dist/components/Modal/ModalOld.js +230 -0
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +9 -1
- package/dist/components/PaginationFooter/PaginationFooter.css +73 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +45 -87
- package/dist/components/RadioButton/Radio.css +115 -16
- package/dist/components/RadioButton/Radio.js +70 -94
- package/dist/components/RadioButton/Radio.stories.js +42 -18
- package/dist/components/RadioButton/RadioOld.css +31 -0
- package/dist/components/RadioButton/RadioOld.js +142 -0
- package/dist/components/Ripple/DesignRipple.js +77 -0
- package/dist/components/Ripple/Ripple.stories.js +45 -0
- package/dist/components/Scrollbar/Scrollbar.js +21 -6
- package/dist/components/SelectInput/DesignSelectInput.js +62 -23
- package/dist/components/SelectInput/SelectInput.css +128 -10
- package/dist/components/SelectInput/SelectInput.js +233 -246
- package/dist/components/SelectInput/SelectInputOld.css +17 -0
- package/dist/components/SelectInput/SelectInputOld.js +325 -0
- package/dist/components/Stars/Stars.css +28 -28
- package/dist/components/Stars/Stars.js +22 -12
- package/dist/components/Stepper/Stepper.css +1 -0
- package/dist/components/Stepper/Stepper.js +81 -24
- package/dist/components/Table/DesignTable.stories.js +1 -0
- package/dist/components/Table/Table.css +56 -53
- package/dist/components/Table/Table.js +55 -75
- package/dist/components/Table/TableOld.css +79 -0
- package/dist/components/Table/TableOld.js +165 -0
- package/dist/components/Tabs/DesignTabs.js +37 -12
- package/dist/components/Tabs/Tabs.css +39 -4
- package/dist/components/Tabs/Tabs.js +194 -30
- package/dist/components/Tabs/Tabs.stories.js +8 -1
- package/dist/components/Tabs/TabsOld.js +92 -0
- package/dist/components/Tag/Tag.js +19 -9
- package/dist/components/Toggle/Toggle.css +122 -3
- package/dist/components/Toggle/Toggle.js +95 -68
- package/dist/components/Tooltip/DesignTooltip.stories.js +48 -0
- package/dist/components/Tooltip/Tooltip.css +75 -0
- package/dist/components/Tooltip/Tooltip.js +126 -0
- package/dist/components/Tooltip/Tooltip.stories.js +40 -0
- package/dist/components/Typography/Typography.css +9 -0
- package/dist/components/Typography/Typography.js +30 -21
- package/dist/components/Typography/TypographyOld.js +132 -0
- package/dist/styles/colorConsts.css +24 -0
- package/dist/styles/main.css +41 -49
- package/dist/styles/scpacingConsts.css +26 -0
- package/dist/styles/zIndexConsts.css +9 -0
- package/package.json +2 -1
|
@@ -0,0 +1,325 @@
|
|
|
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 _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
13
|
+
|
|
14
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
15
|
+
|
|
16
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
17
|
+
|
|
18
|
+
var _material = require("@mui/material");
|
|
19
|
+
|
|
20
|
+
require("../../styles/main.css");
|
|
21
|
+
|
|
22
|
+
require("./SelectInputOld.css");
|
|
23
|
+
|
|
24
|
+
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
25
|
+
|
|
26
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
27
|
+
|
|
28
|
+
var _excluded = ["id", "className", "onChange", "label", "disabled", "width", "fullWidth", "children", "error", "helperText", "helper", "variant", "endAdornment", "success", "sx", "sxFormControl", "propsFormControl"];
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
var CssSelect = (0, _styled.default)(_Select.default)(function () {
|
|
45
|
+
return {
|
|
46
|
+
'& .MuiInput-underline:after': {
|
|
47
|
+
borderBottomColor: 'var(--gray5)',
|
|
48
|
+
borderWidth: '2px'
|
|
49
|
+
},
|
|
50
|
+
'& .MuiSelect-nativeInput': {
|
|
51
|
+
height: '3rem',
|
|
52
|
+
lineHeight: 'var(--spacing12)',
|
|
53
|
+
padding: 'var(--spacing12)',
|
|
54
|
+
paddingRight: 'var(--spacing8)'
|
|
55
|
+
},
|
|
56
|
+
'&.MuiInputBase-root.Mui-error': {
|
|
57
|
+
color: 'var(--error)'
|
|
58
|
+
},
|
|
59
|
+
'&.MuiInputBase-root.Mui-error input, &.MuiInputBase-root.Mui-error div, .MuiOutlinedInput-input.Mui-disabled': {
|
|
60
|
+
color: 'var(--gray5)',
|
|
61
|
+
WebkitTextFillColor: 'unset'
|
|
62
|
+
},
|
|
63
|
+
'&.Mui-disabled svg': {
|
|
64
|
+
display: 'none'
|
|
65
|
+
},
|
|
66
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
67
|
+
color: 'var(--gray5)',
|
|
68
|
+
paddingRight: 'var(--spacing8)',
|
|
69
|
+
'& fieldset': {
|
|
70
|
+
borderColor: 'var(--gray3)',
|
|
71
|
+
borderWidth: '1px',
|
|
72
|
+
'& legend': {
|
|
73
|
+
'& span': {
|
|
74
|
+
paddingLeft: 'var(--spacing4)',
|
|
75
|
+
paddingRight: 'var(--spacing4)'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
'&:hover fieldset': {
|
|
80
|
+
borderColor: 'var(--gray3)',
|
|
81
|
+
borderWidth: '2px'
|
|
82
|
+
},
|
|
83
|
+
'&:active fieldset': {
|
|
84
|
+
borderColor: 'var(--gray3)',
|
|
85
|
+
borderWidth: '2px'
|
|
86
|
+
},
|
|
87
|
+
'&.Mui-focused fieldset': {
|
|
88
|
+
borderColor: 'var(--primary)',
|
|
89
|
+
borderWidth: '2px'
|
|
90
|
+
},
|
|
91
|
+
'&:focus-visible': {
|
|
92
|
+
outline: 'none',
|
|
93
|
+
'& fieldset': {
|
|
94
|
+
outline: 'none',
|
|
95
|
+
boxShadow: '0 0 0 3px white, 0 0 7px 4px var(--primary)',
|
|
96
|
+
border: '2px solid var(--gray4)'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
'&.MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline': {
|
|
101
|
+
border: '1px dashed var(--gray2)'
|
|
102
|
+
},
|
|
103
|
+
'&.MuiInputLabel-root.Mui-disabled': {
|
|
104
|
+
color: 'var(--gray3)'
|
|
105
|
+
},
|
|
106
|
+
'&.MuiFormHelperText-root.Mui-focused div h6': {
|
|
107
|
+
color: 'var(--primary)'
|
|
108
|
+
},
|
|
109
|
+
'&.MuiInputBase-root.MuiOutlinedInput-root': {
|
|
110
|
+
color: 'var(--gray5)'
|
|
111
|
+
},
|
|
112
|
+
'&.MuiFilledInput-root .MuiSelect-nativeInput': {
|
|
113
|
+
height: '3rem',
|
|
114
|
+
lineHeight: 'var(--spacing12)',
|
|
115
|
+
padding: 'var(--spacing12)',
|
|
116
|
+
paddingRight: 'var(--spacing8)'
|
|
117
|
+
},
|
|
118
|
+
'& .MuiSelect-filled.MuiFilledInput-input': {
|
|
119
|
+
paddingTop: 'var(--spacing12)',
|
|
120
|
+
padding: 'var(--spacing12) var(--spacing12) var(--spacing12) 0!important'
|
|
121
|
+
},
|
|
122
|
+
'& .MuiSelect-select.MuiSelect-standard': {
|
|
123
|
+
paddingBottom: 'var(--spacing12)',
|
|
124
|
+
padding: 'var(--spacing12) var(--spacing12) var(--spacing12) 0!important',
|
|
125
|
+
paddingRight: 'var(--spacing8)!important'
|
|
126
|
+
},
|
|
127
|
+
'&.MuiInputBase-root': {
|
|
128
|
+
marginTop: '0'
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
var SelectInputOld = function SelectInputOld(_ref) {
|
|
134
|
+
var id = _ref.id,
|
|
135
|
+
className = _ref.className,
|
|
136
|
+
onChange = _ref.onChange,
|
|
137
|
+
label = _ref.label,
|
|
138
|
+
disabled = _ref.disabled,
|
|
139
|
+
width = _ref.width,
|
|
140
|
+
fullWidth = _ref.fullWidth,
|
|
141
|
+
children = _ref.children,
|
|
142
|
+
error = _ref.error,
|
|
143
|
+
helperText = _ref.helperText,
|
|
144
|
+
helper = _ref.helper,
|
|
145
|
+
variant = _ref.variant,
|
|
146
|
+
endAdornment = _ref.endAdornment,
|
|
147
|
+
success = _ref.success,
|
|
148
|
+
sx = _ref.sx,
|
|
149
|
+
sxFormControl = _ref.sxFormControl,
|
|
150
|
+
propsFormControl = _ref.propsFormControl,
|
|
151
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
152
|
+
|
|
153
|
+
var getIcon = function getIcon() {
|
|
154
|
+
var icon = /*#__PURE__*/_react.default.createElement("i", {
|
|
155
|
+
className: "cbx-inputText-endAdornment ".concat(endAdornment)
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
if (success) {
|
|
159
|
+
icon = /*#__PURE__*/_react.default.createElement("i", {
|
|
160
|
+
className: "cbx-inputText-endAdornment ri-check-line",
|
|
161
|
+
style: {
|
|
162
|
+
color: 'var(--success)'
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (error) {
|
|
168
|
+
icon = /*#__PURE__*/_react.default.createElement("i", {
|
|
169
|
+
className: 'cbx-inputText-endAdornment ri-information-line',
|
|
170
|
+
style: {
|
|
171
|
+
color: 'var(--error)'
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (helper) {
|
|
177
|
+
icon = /*#__PURE__*/_react.default.createElement("i", {
|
|
178
|
+
className: 'cbx-inputText-endAdornment ri-information-line'
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return icon;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var getVariant = function getVariant() {
|
|
186
|
+
var variantInput = 'outlined';
|
|
187
|
+
|
|
188
|
+
if (variant === 'outlined') {
|
|
189
|
+
variantInput = variant;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (variant === 'filled') {
|
|
193
|
+
variantInput = variant;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (variant === 'standard') {
|
|
197
|
+
variantInput = variant;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return variantInput;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
return /*#__PURE__*/_react.default.createElement(_FormControl.default, _extends({
|
|
204
|
+
fullWidth: fullWidth,
|
|
205
|
+
sx: _objectSpread(_objectSpread({
|
|
206
|
+
minWidth: width || '15rem'
|
|
207
|
+
}, width ? {
|
|
208
|
+
width: width || ''
|
|
209
|
+
} : {}), {}, {
|
|
210
|
+
minHeight: '3rem'
|
|
211
|
+
}, sxFormControl)
|
|
212
|
+
}, propsFormControl), label && /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
|
|
213
|
+
variant: getVariant(),
|
|
214
|
+
disabled: disabled,
|
|
215
|
+
error: error,
|
|
216
|
+
sx: {
|
|
217
|
+
'&.MuiInputLabel-root': {
|
|
218
|
+
color: 'var(--gray5)'
|
|
219
|
+
},
|
|
220
|
+
'&.MuiInputLabel-root.Mui-focused': {
|
|
221
|
+
top: '0',
|
|
222
|
+
color: 'var(--primary)'
|
|
223
|
+
},
|
|
224
|
+
'&.MuiInputLabel-root.Mui-error': {
|
|
225
|
+
color: 'var(--error)'
|
|
226
|
+
},
|
|
227
|
+
'&.MuiInputLabel-root.Mui-disabled': {
|
|
228
|
+
color: 'var(--gray3)'
|
|
229
|
+
},
|
|
230
|
+
'&.MuiInputLabel-filled.MuiInputLabel-shrink': {
|
|
231
|
+
transform: 'translate(0 ,-0.625rem) scale(0.75)!important'
|
|
232
|
+
},
|
|
233
|
+
'&.MuiInputLabel-outlined.MuiFormLabel-root:not(.MuiInputLabel-shrink)': {
|
|
234
|
+
transform: 'translate(0.875rem ,0.75rem) scale(1)!important'
|
|
235
|
+
},
|
|
236
|
+
'&.MuiInputLabel-outlined.MuiFormLabel-root.MuiInputLabel-shrink': {
|
|
237
|
+
transform: 'translate(0.875rem ,-0.625rem) scale(0.75)!important'
|
|
238
|
+
},
|
|
239
|
+
'&.MuiFormLabel-root.MuiInputLabel-root.MuiInputLabel-formControl.MuiInputLabel-animated.MuiInputLabel-filled:not(.MuiInputLabel-shrink)': {
|
|
240
|
+
transform: 'translate(0 ,0.75rem) scale(1)!important'
|
|
241
|
+
},
|
|
242
|
+
'&.MuiFormLabel-root.MuiInputLabel-root.MuiInputLabel-formControl.MuiInputLabel-animated.MuiInputLabel-standard:not(.MuiInputLabel-shrink)': {
|
|
243
|
+
transform: 'translate(0 ,0.75rem) scale(1)!important'
|
|
244
|
+
},
|
|
245
|
+
'&.MuiInputLabel-shrink': {
|
|
246
|
+
transform: 'translate(0 ,-0.625rem) scale(0.75)!important',
|
|
247
|
+
zIndex: '1'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}, label), /*#__PURE__*/_react.default.createElement(CssSelect, _extends({
|
|
251
|
+
id: id,
|
|
252
|
+
className: className,
|
|
253
|
+
sx: _objectSpread(_objectSpread({
|
|
254
|
+
minWidth: width || '15rem'
|
|
255
|
+
}, width ? {
|
|
256
|
+
width: width || ''
|
|
257
|
+
} : {}), {}, {
|
|
258
|
+
maxHeight: '3rem',
|
|
259
|
+
height: '3rem',
|
|
260
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
261
|
+
'& legend': {
|
|
262
|
+
width: label ? 'auto' : '0px'
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}, sx),
|
|
266
|
+
variant: getVariant(),
|
|
267
|
+
label: label,
|
|
268
|
+
fullWidth: fullWidth,
|
|
269
|
+
onChange: onChange,
|
|
270
|
+
disabled: disabled,
|
|
271
|
+
error: error,
|
|
272
|
+
MenuProps: {
|
|
273
|
+
PaperProps: {
|
|
274
|
+
className: fullWidth ? 'cbx-selectInput-fullwidth' : ''
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}, props, {
|
|
278
|
+
InputProps: {
|
|
279
|
+
endAdornment: getIcon()
|
|
280
|
+
}
|
|
281
|
+
}), children), /*#__PURE__*/_react.default.createElement(_material.FormHelperText, {
|
|
282
|
+
sx: {
|
|
283
|
+
marginLeft: '0',
|
|
284
|
+
marginRight: '0px'
|
|
285
|
+
}
|
|
286
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
287
|
+
className: "cbx-selectInput-items-center"
|
|
288
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
289
|
+
variant: "XS",
|
|
290
|
+
color: 'var(--error)'
|
|
291
|
+
}, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
292
|
+
className: "cbx-inputText-items-center"
|
|
293
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
294
|
+
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
295
|
+
variant: "XS"
|
|
296
|
+
}, helper)))));
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
SelectInputOld.displayName = "SelectInputOld";
|
|
300
|
+
SelectInputOld.propTypes = {
|
|
301
|
+
label: _propTypes.default.string,
|
|
302
|
+
width: _propTypes.default.string,
|
|
303
|
+
id: _propTypes.default.string,
|
|
304
|
+
className: _propTypes.default.string,
|
|
305
|
+
onChange: _propTypes.default.func,
|
|
306
|
+
disabled: _propTypes.default.bool,
|
|
307
|
+
children: _propTypes.default.node,
|
|
308
|
+
helperText: _propTypes.default.node,
|
|
309
|
+
error: _propTypes.default.node,
|
|
310
|
+
helper: _propTypes.default.node
|
|
311
|
+
};
|
|
312
|
+
SelectInputOld.defaultProps = {
|
|
313
|
+
label: '',
|
|
314
|
+
width: '',
|
|
315
|
+
id: '',
|
|
316
|
+
className: '',
|
|
317
|
+
onChange: undefined,
|
|
318
|
+
disabled: false,
|
|
319
|
+
children: [],
|
|
320
|
+
helperText: '',
|
|
321
|
+
error: '',
|
|
322
|
+
helper: ''
|
|
323
|
+
};
|
|
324
|
+
var _default = SelectInputOld;
|
|
325
|
+
exports.default = _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.rating {
|
|
1
|
+
.cbx-rating {
|
|
2
2
|
float: left;
|
|
3
3
|
border: none;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.rating:not(:checked)>input {
|
|
6
|
+
.cbx-rating:not(:checked)>input {
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: -9999px;
|
|
9
9
|
clip: rect(0, 0, 0, 0);
|
|
10
10
|
visibility: hidden;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.rating:not(:checked)>label {
|
|
13
|
+
.cbx-rating:not(:checked)>label {
|
|
14
14
|
float: right;
|
|
15
15
|
width: 3.125rem;
|
|
16
16
|
padding: 0 0.319rem;
|
|
@@ -24,67 +24,67 @@
|
|
|
24
24
|
transition: color .2s;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.rating:not(:checked)>label.lowStars {
|
|
27
|
+
.cbx-rating:not(:checked)>label.cbx-lowStars {
|
|
28
28
|
font-size: 200%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.rating:not(:checked)>label:before {
|
|
31
|
+
.cbx-rating:not(:checked)>label:before {
|
|
32
32
|
content: '★ ';
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.rating>input:checked~label {
|
|
35
|
+
.cbx-rating>input:checked~label {
|
|
36
36
|
color: var(--primary);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.rating.secondary>input:checked~label {
|
|
39
|
+
.cbx-rating.secondary>input:checked~label {
|
|
40
40
|
color: var(--secondary);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.rating:not(:checked)>label:hover,
|
|
44
|
-
.rating:not(:checked)>label:hover~label {
|
|
43
|
+
.cbx-rating:not(:checked)>label:hover,
|
|
44
|
+
.cbx-rating:not(:checked)>label:hover~label {
|
|
45
45
|
color: var(--primary);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.rating.secondary:not(:checked)>label:hover,
|
|
49
|
-
.rating.secondary:not(:checked)>label:hover~label {
|
|
48
|
+
.cbx-rating.secondary:not(:checked)>label:hover,
|
|
49
|
+
.cbx-rating.secondary:not(:checked)>label:hover~label {
|
|
50
50
|
color: var(--secondary);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.rating>input:checked+label:hover,
|
|
54
|
-
.rating>input:checked+label:hover~label,
|
|
55
|
-
.rating>input:checked~label:hover,
|
|
56
|
-
.rating>input:checked~label:hover~label,
|
|
57
|
-
.rating>label:hover~input:checked~label {
|
|
53
|
+
.cbx-rating>input:checked+label:hover,
|
|
54
|
+
.cbx-rating>input:checked+label:hover~label,
|
|
55
|
+
.cbx-rating>input:checked~label:hover,
|
|
56
|
+
.cbx-rating>input:checked~label:hover~label,
|
|
57
|
+
.cbx-rating>label:hover~input:checked~label {
|
|
58
58
|
color: var(--primary);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.rating.secondary>input:checked+label:hover,
|
|
62
|
-
.rating.secondary>input:checked+label:hover~label,
|
|
63
|
-
.rating.secondary>input:checked~label:hover,
|
|
64
|
-
.rating.secondary>input:checked~label:hover~label,
|
|
65
|
-
.rating.secondary>label:hover~input:checked~label {
|
|
61
|
+
.cbx-rating.secondary>input:checked+label:hover,
|
|
62
|
+
.cbx-rating.secondary>input:checked+label:hover~label,
|
|
63
|
+
.cbx-rating.secondary>input:checked~label:hover,
|
|
64
|
+
.cbx-rating.secondary>input:checked~label:hover~label,
|
|
65
|
+
.cbx-rating.secondary>label:hover~input:checked~label {
|
|
66
66
|
color: var(--secondary);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.rating>label:active {
|
|
69
|
+
.cbx-rating>label:active {
|
|
70
70
|
position: relative;
|
|
71
71
|
top: 0.125rem;
|
|
72
72
|
left: 0.125rem;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.rating-disabled {
|
|
75
|
+
.cbx-rating-disabled {
|
|
76
76
|
float: left;
|
|
77
77
|
border: none;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.rating-disabled:not(:checked)>input {
|
|
80
|
+
.cbx-rating-disabled:not(:checked)>input {
|
|
81
81
|
visibility: hidden;
|
|
82
82
|
position: absolute;
|
|
83
83
|
top: -9999px;
|
|
84
84
|
clip: rect(0, 0, 0, 0);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.rating-disabled:not(:checked)>label {
|
|
87
|
+
.cbx-rating-disabled:not(:checked)>label {
|
|
88
88
|
float: right;
|
|
89
89
|
width: 3.125rem;
|
|
90
90
|
padding: 0 0.319rem;
|
|
@@ -96,14 +96,14 @@
|
|
|
96
96
|
color: #ddd;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.rating-disabled:not(:checked)>label.lowStars {
|
|
99
|
+
.cbx-rating-disabled:not(:checked)>label.cbx-lowStars {
|
|
100
100
|
font-size: 200%;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.rating-disabled:not(:checked)>label:before {
|
|
103
|
+
.cbx-rating-disabled:not(:checked)>label:before {
|
|
104
104
|
content: '★ ';
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
.rating-disabled>input:checked~label {
|
|
107
|
+
.cbx-rating-disabled>input:checked~label {
|
|
108
108
|
color: var(--primary);
|
|
109
109
|
}
|
|
@@ -13,13 +13,9 @@ require("../../styles/main.css");
|
|
|
13
13
|
|
|
14
14
|
require("./Stars.css");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
16
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
21
17
|
|
|
22
|
-
function
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
19
|
|
|
24
20
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
21
|
|
|
@@ -33,6 +29,12 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
33
29
|
|
|
34
30
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
31
|
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
36
38
|
var Stars = function Stars(_ref) {
|
|
37
39
|
var name = _ref.name,
|
|
38
40
|
lowStars = _ref.lowStars,
|
|
@@ -41,21 +43,29 @@ var Stars = function Stars(_ref) {
|
|
|
41
43
|
error = _ref.error,
|
|
42
44
|
disabled = _ref.disabled,
|
|
43
45
|
lengthtStars = _ref.lengthtStars,
|
|
44
|
-
variant = _ref.variant
|
|
46
|
+
variant = _ref.variant,
|
|
47
|
+
sx = _ref.sx,
|
|
48
|
+
style = _ref.style;
|
|
49
|
+
|
|
50
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
51
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
52
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
53
|
+
|
|
45
54
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
-
style: {
|
|
55
|
+
style: _objectSpread(_objectSpread({
|
|
47
56
|
display: 'inline-block'
|
|
48
|
-
}
|
|
57
|
+
}, style), stylesInLine),
|
|
58
|
+
className: prefixClass('cbx-RatingStarts')
|
|
49
59
|
}, error && /*#__PURE__*/_react.default.createElement("span", {
|
|
50
60
|
style: {
|
|
51
|
-
color: '
|
|
61
|
+
color: 'var(--error)',
|
|
52
62
|
fontWeight: '700',
|
|
53
63
|
marginBottom: '1em'
|
|
54
64
|
}
|
|
55
65
|
}, error), /*#__PURE__*/_react.default.createElement("form", {
|
|
56
66
|
id: "ratingForm".concat(name)
|
|
57
67
|
}, /*#__PURE__*/_react.default.createElement("fieldset", {
|
|
58
|
-
className: disabled ? 'rating-disabled' : "rating ".concat(variant === 'secondary' ? variant : '')
|
|
68
|
+
className: prefixClass(disabled ? 'cbx-rating-disabled' : "cbx-rating ".concat(variant === 'secondary' ? variant : ''))
|
|
59
69
|
}, _toConsumableArray(new Array(lengthtStars)).map(function (item, index) {
|
|
60
70
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
61
71
|
key: "".concat(index, "_").concat(name)
|
|
@@ -76,7 +86,7 @@ var Stars = function Stars(_ref) {
|
|
|
76
86
|
}
|
|
77
87
|
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
78
88
|
htmlFor: "star".concat(5 - index).concat(name),
|
|
79
|
-
className: lowStars ? 'lowStars' : ''
|
|
89
|
+
className: prefixClass(lowStars ? 'cbx-lowStars' : '')
|
|
80
90
|
}, "5 stars"));
|
|
81
91
|
}))));
|
|
82
92
|
};
|