@atlaskit/checkbox 16.0.0 → 17.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 +16 -0
- package/dist/cjs/checkbox.compiled.css +53 -0
- package/dist/cjs/checkbox.js +22 -146
- package/dist/cjs/internal/checkbox-icon.js +15 -17
- package/dist/cjs/internal/label-text.compiled.css +2 -0
- package/dist/cjs/internal/label-text.js +10 -13
- package/dist/cjs/internal/label.compiled.css +29 -0
- package/dist/cjs/internal/label.js +32 -60
- package/dist/cjs/internal/required-indicator.compiled.css +2 -0
- package/dist/cjs/internal/required-indicator.js +15 -18
- package/dist/es2019/checkbox.compiled.css +53 -0
- package/dist/es2019/checkbox.js +13 -144
- package/dist/es2019/internal/checkbox-icon.js +11 -15
- package/dist/es2019/internal/label-text.compiled.css +2 -0
- package/dist/es2019/internal/label-text.js +7 -12
- package/dist/es2019/internal/label.compiled.css +29 -0
- package/dist/es2019/internal/label.js +10 -58
- package/dist/es2019/internal/required-indicator.compiled.css +2 -0
- package/dist/es2019/internal/required-indicator.js +9 -17
- package/dist/esm/checkbox.compiled.css +53 -0
- package/dist/esm/checkbox.js +18 -146
- package/dist/esm/internal/checkbox-icon.js +11 -15
- package/dist/esm/internal/label-text.compiled.css +2 -0
- package/dist/esm/internal/label-text.js +7 -12
- package/dist/esm/internal/label.compiled.css +29 -0
- package/dist/esm/internal/label.js +29 -59
- package/dist/esm/internal/required-indicator.compiled.css +2 -0
- package/dist/esm/internal/required-indicator.js +12 -17
- package/dist/types/checkbox.d.ts +1 -1
- package/dist/types/internal/label-text.d.ts +2 -2
- package/dist/types/internal/label.d.ts +2 -6
- package/dist/types/internal/required-indicator.d.ts +2 -6
- package/dist/types-ts4.5/checkbox.d.ts +1 -1
- package/dist/types-ts4.5/internal/label-text.d.ts +2 -2
- package/dist/types-ts4.5/internal/label.d.ts +2 -6
- package/dist/types-ts4.5/internal/required-indicator.d.ts +2 -6
- package/package.json +6 -7
package/dist/esm/checkbox.js
CHANGED
|
@@ -1,150 +1,17 @@
|
|
|
1
|
+
/* checkbox.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss"];
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
*/
|
|
5
|
+
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss", "className"];
|
|
6
|
+
import "./checkbox.compiled.css";
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
9
|
import { forwardRef, memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
|
-
import { css, jsx } from '@emotion/react';
|
|
13
10
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
14
11
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
15
12
|
import { B200 } from '@atlaskit/theme/colors';
|
|
16
13
|
import { CheckboxIcon, Label, LabelText, RequiredIndicator } from './internal';
|
|
17
|
-
|
|
18
|
-
var checkboxStyles = css({
|
|
19
|
-
width: '100%',
|
|
20
|
-
height: '100%',
|
|
21
|
-
margin: "var(--ds-space-0, 0px)",
|
|
22
|
-
appearance: 'none',
|
|
23
|
-
border: 'none',
|
|
24
|
-
gridArea: '1 / 1 / 2 / 2',
|
|
25
|
-
opacity: 0,
|
|
26
|
-
outline: 'none',
|
|
27
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
28
|
-
'& + svg': {
|
|
29
|
-
/**
|
|
30
|
-
* Change the variables --checkbox-background-color, --checkbox-border-color
|
|
31
|
-
* and --checkbox-tick-color according to user interactions.
|
|
32
|
-
* All other variables are constant.
|
|
33
|
-
* All styles from the input target the sibling svg.
|
|
34
|
-
*/
|
|
35
|
-
'--checkbox-background-color': 'var(--local-background)',
|
|
36
|
-
'--checkbox-border-color': 'var(--local-border)',
|
|
37
|
-
'--checkbox-tick-color': 'var(--local-tick-rest)',
|
|
38
|
-
color: 'var(--checkbox-background-color)',
|
|
39
|
-
fill: 'var(--checkbox-tick-color)',
|
|
40
|
-
gridArea: '1 / 1 / 2 / 2',
|
|
41
|
-
pointerEvents: 'none',
|
|
42
|
-
transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
|
|
43
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
44
|
-
'rect:first-of-type': {
|
|
45
|
-
stroke: 'var(--checkbox-border-color)',
|
|
46
|
-
strokeWidth: "var(--ds-border-width, 1px)",
|
|
47
|
-
transition: 'stroke 0.2s ease-in-out'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
51
|
-
'&&:focus + svg, &&:checked:focus + svg': {
|
|
52
|
-
borderRadius: "var(--ds-border-radius, 0.25rem)",
|
|
53
|
-
outline: "var(--ds-border-width-outline, 2px)".concat(" solid ", "var(--ds-border-focused, ".concat(B200, ")")),
|
|
54
|
-
outlineOffset: "var(--ds-space-negative-025, -2px)"
|
|
55
|
-
},
|
|
56
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
57
|
-
'&:hover + svg': {
|
|
58
|
-
'--checkbox-background-color': 'var(--local-background-hover)',
|
|
59
|
-
'--checkbox-border-color': 'var(--local-border-hover)'
|
|
60
|
-
},
|
|
61
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
62
|
-
'&:checked:hover + svg': {
|
|
63
|
-
'--checkbox-background-color': 'var(--local-background-checked-hover)',
|
|
64
|
-
'--checkbox-border-color': 'var(--local-border-checked-hover)'
|
|
65
|
-
},
|
|
66
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
67
|
-
'&:checked + svg': {
|
|
68
|
-
'--checkbox-background-color': 'var(--local-background-checked)',
|
|
69
|
-
'--checkbox-border-color': 'var(--local-border-checked)',
|
|
70
|
-
'--checkbox-tick-color': 'var(--local-tick-checked)'
|
|
71
|
-
},
|
|
72
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
73
|
-
'&[data-invalid] + svg': {
|
|
74
|
-
'--checkbox-border-color': 'var(--local-border-invalid)'
|
|
75
|
-
},
|
|
76
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
77
|
-
'&:checked[data-invalid] + svg': {
|
|
78
|
-
'--checkbox-border-color': 'var(--local-border-checked-invalid)'
|
|
79
|
-
},
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
81
|
-
'&:active + svg': {
|
|
82
|
-
'--checkbox-background-color': 'var(--local-background-active)',
|
|
83
|
-
'--checkbox-border-color': 'var(--local-border-active)'
|
|
84
|
-
},
|
|
85
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
86
|
-
'&:checked:active + svg': {
|
|
87
|
-
'--checkbox-background-color': 'var(--local-background-active)',
|
|
88
|
-
'--checkbox-border-color': 'var(--local-border-active)',
|
|
89
|
-
'--checkbox-tick-color': 'var(--local-tick-active)'
|
|
90
|
-
},
|
|
91
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
92
|
-
'&:disabled + svg, &:disabled:hover + svg, &:disabled:focus + svg, &:disabled:active + svg, &:disabled[data-invalid] + svg': {
|
|
93
|
-
'--checkbox-background-color': 'var(--local-background-disabled)',
|
|
94
|
-
'--checkbox-border-color': 'var(--local-border-disabled)',
|
|
95
|
-
cursor: 'not-allowed',
|
|
96
|
-
pointerEvents: 'none'
|
|
97
|
-
},
|
|
98
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
99
|
-
'&:disabled:checked + svg': {
|
|
100
|
-
'--checkbox-tick-color': 'var(--local-tick-disabled)'
|
|
101
|
-
},
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-19551
|
|
103
|
-
'&:indeterminate + svg': {
|
|
104
|
-
'--checkbox-background-color': 'var(--local-background-checked)',
|
|
105
|
-
'--checkbox-border-color': 'var(--local-border-checked)',
|
|
106
|
-
'--checkbox-tick-color': 'var(--local-tick-checked)'
|
|
107
|
-
},
|
|
108
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-19551
|
|
109
|
-
'&:disabled:indeterminate + svg': {
|
|
110
|
-
'--checkbox-background-color': 'var(--local-background-disabled)',
|
|
111
|
-
'--checkbox-border-color': 'var(--local-border-disabled)',
|
|
112
|
-
'--checkbox-tick-color': 'var(--local-tick-disabled)'
|
|
113
|
-
},
|
|
114
|
-
'@media screen and (forced-colors: active)': {
|
|
115
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
|
-
'& + svg': {
|
|
117
|
-
'--checkbox-background-color': 'Canvas',
|
|
118
|
-
'--checkbox-border-color': 'CanvasText',
|
|
119
|
-
'--checkbox-tick-color': 'CanvasText'
|
|
120
|
-
},
|
|
121
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
122
|
-
'&:checked + svg, &:checked:hover + svg': {
|
|
123
|
-
'--checkbox-background-color': 'Canvas',
|
|
124
|
-
'--checkbox-border-color': 'CanvasText',
|
|
125
|
-
'--checkbox-tick-color': 'CanvasText'
|
|
126
|
-
},
|
|
127
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
128
|
-
'&:focus + svg rect:first-of-type': {
|
|
129
|
-
stroke: 'Highlight'
|
|
130
|
-
},
|
|
131
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
132
|
-
'&[data-invalid] + svg': {
|
|
133
|
-
'--checkbox-border-color': 'Highlight'
|
|
134
|
-
},
|
|
135
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
136
|
-
'&:checked[data-invalid] + svg': {
|
|
137
|
-
'--checkbox-border-color': 'Highlight'
|
|
138
|
-
},
|
|
139
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
140
|
-
'&:disabled + svg, &:disabled:hover + svg, &:disabled:focus + svg, &:disabled:active + svg, &:disabled[data-invalid] + svg': {
|
|
141
|
-
'--checkbox-background-color': 'Canvas',
|
|
142
|
-
'--checkbox-border-color': 'GrayText',
|
|
143
|
-
'--checkbox-tick-color': 'GrayText'
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
/* eslint-enable @atlaskit/design-system/no-nested-styles */
|
|
14
|
+
var checkboxStyles = null;
|
|
148
15
|
|
|
149
16
|
/**
|
|
150
17
|
* __Checkbox__
|
|
@@ -173,6 +40,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
173
40
|
isRequired = props.isRequired,
|
|
174
41
|
testId = props.testId,
|
|
175
42
|
xcss = props.xcss,
|
|
43
|
+
className = props.className,
|
|
176
44
|
rest = _objectWithoutProperties(props, _excluded);
|
|
177
45
|
var _useState = useState(isCheckedProp !== undefined ? isCheckedProp : defaultChecked),
|
|
178
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -190,7 +58,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
190
58
|
analyticsData: analyticsContext,
|
|
191
59
|
componentName: 'checkbox',
|
|
192
60
|
packageName: "@atlaskit/checkbox",
|
|
193
|
-
packageVersion: "
|
|
61
|
+
packageVersion: "17.0.0"
|
|
194
62
|
});
|
|
195
63
|
var internalRef = useRef(null);
|
|
196
64
|
var mergedRefs = mergeRefs([internalRef, ref]);
|
|
@@ -202,7 +70,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
202
70
|
internalRef.current.indeterminate = isIndeterminate;
|
|
203
71
|
}
|
|
204
72
|
}, [isIndeterminate]);
|
|
205
|
-
return
|
|
73
|
+
return /*#__PURE__*/React.createElement(Label, {
|
|
206
74
|
isDisabled: isDisabled,
|
|
207
75
|
label: label,
|
|
208
76
|
id: rest.id ? "".concat(rest.id, "-label") : undefined,
|
|
@@ -212,7 +80,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
212
80
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
213
81
|
,
|
|
214
82
|
xcss: xcss
|
|
215
|
-
},
|
|
83
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
216
84
|
// It is necessary only for Safari. It allows to render focus styles.
|
|
217
85
|
tabIndex: 0
|
|
218
86
|
}, rest, {
|
|
@@ -223,15 +91,19 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
223
91
|
value: value,
|
|
224
92
|
name: name,
|
|
225
93
|
required: isRequired,
|
|
226
|
-
|
|
94
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
95
|
+
className: ax(["_19itglyw _nd5lfibj _12ji1r31 _1qu2glyw _12y31o36 _1bsb1osq _4t3i1osq _r06hglyw _6rthze3t _1pfhze3t _12l2ze3t _ahbqze3t _tzy4idpf _r050fibj _9bg71mn3 _19op11so _a30fhteq _1610e4h9 _13wo93zu _q5a61gyf _8gq114p8 _wje2mov0 _1fo21cni _eyedglyw _1ef7js4s _1h6rjs4s _smzgo41a _1dk7o41a _l71j1i6y _t34a1i6y _y32gkivo _1ah9199y _1frj180l _h78e1g3k _dwvb1ps2 _1bok170n _1mhr17cl _fx2i3rva _10oaq2ws _w12s155b _15y61vek _e6ww155b _sg1j1vek _rphw18jz _y9y9mz2b _141bmz2b _255gmz2b _jj67mz2b _swhgmz2b _axq81diq _1jiz1diq _s9051diq _1efy1diq _1oav1diq _10y313gf _1wt913gf _qq8613gf _1adw13gf _12sr13gf _16jiglyw _693jglyw _1niqglyw _cl9tglyw _1jbnglyw _j1ta1hou _18qu1ps2 _1g52170n _1log17cl _32hzmz2b _1vv91diq _yjhd1hou _w1cowc43 _jdqn1onz _4y4t1onz _lvfrwc43 _g68dwc43 _13dk1onz _w1el1onz _a9yw1onz _1l3g1onz _dcdpgir2 _wobcgir2 _rp9wgir2 _9ebfwc43 _e43iwc43 _1tkuwc43 _1lehwc43 _b9q3wc43 _tu2918qt _1uxv18qt _1ufw18qt _opo918qt _1e8318qt _1k3d18qt _25yv18qt _1igz18qt _c7cc18qt _1swg18qt", className]),
|
|
227
96
|
onChange: onChangeAnalytics,
|
|
228
97
|
"aria-invalid": isInvalid ? 'true' : undefined,
|
|
229
98
|
"data-testid": testId && "".concat(testId, "--hidden-checkbox"),
|
|
230
|
-
"data-invalid": isInvalid ? 'true' : undefined
|
|
231
|
-
|
|
99
|
+
"data-invalid": isInvalid ? 'true' : undefined,
|
|
100
|
+
style: {
|
|
101
|
+
"--_gqccd2": ix("var(--ds-border-width-outline, 2px)".concat(" solid ", "var(--ds-border-focused, ".concat(B200, ")")))
|
|
102
|
+
}
|
|
103
|
+
})), /*#__PURE__*/React.createElement(CheckboxIcon, {
|
|
232
104
|
isIndeterminate: isIndeterminate,
|
|
233
105
|
isChecked: isChecked
|
|
234
|
-
}), label &&
|
|
106
|
+
}), label && /*#__PURE__*/React.createElement(LabelText, null, label, isRequired && /*#__PURE__*/React.createElement(RequiredIndicator, null)));
|
|
235
107
|
}));
|
|
236
108
|
Checkbox.displayName = 'Checkbox';
|
|
237
109
|
export default Checkbox;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
*/
|
|
1
|
+
/* checkbox-icon.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import { memo, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
9
5
|
import PrimitiveSVGIcon from '@atlaskit/icon/svg';
|
|
10
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
7
|
function getIcon(isIndeterminate, isChecked) {
|
|
12
8
|
if (isIndeterminate) {
|
|
13
9
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
14
10
|
if (fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration')) {
|
|
15
|
-
return
|
|
11
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
16
12
|
fillRule: "evenodd",
|
|
17
13
|
clipRule: "evenodd",
|
|
18
14
|
d: "M7.75 12.75H16.25V11.25H7.75V12.75Z",
|
|
19
15
|
fill: "inherit"
|
|
20
16
|
});
|
|
21
17
|
} else {
|
|
22
|
-
return
|
|
18
|
+
return /*#__PURE__*/React.createElement("rect", {
|
|
23
19
|
fill: "inherit",
|
|
24
20
|
x: "8",
|
|
25
21
|
y: "11",
|
|
@@ -32,14 +28,14 @@ function getIcon(isIndeterminate, isChecked) {
|
|
|
32
28
|
if (isChecked) {
|
|
33
29
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
34
30
|
if (fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration')) {
|
|
35
|
-
return
|
|
31
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
36
32
|
fillRule: "evenodd",
|
|
37
33
|
clipRule: "evenodd",
|
|
38
34
|
d: "M16.3262 9.48011L15.1738 8.51984L10.75 13.8284L8.82616 11.5198L7.67383 12.4801L10.1738 15.4801C10.3163 15.6511 10.5274 15.75 10.75 15.75C10.9726 15.75 11.1837 15.6511 11.3262 15.4801L16.3262 9.48011Z",
|
|
39
35
|
fill: "inherit"
|
|
40
36
|
});
|
|
41
37
|
} else {
|
|
42
|
-
return
|
|
38
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
43
39
|
d: "M9.707 11.293a1 1 0 1 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 1 0-1.414-1.414L11 12.586l-1.293-1.293z",
|
|
44
40
|
fill: "inherit"
|
|
45
41
|
});
|
|
@@ -64,22 +60,22 @@ var CheckboxIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
60
|
var icon = useMemo(function () {
|
|
65
61
|
return getIcon(isIndeterminate, isChecked);
|
|
66
62
|
}, [isIndeterminate, isChecked]);
|
|
67
|
-
return
|
|
63
|
+
return /*#__PURE__*/React.createElement(PrimitiveSVGIcon, {
|
|
68
64
|
label: "",
|
|
69
65
|
primaryColor: "var(--checkbox-background-color)",
|
|
70
66
|
secondaryColor: "var(--checkbox-tick-color)"
|
|
71
|
-
},
|
|
67
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
72
68
|
fillRule: "evenodd"
|
|
73
69
|
},
|
|
74
70
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
|
|
75
|
-
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ?
|
|
71
|
+
fg('platform-visual-refresh-icons') && fg('platform-icon-control-migration') ? /*#__PURE__*/React.createElement("rect", {
|
|
76
72
|
fill: "currentColor",
|
|
77
73
|
x: "5.5",
|
|
78
74
|
y: "5.5",
|
|
79
75
|
width: "13",
|
|
80
76
|
height: "13",
|
|
81
77
|
rx: "1.5"
|
|
82
|
-
}) :
|
|
78
|
+
}) : /*#__PURE__*/React.createElement("rect", {
|
|
83
79
|
fill: "currentColor",
|
|
84
80
|
x: "6",
|
|
85
81
|
y: "6",
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
7
|
-
var labelTextStyles = css({
|
|
8
|
-
alignSelf: 'center',
|
|
9
|
-
gridArea: '1 / 2 / 2 / 3'
|
|
10
|
-
});
|
|
1
|
+
/* label-text.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./label-text.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
var labelTextStyles = null;
|
|
11
6
|
export default function LabelText(_ref) {
|
|
12
7
|
var children = _ref.children;
|
|
13
|
-
return
|
|
14
|
-
|
|
8
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
9
|
+
className: ax(["_nd5l11ig _1wpz1h6o"])
|
|
15
10
|
}, children);
|
|
16
11
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._zulp1te3{gap:var(--_1l71759)}
|
|
3
|
+
._13hr1j28{--local-tick-rest:transparent}
|
|
4
|
+
._18q0snw8{--local-tick-disabled:var(--_1xmcmw9)}
|
|
5
|
+
._1dik1ehr{--local-border-checked-hover:var(--_14y1fod)}
|
|
6
|
+
._1e0c11p5{display:grid}
|
|
7
|
+
._1ejihkll{grid-auto-columns:1fr}
|
|
8
|
+
._1esz1j4g{--local-background-checked:var(--_1gcp7nr)}
|
|
9
|
+
._1g1fe69j{--local-border-active:var(--_rczcge)}
|
|
10
|
+
._1j3h1380{--local-border-invalid:var(--_1i4xulb)}
|
|
11
|
+
._1nzs1kc0{--local-background-active:var(--_1cd0fcx)}
|
|
12
|
+
._1rdaeh7q{--local-tick-checked:var(--_jf353p)}
|
|
13
|
+
._1sfg1380{--local-border-checked-invalid:var(--_1i4xulb)}
|
|
14
|
+
._1yjc3zdg{--local-border-focus:var(--_xjqa3d)}
|
|
15
|
+
._80om13gf{cursor:not-allowed}
|
|
16
|
+
._80om73ad{cursor:default}
|
|
17
|
+
._ay2w1ouc{--local-background-disabled:var(--_r5pknd)}
|
|
18
|
+
._d51u12ci{--local-background-hover:var(--_1z08gfx)}
|
|
19
|
+
._eawbxz7c{--local-tick-active:var(--_uq1ko9)}
|
|
20
|
+
._fpdj1ouc{--local-border-disabled:var(--_r5pknd)}
|
|
21
|
+
._h5e31kd8{--local-background:var(--_4mkb4g)}
|
|
22
|
+
._l6wk1j4g{--local-border-checked:var(--_1gcp7nr)}
|
|
23
|
+
._oaj1ddza{--local-border-hover:var(--_vnm8xo)}
|
|
24
|
+
._phftddza{--local-border:var(--_vnm8xo)}
|
|
25
|
+
._syaz7wap{color:var(--_1ynhf1h)}
|
|
26
|
+
._syazovqm{color:var(--_5xk3r4)}
|
|
27
|
+
._umai184x{grid-auto-rows:min-content}
|
|
28
|
+
._yp0j1ehr{--local-background-checked-hover:var(--_14y1fod)}
|
|
29
|
+
._yv0ey09t{grid-template-columns:min-content auto}
|
|
@@ -1,56 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* label.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./label.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
5
|
import { B200, B300, B400, B50, N10, N100, N20, N30, N70, N80, N900, R300 } from '@atlaskit/theme/colors';
|
|
8
|
-
var baseStyles =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
color: "var(--ds-text, ".concat(N900, ")"),
|
|
13
|
-
cursor: 'default',
|
|
14
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
15
|
-
});
|
|
16
|
-
var textLabelLayoutStyles = css({
|
|
17
|
-
gap: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)"),
|
|
18
|
-
gridTemplateColumns: 'min-content auto'
|
|
19
|
-
});
|
|
20
|
-
var disabledStyles = css({
|
|
21
|
-
color: "var(--ds-text-disabled, ".concat(N80, ")"),
|
|
22
|
-
cursor: 'not-allowed'
|
|
23
|
-
});
|
|
24
|
-
var labelStyles = css({
|
|
25
|
-
/**
|
|
26
|
-
* Background
|
|
27
|
-
*/
|
|
28
|
-
'--local-background': "var(--ds-background-input, ".concat(N10, ")"),
|
|
29
|
-
'--local-background-active': "var(--ds-background-input-pressed, ".concat(B50, ")"),
|
|
30
|
-
'--local-background-checked': "var(--ds-background-selected-bold, ".concat(B400, ")"),
|
|
31
|
-
'--local-background-checked-hover': "var(--ds-background-selected-bold-hovered, ".concat(B300, ")"),
|
|
32
|
-
'--local-background-disabled': "var(--ds-background-disabled, ".concat(N20, ")"),
|
|
33
|
-
'--local-background-hover': "var(--ds-background-input-hovered, ".concat(N30, ")"),
|
|
34
|
-
/**
|
|
35
|
-
* Border
|
|
36
|
-
*/
|
|
37
|
-
'--local-border': "var(--ds-border-input, ".concat(N100, ")"),
|
|
38
|
-
'--local-border-active': "var(--ds-border, ".concat(B50, ")"),
|
|
39
|
-
'--local-border-checked': "var(--ds-background-selected-bold, ".concat(B400, ")"),
|
|
40
|
-
'--local-border-checked-hover': "var(--ds-background-selected-bold-hovered, ".concat(B300, ")"),
|
|
41
|
-
'--local-border-checked-invalid': "var(--ds-border-danger, ".concat(R300, ")"),
|
|
42
|
-
'--local-border-disabled': "var(--ds-background-disabled, ".concat(N20, ")"),
|
|
43
|
-
'--local-border-focus': "var(--ds-border-focused, ".concat(B200, ")"),
|
|
44
|
-
'--local-border-hover': "var(--ds-border-input, ".concat(N100, ")"),
|
|
45
|
-
'--local-border-invalid': "var(--ds-border-danger, ".concat(R300, ")"),
|
|
46
|
-
/**
|
|
47
|
-
* Tick
|
|
48
|
-
*/
|
|
49
|
-
'--local-tick-active': "var(--ds-icon-inverse, ".concat(B400, ")"),
|
|
50
|
-
'--local-tick-checked': "var(--ds-icon-inverse, ".concat(N10, ")"),
|
|
51
|
-
'--local-tick-disabled': "var(--ds-icon-disabled, ".concat(N70, ")"),
|
|
52
|
-
'--local-tick-rest': 'transparent'
|
|
53
|
-
});
|
|
6
|
+
var baseStyles = null;
|
|
7
|
+
var textLabelLayoutStyles = null;
|
|
8
|
+
var disabledStyles = null;
|
|
9
|
+
var labelStyles = null;
|
|
54
10
|
export default function Label(_ref) {
|
|
55
11
|
var children = _ref.children,
|
|
56
12
|
isDisabled = _ref.isDisabled,
|
|
@@ -58,14 +14,28 @@ export default function Label(_ref) {
|
|
|
58
14
|
label = _ref.label,
|
|
59
15
|
id = _ref.id,
|
|
60
16
|
xcss = _ref.xcss;
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
// When we're fully on Compiled its local jsx namespace accepts the output of xcss prop.
|
|
64
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- This rule still fails because of the TS assertion
|
|
65
|
-
className: xcss,
|
|
66
|
-
css: [baseStyles, label && textLabelLayoutStyles, isDisabled && disabledStyles, labelStyles],
|
|
17
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
18
|
+
className: ax(["_11c81oud _1e0c11p5 _1ejihkll _umai184x _syazovqm _80om73ad", label && "_zulp1te3 _yv0ey09t", isDisabled && "_syaz7wap _80om13gf", "_h5e31kd8 _1nzs1kc0 _1esz1j4g _yp0j1ehr _ay2w1ouc _d51u12ci _phftddza _1g1fe69j _l6wk1j4g _1dik1ehr _1sfg1380 _fpdj1ouc _1yjc3zdg _oaj1ddza _1j3h1380 _eawbxz7c _1rdaeh7q _18q0snw8 _13hr1j28", xcss]),
|
|
67
19
|
"data-testid": testId,
|
|
68
20
|
"data-disabled": isDisabled || undefined,
|
|
69
|
-
id: id
|
|
21
|
+
id: id,
|
|
22
|
+
style: {
|
|
23
|
+
"--_5xk3r4": ix("var(--ds-text, ".concat(N900, ")")),
|
|
24
|
+
"--_1l71759": ix("var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-050, 4px)")),
|
|
25
|
+
"--_1ynhf1h": ix("var(--ds-text-disabled, ".concat(N80, ")")),
|
|
26
|
+
"--_4mkb4g": ix("var(--ds-background-input, ".concat(N10, ")")),
|
|
27
|
+
"--_1cd0fcx": ix("var(--ds-background-input-pressed, ".concat(B50, ")")),
|
|
28
|
+
"--_1gcp7nr": ix("var(--ds-background-selected-bold, ".concat(B400, ")")),
|
|
29
|
+
"--_14y1fod": ix("var(--ds-background-selected-bold-hovered, ".concat(B300, ")")),
|
|
30
|
+
"--_r5pknd": ix("var(--ds-background-disabled, ".concat(N20, ")")),
|
|
31
|
+
"--_1z08gfx": ix("var(--ds-background-input-hovered, ".concat(N30, ")")),
|
|
32
|
+
"--_vnm8xo": ix("var(--ds-border-input, ".concat(N100, ")")),
|
|
33
|
+
"--_rczcge": ix("var(--ds-border, ".concat(B50, ")")),
|
|
34
|
+
"--_1i4xulb": ix("var(--ds-border-danger, ".concat(R300, ")")),
|
|
35
|
+
"--_xjqa3d": ix("var(--ds-border-focused, ".concat(B200, ")")),
|
|
36
|
+
"--_uq1ko9": ix("var(--ds-icon-inverse, ".concat(B400, ")")),
|
|
37
|
+
"--_jf353p": ix("var(--ds-icon-inverse, ".concat(N10, ")")),
|
|
38
|
+
"--_1xmcmw9": ix("var(--ds-icon-disabled, ".concat(N70, ")"))
|
|
39
|
+
}
|
|
70
40
|
}, children);
|
|
71
41
|
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* required-indicator.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./required-indicator.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
5
|
import { R500 } from '@atlaskit/theme/colors';
|
|
8
|
-
var requiredIndicatorStyles =
|
|
9
|
-
color: "var(--ds-text-danger, ".concat(R500, ")"),
|
|
10
|
-
paddingInlineStart: "var(--ds-space-025, 2px)"
|
|
11
|
-
});
|
|
6
|
+
var requiredIndicatorStyles = null;
|
|
12
7
|
export default function RequiredIndicator() {
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
}
|
|
19
|
-
);
|
|
8
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
9
|
+
"aria-hidden": true,
|
|
10
|
+
className: ax(["_syaz1ml5 _bozgv77o"]),
|
|
11
|
+
style: {
|
|
12
|
+
"--_1xw92dq": ix("var(--ds-text-danger, ".concat(R500, ")"))
|
|
13
|
+
}
|
|
14
|
+
}, "*");
|
|
20
15
|
}
|
package/dist/types/checkbox.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
|
13
13
|
* - [Code](https://atlassian.design/components/checkbox/code)
|
|
14
14
|
* - [Usage](https://atlassian.design/components/checkbox/usage)
|
|
15
15
|
*/
|
|
16
|
-
declare const Checkbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
16
|
+
declare const Checkbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled" | "required" | "checked" | "css">, keyof {
|
|
17
17
|
defaultChecked?: boolean | undefined;
|
|
18
18
|
id?: string | undefined;
|
|
19
19
|
isChecked?: boolean | undefined;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/// <reference types="react" />
|
|
6
6
|
import { type LabelTextProps } from '../types';
|
|
7
|
-
export default function LabelText({ children }: LabelTextProps):
|
|
7
|
+
export default function LabelText({ children }: LabelTextProps): JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import { type LabelProps } from '../types';
|
|
7
|
-
export default function Label({ children, isDisabled, testId, label, id, xcss }: LabelProps):
|
|
3
|
+
export default function Label({ children, isDisabled, testId, label, id, xcss }: LabelProps): JSX.Element;
|
|
@@ -13,7 +13,7 @@ import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
|
13
13
|
* - [Code](https://atlassian.design/components/checkbox/code)
|
|
14
14
|
* - [Usage](https://atlassian.design/components/checkbox/usage)
|
|
15
15
|
*/
|
|
16
|
-
declare const Checkbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
16
|
+
declare const Checkbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled" | "required" | "checked" | "css">, keyof {
|
|
17
17
|
defaultChecked?: boolean | undefined;
|
|
18
18
|
id?: string | undefined;
|
|
19
19
|
isChecked?: boolean | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* @jsxRuntime classic
|
|
3
4
|
* @jsx jsx
|
|
4
5
|
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
6
|
import { type LabelTextProps } from '../types';
|
|
7
|
-
export default function LabelText({ children }: LabelTextProps):
|
|
7
|
+
export default function LabelText({ children }: LabelTextProps): JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import { type LabelProps } from '../types';
|
|
7
|
-
export default function Label({ children, isDisabled, testId, label, id, xcss }: LabelProps):
|
|
3
|
+
export default function Label({ children, isDisabled, testId, label, id, xcss }: LabelProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/checkbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.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,12 +39,12 @@
|
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/css": "^0.10.0",
|
|
41
41
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
42
|
-
"@atlaskit/icon": "^24.
|
|
42
|
+
"@atlaskit/icon": "^24.1.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "*",
|
|
44
44
|
"@atlaskit/theme": "^17.0.0",
|
|
45
|
-
"@atlaskit/tokens": "^4.
|
|
45
|
+
"@atlaskit/tokens": "^4.2.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
|
-
"@
|
|
47
|
+
"@compiled/react": "^0.18.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^18.2.0"
|
|
@@ -53,16 +53,15 @@
|
|
|
53
53
|
"@af/accessibility-testing": "*",
|
|
54
54
|
"@af/integration-testing": "*",
|
|
55
55
|
"@af/visual-regression": "*",
|
|
56
|
-
"@atlaskit/button": "^21.
|
|
56
|
+
"@atlaskit/button": "^21.1.0",
|
|
57
57
|
"@atlaskit/docs": "*",
|
|
58
58
|
"@atlaskit/form": "^12.0.0",
|
|
59
59
|
"@atlaskit/link": "*",
|
|
60
|
-
"@atlaskit/primitives": "^14.
|
|
60
|
+
"@atlaskit/primitives": "^14.1.0",
|
|
61
61
|
"@atlaskit/section-message": "*",
|
|
62
62
|
"@atlaskit/ssr": "*",
|
|
63
63
|
"@atlaskit/visual-regression": "*",
|
|
64
64
|
"@atlassian/feature-flags-test-utils": "*",
|
|
65
|
-
"@compiled/react": "^0.18.2",
|
|
66
65
|
"@testing-library/react": "^13.4.0",
|
|
67
66
|
"jscodeshift": "^0.13.0",
|
|
68
67
|
"react-dom": "^18.2.0",
|