@councilbox/councilbox-ui 2.0.54 → 2.0.55
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/Accordion.js +3 -0
- package/Alert.js +3 -0
- package/Avatar.js +3 -0
- package/AvatarGroup.js +3 -0
- package/Block.js +3 -0
- package/Button.js +3 -0
- package/ButtonBasic.js +3 -0
- package/Checkbox.js +3 -0
- package/DatePicker.js +3 -0
- package/DateRangePicker.js +3 -0
- package/DateTimePicker.js +3 -0
- package/DragDrop.js +3 -0
- package/DrawerPanel.js +3 -0
- package/DropDown.js +3 -0
- package/EnhancedTable.js +3 -0
- package/FabButton.js +3 -0
- package/Grid.js +3 -0
- package/Header.js +3 -0
- package/IconButton.js +3 -0
- package/IconButtonSquare.js +3 -0
- package/IconFont.js +3 -0
- package/InputAutocomplete.js +3 -0
- package/InputPassword.js +3 -0
- package/InputText.js +3 -0
- package/InputTextArea.js +3 -0
- package/LoadingSection.js +3 -0
- package/MenuItem.js +3 -0
- package/MenuLateralLeft.js +3 -0
- package/MenuLateralRight.js +3 -0
- package/Modal.js +3 -0
- package/Radio.js +3 -0
- package/RichTextInput.js +3 -0
- package/Scrollbar.js +3 -0
- package/ScrollbarNew.js +3 -0
- package/SelectInput.js +3 -0
- package/Slider.js +3 -0
- package/Spacing.js +3 -0
- package/Stars.js +3 -0
- package/Stepper.js +3 -0
- package/Table.js +3 -0
- package/TableBody.js +3 -0
- package/TableCell.js +3 -0
- package/TableContainer.js +3 -0
- package/TableHead.js +3 -0
- package/TableRow.js +3 -0
- package/TableSortLabel.js +3 -0
- package/Tabs.js +3 -0
- package/Tag.js +3 -0
- package/TextInput.js +3 -0
- package/ThemeProvider.js +3 -0
- package/TimePicker.js +3 -0
- package/Timeline.js +3 -0
- package/ToastProvider.js +3 -0
- package/Toggle.js +3 -0
- package/Tooltip.js +3 -0
- package/Typography.js +3 -0
- package/dist/HOCs/useDynamicStyles.js +25 -24
- package/dist/build-index.js +70 -0
- package/dist/components/1.Introduction.stories.mdx +4 -1
- package/dist/components/2.Changelog.stories.mdx +15 -3
- package/dist/components/DatePicker/Calendar.js +243 -0
- package/dist/components/DatePicker/DatePicker.css +197 -0
- package/dist/components/DatePicker/DatePicker.js +384 -0
- package/dist/components/DatePicker/DatePicker.stories.js +180 -0
- package/dist/components/DatePicker/dateUtils.js +478 -0
- package/dist/components/DateRangePicker/DateRangePicker.css +41 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +435 -0
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +147 -0
- package/dist/components/DateRangePicker/RangeCalendar.js +188 -0
- package/dist/components/DateTimePicker/DateTimePicker.css +4 -0
- package/dist/components/DateTimePicker/DateTimePicker.js +481 -0
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +144 -0
- package/dist/components/DateTimePicker/TimeColumns.css +46 -0
- package/dist/components/DateTimePicker/TimeColumns.js +175 -0
- package/dist/components/DragDrop/DragDrop.js +4 -1
- package/dist/components/DropDown/DesignDropDown.stories.js +8 -0
- package/dist/components/DropDown/DropDown.js +14 -4
- package/dist/components/Header/Header.js +32 -10
- package/dist/components/IconButton/IconButton.js +3 -2
- package/dist/components/IconButtonSquare/IconButtonSquare.js +3 -3
- package/dist/components/InputAutocomplete/InputAutocomplete.js +2 -2
- package/dist/components/InputText/InputText.css +10 -5
- package/dist/components/InputText/InputText.js +4 -4
- package/dist/components/MenuItem/MenuItem.js +65 -61
- package/dist/components/MenuLateralRight/MenuLateralRight.js +18 -2
- package/dist/components/Modal/Modal.js +3 -1
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +119 -0
- package/dist/components/RichTextInput/RichTextInput.css +309 -0
- package/dist/components/RichTextInput/RichTextInput.js +851 -0
- package/dist/components/RichTextInput/RichTextInput.stories.js +33 -0
- package/dist/components/Ripple/DesignRipple.js +17 -0
- package/dist/components/ScrollbarNew/DesignScrollbarNew.js +24 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.css +79 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.js +426 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.stories.js +37 -0
- package/dist/components/SelectInput/SelectInput.js +85 -78
- package/dist/components/Tabs/DesignTabs.js +1 -1
- package/dist/components/Tabs/Tabs.js +0 -1
- package/dist/components/TimePicker/TimePicker.css +3 -0
- package/dist/components/TimePicker/TimePicker.js +359 -0
- package/dist/components/TimePicker/TimePicker.stories.js +132 -0
- package/dist/components/Toast/DesignToast.stories.js +174 -0
- package/dist/components/Toast/Toast.css +154 -0
- package/dist/components/Toast/Toast.js +165 -0
- package/dist/components/Toast/Toast.stories.js +33 -0
- package/dist/components/Toast/ToastProvider.js +33 -0
- package/dist/components/Toast/ToastRoot.js +89 -0
- package/dist/components/Toast/toastStore.js +127 -0
- package/dist/components/Toast/useToast.js +42 -0
- package/dist/components/Toggle/Toggle.js +20 -14
- package/dist/components/Tooltip/Tooltip.js +7 -2
- package/dist/styles/styleFont.css +1 -1
- package/dist/styles/zIndexConsts.css +2 -0
- package/package.json +63 -3
- package/toast.js +7 -0
- package/useCouncilboxTheme.js +7 -0
- package/useToast.js +7 -0
- package/dist/components/Accordion/AccordionOld.css +0 -16
- package/dist/components/Accordion/AccordionOld.js +0 -91
- package/dist/components/Avatar/AvatarOld.js +0 -124
- package/dist/components/ButtonBasic/ButtonBasicOld.css +0 -41
- package/dist/components/ButtonBasic/ButtonBasicOld.js +0 -211
- package/dist/components/Checkbox/CheckboxOld.css +0 -31
- package/dist/components/Checkbox/CheckboxOld.js +0 -96
- package/dist/components/DrawerPanel/DrawerPanelOld.css +0 -56
- package/dist/components/DrawerPanel/DrawerPanelOld.js +0 -211
- package/dist/components/DropDown/DropDownOld.css +0 -3
- package/dist/components/DropDown/DropDownOld.js +0 -154
- package/dist/components/Grid/GridItemOld.js +0 -38
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +0 -46
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +0 -122
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +0 -43
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +0 -115
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +0 -5
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +0 -159
- package/dist/components/InputText/InputTextOld.css +0 -10
- package/dist/components/InputText/InputTextOld.js +0 -314
- package/dist/components/MenuItem/MenuItemOld.js +0 -123
- package/dist/components/Modal/ModalOld.css +0 -3
- package/dist/components/Modal/ModalOld.js +0 -213
- package/dist/components/RadioButton/RadioOld.css +0 -31
- package/dist/components/RadioButton/RadioOld.js +0 -126
- package/dist/components/SelectInput/SelectInputOld.css +0 -17
- package/dist/components/SelectInput/SelectInputOld.js +0 -296
- package/dist/components/Table/TableOld.css +0 -79
- package/dist/components/Table/TableOld.js +0 -133
- package/dist/components/Tabs/TabsOld.js +0 -78
- package/dist/components/Typography/TypographyOld.js +0 -119
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
require("./TimeColumns.css");
|
|
10
|
+
var _dateUtils = require("../DatePicker/dateUtils");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
/* eslint-disable no-tabs */
|
|
13
|
+
|
|
14
|
+
var range = function range(start, end) {
|
|
15
|
+
var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
16
|
+
var values = [];
|
|
17
|
+
for (var i = start; i <= end; i += step) {
|
|
18
|
+
values.push(i);
|
|
19
|
+
}
|
|
20
|
+
return values;
|
|
21
|
+
};
|
|
22
|
+
var TimeColumn = function TimeColumn(_ref) {
|
|
23
|
+
var items = _ref.items,
|
|
24
|
+
selected = _ref.selected,
|
|
25
|
+
onSelect = _ref.onSelect,
|
|
26
|
+
getLabel = _ref.getLabel,
|
|
27
|
+
disabledItem = _ref.disabledItem,
|
|
28
|
+
prefixClass = _ref.prefixClass;
|
|
29
|
+
var listRef = _react["default"].useRef(null);
|
|
30
|
+
_react["default"].useEffect(function () {
|
|
31
|
+
var _listRef$current;
|
|
32
|
+
var selectedNode = (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.querySelector('[data-selected="true"]');
|
|
33
|
+
selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.scrollIntoView({
|
|
34
|
+
block: 'center'
|
|
35
|
+
});
|
|
36
|
+
// Re-centers whenever the selection changes (typed input, external
|
|
37
|
+
// value update), not just on mount — otherwise a newly selected item
|
|
38
|
+
// scrolled out of view stays hidden until the user scrolls manually.
|
|
39
|
+
}, [selected]);
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
|
+
className: prefixClass('cbx-timeColumns-column'),
|
|
42
|
+
ref: listRef,
|
|
43
|
+
role: "listbox"
|
|
44
|
+
}, items.map(function (item) {
|
|
45
|
+
var isSelected = item === selected;
|
|
46
|
+
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
key: item,
|
|
49
|
+
role: "option",
|
|
50
|
+
"aria-selected": isSelected,
|
|
51
|
+
"data-selected": isSelected,
|
|
52
|
+
disabled: disabledItem === null || disabledItem === void 0 ? void 0 : disabledItem(item),
|
|
53
|
+
className: prefixClass("cbx-timeColumns-item ".concat(isSelected ? 'cbx-timeColumns-item-selected' : '')),
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return onSelect(item);
|
|
56
|
+
}
|
|
57
|
+
}, getLabel ? getLabel(item) : item);
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
TimeColumn.displayName = "TimeColumn";
|
|
61
|
+
var TimeColumns = function TimeColumns(_ref2) {
|
|
62
|
+
var value = _ref2.value,
|
|
63
|
+
onChange = _ref2.onChange,
|
|
64
|
+
_ref2$ampm = _ref2.ampm,
|
|
65
|
+
ampm = _ref2$ampm === void 0 ? true : _ref2$ampm,
|
|
66
|
+
_ref2$minutesStep = _ref2.minutesStep,
|
|
67
|
+
minutesStep = _ref2$minutesStep === void 0 ? 1 : _ref2$minutesStep,
|
|
68
|
+
disabled = _ref2.disabled,
|
|
69
|
+
minTime = _ref2.minTime,
|
|
70
|
+
maxTime = _ref2.maxTime,
|
|
71
|
+
minDateTime = _ref2.minDateTime,
|
|
72
|
+
maxDateTime = _ref2.maxDateTime,
|
|
73
|
+
_ref2$locale = _ref2.locale,
|
|
74
|
+
locale = _ref2$locale === void 0 ? _dateUtils.DEFAULT_LOCALE : _ref2$locale,
|
|
75
|
+
prefixClass = _ref2.prefixClass;
|
|
76
|
+
var amText = _react["default"].useMemo(function () {
|
|
77
|
+
return (0, _dateUtils.getMeridiemText)(locale, 9);
|
|
78
|
+
}, [locale]);
|
|
79
|
+
var pmText = _react["default"].useMemo(function () {
|
|
80
|
+
return (0, _dateUtils.getMeridiemText)(locale, 21);
|
|
81
|
+
}, [locale]);
|
|
82
|
+
var current = (0, _dateUtils.isValidDate)(value) ? value : new Date();
|
|
83
|
+
var hours24 = current.getHours();
|
|
84
|
+
var hours12raw = hours24 % 12;
|
|
85
|
+
var hours12 = hours12raw === 0 ? 12 : hours12raw;
|
|
86
|
+
var isPM = hours24 >= 12;
|
|
87
|
+
var minutes = current.getMinutes();
|
|
88
|
+
var hourItems = ampm ? range(1, 12) : range(0, 23);
|
|
89
|
+
var minuteItems = range(0, 59, minutesStep);
|
|
90
|
+
var buildDisabledCheck = function buildDisabledCheck(getCandidate) {
|
|
91
|
+
return function (hourOrMinute) {
|
|
92
|
+
var candidate = getCandidate(hourOrMinute);
|
|
93
|
+
return disabled || (0, _dateUtils.isTimeDisabled)(candidate, {
|
|
94
|
+
minTime: minTime,
|
|
95
|
+
maxTime: maxTime,
|
|
96
|
+
minDateTime: minDateTime,
|
|
97
|
+
maxDateTime: maxDateTime
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var handleHourSelect = function handleHourSelect(hour) {
|
|
102
|
+
if (disabled) return;
|
|
103
|
+
var newHours24 = ampm ? hour % 12 + (isPM ? 12 : 0) : hour;
|
|
104
|
+
onChange((0, _dateUtils.setTimeFromDate)(current, {
|
|
105
|
+
hours: newHours24
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
var handleMinuteSelect = function handleMinuteSelect(minute) {
|
|
109
|
+
if (disabled) return;
|
|
110
|
+
onChange((0, _dateUtils.setTimeFromDate)(current, {
|
|
111
|
+
minutes: minute
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
var handleMeridiemSelect = function handleMeridiemSelect(meridiem) {
|
|
115
|
+
if (disabled) return;
|
|
116
|
+
var newHours24 = meridiem === 'PM' ? hours24 < 12 ? hours24 + 12 : hours24 : hours24 >= 12 ? hours24 - 12 : hours24;
|
|
117
|
+
onChange((0, _dateUtils.setTimeFromDate)(current, {
|
|
118
|
+
hours: newHours24
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
|
+
className: prefixClass('cbx-timeColumns')
|
|
123
|
+
}, /*#__PURE__*/_react["default"].createElement(TimeColumn, {
|
|
124
|
+
items: hourItems,
|
|
125
|
+
selected: ampm ? hours12 : hours24,
|
|
126
|
+
onSelect: handleHourSelect,
|
|
127
|
+
getLabel: function getLabel(item) {
|
|
128
|
+
return String(item).padStart(2, '0');
|
|
129
|
+
},
|
|
130
|
+
disabledItem: buildDisabledCheck(function (hour) {
|
|
131
|
+
var newHours24 = ampm ? hour % 12 + (isPM ? 12 : 0) : hour;
|
|
132
|
+
return (0, _dateUtils.setTimeFromDate)(current, {
|
|
133
|
+
hours: newHours24
|
|
134
|
+
});
|
|
135
|
+
}),
|
|
136
|
+
prefixClass: prefixClass
|
|
137
|
+
}), /*#__PURE__*/_react["default"].createElement(TimeColumn, {
|
|
138
|
+
items: minuteItems,
|
|
139
|
+
selected: minutes - minutes % minutesStep,
|
|
140
|
+
onSelect: handleMinuteSelect,
|
|
141
|
+
getLabel: function getLabel(item) {
|
|
142
|
+
return String(item).padStart(2, '0');
|
|
143
|
+
},
|
|
144
|
+
disabledItem: buildDisabledCheck(function (minute) {
|
|
145
|
+
return (0, _dateUtils.setTimeFromDate)(current, {
|
|
146
|
+
minutes: minute
|
|
147
|
+
});
|
|
148
|
+
}),
|
|
149
|
+
prefixClass: prefixClass
|
|
150
|
+
}), ampm && /*#__PURE__*/_react["default"].createElement(TimeColumn, {
|
|
151
|
+
items: ['AM', 'PM'],
|
|
152
|
+
selected: isPM ? 'PM' : 'AM',
|
|
153
|
+
onSelect: handleMeridiemSelect,
|
|
154
|
+
getLabel: function getLabel(item) {
|
|
155
|
+
return item === 'PM' ? pmText : amText;
|
|
156
|
+
},
|
|
157
|
+
prefixClass: prefixClass
|
|
158
|
+
}));
|
|
159
|
+
};
|
|
160
|
+
TimeColumns.displayName = "TimeColumns";
|
|
161
|
+
TimeColumns.propTypes = {
|
|
162
|
+
value: _propTypes["default"].instanceOf(Date),
|
|
163
|
+
onChange: _propTypes["default"].func.isRequired,
|
|
164
|
+
ampm: _propTypes["default"].bool,
|
|
165
|
+
minutesStep: _propTypes["default"].number,
|
|
166
|
+
disabled: _propTypes["default"].bool,
|
|
167
|
+
minTime: _propTypes["default"].instanceOf(Date),
|
|
168
|
+
maxTime: _propTypes["default"].instanceOf(Date),
|
|
169
|
+
minDateTime: _propTypes["default"].instanceOf(Date),
|
|
170
|
+
maxDateTime: _propTypes["default"].instanceOf(Date),
|
|
171
|
+
locale: _propTypes["default"].string,
|
|
172
|
+
prefixClass: _propTypes["default"].func.isRequired
|
|
173
|
+
};
|
|
174
|
+
var _default = TimeColumns;
|
|
175
|
+
exports["default"] = _default;
|
|
@@ -68,6 +68,7 @@ var DragDrop = function DragDrop(_ref) {
|
|
|
68
68
|
className: prefixClass('cbx-dragDrop-principal-container')
|
|
69
69
|
}, getRootProps(), {
|
|
70
70
|
style: _objectSpread(_objectSpread({}, style), stylesInLine),
|
|
71
|
+
role: "button",
|
|
71
72
|
tabIndex: 0,
|
|
72
73
|
onKeyDown: handleKeyDown
|
|
73
74
|
}, props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -103,7 +104,9 @@ var DragDrop = function DragDrop(_ref) {
|
|
|
103
104
|
textAlign: 'center'
|
|
104
105
|
}, text), actionButtons && /*#__PURE__*/_react["default"].createElement("div", {
|
|
105
106
|
className: prefixClass('cbx-dragDrop-container-actionbuttons')
|
|
106
|
-
}, actionButtons)), alertProps
|
|
107
|
+
}, actionButtons)), alertProps
|
|
108
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
109
|
+
&& /*#__PURE__*/_react["default"].createElement("div", {
|
|
107
110
|
onClick: function onClick(e) {
|
|
108
111
|
e.stopPropagation();
|
|
109
112
|
e.preventDefault();
|
|
@@ -73,8 +73,16 @@ var DesignAvatar = function DesignAvatar() {
|
|
|
73
73
|
return setOpenModal(true);
|
|
74
74
|
}
|
|
75
75
|
}, "Show confirm")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
|
+
role: "button",
|
|
77
|
+
tabIndex: 0,
|
|
76
78
|
onClick: function onClick() {
|
|
77
79
|
return setOpen(false);
|
|
80
|
+
},
|
|
81
|
+
onKeyDown: function onKeyDown(event) {
|
|
82
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
setOpen(false);
|
|
85
|
+
}
|
|
78
86
|
}
|
|
79
87
|
}, "CloseControl"))
|
|
80
88
|
})), /*#__PURE__*/_react["default"].createElement(_DrawerPanel["default"], {
|
|
@@ -198,13 +198,23 @@ var DropDown = function DropDown(_ref) {
|
|
|
198
198
|
placement: placementTooltip
|
|
199
199
|
}, Component ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
200
200
|
onClick: handleClick,
|
|
201
|
+
onKeyDown: function onKeyDown(event) {
|
|
202
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
handleClick(event);
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
role: "button",
|
|
208
|
+
tabIndex: 0,
|
|
201
209
|
id: dropdownId,
|
|
202
210
|
ref: function ref(node) {
|
|
203
211
|
containerDropdownRef.current = node;
|
|
204
212
|
triggerRef.current = node;
|
|
205
213
|
},
|
|
206
214
|
className: prefixClass('cbx-dropdown-component-container'),
|
|
207
|
-
style: _objectSpread({}, styleComponent)
|
|
215
|
+
style: _objectSpread({}, styleComponent),
|
|
216
|
+
"aria-haspopup": "menu",
|
|
217
|
+
"aria-expanded": isDropdownOpen
|
|
208
218
|
}, typeof Component === 'function' ? /*#__PURE__*/_react["default"].createElement(Component, null) : Component) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
209
219
|
ref: function ref(node) {
|
|
210
220
|
containerDropdownRef.current = node;
|
|
@@ -232,12 +242,12 @@ var DropDown = function DropDown(_ref) {
|
|
|
232
242
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
233
243
|
className: prefixClass("cbx-dropdown-options-container ".concat(isVisible && popoverStyles ? 'cbx-dropdown-options-container-opened' : 'cbx-dropdown-options-container-closed')),
|
|
234
244
|
ref: dropdownRef,
|
|
235
|
-
style: popoverStyles
|
|
236
|
-
onKeyDown: handleMenuKeyDown
|
|
245
|
+
style: popoverStyles
|
|
237
246
|
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
238
247
|
id: "".concat(dropdownId, "-menu"),
|
|
239
248
|
role: "menu",
|
|
240
|
-
className: prefixClass('cbx-dropdown-options')
|
|
249
|
+
className: prefixClass('cbx-dropdown-options'),
|
|
250
|
+
onKeyDown: handleMenuKeyDown
|
|
241
251
|
}, enhancedItems))), document.body));
|
|
242
252
|
};
|
|
243
253
|
DropDown.displayName = "DropDown";
|
|
@@ -88,7 +88,9 @@ var Header = function Header(_ref) {
|
|
|
88
88
|
showTypographyLogoLeft = _ref.showTypographyLogoLeft,
|
|
89
89
|
buttonNotificationIconItems = _ref.buttonNotificationIconItems,
|
|
90
90
|
buttonNotificationIconDropDownProps = _ref.buttonNotificationIconDropDownProps,
|
|
91
|
-
thirdBlockActions = _ref.thirdBlockActions
|
|
91
|
+
thirdBlockActions = _ref.thirdBlockActions,
|
|
92
|
+
altLogoLeft = _ref.altLogoLeft,
|
|
93
|
+
altLogoRight = _ref.altLogoRight;
|
|
92
94
|
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
93
95
|
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
94
96
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
@@ -165,7 +167,7 @@ var Header = function Header(_ref) {
|
|
|
165
167
|
id: 'cbx-header-third-logo-right',
|
|
166
168
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
167
169
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
168
|
-
alt:
|
|
170
|
+
alt: altLogoRight
|
|
169
171
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
170
172
|
className: prefixClass('cbx-header-third-button-user-logo'),
|
|
171
173
|
style: _objectSpread({}, styleIconButtonRightContainer)
|
|
@@ -174,7 +176,7 @@ var Header = function Header(_ref) {
|
|
|
174
176
|
style: _objectSpread({}, styleIconButtonRight)
|
|
175
177
|
})))
|
|
176
178
|
}, iconButtonRightProps))));
|
|
177
|
-
}, [tooltipThirdDropdownUser, placementTooltipThirdDropdownUser, logoRightXS, logoRight, breakpoints, innerWidth, styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps]);
|
|
179
|
+
}, [tooltipThirdDropdownUser, placementTooltipThirdDropdownUser, logoRightXS, logoRight, breakpoints, innerWidth, styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, altLogoRight]);
|
|
178
180
|
var renderlogoAndDropdownSeparated = _react["default"].useMemo(function () {
|
|
179
181
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, iconButtonRight && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
180
182
|
prefixClass: prefixClass,
|
|
@@ -193,9 +195,9 @@ var Header = function Header(_ref) {
|
|
|
193
195
|
id: 'cbx-header-third-logo-right',
|
|
194
196
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
195
197
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
196
|
-
alt:
|
|
198
|
+
alt: altLogoRight
|
|
197
199
|
}));
|
|
198
|
-
}, [styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, logoRight, logoRightXS, innerWidth, breakpoints]);
|
|
200
|
+
}, [styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, logoRight, logoRightXS, innerWidth, breakpoints, altLogoRight]);
|
|
199
201
|
var getCompanyName = _react["default"].useCallback(function () {
|
|
200
202
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
203
|
className: prefixClass('cbx-header-first-container-app-logo-text-empty')
|
|
@@ -262,6 +264,14 @@ var Header = function Header(_ref) {
|
|
|
262
264
|
}, dropdownLeftProps))), logoLeft ? logoLeft !== 'noLogo' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
263
265
|
className: prefixClass("cbx-header-first-container-app-logo".concat(showTypographyLogoLeft ? '-empty' : '')),
|
|
264
266
|
onClick: actionLogoLeft,
|
|
267
|
+
onKeyDown: actionLogoLeft ? function (event) {
|
|
268
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
269
|
+
event.preventDefault();
|
|
270
|
+
actionLogoLeft(event);
|
|
271
|
+
}
|
|
272
|
+
} : undefined,
|
|
273
|
+
role: actionLogoLeft ? 'button' : undefined,
|
|
274
|
+
tabIndex: actionLogoLeft ? 0 : undefined,
|
|
265
275
|
style: {
|
|
266
276
|
cursor: actionLogoLeft ? 'pointer' : 'auto'
|
|
267
277
|
}
|
|
@@ -269,16 +279,24 @@ var Header = function Header(_ref) {
|
|
|
269
279
|
id: 'cbx-header-first-app-logo',
|
|
270
280
|
src: innerWidth < breakpoints.md ? logoLeftXS || logoLeft : logoLeft,
|
|
271
281
|
className: prefixClass('App-logo-header-ui'),
|
|
272
|
-
alt:
|
|
282
|
+
alt: altLogoLeft
|
|
273
283
|
}), showTypographyLogoLeft && getCompanyName()) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
274
284
|
className: prefixClass('cbx-header-first-container-app-logo-empty'),
|
|
275
285
|
onClick: actionLogoLeft,
|
|
286
|
+
onKeyDown: actionLogoLeft ? function (event) {
|
|
287
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
actionLogoLeft(event);
|
|
290
|
+
}
|
|
291
|
+
} : undefined,
|
|
292
|
+
role: actionLogoLeft ? 'button' : undefined,
|
|
293
|
+
tabIndex: actionLogoLeft ? 0 : undefined,
|
|
276
294
|
style: {
|
|
277
295
|
cursor: actionLogoLeft ? 'pointer' : 'auto'
|
|
278
296
|
}
|
|
279
297
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
280
298
|
style: _objectSpread({}, colorNoLogo),
|
|
281
|
-
alt:
|
|
299
|
+
alt: altLogoLeft,
|
|
282
300
|
id: 'cbx-header-first-app-logo',
|
|
283
301
|
className: prefixClass('cbx-header-first-app-logo-empty')
|
|
284
302
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
@@ -423,7 +441,7 @@ var Header = function Header(_ref) {
|
|
|
423
441
|
id: 'cbx-header-third-logo-right',
|
|
424
442
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
425
443
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
426
|
-
alt:
|
|
444
|
+
alt: altLogoRight
|
|
427
445
|
})), !!iconButtonRight && !itemsDropDownUser && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
428
446
|
prefixClass: prefixClass,
|
|
429
447
|
"aria-label": "Button user",
|
|
@@ -565,7 +583,9 @@ Header.propTypes = {
|
|
|
565
583
|
buttonNotificationBadge: _propTypes["default"].bool,
|
|
566
584
|
tooltipThirdDropdownUser: _propTypes["default"].string,
|
|
567
585
|
placementTooltipThirdDropdownUser: _propTypes["default"].string,
|
|
568
|
-
showTypographyLogoLeft: _propTypes["default"].bool
|
|
586
|
+
showTypographyLogoLeft: _propTypes["default"].bool,
|
|
587
|
+
altLogoLeft: _propTypes["default"].string,
|
|
588
|
+
altLogoRight: _propTypes["default"].string
|
|
569
589
|
};
|
|
570
590
|
Header.defaultProps = {
|
|
571
591
|
back: '',
|
|
@@ -601,7 +621,9 @@ Header.defaultProps = {
|
|
|
601
621
|
buttonNotificationBadge: false,
|
|
602
622
|
tooltipThirdDropdownUser: '',
|
|
603
623
|
placementTooltipThirdDropdownUser: 'bottom',
|
|
604
|
-
showTypographyLogoLeft: false
|
|
624
|
+
showTypographyLogoLeft: false,
|
|
625
|
+
altLogoLeft: 'Main logo',
|
|
626
|
+
altLogoRight: 'Secondary logo'
|
|
605
627
|
};
|
|
606
628
|
var _default = Header;
|
|
607
629
|
exports["default"] = _default;
|
|
@@ -30,7 +30,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
30
30
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
31
31
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
32
32
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
33
|
-
var IconButton = function
|
|
33
|
+
var IconButton = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
34
34
|
var id = _ref.id,
|
|
35
35
|
className = _ref.className,
|
|
36
36
|
onClick = _ref.onClick,
|
|
@@ -220,6 +220,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
220
220
|
};
|
|
221
221
|
var getButton = function getButton() {
|
|
222
222
|
return /*#__PURE__*/_react["default"].createElement("button", _extends({
|
|
223
|
+
ref: ref,
|
|
223
224
|
id: id,
|
|
224
225
|
disabled: disabled,
|
|
225
226
|
className: prefixClass("cbx-IconButton ".concat(className || '', " ").concat(type === 'fab' ? 'cbx-IconButton-fabButton' : '', " ").concat(type === 'square' ? 'cbx-IconButton-squareButton' : '', " ").concat(type === 'rounded' || rounded ? 'cbx-IconButton-rounded' : '', " ").concat(disabled ? 'cbx-IconButton-disabled' : '', " ").concat(active ? 'cbx-IconButton-active' : '', " ").concat(hoverColor ? 'cbx-IconButton-hoverColor' : '')),
|
|
@@ -252,7 +253,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
252
253
|
}, getButton());
|
|
253
254
|
};
|
|
254
255
|
return tooltip ? getTooltip() : getButton();
|
|
255
|
-
};
|
|
256
|
+
});
|
|
256
257
|
IconButton.propTypes = {
|
|
257
258
|
id: _propTypes["default"].string,
|
|
258
259
|
className: _propTypes["default"].string,
|
|
@@ -14,7 +14,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
14
14
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
15
15
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
17
|
-
var IconButtonSquare = function
|
|
17
|
+
var IconButtonSquare = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
18
18
|
var sx = _ref.sx,
|
|
19
19
|
propPrefixClass = _ref.prefixClass,
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -22,11 +22,11 @@ var IconButtonSquare = function IconButtonSquare(_ref) {
|
|
|
22
22
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
23
23
|
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
24
24
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
25
|
+
ref: ref,
|
|
25
26
|
prefixClass: prefixClass,
|
|
26
27
|
type: 'square'
|
|
27
28
|
}, props));
|
|
28
|
-
};
|
|
29
|
-
IconButtonSquare.displayName = "IconButtonSquare";
|
|
29
|
+
});
|
|
30
30
|
IconButtonSquare.propTypes = {};
|
|
31
31
|
IconButtonSquare.defaultProps = {};
|
|
32
32
|
var _default = IconButtonSquare;
|
|
@@ -386,13 +386,13 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
386
386
|
}), shouldShowDropdown && /*#__PURE__*/_react["default"].createElement("div", {
|
|
387
387
|
className: prefixClass("cbx-inputAutocomplete-options-container ".concat(uiState.showDropdown && !isClosing ? 'cbx-inputAutocomplete-options-container-open' : 'cbx-inputAutocomplete-options-container-close')),
|
|
388
388
|
style: _objectSpread({}, positions),
|
|
389
|
-
onKeyDown: handleListKeyDown,
|
|
390
389
|
ref: dropdownRef
|
|
391
390
|
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
392
391
|
className: prefixClass('cbx-inputAutocomplete-options'),
|
|
393
392
|
ref: optionContainerRef,
|
|
394
393
|
id: listboxId,
|
|
395
|
-
role: "listbox"
|
|
394
|
+
role: "listbox",
|
|
395
|
+
onKeyDown: handleListKeyDown
|
|
396
396
|
}, !loading && (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(function (item, index) {
|
|
397
397
|
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], _extends({}, item, {
|
|
398
398
|
value: item.value || getOptionLabel(item),
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
|
|
154
154
|
.cbx-inputText-fieldset {
|
|
155
155
|
font-size: 1rem;
|
|
156
|
-
transition: border 0.2s;
|
|
156
|
+
transition: border-color 0.2s;
|
|
157
157
|
color: var(--gray5);
|
|
158
158
|
padding-right: var(--spacing8);
|
|
159
159
|
text-align: left;
|
|
@@ -193,12 +193,11 @@
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
.cbx-inputText-fieldset-outlined.hover {
|
|
196
|
-
border:
|
|
196
|
+
border-color: black;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.cbx-inputText-fieldset-outlined.focused {
|
|
200
200
|
border-radius: inherit;
|
|
201
|
-
border-style: solid;
|
|
202
201
|
border: 2px solid var(--primary);
|
|
203
202
|
border-radius: 4px;
|
|
204
203
|
height: 53px;
|
|
@@ -207,7 +206,7 @@
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
.cbx-inputText-fieldset-outlined.focusedNo.value {
|
|
210
|
-
border:
|
|
209
|
+
border-color: #bbbbbb;
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
.cbx-inputText-fieldset.focused legend,
|
|
@@ -304,7 +303,9 @@
|
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
.cbx-input:focus~.cbx-inputText-bar:before,
|
|
307
|
-
.cbx-input:focus~.cbx-inputText-bar:after
|
|
306
|
+
.cbx-input:focus~.cbx-inputText-bar:after,
|
|
307
|
+
.cbx-inputText-bar.focused:before,
|
|
308
|
+
.cbx-inputText-bar.focused:after {
|
|
308
309
|
width: 50%;
|
|
309
310
|
}
|
|
310
311
|
|
|
@@ -437,6 +438,10 @@ textarea.cbx-inputText.cbx-inputText-standard~.cbx-inputText-fieldset-standard {
|
|
|
437
438
|
transform: translate(40px, -9px) scale(0.75);
|
|
438
439
|
}
|
|
439
440
|
|
|
441
|
+
.cbx-inputText-icon-startAdornment .cbx-inputText-fieldset legend {
|
|
442
|
+
margin-left: 1.625rem;
|
|
443
|
+
}
|
|
444
|
+
|
|
440
445
|
.cbx-inputText-autocomplete-button-open {
|
|
441
446
|
position: absolute;
|
|
442
447
|
right: 0.313rem;
|
|
@@ -99,7 +99,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
99
99
|
widthLabel = _React$useState8[0],
|
|
100
100
|
setWidthLabel = _React$useState8[1];
|
|
101
101
|
var textareaRef = _react["default"].useRef(null);
|
|
102
|
-
var inputShrink = !!(shrink || value || defaultValue || props !== null && props !== void 0 && props.InputLabelProps && props !== null && props !== void 0 && (_props$InputLabelProp = props.InputLabelProps) !== null && _props$InputLabelProp !== void 0 && _props$InputLabelProp.shrink);
|
|
102
|
+
var inputShrink = !!(shrink || value !== '' || defaultValue !== undefined || props !== null && props !== void 0 && props.InputLabelProps && props !== null && props !== void 0 && (_props$InputLabelProp = props.InputLabelProps) !== null && _props$InputLabelProp !== void 0 && _props$InputLabelProp.shrink);
|
|
103
103
|
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
104
104
|
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
105
105
|
var accessibleLabel = label || ariaLabel || placeholder;
|
|
@@ -339,7 +339,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
339
339
|
onBlur: handleInputBlur,
|
|
340
340
|
onMouseEnter: handleMouseEnter,
|
|
341
341
|
onMouseLeave: handleMouseLeave,
|
|
342
|
-
value: value
|
|
342
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
343
343
|
onChange: handleInputChange,
|
|
344
344
|
disabled: disabled,
|
|
345
345
|
type: type,
|
|
@@ -360,7 +360,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
360
360
|
onMouseEnter: handleMouseEnter,
|
|
361
361
|
onKeyDown: handleKeyDown,
|
|
362
362
|
onMouseLeave: handleMouseLeave,
|
|
363
|
-
value: value
|
|
363
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
364
364
|
onChange: handleInputChange,
|
|
365
365
|
disabled: disabled,
|
|
366
366
|
type: type,
|
|
@@ -372,7 +372,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
372
372
|
"aria-invalid": !!error,
|
|
373
373
|
"aria-describedby": describedBy
|
|
374
374
|
}, accessibleLabelProps, props)), (getVariant() === 'filled' || getVariant() === 'standard') && /*#__PURE__*/_react["default"].createElement("span", {
|
|
375
|
-
className: prefixClass(
|
|
375
|
+
className: prefixClass("cbx-inputText-bar ".concat(isInputFocused ? 'focused' : ''))
|
|
376
376
|
}), !renderValue && getLabel(), type === 'autocomplete' && (options === null || options === void 0 ? void 0 : options.length) > 0 && /*#__PURE__*/_react["default"].createElement("button", {
|
|
377
377
|
type: "button",
|
|
378
378
|
className: prefixClass('cbx-inputText-autocomplete-button-open'),
|