@cocso-ui/react 1.10.1 → 1.11.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.
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
+
5
+ var css_248z = "@layer components{.year-month-view-module_title__xCQjI{align-items:center;background:none;border:0;border-radius:var(--cocso-radius-2);color:inherit;cursor:pointer;display:inline-flex;gap:var(--cocso-spacing-1);margin-inline-start:calc(var(--cocso-spacing-2)*-1);padding-block:var(--cocso-spacing-1);padding-inline:var(--cocso-spacing-2)}.year-month-view-module_monthCell__Tju2y:focus-visible,.year-month-view-module_title__xCQjI:focus-visible{outline:2px solid var(--cocso-color-focus-ring);outline-offset:2px}.year-month-view-module_menu__WInY3{align-items:center;display:flex;gap:var(--cocso-spacing-3);justify-content:center}.year-month-view-module_arrow__oIH1T{height:24px;width:24px}.year-month-view-module_monthView__6rbV7{display:flex;flex-direction:column}.year-month-view-module_monthView__6rbV7[hidden]{display:none}.year-month-view-module_monthHeader__3ZcdS{align-items:center;display:flex;justify-content:space-between;padding-bottom:var(--cocso-spacing-5);width:100%}.year-month-view-module_monthGrid__jGMsB{display:grid;flex:1;gap:var(--cocso-spacing-3);grid-auto-rows:1fr;grid-template-columns:repeat(3,1fr)}.year-month-view-module_monthCell__Tju2y{align-items:center;background:none;border:0;border-radius:var(--cocso-radius-4);color:var(--cocso-color-text-primary);cursor:pointer;display:flex;font-size:var(--cocso-text-sm);font-weight:var(--cocso-font-weight-medium);justify-content:center;min-height:var(--cocso-spacing-14)}.year-month-view-module_monthCell__Tju2y[data-selected]{background-color:var(--cocso-color-interactive-primary);color:var(--cocso-color-text-on-primary);font-weight:var(--cocso-font-weight-semibold)}.year-month-view-module_monthCell__Tju2y:disabled{cursor:not-allowed;opacity:.4}@media (hover:hover) and (pointer:fine){.year-month-view-module_monthCell__Tju2y:not(:disabled):hover,.year-month-view-module_title__xCQjI:hover{background-color:var(--cocso-color-interactive-secondary)}.year-month-view-module_monthCell__Tju2y[data-selected]:not(:disabled):hover{background-color:var(--cocso-color-interactive-primary-hover)}}}";
6
+ var styles = {"title":"year-month-view-module_title__xCQjI","monthCell":"year-month-view-module_monthCell__Tju2y","menu":"year-month-view-module_menu__WInY3","arrow":"year-month-view-module_arrow__oIH1T","monthView":"year-month-view-module_monthView__6rbV7","monthHeader":"year-month-view-module_monthHeader__3ZcdS","monthGrid":"year-month-view-module_monthGrid__jGMsB"};
7
+ styleInject_es(css_248z);
8
+
9
+ module.exports = styles;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
4
 
5
- var css_248z = "@layer components{.skeleton-module_skeleton__fula5{background-color:var(--cocso-skeleton-bg-color);border-radius:var(--cocso-skeleton-border-radius);height:var(--cocso-skeleton-height);width:var(--cocso-skeleton-width,100%)}.skeleton-module_pulse__YLysm{animation:skeleton-module_skeleton-pulse__Yp45W var(--cocso-duration-decorative-slow) var(--cocso-easing-default) infinite}.skeleton-module_wave__GxWJ1{overflow:hidden;position:relative}.skeleton-module_wave__GxWJ1:after{animation:skeleton-module_skeleton-wave__zaVNu var(--cocso-duration-decorative-slow) var(--cocso-easing-default) infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:\"\";inset:0;position:absolute}@keyframes skeleton-module_skeleton-pulse__Yp45W{0%,to{opacity:1}50%{opacity:.4}}@keyframes skeleton-module_skeleton-wave__zaVNu{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}@media (prefers-reduced-motion:reduce){.skeleton-module_pulse__YLysm,.skeleton-module_wave__GxWJ1:after{animation:none}}}";
5
+ var css_248z = "@layer components{.skeleton-module_skeleton__fula5{--cocso-skeleton-edge-fade-size:min(var(--cocso-skeleton-edge-fade,12px),25%);background-color:var(--cocso-skeleton-bg-color);border-radius:var(--cocso-skeleton-border-radius);height:var(--cocso-skeleton-height);mask-composite:intersect;mask-image:linear-gradient(to right,transparent,#000 var(--cocso-skeleton-edge-fade-size),#000 calc(100% - var(--cocso-skeleton-edge-fade-size)),transparent),linear-gradient(to bottom,transparent,#000 var(--cocso-skeleton-edge-fade-size),#000 calc(100% - var(--cocso-skeleton-edge-fade-size)),transparent);width:var(--cocso-skeleton-width,100%)}.cocso-skeleton--variant-circular.skeleton-module_skeleton__fula5{mask-composite:add;mask-image:radial-gradient(closest-side,#000 calc(100% - var(--cocso-skeleton-edge-fade, 12px)),transparent)}.skeleton-module_pulse__YLysm{animation:skeleton-module_skeleton-pulse__Yp45W var(--cocso-duration-decorative-slow) var(--cocso-easing-default) infinite}.skeleton-module_wave__GxWJ1{overflow:hidden;position:relative}.skeleton-module_wave__GxWJ1:after{animation:skeleton-module_skeleton-wave__zaVNu var(--cocso-duration-decorative-slow) var(--cocso-easing-default) infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:\"\";inset:0;position:absolute}@keyframes skeleton-module_skeleton-pulse__Yp45W{0%,to{opacity:1}50%{opacity:.4}}@keyframes skeleton-module_skeleton-wave__zaVNu{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}@media (prefers-reduced-motion:reduce){.skeleton-module_pulse__YLysm,.skeleton-module_wave__GxWJ1:after{animation:none}}}";
6
6
  var styles = {"skeleton":"skeleton-module_skeleton__fula5","pulse":"skeleton-module_pulse__YLysm","wave":"skeleton-module_wave__GxWJ1"};
7
7
  styleInject_es(css_248z);
8
8
 
@@ -5,11 +5,11 @@ import { ko } from 'date-fns/locale';
5
5
  import { useState, useMemo } from 'react';
6
6
  import DatePicker from 'react-datepicker';
7
7
  import { cn } from '../../cn.mjs';
8
+ import { useYearMonthView, YearMonthView, CalendarTitle } from '../picker/year-month-view.mjs';
8
9
  import styles from './date-time-picker.module.css.mjs';
9
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
11
  import { Popover } from '../popover/popover.mjs';
11
12
  import { Button } from '../button/button.mjs';
12
- import { Typography } from '../typography/typography.mjs';
13
13
 
14
14
  const isSameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
15
15
  const atTime = (day, hours, minutes) => {
@@ -57,14 +57,24 @@ function DateTimePicker({
57
57
  const [draft, setDraft] = useState(null);
58
58
  const selected = value ?? draft;
59
59
 
60
- // The month to open on: `minDate`'s, if it is still ahead of today.
61
- const openToDate = useMemo(() => {
60
+ // The month to open on: the selection's, else `minDate`'s if it is still
61
+ // ahead of today, else today's.
62
+ const openingMonth = () => {
62
63
  if (selected) {
63
- return undefined;
64
+ return selected;
64
65
  }
65
66
  const now = new Date();
66
- return minDate && minDate.getTime() > now.getTime() ? minDate : undefined;
67
- }, [selected, minDate]);
67
+ return minDate && minDate.getTime() > now.getTime() ? minDate : now;
68
+ };
69
+ // The header opens a year-and-month grid, as in DayPicker — a date years
70
+ // away is a few clicks instead of one per month.
71
+ const calendar = useYearMonthView(openingMonth);
72
+ const handleOpenChange = next => {
73
+ setOpen(next);
74
+ if (next) {
75
+ calendar.reset(openingMonth());
76
+ }
77
+ };
68
78
 
69
79
  // A bound that only applies on the day it falls on: on any other day the
70
80
  // whole day is open. Without this a `minDate` of 3pm today would also cut
@@ -105,7 +115,7 @@ function DateTimePicker({
105
115
  ref: ref,
106
116
  ...props,
107
117
  children: /*#__PURE__*/jsxs(Popover, {
108
- onOpenChange: setOpen,
118
+ onOpenChange: handleOpenChange,
109
119
  open: open,
110
120
  children: [/*#__PURE__*/jsx(Popover.Trigger, {
111
121
  render: trigger ?? /*#__PURE__*/jsx(Button, {
@@ -116,81 +126,94 @@ function DateTimePicker({
116
126
  locale
117
127
  }) : "Select date and time"
118
128
  })
119
- }), /*#__PURE__*/jsx(Popover.Content, {
129
+ }), /*#__PURE__*/jsxs(Popover.Content, {
120
130
  "aria-label": "Select date and time",
121
131
  className: styles.content,
122
- children: /*#__PURE__*/jsx(DatePicker, {
123
- dateFormat: dateFormat,
124
- dayClassName: date => {
125
- const day = date.getDay();
126
- if (day === 0) {
127
- return styles.sunday;
128
- }
129
- if (day === 6) {
130
- return styles.saturday;
131
- }
132
- return "";
133
- },
134
- disabled: disabled,
135
- filterTime: filterTime
136
- // Six weeks always, for the same reason as DayPicker: a five-week month made
137
- // the panel shorter, and paging into a six-week one could flip it above the trigger.
138
- ,
139
- fixedHeight: true,
140
- inline: true,
132
+ children: [/*#__PURE__*/jsx(YearMonthView, {
133
+ currentMonthRef: calendar.currentMonthRef,
134
+ hidden: calendar.view !== "month",
141
135
  locale: locale,
142
136
  maxDate: maxDate,
143
- maxTime: bounds.maxTime,
144
137
  minDate: minDate,
145
- minTime: bounds.minTime,
146
- onChange: handleChange,
147
- openToDate: openToDate,
148
- renderCustomHeader: ({
149
- date,
150
- decreaseMonth,
151
- increaseMonth,
152
- prevMonthButtonDisabled,
153
- nextMonthButtonDisabled
154
- }) => /*#__PURE__*/jsxs(Fragment, {
155
- children: [/*#__PURE__*/jsx(Typography, {
156
- size: "small",
157
- type: "body",
158
- weight: "semibold",
159
- children: date.toLocaleDateString(locale.code ?? "ko-KR", {
160
- year: "numeric",
161
- month: "long"
162
- })
163
- }), /*#__PURE__*/jsxs("div", {
164
- className: styles.menu,
165
- children: [/*#__PURE__*/jsx(Button, {
166
- "aria-label": "Previous month",
167
- className: styles.arrow,
168
- disabled: prevMonthButtonDisabled,
169
- onClick: decreaseMonth,
170
- size: "x-small",
171
- svgOnly: true,
172
- type: "button",
173
- variant: "outline",
174
- children: /*#__PURE__*/jsx(ArrowIOSBackwardIcon, {})
175
- }), /*#__PURE__*/jsx(Button, {
176
- "aria-label": "Next month",
177
- className: styles.arrow,
178
- disabled: nextMonthButtonDisabled,
179
- onClick: increaseMonth,
180
- size: "x-small",
181
- svgOnly: true,
182
- type: "button",
183
- variant: "outline",
184
- children: /*#__PURE__*/jsx(ArrowIOSForwardIcon, {})
138
+ minHeight: calendar.dayViewHeight,
139
+ onBack: () => calendar.changeView("day"),
140
+ onPick: calendar.jumpTo,
141
+ onYearChange: calendar.setViewDate,
142
+ selected: selected,
143
+ viewDate: calendar.viewDate
144
+ }), /*#__PURE__*/jsx("div", {
145
+ hidden: calendar.view !== "day",
146
+ children: /*#__PURE__*/jsx(DatePicker, {
147
+ dateFormat: dateFormat,
148
+ dayClassName: date => {
149
+ const day = date.getDay();
150
+ if (day === 0) {
151
+ return styles.sunday;
152
+ }
153
+ if (day === 6) {
154
+ return styles.saturday;
155
+ }
156
+ return "";
157
+ },
158
+ disabled: disabled,
159
+ filterTime: filterTime
160
+ // Six weeks always, for the same reason as DayPicker: a five-week month made
161
+ // the panel shorter, and paging into a six-week one could flip it above the trigger.
162
+ ,
163
+ fixedHeight: true,
164
+ inline: true,
165
+ locale: locale,
166
+ maxDate: maxDate,
167
+ maxTime: bounds.maxTime,
168
+ minDate: minDate,
169
+ minTime: bounds.minTime,
170
+ onChange: handleChange,
171
+ onMonthChange: calendar.setViewDate,
172
+ openToDate: calendar.viewDate,
173
+ renderCustomHeader: ({
174
+ date,
175
+ decreaseMonth,
176
+ increaseMonth,
177
+ prevMonthButtonDisabled,
178
+ nextMonthButtonDisabled
179
+ }) => /*#__PURE__*/jsxs(Fragment, {
180
+ children: [/*#__PURE__*/jsx(CalendarTitle, {
181
+ date: date,
182
+ locale: locale,
183
+ onPress: panel => calendar.openMonths(date, panel),
184
+ ref: calendar.titleRef
185
+ }), /*#__PURE__*/jsxs("div", {
186
+ className: styles.menu,
187
+ children: [/*#__PURE__*/jsx(Button, {
188
+ "aria-label": "Previous month",
189
+ className: styles.arrow,
190
+ disabled: prevMonthButtonDisabled,
191
+ onClick: decreaseMonth,
192
+ size: "x-small",
193
+ svgOnly: true,
194
+ type: "button",
195
+ variant: "outline",
196
+ children: /*#__PURE__*/jsx(ArrowIOSBackwardIcon, {})
197
+ }), /*#__PURE__*/jsx(Button, {
198
+ "aria-label": "Next month",
199
+ className: styles.arrow,
200
+ disabled: nextMonthButtonDisabled,
201
+ onClick: increaseMonth,
202
+ size: "x-small",
203
+ svgOnly: true,
204
+ type: "button",
205
+ variant: "outline",
206
+ children: /*#__PURE__*/jsx(ArrowIOSForwardIcon, {})
207
+ })]
185
208
  })]
186
- })]
187
- }),
188
- selected: selected ?? undefined,
189
- showPopperArrow: false,
190
- showTimeSelect: true,
191
- timeCaption: timeCaption,
192
- timeIntervals: timeIntervals
193
- })
209
+ }),
210
+ selected: selected ?? undefined,
211
+ showPopperArrow: false,
212
+ showTimeSelect: true,
213
+ timeCaption: timeCaption,
214
+ timeIntervals: timeIntervals
215
+ }, calendar.calendarKey)
216
+ })]
194
217
  })]
195
218
  })
196
219
  });
@@ -1,19 +1,15 @@
1
1
  "use client";
2
- import { ArrowDropUpIcon, ArrowIOSBackwardIcon, ArrowIOSForwardIcon, ArrowDropDownIcon } from '@cocso-ui/react-icons';
3
- import { format, startOfMonth, endOfMonth } from 'date-fns';
2
+ import { ArrowIOSBackwardIcon, ArrowIOSForwardIcon } from '@cocso-ui/react-icons';
3
+ import { format } from 'date-fns';
4
4
  import { ko } from 'date-fns/locale';
5
- import { useState, useRef, useEffect } from 'react';
5
+ import { useState } from 'react';
6
6
  import DatePicker from 'react-datepicker';
7
7
  import { cn } from '../../cn.mjs';
8
+ import { useYearMonthView, YearMonthView, CalendarTitle } from '../picker/year-month-view.mjs';
8
9
  import styles from './day-picker.module.css.mjs';
9
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
11
  import { Popover } from '../popover/popover.mjs';
11
12
  import { Button } from '../button/button.mjs';
12
- import { Typography } from '../typography/typography.mjs';
13
-
14
- const MONTHS = Array.from({
15
- length: 12
16
- }, (_, month) => month);
17
13
 
18
14
  // Where the calendar opens: the value's month, else today's, pulled inside
19
15
  // the bounds so an empty picker with a future `minDate` does not open on a
@@ -47,54 +43,17 @@ function DayPicker({
47
43
  const [open, setOpen] = useState(false);
48
44
  // The header's month opens a year-and-month grid in the same panel, so a
49
45
  // date years away is a few clicks instead of one click per month.
50
- const [view, setView] = useState("day");
51
- const [viewDate, setViewDate] = useState(() => initialViewDate(value, minDate, maxDate));
52
- // Remounts the calendar after a jump. A live calendar follows its keyboard
53
- // cursor before `openToDate`, so a fresh mount is the reliable way to land
54
- // on the picked month.
55
- const [calendarKey, setCalendarKey] = useState(0);
56
- // The day grid's height, held by the month grid so the panel does not
57
- // shrink under the pointer — a panel opened above its trigger would jump.
58
- const [dayViewHeight, setDayViewHeight] = useState();
59
- const focusAfterViewChange = useRef(false);
60
- const titleRef = useRef(null);
61
- const currentMonthRef = useRef(null);
62
-
63
- // A view change unmounts the control that had focus. Hand it to the
64
- // matching control in the new view instead of dropping it on the body.
65
- useEffect(() => {
66
- if (!focusAfterViewChange.current) {
67
- return;
68
- }
69
- focusAfterViewChange.current = false;
70
- (view === "month" ? currentMonthRef : titleRef).current?.focus();
71
- }, [view]);
46
+ const calendar = useYearMonthView(() => initialViewDate(value, minDate, maxDate));
72
47
  const handleOpenChange = next => {
73
48
  setOpen(next);
74
49
  if (next) {
75
- setView("day");
76
- setViewDate(initialViewDate(value, minDate, maxDate));
77
- setCalendarKey(key => key + 1);
50
+ calendar.reset(initialViewDate(value, minDate, maxDate));
78
51
  }
79
52
  };
80
53
  const handleChange = date => {
81
54
  onValueChange?.(date);
82
55
  setOpen(false);
83
56
  };
84
- const changeView = next => {
85
- focusAfterViewChange.current = true;
86
- setView(next);
87
- };
88
- const jumpTo = (year, month) => {
89
- setViewDate(new Date(year, month, 1));
90
- setCalendarKey(key => key + 1);
91
- changeView("day");
92
- };
93
- const year = viewDate.getFullYear();
94
- const monthDisabled = month => {
95
- const first = startOfMonth(new Date(year, month, 1));
96
- return minDate !== undefined && endOfMonth(first) < minDate || maxDate !== undefined && first > maxDate;
97
- };
98
57
  return /*#__PURE__*/jsx("div", {
99
58
  className: cn(styles.root, className),
100
59
  ref: ref,
@@ -114,75 +73,20 @@ function DayPicker({
114
73
  }), /*#__PURE__*/jsxs(Popover.Content, {
115
74
  "aria-label": "Select date",
116
75
  className: styles.content,
117
- children: [/*#__PURE__*/jsxs("div", {
118
- className: styles.monthView,
119
- hidden: view !== "month",
120
- style: {
121
- minHeight: dayViewHeight
122
- },
123
- children: [/*#__PURE__*/jsxs("div", {
124
- className: styles.monthHeader,
125
- children: [/*#__PURE__*/jsxs("button", {
126
- "aria-label": "Back to days",
127
- className: styles.title,
128
- onClick: () => changeView("day"),
129
- type: "button",
130
- children: [/*#__PURE__*/jsx(Typography, {
131
- size: "small",
132
- type: "body",
133
- weight: "semibold",
134
- children: viewDate.toLocaleDateString(locale.code ?? "ko-KR", {
135
- year: "numeric"
136
- })
137
- }), /*#__PURE__*/jsx(ArrowDropUpIcon, {
138
- "aria-hidden": true,
139
- size: 16
140
- })]
141
- }), /*#__PURE__*/jsxs("div", {
142
- className: styles.menu,
143
- children: [/*#__PURE__*/jsx(Button, {
144
- "aria-label": "Previous year",
145
- className: styles.arrow,
146
- disabled: minDate !== undefined && year - 1 < minDate.getFullYear(),
147
- onClick: () => setViewDate(new Date(year - 1, 0, 1)),
148
- size: "x-small",
149
- svgOnly: true,
150
- type: "button",
151
- variant: "outline",
152
- children: /*#__PURE__*/jsx(ArrowIOSBackwardIcon, {})
153
- }), /*#__PURE__*/jsx(Button, {
154
- "aria-label": "Next year",
155
- className: styles.arrow,
156
- disabled: maxDate !== undefined && year + 1 > maxDate.getFullYear(),
157
- onClick: () => setViewDate(new Date(year + 1, 0, 1)),
158
- size: "x-small",
159
- svgOnly: true,
160
- type: "button",
161
- variant: "outline",
162
- children: /*#__PURE__*/jsx(ArrowIOSForwardIcon, {})
163
- })]
164
- })]
165
- }), /*#__PURE__*/jsx("div", {
166
- className: styles.monthGrid,
167
- children: MONTHS.map(month => {
168
- const current = value !== undefined && value.getFullYear() === year && value.getMonth() === month;
169
- const isViewed = viewDate.getMonth() === month;
170
- return /*#__PURE__*/jsx("button", {
171
- "aria-current": current ? "date" : undefined,
172
- className: styles.monthCell,
173
- "data-selected": current || undefined,
174
- disabled: monthDisabled(month),
175
- onClick: () => jumpTo(year, month),
176
- ref: isViewed ? currentMonthRef : undefined,
177
- type: "button",
178
- children: format(new Date(year, month, 1), "LLL", {
179
- locale
180
- })
181
- }, month);
182
- })
183
- })]
76
+ children: [/*#__PURE__*/jsx(YearMonthView, {
77
+ currentMonthRef: calendar.currentMonthRef,
78
+ hidden: calendar.view !== "month",
79
+ locale: locale,
80
+ maxDate: maxDate,
81
+ minDate: minDate,
82
+ minHeight: calendar.dayViewHeight,
83
+ onBack: () => calendar.changeView("day"),
84
+ onPick: calendar.jumpTo,
85
+ onYearChange: calendar.setViewDate,
86
+ selected: value,
87
+ viewDate: calendar.viewDate
184
88
  }), /*#__PURE__*/jsx("div", {
185
- hidden: view !== "day",
89
+ hidden: calendar.view !== "day",
186
90
  children: /*#__PURE__*/jsx(DatePicker, {
187
91
  dateFormat: dateFormat,
188
92
  dayClassName: date => {
@@ -207,8 +111,8 @@ function DayPicker({
207
111
  maxDate: maxDate,
208
112
  minDate: minDate,
209
113
  onChange: handleChange,
210
- onMonthChange: setViewDate,
211
- openToDate: viewDate,
114
+ onMonthChange: calendar.setViewDate,
115
+ openToDate: calendar.viewDate,
212
116
  renderCustomHeader: ({
213
117
  date,
214
118
  decreaseMonth,
@@ -216,28 +120,11 @@ function DayPicker({
216
120
  prevMonthButtonDisabled,
217
121
  nextMonthButtonDisabled
218
122
  }) => /*#__PURE__*/jsxs(Fragment, {
219
- children: [/*#__PURE__*/jsxs("button", {
220
- "aria-label": "Choose year and month",
221
- className: styles.title,
222
- onClick: event => {
223
- setDayViewHeight(event.currentTarget.closest(".react-datepicker")?.getBoundingClientRect().height);
224
- setViewDate(date);
225
- changeView("month");
226
- },
227
- ref: titleRef,
228
- type: "button",
229
- children: [/*#__PURE__*/jsx(Typography, {
230
- size: "small",
231
- type: "body",
232
- weight: "semibold",
233
- children: date.toLocaleDateString(locale.code ?? "ko-KR", {
234
- year: "numeric",
235
- month: "long"
236
- })
237
- }), /*#__PURE__*/jsx(ArrowDropDownIcon, {
238
- "aria-hidden": true,
239
- size: 16
240
- })]
123
+ children: [/*#__PURE__*/jsx(CalendarTitle, {
124
+ date: date,
125
+ locale: locale,
126
+ onPress: panel => calendar.openMonths(date, panel),
127
+ ref: calendar.titleRef
241
128
  }), /*#__PURE__*/jsxs("div", {
242
129
  className: styles.menu,
243
130
  children: [/*#__PURE__*/jsx(Button, {
@@ -265,7 +152,7 @@ function DayPicker({
265
152
  }),
266
153
  selected: value,
267
154
  showPopperArrow: false
268
- }, calendarKey)
155
+ }, calendar.calendarKey)
269
156
  })]
270
157
  })]
271
158
  })
@@ -1,3 +1,3 @@
1
- var styles = {"root":"day-picker-module_root__QVrbb","content":"day-picker-module_content__34qUu","menu":"day-picker-module_menu__2eMt0","arrow":"day-picker-module_arrow__p9QLq","title":"day-picker-module_title__UokL8","monthCell":"day-picker-module_monthCell__lbR2S","monthView":"day-picker-module_monthView__tPMlr","monthHeader":"day-picker-module_monthHeader__mAlm5","monthGrid":"day-picker-module_monthGrid__14EcZ","sunday":"day-picker-module_sunday__nVavs","saturday":"day-picker-module_saturday__ZYoB9"};
1
+ var styles = {"root":"day-picker-module_root__QVrbb","content":"day-picker-module_content__34qUu","menu":"day-picker-module_menu__2eMt0","arrow":"day-picker-module_arrow__p9QLq","sunday":"day-picker-module_sunday__nVavs","saturday":"day-picker-module_saturday__ZYoB9"};
2
2
 
3
3
  export { styles as default };