@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.
- package/CHANGELOG.md +19 -0
- package/codemods/14.0.0-remove-duplicate-and-unused-props.tsx +432 -0
- package/codemods/__tests__/next-remove-duplicate-and-unused-props.tsx +1225 -0
- package/codemods/utils/helpers.tsx +306 -0
- package/dist/cjs/components/date-picker.js +22 -24
- package/dist/cjs/components/date-time-picker.js +73 -68
- package/dist/cjs/components/time-picker.js +13 -11
- package/dist/es2019/components/date-picker.js +21 -22
- package/dist/es2019/components/date-time-picker.js +66 -72
- package/dist/es2019/components/time-picker.js +13 -14
- package/dist/esm/components/date-picker.js +22 -24
- package/dist/esm/components/date-time-picker.js +73 -68
- package/dist/esm/components/time-picker.js +13 -11
- package/dist/types/components/date-picker.d.ts +2 -12
- package/dist/types/components/date-time-picker.d.ts +3 -6
- package/dist/types/components/time-picker.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +43 -31
- package/dist/types-ts4.5/components/date-picker.d.ts +2 -12
- package/dist/types-ts4.5/components/date-time-picker.d.ts +3 -6
- package/dist/types-ts4.5/components/time-picker.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +43 -31
- package/package.json +6 -5
|
@@ -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 `
|
|
302
|
-
* `
|
|
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": "
|
|
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.
|
|
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.
|
|
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",
|