colibri-ui 0.8.42 → 0.8.44
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/Avatar/Avatar.module.css +45 -41
- package/Avatar/index.js +5 -5
- package/Button/Button.module.css +1 -1
- package/Button/index.js +1 -1
- package/Calendar/components/Month/Month.d.ts +3 -2
- package/Calendar/components/Month/Month.js +120 -63
- package/Calendar/components/Month/index.module.css +6 -6
- package/Calendar/index.js +126 -76
- package/Calendar/index.module.css +1 -1
- package/Calendar/utils/getPresets.js +1 -0
- package/Checkbox/Checkbox.module.css +3 -3
- package/Counter/Counter.module.css +1 -1
- package/Datepicker/components/DatePicker/index.module.css +18 -18
- package/Grid/Grid.module.css +1 -1
- package/Modal/Modal.module.css +4 -4
- package/Switch/Switch.module.css +6 -6
- package/TabsMenu/Tab/Tab.props.d.ts +1 -1
- package/esm/Avatar/Avatar.module.css +45 -41
- package/esm/Avatar/index.js +5 -5
- package/esm/Button/Button.module.css +1 -1
- package/esm/Button/index.js +1 -1
- package/esm/Calendar/components/Month/Month.d.ts +3 -2
- package/esm/Calendar/components/Month/Month.js +114 -58
- package/esm/Calendar/components/Month/index.module.css +6 -6
- package/esm/Calendar/index.js +126 -76
- package/esm/Calendar/index.module.css +1 -1
- package/esm/Calendar/utils/getPresets.js +1 -0
- package/esm/Checkbox/Checkbox.module.css +3 -3
- package/esm/Counter/Counter.module.css +1 -1
- package/esm/Datepicker/components/DatePicker/index.module.css +18 -18
- package/esm/Grid/Grid.module.css +1 -1
- package/esm/Modal/Modal.module.css +4 -4
- package/esm/Switch/Switch.module.css +6 -6
- package/esm/TabsMenu/Tab/Tab.props.d.ts +1 -1
- package/esm/helpers/date/index.js +1 -1
- package/esm/hooks/useTrapFocus/index.d.ts +1 -1
- package/hooks/useTrapFocus/index.d.ts +1 -1
- package/package.json +11 -10
package/Avatar/Avatar.module.css
CHANGED
|
@@ -1,118 +1,122 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
1
|
.avatar {
|
|
2
|
+
border-radius: 100%;
|
|
3
|
+
box-sizing: border-box;
|
|
3
4
|
display: block;
|
|
4
|
-
width: 100%; /* Теперь адаптивно */
|
|
5
5
|
height: 100%;
|
|
6
|
+
object-fit: cover;
|
|
6
7
|
position: relative;
|
|
7
|
-
border-radius: 100%;
|
|
8
|
-
box-sizing: border-box;
|
|
9
8
|
transition: border-color 0.15s ease;
|
|
10
|
-
|
|
9
|
+
width: 100%;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
.
|
|
12
|
+
.avatar-bordered {
|
|
14
13
|
background-color: var(--palette-white);
|
|
15
14
|
border: 3px solid var(--palette-bg-2);
|
|
16
15
|
padding: 3px;
|
|
17
16
|
}
|
|
18
|
-
.
|
|
17
|
+
.avatar-bordered:hover {
|
|
19
18
|
border-color: var(--palette-bg-4);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
.
|
|
21
|
+
.size-s,
|
|
22
|
+
.size-m,
|
|
23
|
+
.size-l,
|
|
24
|
+
.size-xl,
|
|
25
|
+
.size-xxl,
|
|
26
|
+
.size-xxxl {
|
|
23
27
|
aspect-ratio: 1/1;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
.
|
|
27
|
-
width: 32px;
|
|
30
|
+
.size-s {
|
|
28
31
|
height: 32px;
|
|
32
|
+
width: 32px;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
.
|
|
32
|
-
width: 48px;
|
|
35
|
+
.size-m {
|
|
33
36
|
height: 48px;
|
|
37
|
+
width: 48px;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
.
|
|
37
|
-
width: 80px;
|
|
40
|
+
.size-l {
|
|
38
41
|
height: 80px;
|
|
42
|
+
width: 80px;
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
.
|
|
42
|
-
width: 120px;
|
|
45
|
+
.size-xl {
|
|
43
46
|
height: 120px;
|
|
47
|
+
width: 120px;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
.
|
|
47
|
-
width: 196px;
|
|
50
|
+
.size-xxl {
|
|
48
51
|
height: 196px;
|
|
52
|
+
width: 196px;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
.
|
|
52
|
-
width: 280px;
|
|
55
|
+
.size-xxxl {
|
|
53
56
|
height: 280px;
|
|
57
|
+
width: 280px;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
.
|
|
60
|
+
.text-s {
|
|
57
61
|
font-size: 1rem;
|
|
58
62
|
font-weight: 500;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
.
|
|
65
|
+
.text-m {
|
|
62
66
|
font-size: 1.5rem;
|
|
63
67
|
font-weight: 500;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
.
|
|
70
|
+
.text-l {
|
|
67
71
|
font-size: 2.5rem;
|
|
68
72
|
font-weight: 400;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
.
|
|
75
|
+
.text-xl {
|
|
72
76
|
font-size: 3.75rem;
|
|
73
77
|
font-weight: 400;
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
.
|
|
80
|
+
.text-xxl {
|
|
77
81
|
font-size: 6rem;
|
|
78
82
|
font-weight: 400;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
.
|
|
85
|
+
.text-xxxl {
|
|
82
86
|
font-size: 9rem;
|
|
83
87
|
font-weight: 400;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
.
|
|
87
|
-
display: inline-flex;
|
|
90
|
+
.avatar-initials {
|
|
88
91
|
align-items: center;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
border-radius: 50%;
|
|
91
92
|
background-color: var(--palette-bg-4);
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
justify-content: center;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
.
|
|
98
|
+
.initials-text {
|
|
95
99
|
color: white;
|
|
96
100
|
text-transform: uppercase;
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
.
|
|
100
|
-
position: relative;
|
|
103
|
+
.avatar-wrapper {
|
|
101
104
|
display: inline-block;
|
|
105
|
+
position: relative;
|
|
102
106
|
}
|
|
103
107
|
|
|
104
|
-
.
|
|
108
|
+
.avatar-loader::before {
|
|
109
|
+
animation: spin 1s linear infinite;
|
|
110
|
+
border: 4px solid transparent;
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
border-top-color: #0087bf;
|
|
113
|
+
box-sizing: border-box;
|
|
105
114
|
content: "";
|
|
115
|
+
height: calc(100% + 6px);
|
|
116
|
+
left: -3px;
|
|
106
117
|
position: absolute;
|
|
107
118
|
top: -3px;
|
|
108
|
-
left: -3px;
|
|
109
119
|
width: calc(100% + 6px);
|
|
110
|
-
height: calc(100% + 6px);
|
|
111
|
-
border-radius: 50%;
|
|
112
|
-
border: 4px solid transparent;
|
|
113
|
-
border-top-color: #0087bf;
|
|
114
|
-
animation: spin 1s linear infinite;
|
|
115
|
-
box-sizing: border-box;
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
@keyframes spin {
|
package/Avatar/index.js
CHANGED
|
@@ -23,8 +23,8 @@ var clx = classNames__default.default.bind(styles__default.default);
|
|
|
23
23
|
var getStubImage = function getStubImage(type) {
|
|
24
24
|
return type === index_props.AccountType.Organization ? orgCircle.default : userCircle.default;
|
|
25
25
|
};
|
|
26
|
-
var SIZE_CLASSES = _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, constants.AvatarSize.S, styles__default.default
|
|
27
|
-
var TEXT_CLASSES = _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, constants.AvatarSize.S, styles__default.default
|
|
26
|
+
var SIZE_CLASSES = _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, constants.AvatarSize.S, styles__default.default['size-s']), constants.AvatarSize.M, styles__default.default['size-m']), constants.AvatarSize.L, styles__default.default['size-l']), constants.AvatarSize.XL, styles__default.default['size-xl']), constants.AvatarSize.XXL, styles__default.default['size-xxl']), constants.AvatarSize.XXXL, styles__default.default['size-xxxl']);
|
|
27
|
+
var TEXT_CLASSES = _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, constants.AvatarSize.S, styles__default.default['text-s']), constants.AvatarSize.M, styles__default.default['text-m']), constants.AvatarSize.L, styles__default.default['text-l']), constants.AvatarSize.XL, styles__default.default['text-xl']), constants.AvatarSize.XXL, styles__default.default['text-xxl']), constants.AvatarSize.XXXL, styles__default.default['text-xxxl']);
|
|
28
28
|
var Avatar = /*#__PURE__*/React.memo(function (props) {
|
|
29
29
|
var src = props.src,
|
|
30
30
|
_props$size = props.size,
|
|
@@ -63,7 +63,7 @@ var Avatar = /*#__PURE__*/React.memo(function (props) {
|
|
|
63
63
|
"data-testid": "avatar",
|
|
64
64
|
alt: alt,
|
|
65
65
|
src: finalSrc,
|
|
66
|
-
className: clx(
|
|
66
|
+
className: clx('avatar', {
|
|
67
67
|
avatarBordered: !!bordered
|
|
68
68
|
}, SIZE_CLASSES[size], className)
|
|
69
69
|
}, rest)))) : (
|
|
@@ -75,12 +75,12 @@ var Avatar = /*#__PURE__*/React.memo(function (props) {
|
|
|
75
75
|
role: "button",
|
|
76
76
|
"aria-label": ariaLabel || "Avatar",
|
|
77
77
|
onClick: onClick,
|
|
78
|
-
className: clx(
|
|
78
|
+
className: clx('avatarInitials', {
|
|
79
79
|
avatarBordered: !!bordered,
|
|
80
80
|
loading: !!loading
|
|
81
81
|
}, SIZE_CLASSES[size], className)
|
|
82
82
|
}, rest), /*#__PURE__*/React__default.default.createElement("span", {
|
|
83
|
-
className: clx(
|
|
83
|
+
className: clx('initialsText', TEXT_CLASSES[size])
|
|
84
84
|
}, (initials === null || initials === void 0 ? void 0 : initials.trim().slice(0, 2)) || "")));
|
|
85
85
|
});
|
|
86
86
|
|
package/Button/Button.module.css
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
border: 1px solid;
|
|
4
4
|
border-radius: 1.125rem;
|
|
5
5
|
box-sizing: border-box;
|
|
6
|
-
transition: color 0.15s linear;
|
|
7
6
|
cursor: pointer;
|
|
8
7
|
display: inline-flex;
|
|
9
8
|
flex-shrink: 0;
|
|
@@ -18,6 +17,7 @@
|
|
|
18
17
|
padding: 0 12px;
|
|
19
18
|
text-overflow: ellipsis;
|
|
20
19
|
transform: scale(1);
|
|
20
|
+
transition: color 0.15s linear;
|
|
21
21
|
transition: transform 0.1s ease-out;
|
|
22
22
|
white-space: nowrap;
|
|
23
23
|
width: fit-content;
|
package/Button/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var Button = function Button(_a) {
|
|
|
35
35
|
return /*#__PURE__*/React__default.default.createElement("button", Object.assign({
|
|
36
36
|
onClick: onClick,
|
|
37
37
|
ref: ref,
|
|
38
|
-
className: clx(
|
|
38
|
+
className: clx("root", _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({
|
|
39
39
|
root_icon: !!icon,
|
|
40
40
|
root_fullWidth: !!fullWidth
|
|
41
41
|
}, "size_".concat(size), !!size), "variant_".concat(variant), !!variant), "variant_".concat(variant, "_disabled"), !!disabled), className),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import type { CalendarTitleSize } from "../../index.props";
|
|
2
3
|
import type { FunctionComponent } from "react";
|
|
3
4
|
export interface FCWithElements<T = {}> extends FunctionComponent<T> {
|
|
@@ -13,5 +14,5 @@ type Props = {
|
|
|
13
14
|
availableDates?: string[];
|
|
14
15
|
titleSize?: CalendarTitleSize;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
export
|
|
17
|
+
declare const _default: React.NamedExoticComponent<Props>;
|
|
18
|
+
export default _default;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
6
|
var React = require('react');
|
|
5
7
|
var classNames = require('classnames/bind');
|
|
6
8
|
var leadingZeros = require('../../../libs/numbers/leadingZeros.js');
|
|
7
|
-
var index = require('../../../Typography/index.js');
|
|
8
|
-
var index
|
|
9
|
+
var index$1 = require('../../../Typography/index.js');
|
|
10
|
+
var index = require('../../../helpers/date/index.js');
|
|
9
11
|
var getMonthWeeks = require('../../utils/getMonthWeeks.js');
|
|
10
12
|
var styles = require('./index.module.css');
|
|
11
13
|
|
|
@@ -29,105 +31,160 @@ function _interopNamespace(e) {
|
|
|
29
31
|
return Object.freeze(n);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
33
35
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
34
36
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
35
37
|
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
36
38
|
|
|
37
39
|
var clx = classNames__default.default.bind(styles__default.default);
|
|
38
|
-
var
|
|
40
|
+
var WEEK_DAYS = Array.from({
|
|
41
|
+
length: 7
|
|
42
|
+
}, function (_, idx) {
|
|
43
|
+
var index$1 = idx + 1;
|
|
44
|
+
return {
|
|
45
|
+
index: index$1,
|
|
46
|
+
name: index.getShortWeekDayNameByIndex(index$1),
|
|
47
|
+
isWeekend: index$1 > 5
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
var SELECTED_BG_STYLE = {
|
|
51
|
+
background: "var(--palette-bg-2)"
|
|
52
|
+
};
|
|
53
|
+
var TRANSPARENT_BG_STYLE = {
|
|
54
|
+
background: "transparent"
|
|
55
|
+
};
|
|
56
|
+
var Item = /*#__PURE__*/React__namespace.memo(function (_ref) {
|
|
39
57
|
var isSelected = _ref.isSelected,
|
|
40
58
|
isInSelectedRange = _ref.isInSelectedRange,
|
|
41
59
|
isStartOfSelection = _ref.isStartOfSelection,
|
|
42
60
|
isEndOfSelection = _ref.isEndOfSelection,
|
|
43
61
|
children = _ref.children;
|
|
44
|
-
var
|
|
45
|
-
var startClass = isStartOfSelection && !isEndOfSelection ? styles__default.default["start-of-selection"] : "";
|
|
46
|
-
var endClass = isEndOfSelection && !isStartOfSelection ? styles__default.default["end-of-selection"] : "";
|
|
47
|
-
var firstChildClass = isEndOfSelection ? styles__default.default["first-child"] : "";
|
|
48
|
-
var lastChildClass = isStartOfSelection ? styles__default.default["last-child"] : "";
|
|
62
|
+
var itemClass = clx("day", _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, "selected-day", isSelected), "selected-range-day", isInSelectedRange || isSelected), "no-selection", isStartOfSelection && isEndOfSelection), "start-of-selection", isStartOfSelection && !isEndOfSelection), "end-of-selection", isEndOfSelection && !isStartOfSelection), "first-child", isEndOfSelection), "last-child", isStartOfSelection));
|
|
49
63
|
if (isSelected) {
|
|
50
64
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
51
|
-
className:
|
|
65
|
+
className: itemClass
|
|
52
66
|
}, children);
|
|
53
67
|
} else if (isInSelectedRange) {
|
|
54
68
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
55
|
-
className: clx(
|
|
69
|
+
className: clx("selected-range-day")
|
|
56
70
|
}, children);
|
|
57
71
|
}
|
|
58
72
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
59
|
-
className: clx(
|
|
73
|
+
className: clx("day")
|
|
60
74
|
}, children);
|
|
61
|
-
};
|
|
75
|
+
});
|
|
76
|
+
Item.displayName = "Item";
|
|
77
|
+
var DayButton = /*#__PURE__*/React__namespace.memo(function (_ref2) {
|
|
78
|
+
var day = _ref2.day,
|
|
79
|
+
isActive = _ref2.isActive,
|
|
80
|
+
isSelected = _ref2.isSelected,
|
|
81
|
+
dateString = _ref2.dateString,
|
|
82
|
+
onDayClick = _ref2.onDayClick;
|
|
83
|
+
var handleClick = React.useCallback(function () {
|
|
84
|
+
if (isActive) {
|
|
85
|
+
onDayClick(dateString);
|
|
86
|
+
}
|
|
87
|
+
}, [isActive, dateString, onDayClick]);
|
|
88
|
+
var dayInnerActive = isActive ? "day-inner-active" : "";
|
|
89
|
+
var bgStyle = isSelected ? SELECTED_BG_STYLE : TRANSPARENT_BG_STYLE;
|
|
90
|
+
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
91
|
+
className: clx("day-inner", dayInnerActive),
|
|
92
|
+
style: bgStyle,
|
|
93
|
+
role: "button",
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick: isActive ? handleClick : undefined
|
|
96
|
+
}, /*#__PURE__*/React__namespace.createElement(index$1.default, {
|
|
97
|
+
size: "s",
|
|
98
|
+
style: {
|
|
99
|
+
opacity: isActive ? 80 : 30,
|
|
100
|
+
color: isActive ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.3)"
|
|
101
|
+
}
|
|
102
|
+
}, day));
|
|
103
|
+
});
|
|
104
|
+
DayButton.displayName = "DayButton";
|
|
62
105
|
var Month = function Month(props) {
|
|
63
|
-
var
|
|
64
|
-
|
|
106
|
+
var startDate = props.startDate,
|
|
107
|
+
offsetLeft = props.offsetLeft,
|
|
108
|
+
titleSize = props.titleSize,
|
|
109
|
+
onDayClick = props.onDayClick,
|
|
110
|
+
today = props.today,
|
|
111
|
+
selectedDate = props.selectedDate,
|
|
112
|
+
selectedPeriod = props.selectedPeriod,
|
|
113
|
+
activeDays = props.activeDays,
|
|
114
|
+
availableDates = props.availableDates;
|
|
115
|
+
var year = startDate.getFullYear();
|
|
116
|
+
var month = React.useMemo(function () {
|
|
117
|
+
return leadingZeros.leadingZeros(startDate.getMonth() + 1, 2);
|
|
118
|
+
}, [startDate]);
|
|
119
|
+
var monthName = React.useMemo(function () {
|
|
120
|
+
return index.getUpperMonthName(startDate);
|
|
121
|
+
}, [startDate]);
|
|
122
|
+
var weeks = React.useMemo(function () {
|
|
123
|
+
return getMonthWeeks.getMonthWeeks(props);
|
|
124
|
+
},
|
|
125
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
126
|
+
[today, startDate, activeDays, selectedDate, selectedPeriod, availableDates]);
|
|
127
|
+
var leftStyle = React.useMemo(function () {
|
|
128
|
+
return offsetLeft ? {
|
|
129
|
+
left: "".concat(offsetLeft, "px")
|
|
130
|
+
} : undefined;
|
|
131
|
+
}, [offsetLeft]);
|
|
65
132
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
66
133
|
"data-testid": "month",
|
|
67
|
-
className: clx(
|
|
68
|
-
style:
|
|
69
|
-
left: props.offsetLeft ? "".concat(props.offsetLeft, "px") : undefined
|
|
70
|
-
}
|
|
134
|
+
className: clx("root"),
|
|
135
|
+
style: leftStyle
|
|
71
136
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
72
|
-
className: clx(
|
|
73
|
-
}, /*#__PURE__*/React__namespace.createElement(index.default, {
|
|
137
|
+
className: clx("month-name")
|
|
138
|
+
}, /*#__PURE__*/React__namespace.createElement(index$1.default, {
|
|
74
139
|
tag: "span",
|
|
75
|
-
size:
|
|
76
|
-
},
|
|
77
|
-
className: clx(
|
|
140
|
+
size: titleSize
|
|
141
|
+
}, monthName)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
142
|
+
className: clx("table")
|
|
78
143
|
}, /*#__PURE__*/React__namespace.createElement("ul", {
|
|
79
|
-
className: clx(
|
|
80
|
-
},
|
|
81
|
-
var index
|
|
144
|
+
className: clx("legend")
|
|
145
|
+
}, WEEK_DAYS.map(function (_ref3) {
|
|
146
|
+
var index = _ref3.index,
|
|
147
|
+
name = _ref3.name,
|
|
148
|
+
isWeekend = _ref3.isWeekend;
|
|
82
149
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
83
|
-
className: clx(
|
|
84
|
-
key: index
|
|
85
|
-
}, /*#__PURE__*/React__namespace.createElement(index.default, {
|
|
150
|
+
className: clx("day"),
|
|
151
|
+
key: index
|
|
152
|
+
}, /*#__PURE__*/React__namespace.createElement(index$1.default, {
|
|
86
153
|
style: {
|
|
87
|
-
opacity:
|
|
88
|
-
color:
|
|
154
|
+
opacity: isWeekend ? 80 : 30,
|
|
155
|
+
color: isWeekend ? "var(--typography-alert)" : "var(--palette-black)"
|
|
89
156
|
}
|
|
90
|
-
},
|
|
91
|
-
})),
|
|
157
|
+
}, name));
|
|
158
|
+
})), weeks.map(function (days, weekIndex) {
|
|
92
159
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
93
|
-
key: "week-".concat(
|
|
94
|
-
className: clx(
|
|
95
|
-
}, days.map(function (day) {
|
|
96
|
-
var key = "day-".concat(
|
|
160
|
+
key: "week-".concat(weekIndex),
|
|
161
|
+
className: clx("week")
|
|
162
|
+
}, days.map(function (day, dayIndex) {
|
|
163
|
+
var key = "day-".concat(dayIndex);
|
|
97
164
|
if (day.isDummy) {
|
|
98
165
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
99
|
-
className: clx(
|
|
166
|
+
className: clx("day"),
|
|
100
167
|
key: key
|
|
101
168
|
});
|
|
102
169
|
}
|
|
103
|
-
var
|
|
170
|
+
var dateString = "".concat(year, "-").concat(month, "-").concat(leadingZeros.leadingZeros(day.day, 2));
|
|
171
|
+
return /*#__PURE__*/React__namespace.createElement(Item, {
|
|
104
172
|
isStartOfSelection: day.isStartOfSelection,
|
|
105
173
|
isEndOfSelection: day.isEndOfSelection,
|
|
106
174
|
isSelected: day.isSelected,
|
|
107
|
-
isInSelectedRange: day.isInSelectedRange
|
|
108
|
-
};
|
|
109
|
-
var dayInnerActive = day.isActive ? styles__default.default["day-inner-active"] : "";
|
|
110
|
-
return /*#__PURE__*/React__namespace.createElement(Item, Object.assign({}, attrs, {
|
|
175
|
+
isInSelectedRange: day.isInSelectedRange,
|
|
111
176
|
key: key
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
onClick: day.isActive ? function () {
|
|
120
|
-
return props.onDayClick([year, month, leadingZeros.leadingZeros(day.day, 2)].join("-"));
|
|
121
|
-
} : undefined
|
|
122
|
-
}, /*#__PURE__*/React__namespace.createElement(index.default, {
|
|
123
|
-
size: "s",
|
|
124
|
-
style: {
|
|
125
|
-
opacity: day.isActive ? 80 : 30,
|
|
126
|
-
color: day.isActive ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.3)"
|
|
127
|
-
}
|
|
128
|
-
}, day.day)));
|
|
177
|
+
}, /*#__PURE__*/React__namespace.createElement(DayButton, {
|
|
178
|
+
day: day.day,
|
|
179
|
+
isActive: Boolean(day.isActive),
|
|
180
|
+
isSelected: Boolean(day.isSelected),
|
|
181
|
+
dateString: dateString,
|
|
182
|
+
onDayClick: onDayClick
|
|
183
|
+
}));
|
|
129
184
|
}));
|
|
130
185
|
})));
|
|
131
186
|
};
|
|
187
|
+
var Month$1 = /*#__PURE__*/React__namespace.memo(Month);
|
|
188
|
+
Month.displayName = "Month";
|
|
132
189
|
|
|
133
|
-
exports.
|
|
190
|
+
exports.default = Month$1;
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
.table {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
|
-
width: 100%;
|
|
16
15
|
height: auto;
|
|
16
|
+
width: 100%;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.week {
|
|
20
20
|
display: grid;
|
|
21
|
-
grid-template-columns: repeat(7, 1fr);
|
|
22
21
|
gap: 4px;
|
|
22
|
+
grid-template-columns: repeat(7, 1fr);
|
|
23
23
|
justify-content: center;
|
|
24
|
-
padding: 0;
|
|
25
24
|
margin: 2px 0;
|
|
25
|
+
padding: 0;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.day {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
|
|
36
36
|
.legend {
|
|
37
37
|
display: grid;
|
|
38
|
-
grid-template-columns: repeat(7, 1fr);
|
|
39
38
|
gap: 4px;
|
|
40
|
-
|
|
41
|
-
padding: 0;
|
|
39
|
+
grid-template-columns: repeat(7, 1fr);
|
|
42
40
|
margin: 2px 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
text-align: center;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.selected-range-day {
|