@atlaskit/checkbox 13.3.0 → 13.5.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 +873 -858
- package/README.md +2 -1
- package/__perf__/checkbox.tsx +54 -72
- package/__perf__/default.tsx +7 -7
- package/codemods/12.0.0-lite-mode.tsx +12 -16
- package/codemods/__tests__/12.0.0-lite-mode.tsx +105 -105
- package/codemods/migrations/remove-imports.tsx +3 -3
- package/codemods/migrations/remove-props.tsx +9 -13
- package/codemods/migrations/rename-import.tsx +10 -10
- package/codemods/migrations/rename-input-ref-to-ref.tsx +4 -4
- package/codemods/utils.tsx +362 -401
- package/dist/cjs/checkbox.js +27 -2
- package/dist/cjs/internal/checkbox-icon.js +2 -0
- package/dist/cjs/internal/label-text.js +4 -0
- package/dist/cjs/internal/label.js +10 -1
- package/dist/cjs/internal/required-indicator.js +6 -2
- package/dist/es2019/checkbox.js +27 -1
- package/dist/es2019/internal/checkbox-icon.js +2 -0
- package/dist/es2019/internal/label-text.js +4 -0
- package/dist/es2019/internal/label.js +10 -1
- package/dist/es2019/internal/required-indicator.js +6 -2
- package/dist/esm/checkbox.js +28 -2
- package/dist/esm/internal/checkbox-icon.js +2 -0
- package/dist/esm/internal/label-text.js +4 -0
- package/dist/esm/internal/label.js +10 -1
- package/dist/esm/internal/required-indicator.js +6 -2
- package/dist/types/internal/label-text.d.ts +4 -1
- package/dist/types/internal/label.d.ts +5 -2
- package/dist/types/internal/required-indicator.d.ts +3 -0
- package/dist/types/types.d.ts +12 -1
- package/dist/types-ts4.5/internal/label-text.d.ts +4 -1
- package/dist/types-ts4.5/internal/label.d.ts +5 -2
- package/dist/types-ts4.5/internal/required-indicator.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +12 -1
- package/extract-react-types/checkbox-props.tsx +2 -2
- package/package.json +93 -93
- package/report.api.md +41 -46
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
3
|
+
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
3
4
|
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
@@ -70,6 +71,11 @@ export type OwnProps = {
|
|
|
70
71
|
* Additional information to be included in the `context` of analytics events that come from radio.
|
|
71
72
|
*/
|
|
72
73
|
analyticsContext?: Record<string, any>;
|
|
74
|
+
/**
|
|
75
|
+
* Bounded style API. Defining allowed styles through this prop will be supported for future component
|
|
76
|
+
* iterations. Any styles that are not allowed by this API will result in type and land blocking violations.
|
|
77
|
+
*/
|
|
78
|
+
xcss?: StrictXCSSProp<'alignItems', never>;
|
|
73
79
|
};
|
|
74
80
|
type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
75
81
|
export type CheckboxProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
@@ -99,5 +105,10 @@ export interface LabelProps extends React.HTMLProps<HTMLInputElement> {
|
|
|
99
105
|
* as Firefox does not dispatch modified click events (e.g. Ctrl+Click) down to the underlying input element.
|
|
100
106
|
*/
|
|
101
107
|
onClick?: React.MouseEventHandler;
|
|
108
|
+
/**
|
|
109
|
+
* Bounded style overrides. Defining allowed styles through this prop will be supported for future component
|
|
110
|
+
* iterations. Any styles that are not allowed by this API will result in type and land blocking violations.
|
|
111
|
+
*/
|
|
112
|
+
xcss?: StrictXCSSProp<'alignItems', never>;
|
|
102
113
|
}
|
|
103
114
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { LabelTextProps } from '../types';
|
|
6
|
+
import { type LabelTextProps } from '../types';
|
|
4
7
|
export default function LabelText({ children }: LabelTextProps): jsx.JSX.Element;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { LabelProps } from '../types';
|
|
4
|
-
export default function Label({ children, isDisabled, testId, label, id, }: LabelProps): jsx.JSX.Element;
|
|
6
|
+
import { type LabelProps } from '../types';
|
|
7
|
+
export default function Label({ children, isDisabled, testId, label, id, xcss }: LabelProps): jsx.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
3
|
+
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
3
4
|
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
@@ -70,6 +71,11 @@ export type OwnProps = {
|
|
|
70
71
|
* Additional information to be included in the `context` of analytics events that come from radio.
|
|
71
72
|
*/
|
|
72
73
|
analyticsContext?: Record<string, any>;
|
|
74
|
+
/**
|
|
75
|
+
* Bounded style API. Defining allowed styles through this prop will be supported for future component
|
|
76
|
+
* iterations. Any styles that are not allowed by this API will result in type and land blocking violations.
|
|
77
|
+
*/
|
|
78
|
+
xcss?: StrictXCSSProp<'alignItems', never>;
|
|
73
79
|
};
|
|
74
80
|
type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
75
81
|
export type CheckboxProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
@@ -99,5 +105,10 @@ export interface LabelProps extends React.HTMLProps<HTMLInputElement> {
|
|
|
99
105
|
* as Firefox does not dispatch modified click events (e.g. Ctrl+Click) down to the underlying input element.
|
|
100
106
|
*/
|
|
101
107
|
onClick?: React.MouseEventHandler;
|
|
108
|
+
/**
|
|
109
|
+
* Bounded style overrides. Defining allowed styles through this prop will be supported for future component
|
|
110
|
+
* iterations. Any styles that are not allowed by this API will result in type and land blocking violations.
|
|
111
|
+
*/
|
|
112
|
+
xcss?: StrictXCSSProp<'alignItems', never>;
|
|
102
113
|
}
|
|
103
114
|
export {};
|
package/package.json
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
2
|
+
"name": "@atlaskit/checkbox",
|
|
3
|
+
"version": "13.5.0",
|
|
4
|
+
"description": "A checkbox is an input control that allows a user to select one or more options from a number of choices.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.tsx",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "Design System Team",
|
|
27
|
+
"productPushConsumption": [
|
|
28
|
+
"jira"
|
|
29
|
+
],
|
|
30
|
+
"releaseModel": "continuous",
|
|
31
|
+
"website": {
|
|
32
|
+
"name": "Checkbox",
|
|
33
|
+
"category": "Components"
|
|
34
|
+
},
|
|
35
|
+
"runReact18": true
|
|
36
|
+
},
|
|
37
|
+
"af:exports": {
|
|
38
|
+
".": "./src/index.tsx"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@atlaskit/analytics-next": "^9.3.0",
|
|
42
|
+
"@atlaskit/css": "^0.2.0",
|
|
43
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
44
|
+
"@atlaskit/icon": "^22.4.0",
|
|
45
|
+
"@atlaskit/theme": "^12.10.0",
|
|
46
|
+
"@atlaskit/tokens": "^1.51.0",
|
|
47
|
+
"@babel/runtime": "^7.0.0",
|
|
48
|
+
"@emotion/react": "^11.7.1"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@af/accessibility-testing": "*",
|
|
55
|
+
"@af/integration-testing": "*",
|
|
56
|
+
"@af/visual-regression": "*",
|
|
57
|
+
"@atlaskit/primitives": "^7.4.0",
|
|
58
|
+
"@atlaskit/ssr": "*",
|
|
59
|
+
"@atlaskit/visual-regression": "*",
|
|
60
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
61
|
+
"@testing-library/react": "^12.1.5",
|
|
62
|
+
"jscodeshift": "^0.13.0",
|
|
63
|
+
"react-dom": "^16.8.0",
|
|
64
|
+
"storybook-addon-performance": "^0.16.0",
|
|
65
|
+
"typescript": "~5.4.2",
|
|
66
|
+
"wait-for-expect": "^1.2.0"
|
|
67
|
+
},
|
|
68
|
+
"keywords": [
|
|
69
|
+
"atlaskit",
|
|
70
|
+
"react",
|
|
71
|
+
"ui"
|
|
72
|
+
],
|
|
73
|
+
"techstack": {
|
|
74
|
+
"@atlassian/frontend": {
|
|
75
|
+
"import-structure": "atlassian-conventions"
|
|
76
|
+
},
|
|
77
|
+
"@repo/internal": {
|
|
78
|
+
"dom-events": "use-bind-event-listener",
|
|
79
|
+
"design-system": "v1",
|
|
80
|
+
"ui-components": "lite-mode",
|
|
81
|
+
"analytics": "analytics-next",
|
|
82
|
+
"design-tokens": [
|
|
83
|
+
"color",
|
|
84
|
+
"spacing"
|
|
85
|
+
],
|
|
86
|
+
"deprecation": "no-deprecated-imports",
|
|
87
|
+
"styling": [
|
|
88
|
+
"emotion",
|
|
89
|
+
"static"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"homepage": "https://atlassian.design/components/checkbox/"
|
|
94
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/checkbox"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -26,39 +27,36 @@ import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
|
26
27
|
|
|
27
28
|
// @public
|
|
28
29
|
const Checkbox: MemoExoticComponent<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
OwnProps &
|
|
38
|
-
RefAttributes<HTMLInputElement>
|
|
39
|
-
>
|
|
30
|
+
ForwardRefExoticComponent<
|
|
31
|
+
Omit<
|
|
32
|
+
Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'css' | 'disabled' | 'required'>,
|
|
33
|
+
keyof OwnProps
|
|
34
|
+
> &
|
|
35
|
+
OwnProps &
|
|
36
|
+
RefAttributes<HTMLInputElement>
|
|
37
|
+
>
|
|
40
38
|
>;
|
|
41
39
|
export { Checkbox };
|
|
42
40
|
export default Checkbox;
|
|
43
41
|
|
|
44
42
|
// @public (undocumented)
|
|
45
43
|
export type CheckboxProps = Combine<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
Omit<
|
|
45
|
+
React_2.InputHTMLAttributes<HTMLInputElement>,
|
|
46
|
+
/**
|
|
47
|
+
* 'disabled', 'required', and 'checked' are omitted so that
|
|
48
|
+
* consumers must handle state using our props.
|
|
49
|
+
*
|
|
50
|
+
* 'css' is added globally to element attributes by emotion.
|
|
51
|
+
* This was causing a bug, making the css prop required in
|
|
52
|
+
* some cases. We explicitly omit it to avoid that.
|
|
53
|
+
*
|
|
54
|
+
* Because 'className' (which the css prop uses internally)
|
|
55
|
+
* is still available, this should not break existing usage.
|
|
56
|
+
*/
|
|
57
|
+
'checked' | 'css' | 'disabled' | 'required'
|
|
58
|
+
>,
|
|
59
|
+
OwnProps
|
|
62
60
|
>;
|
|
63
61
|
|
|
64
62
|
// @public (undocumented)
|
|
@@ -66,23 +64,20 @@ type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
|
66
64
|
|
|
67
65
|
// @public
|
|
68
66
|
type OwnProps = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
size?: Size;
|
|
84
|
-
testId?: string;
|
|
85
|
-
analyticsContext?: Record<string, any>;
|
|
67
|
+
defaultChecked?: boolean;
|
|
68
|
+
id?: string;
|
|
69
|
+
isChecked?: boolean;
|
|
70
|
+
isDisabled?: boolean;
|
|
71
|
+
isIndeterminate?: boolean;
|
|
72
|
+
isInvalid?: boolean;
|
|
73
|
+
isRequired?: boolean;
|
|
74
|
+
label?: React_2.ReactChild;
|
|
75
|
+
name?: string;
|
|
76
|
+
onChange?: (e: React_2.ChangeEvent<HTMLInputElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
77
|
+
value?: number | string;
|
|
78
|
+
size?: Size;
|
|
79
|
+
testId?: string;
|
|
80
|
+
analyticsContext?: Record<string, any>;
|
|
86
81
|
};
|
|
87
82
|
|
|
88
83
|
// @public (undocumented)
|
|
@@ -99,7 +94,7 @@ type Size = 'large' | 'medium' | 'small' | 'xlarge';
|
|
|
99
94
|
|
|
100
95
|
```json
|
|
101
96
|
{
|
|
102
|
-
|
|
97
|
+
"react": "^16.8.0"
|
|
103
98
|
}
|
|
104
99
|
```
|
|
105
100
|
|