@atlaskit/checkbox 17.3.6 → 17.3.8
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 +14 -0
- package/checkbox.docs.tsx +53 -0
- package/dist/cjs/checkbox.js +7 -4
- package/dist/cjs/internal/required-indicator.compiled.css +1 -1
- package/dist/cjs/internal/required-indicator.js +1 -5
- package/dist/es2019/checkbox.js +4 -1
- package/dist/es2019/internal/required-indicator.compiled.css +1 -1
- package/dist/es2019/internal/required-indicator.js +1 -2
- package/dist/esm/checkbox.js +4 -1
- package/dist/esm/internal/required-indicator.compiled.css +1 -1
- package/dist/esm/internal/required-indicator.js +1 -5
- package/package.json +7 -7
- package/dist/cjs/internal/index.js +0 -34
- package/dist/es2019/internal/index.js +0 -4
- package/dist/esm/internal/index.js +0 -4
- package/dist/types/internal/index.d.ts +0 -4
- package/dist/types-ts4.5/internal/index.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/checkbox
|
|
2
2
|
|
|
3
|
+
## 17.3.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f1383e3821070`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1383e3821070) -
|
|
8
|
+
Removes internal barrel file
|
|
9
|
+
|
|
10
|
+
## 17.3.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`7aef1e49e90ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7aef1e49e90ea) -
|
|
15
|
+
Removes redundant fallback color values via @atlaskit/theme
|
|
16
|
+
|
|
3
17
|
## 17.3.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
|
|
4
|
+
|
|
5
|
+
const documentation: ComponentStructuredContentSource[] = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Checkbox',
|
|
8
|
+
description:
|
|
9
|
+
'A checkbox is an input control that allows a user to select one or more options from a number of choices.',
|
|
10
|
+
status: 'general-availability',
|
|
11
|
+
import: {
|
|
12
|
+
name: 'Checkbox',
|
|
13
|
+
package: '@atlaskit/checkbox',
|
|
14
|
+
type: 'default',
|
|
15
|
+
packagePath: path.resolve(__dirname),
|
|
16
|
+
packageJson: require('./package.json'),
|
|
17
|
+
},
|
|
18
|
+
usageGuidelines: [
|
|
19
|
+
'Use for multiple choice selections from a list, or for explicit confirmation (e.g. settings)',
|
|
20
|
+
'Use indeterminate state when some but not all children in a group are selected',
|
|
21
|
+
'Group related checkboxes logically',
|
|
22
|
+
'Provide clear labels for each option',
|
|
23
|
+
'Consider default states carefully',
|
|
24
|
+
'Use Radio for single selection; Dropdown for compact single choice; Toggle for on/off',
|
|
25
|
+
],
|
|
26
|
+
contentGuidelines: [
|
|
27
|
+
'Write short, descriptive labels; no punctuation after labels',
|
|
28
|
+
'Use consistent language across related options',
|
|
29
|
+
'Avoid negative phrasing when possible',
|
|
30
|
+
'Group related options together',
|
|
31
|
+
],
|
|
32
|
+
accessibilityGuidelines: [
|
|
33
|
+
'Include error messages for required or invalid checkbox state',
|
|
34
|
+
'Do not use disabled if the control must stay in tab order; use validation and error message so screen reader users hear why and how to proceed',
|
|
35
|
+
'Ensure proper labeling for all checkboxes',
|
|
36
|
+
'Use clear, descriptive labels that explain the choice',
|
|
37
|
+
'Provide keyboard navigation support',
|
|
38
|
+
'Indicate required fields clearly',
|
|
39
|
+
'Use appropriate error states and messaging',
|
|
40
|
+
],
|
|
41
|
+
examples: [
|
|
42
|
+
{
|
|
43
|
+
name: 'Checkbox',
|
|
44
|
+
description: 'Checkbox example',
|
|
45
|
+
source: path.resolve(__dirname, './examples/ai/checkbox.tsx'),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
keywords: ['checkbox', 'input', 'form', 'selection', 'choice', 'option', 'multiple'],
|
|
49
|
+
categories: ['forms-and-input'],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export default documentation;
|
package/dist/cjs/checkbox.js
CHANGED
|
@@ -16,7 +16,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
16
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
17
|
var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
|
|
18
18
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
19
|
-
var
|
|
19
|
+
var _checkboxIcon = _interopRequireDefault(require("./internal/checkbox-icon"));
|
|
20
|
+
var _label = _interopRequireDefault(require("./internal/label"));
|
|
21
|
+
var _labelText = _interopRequireDefault(require("./internal/label-text"));
|
|
22
|
+
var _requiredIndicator = _interopRequireDefault(require("./internal/required-indicator"));
|
|
20
23
|
var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss", "className"];
|
|
21
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
25
|
/**
|
|
@@ -85,7 +88,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
85
88
|
internalRef.current.indeterminate = isIndeterminate;
|
|
86
89
|
}
|
|
87
90
|
}, [isIndeterminate]);
|
|
88
|
-
return /*#__PURE__*/React.createElement(
|
|
91
|
+
return /*#__PURE__*/React.createElement(_label.default, {
|
|
89
92
|
isDisabled: isDisabled,
|
|
90
93
|
isChecked: isChecked,
|
|
91
94
|
isIndeterminate: isIndeterminate,
|
|
@@ -114,10 +117,10 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
114
117
|
"aria-invalid": isInvalid ? 'true' : undefined,
|
|
115
118
|
"data-testid": testId && "".concat(testId, "--hidden-checkbox"),
|
|
116
119
|
"data-invalid": isInvalid ? 'true' : undefined
|
|
117
|
-
})), /*#__PURE__*/React.createElement(
|
|
120
|
+
})), /*#__PURE__*/React.createElement(_checkboxIcon.default, {
|
|
118
121
|
isIndeterminate: isIndeterminate,
|
|
119
122
|
isChecked: isChecked
|
|
120
|
-
}), label && /*#__PURE__*/React.createElement(
|
|
123
|
+
}), label && /*#__PURE__*/React.createElement(_labelText.default, null, label, isRequired && /*#__PURE__*/React.createElement(_requiredIndicator.default, null)));
|
|
121
124
|
}));
|
|
122
125
|
Checkbox.displayName = 'Checkbox';
|
|
123
126
|
var _default = exports.default = Checkbox;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
2
|
-
.
|
|
2
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
@@ -9,15 +9,11 @@ exports.default = RequiredIndicator;
|
|
|
9
9
|
require("./required-indicator.compiled.css");
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
13
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
13
|
var requiredIndicatorStyles = null;
|
|
15
14
|
function RequiredIndicator() {
|
|
16
15
|
return /*#__PURE__*/React.createElement("span", {
|
|
17
16
|
"aria-hidden": true,
|
|
18
|
-
className: (0, _runtime.ax)(["
|
|
19
|
-
style: {
|
|
20
|
-
"--_1xw92dq": (0, _runtime.ix)("var(--ds-text-danger, ".concat(_colors.R500, ")"))
|
|
21
|
-
}
|
|
17
|
+
className: (0, _runtime.ax)(["_syaz1tmw _bozgv77o"])
|
|
22
18
|
}, "*");
|
|
23
19
|
}
|
package/dist/es2019/checkbox.js
CHANGED
|
@@ -6,7 +6,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { forwardRef, memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
8
8
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
9
|
-
import
|
|
9
|
+
import CheckboxIcon from './internal/checkbox-icon';
|
|
10
|
+
import Label from './internal/label';
|
|
11
|
+
import LabelText from './internal/label-text';
|
|
12
|
+
import RequiredIndicator from './internal/required-indicator';
|
|
10
13
|
/**
|
|
11
14
|
* The input is visually hidden but remains in the DOM for accessibility.
|
|
12
15
|
* State-based styling is handled by the Label component using CSS custom properties
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
2
|
-
.
|
|
2
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import "./required-indicator.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { R500 } from '@atlaskit/theme/colors';
|
|
6
5
|
const requiredIndicatorStyles = null;
|
|
7
6
|
export default function RequiredIndicator() {
|
|
8
7
|
return /*#__PURE__*/React.createElement("span", {
|
|
9
8
|
"aria-hidden": true,
|
|
10
|
-
className: ax(["
|
|
9
|
+
className: ax(["_syaz1tmw _bozgv77o"])
|
|
11
10
|
}, "*");
|
|
12
11
|
}
|
package/dist/esm/checkbox.js
CHANGED
|
@@ -9,7 +9,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
9
9
|
import { forwardRef, memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
11
11
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
12
|
-
import
|
|
12
|
+
import CheckboxIcon from './internal/checkbox-icon';
|
|
13
|
+
import Label from './internal/label';
|
|
14
|
+
import LabelText from './internal/label-text';
|
|
15
|
+
import RequiredIndicator from './internal/required-indicator';
|
|
13
16
|
/**
|
|
14
17
|
* The input is visually hidden but remains in the DOM for accessibility.
|
|
15
18
|
* State-based styling is handled by the Label component using CSS custom properties
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
2
|
-
.
|
|
2
|
+
._syaz1tmw{color:var(--ds-text-danger,#ae2e24)}
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
import "./required-indicator.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { R500 } from '@atlaskit/theme/colors';
|
|
6
5
|
var requiredIndicatorStyles = null;
|
|
7
6
|
export default function RequiredIndicator() {
|
|
8
7
|
return /*#__PURE__*/React.createElement("span", {
|
|
9
8
|
"aria-hidden": true,
|
|
10
|
-
className: ax(["
|
|
11
|
-
style: {
|
|
12
|
-
"--_1xw92dq": ix("var(--ds-text-danger, ".concat(R500, ")"))
|
|
13
|
-
}
|
|
9
|
+
className: ax(["_syaz1tmw _bozgv77o"])
|
|
14
10
|
}, "*");
|
|
15
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/checkbox",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.8",
|
|
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/"
|
|
@@ -32,11 +32,10 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/analytics-next": "^11.
|
|
35
|
+
"@atlaskit/analytics-next": "^11.2.0",
|
|
36
36
|
"@atlaskit/css": "^0.19.0",
|
|
37
37
|
"@atlaskit/ds-lib": "^6.0.0",
|
|
38
|
-
"@atlaskit/
|
|
39
|
-
"@atlaskit/tokens": "^11.1.0",
|
|
38
|
+
"@atlaskit/tokens": "^11.4.0",
|
|
40
39
|
"@babel/runtime": "^7.0.0",
|
|
41
40
|
"@compiled/react": "^0.20.0"
|
|
42
41
|
},
|
|
@@ -49,12 +48,13 @@
|
|
|
49
48
|
"@af/suppress-react-warnings": "workspace:^",
|
|
50
49
|
"@af/visual-regression": "workspace:^",
|
|
51
50
|
"@atlaskit/button": "^23.10.0",
|
|
52
|
-
"@atlaskit/docs": "^11.
|
|
53
|
-
"@atlaskit/form": "^15.
|
|
51
|
+
"@atlaskit/docs": "^11.7.0",
|
|
52
|
+
"@atlaskit/form": "^15.5.0",
|
|
54
53
|
"@atlaskit/link": "^3.3.0",
|
|
55
|
-
"@atlaskit/primitives": "^18.
|
|
54
|
+
"@atlaskit/primitives": "^18.1.0",
|
|
56
55
|
"@atlaskit/section-message": "^8.12.0",
|
|
57
56
|
"@atlassian/ssr-tests": "workspace:^",
|
|
57
|
+
"@atlassian/structured-docs-types": "workspace:^",
|
|
58
58
|
"@testing-library/react": "^16.3.0",
|
|
59
59
|
"jscodeshift": "^17.0.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "CheckboxIcon", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _checkboxIcon.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "Label", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _label.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "LabelText", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _labelText.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "RequiredIndicator", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _requiredIndicator.default;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
var _checkboxIcon = _interopRequireDefault(require("./checkbox-icon"));
|
|
32
|
-
var _label = _interopRequireDefault(require("./label"));
|
|
33
|
-
var _labelText = _interopRequireDefault(require("./label-text"));
|
|
34
|
-
var _requiredIndicator = _interopRequireDefault(require("./required-indicator"));
|