@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.
Files changed (37) hide show
  1. package/CHANGELOG.md +873 -858
  2. package/README.md +2 -1
  3. package/__perf__/checkbox.tsx +54 -72
  4. package/__perf__/default.tsx +7 -7
  5. package/codemods/12.0.0-lite-mode.tsx +12 -16
  6. package/codemods/__tests__/12.0.0-lite-mode.tsx +105 -105
  7. package/codemods/migrations/remove-imports.tsx +3 -3
  8. package/codemods/migrations/remove-props.tsx +9 -13
  9. package/codemods/migrations/rename-import.tsx +10 -10
  10. package/codemods/migrations/rename-input-ref-to-ref.tsx +4 -4
  11. package/codemods/utils.tsx +362 -401
  12. package/dist/cjs/checkbox.js +27 -2
  13. package/dist/cjs/internal/checkbox-icon.js +2 -0
  14. package/dist/cjs/internal/label-text.js +4 -0
  15. package/dist/cjs/internal/label.js +10 -1
  16. package/dist/cjs/internal/required-indicator.js +6 -2
  17. package/dist/es2019/checkbox.js +27 -1
  18. package/dist/es2019/internal/checkbox-icon.js +2 -0
  19. package/dist/es2019/internal/label-text.js +4 -0
  20. package/dist/es2019/internal/label.js +10 -1
  21. package/dist/es2019/internal/required-indicator.js +6 -2
  22. package/dist/esm/checkbox.js +28 -2
  23. package/dist/esm/internal/checkbox-icon.js +2 -0
  24. package/dist/esm/internal/label-text.js +4 -0
  25. package/dist/esm/internal/label.js +10 -1
  26. package/dist/esm/internal/required-indicator.js +6 -2
  27. package/dist/types/internal/label-text.d.ts +4 -1
  28. package/dist/types/internal/label.d.ts +5 -2
  29. package/dist/types/internal/required-indicator.d.ts +3 -0
  30. package/dist/types/types.d.ts +12 -1
  31. package/dist/types-ts4.5/internal/label-text.d.ts +4 -1
  32. package/dist/types-ts4.5/internal/label.d.ts +5 -2
  33. package/dist/types-ts4.5/internal/required-indicator.d.ts +3 -0
  34. package/dist/types-ts4.5/types.d.ts +12 -1
  35. package/extract-react-types/checkbox-props.tsx +2 -2
  36. package/package.json +93 -93
  37. package/report.api.md +41 -46
@@ -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,3 +1,6 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import { jsx } from '@emotion/react';
3
6
  export default function RequiredIndicator(): 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 {};
@@ -1,5 +1,5 @@
1
- import { OwnProps } from '../src/types';
1
+ import { type OwnProps } from '../src/types';
2
2
 
3
3
  export default function CheckboxProps(props: OwnProps) {
4
- return null;
4
+ return null;
5
5
  }
package/package.json CHANGED
@@ -1,94 +1,94 @@
1
1
  {
2
- "name": "@atlaskit/checkbox",
3
- "version": "13.3.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/ds-lib": "^2.3.0",
43
- "@atlaskit/icon": "^22.1.0",
44
- "@atlaskit/theme": "^12.7.0",
45
- "@atlaskit/tokens": "^1.45.0",
46
- "@babel/runtime": "^7.0.0",
47
- "@emotion/react": "^11.7.1"
48
- },
49
- "peerDependencies": {
50
- "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
51
- },
52
- "devDependencies": {
53
- "@af/accessibility-testing": "*",
54
- "@af/integration-testing": "*",
55
- "@af/visual-regression": "*",
56
- "@atlaskit/ssr": "*",
57
- "@atlaskit/visual-regression": "*",
58
- "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
59
- "@atlassian/feature-flags-test-utils": "*",
60
- "@testing-library/react": "^12.1.5",
61
- "jscodeshift": "^0.13.0",
62
- "react-dom": "^16.8.0",
63
- "storybook-addon-performance": "^0.16.0",
64
- "typescript": "~5.4.2",
65
- "wait-for-expect": "^1.2.0"
66
- },
67
- "keywords": [
68
- "atlaskit",
69
- "react",
70
- "ui"
71
- ],
72
- "techstack": {
73
- "@atlassian/frontend": {
74
- "import-structure": "atlassian-conventions"
75
- },
76
- "@repo/internal": {
77
- "dom-events": "use-bind-event-listener",
78
- "design-system": "v1",
79
- "ui-components": "lite-mode",
80
- "analytics": "analytics-next",
81
- "design-tokens": [
82
- "color",
83
- "spacing"
84
- ],
85
- "deprecation": "no-deprecated-imports",
86
- "styling": [
87
- "emotion",
88
- "static"
89
- ]
90
- }
91
- },
92
- "homepage": "https://atlassian.design/components/checkbox/",
93
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
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 [API Extractor](https://api-extractor.com/).
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
- ForwardRefExoticComponent<
30
- Omit<
31
- Omit<
32
- InputHTMLAttributes<HTMLInputElement>,
33
- 'checked' | 'css' | 'disabled' | 'required'
34
- >,
35
- keyof OwnProps
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
- Omit<
47
- React_2.InputHTMLAttributes<HTMLInputElement>,
48
- /**
49
- * 'disabled', 'required', and 'checked' are omitted so that
50
- * consumers must handle state using our props.
51
- *
52
- * 'css' is added globally to element attributes by emotion.
53
- * This was causing a bug, making the css prop required in
54
- * some cases. We explicitly omit it to avoid that.
55
- *
56
- * Because 'className' (which the css prop uses internally)
57
- * is still available, this should not break existing usage.
58
- */
59
- 'checked' | 'css' | 'disabled' | 'required'
60
- >,
61
- OwnProps
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
- defaultChecked?: boolean;
70
- id?: string;
71
- isChecked?: boolean;
72
- isDisabled?: boolean;
73
- isIndeterminate?: boolean;
74
- isInvalid?: boolean;
75
- isRequired?: boolean;
76
- label?: React_2.ReactChild;
77
- name?: string;
78
- onChange?: (
79
- e: React_2.ChangeEvent<HTMLInputElement>,
80
- analyticsEvent: UIAnalyticsEvent,
81
- ) => void;
82
- value?: number | string;
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
- "react": "^16.8.0"
97
+ "react": "^16.8.0"
103
98
  }
104
99
  ```
105
100