@atlaskit/checkbox 17.3.3 → 17.3.5

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,18 @@
1
1
  # @atlaskit/checkbox
2
2
 
3
+ ## 17.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`03f794ce20f2f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/03f794ce20f2f) -
8
+ Clean up and removal of the `platform-checkbox-atomic-styles` feature gate.
9
+
10
+ ## 17.3.4
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 17.3.3
4
17
 
5
18
  ### Patch Changes
@@ -1,6 +1,9 @@
1
1
  import { createRemoveImportsFor } from '../utils';
2
2
 
3
- export const removeThemeImports: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRemoveImportsFor({
3
+ export const removeThemeImports: (
4
+ j: import('jscodeshift/src/core').JSCodeshift,
5
+ source: import('jscodeshift/src/Collection').Collection<Node>,
6
+ ) => void = createRemoveImportsFor({
4
7
  importsToRemove: ['ComponentTokens', 'ThemeFn'],
5
8
  packagePath: '@atlaskit/checkbox/types',
6
9
  comment: `This file uses exports used to help theme @atlaskit/checkbox which
@@ -1,8 +1,14 @@
1
1
  import { createRemoveFuncFor } from '../utils';
2
2
 
3
- export const removeFullWidth: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRemoveFuncFor('@atlaskit/checkbox', 'Checkbox', 'isFullWidth');
3
+ export const removeFullWidth: (
4
+ j: import('jscodeshift/src/core').JSCodeshift,
5
+ source: import('jscodeshift/src/Collection').Collection<Node>,
6
+ ) => void = createRemoveFuncFor('@atlaskit/checkbox', 'Checkbox', 'isFullWidth');
4
7
 
5
- export const removeOverrides: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRemoveFuncFor(
8
+ export const removeOverrides: (
9
+ j: import('jscodeshift/src/core').JSCodeshift,
10
+ source: import('jscodeshift/src/Collection').Collection<Node>,
11
+ ) => void = createRemoveFuncFor(
6
12
  '@atlaskit/checkbox',
7
13
  'Checkbox',
8
14
  'overrides',
@@ -13,7 +19,10 @@ export const removeOverrides: (j: import("jscodeshift/src/core").JSCodeshift, so
13
19
  of Checkbox will have likely changed.`,
14
20
  );
15
21
 
16
- export const removeTheme: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRemoveFuncFor(
22
+ export const removeTheme: (
23
+ j: import('jscodeshift/src/core').JSCodeshift,
24
+ source: import('jscodeshift/src/Collection').Collection<Node>,
25
+ ) => void = createRemoveFuncFor(
17
26
  '@atlaskit/checkbox',
18
27
  'Checkbox',
19
28
  'theme',
@@ -24,4 +33,7 @@ export const removeTheme: (j: import("jscodeshift/src/core").JSCodeshift, source
24
33
  The appearance of Checkbox will have likely changed.`,
25
34
  );
26
35
 
27
- export const removeSize: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRemoveFuncFor('@atlaskit/checkbox', 'Checkbox', 'size');
36
+ export const removeSize: (
37
+ j: import('jscodeshift/src/core').JSCodeshift,
38
+ source: import('jscodeshift/src/Collection').Collection<Node>,
39
+ ) => void = createRemoveFuncFor('@atlaskit/checkbox', 'Checkbox', 'size');
@@ -4,19 +4,28 @@ import { createRenameImportFor } from '../utils';
4
4
  // there are a lot of possible things to fix. Having searched on SourceTree
5
5
  // these are the only things that need to be fixed
6
6
 
7
- export const renameTypeImport: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRenameImportFor({
7
+ export const renameTypeImport: (
8
+ j: import('jscodeshift/src/core').JSCodeshift,
9
+ source: import('jscodeshift/src/Collection').Collection<Node>,
10
+ ) => void = createRenameImportFor({
8
11
  componentName: 'CheckboxProps',
9
12
  oldPackagePath: '@atlaskit/checkbox/types',
10
13
  newPackagePath: '@atlaskit/checkbox',
11
14
  });
12
15
 
13
- export const renameDeepTypeImport: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRenameImportFor({
16
+ export const renameDeepTypeImport: (
17
+ j: import('jscodeshift/src/core').JSCodeshift,
18
+ source: import('jscodeshift/src/Collection').Collection<Node>,
19
+ ) => void = createRenameImportFor({
14
20
  componentName: 'CheckboxProps',
15
21
  oldPackagePath: '@atlaskit/checkbox/dist/cjs/types',
16
22
  newPackagePath: '@atlaskit/checkbox',
17
23
  });
18
24
 
19
- export const renameCheckboxWithoutAnalyticsImport: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRenameImportFor({
25
+ export const renameCheckboxWithoutAnalyticsImport: (
26
+ j: import('jscodeshift/src/core').JSCodeshift,
27
+ source: import('jscodeshift/src/Collection').Collection<Node>,
28
+ ) => void = createRenameImportFor({
20
29
  componentName: 'CheckboxWithoutAnalytics',
21
30
  newComponentName: 'Checkbox',
22
31
  oldPackagePath: '@atlaskit/checkbox/Checkbox',
@@ -1,8 +1,6 @@
1
1
  import { createRenameFuncFor } from '../utils';
2
2
 
3
- export const renameInputRef: (j: import("jscodeshift/src/core").JSCodeshift, source: import("jscodeshift/src/Collection").Collection<Node>) => void = createRenameFuncFor(
4
- '@atlaskit/checkbox',
5
- 'Checkbox',
6
- 'inputRef',
7
- 'ref',
8
- );
3
+ export const renameInputRef: (
4
+ j: import('jscodeshift/src/core').JSCodeshift,
5
+ source: import('jscodeshift/src/Collection').Collection<Node>,
6
+ ) => void = createRenameFuncFor('@atlaskit/checkbox', 'Checkbox', 'inputRef', 'ref');
@@ -20,7 +20,7 @@ export function getNamedSpecifier(
20
20
  source: any,
21
21
  specifier: string,
22
22
  importName: string,
23
- ) {
23
+ ): any {
24
24
  const specifiers = source
25
25
  .find(j.ImportDeclaration)
26
26
  .filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
@@ -61,7 +61,11 @@ export function getJSXAttributesByName(
61
61
  });
62
62
  }
63
63
 
64
- export function hasImportDeclaration(j: core.JSCodeshift, source: any, importPath: string) {
64
+ export function hasImportDeclaration(
65
+ j: core.JSCodeshift,
66
+ source: any,
67
+ importPath: string,
68
+ ): boolean {
65
69
  const imports = source
66
70
  .find(j.ImportDeclaration)
67
71
  .filter(
@@ -78,7 +82,7 @@ export function findIdentifierAndReplaceAttribute(
78
82
  identifierName: string,
79
83
  searchAttr: string,
80
84
  replaceWithAttr: string,
81
- ) {
85
+ ): void {
82
86
  source
83
87
  .find(j.JSXElement)
84
88
  .find(j.JSXOpeningElement)
@@ -136,7 +140,7 @@ export function addCommentToStartOfFile({
136
140
  j: core.JSCodeshift;
137
141
  base: Collection<Node>;
138
142
  message: string;
139
- }) {
143
+ }): void {
140
144
  addCommentBefore({
141
145
  j,
142
146
  target: base.find(j.Program),
@@ -152,7 +156,7 @@ export function addCommentBefore({
152
156
  j: core.JSCodeshift;
153
157
  target: Collection<Program> | Collection<ImportDeclaration>;
154
158
  message: string;
155
- }) {
159
+ }): void {
156
160
  const content: string = ` TODO: (from codemod) ${clean(message)} `;
157
161
  target.forEach((path: ASTPath<Program | ImportDeclaration>) => {
158
162
  path.value.comments = path.value.comments || [];
@@ -178,7 +182,7 @@ export function tryCreateImport({
178
182
  base: Collection<any>;
179
183
  relativeToPackage: string;
180
184
  packageName: string;
181
- }) {
185
+ }): void {
182
186
  const exists: boolean =
183
187
  base.find(j.ImportDeclaration).filter((path) => path.value.source.value === packageName)
184
188
  .length > 0;
@@ -203,7 +207,7 @@ export function addToImport({
203
207
  base: Collection<any>;
204
208
  importSpecifier: ImportSpecifier | ImportDefaultSpecifier;
205
209
  packageName: string;
206
- }) {
210
+ }): void {
207
211
  base
208
212
  .find(j.ImportDeclaration)
209
213
  .filter((path) => path.value.source.value === packageName)
@@ -223,7 +227,12 @@ export function addToImport({
223
227
  });
224
228
  }
225
229
 
226
- export const createRenameFuncFor =
230
+ export const createRenameFuncFor: (
231
+ component: string,
232
+ importName: string,
233
+ from: string,
234
+ to: string,
235
+ ) => (j: core.JSCodeshift, source: Collection<Node>) => void =
227
236
  (component: string, importName: string, from: string, to: string) =>
228
237
  (j: core.JSCodeshift, source: Collection<Node>) => {
229
238
  const specifier = getNamedSpecifier(j, source, component, importName);
@@ -253,7 +262,12 @@ export const createRenameFuncFor =
253
262
  }
254
263
  };
255
264
 
256
- export const createRemoveFuncFor =
265
+ export const createRemoveFuncFor: (
266
+ component: string,
267
+ importName: string,
268
+ prop: string,
269
+ comment?: string,
270
+ ) => (j: core.JSCodeshift, source: Collection<Node>) => void =
257
271
  (component: string, importName: string, prop: string, comment?: string) =>
258
272
  (j: core.JSCodeshift, source: Collection<Node>) => {
259
273
  const specifier =
@@ -274,7 +288,17 @@ export const createRemoveFuncFor =
274
288
  });
275
289
  };
276
290
 
277
- export const createRenameImportFor =
291
+ export const createRenameImportFor: ({
292
+ componentName,
293
+ newComponentName,
294
+ oldPackagePath,
295
+ newPackagePath,
296
+ }: {
297
+ componentName: string;
298
+ newComponentName?: string;
299
+ oldPackagePath: string;
300
+ newPackagePath: string;
301
+ }) => (j: core.JSCodeshift, source: Collection<Node>) => void =
278
302
  ({
279
303
  componentName,
280
304
  newComponentName,
@@ -355,7 +379,15 @@ export const createRenameImportFor =
355
379
  .remove();
356
380
  };
357
381
 
358
- export const createRemoveImportsFor =
382
+ export const createRemoveImportsFor: ({
383
+ importsToRemove,
384
+ packagePath,
385
+ comment,
386
+ }: {
387
+ importsToRemove: string[];
388
+ packagePath: string;
389
+ comment: string;
390
+ }) => (j: core.JSCodeshift, source: Collection<Node>) => void =
359
391
  ({
360
392
  importsToRemove,
361
393
  packagePath,
@@ -425,16 +457,21 @@ export const createRemoveImportsFor =
425
457
  }
426
458
  };
427
459
 
428
- export const createTransformer =
460
+ export const createTransformer: (
461
+ component: string,
462
+ migrates: {
463
+ (j: core.JSCodeshift, source: Collection<Node>): void;
464
+ }[],
465
+ ) => (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => string =
429
466
  (component: string, migrates: { (j: core.JSCodeshift, source: Collection<Node>): void }[]) =>
430
- (fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => {
431
- const source: Collection<Node> = j(fileInfo.source);
467
+ (fileInfo: FileInfo, { jscodeshift }: API, options: Options) => {
468
+ const source: Collection<Node> = jscodeshift(fileInfo.source);
432
469
 
433
- if (!hasImportDeclaration(j, source, component)) {
470
+ if (!hasImportDeclaration(jscodeshift, source, component)) {
434
471
  return fileInfo.source;
435
472
  }
436
473
 
437
- migrates.forEach((tf) => tf(j, source));
474
+ migrates.forEach((tf) => tf(jscodeshift, source));
438
475
 
439
476
  return source.toSource(options.printOptions || { quote: 'single' });
440
477
  };
@@ -1,72 +1,13 @@
1
1
 
2
2
  ._19itglyw{border:none}
3
- ._19op11so+svg rect:first-of-type{transition:stroke .2s ease-in-out}
4
- ._1dk71nfn._1dk71nfn:focus+svg{outline:var(--ds-border-width-focused,2px) solid var(--ds-border-focused,#2684ff)}
5
- ._1ef78r4n._1ef78r4n:checked:focus+svg{border-radius:var(--ds-radius-small,.25rem)}
6
- ._1h6r8r4n._1h6r8r4n:focus+svg{border-radius:var(--ds-radius-small,.25rem)}
7
- ._9bg71mn3+svg{transition:color .2s ease-in-out,fill .2s ease-in-out}
8
- ._nd5lfibj{grid-area:1/1/2/2}
9
- ._r050fibj+svg{grid-area:1/1/2/2}
10
- ._smzg1nfn._smzg1nfn:checked:focus+svg{outline:var(--ds-border-width-focused,2px) solid var(--ds-border-focused,#2684ff)}._10oaq2ws:checked[data-invalid]+svg{--checkbox-border-color:var(--local-border-checked-invalid)}
11
- ._10y313gf:disabled+svg{cursor:not-allowed}
12
- ._12ji1r31{outline-color:currentColor}
3
+ ._nd5lfibj{grid-area:1/1/2/2}._12ji1r31{outline-color:currentColor}
13
4
  ._12l2ze3t{margin-inline-end:var(--ds-space-0,0)}
14
- ._12sr13gf:disabled[data-invalid]+svg{cursor:not-allowed}
15
5
  ._12y31o36{outline-width:medium}
16
- ._13wo93zu+svg{--checkbox-background-color:var(--local-background)}
17
- ._141bmz2b:disabled:active+svg{--checkbox-background-color:var(--local-background-disabled)}
18
- ._15y61vek:active+svg{--checkbox-border-color:var(--local-border-active)}
19
- ._1610e4h9+svg rect:first-of-type{stroke-width:var(--ds-border-width,1px)}
20
- ._16jiglyw:disabled+svg{pointer-events:none}
21
- ._18qu1ps2:indeterminate+svg{--checkbox-background-color:var(--local-background-checked)}
22
- ._1adw13gf:disabled:hover+svg{cursor:not-allowed}
23
- ._1ah9199y:hover+svg{--checkbox-border-color:var(--local-border-hover)}
24
- ._1bok170n:checked+svg{--checkbox-border-color:var(--local-border-checked)}
25
6
  ._1bsb1osq{width:100%}
26
- ._1efy1diq:disabled:hover+svg{--checkbox-border-color:var(--local-border-disabled)}
27
- ._1fo21cni+svg{fill:var(--checkbox-tick-color)}
28
- ._1frj180l:checked:hover+svg{--checkbox-background-color:var(--local-background-checked-hover)}
29
- ._1g52170n:indeterminate+svg{--checkbox-border-color:var(--local-border-checked)}
30
- ._1jbnglyw:disabled[data-invalid]+svg{pointer-events:none}
31
- ._1jiz1diq:disabled:active+svg{--checkbox-border-color:var(--local-border-disabled)}
32
- ._1log17cl:indeterminate+svg{--checkbox-tick-color:var(--local-tick-checked)}
33
- ._1mhr17cl:checked+svg{--checkbox-tick-color:var(--local-tick-checked)}
34
- ._1niqglyw:disabled:focus+svg{pointer-events:none}
35
- ._1oav1diq:disabled[data-invalid]+svg{--checkbox-border-color:var(--local-border-disabled)}
36
7
  ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
37
8
  ._1qu2glyw{outline-style:none}
38
- ._1vv91diq:disabled:indeterminate+svg{--checkbox-border-color:var(--local-border-disabled)}
39
- ._1wt913gf:disabled:active+svg{cursor:not-allowed}
40
- ._255gmz2b:disabled:focus+svg{--checkbox-background-color:var(--local-background-disabled)}
41
- ._32hzmz2b:disabled:indeterminate+svg{--checkbox-background-color:var(--local-background-disabled)}
42
9
  ._4t3i1osq{height:100%}
43
- ._693jglyw:disabled:active+svg{pointer-events:none}
44
10
  ._6rthze3t{margin-block-end:var(--ds-space-0,0)}
45
- ._8gq114p8+svg{--checkbox-tick-color:var(--local-tick-rest)}
46
- ._a30fhteq+svg rect:first-of-type{stroke:var(--checkbox-border-color)}
47
11
  ._ahbqze3t{margin-inline-start:var(--ds-space-0,0)}
48
- ._axq81diq:disabled+svg{--checkbox-border-color:var(--local-border-disabled)}
49
- ._cl9tglyw:disabled:hover+svg{pointer-events:none}
50
- ._dwvb1ps2:checked+svg{--checkbox-background-color:var(--local-background-checked)}
51
- ._e6ww155b:checked:active+svg{--checkbox-background-color:var(--local-background-active)}
52
- ._eyedglyw+svg{pointer-events:none}
53
- ._fx2i3rva[data-invalid]+svg{--checkbox-border-color:var(--local-border-invalid)}
54
- ._h78e1g3k:checked:hover+svg{--checkbox-border-color:var(--local-border-checked-hover)}
55
- ._j1ta1hou:disabled:checked+svg{--checkbox-tick-color:var(--local-tick-disabled)}
56
- ._jj67mz2b:disabled:hover+svg{--checkbox-background-color:var(--local-background-disabled)}
57
- ._l71j1i6y._l71j1i6y:checked:focus+svg{outline-offset:var(--ds-space-negative-025,-2px)}
58
- ._q5a61gyf+svg{--checkbox-border-color:var(--local-border)}
59
- ._qq8613gf:disabled:focus+svg{cursor:not-allowed}
60
12
  ._r06hglyw{-webkit-appearance:none;appearance:none}
61
- ._rphw18jz:checked:active+svg{--checkbox-tick-color:var(--local-tick-active)}
62
- ._s9051diq:disabled:focus+svg{--checkbox-border-color:var(--local-border-disabled)}
63
- ._sg1j1vek:checked:active+svg{--checkbox-border-color:var(--local-border-active)}
64
- ._swhgmz2b:disabled[data-invalid]+svg{--checkbox-background-color:var(--local-background-disabled)}
65
- ._t34a1i6y._t34a1i6y:focus+svg{outline-offset:var(--ds-space-negative-025,-2px)}
66
- ._tzy4idpf{opacity:0}
67
- ._w12s155b:active+svg{--checkbox-background-color:var(--local-background-active)}
68
- ._wje2mov0+svg{color:var(--checkbox-background-color)}
69
- ._y32gkivo:hover+svg{--checkbox-background-color:var(--local-background-hover)}
70
- ._y9y9mz2b:disabled+svg{--checkbox-background-color:var(--local-background-disabled)}
71
- ._yjhd1hou:disabled:indeterminate+svg{--checkbox-tick-color:var(--local-tick-disabled)}
72
- @media screen and (forced-colors:active){._w1cowc43+svg{--checkbox-background-color:Canvas}._jdqn1onz+svg{--checkbox-border-color:CanvasText}._4y4t1onz+svg{--checkbox-tick-color:CanvasText}._lvfrwc43:checked+svg{--checkbox-background-color:Canvas}._g68dwc43:checked:hover+svg{--checkbox-background-color:Canvas}._13dk1onz:checked+svg{--checkbox-border-color:CanvasText}._w1el1onz:checked:hover+svg{--checkbox-border-color:CanvasText}._a9yw1onz:checked+svg{--checkbox-tick-color:CanvasText}._1l3g1onz:checked:hover+svg{--checkbox-tick-color:CanvasText}._dcdpgir2:focus+svg rect:first-of-type{stroke:Highlight}._wobcgir2[data-invalid]+svg{--checkbox-border-color:Highlight}._rp9wgir2:checked[data-invalid]+svg{--checkbox-border-color:Highlight}._9ebfwc43:disabled+svg{--checkbox-background-color:Canvas}._e43iwc43:disabled:active+svg{--checkbox-background-color:Canvas}._1tkuwc43:disabled:focus+svg{--checkbox-background-color:Canvas}._1lehwc43:disabled:hover+svg{--checkbox-background-color:Canvas}._b9q3wc43:disabled[data-invalid]+svg{--checkbox-background-color:Canvas}._tu2918qt:disabled+svg{--checkbox-border-color:GrayText}._1uxv18qt:disabled:active+svg{--checkbox-border-color:GrayText}._1ufw18qt:disabled:focus+svg{--checkbox-border-color:GrayText}._opo918qt:disabled:hover+svg{--checkbox-border-color:GrayText}._1e8318qt:disabled[data-invalid]+svg{--checkbox-border-color:GrayText}._1k3d18qt:disabled+svg{--checkbox-tick-color:GrayText}._25yv18qt:disabled:active+svg{--checkbox-tick-color:GrayText}._1igz18qt:disabled:focus+svg{--checkbox-tick-color:GrayText}._c7cc18qt:disabled:hover+svg{--checkbox-tick-color:GrayText}._1swg18qt:disabled[data-invalid]+svg{--checkbox-tick-color:GrayText}}
13
+ ._tzy4idpf{opacity:0}
@@ -16,7 +16,6 @@ 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 _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
19
  var _internal = require("./internal");
21
20
  var _excluded = ["isChecked", "isDisabled", "isInvalid", "defaultChecked", "isIndeterminate", "onChange", "analyticsContext", "label", "name", "value", "isRequired", "testId", "xcss", "className"];
22
21
  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); }
@@ -29,19 +28,6 @@ var checkboxStyles = {
29
28
  root: "_19itglyw _nd5lfibj _12ji1r31 _1qu2glyw _12y31o36 _1bsb1osq _4t3i1osq _r06hglyw _6rthze3t _1pfhze3t _12l2ze3t _ahbqze3t _tzy4idpf"
30
29
  };
31
30
 
32
- /**
33
- * Legacy hidden input styles with nested sibling selectors.
34
- * Used when the `platform-checkbox-atomic-styles` feature gate is disabled.
35
- * Using `cssMap` to avoid a Compiled bug with the transformed styles.
36
- * It was using a CSS variable for the outline template string,
37
- * which broke because of the use of a sibling selector.
38
- *
39
- * Related to: https://github.com/atlassian-labs/compiled/pull/1795
40
- */
41
- var checkboxStylesLegacy = {
42
- root: "_19itglyw _nd5lfibj _12ji1r31 _1qu2glyw _12y31o36 _1bsb1osq _4t3i1osq _r06hglyw _6rthze3t _1pfhze3t _12l2ze3t _ahbqze3t _tzy4idpf _r050fibj _9bg71mn3 _19op11so _a30fhteq _1610e4h9 _13wo93zu _q5a61gyf _8gq114p8 _wje2mov0 _1fo21cni _eyedglyw _1ef78r4n _1h6r8r4n _smzg1nfn _1dk71nfn _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"
43
- };
44
-
45
31
  /**
46
32
  * __Checkbox__
47
33
  *
@@ -87,7 +73,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
87
73
  analyticsData: analyticsContext,
88
74
  componentName: 'checkbox',
89
75
  packageName: "@atlaskit/checkbox",
90
- packageVersion: "0.0.0-development"
76
+ packageVersion: "17.3.4"
91
77
  });
92
78
  var internalRef = (0, _react.useRef)(null);
93
79
  var mergedRefs = (0, _mergeRefs.default)([internalRef, ref]);
@@ -101,9 +87,9 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
101
87
  }, [isIndeterminate]);
102
88
  return /*#__PURE__*/React.createElement(_internal.Label, {
103
89
  isDisabled: isDisabled,
104
- isChecked: (0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles') ? isChecked : undefined,
105
- isIndeterminate: (0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles') ? isIndeterminate : undefined,
106
- isInvalid: (0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles') ? isInvalid : undefined,
90
+ isChecked: isChecked,
91
+ isIndeterminate: isIndeterminate,
92
+ isInvalid: isInvalid,
107
93
  label: label,
108
94
  id: rest.id ? "".concat(rest.id, "-label") : undefined,
109
95
  testId: testId && "".concat(testId, "--checkbox-label")
@@ -123,7 +109,7 @@ var Checkbox = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef
123
109
  name: name,
124
110
  required: isRequired,
125
111
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
126
- className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles') && checkboxStyles.root, !(0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles') && checkboxStylesLegacy.root, className]),
112
+ className: (0, _runtime.ax)([checkboxStyles.root, className]),
127
113
  onChange: onChangeAnalytics,
128
114
  "aria-invalid": isInvalid ? 'true' : undefined,
129
115
  "data-testid": testId && "".concat(testId, "--hidden-checkbox"),
@@ -10,5 +10,4 @@
10
10
  ._1snbe4h9{stroke-width:var(--ds-border-width,1px)}
11
11
  ._lcxvglyw{pointer-events:none}
12
12
  ._lswu1kgh{fill:var(--checkbox-tick-color,var(--ds-surface,#fff))}
13
- ._lswuvuon{fill:var(--ds-surface,#fff)}
14
13
  ._syazmov0{color:var(--checkbox-background-color)}
@@ -10,7 +10,6 @@ require("./checkbox-icon.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
13
  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); }
15
14
  /**
16
15
  * Styles for the checkbox icon.
@@ -21,12 +20,6 @@ var svgStyles = {
21
20
  root: "_nd5lfibj _1reo15vq _18m915vq _v5641mn3 _2rko12b0 _1a3742bt _lcxvglyw _syazmov0 _lswu1kgh _1cwg1i6y",
22
21
  rect: "_v56411so _1snbe4h9 _1s17hteq"
23
22
  };
24
-
25
- /**
26
- * Legacy SVG styles.
27
- * Used when the `platform-checkbox-atomic-styles` feature gate is disabled.
28
- */
29
- var svgStylesLegacy = null;
30
23
  function getIcon(isIndeterminate, isChecked) {
31
24
  if (isIndeterminate) {
32
25
  return /*#__PURE__*/React.createElement("path", {
@@ -62,39 +55,12 @@ var CheckboxIcon = /*#__PURE__*/(0, _react.memo)(function (_ref) {
62
55
  var icon = (0, _react.useMemo)(function () {
63
56
  return getIcon(isIndeterminate, isChecked);
64
57
  }, [isIndeterminate, isChecked]);
65
- if ((0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles')) {
66
- return /*#__PURE__*/React.createElement("svg", {
67
- width: 24,
68
- height: 24,
69
- viewBox: "0 0 24 24",
70
- role: "presentation",
71
- className: (0, _runtime.ax)([svgStyles.root])
72
- }, /*#__PURE__*/React.createElement("g", {
73
- fillRule: "evenodd"
74
- }, /*#__PURE__*/React.createElement("rect", {
75
- fill: "currentColor",
76
- x: "5.5",
77
- y: "5.5",
78
- width: "13",
79
- height: "13",
80
- rx: "1.5",
81
- className: (0, _runtime.ax)([svgStyles.rect])
82
- }), icon));
83
- }
84
-
85
- // Legacy rendering with inline style props for CSS variable consumption
86
58
  return /*#__PURE__*/React.createElement("svg", {
87
59
  width: 24,
88
60
  height: 24,
89
61
  viewBox: "0 0 24 24",
90
- style: {
91
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
92
- color: 'var(--checkbox-background-color)',
93
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
94
- fill: 'var(--checkbox-tick-color)'
95
- },
96
62
  role: "presentation",
97
- className: (0, _runtime.ax)(["_1reo15vq _18m915vq _lswuvuon _lcxvglyw"])
63
+ className: (0, _runtime.ax)([svgStyles.root])
98
64
  }, /*#__PURE__*/React.createElement("g", {
99
65
  fillRule: "evenodd"
100
66
  }, /*#__PURE__*/React.createElement("rect", {
@@ -103,7 +69,8 @@ var CheckboxIcon = /*#__PURE__*/(0, _react.memo)(function (_ref) {
103
69
  y: "5.5",
104
70
  width: "13",
105
71
  height: "13",
106
- rx: "1.5"
72
+ rx: "1.5",
73
+ className: (0, _runtime.ax)([svgStyles.rect])
107
74
  }), icon));
108
75
  });
109
76
  var _default = exports.default = CheckboxIcon;
@@ -1,44 +1,23 @@
1
1
  ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
2
  ._zulp1nu5{gap:var(--ds-space-0,0) var(--ds-space-050,4px)}
3
- ._13hr1j28{--local-tick-rest:transparent}
4
- ._18q0snw8{--local-tick-disabled:var(--_1xmcmw9)}
5
3
  ._1c53glyw{--checkbox-outline:none}
6
- ._1dik1ehr{--local-border-checked-hover:var(--_14y1fod)}
7
4
  ._1e0c11p5{display:grid}
8
5
  ._1e9d1j28{--checkbox-tick-color:transparent}
9
6
  ._1e9d2sac{--checkbox-tick-color:var(--ds-icon-disabled,#080f214a)}
10
7
  ._1e9d5w2r{--checkbox-tick-color:var(--ds-icon-inverse,#fff)}
11
8
  ._1ejihkll{grid-auto-columns:1fr}
12
- ._1esz1j4g{--local-background-checked:var(--_1gcp7nr)}
13
- ._1g1fe69j{--local-border-active:var(--_rczcge)}
14
- ._1j3h1380{--local-border-invalid:var(--_1i4xulb)}
15
- ._1nzs1kc0{--local-background-active:var(--_1cd0fcx)}
16
9
  ._1qwn1j9a{--checkbox-background-color:var(--ds-background-input,#fff)}
17
10
  ._1qwnby5v{--checkbox-background-color:var(--ds-background-disabled,#17171708)}
18
11
  ._1qwnjmqp{--checkbox-background-color:var(--ds-background-selected-bold,#1868db)}
19
- ._1rdaeh7q{--local-tick-checked:var(--_jf353p)}
20
- ._1sfg1380{--local-border-checked-invalid:var(--_1i4xulb)}
21
- ._1yjc3zdg{--local-border-focus:var(--_xjqa3d)}
22
12
  ._80om13gf{cursor:not-allowed}
23
13
  ._80om73ad{cursor:default}
24
- ._ay2w1ouc{--local-background-disabled:var(--_r5pknd)}
25
- ._d51u12ci{--local-background-hover:var(--_1z08gfx)}
26
- ._eawbxz7c{--local-tick-active:var(--_uq1ko9)}
27
14
  ._f0gr1bqt{--checkbox-border-color:var(--ds-border-danger,#e2483d)}
28
15
  ._f0grby5v{--checkbox-border-color:var(--ds-background-disabled,#17171708)}
29
16
  ._f0grjmqp{--checkbox-border-color:var(--ds-background-selected-bold,#1868db)}
30
17
  ._f0grrsbi{--checkbox-border-color:var(--ds-border-input,#8c8f97)}
31
- ._fpdj1ouc{--local-border-disabled:var(--_r5pknd)}
32
- ._h5e31kd8{--local-background:var(--_4mkb4g)}
33
- ._l6wk1j4g{--local-border-checked:var(--_1gcp7nr)}
34
- ._oaj1ddza{--local-border-hover:var(--_vnm8xo)}
35
- ._phftddza{--local-border:var(--_vnm8xo)}
36
18
  ._syaz1tvo{color:var(--ds-text-disabled,#97a0af)}
37
- ._syaz7wap{color:var(--_1ynhf1h)}
38
19
  ._syazi7uo{color:var(--ds-text,#292a2e)}
39
- ._syazovqm{color:var(--_5xk3r4)}
40
20
  ._umai184x{grid-auto-rows:min-content}
41
- ._yp0j1ehr{--local-background-checked-hover:var(--_14y1fod)}
42
21
  ._yv0ey09t{grid-template-columns:min-content auto}
43
22
  ._ljcgdfik:focus-within{--checkbox-outline:var(--ds-border-width-focused,2px) solid var(--ds-border-focused,#4688ec)}
44
23
  ._1vj51q28:hover{--checkbox-background-color:var(--ds-background-selected-bold-hovered,#1558bc)}
@@ -1,4 +1,13 @@
1
1
  /* label.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ /**
3
+ * Base state styles with CSS custom properties.
4
+ * Pseudo-selectors (:hover, :focus-within, :active) on the label element
5
+ * update CSS variables that cascade to the CheckboxIcon.
6
+ * This avoids nested sibling selectors.
7
+ *
8
+ * Uses `css` over `cssMap` to work around a bug in Compiled types when
9
+ * using CSS variables in pseudo-selectors.
10
+ */
2
11
  "use strict";
3
12
 
4
13
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -9,18 +18,7 @@ exports.default = Label;
9
18
  require("./label.compiled.css");
10
19
  var React = _interopRequireWildcard(require("react"));
11
20
  var _runtime = require("@compiled/react/runtime");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
- var _colors = require("@atlaskit/theme/colors");
14
21
  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); }
15
- /**
16
- * Base state styles with CSS custom properties.
17
- * Pseudo-selectors (:hover, :focus-within, :active) on the label element
18
- * update CSS variables that cascade to the CheckboxIcon.
19
- * This avoids nested sibling selectors.
20
- *
21
- * Uses `css` over `cssMap` to work around a bug in Compiled types when
22
- * using CSS variables in pseudo-selectors.
23
- */
24
22
  var baseStyles = null;
25
23
  var textLabelLayoutStyles = null;
26
24
 
@@ -35,15 +33,6 @@ var disabledStyles = null;
35
33
 
36
34
  // Disabled + Checked/Indeterminate
37
35
  var disabledCheckedStyles = null;
38
-
39
- /**
40
- * Legacy label styles with --local-* CSS custom properties.
41
- * These are consumed by the nested sibling selectors in checkbox.tsx.
42
- */
43
- var legacyBaseStyles = null;
44
- var legacyTextLabelLayoutStyles = null;
45
- var legacyDisabledStyles = null;
46
- var legacyLabelStyles = null;
47
36
  function Label(_ref) {
48
37
  var children = _ref.children,
49
38
  isDisabled = _ref.isDisabled,
@@ -54,35 +43,10 @@ function Label(_ref) {
54
43
  label = _ref.label,
55
44
  id = _ref.id,
56
45
  xcss = _ref.xcss;
57
- if ((0, _platformFeatureFlags.fg)('platform-checkbox-atomic-styles')) {
58
- return /*#__PURE__*/React.createElement("label", {
59
- className: (0, _runtime.ax)(["_11c8fhey _1e0c11p5 _1ejihkll _umai184x _1qwn1j9a _f0grrsbi _1c53glyw _1e9d1j28 _syazi7uo _80om73ad _ljcgdfik _1vj5l4ek _dh4gr01l _cz1u1l7x _jom5wc43 _1s071onz _106f1onz", label && "_zulp1nu5 _yv0ey09t", (isChecked || isIndeterminate) && "_1qwnjmqp _f0grjmqp _1e9d5w2r _1vj51q28 _q29q1q28 _dh4gr01l _cz1u1l7x _zoo95w2r _jom5wc43 _1s071onz _106f1onz", isInvalid && "_f0gr1bqt _q29q1bqt _cz1u1bqt _1s07gir2", isDisabled && "_1qwnby5v _f0grby5v _syaz1tvo _80om13gf _1vj5by5v _q29qby5v _dh4gby5v _cz1uby5v _jom5wc43 _1s0718qt _106f18qt", isDisabled && (isChecked || isIndeterminate) && "_1e9d2sac _9js12sac _zoo92sac", xcss]),
60
- "data-testid": testId,
61
- "data-disabled": isDisabled || undefined,
62
- id: id
63
- }, children);
64
- }
65
46
  return /*#__PURE__*/React.createElement("label", {
66
- className: (0, _runtime.ax)(["_11c8fhey _1e0c11p5 _1ejihkll _umai184x _syazovqm _80om73ad", label && "_zulp1nu5 _yv0ey09t", isDisabled && "_syaz7wap _80om13gf", "_h5e31kd8 _1nzs1kc0 _1esz1j4g _yp0j1ehr _ay2w1ouc _d51u12ci _phftddza _1g1fe69j _l6wk1j4g _1dik1ehr _1sfg1380 _fpdj1ouc _1yjc3zdg _oaj1ddza _1j3h1380 _eawbxz7c _1rdaeh7q _18q0snw8 _13hr1j28", xcss]),
47
+ className: (0, _runtime.ax)(["_11c8fhey _1e0c11p5 _1ejihkll _umai184x _1qwn1j9a _f0grrsbi _1c53glyw _1e9d1j28 _syazi7uo _80om73ad _ljcgdfik _1vj5l4ek _dh4gr01l _cz1u1l7x _jom5wc43 _1s071onz _106f1onz", label && "_zulp1nu5 _yv0ey09t", (isChecked || isIndeterminate) && "_1qwnjmqp _f0grjmqp _1e9d5w2r _1vj51q28 _q29q1q28 _dh4gr01l _cz1u1l7x _zoo95w2r _jom5wc43 _1s071onz _106f1onz", isInvalid && "_f0gr1bqt _q29q1bqt _cz1u1bqt _1s07gir2", isDisabled && "_1qwnby5v _f0grby5v _syaz1tvo _80om13gf _1vj5by5v _q29qby5v _dh4gby5v _cz1uby5v _jom5wc43 _1s0718qt _106f18qt", isDisabled && (isChecked || isIndeterminate) && "_1e9d2sac _9js12sac _zoo92sac", xcss]),
67
48
  "data-testid": testId,
68
49
  "data-disabled": isDisabled || undefined,
69
- id: id,
70
- style: {
71
- "--_5xk3r4": (0, _runtime.ix)("var(--ds-text, ".concat(_colors.N900, ")")),
72
- "--_1ynhf1h": (0, _runtime.ix)("var(--ds-text-disabled, ".concat(_colors.N80, ")")),
73
- "--_4mkb4g": (0, _runtime.ix)("var(--ds-background-input, ".concat(_colors.N10, ")")),
74
- "--_1cd0fcx": (0, _runtime.ix)("var(--ds-background-input-pressed, ".concat(_colors.B50, ")")),
75
- "--_1gcp7nr": (0, _runtime.ix)("var(--ds-background-selected-bold, ".concat(_colors.B400, ")")),
76
- "--_14y1fod": (0, _runtime.ix)("var(--ds-background-selected-bold-hovered, ".concat(_colors.B300, ")")),
77
- "--_r5pknd": (0, _runtime.ix)("var(--ds-background-disabled, ".concat(_colors.N20, ")")),
78
- "--_1z08gfx": (0, _runtime.ix)("var(--ds-background-input-hovered, ".concat(_colors.N30, ")")),
79
- "--_vnm8xo": (0, _runtime.ix)("var(--ds-border-input, ".concat(_colors.N100, ")")),
80
- "--_rczcge": (0, _runtime.ix)("var(--ds-border, ".concat(_colors.B50, ")")),
81
- "--_1i4xulb": (0, _runtime.ix)("var(--ds-border-danger, ".concat(_colors.R300, ")")),
82
- "--_xjqa3d": (0, _runtime.ix)("var(--ds-border-focused, ".concat(_colors.B200, ")")),
83
- "--_uq1ko9": (0, _runtime.ix)("var(--ds-icon-inverse, ".concat(_colors.B400, ")")),
84
- "--_jf353p": (0, _runtime.ix)("var(--ds-icon-inverse, ".concat(_colors.N10, ")")),
85
- "--_1xmcmw9": (0, _runtime.ix)("var(--ds-icon-disabled, ".concat(_colors.N70, ")"))
86
- }
50
+ id: id
87
51
  }, children);
88
52
  }