@atlaskit/checkbox 12.5.0 → 12.6.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/checkbox
2
2
 
3
+ ## 12.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
8
+
9
+ ## 12.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`8d0fd2d3f6c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d0fd2d3f6c) - [ux] reduce stroke width from 2px to 1px with new color to meet contrast requirement
14
+
3
15
  ## 12.5.0
4
16
 
5
17
  ### Minor Changes
@@ -12,6 +12,7 @@ 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");
15
16
  var _internal = require("./internal");
16
17
  var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "size", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId"];
17
18
  /** @jsx jsx */
@@ -42,7 +43,7 @@ var checkboxStyles = (0, _react2.css)({
42
43
  transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
43
44
  'rect:first-of-type': {
44
45
  stroke: 'var(--checkbox-border-color)',
45
- strokeWidth: 2,
46
+ strokeWidth: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.update-border-input_ff9l1') ? 1 : 2,
46
47
  transition: 'stroke 0.2s ease-in-out'
47
48
  }
48
49
  },
@@ -160,7 +161,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
160
161
  analyticsData: analyticsContext,
161
162
  componentName: 'checkbox',
162
163
  packageName: "@atlaskit/checkbox",
163
- packageVersion: "12.5.0"
164
+ packageVersion: "12.6.1"
164
165
  });
165
166
  var internalRef = (0, _react.useRef)(null);
166
167
  var mergedRefs = (0, _mergeRefs.default)([internalRef, ref]);
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
8
  var _colors = require("@atlaskit/theme/colors");
8
9
  var theme = {
9
10
  light: {
10
11
  borderColor: {
11
- rest: "var(--ds-border-input, ".concat(_colors.N40, ")"),
12
- hovered: "var(--ds-border-input, ".concat(_colors.N40, ")"),
12
+ rest: "var(--ds-border-input, ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.update-border-input_ff9l1') ? _colors.N100 : _colors.N40, ")"),
13
+ hovered: "var(--ds-border-input, ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.update-border-input_ff9l1') ? _colors.N100 : _colors.N40, ")"),
13
14
  disabled: "var(--ds-background-disabled, ".concat(_colors.N20, ")"),
14
15
  checked: "var(--ds-background-selected-bold, ".concat(_colors.B400, ")"),
15
16
  active: "var(--ds-border, ".concat(_colors.B50, ")"),
@@ -34,7 +35,7 @@ var theme = {
34
35
  },
35
36
  dark: {
36
37
  borderColor: {
37
- rest: "var(--ds-border-input, ".concat(_colors.DN80, ")"),
38
+ rest: "var(--ds-border-input, ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.update-border-input_ff9l1') ? _colors.DN200 : _colors.DN80, ")"),
38
39
  hovered: "var(--ds-border-input, ".concat(_colors.DN200, ")"),
39
40
  disabled: "var(--ds-background-disabled, ".concat(_colors.DN10, ")"),
40
41
  checked: "var(--ds-background-selected-bold, ".concat(_colors.B400, ")"),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/checkbox",
3
- "version": "12.5.0",
3
+ "version": "12.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,7 @@ 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';
7
8
  import { CheckboxIcon, Label, LabelText, RequiredIndicator } from './internal';
8
9
  /* eslint-disable @repo/internal/styles/no-nested-styles */
9
10
  const checkboxStyles = css({
@@ -32,7 +33,7 @@ const checkboxStyles = css({
32
33
  transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
33
34
  'rect:first-of-type': {
34
35
  stroke: 'var(--checkbox-border-color)',
35
- strokeWidth: 2,
36
+ strokeWidth: getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? 1 : 2,
36
37
  transition: 'stroke 0.2s ease-in-out'
37
38
  }
38
39
  },
@@ -144,7 +145,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(pr
144
145
  analyticsData: analyticsContext,
145
146
  componentName: 'checkbox',
146
147
  packageName: "@atlaskit/checkbox",
147
- packageVersion: "12.5.0"
148
+ packageVersion: "12.6.1"
148
149
  });
149
150
  const internalRef = useRef(null);
150
151
  const mergedRefs = mergeRefs([internalRef, ref]);
@@ -1,9 +1,10 @@
1
- import { B100, B200, B300, B400, B50, B75, DN10, DN200, DN30, DN80, DN90, N10, N20, N30, N40, N70, R300 } from '@atlaskit/theme/colors';
1
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
+ import { B100, B200, B300, B400, B50, B75, DN10, DN200, DN30, DN80, DN90, N10, N100, N20, N30, N40, N70, R300 } from '@atlaskit/theme/colors';
2
3
  const theme = {
3
4
  light: {
4
5
  borderColor: {
5
- rest: `var(--ds-border-input, ${N40})`,
6
- hovered: `var(--ds-border-input, ${N40})`,
6
+ rest: `var(--ds-border-input, ${getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? N100 : N40})`,
7
+ hovered: `var(--ds-border-input, ${getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? N100 : N40})`,
7
8
  disabled: `var(--ds-background-disabled, ${N20})`,
8
9
  checked: `var(--ds-background-selected-bold, ${B400})`,
9
10
  active: `var(--ds-border, ${B50})`,
@@ -28,7 +29,7 @@ const theme = {
28
29
  },
29
30
  dark: {
30
31
  borderColor: {
31
- rest: `var(--ds-border-input, ${DN80})`,
32
+ rest: `var(--ds-border-input, ${getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? DN200 : DN80})`,
32
33
  hovered: `var(--ds-border-input, ${DN200})`,
33
34
  disabled: `var(--ds-background-disabled, ${DN10})`,
34
35
  checked: `var(--ds-background-selected-bold, ${B400})`,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/checkbox",
3
- "version": "12.5.0",
3
+ "version": "12.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,6 +7,7 @@ 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';
10
11
  import { CheckboxIcon, Label, LabelText, RequiredIndicator } from './internal';
11
12
  /* eslint-disable @repo/internal/styles/no-nested-styles */
12
13
  var checkboxStyles = css({
@@ -35,7 +36,7 @@ var checkboxStyles = css({
35
36
  transition: 'color 0.2s ease-in-out, fill 0.2s ease-in-out',
36
37
  'rect:first-of-type': {
37
38
  stroke: 'var(--checkbox-border-color)',
38
- strokeWidth: 2,
39
+ strokeWidth: getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? 1 : 2,
39
40
  transition: 'stroke 0.2s ease-in-out'
40
41
  }
41
42
  },
@@ -153,7 +154,7 @@ var Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Checkbox(prop
153
154
  analyticsData: analyticsContext,
154
155
  componentName: 'checkbox',
155
156
  packageName: "@atlaskit/checkbox",
156
- packageVersion: "12.5.0"
157
+ packageVersion: "12.6.1"
157
158
  });
158
159
  var internalRef = useRef(null);
159
160
  var mergedRefs = mergeRefs([internalRef, ref]);
@@ -1,9 +1,10 @@
1
- import { B100, B200, B300, B400, B50, B75, DN10, DN200, DN30, DN80, DN90, N10, N20, N30, N40, N70, R300 } from '@atlaskit/theme/colors';
1
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
+ import { B100, B200, B300, B400, B50, B75, DN10, DN200, DN30, DN80, DN90, N10, N100, N20, N30, N40, N70, R300 } from '@atlaskit/theme/colors';
2
3
  var theme = {
3
4
  light: {
4
5
  borderColor: {
5
- rest: "var(--ds-border-input, ".concat(N40, ")"),
6
- hovered: "var(--ds-border-input, ".concat(N40, ")"),
6
+ rest: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? N100 : N40, ")"),
7
+ hovered: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? N100 : N40, ")"),
7
8
  disabled: "var(--ds-background-disabled, ".concat(N20, ")"),
8
9
  checked: "var(--ds-background-selected-bold, ".concat(B400, ")"),
9
10
  active: "var(--ds-border, ".concat(B50, ")"),
@@ -28,7 +29,7 @@ var theme = {
28
29
  },
29
30
  dark: {
30
31
  borderColor: {
31
- rest: "var(--ds-border-input, ".concat(DN80, ")"),
32
+ rest: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.update-border-input_ff9l1') ? DN200 : DN80, ")"),
32
33
  hovered: "var(--ds-border-input, ".concat(DN200, ")"),
33
34
  disabled: "var(--ds-background-disabled, ".concat(DN10, ")"),
34
35
  checked: "var(--ds-background-selected-bold, ".concat(B400, ")"),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/checkbox",
3
- "version": "12.5.0",
3
+ "version": "12.6.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
3
- export declare type Size = 'small' | 'medium' | 'large' | 'xlarge';
3
+ export type Size = 'small' | 'medium' | 'large' | 'xlarge';
4
4
  /**
5
5
  *
6
6
  *
@@ -8,7 +8,7 @@ export declare type Size = 'small' | 'medium' | 'large' | 'xlarge';
8
8
  *
9
9
  *
10
10
  */
11
- export declare type OwnProps = {
11
+ export type OwnProps = {
12
12
  /**
13
13
  * Sets whether the checkbox begins checked.
14
14
  */
@@ -71,8 +71,8 @@ export declare type OwnProps = {
71
71
  */
72
72
  analyticsContext?: Record<string, any>;
73
73
  };
74
- declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
75
- export declare type CheckboxProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement>,
74
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
75
+ export type CheckboxProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement>,
76
76
  /**
77
77
  * 'disabled', 'required', and 'checked' are omitted so that
78
78
  * consumers must handle state using our props.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/checkbox",
3
- "version": "12.5.0",
3
+ "version": "12.6.1",
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/"
@@ -12,6 +12,14 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
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
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.tsx",
17
25
  "atlassian": {
@@ -29,8 +37,9 @@
29
37
  "@atlaskit/analytics-next": "^9.1.0",
30
38
  "@atlaskit/ds-lib": "^2.2.0",
31
39
  "@atlaskit/icon": "^21.12.0",
40
+ "@atlaskit/platform-feature-flags": "^0.2.0",
32
41
  "@atlaskit/theme": "^12.5.0",
33
- "@atlaskit/tokens": "^1.3.0",
42
+ "@atlaskit/tokens": "^1.4.0",
34
43
  "@babel/runtime": "^7.0.0",
35
44
  "@emotion/react": "^11.7.1"
36
45
  },
@@ -47,11 +56,12 @@
47
56
  "@atlaskit/visual-regression": "*",
48
57
  "@atlaskit/webdriver-runner": "*",
49
58
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
59
+ "@atlassian/feature-flags-test-utils": "*",
50
60
  "@testing-library/react": "^12.1.5",
51
61
  "jscodeshift": "^0.13.0",
52
62
  "react-dom": "^16.8.0",
53
63
  "storybook-addon-performance": "^0.16.0",
54
- "typescript": "4.5.5",
64
+ "typescript": "~4.9.5",
55
65
  "wait-for-expect": "^1.2.0"
56
66
  },
57
67
  "keywords": [
@@ -79,6 +89,11 @@
79
89
  ]
80
90
  }
81
91
  },
92
+ "platform-feature-flags": {
93
+ "platform.design-system-team.update-border-input_ff9l1": {
94
+ "type": "boolean"
95
+ }
96
+ },
82
97
  "homepage": "https://atlassian.design/components/checkbox/",
83
98
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
84
99
  }