@atlaskit/checkbox 12.6.1 → 12.6.3
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 +12 -0
- package/dist/cjs/checkbox.js +1 -1
- package/dist/cjs/internal/constants.js +2 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/checkbox.js +1 -1
- package/dist/es2019/internal/constants.js +2 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/checkbox.js +1 -1
- package/dist/esm/internal/constants.js +2 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/constants.d.ts +0 -1
- package/dist/types-ts4.5/checkbox.d.ts +12 -0
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/internal/checkbox-icon.d.ts +16 -0
- package/dist/types-ts4.5/internal/constants.d.ts +1 -0
- package/dist/types-ts4.5/internal/index.d.ts +4 -0
- package/dist/types-ts4.5/internal/label-text.d.ts +4 -0
- package/dist/types-ts4.5/internal/label.d.ts +4 -0
- package/dist/types-ts4.5/internal/required-indicator.d.ts +3 -0
- package/dist/types-ts4.5/internal/theme.d.ts +55 -0
- package/dist/types-ts4.5/types.d.ts +103 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/checkbox
|
|
2
2
|
|
|
3
|
+
## 12.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`49b08bfdf5f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/49b08bfdf5f) - Migrated use of `gridSize` to space tokens where possible. There is no expected visual or behaviour change.
|
|
8
|
+
|
|
9
|
+
## 12.6.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 12.6.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/checkbox.js
CHANGED
|
@@ -161,7 +161,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
|
|
|
161
161
|
analyticsData: analyticsContext,
|
|
162
162
|
componentName: 'checkbox',
|
|
163
163
|
packageName: "@atlaskit/checkbox",
|
|
164
|
-
packageVersion: "12.6.
|
|
164
|
+
packageVersion: "12.6.3"
|
|
165
165
|
});
|
|
166
166
|
var internalRef = (0, _react.useRef)(null);
|
|
167
167
|
var mergedRefs = (0, _mergeRefs.default)([internalRef, ref]);
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.fontFamily = void 0;
|
|
7
7
|
var _constants = require("@atlaskit/theme/constants");
|
|
8
8
|
var fontFamily = (0, _constants.fontFamily)();
|
|
9
|
-
exports.fontFamily = fontFamily;
|
|
10
|
-
var gridSize = (0, _constants.gridSize)();
|
|
11
|
-
exports.gridSize = gridSize;
|
|
9
|
+
exports.fontFamily = fontFamily;
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/checkbox.js
CHANGED
|
@@ -145,7 +145,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(pr
|
|
|
145
145
|
analyticsData: analyticsContext,
|
|
146
146
|
componentName: 'checkbox',
|
|
147
147
|
packageName: "@atlaskit/checkbox",
|
|
148
|
-
packageVersion: "12.6.
|
|
148
|
+
packageVersion: "12.6.3"
|
|
149
149
|
});
|
|
150
150
|
const internalRef = useRef(null);
|
|
151
151
|
const mergedRefs = mergeRefs([internalRef, ref]);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { fontFamily as getFontFamily
|
|
2
|
-
export const fontFamily = getFontFamily();
|
|
3
|
-
export const gridSize = getGridSize();
|
|
1
|
+
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
2
|
+
export const fontFamily = getFontFamily();
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/checkbox.js
CHANGED
|
@@ -154,7 +154,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
|
|
|
154
154
|
analyticsData: analyticsContext,
|
|
155
155
|
componentName: 'checkbox',
|
|
156
156
|
packageName: "@atlaskit/checkbox",
|
|
157
|
-
packageVersion: "12.6.
|
|
157
|
+
packageVersion: "12.6.3"
|
|
158
158
|
});
|
|
159
159
|
var internalRef = useRef(null);
|
|
160
160
|
var mergedRefs = mergeRefs([internalRef, ref]);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { fontFamily as getFontFamily
|
|
2
|
-
export var fontFamily = getFontFamily();
|
|
3
|
-
export var gridSize = getGridSize();
|
|
1
|
+
import { fontFamily as getFontFamily } from '@atlaskit/theme/constants';
|
|
2
|
+
export var fontFamily = getFontFamily();
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* __Checkbox__
|
|
4
|
+
*
|
|
5
|
+
* A checkbox an input control that allows a user to select one or more options from a number of choices.
|
|
6
|
+
*
|
|
7
|
+
* - [Examples](https://atlassian.design/components/checkbox/examples)
|
|
8
|
+
* - [Code](https://atlassian.design/components/checkbox/code)
|
|
9
|
+
* - [Usage](https://atlassian.design/components/checkbox/usage)
|
|
10
|
+
*/
|
|
11
|
+
declare const Checkbox: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled" | "required" | "checked" | "css">, keyof import("./types").OwnProps> & import("./types").OwnProps & import("react").RefAttributes<HTMLInputElement>>>;
|
|
12
|
+
export default Checkbox;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Size } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* __Checkbox icon__
|
|
5
|
+
*
|
|
6
|
+
* A checkbox icon is the visual representation of checkbox state,
|
|
7
|
+
* which is shown instead of the native input.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
declare const CheckboxIcon: import("react").NamedExoticComponent<{
|
|
12
|
+
size: Size;
|
|
13
|
+
isIndeterminate: boolean;
|
|
14
|
+
isChecked: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export default CheckboxIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fontFamily: string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare const theme: {
|
|
2
|
+
light: {
|
|
3
|
+
borderColor: {
|
|
4
|
+
rest: "var(--ds-border-input)";
|
|
5
|
+
hovered: "var(--ds-border-input)";
|
|
6
|
+
disabled: "var(--ds-background-disabled)";
|
|
7
|
+
checked: "var(--ds-background-selected-bold)";
|
|
8
|
+
active: "var(--ds-border)";
|
|
9
|
+
invalid: "var(--ds-border-danger)";
|
|
10
|
+
invalidAndChecked: "var(--ds-border-danger)";
|
|
11
|
+
focused: "var(--ds-border-focused)";
|
|
12
|
+
hoveredAndChecked: "var(--ds-background-selected-bold-hovered)";
|
|
13
|
+
};
|
|
14
|
+
boxColor: {
|
|
15
|
+
rest: "var(--ds-background-input)";
|
|
16
|
+
hovered: "var(--ds-background-input-hovered)";
|
|
17
|
+
disabled: "var(--ds-background-disabled)";
|
|
18
|
+
active: "var(--ds-background-input-pressed)";
|
|
19
|
+
hoveredAndChecked: "var(--ds-background-selected-bold-hovered)";
|
|
20
|
+
checked: "var(--ds-background-selected-bold)";
|
|
21
|
+
};
|
|
22
|
+
tickColor: {
|
|
23
|
+
disabledAndChecked: "var(--ds-icon-disabled)";
|
|
24
|
+
activeAndChecked: "var(--ds-icon-inverse)";
|
|
25
|
+
checked: "var(--ds-icon-inverse)";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
dark: {
|
|
29
|
+
borderColor: {
|
|
30
|
+
rest: "var(--ds-border-input)";
|
|
31
|
+
hovered: "var(--ds-border-input)";
|
|
32
|
+
disabled: "var(--ds-background-disabled)";
|
|
33
|
+
checked: "var(--ds-background-selected-bold)";
|
|
34
|
+
active: "var(--ds-border)";
|
|
35
|
+
invalid: "var(--ds-border-danger)";
|
|
36
|
+
invalidAndChecked: "var(--ds-border-danger)";
|
|
37
|
+
focused: "var(--ds-border-focused)";
|
|
38
|
+
hoveredAndChecked: "var(--ds-background-selected-bold-hovered)";
|
|
39
|
+
};
|
|
40
|
+
boxColor: {
|
|
41
|
+
rest: "var(--ds-background-input)";
|
|
42
|
+
hovered: "var(--ds-background-input-hovered)";
|
|
43
|
+
disabled: "var(--ds-background-disabled)";
|
|
44
|
+
active: "var(--ds-background-input-pressed)";
|
|
45
|
+
hoveredAndChecked: "var(--ds-background-selected-bold-hovered)";
|
|
46
|
+
checked: "var(--ds-background-selected-bold)";
|
|
47
|
+
};
|
|
48
|
+
tickColor: {
|
|
49
|
+
disabledAndChecked: "var(--ds-icon-disabled)";
|
|
50
|
+
activeAndChecked: "var(--ds-icon-inverse)";
|
|
51
|
+
checked: "var(--ds-icon-inverse)";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default theme;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
3
|
+
export type Size = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* CHECKBOX PROPTYPES
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export type OwnProps = {
|
|
12
|
+
/**
|
|
13
|
+
* Sets whether the checkbox begins checked.
|
|
14
|
+
*/
|
|
15
|
+
defaultChecked?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* id assigned to input
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sets whether the checkbox is checked or unchecked.
|
|
22
|
+
*/
|
|
23
|
+
isChecked?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Sets whether the checkbox is disabled.
|
|
26
|
+
*/
|
|
27
|
+
isDisabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets whether the checkbox is indeterminate. This only affects the
|
|
30
|
+
* style and does not modify the isChecked property.
|
|
31
|
+
*/
|
|
32
|
+
isIndeterminate?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Marks the field as invalid. Changes style of unchecked component.
|
|
35
|
+
*/
|
|
36
|
+
isInvalid?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Marks the field as required & changes the label style.
|
|
39
|
+
*/
|
|
40
|
+
isRequired?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The label to be displayed to the right of the checkbox. The label is part
|
|
43
|
+
* of the clickable element to select the checkbox.
|
|
44
|
+
*/
|
|
45
|
+
label?: React.ReactChild;
|
|
46
|
+
/**
|
|
47
|
+
* The name of the submitted field in a checkbox.
|
|
48
|
+
*/
|
|
49
|
+
name?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Function that is called whenever the state of the checkbox changes. It will
|
|
52
|
+
* be called with an object containing the react synthetic event. Use currentTarget to get value, name and checked
|
|
53
|
+
*/
|
|
54
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
55
|
+
/**
|
|
56
|
+
* The value to be used in the checkbox input. This is the value that will be returned on form submission.
|
|
57
|
+
*/
|
|
58
|
+
value?: number | string;
|
|
59
|
+
/**
|
|
60
|
+
* The size of the Checkbox
|
|
61
|
+
*/
|
|
62
|
+
size?: Size;
|
|
63
|
+
/**
|
|
64
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
65
|
+
* we have generated testid based on the one you pass to the Checkbox component:
|
|
66
|
+
* - `{testId}--hidden-checkbox` to check if it got changed to checked/unchecked.
|
|
67
|
+
*/
|
|
68
|
+
testId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Additional information to be included in the `context` of analytics events that come from radio
|
|
71
|
+
*/
|
|
72
|
+
analyticsContext?: Record<string, any>;
|
|
73
|
+
};
|
|
74
|
+
type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
75
|
+
export type CheckboxProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
76
|
+
/**
|
|
77
|
+
* 'disabled', 'required', and 'checked' are omitted so that
|
|
78
|
+
* consumers must handle state using our props.
|
|
79
|
+
*
|
|
80
|
+
* 'css' is added globally to element attributes by emotion.
|
|
81
|
+
* This was causing a bug, making the css prop required in
|
|
82
|
+
* some cases. We explicitly omit it to avoid that.
|
|
83
|
+
*
|
|
84
|
+
* Because 'className' (which the css prop uses internally)
|
|
85
|
+
* is still available, this should not break existing usage.
|
|
86
|
+
*/
|
|
87
|
+
'disabled' | 'required' | 'checked' | 'css'>, OwnProps>;
|
|
88
|
+
export interface LabelTextProps extends React.HTMLProps<HTMLSpanElement> {
|
|
89
|
+
children: React.ReactNode;
|
|
90
|
+
}
|
|
91
|
+
export interface LabelProps extends React.HTMLProps<HTMLInputElement> {
|
|
92
|
+
isDisabled?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
95
|
+
*/
|
|
96
|
+
testId?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Click handler that is conditionally applied for Firefox
|
|
99
|
+
* as Firefox does not dispatch modified click events (e.g. Ctrl+Click) down to the underlying input element
|
|
100
|
+
*/
|
|
101
|
+
onClick?: React.MouseEventHandler;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/checkbox",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.3",
|
|
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/"
|