@atlaskit/checkbox 13.2.0 → 13.4.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 +21 -0
- package/__perf__/checkbox.tsx +2 -2
- package/codemods/utils.tsx +3 -2
- package/dist/cjs/checkbox.js +9 -4
- package/dist/cjs/internal/label.js +7 -4
- package/dist/es2019/checkbox.js +8 -3
- package/dist/es2019/internal/label.js +8 -5
- package/dist/esm/checkbox.js +9 -4
- package/dist/esm/internal/label.js +8 -5
- package/dist/types/internal/label-text.d.ts +1 -1
- package/dist/types/internal/label.d.ts +2 -2
- package/dist/types/types.d.ts +12 -1
- package/dist/types-ts4.5/internal/label-text.d.ts +1 -1
- package/dist/types-ts4.5/internal/label.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +12 -1
- package/extract-react-types/checkbox-props.tsx +1 -1
- package/package.json +6 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/checkbox
|
|
2
2
|
|
|
3
|
+
## 13.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#103698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103698)
|
|
8
|
+
[`413b5201c8fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/413b5201c8fe) -
|
|
9
|
+
Introduce the bounded `xcss` prop.
|
|
10
|
+
|
|
11
|
+
## 13.3.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#94675](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94675)
|
|
16
|
+
[`5d9e1dccacca`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5d9e1dccacca) -
|
|
17
|
+
[ux] Update input border color token to meet 3:1 color contrast ratioLight theme:
|
|
18
|
+
color.border.input: #091E4224 → #8590A2Dark mode: color.border.input: #A6C5E229 → #738496
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 13.2.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/__perf__/checkbox.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { fireEvent } from '@testing-library/react';
|
|
4
4
|
import {
|
|
5
|
-
InteractionTaskArgs,
|
|
6
|
-
PublicInteractionTask,
|
|
5
|
+
type InteractionTaskArgs,
|
|
6
|
+
type PublicInteractionTask,
|
|
7
7
|
} from 'storybook-addon-performance';
|
|
8
8
|
|
|
9
9
|
import { Checkbox } from '../src';
|
package/codemods/utils.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {
|
|
2
2
|
API,
|
|
3
3
|
ASTPath,
|
|
4
|
+
default as core,
|
|
4
5
|
FileInfo,
|
|
5
6
|
ImportDeclaration,
|
|
6
7
|
ImportDefaultSpecifier,
|
|
@@ -10,7 +11,7 @@ import core, {
|
|
|
10
11
|
Program,
|
|
11
12
|
VariableDeclaration,
|
|
12
13
|
} from 'jscodeshift';
|
|
13
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
14
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
14
15
|
|
|
15
16
|
export type Nullable<T> = T | null;
|
|
16
17
|
|
package/dist/cjs/checkbox.js
CHANGED
|
@@ -12,10 +12,9 @@ var _react = require("react");
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
|
|
14
14
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
16
|
var _internal = require("./internal");
|
|
18
|
-
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "size", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId"];
|
|
17
|
+
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "size", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss"];
|
|
19
18
|
/** @jsx jsx */
|
|
20
19
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
21
20
|
var checkboxStyles = (0, _react2.css)({
|
|
@@ -44,7 +43,7 @@ var checkboxStyles = (0, _react2.css)({
|
|
|
44
43
|
transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
|
|
45
44
|
'rect:first-of-type': {
|
|
46
45
|
stroke: 'var(--checkbox-border-color)',
|
|
47
|
-
strokeWidth:
|
|
46
|
+
strokeWidth: "var(--ds-border-width, 1px)",
|
|
48
47
|
transition: 'stroke 0.2s ease-in-out'
|
|
49
48
|
}
|
|
50
49
|
},
|
|
@@ -147,6 +146,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
147
146
|
value = props.value,
|
|
148
147
|
isRequired = props.isRequired,
|
|
149
148
|
testId = props.testId,
|
|
149
|
+
xcss = props.xcss,
|
|
150
150
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
151
151
|
var _useState = (0, _react.useState)(isCheckedProp !== undefined ? isCheckedProp : defaultChecked),
|
|
152
152
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -164,7 +164,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
164
164
|
analyticsData: analyticsContext,
|
|
165
165
|
componentName: 'checkbox',
|
|
166
166
|
packageName: "@atlaskit/checkbox",
|
|
167
|
-
packageVersion: "13.
|
|
167
|
+
packageVersion: "13.4.0"
|
|
168
168
|
});
|
|
169
169
|
var internalRef = (0, _react.useRef)(null);
|
|
170
170
|
var mergedRefs = (0, _mergeRefs.default)([internalRef, ref]);
|
|
@@ -176,6 +176,11 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
176
176
|
label: label,
|
|
177
177
|
id: rest.id ? "".concat(rest.id, "-label") : undefined,
|
|
178
178
|
testId: testId && "".concat(testId, "--checkbox-label")
|
|
179
|
+
// Currently the rule hasn't been updated to enable "allowed" dynamic pass-throughs.
|
|
180
|
+
// When there is more usage of this pattern we'll update the lint rule.
|
|
181
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
182
|
+
,
|
|
183
|
+
xcss: xcss
|
|
179
184
|
}, (0, _react2.jsx)("input", (0, _extends2.default)({
|
|
180
185
|
// It is necessary only for Safari. It allows to render focus styles.
|
|
181
186
|
tabIndex: 0
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = Label;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
10
9
|
/** @jsx jsx */
|
|
11
10
|
|
|
@@ -38,14 +37,14 @@ var labelStyles = (0, _react.css)({
|
|
|
38
37
|
/**
|
|
39
38
|
* Border
|
|
40
39
|
*/
|
|
41
|
-
'--local-border':
|
|
40
|
+
'--local-border': "var(--ds-border-input, ".concat(_colors.N100, ")"),
|
|
42
41
|
'--local-border-active': "var(--ds-border, ".concat(_colors.B50, ")"),
|
|
43
42
|
'--local-border-checked': "var(--ds-background-selected-bold, ".concat(_colors.B400, ")"),
|
|
44
43
|
'--local-border-checked-hover': "var(--ds-background-selected-bold-hovered, ".concat(_colors.B300, ")"),
|
|
45
44
|
'--local-border-checked-invalid': "var(--ds-border-danger, ".concat(_colors.R300, ")"),
|
|
46
45
|
'--local-border-disabled': "var(--ds-background-disabled, ".concat(_colors.N20, ")"),
|
|
47
46
|
'--local-border-focus': "var(--ds-border-focused, ".concat(_colors.B200, ")"),
|
|
48
|
-
'--local-border-hover':
|
|
47
|
+
'--local-border-hover': "var(--ds-border-input, ".concat(_colors.N100, ")"),
|
|
49
48
|
'--local-border-invalid': "var(--ds-border-danger, ".concat(_colors.R300, ")"),
|
|
50
49
|
/**
|
|
51
50
|
* Tick
|
|
@@ -60,8 +59,12 @@ function Label(_ref) {
|
|
|
60
59
|
isDisabled = _ref.isDisabled,
|
|
61
60
|
testId = _ref.testId,
|
|
62
61
|
label = _ref.label,
|
|
63
|
-
id = _ref.id
|
|
62
|
+
id = _ref.id,
|
|
63
|
+
xcss = _ref.xcss;
|
|
64
64
|
return (0, _react.jsx)("label", {
|
|
65
|
+
// Because we're using Emotion local jsx namespace we have to coerce xcss prop to a string.
|
|
66
|
+
// When we're fully on Compiled its local jsx namespace accepts the output of xcss prop.
|
|
67
|
+
className: xcss,
|
|
65
68
|
css: [baseStyles, label && textLabelLayoutStyles, isDisabled && disabledStyles, labelStyles],
|
|
66
69
|
"data-testid": testId,
|
|
67
70
|
"data-disabled": isDisabled || undefined,
|
package/dist/es2019/checkbox.js
CHANGED
|
@@ -4,7 +4,6 @@ import { forwardRef, memo, useCallback, useRef, useState } from 'react';
|
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
6
6
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
7
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { B200 } from '@atlaskit/theme/colors';
|
|
9
8
|
import { CheckboxIcon, Label, LabelText, RequiredIndicator } from './internal';
|
|
10
9
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
@@ -34,7 +33,7 @@ const checkboxStyles = css({
|
|
|
34
33
|
transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
|
|
35
34
|
'rect:first-of-type': {
|
|
36
35
|
stroke: 'var(--checkbox-border-color)',
|
|
37
|
-
strokeWidth:
|
|
36
|
+
strokeWidth: "var(--ds-border-width, 1px)",
|
|
38
37
|
transition: 'stroke 0.2s ease-in-out'
|
|
39
38
|
}
|
|
40
39
|
},
|
|
@@ -133,6 +132,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(pr
|
|
|
133
132
|
value,
|
|
134
133
|
isRequired,
|
|
135
134
|
testId,
|
|
135
|
+
xcss,
|
|
136
136
|
...rest
|
|
137
137
|
} = props;
|
|
138
138
|
const [isCheckedState, setIsCheckedState] = useState(isCheckedProp !== undefined ? isCheckedProp : defaultChecked);
|
|
@@ -148,7 +148,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(pr
|
|
|
148
148
|
analyticsData: analyticsContext,
|
|
149
149
|
componentName: 'checkbox',
|
|
150
150
|
packageName: "@atlaskit/checkbox",
|
|
151
|
-
packageVersion: "13.
|
|
151
|
+
packageVersion: "13.4.0"
|
|
152
152
|
});
|
|
153
153
|
const internalRef = useRef(null);
|
|
154
154
|
const mergedRefs = mergeRefs([internalRef, ref]);
|
|
@@ -160,6 +160,11 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(pr
|
|
|
160
160
|
label: label,
|
|
161
161
|
id: rest.id ? `${rest.id}-label` : undefined,
|
|
162
162
|
testId: testId && `${testId}--checkbox-label`
|
|
163
|
+
// Currently the rule hasn't been updated to enable "allowed" dynamic pass-throughs.
|
|
164
|
+
// When there is more usage of this pattern we'll update the lint rule.
|
|
165
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
166
|
+
,
|
|
167
|
+
xcss: xcss
|
|
163
168
|
}, jsx("input", _extends({
|
|
164
169
|
// It is necessary only for Safari. It allows to render focus styles.
|
|
165
170
|
tabIndex: 0
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
import { B200, B300, B400, B50, N10, N100, N20, N30, N40, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
|
|
3
|
+
import { B200, B300, B400, B50, N10, N100, N20, N30, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
|
|
5
4
|
const baseStyles = css({
|
|
6
5
|
display: 'grid',
|
|
7
6
|
gridAutoColumns: '1fr',
|
|
@@ -31,14 +30,14 @@ const labelStyles = css({
|
|
|
31
30
|
/**
|
|
32
31
|
* Border
|
|
33
32
|
*/
|
|
34
|
-
'--local-border':
|
|
33
|
+
'--local-border': `var(--ds-border-input, ${N100})`,
|
|
35
34
|
'--local-border-active': `var(--ds-border, ${B50})`,
|
|
36
35
|
'--local-border-checked': `var(--ds-background-selected-bold, ${B400})`,
|
|
37
36
|
'--local-border-checked-hover': `var(--ds-background-selected-bold-hovered, ${B300})`,
|
|
38
37
|
'--local-border-checked-invalid': `var(--ds-border-danger, ${R300})`,
|
|
39
38
|
'--local-border-disabled': `var(--ds-background-disabled, ${N20})`,
|
|
40
39
|
'--local-border-focus': `var(--ds-border-focused, ${B200})`,
|
|
41
|
-
'--local-border-hover':
|
|
40
|
+
'--local-border-hover': `var(--ds-border-input, ${N100})`,
|
|
42
41
|
'--local-border-invalid': `var(--ds-border-danger, ${R300})`,
|
|
43
42
|
/**
|
|
44
43
|
* Tick
|
|
@@ -53,9 +52,13 @@ export default function Label({
|
|
|
53
52
|
isDisabled,
|
|
54
53
|
testId,
|
|
55
54
|
label,
|
|
56
|
-
id
|
|
55
|
+
id,
|
|
56
|
+
xcss
|
|
57
57
|
}) {
|
|
58
58
|
return jsx("label", {
|
|
59
|
+
// Because we're using Emotion local jsx namespace we have to coerce xcss prop to a string.
|
|
60
|
+
// When we're fully on Compiled its local jsx namespace accepts the output of xcss prop.
|
|
61
|
+
className: xcss,
|
|
59
62
|
css: [baseStyles, label && textLabelLayoutStyles, isDisabled && disabledStyles, labelStyles],
|
|
60
63
|
"data-testid": testId,
|
|
61
64
|
"data-disabled": isDisabled || undefined,
|
package/dist/esm/checkbox.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "size", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId"];
|
|
4
|
+
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "size", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss"];
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { forwardRef, memo, useCallback, useRef, useState } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
9
9
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
10
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { B200 } from '@atlaskit/theme/colors';
|
|
12
11
|
import { CheckboxIcon, Label, LabelText, RequiredIndicator } from './internal';
|
|
13
12
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
@@ -37,7 +36,7 @@ var checkboxStyles = css({
|
|
|
37
36
|
transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
|
|
38
37
|
'rect:first-of-type': {
|
|
39
38
|
stroke: 'var(--checkbox-border-color)',
|
|
40
|
-
strokeWidth:
|
|
39
|
+
strokeWidth: "var(--ds-border-width, 1px)",
|
|
41
40
|
transition: 'stroke 0.2s ease-in-out'
|
|
42
41
|
}
|
|
43
42
|
},
|
|
@@ -140,6 +139,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
140
139
|
value = props.value,
|
|
141
140
|
isRequired = props.isRequired,
|
|
142
141
|
testId = props.testId,
|
|
142
|
+
xcss = props.xcss,
|
|
143
143
|
rest = _objectWithoutProperties(props, _excluded);
|
|
144
144
|
var _useState = useState(isCheckedProp !== undefined ? isCheckedProp : defaultChecked),
|
|
145
145
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -157,7 +157,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
157
157
|
analyticsData: analyticsContext,
|
|
158
158
|
componentName: 'checkbox',
|
|
159
159
|
packageName: "@atlaskit/checkbox",
|
|
160
|
-
packageVersion: "13.
|
|
160
|
+
packageVersion: "13.4.0"
|
|
161
161
|
});
|
|
162
162
|
var internalRef = useRef(null);
|
|
163
163
|
var mergedRefs = mergeRefs([internalRef, ref]);
|
|
@@ -169,6 +169,11 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
169
169
|
label: label,
|
|
170
170
|
id: rest.id ? "".concat(rest.id, "-label") : undefined,
|
|
171
171
|
testId: testId && "".concat(testId, "--checkbox-label")
|
|
172
|
+
// Currently the rule hasn't been updated to enable "allowed" dynamic pass-throughs.
|
|
173
|
+
// When there is more usage of this pattern we'll update the lint rule.
|
|
174
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
175
|
+
,
|
|
176
|
+
xcss: xcss
|
|
172
177
|
}, jsx("input", _extends({
|
|
173
178
|
// It is necessary only for Safari. It allows to render focus styles.
|
|
174
179
|
tabIndex: 0
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
import { B200, B300, B400, B50, N10, N100, N20, N30, N40, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
|
|
3
|
+
import { B200, B300, B400, B50, N10, N100, N20, N30, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
|
|
5
4
|
var baseStyles = css({
|
|
6
5
|
display: 'grid',
|
|
7
6
|
gridAutoColumns: '1fr',
|
|
@@ -31,14 +30,14 @@ var labelStyles = css({
|
|
|
31
30
|
/**
|
|
32
31
|
* Border
|
|
33
32
|
*/
|
|
34
|
-
'--local-border':
|
|
33
|
+
'--local-border': "var(--ds-border-input, ".concat(N100, ")"),
|
|
35
34
|
'--local-border-active': "var(--ds-border, ".concat(B50, ")"),
|
|
36
35
|
'--local-border-checked': "var(--ds-background-selected-bold, ".concat(B400, ")"),
|
|
37
36
|
'--local-border-checked-hover': "var(--ds-background-selected-bold-hovered, ".concat(B300, ")"),
|
|
38
37
|
'--local-border-checked-invalid': "var(--ds-border-danger, ".concat(R300, ")"),
|
|
39
38
|
'--local-border-disabled': "var(--ds-background-disabled, ".concat(N20, ")"),
|
|
40
39
|
'--local-border-focus': "var(--ds-border-focused, ".concat(B200, ")"),
|
|
41
|
-
'--local-border-hover':
|
|
40
|
+
'--local-border-hover': "var(--ds-border-input, ".concat(N100, ")"),
|
|
42
41
|
'--local-border-invalid': "var(--ds-border-danger, ".concat(R300, ")"),
|
|
43
42
|
/**
|
|
44
43
|
* Tick
|
|
@@ -53,8 +52,12 @@ export default function Label(_ref) {
|
|
|
53
52
|
isDisabled = _ref.isDisabled,
|
|
54
53
|
testId = _ref.testId,
|
|
55
54
|
label = _ref.label,
|
|
56
|
-
id = _ref.id
|
|
55
|
+
id = _ref.id,
|
|
56
|
+
xcss = _ref.xcss;
|
|
57
57
|
return jsx("label", {
|
|
58
|
+
// Because we're using Emotion local jsx namespace we have to coerce xcss prop to a string.
|
|
59
|
+
// When we're fully on Compiled its local jsx namespace accepts the output of xcss prop.
|
|
60
|
+
className: xcss,
|
|
58
61
|
css: [baseStyles, label && textLabelLayoutStyles, isDisabled && disabledStyles, labelStyles],
|
|
59
62
|
"data-testid": testId,
|
|
60
63
|
"data-disabled": isDisabled || undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { LabelProps } from '../types';
|
|
4
|
-
export default function Label({ children, isDisabled, testId, label, id, }: LabelProps): jsx.JSX.Element;
|
|
3
|
+
import { type LabelProps } from '../types';
|
|
4
|
+
export default function Label({ children, isDisabled, testId, label, id, xcss, }: LabelProps): jsx.JSX.Element;
|
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,4 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { LabelProps } from '../types';
|
|
4
|
-
export default function Label({ children, isDisabled, testId, label, id, }: LabelProps): jsx.JSX.Element;
|
|
3
|
+
import { type LabelProps } from '../types';
|
|
4
|
+
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/checkbox",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.4.0",
|
|
4
4
|
"description": "A checkbox is an input control that allows a user to select one or more options from a number of choices.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
42
|
+
"@atlaskit/css": "^0.1.0",
|
|
42
43
|
"@atlaskit/ds-lib": "^2.3.0",
|
|
43
|
-
"@atlaskit/icon": "^22.
|
|
44
|
-
"@atlaskit/
|
|
45
|
-
"@atlaskit/
|
|
46
|
-
"@atlaskit/tokens": "^1.44.0",
|
|
44
|
+
"@atlaskit/icon": "^22.3.0",
|
|
45
|
+
"@atlaskit/theme": "^12.8.0",
|
|
46
|
+
"@atlaskit/tokens": "^1.49.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1"
|
|
49
49
|
},
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@af/accessibility-testing": "*",
|
|
55
55
|
"@af/integration-testing": "*",
|
|
56
56
|
"@af/visual-regression": "*",
|
|
57
|
+
"@atlaskit/primitives": "^6.3.0",
|
|
57
58
|
"@atlaskit/ssr": "*",
|
|
58
59
|
"@atlaskit/visual-regression": "*",
|
|
59
60
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -90,11 +91,6 @@
|
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
"platform-feature-flags": {
|
|
94
|
-
"platform.design-system-team.update-border-radio-checkbox_7askv": {
|
|
95
|
-
"type": "boolean"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
94
|
"homepage": "https://atlassian.design/components/checkbox/",
|
|
99
95
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
100
96
|
}
|