@mailstep/design-system 0.7.25-beta.9 → 0.7.26
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/package.json +1 -1
- package/ui/Blocks/Scheduler/Scheduler.js +2 -3
- package/ui/Blocks/Scheduler/components/Groups/styles.js +2 -2
- package/ui/Blocks/Scheduler/components/TimeSlots/styles.js +2 -2
- package/ui/Blocks/Scheduler/index.d.ts +1 -1
- package/ui/Blocks/Scheduler/styles.d.ts +1 -0
- package/ui/Blocks/Scheduler/styles.js +3 -2
- package/ui/Blocks/SideMenu/MenuItem.js +1 -1
- package/ui/Forms/Input/stories/Input.stories.d.ts +1 -0
- package/ui/Forms/Input/stories/Input.stories.js +6 -0
- package/ui/Forms/Input/styles.js +2 -2
- package/ui/index.es.js +732 -726
- package/ui/index.umd.js +93 -87
package/package.json
CHANGED
|
@@ -8,8 +8,7 @@ import { TimeSlots } from './components/TimeSlots';
|
|
|
8
8
|
import { useChangeDate } from './hooks/useChangeDate';
|
|
9
9
|
import { generateTimeArray } from './utils/generateTimeArray';
|
|
10
10
|
import { getClosestStep } from './utils/getClosestStep';
|
|
11
|
-
import {
|
|
12
|
-
import { Container } from './styles';
|
|
11
|
+
import { Block, Container } from './styles';
|
|
13
12
|
var timeArray = generateTimeArray();
|
|
14
13
|
export var Scheduler = function (_a) {
|
|
15
14
|
var groups = _a.groups, activeHours = _a.activeHours, data = _a.data, handleSelectTimeSlot = _a.handleSelectTimeSlot, handleReloadTimeSlots = _a.handleReloadTimeSlots, handleTimeSlotClick = _a.handleTimeSlotClick, isLoading = _a.isLoading, timeSlotDefinitions = _a.timeSlotDefinitions;
|
|
@@ -24,5 +23,5 @@ export var Scheduler = function (_a) {
|
|
|
24
23
|
}), handlePrevDay = _c.handlePrevDay, handleNextDay = _c.handleNextDay, handleChangeDate = _c.handleChangeDate, date = _c.date, isTodayDate = _c.isTodayDate;
|
|
25
24
|
if (!(groups === null || groups === void 0 ? void 0 : groups.length))
|
|
26
25
|
return null;
|
|
27
|
-
return (_jsxs(
|
|
26
|
+
return (_jsxs(Container, { children: [_jsx(DateChanger, { isLoading: isLoading, isDatepickerOpen: isDatepickerOpen, toggleDatepicker: toggleDatepicker, closeDatePicker: closeDatePicker, handlePrevDay: handlePrevDay, handleNextDay: handleNextDay, handleChangeDate: handleChangeDate, date: date }), _jsxs(Block, { children: [_jsx(Groups, { groups: groups }), _jsx(TimeSlots, { timeArray: timeArray, groups: groups, activeHours: activeHours, timeSlots: groupedTimeSlots, handleSelectTimeSlot: !isLoading ? handleSelectTimeSlot : undefined, handleTimeSlotClick: !isLoading ? handleTimeSlotClick : undefined, isTodayDate: isTodayDate, date: date, timeSlotDefinitions: timeSlotDefinitions })] })] }));
|
|
28
27
|
};
|
|
@@ -4,8 +4,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { groupsHeight, timeIntervalWidth } from '../../utils/constants';
|
|
6
6
|
import styled, { th } from '@xstyled/styled-components';
|
|
7
|
-
export var GroupContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", "px;\n display: flex;\n border-bottom: 1px solid ", ";\n width: 100%;\n"], ["\n height: ", "px;\n display: flex;\n border-bottom: 1px solid ", ";\n width: 100%;\n"])), groupsHeight, th.color('lightGray6'));
|
|
8
|
-
export var GroupItem = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n
|
|
7
|
+
export var GroupContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", "px;\n display: flex;\n border-bottom: 1px solid ", ";\n width: 100%;\n flex: 0 0 auto;\n"], ["\n height: ", "px;\n display: flex;\n border-bottom: 1px solid ", ";\n width: 100%;\n flex: 0 0 auto;\n"])), groupsHeight, th.color('lightGray6'));
|
|
8
|
+
export var GroupItem = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n min-width: 350px;\n height: 100%;\n font-size: 14px;\n font-weight: 600;\n padding: 10px;\n border-right: 1px solid ", ";\n\n &:last-child {\n border-right: none;\n }\n"], ["\n background-color: ", ";\n width: ", ";\n min-width: 350px;\n height: 100%;\n font-size: 14px;\n font-weight: 600;\n padding: 10px;\n border-right: 1px solid ", ";\n\n &:last-child {\n border-right: none;\n }\n"])), function (_a) {
|
|
9
9
|
var bg = _a.bg;
|
|
10
10
|
return bg || th.color('bgLightGray');
|
|
11
11
|
}, function (_a) {
|
|
@@ -4,8 +4,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { minuteHeight, stepInMinutes, timeIntervalWidth } from '../../utils/constants';
|
|
6
6
|
import styled, { th } from '@xstyled/styled-components';
|
|
7
|
-
export var TimeSlotsContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n scroll-behavior: smooth;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n position: relative;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n scroll-behavior: smooth;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
8
|
-
export var EmptyTimeSlot = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: ", "px;\n width: ", ";\n
|
|
7
|
+
export var TimeSlotsContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex: 1 1 auto;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n scroll-behavior: smooth;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n position: relative;\n flex: 1 1 auto;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n -ms-overflow-style: none;\n scrollbar-width: none;\n scroll-behavior: smooth;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
8
|
+
export var EmptyTimeSlot = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: ", "px;\n width: ", ";\n min-width: 350px;\n position: relative;\n background-color: ", ";\n cursor: ", ";\n border-right: 1px solid ", ";\n\n &:last-child {\n border-right: none;\n }\n\n &:hover {\n background-color: ", ";\n }\n"], ["\n height: ", "px;\n width: ", ";\n min-width: 350px;\n position: relative;\n background-color: ", ";\n cursor: ", ";\n border-right: 1px solid ", ";\n\n &:last-child {\n border-right: none;\n }\n\n &:hover {\n background-color: ", ";\n }\n"])), minuteHeight * stepInMinutes, function (_a) {
|
|
9
9
|
var groupsCount = _a.groupsCount;
|
|
10
10
|
return "calc((100% / ".concat(groupsCount, ") - (").concat(timeIntervalWidth, "px / ").concat(groupsCount, "))");
|
|
11
11
|
}, function (_a) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Scheduler as default } from './Scheduler';
|
|
2
|
-
export type { GroupType, ActiveHours, TimeSlotType, SelectedTimeSlotType
|
|
2
|
+
export type { GroupType, ActiveHours, TimeSlotType, SelectedTimeSlotType } from './types';
|
|
@@ -3,5 +3,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { th } from '@xstyled/styled-components';
|
|
6
|
-
export var
|
|
7
|
-
var
|
|
6
|
+
export var Block = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: white;\n color: ", ";\n overflow-x: auto;\n overflow-y: hidden;\n text-align: center;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n border: 1px solid ", ";\n user-select: none;\n width: 100%;\n}\n"], ["\n background-color: white;\n color: ", ";\n overflow-x: auto;\n overflow-y: hidden;\n text-align: center;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n border: 1px solid ", ";\n user-select: none;\n width: 100%;\n}\n"])), th.color('typoPrimary'), th.color('lightGray6'));
|
|
7
|
+
export var Container = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n overflow-y: hidden;\n"], ["\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n overflow-y: hidden;\n"])));
|
|
8
|
+
var templateObject_1, templateObject_2;
|
|
@@ -49,6 +49,6 @@ var MenuItem = function (_a) {
|
|
|
49
49
|
}, [items, link]);
|
|
50
50
|
return (_jsxs(_Fragment, { children: [separator && _jsx(ItemsSeparator, {}), _jsxs(MenuItemContainer, { ref: parentRef, "$isCompact": isCompact, "$lightMode": lightMode, hasChildren: hasChildren, isHovering: isHovering, children: [_jsxs(ItemLinkWrap, __assign({}, linkProps, { onMouseOver: handleMouseOver, exact: true, activeClassName: hasChildren ? 'selected' : undefined, onClick: toggleChildren, "$isCompact": isCompact, className: itemLinkWrapClassName,
|
|
51
51
|
// @ts-ignore
|
|
52
|
-
isActive: isActive, "$lightMode": lightMode, children: [_jsxs(ItemLabel, { "$isCompact": isCompact, isSubitem: isSubitem, children: [!isSubitem && icon && (_jsx(ItemIcon, { className: "mainIcon", "$isCompact": isCompact, children: typeof icon === 'string' ? _jsx(Icon, { icon: icon, fill: "none" }) : icon })), _jsx(Title, { variant: "semiBold", mt: 0, mb: 0, children: _jsx(OverflowWithEllipsis, { children: title }) })] }), !isCompact && hasChildren && _jsx(ItemDropdownArrow, { icon: "goDown", "$lightMode": lightMode })] })), isHovering && isCompact && hasChildren && !listExpandedItems && (_jsx(SubitemTooltip, { items: items, childRef: childRef, parentRef: parentRef, isLeftMenuOpen: isLeftMenuOpen, onCloseLeftMenu: onCloseLeftMenu, lightMode: lightMode }))] }), hasChildren && listExpandedItems && (_jsx(SubItemsWrap, { children: items === null || items === void 0 ? void 0 : items.map(function (item, index) { return (_jsx(MenuItem, __assign({ isCompact: isCompact, lightMode: lightMode }, item, { onCloseLeftMenu: onCloseLeftMenu, isSubitem: true }), "".concat(index))); }) }))] }));
|
|
52
|
+
isActive: isActive, "$lightMode": lightMode, children: [_jsxs(ItemLabel, { "$isCompact": isCompact, isSubitem: isSubitem, children: [!isSubitem && icon && (_jsx(ItemIcon, { className: "mainIcon", "$isCompact": isCompact, children: typeof icon === 'string' ? _jsx(Icon, { icon: icon, fill: "none" }) : icon })), _jsx(Title, { variant: "semiBold", mt: 0, mb: 0, textAlign: "left", children: _jsx(OverflowWithEllipsis, { children: title }) })] }), !isCompact && hasChildren && _jsx(ItemDropdownArrow, { icon: "goDown", "$lightMode": lightMode })] })), isHovering && isCompact && hasChildren && !listExpandedItems && (_jsx(SubitemTooltip, { items: items, childRef: childRef, parentRef: parentRef, isLeftMenuOpen: isLeftMenuOpen, onCloseLeftMenu: onCloseLeftMenu, lightMode: lightMode }))] }), hasChildren && listExpandedItems && (_jsx(SubItemsWrap, { children: items === null || items === void 0 ? void 0 : items.map(function (item, index) { return (_jsx(MenuItem, __assign({ isCompact: isCompact, lightMode: lightMode }, item, { onCloseLeftMenu: onCloseLeftMenu, isSubitem: true }), "".concat(index))); }) }))] }));
|
|
53
53
|
};
|
|
54
54
|
export default memo(MenuItem);
|
package/ui/Forms/Input/styles.js
CHANGED
|
@@ -29,10 +29,10 @@ export var IconsController = styled.div(templateObject_3 || (templateObject_3 =
|
|
|
29
29
|
export var IconWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n svg {\n :hover {\n cursor: pointer;\n color: blue2;\n }\n }\n"], ["\n display: flex;\n svg {\n :hover {\n cursor: pointer;\n color: blue2;\n }\n }\n"])));
|
|
30
30
|
export var StyledInput = styled.input.attrs(function (props) { return ({
|
|
31
31
|
as: props.$asTextArea ? 'textarea' : 'input'
|
|
32
|
-
}); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n border: slim;\n border-color: ", ";\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width:
|
|
32
|
+
}); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n border: slim;\n border-color: ", ";\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: bgLightGray1;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"], ["\n ", ";\n border: slim;\n border-color: ", ";\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: bgLightGray1;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"])), system, function (_a) {
|
|
33
33
|
var $isInvalid = _a.$isInvalid;
|
|
34
34
|
return ($isInvalid ? th.color('red1') : th.color('lightGray6'));
|
|
35
|
-
}, function (props) { return resolvePaddingRight(props); }, th('fonts.primary'), InputIcon, InputIcon, function (_a) {
|
|
35
|
+
}, function (props) { return resolvePaddingRight(props); }, function (props) { return props.type !== 'checkbox' ? '100%' : 'auto'; }, th('fonts.primary'), InputIcon, InputIcon, function (_a) {
|
|
36
36
|
var big = _a.big;
|
|
37
37
|
return big
|
|
38
38
|
? css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "], ["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "]))) : '';
|