@atlaskit/datetime-picker 13.11.2 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,12 +4,48 @@ import { type DropdownIndicatorProps, type OptionType, type SelectProps } from '
4
4
  export type Appearance = 'default' | 'subtle' | 'none';
5
5
  export type Spacing = 'compact' | 'default';
6
6
  type Combine<First, Second> = Omit<First, keyof Second> & Second;
7
+ /**
8
+ * Props to apply to the select. These include all of [the props from our
9
+ * `Select` component](/components/select). For the following properties, use
10
+ * the top-level prop alternatives:
11
+ *
12
+ * - `aria-describedby`, use `aria-describedby` prop
13
+ * - `aria-label`, use `label` prop
14
+ * - `inputId`, use `id` prop
15
+ * - `placeholder`, use `placeholder` prop
16
+ *
17
+ * Example:
18
+ *
19
+ * ```tsx
20
+ * // Don't do this
21
+ * <DatePicker selectProps={{
22
+ * 'aria-describedby': 'helper-id'
23
+ * }} />
24
+ *
25
+ * // Do this
26
+ * <DatePicker aria-describedby="helper-id" />
27
+ * ```
28
+ */
29
+ export type DateTimePickerSelectProps = Combine<SelectProps<OptionType>, {
30
+ /**
31
+ * Use the `aria-describedby` prop on the picker..
32
+ */
33
+ 'aria-describedby'?: never;
34
+ /**
35
+ * Use the `label` prop on the picker..
36
+ */
37
+ 'aria-label'?: never;
38
+ /**
39
+ * Use the `id` prop on the picker.`.
40
+ */
41
+ inputId?: never;
42
+ /**
43
+ * Use the `placeholder` prop on the picker.
44
+ */
45
+ placeholder?: never;
46
+ }>;
7
47
  interface PickerSelectProps {
8
- /**
9
- * Props to apply to the select. These include all of [the props from our
10
- * `Select` component](/components/select).
11
- */
12
- selectProps?: Combine<SelectProps<OptionType>, {}>;
48
+ selectProps?: DateTimePickerSelectProps;
13
49
  }
14
50
  export interface DatePickerBaseProps extends WithAnalyticsEventsProps, PickerSelectProps {
15
51
  /**
@@ -298,8 +334,8 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
298
334
  /**
299
335
  * Used to associate accessible descriptions to both the date and time
300
336
  * picker. If you want to associate individual accessible descriptions, this
301
- * should be done through the `datePickerSelectProps` and
302
- * `timePickerSelectProps`.
337
+ * should be done through the `aria-describedby` props on the
338
+ * `datePickerProps` and `timePickerProps`.
303
339
  */
304
340
  'aria-describedby'?: string;
305
341
  /**
@@ -345,18 +381,10 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
345
381
  * The ISO time that should be used as the input value.
346
382
  */
347
383
  value?: string;
348
- /**
349
- * Set if users can edit the input, allowing them to add custom times.
350
- */
351
- timeIsEditable?: boolean;
352
384
  /**
353
385
  * Set if the picker has an invalid value.
354
386
  */
355
387
  isInvalid?: boolean;
356
- /**
357
- * Format the date with a string that is accepted by [date-fns's format function](https://date-fns.org/v1.29.0/docs/format).
358
- */
359
- dateFormat?: string;
360
388
  /**
361
389
  * Props applied to the `DatePicker`.
362
390
  */
@@ -373,22 +401,6 @@ export interface DateTimePickerBaseProps extends WithAnalyticsEventsProps {
373
401
  timeValue: string;
374
402
  zoneValue: string;
375
403
  };
376
- /**
377
- * [Select props](/components/select) to pass onto the `DatePicker` component's `Select`. This can be used to set options such as placeholder text.
378
- */
379
- datePickerSelectProps?: SelectProps<any>;
380
- /**
381
- * [Select props](/components/select) to pass onto the `TimePicker` component's `Select`. This can be used to set options such as placeholder text.
382
- */
383
- timePickerSelectProps?: SelectProps<any>;
384
- /**
385
- * The times shown by the `TimePicker`.
386
- */
387
- times?: Array<string>;
388
- /**
389
- * The format that times are displayed in. Values should be those accepted by [date-fns's format function](https://date-fns.org/v1.29.0/docs/format).
390
- */
391
- timeFormat?: string;
392
404
  /**
393
405
  * The spacing for the select control.
394
406
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "13.11.2",
3
+ "version": "14.0.0",
4
4
  "description": "A date time picker allows the user to select an associated date and time.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,17 +42,16 @@
42
42
  "@atlaskit/analytics-next": "^10.1.0",
43
43
  "@atlaskit/calendar": "^14.5.0",
44
44
  "@atlaskit/ds-lib": "^2.5.0",
45
- "@atlaskit/icon": "^22.13.0",
45
+ "@atlaskit/icon": "^22.14.0",
46
46
  "@atlaskit/layering": "^0.4.0",
47
47
  "@atlaskit/locale": "^2.8.0",
48
48
  "@atlaskit/popper": "^6.2.0",
49
49
  "@atlaskit/select": "^17.15.0",
50
50
  "@atlaskit/theme": "^13.0.0",
51
- "@atlaskit/tokens": "^1.58.0",
51
+ "@atlaskit/tokens": "^1.59.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",
54
- "date-fns": "^2.17.0",
55
- "lodash": "^4.17.21"
54
+ "date-fns": "^2.17.0"
56
55
  },
57
56
  "peerDependencies": {
58
57
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@@ -62,6 +61,7 @@
62
61
  "@af/integration-testing": "*",
63
62
  "@af/visual-regression": "*",
64
63
  "@atlaskit/button": "^20.1.0",
64
+ "@atlaskit/codemod-utils": "4.2.4",
65
65
  "@atlaskit/docs": "*",
66
66
  "@atlaskit/form": "^10.5.0",
67
67
  "@atlaskit/modal-dialog": "^12.15.0",
@@ -77,6 +77,7 @@
77
77
  "@testing-library/user-event": "^14.4.3",
78
78
  "@types/testing-library__jest-dom": "^5.14.5",
79
79
  "jest-in-case": "^1.0.2",
80
+ "jscodeshift": "^0.13.0",
80
81
  "moment": "^2.29.2",
81
82
  "react-dom": "^16.8.0",
82
83
  "react-lorem-component": "^0.13.0",