colibri-ui 0.8.43 → 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 +113 -54
- 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 +108 -50
- 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 +5 -7
package/Calendar/index.js
CHANGED
|
@@ -27,6 +27,59 @@ var clx = classNames__default.default.bind(styles__default.default);
|
|
|
27
27
|
var idleCallbackOptions = {
|
|
28
28
|
timeout: 1000
|
|
29
29
|
};
|
|
30
|
+
var updates = {};
|
|
31
|
+
var calendarReducer = function calendarReducer(state, action) {
|
|
32
|
+
switch (action.type) {
|
|
33
|
+
case "SET_SELECTED_DATE":
|
|
34
|
+
return Object.assign(Object.assign({}, state), {
|
|
35
|
+
selectedDate: action.payload
|
|
36
|
+
});
|
|
37
|
+
case "SET_SELECTED_PERIOD":
|
|
38
|
+
return Object.assign(Object.assign({}, state), {
|
|
39
|
+
selectedPeriod: action.payload
|
|
40
|
+
});
|
|
41
|
+
case "SET_CURRENT_MONTH_OFFSET":
|
|
42
|
+
return Object.assign(Object.assign({}, state), {
|
|
43
|
+
currentMonthOffset: action.payload
|
|
44
|
+
});
|
|
45
|
+
case "SET_CONTENT_WIDTH":
|
|
46
|
+
return Object.assign(Object.assign({}, state), {
|
|
47
|
+
contentWidth: action.payload
|
|
48
|
+
});
|
|
49
|
+
case "SET_IS_RANGE_COMPLETED":
|
|
50
|
+
return Object.assign(Object.assign({}, state), {
|
|
51
|
+
isRangeCompleted: action.payload
|
|
52
|
+
});
|
|
53
|
+
case "SELECT_DATE":
|
|
54
|
+
return Object.assign(Object.assign({}, state), {
|
|
55
|
+
selectedDate: action.payload.date,
|
|
56
|
+
selectedPeriod: action.payload.period,
|
|
57
|
+
isRangeCompleted: action.payload.rangeCompleted,
|
|
58
|
+
currentMonthOffset: getNumberOfMonthsBetweenDates.getNumberOfMonthsBetweenDates(action.payload.startMonth, action.payload.date)
|
|
59
|
+
});
|
|
60
|
+
case "INCREMENT_MONTH_OFFSET":
|
|
61
|
+
return Object.assign(Object.assign({}, state), {
|
|
62
|
+
currentMonthOffset: state.currentMonthOffset + 1
|
|
63
|
+
});
|
|
64
|
+
case "DECREMENT_MONTH_OFFSET":
|
|
65
|
+
return Object.assign(Object.assign({}, state), {
|
|
66
|
+
currentMonthOffset: state.currentMonthOffset - 1
|
|
67
|
+
});
|
|
68
|
+
case "SYNC_INITIAL_STATE":
|
|
69
|
+
if (action.payload.selectedDate !== undefined && action.payload.selectedDate !== state.selectedDate) {
|
|
70
|
+
updates.selectedDate = action.payload.selectedDate;
|
|
71
|
+
if (action.payload.selectedDate) {
|
|
72
|
+
updates.currentMonthOffset = getNumberOfMonthsBetweenDates.getNumberOfMonthsBetweenDates(action.payload.startMonth, action.payload.selectedDate);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (action.payload.selectedPeriod !== undefined && action.payload.selectedPeriod !== state.selectedPeriod) {
|
|
76
|
+
updates.selectedPeriod = action.payload.selectedPeriod;
|
|
77
|
+
}
|
|
78
|
+
return Object.keys(updates).length > 0 ? Object.assign(Object.assign({}, state), updates) : state;
|
|
79
|
+
default:
|
|
80
|
+
return state;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
30
83
|
var Calendar = function Calendar(_ref) {
|
|
31
84
|
var today = _ref.today,
|
|
32
85
|
initialSelectedDate = _ref.selectedDate,
|
|
@@ -49,60 +102,59 @@ var Calendar = function Calendar(_ref) {
|
|
|
49
102
|
today: today,
|
|
50
103
|
activeDates: activeDates
|
|
51
104
|
});
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return 0;
|
|
105
|
+
var getInitialOffset = function getInitialOffset() {
|
|
106
|
+
if (initialSelectedDate) {
|
|
107
|
+
return getNumberOfMonthsBetweenDates.getNumberOfMonthsBetweenDates(startMonth, initialSelectedDate);
|
|
108
|
+
} else if (activeDates && activeDates.length) {
|
|
109
|
+
return getNumberOfMonthsBetweenDates.getNumberOfMonthsBetweenDates(startMonth, activeDates.sort()[0]);
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
};
|
|
113
|
+
var _useReducer = React.useReducer(calendarReducer, {
|
|
114
|
+
selectedDate: initialSelectedDate,
|
|
115
|
+
selectedPeriod: initialSelectedPeriod,
|
|
116
|
+
currentMonthOffset: getInitialOffset(),
|
|
117
|
+
contentWidth: 0,
|
|
118
|
+
isRangeCompleted: true
|
|
67
119
|
}),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var _useState7 = React.useState(0),
|
|
72
|
-
_useState8 = _slicedToArray__default.default(_useState7, 2),
|
|
73
|
-
contentWidth = _useState8[0],
|
|
74
|
-
setContentWidth = _useState8[1];
|
|
75
|
-
var _useState9 = React.useState(true),
|
|
76
|
-
_useState0 = _slicedToArray__default.default(_useState9, 2),
|
|
77
|
-
isRangeCompleted = _useState0[0],
|
|
78
|
-
setIsRangeCompleted = _useState0[1];
|
|
120
|
+
_useReducer2 = _slicedToArray__default.default(_useReducer, 2),
|
|
121
|
+
state = _useReducer2[0],
|
|
122
|
+
dispatch = _useReducer2[1];
|
|
79
123
|
React.useEffect(function () {
|
|
80
124
|
var _a;
|
|
81
|
-
|
|
125
|
+
dispatch({
|
|
126
|
+
type: "SET_CONTENT_WIDTH",
|
|
127
|
+
payload: ((_a = $root.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0
|
|
128
|
+
});
|
|
82
129
|
}, []);
|
|
83
130
|
var showPrevMonth = function showPrevMonth(event) {
|
|
84
131
|
event.preventDefault();
|
|
85
132
|
event.stopPropagation();
|
|
86
|
-
|
|
87
|
-
|
|
133
|
+
dispatch({
|
|
134
|
+
type: "DECREMENT_MONTH_OFFSET"
|
|
88
135
|
});
|
|
89
136
|
};
|
|
90
137
|
var showNextMonth = function showNextMonth(event) {
|
|
91
138
|
event.preventDefault();
|
|
92
139
|
event.stopPropagation();
|
|
93
|
-
|
|
94
|
-
|
|
140
|
+
dispatch({
|
|
141
|
+
type: "INCREMENT_MONTH_OFFSET"
|
|
95
142
|
});
|
|
96
143
|
};
|
|
97
144
|
var selectDate = React.useCallback(function (date, period, rangeCompleted) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
145
|
+
dispatch({
|
|
146
|
+
type: "SELECT_DATE",
|
|
147
|
+
payload: {
|
|
148
|
+
date: date,
|
|
149
|
+
period: period,
|
|
150
|
+
rangeCompleted: rangeCompleted,
|
|
151
|
+
startMonth: startMonth
|
|
152
|
+
}
|
|
153
|
+
});
|
|
102
154
|
}, [startMonth]);
|
|
103
155
|
var handleDayClick = React.useCallback(function (date) {
|
|
104
|
-
if (canSelectRange && selectedDate && !isRangeCompleted) {
|
|
105
|
-
var _sort = [date, selectedDate].sort(),
|
|
156
|
+
if (canSelectRange && state.selectedDate && !state.isRangeCompleted) {
|
|
157
|
+
var _sort = [date, state.selectedDate].sort(),
|
|
106
158
|
_sort2 = _slicedToArray__default.default(_sort, 2),
|
|
107
159
|
startDate = _sort2[0],
|
|
108
160
|
endDate = _sort2[1];
|
|
@@ -127,9 +179,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
127
179
|
return selectDate(date, 1, false);
|
|
128
180
|
}, idleCallbackOptions);
|
|
129
181
|
}
|
|
130
|
-
},
|
|
131
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
132
|
-
[canSelectRange, selectedDate, isRangeCompleted, selectDate]);
|
|
182
|
+
}, [canSelectRange, state.selectedDate, state.isRangeCompleted, selectDate, onChange]);
|
|
133
183
|
var handlePresetSelect = React.useCallback(function (preset) {
|
|
134
184
|
if (onChange) {
|
|
135
185
|
onChange({
|
|
@@ -140,20 +190,20 @@ var Calendar = function Calendar(_ref) {
|
|
|
140
190
|
index$1.requestIdleCallback(function () {
|
|
141
191
|
return selectDate(preset.date, preset.period, true);
|
|
142
192
|
}, idleCallbackOptions);
|
|
143
|
-
}, [selectDate]);
|
|
193
|
+
}, [selectDate, onChange]);
|
|
144
194
|
var commitSelectedDates = React.useCallback(function () {
|
|
145
|
-
if (selectedDate && selectedPeriod) {
|
|
195
|
+
if (state.selectedDate && state.selectedPeriod) {
|
|
146
196
|
if (onCancel) {
|
|
147
197
|
onCancel();
|
|
148
198
|
}
|
|
149
199
|
if (onChange) {
|
|
150
200
|
onChange({
|
|
151
|
-
date: selectedDate,
|
|
152
|
-
period: selectedPeriod
|
|
201
|
+
date: state.selectedDate,
|
|
202
|
+
period: state.selectedPeriod
|
|
153
203
|
});
|
|
154
204
|
}
|
|
155
205
|
}
|
|
156
|
-
}, [selectedDate, selectedPeriod, onChange, onCancel]);
|
|
206
|
+
}, [state.selectedDate, state.selectedPeriod, onChange, onCancel]);
|
|
157
207
|
var cancelCalendar = React.useCallback(function () {
|
|
158
208
|
if (onCancel) {
|
|
159
209
|
onCancel();
|
|
@@ -164,26 +214,26 @@ var Calendar = function Calendar(_ref) {
|
|
|
164
214
|
startDate.setMonth(startDate.getMonth() + shiftIndex);
|
|
165
215
|
return startDate;
|
|
166
216
|
}, [startMonth]);
|
|
167
|
-
var commonAttrs = {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
217
|
+
var commonAttrs = React.useMemo(function () {
|
|
218
|
+
return {
|
|
219
|
+
selectedDate: state.selectedDate,
|
|
220
|
+
selectedPeriod: state.selectedPeriod,
|
|
221
|
+
activeDates: activeDates,
|
|
222
|
+
availableDates: availableDates,
|
|
223
|
+
isRangeCompleted: state.isRangeCompleted,
|
|
224
|
+
onDayClick: handleDayClick
|
|
225
|
+
};
|
|
226
|
+
}, [state.selectedDate, state.selectedPeriod, activeDates, availableDates, state.isRangeCompleted, handleDayClick]);
|
|
175
227
|
React.useEffect(function () {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
}, [initialSelectedDate, startMonth]);
|
|
228
|
+
dispatch({
|
|
229
|
+
type: "SYNC_INITIAL_STATE",
|
|
230
|
+
payload: {
|
|
231
|
+
selectedDate: initialSelectedDate,
|
|
232
|
+
selectedPeriod: initialSelectedPeriod,
|
|
233
|
+
startMonth: startMonth
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}, [initialSelectedDate, initialSelectedPeriod, startMonth]);
|
|
187
237
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
188
238
|
className: clx(styles__default.default.root, className),
|
|
189
239
|
style: {
|
|
@@ -191,33 +241,33 @@ var Calendar = function Calendar(_ref) {
|
|
|
191
241
|
},
|
|
192
242
|
"data-testid": "calendar",
|
|
193
243
|
ref: $root
|
|
194
|
-
}, /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, contentWidth ? (/*#__PURE__*/React__default.default.createElement("div", {
|
|
244
|
+
}, /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, state.contentWidth ? (/*#__PURE__*/React__default.default.createElement("div", {
|
|
195
245
|
"data-component": "Months",
|
|
196
246
|
className: clx(styles__default.default.months),
|
|
197
247
|
style: {
|
|
198
|
-
transform: "translate3D(".concat(-1 * currentMonthOffset * contentWidth, "px, 0, 0)")
|
|
248
|
+
transform: "translate3D(".concat(-1 * state.currentMonthOffset * state.contentWidth, "px, 0, 0)")
|
|
199
249
|
}
|
|
200
|
-
}, [currentMonthOffset - 1, currentMonthOffset, currentMonthOffset + 1].filter(function (index) {
|
|
250
|
+
}, [state.currentMonthOffset - 1, state.currentMonthOffset, state.currentMonthOffset + 1].filter(function (index) {
|
|
201
251
|
return index >= 0;
|
|
202
252
|
}).map(function (index) {
|
|
203
253
|
var attrs = Object.assign(Object.assign({}, commonAttrs), {
|
|
204
254
|
today: today,
|
|
205
255
|
startDate: getMonthStartDate(index),
|
|
206
|
-
offsetLeft: index * contentWidth
|
|
256
|
+
offsetLeft: index * state.contentWidth
|
|
207
257
|
});
|
|
208
|
-
return /*#__PURE__*/React__default.default.createElement(Month.
|
|
258
|
+
return /*#__PURE__*/React__default.default.createElement(Month.default, Object.assign({}, attrs, {
|
|
209
259
|
titleSize: titleSize,
|
|
210
260
|
key: "month-".concat(index)
|
|
211
261
|
}));
|
|
212
|
-
}))) : (/*#__PURE__*/React__default.default.createElement(Month.
|
|
262
|
+
}))) : (/*#__PURE__*/React__default.default.createElement(Month.default, Object.assign({
|
|
213
263
|
titleSize: titleSize,
|
|
214
264
|
today: today,
|
|
215
|
-
startDate: getMonthStartDate(currentMonthOffset),
|
|
265
|
+
startDate: getMonthStartDate(state.currentMonthOffset),
|
|
216
266
|
offsetLeft: 0
|
|
217
267
|
}, commonAttrs))), /*#__PURE__*/React__default.default.createElement("button", {
|
|
218
268
|
className: clx(styles__default.default["month-control"], styles__default.default["month-control-prev"]),
|
|
219
269
|
onClick: showPrevMonth,
|
|
220
|
-
disabled: currentMonthOffset <= 0,
|
|
270
|
+
disabled: state.currentMonthOffset <= 0,
|
|
221
271
|
type: "button",
|
|
222
272
|
role: "button",
|
|
223
273
|
"aria-label": "Prev"
|
|
@@ -226,7 +276,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
226
276
|
})), /*#__PURE__*/React__default.default.createElement("button", {
|
|
227
277
|
className: clx(styles__default.default["month-control"], styles__default.default["month-control-next"]),
|
|
228
278
|
onClick: showNextMonth,
|
|
229
|
-
disabled: currentMonthOffset >= 11,
|
|
279
|
+
disabled: state.currentMonthOffset >= 11,
|
|
230
280
|
type: "button",
|
|
231
281
|
role: "button",
|
|
232
282
|
"aria-label": "Next"
|
|
@@ -236,9 +286,9 @@ var Calendar = function Calendar(_ref) {
|
|
|
236
286
|
presets: datePresets,
|
|
237
287
|
onPresetSelect: handlePresetSelect
|
|
238
288
|
})), withContinueButton && (/*#__PURE__*/React__default.default.createElement(index$3.ContinueButton, {
|
|
239
|
-
isChanged: selectedDate !== initialSelectedDate || selectedPeriod !== initialSelectedPeriod,
|
|
240
|
-
selectedDate: selectedDate,
|
|
241
|
-
selectedPeriod: selectedPeriod,
|
|
289
|
+
isChanged: state.selectedDate !== initialSelectedDate || state.selectedPeriod !== initialSelectedPeriod,
|
|
290
|
+
selectedDate: state.selectedDate,
|
|
291
|
+
selectedPeriod: state.selectedPeriod,
|
|
242
292
|
onContinue: commitSelectedDates,
|
|
243
293
|
onCancel: cancelCalendar
|
|
244
294
|
})));
|
|
@@ -83,6 +83,7 @@ function getPresets(presets) {
|
|
|
83
83
|
var _a;
|
|
84
84
|
var presetFn = PRESET_MAP[preset];
|
|
85
85
|
if (!presetFn) {
|
|
86
|
+
//eslint-disable-next-line no-console
|
|
86
87
|
console.warn("Unknown preset: ".concat(preset, ", falling back to TODAY"));
|
|
87
88
|
}
|
|
88
89
|
return (_a = presetFn === null || presetFn === void 0 ? void 0 : presetFn()) !== null && _a !== void 0 ? _a : getToday();
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
border-color: var(--palette-bg-3);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.control_variant_primary {
|
|
73
|
-
/* stylelint-disable-next-line no-descending-specificity */
|
|
74
|
-
}
|
|
75
72
|
.control_variant_primary:focus:not(:disabled) + .fake-checkbox {
|
|
76
73
|
box-shadow: 0 0 0 2px var(--checkbox-box-shadow-focused);
|
|
77
74
|
}
|
|
75
|
+
.control_variant_primary {
|
|
76
|
+
/* stylelint-disable-next-line no-descending-specificity */
|
|
77
|
+
}
|
|
78
78
|
.control_variant_primary:disabled + .fake-checkbox {
|
|
79
79
|
background-color: var(--checkbox-bg-disabled);
|
|
80
80
|
z-index: 1;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
.input-container {
|
|
2
|
-
display: flex;
|
|
3
2
|
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
height: 36px;
|
|
6
|
-
box-sizing: border-box;
|
|
7
3
|
border: 1px solid var(--palette-bg-3);
|
|
8
|
-
border-top-right-radius: 0.375rem;
|
|
9
4
|
border-bottom-right-radius: 0.375rem;
|
|
10
5
|
border-left: none;
|
|
6
|
+
border-top-right-radius: 0.375rem;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
display: flex;
|
|
9
|
+
height: 36px;
|
|
10
|
+
justify-content: center;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.input-field {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
padding: 4px;
|
|
17
|
-
text-align: center;
|
|
18
14
|
background: transparent;
|
|
19
15
|
border: none;
|
|
20
|
-
outline: none;
|
|
21
16
|
box-sizing: border-box;
|
|
17
|
+
height: 100%;
|
|
18
|
+
outline: none;
|
|
19
|
+
padding: 4px;
|
|
20
|
+
text-align: center;
|
|
21
|
+
width: 100%;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.input-date {
|
|
25
|
+
border-bottom: 1px solid var(--palette-bg-3);
|
|
26
|
+
border-right: 1px solid var(--palette-bg-3);
|
|
27
|
+
border-top: 1px solid var(--palette-bg-3);
|
|
25
28
|
cursor: pointer;
|
|
26
29
|
flex: 3;
|
|
27
30
|
position: relative;
|
|
28
|
-
border-top: 1px solid var(--palette-bg-3);
|
|
29
|
-
border-right: 1px solid var(--palette-bg-3);
|
|
30
|
-
border-bottom: 1px solid var(--palette-bg-3);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.input-date:focus-within {
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.input-date:focus-within::before {
|
|
39
|
+
background-color: var(--palette-primary-3);
|
|
39
40
|
content: "";
|
|
40
|
-
|
|
41
|
+
height: 100%;
|
|
41
42
|
left: 0;
|
|
43
|
+
position: absolute;
|
|
42
44
|
width: 1px;
|
|
43
|
-
height: 100%;
|
|
44
|
-
background-color: var(--palette-primary-3);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.calendar {
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.calendar-icon {
|
|
52
|
-
|
|
52
|
+
cursor: pointer;
|
|
53
53
|
height: 24px;
|
|
54
54
|
margin-right: 10px;
|
|
55
|
-
|
|
55
|
+
width: 24px;
|
|
56
56
|
}
|
package/Grid/Grid.module.css
CHANGED
package/Modal/Modal.module.css
CHANGED
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.title-wrapper {
|
|
11
|
-
padding-right: 20px;
|
|
12
11
|
align-items: center;
|
|
13
12
|
border-bottom: 1px solid var(--palette-bg-2);
|
|
14
13
|
display: flex;
|
|
15
14
|
justify-content: space-between;
|
|
15
|
+
padding-right: 20px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.close-wrapper {
|
|
19
|
+
align-items: center;
|
|
19
20
|
box-sizing: border-box;
|
|
20
|
-
padding: 0 20px;
|
|
21
|
-
min-height: 70px;
|
|
22
21
|
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
22
|
justify-content: flex-end;
|
|
23
|
+
min-height: 70px;
|
|
24
|
+
padding: 0 20px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.modal-overlay {
|
package/Switch/Switch.module.css
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.label {
|
|
13
|
-
display: flex;
|
|
14
13
|
align-items: center;
|
|
15
|
-
gap: 8px;
|
|
16
14
|
cursor: pointer;
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 8px;
|
|
17
17
|
position: relative;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
height: 22px;
|
|
26
26
|
position: relative;
|
|
27
|
-
width: 40px;
|
|
28
27
|
transition: all 150ms ease;
|
|
28
|
+
width: 40px;
|
|
29
29
|
}
|
|
30
30
|
.wrapper_variant_primary {
|
|
31
31
|
background-color: var(--switch-bg);
|
|
32
32
|
border-color: var(--switch-border-color);
|
|
33
33
|
}
|
|
34
34
|
.wrapper_disabled {
|
|
35
|
-
opacity: 0.5;
|
|
36
35
|
cursor: not-allowed;
|
|
36
|
+
opacity: 0.5;
|
|
37
37
|
}
|
|
38
38
|
.wrapper_error {
|
|
39
39
|
border-color: var(--color-error, #ef4444);
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
.base-switch {
|
|
44
44
|
background: var(--palette-white);
|
|
45
45
|
border-radius: 50%;
|
|
46
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
46
47
|
height: 16px;
|
|
47
48
|
left: 2px;
|
|
48
49
|
position: absolute;
|
|
49
50
|
top: 2px;
|
|
50
51
|
transition: transform 150ms ease;
|
|
51
52
|
width: 16px;
|
|
52
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.checkbox {
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.text {
|
|
85
|
+
color: var(--text-primary, #1f2937);
|
|
85
86
|
font-size: 16px;
|
|
86
87
|
line-height: 1.4;
|
|
87
|
-
color: var(--text-primary, #1f2937);
|
|
88
88
|
user-select: none;
|
|
89
89
|
}
|
|
@@ -6,7 +6,7 @@ export type TabProps = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
content?: ReactNode;
|
|
8
8
|
onClick?: MouseEventHandler<HTMLLIElement>;
|
|
9
|
-
innerRef?: RefObject<HTMLLIElement>;
|
|
9
|
+
innerRef?: RefObject<HTMLLIElement | null>;
|
|
10
10
|
className?: string;
|
|
11
11
|
tabIndex?: number;
|
|
12
12
|
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
@@ -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 {
|