@redis-ui/components 46.1.2 → 47.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/index.cjs +1 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -4
- package/dist/node_modules/react-loading-skeleton/dist/index.cjs +2 -1
- package/dist/node_modules/react-loading-skeleton/dist/index.js +2 -1
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{packages/components/node_modules → node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +3 -5
- package/skills/redis-ui-components/SKILL.md +0 -1
- package/dist/DatePicker/DatePicker.cjs +0 -32
- package/dist/DatePicker/DatePicker.d.ts +0 -6
- package/dist/DatePicker/DatePicker.js +0 -31
- package/dist/DatePicker/DatePicker.style.cjs +0 -251
- package/dist/DatePicker/DatePicker.style.d.ts +0 -3
- package/dist/DatePicker/DatePicker.style.js +0 -249
- package/dist/DatePicker/DatePicker.types.d.ts +0 -17
- package/dist/DatePicker/DatePicker.types.js +0 -1
- package/dist/DatePicker/DatePicker.utils.cjs +0 -7
- package/dist/DatePicker/DatePicker.utils.d.ts +0 -2
- package/dist/DatePicker/DatePicker.utils.js +0 -6
- package/dist/DatePicker/RangeDatePicker.cjs +0 -30
- package/dist/DatePicker/RangeDatePicker.d.ts +0 -3
- package/dist/DatePicker/RangeDatePicker.js +0 -29
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.cjs +0 -34
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.d.ts +0 -3
- package/dist/DatePicker/components/CustomDropdown/CustomDropdown.js +0 -32
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomLeftIcon/CustomLeftIcon.js +0 -10
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.cjs +0 -11
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.d.ts +0 -2
- package/dist/DatePicker/components/CustomRightIcon/CustomRightIcon.js +0 -10
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.cjs +0 -6
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -6
- package/dist/node_modules/date-fns/_lib/defaultOptions.cjs +0 -7
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -7
- package/dist/node_modules/date-fns/_lib/format/formatters.cjs +0 -418
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -418
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.cjs +0 -45
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -45
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +0 -21
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -21
- package/dist/node_modules/date-fns/_lib/protectedTokens.cjs +0 -28
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -26
- package/dist/node_modules/date-fns/addDays.cjs +0 -32
- package/dist/node_modules/date-fns/addDays.js +0 -32
- package/dist/node_modules/date-fns/addMonths.cjs +0 -42
- package/dist/node_modules/date-fns/addMonths.js +0 -42
- package/dist/node_modules/date-fns/addWeeks.cjs +0 -27
- package/dist/node_modules/date-fns/addWeeks.js +0 -27
- package/dist/node_modules/date-fns/addYears.cjs +0 -27
- package/dist/node_modules/date-fns/addYears.js +0 -27
- package/dist/node_modules/date-fns/constants.cjs +0 -39
- package/dist/node_modules/date-fns/constants.js +0 -38
- package/dist/node_modules/date-fns/constructFrom.cjs +0 -37
- package/dist/node_modules/date-fns/constructFrom.js +0 -37
- package/dist/node_modules/date-fns/differenceInCalendarDays.cjs +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -45
- package/dist/node_modules/date-fns/differenceInCalendarMonths.cjs +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -34
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.cjs +0 -50
- package/dist/node_modules/date-fns/differenceInCalendarWeeks.js +0 -50
- package/dist/node_modules/date-fns/endOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/endOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/endOfMonth.js +0 -31
- package/dist/node_modules/date-fns/endOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/endOfWeek.js +0 -44
- package/dist/node_modules/date-fns/format.cjs +0 -357
- package/dist/node_modules/date-fns/format.js +0 -357
- package/dist/node_modules/date-fns/getDayOfYear.cjs +0 -29
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -29
- package/dist/node_modules/date-fns/getDaysInMonth.cjs +0 -33
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -33
- package/dist/node_modules/date-fns/getISOWeek.cjs +0 -33
- package/dist/node_modules/date-fns/getISOWeek.js +0 -33
- package/dist/node_modules/date-fns/getISOWeekYear.cjs +0 -43
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -43
- package/dist/node_modules/date-fns/getUnixTime.cjs +0 -26
- package/dist/node_modules/date-fns/getUnixTime.js +0 -26
- package/dist/node_modules/date-fns/getWeek.cjs +0 -51
- package/dist/node_modules/date-fns/getWeek.js +0 -51
- package/dist/node_modules/date-fns/getWeekYear.cjs +0 -63
- package/dist/node_modules/date-fns/getWeekYear.js +0 -63
- package/dist/node_modules/date-fns/getWeeksInMonth.cjs +0 -38
- package/dist/node_modules/date-fns/getWeeksInMonth.js +0 -38
- package/dist/node_modules/date-fns/isAfter.cjs +0 -29
- package/dist/node_modules/date-fns/isAfter.js +0 -29
- package/dist/node_modules/date-fns/isBefore.cjs +0 -29
- package/dist/node_modules/date-fns/isBefore.js +0 -29
- package/dist/node_modules/date-fns/isDate.cjs +0 -38
- package/dist/node_modules/date-fns/isDate.js +0 -38
- package/dist/node_modules/date-fns/isSameDay.cjs +0 -39
- package/dist/node_modules/date-fns/isSameDay.js +0 -39
- package/dist/node_modules/date-fns/isSameMonth.cjs +0 -34
- package/dist/node_modules/date-fns/isSameMonth.js +0 -34
- package/dist/node_modules/date-fns/isSameYear.cjs +0 -29
- package/dist/node_modules/date-fns/isSameYear.js +0 -29
- package/dist/node_modules/date-fns/isValid.cjs +0 -43
- package/dist/node_modules/date-fns/isValid.js +0 -43
- package/dist/node_modules/date-fns/lastDayOfMonth.cjs +0 -31
- package/dist/node_modules/date-fns/lastDayOfMonth.js +0 -31
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -51
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -28
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +0 -19
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -19
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -76
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -32
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.cjs +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -211
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.cjs +0 -123
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -124
- package/dist/node_modules/date-fns/locale/en-US.cjs +0 -28
- package/dist/node_modules/date-fns/locale/en-US.js +0 -28
- package/dist/node_modules/date-fns/max.cjs +0 -36
- package/dist/node_modules/date-fns/max.js +0 -36
- package/dist/node_modules/date-fns/min.cjs +0 -36
- package/dist/node_modules/date-fns/min.js +0 -36
- package/dist/node_modules/date-fns/setMonth.cjs +0 -37
- package/dist/node_modules/date-fns/setMonth.js +0 -37
- package/dist/node_modules/date-fns/setYear.cjs +0 -31
- package/dist/node_modules/date-fns/setYear.js +0 -31
- package/dist/node_modules/date-fns/startOfDay.cjs +0 -29
- package/dist/node_modules/date-fns/startOfDay.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.cjs +0 -29
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -29
- package/dist/node_modules/date-fns/startOfISOWeekYear.cjs +0 -36
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -36
- package/dist/node_modules/date-fns/startOfMonth.cjs +0 -30
- package/dist/node_modules/date-fns/startOfMonth.js +0 -30
- package/dist/node_modules/date-fns/startOfWeek.cjs +0 -44
- package/dist/node_modules/date-fns/startOfWeek.js +0 -44
- package/dist/node_modules/date-fns/startOfWeekYear.cjs +0 -55
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -55
- package/dist/node_modules/date-fns/startOfYear.cjs +0 -32
- package/dist/node_modules/date-fns/startOfYear.js +0 -32
- package/dist/node_modules/date-fns/subDays.cjs +0 -27
- package/dist/node_modules/date-fns/subDays.js +0 -27
- package/dist/node_modules/date-fns/toDate.cjs +0 -41
- package/dist/node_modules/date-fns/toDate.js +0 -41
- package/dist/node_modules/react-day-picker/dist/index.esm.cjs +0 -2094
- package/dist/node_modules/react-day-picker/dist/index.esm.js +0 -2092
- package/skills/redis-ui-components/references/DatePicker.md +0 -52
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_index_esm = require("../node_modules/react-day-picker/dist/index.esm.cjs");
|
|
3
|
-
;/* empty css */
|
|
4
|
-
let styled_components = require("styled-components");
|
|
5
|
-
styled_components = require_runtime.__toESM(styled_components, 1);
|
|
6
|
-
let _redislabsdev_redis_ui_styles = require("@redislabsdev/redis-ui-styles");
|
|
7
|
-
//#region src/DatePicker/DatePicker.style.ts
|
|
8
|
-
var sqrt2 = 1.4;
|
|
9
|
-
var getSelectedMarker = (markerStyle) => styled_components.css`
|
|
10
|
-
width: var(--rdp-x-square-size);
|
|
11
|
-
height: var(--rdp-x-square-size);
|
|
12
|
-
background: ${markerStyle.bgColor};
|
|
13
|
-
border: ${markerStyle.border};
|
|
14
|
-
border-radius: ${markerStyle.borderRadius};
|
|
15
|
-
transform: ${markerStyle.transform};
|
|
16
|
-
`;
|
|
17
|
-
var DatePicker = (0, styled_components.default)(require_index_esm.DayPicker).withConfig({
|
|
18
|
-
displayName: "DatePickerstyle__DatePicker",
|
|
19
|
-
componentId: "RedisUI__sc-ow55ij-0"
|
|
20
|
-
})(["", ""], () => {
|
|
21
|
-
const style = (0, _redislabsdev_redis_ui_styles.useTheme)().components.datePicker;
|
|
22
|
-
return styled_components.css`
|
|
23
|
-
& * {
|
|
24
|
-
font-size: ${style.fontSize};
|
|
25
|
-
font-weight: ${style.fontWeight};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.rdp {
|
|
29
|
-
--rdp-outline: ${style.focusOutline};
|
|
30
|
-
--rdp-background-color: ${style.dayCell.hoverColor};
|
|
31
|
-
--rdp-accent-color: ${style.selectedDay.bgColor};
|
|
32
|
-
--rdp-cell-size: ${style.dayCell.width};
|
|
33
|
-
--rdp-x-cell-height: ${style.dayCell.height || style.dayCell.width};
|
|
34
|
-
--rdp-x-week-day-cell-height: ${style.weekDayCell.height || style.dayCell.width};
|
|
35
|
-
--rdp-x-week-num-cell-height: var(--rdp-x-cell-height);
|
|
36
|
-
--rdp-x-square-size: min(var(--rdp-cell-size) / ${sqrt2}, var(--rdp-x-cell-height));
|
|
37
|
-
font-family: ${style.fontFamily};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.rdp-button {
|
|
41
|
-
// ui-components-style.ts in storybook has min-width: 6rem; and need to override
|
|
42
|
-
// not sure in deployment / production
|
|
43
|
-
min-width: auto;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.rdp-nav_button, // nav-buttons (next/prev month) - will be replaced by icons.
|
|
47
|
-
.rdp-cell, // Month Days Cell (outside and inside month)
|
|
48
|
-
.rdp-weeknumber,
|
|
49
|
-
.rdp-day {
|
|
50
|
-
//Actual Days (1,2,3...)
|
|
51
|
-
height: var(--rdp-x-cell-height);
|
|
52
|
-
transition: border 0s;
|
|
53
|
-
&[disabled] {
|
|
54
|
-
background: none;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.rdp-day:not(.rdp-day_selected) {
|
|
59
|
-
margin: auto;
|
|
60
|
-
width: var(--rdp-x-cell-height);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.rdp-weeknumber {
|
|
64
|
-
font-size: ${style.weekNumCell.fontSize};
|
|
65
|
-
font-weight: ${style.weekNumCell.fontWeight};
|
|
66
|
-
font-family: ${style.weekNumCell.fontFamily};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.rdp-cell {
|
|
70
|
-
// Month Days Cell (outside and inside month)
|
|
71
|
-
color: ${style.dayCell.textColor};
|
|
72
|
-
padding: ${style.dayCell.padding};
|
|
73
|
-
font-size: ${style.dayCell.fontSize};
|
|
74
|
-
font-weight: ${style.dayCell.fontWeight};
|
|
75
|
-
min-width: var(--rdp-cell-size);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.rdp-day_today:not(.rdp-day_outside) {
|
|
79
|
-
// today when not outside
|
|
80
|
-
border: ${style.today.border};
|
|
81
|
-
font-weight: ${style.today.fontWeight};
|
|
82
|
-
font-size: ${style.today.fontSize};
|
|
83
|
-
&:focus-visible {
|
|
84
|
-
outline: var(--rdp-outline);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.rdp-head_cell {
|
|
89
|
-
// MO, TU ...
|
|
90
|
-
font-weight: ${style.weekDayCell.fontWeight};
|
|
91
|
-
font-size: ${style.weekDayCell.fontSize};
|
|
92
|
-
color: ${style.weekDayCell.textColor};
|
|
93
|
-
height: var(--rdp-x-week-day-cell-height);
|
|
94
|
-
// because default is uppercase we need a combination between lowercase and uppercase
|
|
95
|
-
text-transform: lowercase;
|
|
96
|
-
&::first-letter {
|
|
97
|
-
// Mo, Tu ...
|
|
98
|
-
text-transform: uppercase;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// selected days
|
|
103
|
-
.rdp-day_selected {
|
|
104
|
-
background-color: ${style.selectedDay.bgColor};
|
|
105
|
-
color: ${style.selectedDay.textColor};
|
|
106
|
-
border-radius: ${style.selectedDay.borderRadius};
|
|
107
|
-
border: ${style.selectedDay.border};
|
|
108
|
-
|
|
109
|
-
&.rdp-day_today {
|
|
110
|
-
// today when selected
|
|
111
|
-
border: none;
|
|
112
|
-
&:focus-visible {
|
|
113
|
-
outline: var(--rdp-outline);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&.rdp-day_range_start:not(.rdp-day_range_end),
|
|
118
|
-
&.rdp-day_range_end:not(.rdp-day_range_start) {
|
|
119
|
-
z-index: 1;
|
|
120
|
-
&::before {
|
|
121
|
-
content: '';
|
|
122
|
-
position: absolute;
|
|
123
|
-
z-index: -1;
|
|
124
|
-
}
|
|
125
|
-
&:focus-visible:not([disabled])::before {
|
|
126
|
-
outline: var(--rdp-outline);
|
|
127
|
-
outline-offset: 1px;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.rdp-day_range_start:not(.rdp-day_range_end) {
|
|
132
|
-
background: linear-gradient(to left, ${style.selectedDay.bgColor} 10%, transparent 50%);
|
|
133
|
-
color: ${style.selectedDay.startDayMarker.textColor};
|
|
134
|
-
&::before {
|
|
135
|
-
${getSelectedMarker(style.selectedDay.startDayMarker)};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&.rdp-day_range_end:not(.rdp-day_range_start) {
|
|
140
|
-
background: linear-gradient(to right, ${style.selectedDay.bgColor} 10%, transparent 50%);
|
|
141
|
-
color: ${style.selectedDay.endDayMarker.textColor};
|
|
142
|
-
&::before {
|
|
143
|
-
${getSelectedMarker(style.selectedDay.endDayMarker)};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&.rdp-day_range_start.rdp-day_range_end,
|
|
148
|
-
&:not(.rdp-day_range_start):not(.rdp-day_range_middle):not(.rdp-day_range_end) {
|
|
149
|
-
color: ${style.selectedDay.singleDayMarker.textColor};
|
|
150
|
-
margin: auto;
|
|
151
|
-
${getSelectedMarker(style.selectedDay.singleDayMarker)};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
&.rdp-button.rdp-day_range_middle:focus-visible:not([disabled]):not(.rdp-day_today) {
|
|
155
|
-
outline: none;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&.rdp-button.rdp-day_today.rdp-day_range_middle:focus-visible:not([disabled]) {
|
|
159
|
-
outline: none;
|
|
160
|
-
border: var(--rdp-outline);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&.rdp-button:focus-visible:not([disabled]):not(.rdp-day_range_start.rdp-day_range_end) {
|
|
164
|
-
&.rdp-day_range_start,
|
|
165
|
-
&.rdp-day_range_end {
|
|
166
|
-
outline: none;
|
|
167
|
-
border: none;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.rdp-button:not(.rdp-day_selected):focus-visible:not([disabled]):not(:hover) {
|
|
173
|
-
background: unset;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.rdp-nav {
|
|
177
|
-
display: flex;
|
|
178
|
-
justify-content: space-between;
|
|
179
|
-
align-items: center;
|
|
180
|
-
gap: ${style.navArrow.gap};
|
|
181
|
-
|
|
182
|
-
.rdp-nav_button {
|
|
183
|
-
width: ${style.navArrow.width};
|
|
184
|
-
height: ${style.navArrow.height};
|
|
185
|
-
padding: ${style.navArrow.padding};
|
|
186
|
-
&:hover:not([disabled]) {
|
|
187
|
-
background: none;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// hide second month dropdowns in range mode
|
|
193
|
-
.rdp-months > .rdp-month:not(:nth-child(1)) > .rdp-caption {
|
|
194
|
-
.rdp-caption_dropdowns {
|
|
195
|
-
pointer-events: none;
|
|
196
|
-
svg {
|
|
197
|
-
display: none;
|
|
198
|
-
}
|
|
199
|
-
> div[role='combobox'] {
|
|
200
|
-
width: auto;
|
|
201
|
-
button {
|
|
202
|
-
padding-left: 0.3rem;
|
|
203
|
-
padding-right: 0.3rem;
|
|
204
|
-
display: flex;
|
|
205
|
-
justify-content: center;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// VANILLA SELECT - TO BE DELETED when replaced with new Dropdown Component
|
|
210
|
-
select {
|
|
211
|
-
background: none;
|
|
212
|
-
border: none;
|
|
213
|
-
text-align: center;
|
|
214
|
-
padding-left: 0;
|
|
215
|
-
padding-right: 0;
|
|
216
|
-
max-width: 9rem;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.rdp-caption_dropdowns {
|
|
222
|
-
color: ${style.navSelect.textColor};
|
|
223
|
-
gap: ${style.navSelect.gap};
|
|
224
|
-
|
|
225
|
-
button {
|
|
226
|
-
border: none;
|
|
227
|
-
> span:nth-child(2) {
|
|
228
|
-
display: flex;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
> div[role='combobox'] {
|
|
233
|
-
width: ${style.navSelect.month.width};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
> div[role='combobox']:nth-child(3) {
|
|
237
|
-
width: ${style.navSelect.year.width};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// VANILLA SELECT - TO BE DELETED when replaced with new Dropdown Component
|
|
241
|
-
> select {
|
|
242
|
-
width: ${style.navSelect.month.width};
|
|
243
|
-
&:nth-child(3) {
|
|
244
|
-
width: ${style.navSelect.year.width};
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
`;
|
|
249
|
-
});
|
|
250
|
-
//#endregion
|
|
251
|
-
exports.DatePicker = DatePicker;
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { DayPicker } from "../node_modules/react-day-picker/dist/index.esm.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _styled, { css } from "styled-components";
|
|
4
|
-
import { useTheme } from "@redislabsdev/redis-ui-styles";
|
|
5
|
-
//#region src/DatePicker/DatePicker.style.ts
|
|
6
|
-
var sqrt2 = 1.4;
|
|
7
|
-
var getSelectedMarker = (markerStyle) => css`
|
|
8
|
-
width: var(--rdp-x-square-size);
|
|
9
|
-
height: var(--rdp-x-square-size);
|
|
10
|
-
background: ${markerStyle.bgColor};
|
|
11
|
-
border: ${markerStyle.border};
|
|
12
|
-
border-radius: ${markerStyle.borderRadius};
|
|
13
|
-
transform: ${markerStyle.transform};
|
|
14
|
-
`;
|
|
15
|
-
var DatePicker = _styled(DayPicker).withConfig({
|
|
16
|
-
displayName: "DatePickerstyle__DatePicker",
|
|
17
|
-
componentId: "RedisUI__sc-ow55ij-0"
|
|
18
|
-
})(["", ""], () => {
|
|
19
|
-
const style = useTheme().components.datePicker;
|
|
20
|
-
return css`
|
|
21
|
-
& * {
|
|
22
|
-
font-size: ${style.fontSize};
|
|
23
|
-
font-weight: ${style.fontWeight};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.rdp {
|
|
27
|
-
--rdp-outline: ${style.focusOutline};
|
|
28
|
-
--rdp-background-color: ${style.dayCell.hoverColor};
|
|
29
|
-
--rdp-accent-color: ${style.selectedDay.bgColor};
|
|
30
|
-
--rdp-cell-size: ${style.dayCell.width};
|
|
31
|
-
--rdp-x-cell-height: ${style.dayCell.height || style.dayCell.width};
|
|
32
|
-
--rdp-x-week-day-cell-height: ${style.weekDayCell.height || style.dayCell.width};
|
|
33
|
-
--rdp-x-week-num-cell-height: var(--rdp-x-cell-height);
|
|
34
|
-
--rdp-x-square-size: min(var(--rdp-cell-size) / ${sqrt2}, var(--rdp-x-cell-height));
|
|
35
|
-
font-family: ${style.fontFamily};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.rdp-button {
|
|
39
|
-
// ui-components-style.ts in storybook has min-width: 6rem; and need to override
|
|
40
|
-
// not sure in deployment / production
|
|
41
|
-
min-width: auto;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.rdp-nav_button, // nav-buttons (next/prev month) - will be replaced by icons.
|
|
45
|
-
.rdp-cell, // Month Days Cell (outside and inside month)
|
|
46
|
-
.rdp-weeknumber,
|
|
47
|
-
.rdp-day {
|
|
48
|
-
//Actual Days (1,2,3...)
|
|
49
|
-
height: var(--rdp-x-cell-height);
|
|
50
|
-
transition: border 0s;
|
|
51
|
-
&[disabled] {
|
|
52
|
-
background: none;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.rdp-day:not(.rdp-day_selected) {
|
|
57
|
-
margin: auto;
|
|
58
|
-
width: var(--rdp-x-cell-height);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.rdp-weeknumber {
|
|
62
|
-
font-size: ${style.weekNumCell.fontSize};
|
|
63
|
-
font-weight: ${style.weekNumCell.fontWeight};
|
|
64
|
-
font-family: ${style.weekNumCell.fontFamily};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.rdp-cell {
|
|
68
|
-
// Month Days Cell (outside and inside month)
|
|
69
|
-
color: ${style.dayCell.textColor};
|
|
70
|
-
padding: ${style.dayCell.padding};
|
|
71
|
-
font-size: ${style.dayCell.fontSize};
|
|
72
|
-
font-weight: ${style.dayCell.fontWeight};
|
|
73
|
-
min-width: var(--rdp-cell-size);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.rdp-day_today:not(.rdp-day_outside) {
|
|
77
|
-
// today when not outside
|
|
78
|
-
border: ${style.today.border};
|
|
79
|
-
font-weight: ${style.today.fontWeight};
|
|
80
|
-
font-size: ${style.today.fontSize};
|
|
81
|
-
&:focus-visible {
|
|
82
|
-
outline: var(--rdp-outline);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.rdp-head_cell {
|
|
87
|
-
// MO, TU ...
|
|
88
|
-
font-weight: ${style.weekDayCell.fontWeight};
|
|
89
|
-
font-size: ${style.weekDayCell.fontSize};
|
|
90
|
-
color: ${style.weekDayCell.textColor};
|
|
91
|
-
height: var(--rdp-x-week-day-cell-height);
|
|
92
|
-
// because default is uppercase we need a combination between lowercase and uppercase
|
|
93
|
-
text-transform: lowercase;
|
|
94
|
-
&::first-letter {
|
|
95
|
-
// Mo, Tu ...
|
|
96
|
-
text-transform: uppercase;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// selected days
|
|
101
|
-
.rdp-day_selected {
|
|
102
|
-
background-color: ${style.selectedDay.bgColor};
|
|
103
|
-
color: ${style.selectedDay.textColor};
|
|
104
|
-
border-radius: ${style.selectedDay.borderRadius};
|
|
105
|
-
border: ${style.selectedDay.border};
|
|
106
|
-
|
|
107
|
-
&.rdp-day_today {
|
|
108
|
-
// today when selected
|
|
109
|
-
border: none;
|
|
110
|
-
&:focus-visible {
|
|
111
|
-
outline: var(--rdp-outline);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&.rdp-day_range_start:not(.rdp-day_range_end),
|
|
116
|
-
&.rdp-day_range_end:not(.rdp-day_range_start) {
|
|
117
|
-
z-index: 1;
|
|
118
|
-
&::before {
|
|
119
|
-
content: '';
|
|
120
|
-
position: absolute;
|
|
121
|
-
z-index: -1;
|
|
122
|
-
}
|
|
123
|
-
&:focus-visible:not([disabled])::before {
|
|
124
|
-
outline: var(--rdp-outline);
|
|
125
|
-
outline-offset: 1px;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&.rdp-day_range_start:not(.rdp-day_range_end) {
|
|
130
|
-
background: linear-gradient(to left, ${style.selectedDay.bgColor} 10%, transparent 50%);
|
|
131
|
-
color: ${style.selectedDay.startDayMarker.textColor};
|
|
132
|
-
&::before {
|
|
133
|
-
${getSelectedMarker(style.selectedDay.startDayMarker)};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&.rdp-day_range_end:not(.rdp-day_range_start) {
|
|
138
|
-
background: linear-gradient(to right, ${style.selectedDay.bgColor} 10%, transparent 50%);
|
|
139
|
-
color: ${style.selectedDay.endDayMarker.textColor};
|
|
140
|
-
&::before {
|
|
141
|
-
${getSelectedMarker(style.selectedDay.endDayMarker)};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&.rdp-day_range_start.rdp-day_range_end,
|
|
146
|
-
&:not(.rdp-day_range_start):not(.rdp-day_range_middle):not(.rdp-day_range_end) {
|
|
147
|
-
color: ${style.selectedDay.singleDayMarker.textColor};
|
|
148
|
-
margin: auto;
|
|
149
|
-
${getSelectedMarker(style.selectedDay.singleDayMarker)};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.rdp-button.rdp-day_range_middle:focus-visible:not([disabled]):not(.rdp-day_today) {
|
|
153
|
-
outline: none;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&.rdp-button.rdp-day_today.rdp-day_range_middle:focus-visible:not([disabled]) {
|
|
157
|
-
outline: none;
|
|
158
|
-
border: var(--rdp-outline);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&.rdp-button:focus-visible:not([disabled]):not(.rdp-day_range_start.rdp-day_range_end) {
|
|
162
|
-
&.rdp-day_range_start,
|
|
163
|
-
&.rdp-day_range_end {
|
|
164
|
-
outline: none;
|
|
165
|
-
border: none;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.rdp-button:not(.rdp-day_selected):focus-visible:not([disabled]):not(:hover) {
|
|
171
|
-
background: unset;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.rdp-nav {
|
|
175
|
-
display: flex;
|
|
176
|
-
justify-content: space-between;
|
|
177
|
-
align-items: center;
|
|
178
|
-
gap: ${style.navArrow.gap};
|
|
179
|
-
|
|
180
|
-
.rdp-nav_button {
|
|
181
|
-
width: ${style.navArrow.width};
|
|
182
|
-
height: ${style.navArrow.height};
|
|
183
|
-
padding: ${style.navArrow.padding};
|
|
184
|
-
&:hover:not([disabled]) {
|
|
185
|
-
background: none;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// hide second month dropdowns in range mode
|
|
191
|
-
.rdp-months > .rdp-month:not(:nth-child(1)) > .rdp-caption {
|
|
192
|
-
.rdp-caption_dropdowns {
|
|
193
|
-
pointer-events: none;
|
|
194
|
-
svg {
|
|
195
|
-
display: none;
|
|
196
|
-
}
|
|
197
|
-
> div[role='combobox'] {
|
|
198
|
-
width: auto;
|
|
199
|
-
button {
|
|
200
|
-
padding-left: 0.3rem;
|
|
201
|
-
padding-right: 0.3rem;
|
|
202
|
-
display: flex;
|
|
203
|
-
justify-content: center;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// VANILLA SELECT - TO BE DELETED when replaced with new Dropdown Component
|
|
208
|
-
select {
|
|
209
|
-
background: none;
|
|
210
|
-
border: none;
|
|
211
|
-
text-align: center;
|
|
212
|
-
padding-left: 0;
|
|
213
|
-
padding-right: 0;
|
|
214
|
-
max-width: 9rem;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.rdp-caption_dropdowns {
|
|
220
|
-
color: ${style.navSelect.textColor};
|
|
221
|
-
gap: ${style.navSelect.gap};
|
|
222
|
-
|
|
223
|
-
button {
|
|
224
|
-
border: none;
|
|
225
|
-
> span:nth-child(2) {
|
|
226
|
-
display: flex;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
> div[role='combobox'] {
|
|
231
|
-
width: ${style.navSelect.month.width};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
> div[role='combobox']:nth-child(3) {
|
|
235
|
-
width: ${style.navSelect.year.width};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// VANILLA SELECT - TO BE DELETED when replaced with new Dropdown Component
|
|
239
|
-
> select {
|
|
240
|
-
width: ${style.navSelect.month.width};
|
|
241
|
-
&:nth-child(3) {
|
|
242
|
-
width: ${style.navSelect.year.width};
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
`;
|
|
247
|
-
});
|
|
248
|
-
//#endregion
|
|
249
|
-
export { DatePicker };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as DayPicker from 'react-day-picker';
|
|
2
|
-
export type DateRange = DayPicker.DateRange;
|
|
3
|
-
export interface DatePickerProps {
|
|
4
|
-
fromYear?: number;
|
|
5
|
-
toYear?: number;
|
|
6
|
-
onSingleSelect?: DayPicker.DayPickerSingleProps['onSelect'];
|
|
7
|
-
selectedDay?: Date;
|
|
8
|
-
showSelected?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface RangeDatePickerProps {
|
|
11
|
-
fromYear?: number;
|
|
12
|
-
toYear?: number;
|
|
13
|
-
onRangeSelect?: DayPicker.DayPickerRangeProps['onSelect'];
|
|
14
|
-
selectedRange?: DateRange;
|
|
15
|
-
numberOfMonths?: number;
|
|
16
|
-
showSelected?: boolean;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region src/DatePicker/DatePicker.utils.ts
|
|
2
|
-
var today = /* @__PURE__ */ new Date();
|
|
3
|
-
var defaultFromYear = today.getFullYear() - 10;
|
|
4
|
-
var defaultToYear = today.getFullYear() + 10;
|
|
5
|
-
//#endregion
|
|
6
|
-
exports.defaultFromYear = defaultFromYear;
|
|
7
|
-
exports.defaultToYear = defaultToYear;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_DatePicker_style = require("./DatePicker.style.cjs");
|
|
3
|
-
const require_CustomDropdown = require("./components/CustomDropdown/CustomDropdown.cjs");
|
|
4
|
-
const require_DatePicker_utils = require("./DatePicker.utils.cjs");
|
|
5
|
-
const require_CustomLeftIcon = require("./components/CustomLeftIcon/CustomLeftIcon.cjs");
|
|
6
|
-
const require_CustomRightIcon = require("./components/CustomRightIcon/CustomRightIcon.cjs");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
//#region src/DatePicker/RangeDatePicker.tsx
|
|
9
|
-
var RangeDatePicker = ({ fromYear = require_DatePicker_utils.defaultFromYear, toYear = require_DatePicker_utils.defaultToYear, onRangeSelect, selectedRange, numberOfMonths = 2, showSelected, ...restProps }) => {
|
|
10
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DatePicker_style.DatePicker, {
|
|
11
|
-
captionLayout: "dropdown-buttons",
|
|
12
|
-
fixedWeeks: true,
|
|
13
|
-
weekStartsOn: 1,
|
|
14
|
-
mode: "range",
|
|
15
|
-
numberOfMonths,
|
|
16
|
-
selected: selectedRange,
|
|
17
|
-
onSelect: onRangeSelect,
|
|
18
|
-
fromYear,
|
|
19
|
-
toYear,
|
|
20
|
-
components: {
|
|
21
|
-
Dropdown: require_CustomDropdown.default,
|
|
22
|
-
IconLeft: require_CustomLeftIcon.default,
|
|
23
|
-
IconRight: require_CustomRightIcon.default
|
|
24
|
-
},
|
|
25
|
-
defaultMonth: showSelected ? selectedRange?.from || selectedRange?.to : void 0,
|
|
26
|
-
...restProps
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.default = RangeDatePicker;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { RangeDatePickerProps } from './DatePicker.types';
|
|
2
|
-
declare const RangeDatePicker: ({ fromYear, toYear, onRangeSelect, selectedRange, numberOfMonths, showSelected, ...restProps }: RangeDatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default RangeDatePicker;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DatePicker } from "./DatePicker.style.js";
|
|
2
|
-
import CustomDropdown from "./components/CustomDropdown/CustomDropdown.js";
|
|
3
|
-
import { defaultFromYear, defaultToYear } from "./DatePicker.utils.js";
|
|
4
|
-
import CustomLeftIcon from "./components/CustomLeftIcon/CustomLeftIcon.js";
|
|
5
|
-
import CustomRightIcon from "./components/CustomRightIcon/CustomRightIcon.js";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
//#region src/DatePicker/RangeDatePicker.tsx
|
|
8
|
-
var RangeDatePicker = ({ fromYear = defaultFromYear, toYear = defaultToYear, onRangeSelect, selectedRange, numberOfMonths = 2, showSelected, ...restProps }) => {
|
|
9
|
-
return /* @__PURE__ */ jsx(DatePicker, {
|
|
10
|
-
captionLayout: "dropdown-buttons",
|
|
11
|
-
fixedWeeks: true,
|
|
12
|
-
weekStartsOn: 1,
|
|
13
|
-
mode: "range",
|
|
14
|
-
numberOfMonths,
|
|
15
|
-
selected: selectedRange,
|
|
16
|
-
onSelect: onRangeSelect,
|
|
17
|
-
fromYear,
|
|
18
|
-
toYear,
|
|
19
|
-
components: {
|
|
20
|
-
Dropdown: CustomDropdown,
|
|
21
|
-
IconLeft: CustomLeftIcon,
|
|
22
|
-
IconRight: CustomRightIcon
|
|
23
|
-
},
|
|
24
|
-
defaultMonth: showSelected ? selectedRange?.from || selectedRange?.to : void 0,
|
|
25
|
-
...restProps
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
export { RangeDatePicker as default };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_startOfMonth = require("../../../node_modules/date-fns/startOfMonth.cjs");
|
|
3
|
-
const require_setMonth = require("../../../node_modules/date-fns/setMonth.cjs");
|
|
4
|
-
const require_setYear = require("../../../node_modules/date-fns/setYear.cjs");
|
|
5
|
-
const require_index_esm = require("../../../node_modules/react-day-picker/dist/index.esm.cjs");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let react = require("react");
|
|
8
|
-
react = require_runtime.__toESM(react, 1);
|
|
9
|
-
//#region src/DatePicker/components/CustomDropdown/CustomDropdown.tsx
|
|
10
|
-
var CustomDropdown = (props) => {
|
|
11
|
-
const { children, name, value } = props;
|
|
12
|
-
const { goToMonth, currentMonth } = require_index_esm.useNavigation();
|
|
13
|
-
const handleChange = (event) => {
|
|
14
|
-
const { value: date } = event.target;
|
|
15
|
-
let newMonth = /* @__PURE__ */ new Date();
|
|
16
|
-
switch (name) {
|
|
17
|
-
case "months":
|
|
18
|
-
newMonth = require_setMonth.default(require_startOfMonth.default(currentMonth), Number(date));
|
|
19
|
-
break;
|
|
20
|
-
case "years":
|
|
21
|
-
newMonth = require_setYear.default(require_startOfMonth.default(currentMonth), Number(date));
|
|
22
|
-
break;
|
|
23
|
-
default: break;
|
|
24
|
-
}
|
|
25
|
-
goToMonth(newMonth);
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
28
|
-
onChange: handleChange,
|
|
29
|
-
value,
|
|
30
|
-
children
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
exports.default = CustomDropdown;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import startOfMonth from "../../../node_modules/date-fns/startOfMonth.js";
|
|
2
|
-
import setMonth from "../../../node_modules/date-fns/setMonth.js";
|
|
3
|
-
import setYear from "../../../node_modules/date-fns/setYear.js";
|
|
4
|
-
import { useNavigation } from "../../../node_modules/react-day-picker/dist/index.esm.js";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import "react";
|
|
7
|
-
//#region src/DatePicker/components/CustomDropdown/CustomDropdown.tsx
|
|
8
|
-
var CustomDropdown = (props) => {
|
|
9
|
-
const { children, name, value } = props;
|
|
10
|
-
const { goToMonth, currentMonth } = useNavigation();
|
|
11
|
-
const handleChange = (event) => {
|
|
12
|
-
const { value: date } = event.target;
|
|
13
|
-
let newMonth = /* @__PURE__ */ new Date();
|
|
14
|
-
switch (name) {
|
|
15
|
-
case "months":
|
|
16
|
-
newMonth = setMonth(startOfMonth(currentMonth), Number(date));
|
|
17
|
-
break;
|
|
18
|
-
case "years":
|
|
19
|
-
newMonth = setYear(startOfMonth(currentMonth), Number(date));
|
|
20
|
-
break;
|
|
21
|
-
default: break;
|
|
22
|
-
}
|
|
23
|
-
goToMonth(newMonth);
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ jsx("select", {
|
|
26
|
-
onChange: handleChange,
|
|
27
|
-
value,
|
|
28
|
-
children
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
export { CustomDropdown as default };
|