@sproutsocial/seeds-react-datepicker 1.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/index.js ADDED
@@ -0,0 +1,451 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ DateRangePicker: () => DateRangePicker_default,
34
+ SingleDatePicker: () => SingleDatePicker_default,
35
+ StatefulDateRangePicker: () => StatefulDateRangePicker,
36
+ StatefulSingleDatePicker: () => StatefulSingleDatePicker
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+
40
+ // src/SingleDatePicker/SingleDatePicker.tsx
41
+ var import_react2 = __toESM(require("react"));
42
+ var import_moment2 = __toESM(require("moment"));
43
+ var import_DayPickerSingleDateController = __toESM(require("react-dates/lib/components/DayPickerSingleDateController"));
44
+
45
+ // src/styles.ts
46
+ var import_styled_components = __toESM(require("styled-components"));
47
+ var import_moment = __toESM(require("moment"));
48
+ var import_seeds_react_mixins = require("@sproutsocial/seeds-react-mixins");
49
+ var import_seeds_react_box = __toESM(require("@sproutsocial/seeds-react-box"));
50
+ var isSelected = (modifiers) => modifiers.has("selected-span") || modifiers.has("selected") || modifiers.has("selected-start") || modifiers.has("selected-end") || modifiers.has("hovered-span") || modifiers.has("after-hovered-start");
51
+ var isOutOfRange = (modifiers) => modifiers.has("blocked-out-of-range");
52
+ var isHoveredAndInRange = (modifiers) => modifiers.has("hovered") && !modifiers.has("blocked-out-of-range");
53
+ var shouldHaveLeftPill = (modifiers, day) => {
54
+ if (!isSelected(modifiers)) {
55
+ return false;
56
+ }
57
+ if (modifiers.has("selected") || modifiers.has("selected-start") || modifiers.has("first-day-of-week") || day.isSame((0, import_moment.default)(day).startOf("month"), "day")) {
58
+ return true;
59
+ }
60
+ return false;
61
+ };
62
+ var shouldHaveRightPill = (modifiers, day) => {
63
+ if (!isSelected(modifiers)) {
64
+ return false;
65
+ }
66
+ if (modifiers.has("selected") || modifiers.has("selected-end") || modifiers.has("last-day-of-week") || day.isSame((0, import_moment.default)(day).endOf("month"), "day")) {
67
+ return true;
68
+ }
69
+ return false;
70
+ };
71
+ var CalendarDay = (0, import_styled_components.default)(import_seeds_react_box.default)`
72
+ ${({ modifiers, day, theme }) => {
73
+ if (isSelected(modifiers)) {
74
+ return import_styled_components.css`
75
+ background-color: ${theme.colors.container.background.selected};
76
+ color: ${theme.colors.text.inverse};
77
+ margin-left: ${shouldHaveLeftPill(modifiers, day) && theme.space[200]};
78
+ margin-right: ${shouldHaveRightPill(modifiers, day) && theme.space[200]};
79
+ border-top-left-radius: ${shouldHaveLeftPill(modifiers, day) && theme.radii.pill};
80
+ border-bottom-left-radius: ${shouldHaveLeftPill(modifiers, day) && theme.radii.pill};
81
+ border-top-right-radius: ${shouldHaveRightPill(modifiers, day) && theme.radii.pill};
82
+ border-bottom-right-radius: ${shouldHaveRightPill(modifiers, day) && theme.radii.pill};
83
+ `;
84
+ }
85
+ if (isHoveredAndInRange(modifiers)) {
86
+ return import_styled_components.css`
87
+ margin: 0 ${theme.space[200]};
88
+ border-radius: ${theme.radii.pill};
89
+ border: 1px solid ${theme.colors.container.border.selected};
90
+ `;
91
+ } else if (isOutOfRange(modifiers)) {
92
+ return import_styled_components.css`
93
+ color: ${theme.colors.text.subtext};
94
+ ${import_seeds_react_mixins.disabled};
95
+ `;
96
+ }
97
+ }};
98
+ `;
99
+ var ReactDatesCssOverrides = import_styled_components.createGlobalStyle`
100
+ .DayPicker {
101
+ box-sizing: content-box;
102
+ font-weight: ${({ theme }) => theme.fontWeights.normal};
103
+ font-family: ${(props) => props.theme.fontFamily};
104
+
105
+ /* override react-dates height to better reflect how tall the component actually is */
106
+ /* adding margin/padding will be more truer to our seeds system because the height */
107
+ /* of the calendar adds an extra row of padding if we do not override it */
108
+ &_transitionContainer {
109
+ /* need !important because react-dates sets height on the element itself */
110
+ height: 228px !important;
111
+ }
112
+
113
+ &_weekHeader {
114
+ color: ${({ theme }) => theme.colors.text.headline};
115
+ border-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};
116
+
117
+ /* Magic number to match position of .CalendarMonth_caption */
118
+ top: 26px;
119
+
120
+ /* Magic number to make the bottom border line stretch the full width */
121
+ width: 230px;
122
+
123
+ &_ul {
124
+ /* Magic number to line up day name headings over the correct numbers */
125
+ padding-left: 10px;
126
+ }
127
+ }
128
+
129
+ &_weekHeaders__horizontal {
130
+ margin-left: 0
131
+ }
132
+
133
+ &_weekHeader_li {
134
+ ${({ theme }) => theme.typography[200]}
135
+ color: ${({ theme }) => theme.colors.text.subtext};
136
+ font-weight: ${({ theme }) => theme.fontWeights.semibold};
137
+ margin: 0;
138
+ }
139
+
140
+ &__horizontal {
141
+ box-shadow: none;
142
+ background: ${({ theme }) => theme.colors.container.background.base};
143
+ }
144
+ }
145
+
146
+ .CalendarDay {
147
+ background-color: transparent;
148
+
149
+ &__selected, &__selected_span, &:hover {
150
+ background-color: transparent;
151
+ }
152
+
153
+ &__default {
154
+ color: ${({ theme }) => theme.colors.text.body};
155
+ }
156
+ &__default,
157
+ &__default:hover {
158
+ border: none;
159
+ color: ${({ theme }) => theme.colors.text.body};
160
+ }
161
+ }
162
+
163
+ .CalendarMonth {
164
+ ${({ theme }) => theme.typography[200]}
165
+ background: ${({ theme }) => theme.colors.container.background.base};
166
+
167
+ /* spacing between visible months and months off canvas */
168
+ padding: 0 15px;
169
+
170
+ &_caption {
171
+ ${({ theme }) => theme.typography[200]}
172
+ color: ${({ theme }) => theme.colors.text.headline};
173
+ padding-top: 0;
174
+ background: ${({ theme }) => theme.colors.container.background.base};
175
+
176
+ strong {
177
+ font-weight: ${({ theme }) => theme.fontWeights.semibold};
178
+ }
179
+
180
+ }
181
+ &_table {
182
+ line-height: 21.333px;
183
+ tr {
184
+ vertical-align: middle;
185
+ }
186
+ td {
187
+ padding: 0;
188
+ border-bottom: none;
189
+ }
190
+ }
191
+ }
192
+
193
+ .CalendarMonthGrid {
194
+ background: ${({ theme }) => theme.colors.container.background.base};
195
+ }
196
+
197
+ /* Left and Right Arrow Buttons to navigate months */
198
+ .DayPickerNavigation_button__horizontal {
199
+ color: ${({ theme }) => theme.colors.button.pill.text.base};
200
+ top: -4px;
201
+ padding: 7px 8px;
202
+ position: absolute;
203
+ line-height: 0.78;
204
+ border-radius: 9999px;
205
+ border: none;
206
+ background: ${({ theme }) => theme.colors.button.pill.background.base};
207
+
208
+ &:nth-child(1) {
209
+ left: 22px;
210
+ }
211
+ &:nth-child(2) {
212
+ right: 22px;
213
+ }
214
+
215
+ &:hover {
216
+ background: ${({ theme }) => theme.colors.button.pill.background.hover};
217
+ }
218
+ }
219
+ `;
220
+
221
+ // src/common.tsx
222
+ var import_initialize = require("react-dates/initialize");
223
+ var import_datepicker = require("react-dates/lib/css/_datepicker.css");
224
+ var import_react = require("react");
225
+ var import_seeds_react_icon = __toESM(require("@sproutsocial/seeds-react-icon"));
226
+ var import_jsx_runtime = require("react/jsx-runtime");
227
+ var iconNames = {
228
+ left: "arrow-left-solid",
229
+ right: "arrow-right-solid"
230
+ };
231
+ var CalendarNavButton = ({
232
+ type
233
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_seeds_react_icon.default, { size: "mini", name: iconNames[type], "aria-hidden": true });
234
+ var commonDatePickerProps = {
235
+ hideKeyboardShortcutsPanel: true,
236
+ daySize: 30,
237
+ navPrev: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CalendarNavButton, { type: "left" }),
238
+ navNext: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CalendarNavButton, { type: "right" }),
239
+ renderDayContents: (day, modifiers) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CalendarDay, { day, modifiers, children: day.format("D") }),
240
+ initialVisibleMonth: null
241
+ };
242
+ var formatDateAsCalendarHeader = (date) => date.format("MMMM YYYY");
243
+ var getVisibleMonths = (initialMonth, numberOfMonths) => {
244
+ const months = [initialMonth];
245
+ for (let i = 1; i < numberOfMonths; i++) {
246
+ months.push(initialMonth.clone().add(i, "month"));
247
+ }
248
+ return months;
249
+ };
250
+ var DefaultSetStatusText = (dates) => dates.map(formatDateAsCalendarHeader).join(", ");
251
+
252
+ // src/SingleDatePicker/SingleDatePicker.tsx
253
+ var import_seeds_react_visually_hidden = require("@sproutsocial/seeds-react-visually-hidden");
254
+ var import_jsx_runtime2 = require("react/jsx-runtime");
255
+ var noop = () => {
256
+ };
257
+ var SingleDatePicker = ({
258
+ onDateChange,
259
+ setStatusText = DefaultSetStatusText,
260
+ date = null,
261
+ focused = false,
262
+ onFocusChange = noop,
263
+ initialVisibleMonth,
264
+ numberOfMonths = 1,
265
+ onBlur,
266
+ ...rest
267
+ }) => {
268
+ const [statusText, updateStatusText] = (0, import_react2.useState)(
269
+ () => setStatusText(
270
+ getVisibleMonths(
271
+ (0, import_moment2.default)(initialVisibleMonth?.() || date || void 0),
272
+ numberOfMonths
273
+ )
274
+ )
275
+ );
276
+ const handleMonthClick = (0, import_react2.useCallback)(
277
+ // @ts-ignore unknown types
278
+ (date2) => {
279
+ updateStatusText(setStatusText(getVisibleMonths(date2, numberOfMonths)));
280
+ },
281
+ [numberOfMonths, setStatusText]
282
+ );
283
+ const wrappedOnBlur = (0, import_react2.useCallback)(
284
+ (event) => {
285
+ onFocusChange?.({ focused: false });
286
+ onBlur?.(event);
287
+ },
288
+ [onBlur, onFocusChange]
289
+ );
290
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
291
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReactDatesCssOverrides, {}),
292
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { role: "status", children: statusText }) }),
293
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
294
+ import_DayPickerSingleDateController.default,
295
+ {
296
+ ...commonDatePickerProps,
297
+ date,
298
+ numberOfMonths,
299
+ onDateChange,
300
+ initialVisibleMonth: initialVisibleMonth || null,
301
+ focused,
302
+ onBlur: wrappedOnBlur,
303
+ onFocusChange,
304
+ onPrevMonthClick: handleMonthClick,
305
+ onNextMonthClick: handleMonthClick,
306
+ ...rest
307
+ }
308
+ )
309
+ ] });
310
+ };
311
+ var SingleDatePicker_default = import_react2.default.memo(SingleDatePicker);
312
+
313
+ // src/SingleDatePicker/StatefulSingleDatePicker.tsx
314
+ var import_react3 = require("react");
315
+ var import_jsx_runtime3 = require("react/jsx-runtime");
316
+ var StatefulSingleDatePicker = ({
317
+ date,
318
+ onDateChange,
319
+ ...rest
320
+ }) => {
321
+ const [stateDate, setDate] = (0, import_react3.useState)(date);
322
+ const handleDateChange = (date2) => {
323
+ onDateChange && onDateChange(date2);
324
+ setDate(date2);
325
+ };
326
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
327
+ SingleDatePicker_default,
328
+ {
329
+ date: stateDate,
330
+ onDateChange: handleDateChange,
331
+ ...rest
332
+ }
333
+ );
334
+ };
335
+
336
+ // src/DateRangePicker/DateRangePicker.tsx
337
+ var import_react4 = require("react");
338
+ var import_moment3 = __toESM(require("moment"));
339
+ var import_DayPickerRangeController = __toESM(require("react-dates/lib/components/DayPickerRangeController"));
340
+ var import_seeds_react_visually_hidden2 = require("@sproutsocial/seeds-react-visually-hidden");
341
+ var import_jsx_runtime4 = require("react/jsx-runtime");
342
+ var DateRangePicker = ({
343
+ startDate = null,
344
+ endDate = null,
345
+ onDatesChange,
346
+ setStatusText = DefaultSetStatusText,
347
+ initialVisibleMonth,
348
+ numberOfMonths = 2,
349
+ onFocusChange,
350
+ onBlur,
351
+ focusedInput,
352
+ ...rest
353
+ }) => {
354
+ const [statusText, updateStatusText] = (0, import_react4.useState)(
355
+ () => setStatusText(
356
+ getVisibleMonths(
357
+ (0, import_moment3.default)(initialVisibleMonth?.() ?? startDate ?? void 0),
358
+ numberOfMonths
359
+ )
360
+ )
361
+ );
362
+ const handleMonthClick = (0, import_react4.useCallback)(
363
+ (month) => {
364
+ updateStatusText(setStatusText(getVisibleMonths(month, numberOfMonths)));
365
+ },
366
+ [numberOfMonths, setStatusText]
367
+ );
368
+ const wrappedOnBlur = (0, import_react4.useCallback)(
369
+ (event) => {
370
+ if (!event) {
371
+ return;
372
+ }
373
+ onFocusChange?.(null);
374
+ onBlur?.(event);
375
+ },
376
+ [onBlur, onFocusChange]
377
+ );
378
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
379
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReactDatesCssOverrides, {}),
380
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_visually_hidden2.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "status", children: statusText }) }),
381
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
382
+ import_DayPickerRangeController.default,
383
+ {
384
+ ...commonDatePickerProps,
385
+ startDate,
386
+ endDate,
387
+ onDatesChange,
388
+ numberOfMonths,
389
+ initialVisibleMonth: initialVisibleMonth || null,
390
+ focusedInput,
391
+ isFocused: focusedInput !== null,
392
+ onBlur: wrappedOnBlur,
393
+ onFocusChange,
394
+ onPrevMonthClick: handleMonthClick,
395
+ onNextMonthClick: handleMonthClick,
396
+ ...rest
397
+ }
398
+ )
399
+ ] });
400
+ };
401
+ var DateRangePicker_default = DateRangePicker;
402
+
403
+ // src/DateRangePicker/StatefulDateRangePicker.tsx
404
+ var import_react5 = __toESM(require("react"));
405
+ var import_constants = require("react-dates/constants");
406
+ var import_jsx_runtime5 = require("react/jsx-runtime");
407
+ var StatefulDateRangePicker = ({
408
+ startDate,
409
+ endDate,
410
+ onDatesChange,
411
+ onFocusChange,
412
+ ...rest
413
+ }) => {
414
+ const [dates, setDate] = (0, import_react5.useState)({
415
+ startDate,
416
+ endDate
417
+ });
418
+ const [focusedInput, setFocusedInput] = import_react5.default.useState(import_constants.START_DATE);
419
+ const handleDatesChange = (nextDates) => {
420
+ onDatesChange && onDatesChange(nextDates);
421
+ setDate(nextDates);
422
+ };
423
+ const handleFocusChange = (nextFocusedInput) => {
424
+ onFocusChange && onFocusChange(nextFocusedInput);
425
+ setFocusedInput(
426
+ // null means that we've selected an end date. we want to go back to START_DATE
427
+ // so the user can modify their selection. if focusedInput === null then it won't
428
+ // respond to click or keyboard events
429
+ nextFocusedInput === null ? import_constants.START_DATE : nextFocusedInput
430
+ );
431
+ };
432
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
433
+ DateRangePicker_default,
434
+ {
435
+ startDate: dates.startDate,
436
+ endDate: dates.endDate,
437
+ focusedInput,
438
+ onDatesChange: handleDatesChange,
439
+ onFocusChange: handleFocusChange,
440
+ ...rest
441
+ }
442
+ );
443
+ };
444
+ // Annotate the CommonJS export names for ESM import in node:
445
+ 0 && (module.exports = {
446
+ DateRangePicker,
447
+ SingleDatePicker,
448
+ StatefulDateRangePicker,
449
+ StatefulSingleDatePicker
450
+ });
451
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/SingleDatePicker/SingleDatePicker.tsx","../src/styles.ts","../src/common.tsx","../src/SingleDatePicker/StatefulSingleDatePicker.tsx","../src/DateRangePicker/DateRangePicker.tsx","../src/DateRangePicker/StatefulDateRangePicker.tsx"],"sourcesContent":["export * from \"./SingleDatePicker\";\nexport * from \"./DateRangePicker\";\n","import React, { useCallback, useState } from \"react\";\nimport moment from \"moment\";\nimport DayPickerSingleDateController from \"react-dates/lib/components/DayPickerSingleDateController\";\nimport { ReactDatesCssOverrides } from \"../styles\";\nimport {\n commonDatePickerProps,\n DefaultSetStatusText,\n getVisibleMonths,\n} from \"../common\";\nimport type { TypeSingleDatePickerProps } from \"./SingleDatePickerTypes\";\nimport { VisuallyHidden } from \"@sproutsocial/seeds-react-visually-hidden\";\n\nconst noop = () => {};\n\nconst SingleDatePicker = ({\n onDateChange,\n setStatusText = DefaultSetStatusText,\n date = null,\n focused = false,\n onFocusChange = noop,\n initialVisibleMonth,\n numberOfMonths = 1,\n onBlur,\n ...rest\n}: TypeSingleDatePickerProps) => {\n const [statusText, updateStatusText] = useState(() =>\n setStatusText(\n getVisibleMonths(\n moment(initialVisibleMonth?.() || date || undefined),\n numberOfMonths\n )\n )\n );\n\n const handleMonthClick = useCallback(\n // @ts-ignore unknown types\n (date) => {\n updateStatusText(setStatusText(getVisibleMonths(date, numberOfMonths)));\n },\n [numberOfMonths, setStatusText]\n );\n const wrappedOnBlur = useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n onFocusChange?.({ focused: false });\n onBlur?.(event);\n },\n [onBlur, onFocusChange]\n );\n\n return (\n <>\n <ReactDatesCssOverrides />\n <VisuallyHidden>\n <div role=\"status\">{statusText}</div>\n </VisuallyHidden>\n <DayPickerSingleDateController\n {...commonDatePickerProps}\n date={date}\n numberOfMonths={numberOfMonths}\n onDateChange={onDateChange}\n initialVisibleMonth={initialVisibleMonth || null}\n focused={focused}\n onBlur={wrappedOnBlur}\n onFocusChange={onFocusChange}\n onPrevMonthClick={handleMonthClick}\n onNextMonthClick={handleMonthClick}\n {...rest}\n />\n </>\n );\n};\n\nexport default React.memo<TypeSingleDatePickerProps>(SingleDatePicker);\n","import styled, { createGlobalStyle, css } from \"styled-components\";\nimport moment from \"moment\";\nimport type { ModifiersShape } from \"react-dates\";\nimport { disabled } from \"@sproutsocial/seeds-react-mixins\";\nimport Box from \"@sproutsocial/seeds-react-box\";\n\n/*\n * Partial list of modifiers given to renderDayContents by airbnb/react-dates. There may be more.\n *\n * today, blocked, blocked-calendar, blocked-out-of-range, highlighted-calendar, valid,\n * selected, selected-start, selected-end, blocked-minimum-nights, selected-span, last-in-range,\n * hovered, hovered-span, hovered-offset, after-hovered-start, first-day-of-week, last-day-of-week,\n * hovered-start-first-possible-end, hovered-start-blocked-minimum-nights, before-hovered-end,\n * no-selected-start-before-selected-end, selected-start-in-hovered-span, selected-start-no-selected-end,\n * selected-end-no-selected-start\n *\n */\nconst isSelected = (modifiers: ModifiersShape) =>\n modifiers.has(\"selected-span\") ||\n modifiers.has(\"selected\") ||\n modifiers.has(\"selected-start\") ||\n modifiers.has(\"selected-end\") ||\n modifiers.has(\"hovered-span\") ||\n modifiers.has(\"after-hovered-start\");\n\nconst isOutOfRange = (modifiers: ModifiersShape) =>\n modifiers.has(\"blocked-out-of-range\");\n\nconst isHoveredAndInRange = (modifiers: ModifiersShape) =>\n modifiers.has(\"hovered\") && !modifiers.has(\"blocked-out-of-range\");\n\nconst shouldHaveLeftPill = (modifiers: ModifiersShape, day: moment.Moment) => {\n if (!isSelected(modifiers)) {\n return false;\n }\n\n if (\n modifiers.has(\"selected\") ||\n modifiers.has(\"selected-start\") ||\n modifiers.has(\"first-day-of-week\") ||\n day.isSame(moment(day).startOf(\"month\"), \"day\")\n ) {\n return true;\n }\n\n return false;\n};\n\nconst shouldHaveRightPill = (modifiers: ModifiersShape, day: moment.Moment) => {\n if (!isSelected(modifiers)) {\n return false;\n }\n\n if (\n modifiers.has(\"selected\") ||\n modifiers.has(\"selected-end\") ||\n modifiers.has(\"last-day-of-week\") ||\n day.isSame(moment(day).endOf(\"month\"), \"day\")\n ) {\n return true;\n }\n\n return false;\n};\n\nexport const CalendarDay = styled(Box)<{\n modifiers: ModifiersShape;\n day: moment.Moment;\n}>`\n ${({ modifiers, day, theme }) => {\n if (isSelected(modifiers)) {\n return css`\n background-color: ${theme.colors.container.background.selected};\n color: ${theme.colors.text.inverse};\n margin-left: ${shouldHaveLeftPill(modifiers, day) && theme.space[200]};\n margin-right: ${shouldHaveRightPill(modifiers, day) &&\n theme.space[200]};\n border-top-left-radius: ${shouldHaveLeftPill(modifiers, day) &&\n theme.radii.pill};\n border-bottom-left-radius: ${shouldHaveLeftPill(modifiers, day) &&\n theme.radii.pill};\n border-top-right-radius: ${shouldHaveRightPill(modifiers, day) &&\n theme.radii.pill};\n border-bottom-right-radius: ${shouldHaveRightPill(modifiers, day) &&\n theme.radii.pill};\n `;\n }\n\n if (isHoveredAndInRange(modifiers)) {\n return css`\n margin: 0 ${theme.space[200]};\n border-radius: ${theme.radii.pill};\n border: 1px solid ${theme.colors.container.border.selected};\n `;\n } else if (isOutOfRange(modifiers)) {\n return css`\n color: ${theme.colors.text.subtext};\n ${disabled};\n `;\n }\n }};\n`;\n\nexport const ReactDatesCssOverrides = createGlobalStyle`\n\t.DayPicker {\n\t\tbox-sizing: content-box;\n\t\tfont-weight: ${({ theme }) => theme.fontWeights.normal};\n\t\tfont-family: ${(props) => props.theme.fontFamily};\n\n\t\t/* override react-dates height to better reflect how tall the component actually is */\n\t\t/* adding margin/padding will be more truer to our seeds system because the height */\n\t\t/* of the calendar adds an extra row of padding if we do not override it */\n\t\t&_transitionContainer {\n\t\t\t/* need !important because react-dates sets height on the element itself */\n\t\t\theight: 228px !important;\n\t\t}\n\n\t\t&_weekHeader {\n\t\t\tcolor: ${({ theme }) => theme.colors.text.headline};\n\t\t\tborder-bottom: 1px solid ${({ theme }) => theme.colors.container.border.base};\n\n \t\t\t/* Magic number to match position of .CalendarMonth_caption */\n\t\t\ttop: 26px;\n\n\t\t\t/* Magic number to make the bottom border line stretch the full width */\n\t\t\twidth: 230px;\n\n\t\t\t&_ul {\n \t\t\t\t/* Magic number to line up day name headings over the correct numbers */\n\t\t\t\tpadding-left: 10px;\n\t\t\t}\n\t\t}\n\n\t\t&_weekHeaders__horizontal {\n\t\t\tmargin-left: 0\n\t\t}\n\n\t\t&_weekHeader_li {\n\t\t\t${({ theme }) => theme.typography[200]}\n\t\t\tcolor: ${({ theme }) => theme.colors.text.subtext};\n\t\t\tfont-weight: ${({ theme }) => theme.fontWeights.semibold};\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t&__horizontal {\n\t\t\tbox-shadow: none;\n\t\t\tbackground: ${({ theme }) => theme.colors.container.background.base};\n\t\t}\n\t}\n\n .CalendarDay {\n\t\tbackground-color: transparent;\n\n &__selected, &__selected_span, &:hover {\n background-color: transparent;\n\t\t}\n\n\t\t&__default {\n\t\t\tcolor: ${({ theme }) => theme.colors.text.body};\n\t\t}\n\t\t&__default,\n\t\t&__default:hover {\n\t\t\tborder: none;\n\t\t\tcolor: ${({ theme }) => theme.colors.text.body};\n\t\t}\n\t}\n\n .CalendarMonth {\n\t\t${({ theme }) => theme.typography[200]}\n\t\tbackground: ${({ theme }) => theme.colors.container.background.base};\n\n \t\t/* spacing between visible months and months off canvas */\n\t\tpadding: 0 15px;\n\n\t\t&_caption {\n\t\t\t${({ theme }) => theme.typography[200]}\n\t\t\tcolor: ${({ theme }) => theme.colors.text.headline};\n\t\t\tpadding-top: 0;\n\t\t\tbackground: ${({ theme }) => theme.colors.container.background.base};\n\n\t\t\tstrong {\n\t\t\t\tfont-weight: ${({ theme }) => theme.fontWeights.semibold};\n\t\t\t}\n\n\t\t}\n\t\t&_table {\n\t\t\tline-height: 21.333px;\n\t\t\ttr {\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\ttd {\n\t\t\t\tpadding: 0;\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t.CalendarMonthGrid {\n\t\tbackground: ${({ theme }) => theme.colors.container.background.base};\n\t}\n\n\t/* Left and Right Arrow Buttons to navigate months */\n\t.DayPickerNavigation_button__horizontal {\n\t\tcolor: ${({ theme }) => theme.colors.button.pill.text.base};\n\t\ttop: -4px;\n\t\tpadding: 7px 8px;\n\t\tposition: absolute;\n\t\tline-height: 0.78;\n\t\tborder-radius: 9999px;\n\t\tborder: none;\n\t\tbackground: ${({ theme }) => theme.colors.button.pill.background.base};\n\n\t\t&:nth-child(1) {\n\t\t\tleft: 22px;\n\t\t}\n\t\t&:nth-child(2) {\n\t\t\tright: 22px;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: ${({ theme }) => theme.colors.button.pill.background.hover};\n\t\t}\n\t}\n`;\n","import \"react-dates/initialize\";\nimport \"react-dates/lib/css/_datepicker.css\";\nimport type { Moment } from \"moment\";\nimport React from \"react\";\nimport Icon, { type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { CalendarDay } from \"./styles\";\nimport type { TypeCommonDatePickerProps } from \"./types\";\n\ntype TypeCalendarNavButtonType = \"left\" | \"right\";\n\nconst iconNames: { [key in TypeCalendarNavButtonType]: TypeIconName } = {\n left: \"arrow-left-solid\",\n right: \"arrow-right-solid\",\n};\n\nexport const CalendarNavButton = ({\n type,\n}: {\n type: TypeCalendarNavButtonType;\n}) => <Icon size=\"mini\" name={iconNames[type]} aria-hidden />;\n\nexport const commonDatePickerProps: TypeCommonDatePickerProps = {\n hideKeyboardShortcutsPanel: true,\n daySize: 30,\n navPrev: <CalendarNavButton type=\"left\" />,\n navNext: <CalendarNavButton type=\"right\" />,\n renderDayContents: (day, modifiers) => (\n <CalendarDay day={day} modifiers={modifiers}>\n {day.format(\"D\")}\n </CalendarDay>\n ),\n initialVisibleMonth: null,\n};\n// Testing utilities\n\nexport const formatDateAsCalendarHeader = (date: Moment): string =>\n date.format(\"MMMM YYYY\");\n\nexport const formatDateAsCalendarDay = (date: Moment): string =>\n date.format(\"dddd, MMMM D, YYYY\");\n\nexport const getVisibleMonthWithReactDatesInternalApi = (\n container: HTMLElement\n): string =>\n container.querySelector(\"[data-visible=true] strong\")?.textContent ?? \"\";\n\n// Receives a single Moment and returns an array of Moments, one for each currently visible month.\n// @ts-ignore unknown types\nexport const getVisibleMonths = (initialMonth, numberOfMonths) => {\n const months = [initialMonth];\n for (let i = 1; i < numberOfMonths; i++) {\n months.push(initialMonth.clone().add(i, \"month\"));\n }\n return months;\n};\n\n// Default setStatusText prop for both SingleDatePicker and DateRangePicker\n// @ts-ignore unknown types\nexport const DefaultSetStatusText = (dates) =>\n dates.map(formatDateAsCalendarHeader).join(\", \");\n","import React, { useState } from \"react\";\nimport type { TypeStatefulSingleDatePickerProps } from \"./SingleDatePickerTypes\";\nimport SingleDatePicker from \"./SingleDatePicker\";\n\nexport const StatefulSingleDatePicker = ({\n date,\n onDateChange,\n ...rest\n}: TypeStatefulSingleDatePickerProps) => {\n const [stateDate, setDate] = useState(date);\n\n // @ts-ignore unknown types\n const handleDateChange = (date) => {\n onDateChange && onDateChange(date);\n setDate(date);\n };\n\n return (\n <SingleDatePicker\n date={stateDate}\n onDateChange={handleDateChange}\n {...rest}\n />\n );\n};\n","import React, { useCallback, useState, type KeyboardEvent } from \"react\";\nimport moment from \"moment\";\nimport DayPickerRangeController from \"react-dates/lib/components/DayPickerRangeController\";\nimport { ReactDatesCssOverrides } from \"../styles\";\nimport {\n commonDatePickerProps,\n DefaultSetStatusText,\n getVisibleMonths,\n} from \"../common\";\nimport { VisuallyHidden } from \"@sproutsocial/seeds-react-visually-hidden\";\nimport type { TypeDateRangePickerProps } from \"./DateRangePickerTypes\";\n\nconst DateRangePicker = ({\n startDate = null,\n endDate = null,\n onDatesChange,\n setStatusText = DefaultSetStatusText,\n initialVisibleMonth,\n numberOfMonths = 2,\n onFocusChange,\n onBlur,\n focusedInput,\n ...rest\n}: TypeDateRangePickerProps) => {\n const [statusText, updateStatusText] = useState(() =>\n setStatusText(\n getVisibleMonths(\n moment(initialVisibleMonth?.() ?? startDate ?? undefined),\n numberOfMonths\n )\n )\n );\n interface HandleMonthClick {\n (month: moment.Moment): void;\n }\n\n const handleMonthClick: HandleMonthClick = useCallback(\n (month) => {\n updateStatusText(setStatusText(getVisibleMonths(month, numberOfMonths)));\n },\n [numberOfMonths, setStatusText]\n );\n const wrappedOnBlur = useCallback<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (event: undefined | KeyboardEvent<HTMLDivElement>) => void\n >(\n (event) => {\n // for some reason onBlur is called with no event on day selection 🤷\n if (!event) {\n return;\n }\n onFocusChange?.(null);\n onBlur?.(event);\n },\n [onBlur, onFocusChange]\n );\n\n return (\n <>\n <ReactDatesCssOverrides />\n <VisuallyHidden>\n <div role=\"status\">{statusText}</div>\n </VisuallyHidden>\n <DayPickerRangeController\n {...commonDatePickerProps}\n startDate={startDate}\n endDate={endDate}\n onDatesChange={onDatesChange}\n numberOfMonths={numberOfMonths}\n initialVisibleMonth={initialVisibleMonth || null}\n focusedInput={focusedInput}\n isFocused={focusedInput !== null}\n onBlur={wrappedOnBlur}\n onFocusChange={onFocusChange}\n onPrevMonthClick={handleMonthClick}\n onNextMonthClick={handleMonthClick}\n {...rest}\n />\n </>\n );\n};\n\nexport default DateRangePicker;\n","import React, { useState } from \"react\";\n// @ts-ignore unknown types\nimport { START_DATE } from \"react-dates/constants\";\nimport type { TypeStatefulDateRangePickerProps } from \"./DateRangePickerTypes\";\nimport DateRangePicker from \"./DateRangePicker\";\n\nexport const StatefulDateRangePicker = ({\n startDate,\n endDate,\n onDatesChange,\n onFocusChange,\n ...rest\n}: TypeStatefulDateRangePickerProps) => {\n const [dates, setDate] = useState({\n startDate,\n endDate,\n });\n const [focusedInput, setFocusedInput] = React.useState(START_DATE);\n\n // @ts-ignore unknown types\n const handleDatesChange = (nextDates) => {\n onDatesChange && onDatesChange(nextDates);\n setDate(nextDates);\n };\n\n // @ts-ignore unknown types\n const handleFocusChange = (nextFocusedInput) => {\n onFocusChange && onFocusChange(nextFocusedInput);\n setFocusedInput(\n // null means that we've selected an end date. we want to go back to START_DATE\n // so the user can modify their selection. if focusedInput === null then it won't\n // respond to click or keyboard events\n nextFocusedInput === null ? START_DATE : nextFocusedInput\n );\n };\n\n return (\n <DateRangePicker\n startDate={dates.startDate}\n endDate={dates.endDate}\n focusedInput={focusedInput}\n onDatesChange={handleDatesChange}\n onFocusChange={handleFocusChange}\n {...rest}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6C;AAC7C,IAAAC,iBAAmB;AACnB,2CAA0C;;;ACF1C,+BAA+C;AAC/C,oBAAmB;AAEnB,gCAAyB;AACzB,6BAAgB;AAahB,IAAM,aAAa,CAAC,cAClB,UAAU,IAAI,eAAe,KAC7B,UAAU,IAAI,UAAU,KACxB,UAAU,IAAI,gBAAgB,KAC9B,UAAU,IAAI,cAAc,KAC5B,UAAU,IAAI,cAAc,KAC5B,UAAU,IAAI,qBAAqB;AAErC,IAAM,eAAe,CAAC,cACpB,UAAU,IAAI,sBAAsB;AAEtC,IAAM,sBAAsB,CAAC,cAC3B,UAAU,IAAI,SAAS,KAAK,CAAC,UAAU,IAAI,sBAAsB;AAEnE,IAAM,qBAAqB,CAAC,WAA2B,QAAuB;AAC5E,MAAI,CAAC,WAAW,SAAS,GAAG;AAC1B,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AAAA,IAC3C;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM;AAAA,MACjB,SAAS,MAAM;AAAA,MACf;AAAA,MACA,eAAe;AAAA,MACf,eAAe;AAAA,MACd,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["import_react","import_moment","moment","styled","Box","Icon","import_jsx_runtime","moment","date","DayPickerSingleDateController","React","import_react","import_jsx_runtime","date","import_react","import_moment","import_seeds_react_visually_hidden","import_jsx_runtime","moment","DayPickerRangeController","import_react","import_jsx_runtime","React"]}
package/jest.config.js ADDED
@@ -0,0 +1,9 @@
1
+ const baseConfig = require("@sproutsocial/seeds-testing");
2
+
3
+ /** * @type {import('jest').Config} */
4
+ const config = {
5
+ ...baseConfig,
6
+ displayName: "seeds-react-datepicker",
7
+ };
8
+
9
+ module.exports = config;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@sproutsocial/seeds-react-datepicker",
3
+ "version": "1.0.0",
4
+ "description": "Seeds React Datepicker",
5
+ "author": "Sprout Social, Inc.",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "module": "dist/esm/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "tsup --dts",
12
+ "build:debug": "tsup --dts --metafile",
13
+ "dev": "tsup --watch --dts",
14
+ "clean": "rm -rf .turbo dist",
15
+ "clean:modules": "rm -rf node_modules",
16
+ "typecheck": "tsc --noEmit",
17
+ "test": "jest",
18
+ "test:watch": "jest --watch --coverage=false"
19
+ },
20
+ "dependencies": {
21
+ "@sproutsocial/seeds-react-theme": "*",
22
+ "@sproutsocial/seeds-react-system-props": "*",
23
+ "@sproutsocial/seeds-react-visually-hidden": "*",
24
+ "@sproutsocial/seeds-react-icon": "*",
25
+ "@sproutsocial/seeds-react-box": "*",
26
+ "@sproutsocial/seeds-react-mixins": "*"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^18.0.0",
30
+ "@types/styled-components": "^5.1.26",
31
+ "@sproutsocial/eslint-config-seeds": "*",
32
+ "react": "^18.0.0",
33
+ "styled-components": "^5.2.3",
34
+ "tsup": "^8.0.2",
35
+ "typescript": "^5.6.2",
36
+ "@sproutsocial/seeds-tsconfig": "*",
37
+ "@sproutsocial/seeds-testing": "*",
38
+ "@sproutsocial/seeds-react-testing-library": "*",
39
+ "react-dates": "^21.8.0",
40
+ "@types/react-dates": "^21.8.3",
41
+ "moment": "^2.29.4",
42
+ "@sproutsocial/seeds-react-button": "*",
43
+ "@sproutsocial/seeds-react-popout": "*"
44
+ },
45
+ "peerDependencies": {
46
+ "styled-components": "^5.2.3",
47
+ "react-dates": "^21.8.0",
48
+ "moment": "^2.29.4"
49
+ },
50
+ "engines": {
51
+ "node": ">=18"
52
+ }
53
+ }