@codecademy/gamut 68.2.3-alpha.ea023d.0 → 68.2.3-alpha.f19d29.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.
Files changed (62) hide show
  1. package/dist/DataList/Controls/FilterControl.js +1 -1
  2. package/dist/DatePicker/Calendar/CalendarBody.d.ts +3 -0
  3. package/dist/DatePicker/Calendar/CalendarBody.js +145 -0
  4. package/dist/DatePicker/Calendar/CalendarFooter.d.ts +3 -0
  5. package/dist/DatePicker/Calendar/CalendarFooter.js +57 -0
  6. package/dist/DatePicker/Calendar/CalendarHeader.d.ts +3 -0
  7. package/dist/DatePicker/Calendar/CalendarHeader.js +46 -0
  8. package/dist/DatePicker/Calendar/CalendarNavLastMonth.d.ts +3 -0
  9. package/dist/DatePicker/Calendar/CalendarNavLastMonth.js +30 -0
  10. package/dist/DatePicker/Calendar/CalendarNavNextMonth.d.ts +3 -0
  11. package/dist/DatePicker/Calendar/CalendarNavNextMonth.js +30 -0
  12. package/dist/DatePicker/Calendar/CalendarWrapper.d.ts +8 -0
  13. package/dist/DatePicker/Calendar/CalendarWrapper.js +27 -0
  14. package/dist/DatePicker/Calendar/index.d.ts +6 -0
  15. package/dist/DatePicker/Calendar/index.js +6 -0
  16. package/dist/DatePicker/Calendar/types.d.ts +77 -0
  17. package/dist/DatePicker/Calendar/types.js +1 -0
  18. package/dist/DatePicker/Calendar/utils/dateGrid.d.ts +38 -0
  19. package/dist/DatePicker/Calendar/utils/dateGrid.js +103 -0
  20. package/dist/DatePicker/Calendar/utils/elements.d.ts +18 -0
  21. package/dist/DatePicker/Calendar/utils/elements.js +116 -0
  22. package/dist/DatePicker/Calendar/utils/format.d.ts +28 -0
  23. package/dist/DatePicker/Calendar/utils/format.js +72 -0
  24. package/dist/DatePicker/Calendar/utils/keyHandler.d.ts +12 -0
  25. package/dist/DatePicker/Calendar/utils/keyHandler.js +126 -0
  26. package/dist/DatePicker/DatePicker.d.ts +7 -0
  27. package/dist/DatePicker/DatePicker.js +157 -0
  28. package/dist/DatePicker/DatePickerCalendar.d.ts +11 -0
  29. package/dist/DatePicker/DatePickerCalendar.js +168 -0
  30. package/dist/DatePicker/DatePickerContext.d.ts +10 -0
  31. package/dist/DatePicker/DatePickerContext.js +18 -0
  32. package/dist/DatePicker/DatePickerInput/Segment/DatePickerInputSegment.d.ts +23 -0
  33. package/dist/DatePicker/DatePickerInput/Segment/DatePickerInputSegment.js +131 -0
  34. package/dist/DatePicker/DatePickerInput/Segment/elements.d.ts +16 -0
  35. package/dist/DatePicker/DatePickerInput/Segment/elements.js +36 -0
  36. package/dist/DatePicker/DatePickerInput/Segment/index.d.ts +4 -0
  37. package/dist/DatePicker/DatePickerInput/Segment/index.js +3 -0
  38. package/dist/DatePicker/DatePickerInput/Segment/segmentUtils.d.ts +50 -0
  39. package/dist/DatePicker/DatePickerInput/Segment/segmentUtils.js +201 -0
  40. package/dist/DatePicker/DatePickerInput/elements.d.ts +15 -0
  41. package/dist/DatePicker/DatePickerInput/elements.js +19 -0
  42. package/dist/DatePicker/DatePickerInput/index.d.ts +13 -0
  43. package/dist/DatePicker/DatePickerInput/index.js +206 -0
  44. package/dist/DatePicker/DatePickerInput/utils.d.ts +17 -0
  45. package/dist/DatePicker/DatePickerInput/utils.js +50 -0
  46. package/dist/DatePicker/index.d.ts +5 -0
  47. package/dist/DatePicker/index.js +5 -0
  48. package/dist/DatePicker/types.d.ts +86 -0
  49. package/dist/DatePicker/types.js +1 -0
  50. package/dist/DatePicker/utils/dateSelect.d.ts +29 -0
  51. package/dist/DatePicker/utils/dateSelect.js +145 -0
  52. package/dist/DatePicker/utils/locale.d.ts +38 -0
  53. package/dist/DatePicker/utils/locale.js +93 -0
  54. package/dist/DatePicker/utils/translations.d.ts +15 -0
  55. package/dist/DatePicker/utils/translations.js +10 -0
  56. package/dist/FocusTrap/index.d.ts +2 -2
  57. package/dist/Pagination/index.js +5 -10
  58. package/dist/PopoverContainer/PopoverContainer.js +23 -7
  59. package/dist/PopoverContainer/types.d.ts +7 -1
  60. package/dist/index.d.ts +2 -0
  61. package/dist/index.js +2 -0
  62. package/package.json +7 -6
@@ -37,7 +37,7 @@ const FilterToggle = /*#__PURE__*/_styled(Anchor, {
37
37
  open: {
38
38
  pointerEvents: 'none'
39
39
  }
40
- }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9EYXRhTGlzdC9Db250cm9scy9GaWx0ZXJDb250cm9sLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5Q3FCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9EYXRhTGlzdC9Db250cm9scy9GaWx0ZXJDb250cm9sLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZpbHRlckljb24gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1pY29ucyc7XG5pbXBvcnQgeyBzdGF0ZXMgfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IGtlYmFiQ2FzZSBmcm9tICdsb2Rhc2gva2ViYWJDYXNlJztcbmltcG9ydCB7IHVzZVJlZiwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgKiBhcyBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCB7IENoZWNrYm94LCBGbGV4Qm94LCBNZW51LCBNZW51SXRlbSwgVGV4dCB9IGZyb20gJy4uLy4uJztcbmltcG9ydCB7IEFuY2hvciB9IGZyb20gJy4uLy4uL0FuY2hvcic7XG5pbXBvcnQgeyBQb3BvdmVyQ29udGFpbmVyIH0gZnJvbSAnLi4vLi4vUG9wb3ZlckNvbnRhaW5lcic7XG5pbXBvcnQgeyB1c2VDb250cm9sQ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d1k9XCJhdXRvXCJcbiAgICAgICAgICAgIHNwYWNpbmc9XCJjb25kZW5zZWRcIlxuICAgICAgICAgICAgdmFyaWFudD1cInBvcG92ZXJcIlxuICAgICAgICAgICAgd2lkdGg9XCJtYXgtY29udGVudFwiXG4gICAgICAgICAgPlxuICAgICAgICAgICAge1tTRUxFQ1RfQUxMLCAuLi5vcHRpb25zXS5tYXAoKG9wdCkgPT4ge1xuICAgICAgICAgICAgICBjb25zdCB7IHRleHQsIHZhbHVlIH0gPSBmb3JtYXRPcHRpb24ob3B0KTtcbiAgICAgICAgICAgICAgY29uc3Qgb3B0aW9uSWQgPSBwcmVmaXhJZChgJHtrZWJhYkNhc2UodmFsdWUpfS0ke2RpbWVuc2lvbn1gKTtcbiAgICAgICAgICAgICAgY29uc3QgYWxsU2VsZWN0ZWQgPSBmaWx0ZXJzLmxlbmd0aCA9PT0gMDtcbiAgICAgICAgICAgICAgY29uc3QgaXNTZWxlY3RBbGwgPSB2YWx1ZSA9PT0gJ2FsbCc7XG5cbiAgICAgICAgICAgICAgY29uc3Qgb3B0aW9uU2VsZWN0ZWQgPSBpc1NlbGVjdEFsbFxuICAgICAgICAgICAgICAgID8gYWxsU2VsZWN0ZWRcbiAgICAgICAgICAgICAgICA6ICFmaWx0ZXJzLmluY2x1ZGVzKHZhbHVlKTtcblxuICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxNZW51SXRlbSBrZXk9e3ByZWZpeElkKGBmaWx0ZXItJHtjb2x1bW5LZXl9LSR7dmFsdWV9YCl9PlxuICAgICAgICAgICAgICAgICAgPENoZWNrYm94XG4gICAgICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2lzU2VsZWN0QWxsID8gYCR7dGV4dH0gJHtkaW1lbnNpb259YCA6IHRleHR9XG4gICAgICAgICAgICAgICAgICAgIGNoZWNrZWQ9e29wdGlvblNlbGVjdGVkfVxuICAgICAgICAgICAgICAgICAgICBodG1sRm9yPXtvcHRpb25JZH1cbiAgICAgICAgICAgICAgICAgICAgbGFiZWw9e1xuICAgICAgICAgICAgICAgICAgICAgIDxUZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICBhbGlnblNlbGY9XCJjZW50ZXJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheT1cImlubGluZS1ibG9ja1wiXG4gICAgICAgICAgICAgICAgICAgICAgICBmb250RmFtaWx5PVwiYmFzZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXJpYW50PVwicC1zbWFsbFwiXG4gICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAge3RleHR9XG4gICAgICAgICAgICAgICAgICAgICAgICB7aXNTZWxlY3RBbGwgJiYgPFRleHQgc2NyZWVucmVhZGVyPiB7ZGltZW5zaW9ufTwvVGV4dD59XG4gICAgICAgICAgICAgICAgICAgICAgPC9UZXh0PlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG5hbWU9e29wdGlvbklkfVxuICAgICAgICAgICAgICAgICAgICBzcGFjaW5nPVwidGlnaHRcIlxuICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgIG9uRmlsdGVyPy4oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZGltZW5zaW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldE5leHRGaWx0ZXJzKHZhbHVlLCBmaWx0ZXJzKSxcbiAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgPC9NZW51SXRlbT5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pfVxuICAgICAgICAgIDwvTWVudT5cbiAgICAgICAgPC9Qb3BvdmVyQ29udGFpbmVyPlxuICAgICAgKX1cbiAgICAgIDxGaWx0ZXJUb2dnbGVcbiAgICAgICAgYXJpYS1leHBhbmRlZD17bWVudU9wZW59XG4gICAgICAgIGFyaWEtaGFzcG9wdXA9XCJ0cnVlXCJcbiAgICAgICAgYXJpYS1sYWJlbD17YGZpbHRlciBieSAke2NvbHVtbktleX1gfVxuICAgICAgICBkaXNwbGF5PVwiaW5saW5lLWZsZXhcIlxuICAgICAgICBvcGVuPXttZW51T3Blbn1cbiAgICAgICAgcmVmPXt0YXJnZXR9XG4gICAgICAgIHZhcmlhbnQ9XCJpbnRlcmZhY2VcIlxuICAgICAgICBvbkNsaWNrPXsoKSA9PiBzZXRNZW51T3Blbih0cnVlKX1cbiAgICAgID5cbiAgICAgICAgPEZsZXhCb3ggY2VudGVyIGRpbWVuc2lvbnM9ezE2fSBtYj17NH0gbXI9ezR9PlxuICAgICAgICAgIDxGaWx0ZXJJY29uXG4gICAgICAgICAgICBjb2xvcj17ZmlsdGVycy5sZW5ndGggPiAwID8gJ3ByaW1hcnknIDogJ3RleHQnfVxuICAgICAgICAgICAgc2l6ZT17MTR9XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9GbGV4Qm94PlxuICAgICAgPC9GaWx0ZXJUb2dnbGU+XG4gICAgPC9GbGV4Qm94PlxuICApO1xufTtcbiJdfQ== */");
40
+ }), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9EYXRhTGlzdC9Db250cm9scy9GaWx0ZXJDb250cm9sLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5Q3FCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9EYXRhTGlzdC9Db250cm9scy9GaWx0ZXJDb250cm9sLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZpbHRlckljb24gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1pY29ucyc7XG5pbXBvcnQgeyBzdGF0ZXMgfS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AgICAgICAgIGNvbnN0IG9wdGlvblNlbGVjdGVkID0gaXNTZWxlY3RBbGxcbiAgICAgICAgICAgICAgICA/IGFsbFNlbGVjdGVkXG4gICAgICAgICAgICAgICAgOiAhZmlsdGVycy5pbmNsdWRlcyh2YWx1ZSk7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICA8TWVudUl0ZW0ga2V5PXtwcmVmaXhJZChgZmlsdGVyLSR7Y29sdW1uS2V5fS0ke3ZhbHVlfWApfT5cbiAgICAgICAgICAgICAgICAgIDxDaGVja2JveFxuICAgICAgICAgICAgICAgICAgICBhcmlhLWxhYmVsPXtpc1NlbGVjdEFsbCA/IGAke3RleHR9ICR7ZGltZW5zaW9ufWAgOiB0ZXh0fVxuICAgICAgICAgICAgICAgICAgICBjaGVja2VkPXtvcHRpb25TZWxlY3RlZH1cbiAgICAgICAgICAgICAgICAgICAgaHRtbEZvcj17b3B0aW9uSWR9XG4gICAgICAgICAgICAgICAgICAgIGxhYmVsPXtcbiAgICAgICAgICAgICAgICAgICAgICA8VGV4dFxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25TZWxmPVwiY2VudGVyXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk9XCJpbmxpbmUtYmxvY2tcIlxuICAgICAgICAgICAgICAgICAgICAgICAgZm9udEZhbWlseT1cImJhc2VcIlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFudD1cInAtc21hbGxcIlxuICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIHt0ZXh0fVxuICAgICAgICAgICAgICAgICAgICAgICAge2lzU2VsZWN0QWxsICYmIDxUZXh0IHNjcmVlbnJlYWRlcj4ge2RpbWVuc2lvbn08L1RleHQ+fVxuICAgICAgICAgICAgICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuYW1lPXtvcHRpb25JZH1cbiAgICAgICAgICAgICAgICAgICAgc3BhY2luZz1cInRpZ2h0XCJcbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eygpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICBvbkZpbHRlcj8uKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpbWVuc2lvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXROZXh0RmlsdGVycyh2YWx1ZSwgZmlsdGVycyksXG4gICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgIDwvTWVudUl0ZW0+XG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9KX1cbiAgICAgICAgICA8L01lbnU+XG4gICAgICAgIDwvUG9wb3ZlckNvbnRhaW5lcj5cbiAgICAgICl9XG4gICAgICA8RmlsdGVyVG9nZ2xlXG4gICAgICAgIGFyaWEtZXhwYW5kZWQ9e21lbnVPcGVufVxuICAgICAgICBhcmlhLWhhc3BvcHVwPVwidHJ1ZVwiXG4gICAgICAgIGFyaWEtbGFiZWw9e2BmaWx0ZXIgYnkgJHtjb2x1bW5LZXl9YH1cbiAgICAgICAgZGlzcGxheT1cImlubGluZS1mbGV4XCJcbiAgICAgICAgb3Blbj17bWVudU9wZW59XG4gICAgICAgIHJlZj17dGFyZ2V0fVxuICAgICAgICB2YXJpYW50PVwiaW50ZXJmYWNlXCJcbiAgICAgICAgb25DbGljaz17KCkgPT4gc2V0TWVudU9wZW4odHJ1ZSl9XG4gICAgICA+XG4gICAgICAgIDxGbGV4Qm94IGNlbnRlciBkaW1lbnNpb25zPXsxNn0gbWI9ezR9IG1yPXs0fT5cbiAgICAgICAgICA8RmlsdGVySWNvblxuICAgICAgICAgICAgY29sb3I9e2ZpbHRlcnMubGVuZ3RoID4gMCA/ICdwcmltYXJ5JyA6ICd0ZXh0J31cbiAgICAgICAgICAgIHNpemU9ezE0fVxuICAgICAgICAgIC8+XG4gICAgICAgIDwvRmxleEJveD5cbiAgICAgIDwvRmlsdGVyVG9nZ2xlPlxuICAgIDwvRmxleEJveD5cbiAgKTtcbn07XG4iXX0= */");
41
41
  export const FilterControl = ({
42
42
  columnKey,
43
43
  onFilter,
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { CalendarBodyProps } from './types';
3
+ export declare const CalendarBody: React.FC<CalendarBodyProps>;
@@ -0,0 +1,145 @@
1
+ import { useCallback, useEffect, useMemo, useRef } from 'react';
2
+ import * as React from 'react';
3
+ import { useIsoFirstWeekday, useResolvedLocale } from '../utils/locale';
4
+ import { getDatesWithRow, getMonthGrid, isDateDisabled, isDateInRange, isSameDay } from './utils/dateGrid';
5
+ import { CalendarTable, DateCell, TableHeader } from './utils/elements';
6
+ import { formatDateForAriaLabel, getWeekdayNames } from './utils/format';
7
+ import { keyHandler } from './utils/keyHandler';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const CalendarBody = ({
10
+ displayDate,
11
+ selectedDate,
12
+ endDate = null,
13
+ disabledDates = [],
14
+ onDateSelect,
15
+ locale,
16
+ weekStartsOn,
17
+ labelledById,
18
+ focusedDate,
19
+ onFocusedDateChange,
20
+ onDisplayDateChange,
21
+ onEscapeKeyPress,
22
+ hasAdjacentMonthRight,
23
+ hasAdjacentMonthLeft,
24
+ focusGridSync
25
+ }) => {
26
+ const resolvedLocale = useResolvedLocale(locale);
27
+ const firstWeekday = useIsoFirstWeekday(resolvedLocale, weekStartsOn);
28
+ const year = displayDate.getFullYear();
29
+ const month = displayDate.getMonth();
30
+ const weeks = getMonthGrid(year, month, firstWeekday);
31
+ const weekdayLabels = getWeekdayNames('short', resolvedLocale, firstWeekday);
32
+ const weekdayFullNames = getWeekdayNames('long', resolvedLocale, firstWeekday);
33
+ const buttonRefs = useRef(new Map());
34
+ const tableRef = useRef(null);
35
+ const datesWithRow = useMemo(() => getDatesWithRow(weeks), [weeks]);
36
+ const focusTarget = focusedDate ?? selectedDate;
37
+ const isToday = useCallback(date => date !== null && isSameDay(date, new Date()), []);
38
+ const focusButton = useCallback(date => {
39
+ if (date === null) return false;
40
+ const key = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
41
+ const el = buttonRefs.current.get(key);
42
+ if (!el) return false;
43
+ el.focus();
44
+ return true;
45
+ }, []);
46
+ useEffect(() => {
47
+ // Keep the roving tabindex / focused day aligned with `focusTarget` when it makes sense for a11y.
48
+ if (focusTarget === null) return;
49
+
50
+ // Standalone calendar (e.g. Storybook): always move DOM focus to the active day.
51
+ if (!focusGridSync) {
52
+ focusButton(focusTarget);
53
+ return;
54
+ }
55
+ const inGrid = tableRef.current?.contains(document.activeElement);
56
+ const requested = focusGridSync.gridFocusRequested;
57
+
58
+ // Focus is already in this grid (keyboard nav): update which day is focused as `focusTarget` changes.
59
+ if (inGrid) {
60
+ focusButton(focusTarget);
61
+ return;
62
+ }
63
+
64
+ // DatePicker opened via keyboard / ArrowDown: parent asked to move focus into the grid once.
65
+ if (requested) {
66
+ const success = focusButton(focusTarget);
67
+ if (success) {
68
+ focusGridSync.onGridFocusRequestHandled();
69
+ }
70
+ }
71
+ // If !inGrid && !requested (e.g. calendar opened with the mouse): leave focus on the input — do not call focusButton.
72
+ }, [focusTarget, focusButton, focusGridSync]);
73
+ const handleKeyDown = useCallback((e, date) => keyHandler({
74
+ e,
75
+ date,
76
+ onFocusedDateChange,
77
+ datesWithRow,
78
+ month,
79
+ year,
80
+ disabledDates,
81
+ onDateSelect,
82
+ onEscapeKeyPress,
83
+ onDisplayDateChange,
84
+ hasAdjacentMonthRight,
85
+ hasAdjacentMonthLeft
86
+ }), [onFocusedDateChange, datesWithRow, month, year, disabledDates, onDateSelect, onEscapeKeyPress, onDisplayDateChange, hasAdjacentMonthLeft, hasAdjacentMonthRight]);
87
+ const setButtonRef = useCallback((date, el) => {
88
+ const k = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
89
+ if (el) buttonRefs.current.set(k, el);else buttonRefs.current.delete(k);
90
+ }, []);
91
+ return /*#__PURE__*/_jsxs(CalendarTable, {
92
+ "aria-labelledby": labelledById,
93
+ ref: tableRef,
94
+ role: "grid",
95
+ children: [/*#__PURE__*/_jsx("thead", {
96
+ children: /*#__PURE__*/_jsx("tr", {
97
+ children: weekdayLabels.map((label, i) => /*#__PURE__*/_jsx(TableHeader, {
98
+ abbr: weekdayFullNames[i],
99
+ scope: "col",
100
+ children: label
101
+ }, label))
102
+ })
103
+ }), /*#__PURE__*/_jsx("tbody", {
104
+ children: weeks.map((week, rowIndex) => /*#__PURE__*/_jsx("tr", {
105
+ children: week.map((date, colIndex) => {
106
+ if (date === null) {
107
+ return (
108
+ /*#__PURE__*/
109
+ // eslint-disable-next-line jsx-a11y/control-has-associated-label
110
+ _jsx("td", {
111
+ role: "gridcell"
112
+ }, `empty-${rowIndex}-${colIndex}`)
113
+ );
114
+ }
115
+ const selected = isSameDay(date, selectedDate) || isSameDay(date, endDate);
116
+ const range = !!selectedDate && !!endDate;
117
+ const inRange = range && isDateInRange(date, selectedDate, endDate);
118
+ const disabled = isDateDisabled(date, disabledDates);
119
+ const today = isToday(date);
120
+ // this is making the selected date a differnet color bc it is focused, look into further
121
+ const isFocused = focusTarget !== null && isSameDay(date, focusTarget);
122
+ return /*#__PURE__*/_jsx(DateCell, {
123
+ "aria-current": today ? 'date' : undefined,
124
+ "aria-disabled": disabled,
125
+ "aria-label": formatDateForAriaLabel(date, resolvedLocale),
126
+ "aria-selected": selected || inRange,
127
+ isDisabled: disabled,
128
+ isInRange: inRange,
129
+ isRangeEnd: range && isSameDay(date, endDate),
130
+ isRangeStart: range && isSameDay(date, selectedDate),
131
+ isSelected: selected,
132
+ isToday: today,
133
+ ref: el => setButtonRef(date, el),
134
+ role: "gridcell",
135
+ tabIndex: isFocused ? 0 : -1,
136
+ onClick: () => onDateSelect(date),
137
+ onFocus: () => onFocusedDateChange?.(date),
138
+ onKeyDown: e => handleKeyDown(e, date),
139
+ children: date.getDate()
140
+ }, date.getTime());
141
+ })
142
+ }, week.join('-')))
143
+ })]
144
+ });
145
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { CalendarFooterProps } from './types';
3
+ export declare const CalendarFooter: React.FC<CalendarFooterProps>;
@@ -0,0 +1,57 @@
1
+ import * as React from 'react';
2
+ import { FlexBox } from '../../Box';
3
+ import { TextButton } from '../../Button';
4
+ import { useResolvedLocale } from '../utils/locale';
5
+ import { DEFAULT_DATE_PICKER_TRANSLATIONS } from '../utils/translations';
6
+ import { getRelativeTodayLabel } from './utils/format';
7
+
8
+ // function formatQuickActionLabel(action: QuickAction): string {
9
+ // const { num, timePeriod } = action;
10
+ // const period =
11
+ // timePeriod === 'day'
12
+ // ? num === 1
13
+ // ? 'day'
14
+ // : 'days'
15
+ // : timePeriod === 'week'
16
+ // ? num === 1
17
+ // ? 'week'
18
+ // : 'weeks'
19
+ // : timePeriod === 'month'
20
+ // ? num === 1
21
+ // ? 'month'
22
+ // : 'months'
23
+ // : num === 1
24
+ // ? 'year'
25
+ // : 'years';
26
+ // return `${num} ${period}`;
27
+ // }
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ export const CalendarFooter = ({
30
+ onClearDate,
31
+ onTodayClick,
32
+ locale,
33
+ clearText = DEFAULT_DATE_PICKER_TRANSLATIONS.clearText,
34
+ disabled,
35
+ showClearButton
36
+ }) => {
37
+ const resolvedLocale = useResolvedLocale(locale);
38
+ // const actions = quickActions.slice(0, 3);
39
+
40
+ return /*#__PURE__*/_jsxs(FlexBox, {
41
+ alignItems: "center",
42
+ borderTop: 1,
43
+ justifyContent: "space-between",
44
+ p: 12,
45
+ children: [showClearButton && /*#__PURE__*/_jsx(TextButton, {
46
+ disabled: disabled,
47
+ onClick: () => onClearDate?.(),
48
+ children: clearText
49
+ }), /*#__PURE__*/_jsx(FlexBox, {
50
+ gap: 32,
51
+ children: /*#__PURE__*/_jsx(TextButton, {
52
+ onClick: () => onTodayClick?.(),
53
+ children: getRelativeTodayLabel(resolvedLocale)
54
+ })
55
+ })]
56
+ });
57
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { CalendarHeaderProps } from './types';
3
+ export declare const CalendarHeader: React.FC<CalendarHeaderProps>;
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { FlexBox } from '../../Box';
3
+ import { Text } from '../../Typography';
4
+ import { useResolvedLocale } from '../utils/locale';
5
+ import { CalendarNavLastMonth } from './CalendarNavLastMonth';
6
+ import { CalendarNavNextMonth } from './CalendarNavNextMonth';
7
+ import { formatMonthYear } from './utils/format';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const CalendarHeader = ({
10
+ displayDate,
11
+ locale,
12
+ headingId,
13
+ onDisplayDateChange,
14
+ hideLastNav,
15
+ hideNextNav,
16
+ onLastMonthClick,
17
+ onNextMonthClick
18
+ }) => {
19
+ const resolvedLocale = useResolvedLocale(locale);
20
+ return /*#__PURE__*/_jsxs(FlexBox, {
21
+ alignItems: "center",
22
+ pb: 8,
23
+ children: [!hideLastNav && /*#__PURE__*/_jsx(CalendarNavLastMonth, {
24
+ displayDate: displayDate,
25
+ locale: locale,
26
+ onDisplayDateChange: onDisplayDateChange,
27
+ onLastMonthClick: onLastMonthClick
28
+ }), /*#__PURE__*/_jsx(FlexBox, {
29
+ justifyContent: "center",
30
+ width: "100%",
31
+ children: /*#__PURE__*/_jsx(Text, {
32
+ "aria-live": "polite",
33
+ fontSize: 16,
34
+ fontWeight: "title",
35
+ id: headingId,
36
+ textAlign: "center",
37
+ children: formatMonthYear(displayDate, resolvedLocale)
38
+ })
39
+ }), !hideNextNav && /*#__PURE__*/_jsx(CalendarNavNextMonth, {
40
+ displayDate: displayDate,
41
+ locale: locale,
42
+ onDisplayDateChange: onDisplayDateChange,
43
+ onNextMonthClick: onNextMonthClick
44
+ })]
45
+ });
46
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { CalendarNavProps } from './types';
3
+ export declare const CalendarNavLastMonth: React.FC<CalendarNavProps>;
@@ -0,0 +1,30 @@
1
+ import { MiniChevronLeftIcon } from '@codecademy/gamut-icons';
2
+ import * as React from 'react';
3
+ import { IconButton } from '../../Button';
4
+ import { useResolvedLocale } from '../utils/locale';
5
+ import { getRelativeMonthLabels } from './utils/format';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const CalendarNavLastMonth = ({
8
+ displayDate,
9
+ onDisplayDateChange,
10
+ onLastMonthClick,
11
+ locale
12
+ }) => {
13
+ const resolvedLocale = useResolvedLocale(locale);
14
+ const {
15
+ lastMonth
16
+ } = getRelativeMonthLabels(resolvedLocale);
17
+ const handleLastMonth = () => {
18
+ const lastMonth = new Date(displayDate.getFullYear(), displayDate.getMonth() - 1, 1);
19
+ onDisplayDateChange?.(lastMonth);
20
+ onLastMonthClick?.();
21
+ };
22
+ return /*#__PURE__*/_jsx(IconButton, {
23
+ alignSelf: "flex-start",
24
+ "aria-label": lastMonth,
25
+ icon: MiniChevronLeftIcon,
26
+ size: "small",
27
+ tip: lastMonth,
28
+ onClick: handleLastMonth
29
+ });
30
+ };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { CalendarNavProps } from './types';
3
+ export declare const CalendarNavNextMonth: React.FC<CalendarNavProps>;
@@ -0,0 +1,30 @@
1
+ import { MiniChevronRightIcon } from '@codecademy/gamut-icons';
2
+ import * as React from 'react';
3
+ import { IconButton } from '../../Button';
4
+ import { useResolvedLocale } from '../utils/locale';
5
+ import { getRelativeMonthLabels } from './utils/format';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const CalendarNavNextMonth = ({
8
+ displayDate,
9
+ onDisplayDateChange,
10
+ onNextMonthClick,
11
+ locale
12
+ }) => {
13
+ const resolvedLocale = useResolvedLocale(locale);
14
+ const {
15
+ nextMonth
16
+ } = getRelativeMonthLabels(resolvedLocale);
17
+ const handleNextMonth = () => {
18
+ const nextMonth = new Date(displayDate.getFullYear(), displayDate.getMonth() + 1, 1);
19
+ onDisplayDateChange?.(nextMonth);
20
+ onNextMonthClick?.();
21
+ };
22
+ return /*#__PURE__*/_jsx(IconButton, {
23
+ alignSelf: "flex-end",
24
+ "aria-label": nextMonth,
25
+ icon: MiniChevronRightIcon,
26
+ size: "small",
27
+ tip: nextMonth,
28
+ onClick: handleNextMonth
29
+ });
30
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { WithChildrenProp } from '../../utils';
3
+ /**
4
+ * Outer wrapper for the calendar (header + body + footer).
5
+ * Used by DatePickerCalendar to group the calendar content.
6
+ * Renders a CheckerDense pattern shadow at offset left 8, top 8.
7
+ */
8
+ export declare const CalendarWrapper: React.FC<WithChildrenProp>;
@@ -0,0 +1,27 @@
1
+ import { CheckerDense } from '@codecademy/gamut-patterns';
2
+ import * as React from 'react';
3
+ import { Box } from '../../Box';
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ /**
6
+ * Outer wrapper for the calendar (header + body + footer).
7
+ * Used by DatePickerCalendar to group the calendar content.
8
+ * Renders a CheckerDense pattern shadow at offset left 8, top 8.
9
+ */
10
+ export const CalendarWrapper = ({
11
+ children
12
+ }) => /*#__PURE__*/_jsxs(Box, {
13
+ position: "relative",
14
+ width: "max-content",
15
+ children: [/*#__PURE__*/_jsx(CheckerDense, {
16
+ left: 8,
17
+ position: "absolute",
18
+ top: 8
19
+ }), /*#__PURE__*/_jsx(Box, {
20
+ bg: "background",
21
+ border: 1,
22
+ borderRadius: "sm",
23
+ position: "relative",
24
+ zIndex: 1,
25
+ children: children
26
+ })]
27
+ });
@@ -0,0 +1,6 @@
1
+ export * from './CalendarWrapper';
2
+ export * from './CalendarHeader';
3
+ export * from './CalendarBody';
4
+ export * from './CalendarFooter';
5
+ export * from './CalendarNavLastMonth';
6
+ export * from './CalendarNavNextMonth';
@@ -0,0 +1,6 @@
1
+ export * from './CalendarWrapper';
2
+ export * from './CalendarHeader';
3
+ export * from './CalendarBody';
4
+ export * from './CalendarFooter';
5
+ export * from './CalendarNavLastMonth';
6
+ export * from './CalendarNavNextMonth';
@@ -0,0 +1,77 @@
1
+ import type { IsoWeekday } from '../utils/locale';
2
+ export interface CalendarBaseProps {
3
+ /** Used for the currently displayed month and year */
4
+ displayDate: Date;
5
+ /** Called when the displayed month changes. Pass the new date (e.g. setDisplayDate) so the calendar updates. */
6
+ onDisplayDateChange: (newDate: Date) => void;
7
+ /**
8
+ * Locale for formatting and `Intl.Locale` APIs. Accepts `Intl.LocalesArgument` (e.g. `'en-US'`,
9
+ * `['en-GB', 'en']`, or a prebuilt `Intl.Locale`). Omitted → runtime default (user agent).
10
+ */
11
+ locale?: Intl.LocalesArgument;
12
+ /** Dates that should be disabled (unselectable) */
13
+ disabledDates?: Date[];
14
+ }
15
+ export interface CalendarNavProps extends Omit<CalendarBaseProps, 'disabledDates'> {
16
+ /** Called after navigating to previous month. */
17
+ onLastMonthClick?: () => void;
18
+ /** Called after navigating to next month */
19
+ onNextMonthClick?: () => void;
20
+ }
21
+ export interface CalendarHeaderProps extends CalendarNavProps {
22
+ hideLastNav?: boolean;
23
+ hideNextNav?: boolean;
24
+ /** Used for the currently displayed second month and year when in two-month view */
25
+ secondDisplayDate?: Date;
26
+ /** id for the heading (for grid aria-labelledby) */
27
+ headingId: string;
28
+ }
29
+ export interface CalendarBodyProps extends CalendarBaseProps {
30
+ /** Selected start date (single or range start) */
31
+ selectedDate: Date | null;
32
+ /** Selected end date (range only; undefined for single-date mode) */
33
+ endDate?: Date | null;
34
+ /** Called when a date cell is selected */
35
+ onDateSelect: (date: Date) => void;
36
+ /**
37
+ * Force first column to this ISO weekday (1 = Monday … 7 = Sunday). Same scale as
38
+ * `Intl.Locale#getWeekInfo().firstDay`. Omit to use locale (polyfill where needed).
39
+ */
40
+ weekStartsOn?: IsoWeekday;
41
+ /** Id of the month/year heading (aria-labelledby on grid) */
42
+ labelledById: string;
43
+ /** For keyboard nav: which cell has focus (roving tabindex) */
44
+ focusedDate: Date | null;
45
+ /** Callback when focused date changes (e.g. arrow keys) */
46
+ onFocusedDateChange: (date: Date | null) => void;
47
+ /** Called when the escape key is pressed */
48
+ onEscapeKeyPress?: () => void;
49
+ /** When true (e.g. two-month view), arrow keys move focus to adjacent month without changing visible date. */
50
+ hasAdjacentMonthRight?: boolean;
51
+ /** When true (e.g. two-month view), arrow keys move focus to adjacent month without changing visible date. */
52
+ hasAdjacentMonthLeft?: boolean;
53
+ /**
54
+ * When set (DatePicker), only programmatically focuses a day when the grid already has focus
55
+ * or `gridFocusRequested` is true (keyboard open / ArrowDown from input).
56
+ * Omit for standalone calendar stories — keeps legacy behavior (always sync focus to focusedDate).
57
+ */
58
+ focusGridSync?: {
59
+ gridFocusRequested: boolean;
60
+ signal: boolean;
61
+ onGridFocusRequestHandled: () => void;
62
+ };
63
+ }
64
+ export interface QuickAction {
65
+ num: number;
66
+ timePeriod: 'day' | 'week' | 'month' | 'year';
67
+ onClick: () => void;
68
+ }
69
+ export interface CalendarFooterProps extends Pick<CalendarBaseProps, 'locale'> {
70
+ disabled?: boolean;
71
+ showClearButton?: boolean;
72
+ clearText?: string;
73
+ onClearDate?: () => void;
74
+ onTodayClick?: () => void;
75
+ /** Max 3 quick actions (e.g. "7 days", "1 month") */
76
+ quickActions?: QuickAction[];
77
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Builds a grid of days for a calendar month using native Date and Intl.
3
+ * Each row has 7 cells; leading/trailing cells may be null (padding from adjacent months).
4
+ */
5
+ import type { IsoWeekday } from '../../utils/locale';
6
+ /**
7
+ * Number of empty cells before the 1st of the month, for a grid whose first column is
8
+ * `firstWeekday` (ISO: 1 = Monday … 7 = Sunday from `Intl.Locale#getWeekInfo`).
9
+ */
10
+ export declare const getWeekdayOffsetInGrid: (date: Date, firstWeekday: IsoWeekday) => number;
11
+ /**
12
+ * Returns an array of weeks for the given month. Each week is an array of 7 items:
13
+ * each item is either a Date (that day) or null (padding from previous/next month).
14
+ *
15
+ * @param year - Full year (e.g. 2026)
16
+ * @param month - Month 0-11 (0 = January)
17
+ * @param firstWeekday - First day of the week for the calendar row (ISO 1–7, from `getWeekInfo().firstDay`)
18
+ */
19
+ export declare const getMonthGrid: (year: number, month: number, firstWeekday: IsoWeekday) => (Date | null)[][];
20
+ /**
21
+ * Check if two dates are the same calendar day (ignoring time).
22
+ */
23
+ export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
24
+ /**
25
+ * Check if `date` is between `start` and `end` (exclusive), ignoring time.
26
+ */
27
+ export declare const isDateInRange: (date: Date, start: Date | null, end: Date | null) => boolean;
28
+ /**
29
+ * Check if `date` is in the `disabledDates` list (by calendar day).
30
+ */
31
+ export declare const isDateDisabled: (date: Date, disabledDates?: Date[]) => boolean;
32
+ /** One visible day in the month grid with its row (for Home/End and keyboard nav). */
33
+ export type DateWithRow = {
34
+ date: Date;
35
+ rowIndex: number;
36
+ };
37
+ /** Flat list of dates in grid order (row-major, non-null only) with row index for Home/End */
38
+ export declare const getDatesWithRow: (weeks: (Date | null)[][]) => DateWithRow[];
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Builds a grid of days for a calendar month using native Date and Intl.
3
+ * Each row has 7 cells; leading/trailing cells may be null (padding from adjacent months).
4
+ */
5
+
6
+ const DAYS_PER_WEEK = 7;
7
+
8
+ /**
9
+ * Normalize to start of day in local time for comparison.
10
+ */
11
+ const normalizeDate = date => {
12
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
13
+ };
14
+
15
+ /**
16
+ * Number of empty cells before the 1st of the month, for a grid whose first column is
17
+ * `firstWeekday` (ISO: 1 = Monday … 7 = Sunday from `Intl.Locale#getWeekInfo`).
18
+ */
19
+ export const getWeekdayOffsetInGrid = (date, firstWeekday) => {
20
+ const js = date.getDay();
21
+ const iso = js === 0 ? 7 : js;
22
+ return (iso - firstWeekday + 14) % 7;
23
+ };
24
+
25
+ /**
26
+ * Returns an array of weeks for the given month. Each week is an array of 7 items:
27
+ * each item is either a Date (that day) or null (padding from previous/next month).
28
+ *
29
+ * @param year - Full year (e.g. 2026)
30
+ * @param month - Month 0-11 (0 = January)
31
+ * @param firstWeekday - First day of the week for the calendar row (ISO 1–7, from `getWeekInfo().firstDay`)
32
+ */
33
+ export const getMonthGrid = (year, month, firstWeekday) => {
34
+ const first = new Date(year, month, 1);
35
+ const last = new Date(year, month + 1, 0);
36
+ const firstDayOfWeek = getWeekdayOffsetInGrid(first, firstWeekday);
37
+ const daysInMonth = last.getDate();
38
+ const weeks = [];
39
+ let currentWeek = [];
40
+ for (let i = 0; i < firstDayOfWeek; i += 1) {
41
+ currentWeek.push(null);
42
+ }
43
+ for (let day = 1; day <= daysInMonth; day += 1) {
44
+ currentWeek.push(new Date(year, month, day));
45
+ if (currentWeek.length === DAYS_PER_WEEK) {
46
+ weeks.push(currentWeek);
47
+ currentWeek = [];
48
+ }
49
+ }
50
+
51
+ // Pad end of last week with nulls
52
+ if (currentWeek.length > 0) {
53
+ while (currentWeek.length < DAYS_PER_WEEK) {
54
+ currentWeek.push(null);
55
+ }
56
+ weeks.push(currentWeek);
57
+ }
58
+ return weeks;
59
+ };
60
+
61
+ /**
62
+ * Check if two dates are the same calendar day (ignoring time).
63
+ */
64
+ export const isSameDay = (a, b) => {
65
+ if (a === null || b === null) return false;
66
+ return normalizeDate(a) === normalizeDate(b);
67
+ };
68
+
69
+ /**
70
+ * Check if `date` is between `start` and `end` (exclusive), ignoring time.
71
+ */
72
+ export const isDateInRange = (date, start, end) => {
73
+ if (start === null) return false;
74
+ const normalizedDateTime = normalizeDate(date);
75
+ const normalizedStartDateTime = normalizeDate(start);
76
+ const normalizedEndDateTime = end !== null ? normalizeDate(end) : normalizedStartDateTime;
77
+ const low = Math.min(normalizedStartDateTime, normalizedEndDateTime);
78
+ const high = Math.max(normalizedStartDateTime, normalizedEndDateTime);
79
+ return normalizedDateTime > low && normalizedDateTime < high;
80
+ };
81
+
82
+ /**
83
+ * Check if `date` is in the `disabledDates` list (by calendar day).
84
+ */
85
+ export const isDateDisabled = (date, disabledDates = []) => {
86
+ return disabledDates.some(d => isSameDay(date, d));
87
+ };
88
+
89
+ /** One visible day in the month grid with its row (for Home/End and keyboard nav). */
90
+
91
+ /** Flat list of dates in grid order (row-major, non-null only) with row index for Home/End */
92
+ export const getDatesWithRow = weeks => {
93
+ const result = [];
94
+ weeks.forEach((week, rowIndex) => {
95
+ week.forEach(date => {
96
+ if (date !== null) result.push({
97
+ date,
98
+ rowIndex
99
+ });
100
+ });
101
+ });
102
+ return result;
103
+ };