@atlaskit/calendar 13.1.16 → 13.2.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 (52) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/calendar.js +46 -12
  3. package/dist/cjs/internal/components/date.js +50 -22
  4. package/dist/cjs/internal/components/header.js +26 -11
  5. package/dist/cjs/internal/components/week-days.js +7 -0
  6. package/dist/cjs/internal/components/week-header.js +14 -16
  7. package/dist/cjs/internal/hooks/use-get-weeks.js +6 -2
  8. package/dist/cjs/internal/hooks/use-handle-date-change.js +6 -1
  9. package/dist/cjs/internal/hooks/use-locale.js +5 -1
  10. package/dist/cjs/internal/styles/date.js +27 -29
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/calendar.js +45 -14
  13. package/dist/es2019/internal/components/date.js +50 -22
  14. package/dist/es2019/internal/components/header.js +26 -11
  15. package/dist/es2019/internal/components/week-days.js +7 -0
  16. package/dist/es2019/internal/components/week-header.js +5 -6
  17. package/dist/es2019/internal/hooks/use-get-weeks.js +6 -2
  18. package/dist/es2019/internal/hooks/use-handle-date-change.js +4 -1
  19. package/dist/es2019/internal/hooks/use-locale.js +3 -1
  20. package/dist/es2019/internal/styles/date.js +6 -4
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/calendar.js +47 -13
  23. package/dist/esm/internal/components/date.js +50 -22
  24. package/dist/esm/internal/components/header.js +26 -11
  25. package/dist/esm/internal/components/week-days.js +7 -0
  26. package/dist/esm/internal/components/week-header.js +14 -16
  27. package/dist/esm/internal/hooks/use-get-weeks.js +6 -2
  28. package/dist/esm/internal/hooks/use-handle-date-change.js +6 -1
  29. package/dist/esm/internal/hooks/use-locale.js +5 -1
  30. package/dist/esm/internal/styles/date.js +27 -30
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/calendar.d.ts +1 -1
  33. package/dist/types/internal/components/date.d.ts +5 -0
  34. package/dist/types/internal/components/header.d.ts +5 -0
  35. package/dist/types/internal/components/week-days.d.ts +4 -0
  36. package/dist/types/internal/hooks/use-get-weeks.d.ts +2 -1
  37. package/dist/types/internal/hooks/use-handle-date-change.d.ts +2 -1
  38. package/dist/types/internal/hooks/use-locale.d.ts +1 -0
  39. package/dist/types/internal/types.d.ts +1 -0
  40. package/dist/types/types.d.ts +4 -2
  41. package/dist/types-ts4.5/calendar.d.ts +1 -1
  42. package/dist/types-ts4.5/internal/components/date.d.ts +5 -0
  43. package/dist/types-ts4.5/internal/components/header.d.ts +5 -0
  44. package/dist/types-ts4.5/internal/components/week-days.d.ts +4 -0
  45. package/dist/types-ts4.5/internal/hooks/use-get-weeks.d.ts +2 -1
  46. package/dist/types-ts4.5/internal/hooks/use-handle-date-change.d.ts +5 -1
  47. package/dist/types-ts4.5/internal/hooks/use-locale.d.ts +1 -0
  48. package/dist/types-ts4.5/internal/types.d.ts +1 -0
  49. package/dist/types-ts4.5/types.d.ts +4 -2
  50. package/package.json +12 -5
  51. package/report.api.md +4 -1
  52. package/tmp/api-report-tmp.d.ts +4 -1
@@ -1,6 +1,6 @@
1
1
  import type { ChangeEvent } from '../../types';
2
2
  import type { ArrowKeys } from '../types';
3
- export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], onChange, }: {
3
+ export default function useHandleDateChange({ day: [dayValue, setDayValue], month: [monthValue, setMonthValue], year: [yearValue, setYearValue], shouldSetFocus: [shouldSetFocus, setShouldSetFocus], onChange, }: {
4
4
  day: readonly [
5
5
  number,
6
6
  (newValue: number) => void
@@ -13,6 +13,10 @@ export default function useHandleDateChange({ day: [dayValue, setDayValue], mont
13
13
  number,
14
14
  (newValue: number) => void
15
15
  ];
16
+ shouldSetFocus: readonly [
17
+ boolean,
18
+ (newValue: boolean) => void
19
+ ];
16
20
  onChange: (event: ChangeEvent) => void;
17
21
  }): {
18
22
  navigate: (type: ArrowKeys) => void;
@@ -5,4 +5,5 @@ export default function useLocale({ locale, weekStartDay, }: {
5
5
  }): {
6
6
  monthsLong: string[];
7
7
  daysShort: string[];
8
+ daysLong: string[];
8
9
  };
@@ -17,6 +17,7 @@ export interface Week {
17
17
  id: string;
18
18
  values: Array<{
19
19
  id: string;
20
+ weekDayName: string;
20
21
  } & DateObj & WeekDayState>;
21
22
  }
22
23
  export interface CalendarDate extends DateObj {
@@ -3,6 +3,7 @@ import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-
3
3
  import { ThemeModes } from '@atlaskit/theme/types';
4
4
  import type { ArrowKeys, DateObj, ISODate } from './internal/types';
5
5
  export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
6
+ export type TabIndex = -1 | 0;
6
7
  export type ChangeEvent = {
7
8
  iso: ISODate;
8
9
  type: 'left' | 'up' | 'right' | 'down' | 'prev' | 'next';
@@ -150,9 +151,10 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
150
151
  */
151
152
  mode?: ThemeModes;
152
153
  /**
153
- * Tab index indicates if the calendar can be focused by keyboard or only programmatically.
154
+ * Indicates if the calendar can be focused by keyboard or only
155
+ * programmatically. Defaults to "0".
154
156
  */
155
- tabIndex?: number;
157
+ tabIndex?: TabIndex;
156
158
  }
157
159
  export interface CalendarRef {
158
160
  navigate: (type: ArrowKeys) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/calendar",
3
- "version": "13.1.16",
3
+ "version": "13.2.0",
4
4
  "description": "An interactive calendar for date selection experiences.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,7 +23,7 @@
23
23
  "sideEffects": false,
24
24
  "atlaskit:src": "src/index.tsx",
25
25
  "atlassian": {
26
- "team": "Design System Fundamentals",
26
+ "team": "Design System Team",
27
27
  "releaseModel": "continuous",
28
28
  "website": {
29
29
  "name": "Calendar",
@@ -32,15 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/analytics-next": "^9.1.0",
35
- "@atlaskit/button": "^16.8.0",
35
+ "@atlaskit/button": "^16.9.0",
36
36
  "@atlaskit/ds-explorations": "^2.2.0",
37
37
  "@atlaskit/ds-lib": "^2.2.0",
38
38
  "@atlaskit/heading": "^1.3.0",
39
39
  "@atlaskit/icon": "^21.12.0",
40
40
  "@atlaskit/locale": "^2.5.0",
41
- "@atlaskit/primitives": "^1.0.6",
41
+ "@atlaskit/platform-feature-flags": "*",
42
+ "@atlaskit/primitives": "^1.2.0",
42
43
  "@atlaskit/theme": "^12.5.0",
43
- "@atlaskit/tokens": "^1.13.0",
44
+ "@atlaskit/tokens": "^1.14.0",
44
45
  "@atlaskit/visually-hidden": "^1.2.0",
45
46
  "@babel/runtime": "^7.0.0",
46
47
  "@emotion/react": "^11.7.1",
@@ -55,6 +56,7 @@
55
56
  "@atlaskit/visual-regression": "*",
56
57
  "@atlaskit/webdriver-runner": "*",
57
58
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
59
+ "@atlassian/feature-flags-test-utils": "*",
58
60
  "@testing-library/dom": "^8.17.1",
59
61
  "@testing-library/react": "^12.1.5",
60
62
  "jest-in-case": "^1.0.2",
@@ -88,6 +90,11 @@
88
90
  ]
89
91
  }
90
92
  },
93
+ "platform-feature-flags": {
94
+ "platform.design-system-team.calendar-keyboard-accessibility_967h1": {
95
+ "type": "boolean"
96
+ }
97
+ },
91
98
  "af:exports": {
92
99
  "./types": "./src/entry-points/types.tsx",
93
100
  ".": "./src/index.tsx"
package/report.api.md CHANGED
@@ -99,7 +99,7 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
99
99
  previousMonthLabel?: string;
100
100
  selected?: Array<string>;
101
101
  style?: CSSProperties;
102
- tabIndex?: number;
102
+ tabIndex?: TabIndex;
103
103
  testId?: string;
104
104
  today?: string;
105
105
  weekStartDay?: WeekDay;
@@ -133,6 +133,9 @@ export type SelectEvent = {
133
133
  iso: ISODate;
134
134
  } & DateObj;
135
135
 
136
+ // @public (undocumented)
137
+ type TabIndex = -1 | 0;
138
+
136
139
  // @public (undocumented)
137
140
  type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
138
141
 
@@ -50,7 +50,7 @@ export interface CalendarProps extends WithAnalyticsEventsProps {
50
50
  previousMonthLabel?: string;
51
51
  selected?: Array<string>;
52
52
  style?: CSSProperties;
53
- tabIndex?: number;
53
+ tabIndex?: TabIndex;
54
54
  testId?: string;
55
55
  today?: string;
56
56
  weekStartDay?: WeekDay;
@@ -84,6 +84,9 @@ export type SelectEvent = {
84
84
  iso: ISODate;
85
85
  } & DateObj;
86
86
 
87
+ // @public (undocumented)
88
+ type TabIndex = -1 | 0;
89
+
87
90
  // @public (undocumented)
88
91
  type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
89
92