@dhis2-ui/calendar 9.12.0-alpha.4 → 9.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. package/build/cjs/calendar/calendar-table-cell.js +2 -5
  2. package/build/cjs/calendar/calendar-table.js +5 -9
  3. package/build/cjs/calendar/calendar.js +33 -34
  4. package/build/cjs/calendar/navigation-container.js +56 -58
  5. package/build/cjs/calendar-input/calendar-input.js +34 -136
  6. package/build/cjs/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +1 -0
  7. package/build/cjs/features/supports_gregorian_calendar/supports_gregorian_calendar.js +1 -0
  8. package/build/cjs/features/supports_nepali_calendar/supports_nepali_calendar.js +1 -0
  9. package/build/cjs/stories/calendar-input.prod.stories.js +2 -70
  10. package/build/cjs/stories/calendar-story-wrapper.js +9 -9
  11. package/build/es/calendar/calendar-table-cell.js +2 -5
  12. package/build/es/calendar/calendar-table.js +4 -8
  13. package/build/es/calendar/calendar.js +34 -35
  14. package/build/es/calendar/navigation-container.js +55 -57
  15. package/build/es/calendar-input/calendar-input.js +36 -138
  16. package/build/es/features/supports_ethiopic_calendar/supports_ethiopic_calendar.js +1 -0
  17. package/build/es/features/supports_gregorian_calendar/supports_gregorian_calendar.js +1 -0
  18. package/build/es/features/supports_nepali_calendar/supports_nepali_calendar.js +1 -0
  19. package/build/es/stories/calendar-input.prod.stories.js +1 -66
  20. package/build/es/stories/calendar-story-wrapper.js +9 -9
  21. package/package.json +13 -13
  22. package/build/cjs/calendar/calendar-container.js +0 -81
  23. package/build/cjs/calendar-input/__tests__/calendar-input.test.js +0 -46
  24. package/build/es/calendar/calendar-container.js +0 -72
  25. package/build/es/calendar-input/__tests__/calendar-input.test.js +0 -43
@@ -38,4 +38,5 @@ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preproces
38
38
  cy.get(`[data-test="${nepaliDate}"]`).click();
39
39
  cy.get('[data-test="dhis2-uiwidgets-calendar-inputfield"] input').should('have.value', nepaliDate);
40
40
  cy.get('[data-test="storybook-calendar-result"]').should('have.text', nepaliDate);
41
+ cy.get('[data-test="storybook-calendar-result-iso"]').should('have.text', '13 October 2021');
41
42
  });
@@ -3,17 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CalendarWithClearButton = void 0;
7
- exports.CalendarWithEditiableInput = CalendarWithEditiableInput;
8
- exports.CalendarWithEditiableInputReactForm = CalendarWithEditiableInputReactForm;
9
- exports.default = exports.NepaliWithNepali = exports.NepaliWithEnglish = exports.IslamicWithArabic = exports.GregorianWithEnglish = exports.GregorianWithArabic = exports.EthiopicWithEnglish = exports.EthiopicWithAmharic = void 0;
6
+ exports.default = exports.NepaliWithNepali = exports.NepaliWithEnglish = exports.IslamicWithArabic = exports.GregorianWithEnglish = exports.GregorianWithArabic = exports.EthiopicWithEnglish = exports.EthiopicWithAmharic = exports.CalendarWithClearButton = void 0;
10
7
  var _react = _interopRequireWildcard(require("react"));
11
- var _reactFinalForm = require("react-final-form");
12
8
  var _calendarInput = require("../calendar-input/calendar-input.js");
13
9
  var _calendarStoryWrapper = require("./calendar-story-wrapper.js");
14
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
17
12
  const subtitle = `[Experimental] Calendar Input is a wrapper around Calendar displaying an input that triggers the calendar`;
18
13
  const description = `
19
14
  Use a CalendarInput where there is a need to let the user input a date.
@@ -119,67 +114,4 @@ const CalendarWithClearButton = _ref2 => {
119
114
  "data-test": "storybook-calendar-date-value"
120
115
  }, date !== null && date !== void 0 ? date : 'undefined')));
121
116
  };
122
- exports.CalendarWithClearButton = CalendarWithClearButton;
123
- function CalendarWithEditiableInput() {
124
- const [date, setDate] = (0, _react.useState)('2020-07-03');
125
- return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_calendarInput.CalendarInput, {
126
- date: date,
127
- calendar: "gregory",
128
- onDateSelect: selectedDate => {
129
- const date = selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.calendarDateString;
130
- setDate(date);
131
- },
132
- width: "400px",
133
- minDate: "2020-07-01",
134
- maxDate: "2020-07-09",
135
- clearable: true
136
- })));
137
- }
138
- function CalendarWithEditiableInputReactForm() {
139
- const [calendarError, setCalendarError] = (0, _react.useState)(undefined);
140
- const errored = () => {
141
- return {
142
- calendar: calendarError
143
- };
144
- };
145
- return /*#__PURE__*/_react.default.createElement(_reactFinalForm.Form, {
146
- onSubmit: (values, meta) => {
147
- console.log('SUBMITTING', {
148
- values,
149
- meta
150
- });
151
- },
152
- initialValues: {
153
- calendar: '2022-10-12'
154
- },
155
- validate: errored
156
- }, _ref3 => {
157
- let {
158
- handleSubmit
159
- } = _ref3;
160
- return /*#__PURE__*/_react.default.createElement("form", {
161
- onSubmit: handleSubmit
162
- }, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
163
- name: "calendar"
164
- }, props => /*#__PURE__*/_react.default.createElement(_calendarInput.CalendarInput, _extends({}, props, {
165
- input: props.input,
166
- meta: props.meta,
167
- editable: true,
168
- date: props.input.value,
169
- calendar: "gregory",
170
- onDateSelect: date => {
171
- if (!date.isValid) {
172
- setCalendarError(date.errorMessage);
173
- } else {
174
- setCalendarError(undefined);
175
- }
176
- props.input.onChange(date ? date === null || date === void 0 ? void 0 : date.calendarDateString : '');
177
- },
178
- timeZone: 'UTC'
179
- }))), /*#__PURE__*/_react.default.createElement("button", {
180
- type: "submit",
181
- disabled: false,
182
- onClick: handleSubmit
183
- }, "Submit"));
184
- });
185
- }
117
+ exports.CalendarWithClearButton = CalendarWithClearButton;
@@ -17,14 +17,15 @@ const {
17
17
  numberingSystems
18
18
  } = _multiCalendarDates.constants;
19
19
  const CalendarStoryWrapper = props => {
20
+ var _selectedDate$calenda;
20
21
  const {
21
- calendar,
22
+ calendar = 'gregory',
22
23
  locale,
23
24
  timeZone,
24
25
  dir,
25
- component: Component,
26
+ component: Component = _calendar.Calendar,
26
27
  date,
27
- weekDayFormat
28
+ weekDayFormat = 'narrow'
28
29
  } = props;
29
30
  const [selectedCalendar, setSelectedCalendar] = (0, _react.useState)(calendar);
30
31
  const [selectedNumberingSystem, setSelectedNumberingSystem] = (0, _react.useState)();
@@ -157,14 +158,13 @@ const CalendarStoryWrapper = props => {
157
158
  }
158
159
  }, /*#__PURE__*/_react.default.createElement("div", null, selectedDate && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", null, "calendar date: "), /*#__PURE__*/_react.default.createElement("span", {
159
160
  "data-test": "storybook-calendar-result"
160
- }, selectedDate.calendarDateString)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", null, "callback:"), JSON.stringify(selectedDate, null, 2))))));
161
+ }, selectedDate.calendarDateString)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", null, "iso date: "), /*#__PURE__*/_react.default.createElement("span", {
162
+ "data-test": "storybook-calendar-result-iso"
163
+ }, (_selectedDate$calenda = selectedDate.calendarDate) === null || _selectedDate$calenda === void 0 ? void 0 : _selectedDate$calenda.withCalendar('iso8601').toLocaleString('en-GB', {
164
+ dateStyle: 'long'
165
+ }))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", null, "callback:"), JSON.stringify(selectedDate, null, 2))))));
161
166
  };
162
167
  exports.CalendarStoryWrapper = CalendarStoryWrapper;
163
- CalendarStoryWrapper.defaultProps = {
164
- calendar: 'gregorian',
165
- component: _calendar.Calendar,
166
- weekDayFormat: 'narrow'
167
- };
168
168
  CalendarStoryWrapper.propTypes = {
169
169
  calendar: _propTypes.default.string.isRequired,
170
170
  component: _propTypes.default.elementType.isRequired,
@@ -7,8 +7,7 @@ export const CalendarTableCell = _ref => {
7
7
  let {
8
8
  day,
9
9
  cellSize,
10
- selectedDate,
11
- unfocusable
10
+ selectedDate
12
11
  } = _ref;
13
12
  const dayHoverBackgroundColor = colors.grey200;
14
13
  const selectedDayBackgroundColor = colors.teal700;
@@ -18,7 +17,6 @@ export const CalendarTableCell = _ref => {
18
17
  className: _JSXStyle.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, colors.grey900, dayHoverBackgroundColor, colors.grey300, selectedDayBackgroundColor, colors.teal600, colors.teal200, colors.grey600]]])
19
18
  }, /*#__PURE__*/React.createElement("button", {
20
19
  name: "day",
21
- tabIndex: unfocusable ? -1 : 0,
22
20
  className: _JSXStyle.dynamic([["2052411850", [cellSize, cellSize, cellSize, cellSize, colors.grey900, dayHoverBackgroundColor, colors.grey300, selectedDayBackgroundColor, colors.teal600, colors.teal200, colors.grey600]]]) + " " + (cx('day', {
23
21
  isSelected: selectedDate === (day === null || day === void 0 ? void 0 : day.calendarDate),
24
22
  isToday: day.isToday,
@@ -39,6 +37,5 @@ CalendarTableCell.propTypes = {
39
37
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
40
38
  onClick: PropTypes.func
41
39
  }),
42
- selectedDate: PropTypes.string,
43
- unfocusable: PropTypes.bool
40
+ selectedDate: PropTypes.string
44
41
  };
@@ -10,8 +10,7 @@ export const CalendarTable = _ref => {
10
10
  calendarWeekDays,
11
11
  width,
12
12
  cellSize,
13
- selectedDate,
14
- unfocusable
13
+ selectedDate
15
14
  } = _ref;
16
15
  return /*#__PURE__*/React.createElement("div", {
17
16
  className: _JSXStyle.dynamic([["452536960", [spacers.dp4, spacers.dp4]]]) + " " + "calendar-table-wrapper"
@@ -29,14 +28,13 @@ export const CalendarTable = _ref => {
29
28
  day: day,
30
29
  key: day === null || day === void 0 ? void 0 : day.calendarDate,
31
30
  cellSize: cellSize,
32
- width: width,
33
- unfocusable: unfocusable
31
+ width: width
34
32
  })))))), /*#__PURE__*/React.createElement(_JSXStyle, {
35
33
  id: "452536960",
36
34
  dynamic: [spacers.dp4, spacers.dp4]
37
35
  }, [`.calendar-table.__jsx-style-dynamic-selector{border:none;border-collapse:collapse;width:100%;margin-block:${spacers.dp4};}`, ".calendar-table.__jsx-style-dynamic-selector tr.__jsx-style-dynamic-selector,.calendar-table.__jsx-style-dynamic-selector td.__jsx-style-dynamic-selector{border:none;}", `.calendar-table-wrapper.__jsx-style-dynamic-selector{padding-inline:${spacers.dp4};}`]));
38
36
  };
39
- export const CalendarTableProps = {
37
+ CalendarTable.propTypes = {
40
38
  calendarWeekDays: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
41
39
  calendarDate: PropTypes.string,
42
40
  isInCurrentMonth: PropTypes.bool,
@@ -48,8 +46,6 @@ export const CalendarTableProps = {
48
46
  }).isRequired).isRequired).isRequired,
49
47
  cellSize: PropTypes.string,
50
48
  selectedDate: PropTypes.string,
51
- unfocusable: PropTypes.bool,
52
49
  weekDayLabels: PropTypes.arrayOf(PropTypes.string),
53
50
  width: PropTypes.string
54
- };
55
- CalendarTable.propTypes = CalendarTableProps;
51
+ };
@@ -1,7 +1,10 @@
1
+ import _JSXStyle from "styled-jsx/style";
1
2
  import { useDatePicker, useResolvedDirection } from '@dhis2/multi-calendar-dates';
3
+ import { colors } from '@dhis2/ui-constants';
2
4
  import PropTypes from 'prop-types';
3
- import React, { useMemo, useState } from 'react';
4
- import { CalendarContainer } from './calendar-container.js';
5
+ import React, { useState } from 'react';
6
+ import { CalendarTable } from './calendar-table.js';
7
+ import { NavigationContainer } from './navigation-container.js';
5
8
  export const Calendar = _ref => {
6
9
  let {
7
10
  onDateSelect,
@@ -10,11 +13,13 @@ export const Calendar = _ref => {
10
13
  dir,
11
14
  locale,
12
15
  numberingSystem,
13
- weekDayFormat,
16
+ weekDayFormat = 'narrow',
14
17
  timeZone,
15
- width,
16
- cellSize
18
+ width = '240px',
19
+ cellSize = '32px'
17
20
  } = _ref;
21
+ const wrapperBorderColor = colors.grey300;
22
+ const backgroundColor = 'none';
18
23
  const [selectedDateString, setSelectedDateString] = useState(date);
19
24
  const languageDirection = useResolvedDirection(dir, locale);
20
25
  const options = {
@@ -24,7 +29,7 @@ export const Calendar = _ref => {
24
29
  numberingSystem,
25
30
  weekDayFormat
26
31
  };
27
- const pickerResults = useDatePicker({
32
+ const pickerOptions = useDatePicker({
28
33
  onDateSelect: result => {
29
34
  const {
30
35
  calendarDateString
@@ -35,35 +40,29 @@ export const Calendar = _ref => {
35
40
  date: selectedDateString,
36
41
  options
37
42
  });
38
- const calendarProps = useMemo(() => {
39
- return {
40
- date,
41
- dir,
42
- locale,
43
- width,
44
- cellSize,
45
- // minDate,
46
- // maxDate,
47
- // validation, // todo: clarify how we use validation props (and format) in Calendar (not CalendarInput)
48
- // format,
49
- isValid: pickerResults.isValid,
50
- calendarWeekDays: pickerResults.calendarWeekDays,
51
- weekDayLabels: pickerResults.weekDayLabels,
52
- currMonth: pickerResults.currMonth,
53
- currYear: pickerResults.currYear,
54
- nextMonth: pickerResults.nextMonth,
55
- nextYear: pickerResults.nextYear,
56
- prevMonth: pickerResults.prevMonth,
57
- prevYear: pickerResults.prevYear,
58
- languageDirection
59
- };
60
- }, [cellSize, date, dir, locale, pickerResults, width, languageDirection]);
61
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CalendarContainer, calendarProps));
62
- };
63
- Calendar.defaultProps = {
64
- cellSize: '32px',
65
- width: '240px',
66
- weekDayFormat: 'narrow'
43
+ const {
44
+ calendarWeekDays,
45
+ weekDayLabels
46
+ } = pickerOptions;
47
+ return /*#__PURE__*/React.createElement("div", {
48
+ className: _JSXStyle.dynamic([["2823859047", [backgroundColor, wrapperBorderColor, width]]])
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ dir: languageDirection,
51
+ "data-test": "calendar",
52
+ className: _JSXStyle.dynamic([["2823859047", [backgroundColor, wrapperBorderColor, width]]]) + " " + "calendar-wrapper"
53
+ }, /*#__PURE__*/React.createElement(NavigationContainer, {
54
+ pickerOptions: pickerOptions,
55
+ languageDirection: languageDirection
56
+ }), /*#__PURE__*/React.createElement(CalendarTable, {
57
+ selectedDate: selectedDateString,
58
+ calendarWeekDays: calendarWeekDays,
59
+ weekDayLabels: weekDayLabels,
60
+ cellSize: cellSize,
61
+ width: width
62
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
63
+ id: "2823859047",
64
+ dynamic: [backgroundColor, wrapperBorderColor, width]
65
+ }, [`.calendar-wrapper.__jsx-style-dynamic-selector{font-family:Roboto,sans-serif;font-weight:400;font-size:14px;background-color:${backgroundColor};display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border:1px solid ${wrapperBorderColor};border-radius:3px;min-width:${width};width:-webkit-max-content;width:-moz-max-content;width:max-content;box-shadow:0px 4px 6px -2px #2129340d;box-shadow:0px 10px 15px -3px #2129341a;}`]));
67
66
  };
68
67
  export const CalendarProps = {
69
68
  /** the calendar to use such gregory, ethiopic, nepali - full supported list here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/calendars.ts */
@@ -10,110 +10,108 @@ export const NavigationContainer = _ref => {
10
10
  var _currYear$label;
11
11
  let {
12
12
  languageDirection,
13
+ pickerOptions
14
+ } = _ref;
15
+ const PreviousIcon = languageDirection === 'ltr' ? IconChevronLeft16 : IconChevronRight16;
16
+ const NextIcon = languageDirection === 'ltr' ? IconChevronRight16 : IconChevronLeft16;
17
+ const {
13
18
  currMonth,
14
19
  currYear,
15
20
  nextMonth,
16
21
  nextYear,
17
22
  prevMonth,
18
- prevYear,
19
- unfocusable
20
- } = _ref;
21
- const PreviousIcon = languageDirection === 'ltr' ? IconChevronLeft16 : IconChevronRight16;
22
- const NextIcon = languageDirection === 'ltr' ? IconChevronRight16 : IconChevronLeft16;
23
+ prevYear
24
+ } = pickerOptions;
23
25
 
24
26
  // Ethiopic years - when localised to English - add the era (i.e. 2015 ERA1), which is redundant in practice (like writing AD for gregorian years)
25
27
  // there is an ongoing discussion in JS-Temporal polyfill whether the era should be included or not, but for our case, it's safer to remove it
26
28
  const currentYearLabel = (_currYear$label = currYear.label) === null || _currYear$label === void 0 ? void 0 : _currYear$label.toString().replace(/ERA1/, '');
27
29
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
28
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "navigation-container"
30
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "navigation-container"
29
31
  }, /*#__PURE__*/React.createElement("div", {
30
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "month"
32
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "month"
31
33
  }, /*#__PURE__*/React.createElement("div", {
32
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "prev"
34
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "prev"
33
35
  }, /*#__PURE__*/React.createElement("button", {
34
36
  onClick: prevMonth.navigateTo,
35
37
  name: "previous-month",
36
38
  "data-test": "calendar-previous-month",
37
39
  "aria-label": `${i18n.t(`Go to ${prevMonth.label}`)}`,
38
40
  type: "button",
39
- tabIndex: unfocusable ? -1 : 0,
40
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
41
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
41
42
  }, /*#__PURE__*/React.createElement(PreviousIcon, {
42
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
43
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
43
44
  }))), /*#__PURE__*/React.createElement("div", {
44
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "curr"
45
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "curr"
45
46
  }, /*#__PURE__*/React.createElement("span", {
46
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "label"
47
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "label"
47
48
  }, currMonth.label)), /*#__PURE__*/React.createElement("div", {
48
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "next"
49
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "next"
49
50
  }, /*#__PURE__*/React.createElement("button", {
50
51
  onClick: nextMonth.navigateTo,
51
52
  "data-test": "calendar-next-month",
52
53
  name: "next-month",
53
54
  "aria-label": `${i18n.t(`Go to ${nextMonth.label}`)}`,
54
55
  type: "button",
55
- tabIndex: unfocusable ? -1 : 0,
56
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
56
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
57
57
  }, /*#__PURE__*/React.createElement(NextIcon, {
58
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
58
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
59
59
  })))), /*#__PURE__*/React.createElement("div", {
60
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "year"
60
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "year"
61
61
  }, /*#__PURE__*/React.createElement("div", {
62
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "prev"
62
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "prev"
63
63
  }, /*#__PURE__*/React.createElement("button", {
64
64
  onClick: prevYear.navigateTo,
65
65
  name: "previous-year",
66
66
  "aria-label": `${i18n.t('Go to previous year')}`,
67
67
  type: "button",
68
- tabIndex: unfocusable ? -1 : 0,
69
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
68
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
70
69
  }, /*#__PURE__*/React.createElement(PreviousIcon, {
71
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
70
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
72
71
  }))), /*#__PURE__*/React.createElement("div", {
73
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "curr"
72
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "curr"
74
73
  }, /*#__PURE__*/React.createElement("span", {
75
74
  "data-test": "calendar-current-year",
76
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "label"
75
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "label"
77
76
  }, currentYearLabel)), /*#__PURE__*/React.createElement("div", {
78
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]]) + " " + "next"
77
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]]) + " " + "next"
79
78
  }, /*#__PURE__*/React.createElement("button", {
80
79
  onClick: nextYear.navigateTo,
81
80
  name: "next-year",
82
81
  "aria-label": `${i18n.t('Go to next year')}`,
83
82
  type: "button",
84
- tabIndex: unfocusable ? -1 : 0,
85
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
83
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
86
84
  }, /*#__PURE__*/React.createElement(NextIcon, {
87
- className: _JSXStyle.dynamic([["1327991300", [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]]])
85
+ className: _JSXStyle.dynamic([["3883083596", [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]]])
88
86
  }))))), /*#__PURE__*/React.createElement(_JSXStyle, {
89
- id: "1327991300",
90
- dynamic: [spacers.dp4, wrapperBorderColor, headerBackground, spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp4, spacers.dp8]
91
- }, [`.navigation-container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:${spacers.dp4};border-bottom:1px solid ${wrapperBorderColor};background-color:${headerBackground};font-size:1.08em;}`, ".month.__jsx-style-dynamic-selector,.year.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:50%;}", ".prev.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector,.curr.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".prev.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector{width:24px;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".curr.__jsx-style-dynamic-selector{-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;overflow:hidden;}", `button.__jsx-style-dynamic-selector{background:none;border:0;padding:${spacers.dp4};height:24px;width:24px;color:${colors.grey600};border-radius:3px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}`, `button.__jsx-style-dynamic-selector:hover{background-color:${colors.grey200};color:${colors.grey900};cursor:pointer;}`, `button.__jsx-style-dynamic-selector:active{background-color:${colors.grey300};}`, `.label.__jsx-style-dynamic-selector{padding:${spacers.dp4} ${spacers.dp8};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;max-width:100%;}`]));
87
+ id: "3883083596",
88
+ dynamic: [spacers.dp4, colors.grey600, colors.grey200, colors.grey900, colors.grey300, spacers.dp8, spacers.dp4, wrapperBorderColor, headerBackground]
89
+ }, ["button.__jsx-style-dynamic-selector{background:none;border:0;}", ".month.__jsx-style-dynamic-selector,.year.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:default;}", ".month.__jsx-style-dynamic-selector .curr.__jsx-style-dynamic-selector,.year.__jsx-style-dynamic-selector .curr.__jsx-style-dynamic-selector{-webkit-flex:2;-ms-flex:2;flex:2;white-space:nowrap;}", ".prev.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector{-webkit-flex:1;-ms-flex:1;flex:1;text-align:center;}", `.prev.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector{padding:${spacers.dp4};height:24px;width:24px;color:${colors.grey600};border-radius:3px;}`, ".prev.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector svg.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector svg.__jsx-style-dynamic-selector{width:16px;height:16px;}", `.prev.__jsx-style-dynamic-selector:hover button.__jsx-style-dynamic-selector,.next.__jsx-style-dynamic-selector:hover button.__jsx-style-dynamic-selector{background-color:${colors.grey200};color:${colors.grey900};cursor:pointer;}`, `.prev.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector:active,.next.__jsx-style-dynamic-selector button.__jsx-style-dynamic-selector:active{background-color:${colors.grey300};}`, ".label.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:4px 8px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;min-height:16px;}", `.navigation-container.__jsx-style-dynamic-selector{gap:${spacers.dp8};padding:${spacers.dp4};display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid ${wrapperBorderColor};background-color:${headerBackground};font-size:1.08em;}`]));
92
90
  };
93
- export const NavigationContainerProps = {
94
- currMonth: PropTypes.shape({
95
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
96
- }),
97
- currYear: PropTypes.shape({
98
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
99
- }),
91
+ NavigationContainer.propTypes = {
100
92
  languageDirection: PropTypes.oneOf(['ltr', 'rtl']),
101
- nextMonth: PropTypes.shape({
102
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
103
- navigateTo: PropTypes.func
104
- }),
105
- nextYear: PropTypes.shape({
106
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
107
- navigateTo: PropTypes.func
108
- }),
109
- prevMonth: PropTypes.shape({
110
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
111
- navigateTo: PropTypes.func
112
- }),
113
- prevYear: PropTypes.shape({
114
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
115
- navigateTo: PropTypes.func
116
- }),
117
- unfocusable: PropTypes.bool
118
- };
119
- NavigationContainer.propTypes = NavigationContainerProps;
93
+ pickerOptions: PropTypes.shape({
94
+ currMonth: PropTypes.shape({
95
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
96
+ }),
97
+ currYear: PropTypes.shape({
98
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
99
+ }),
100
+ nextMonth: PropTypes.shape({
101
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
102
+ navigateTo: PropTypes.func
103
+ }),
104
+ nextYear: PropTypes.shape({
105
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
106
+ navigateTo: PropTypes.func
107
+ }),
108
+ prevMonth: PropTypes.shape({
109
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
110
+ navigateTo: PropTypes.func
111
+ }),
112
+ prevYear: PropTypes.shape({
113
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
114
+ navigateTo: PropTypes.func
115
+ })
116
+ })
117
+ };