@atlaskit/css 0.19.2 → 0.19.4
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/codemods/0.5.2-primitives-emotion-to-compiled/index.tsx +5 -2
- package/codemods/0.5.2-primitives-emotion-to-compiled/style-maps.partial.tsx +2 -13
- package/codemods/hypermod.config.tsx +6 -1
- package/constellation/index/migration.mdx +1 -1
- package/constellation/index/overview.mdx +1 -1
- package/css.docs.tsx +86 -0
- package/dist/cjs/index.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -47,8 +47,11 @@ const styleMaps = {
|
|
|
47
47
|
...textWeightMap,
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
export default function transformer(
|
|
51
|
+
fileInfo: FileInfo,
|
|
52
|
+
{ jscodeshift: j }: API,
|
|
53
|
+
_options: Options,
|
|
54
|
+
): string | undefined {
|
|
52
55
|
const base = j(fileInfo.source);
|
|
53
56
|
|
|
54
57
|
// replace xcss with cssMap
|
|
@@ -1373,7 +1373,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
1373
1373
|
|
|
1374
1374
|
/**
|
|
1375
1375
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
1376
|
-
* @codegen <<SignedSource::
|
|
1376
|
+
* @codegen <<SignedSource::6dffa08c1104af4093361cb0f7e37996>>
|
|
1377
1377
|
* @codegenId typography
|
|
1378
1378
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
1379
1379
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -1382,7 +1382,6 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
export const fontMap: {
|
|
1384
1384
|
'font.body': 'var(--ds-font-body)';
|
|
1385
|
-
'font.body.UNSAFE_small': 'var(--ds-font-body-UNSAFE_small)';
|
|
1386
1385
|
'font.body.large': 'var(--ds-font-body-large)';
|
|
1387
1386
|
'font.body.small': 'var(--ds-font-body-small)';
|
|
1388
1387
|
'font.code': 'var(--ds-font-code)';
|
|
@@ -1401,11 +1400,6 @@ export const fontMap: {
|
|
|
1401
1400
|
'font.body',
|
|
1402
1401
|
'normal 400 14px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
1403
1402
|
),
|
|
1404
|
-
// @deprecated
|
|
1405
|
-
'font.body.UNSAFE_small': token(
|
|
1406
|
-
'font.body.UNSAFE_small',
|
|
1407
|
-
'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
1408
|
-
),
|
|
1409
1403
|
'font.body.large': token(
|
|
1410
1404
|
'font.body.large',
|
|
1411
1405
|
'normal 400 16px/24px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
@@ -1513,7 +1507,7 @@ export type FontFamily = keyof typeof fontFamilyMap;
|
|
|
1513
1507
|
|
|
1514
1508
|
/**
|
|
1515
1509
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
1516
|
-
* @codegen <<SignedSource::
|
|
1510
|
+
* @codegen <<SignedSource::b67a50fa5abb078032598ba819a6f691>>
|
|
1517
1511
|
* @codegenId text
|
|
1518
1512
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
1519
1513
|
* @codegenDependency ../../../primitives/scripts/codegen-file-templates/dimensions.tsx <<SignedSource::cc9b3f12104c6ede803da6a42daac0b0>>
|
|
@@ -1521,7 +1515,6 @@ export type FontFamily = keyof typeof fontFamilyMap;
|
|
|
1521
1515
|
*/
|
|
1522
1516
|
export const textSizeMap: {
|
|
1523
1517
|
medium: 'var(--ds-font-body)';
|
|
1524
|
-
UNSAFE_small: 'var(--ds-font-body-UNSAFE_small)';
|
|
1525
1518
|
large: 'var(--ds-font-body-large)';
|
|
1526
1519
|
small: 'var(--ds-font-body-small)';
|
|
1527
1520
|
} = {
|
|
@@ -1529,10 +1522,6 @@ export const textSizeMap: {
|
|
|
1529
1522
|
'font.body',
|
|
1530
1523
|
'normal 400 14px/20px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
1531
1524
|
),
|
|
1532
|
-
UNSAFE_small: token(
|
|
1533
|
-
'font.body.UNSAFE_small',
|
|
1534
|
-
'normal 400 12px/16px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
1535
|
-
),
|
|
1536
1525
|
large: token(
|
|
1537
1526
|
'font.body.large',
|
|
1538
1527
|
'normal 400 16px/24px "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import primitivesEmotionToCompiled from './0.5.2-primitives-emotion-to-compiled';
|
|
2
2
|
|
|
3
|
-
const config
|
|
3
|
+
const config: {
|
|
4
|
+
presets: {
|
|
5
|
+
'primitives-emotion-to-compiled': typeof primitivesEmotionToCompiled;
|
|
6
|
+
};
|
|
7
|
+
dependencies: string[];
|
|
8
|
+
} = {
|
|
4
9
|
presets: {
|
|
5
10
|
'primitives-emotion-to-compiled': primitivesEmotionToCompiled,
|
|
6
11
|
},
|
|
@@ -18,7 +18,7 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
18
18
|
|
|
19
19
|
We have a codemod available to support this migration, but there are some breaking changes between
|
|
20
20
|
Emotion and Compiled, such as dynamic styles or imports. Please use the
|
|
21
|
-
[UI Styling Standard ESLint Plugin](/components/eslint-plugin-ui-styling-standard
|
|
21
|
+
[UI Styling Standard ESLint Plugin](/components/eslint-plugin-ui-styling-standard) to guide you.
|
|
22
22
|
|
|
23
23
|
## Codemod
|
|
24
24
|
|
|
@@ -34,7 +34,7 @@ For configuration details, see our
|
|
|
34
34
|
at Atlassian.
|
|
35
35
|
|
|
36
36
|
This is a strictly bounded variant designed to align the use of
|
|
37
|
-
[Design System tokens](
|
|
37
|
+
[Design System tokens](/components/tokens/all-tokens) and properties. You cannot use arbitrary
|
|
38
38
|
values, such as `color: 'rgba(123, 45, 67)'` nor `padding: 8`. Typically, only tokenized values are
|
|
39
39
|
allowed. Additionally, there are some restrictions, such as `zIndex`, which only supports a limited
|
|
40
40
|
set of numeric values.
|
package/css.docs.tsx
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
|
|
4
|
+
|
|
5
|
+
const documentation: ComponentStructuredContentSource[] = [
|
|
6
|
+
{
|
|
7
|
+
name: 'css',
|
|
8
|
+
description: 'A typed variant of Compiled CSS-in-JS adhering to the Atlassian Design System.',
|
|
9
|
+
status: 'open-beta',
|
|
10
|
+
import: {
|
|
11
|
+
name: 'css',
|
|
12
|
+
package: '@atlaskit/css',
|
|
13
|
+
type: 'named',
|
|
14
|
+
packagePath: path.resolve(__dirname),
|
|
15
|
+
packageJson: require('./package.json'),
|
|
16
|
+
},
|
|
17
|
+
usageGuidelines: [
|
|
18
|
+
'Prefer `cssMap` for CSS-in-JS styling',
|
|
19
|
+
"Use typescript to infer most things, eg. which media queries you're allowed to use",
|
|
20
|
+
'If the typescript bounding is too restrictive, you can use the `@compiled/react` library instead',
|
|
21
|
+
],
|
|
22
|
+
examples: [
|
|
23
|
+
{
|
|
24
|
+
name: 'Css',
|
|
25
|
+
description: 'Css example',
|
|
26
|
+
source: path.resolve(__dirname, './examples/ai/css.tsx'),
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
keywords: ['css', 'styles', 'theme', 'styling', 'utilities'],
|
|
30
|
+
categories: ['utility'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'cssMap',
|
|
34
|
+
description: 'A typed variant of Compiled CSS-in-JS adhering to the Atlassian Design System.',
|
|
35
|
+
status: 'open-beta',
|
|
36
|
+
import: {
|
|
37
|
+
name: 'cssMap',
|
|
38
|
+
package: '@atlaskit/css',
|
|
39
|
+
type: 'named',
|
|
40
|
+
packagePath: path.resolve(__dirname),
|
|
41
|
+
packageJson: require('./package.json'),
|
|
42
|
+
},
|
|
43
|
+
usageGuidelines: [
|
|
44
|
+
'This is the primary way to define styles in a more structured manner than `css`',
|
|
45
|
+
"Use typescript to infer most things, eg. which media queries you're allowed to use",
|
|
46
|
+
'If the typescript bounding is too restrictive, you can use the `@compiled/react` library instead',
|
|
47
|
+
'You MUST use this when working with an `xcss` prop as `css` does not work there',
|
|
48
|
+
],
|
|
49
|
+
examples: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Css Map',
|
|
52
|
+
description: 'Css Map example',
|
|
53
|
+
source: path.resolve(__dirname, './examples/ai/css-map.tsx'),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
keywords: ['css', 'styles', 'theme', 'styling', 'utilities'],
|
|
57
|
+
categories: ['utility'],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'cx',
|
|
61
|
+
description: 'A function for combining styles in an `xcss` prop to maintain correct typing.',
|
|
62
|
+
status: 'open-beta',
|
|
63
|
+
import: {
|
|
64
|
+
name: 'cx',
|
|
65
|
+
package: '@atlaskit/css',
|
|
66
|
+
type: 'named',
|
|
67
|
+
packagePath: path.resolve(__dirname),
|
|
68
|
+
packageJson: require('./package.json'),
|
|
69
|
+
},
|
|
70
|
+
usageGuidelines: [
|
|
71
|
+
'Use this to combine styles in an `xcss` prop to maintain correct typing, eg. `cx(styles.root, styles.bordered)`',
|
|
72
|
+
'This is not required for native elements which should use `[]` instead, eg. `[styles.root, styles.bordered]`',
|
|
73
|
+
],
|
|
74
|
+
examples: [
|
|
75
|
+
{
|
|
76
|
+
name: 'Cx',
|
|
77
|
+
description: 'Cx example',
|
|
78
|
+
source: path.resolve(__dirname, './examples/ai/cx.tsx'),
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
keywords: ['css', 'styles', 'theme', 'styling', 'utilities'],
|
|
82
|
+
categories: ['utility'],
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
export default documentation;
|
package/dist/cjs/index.js
CHANGED
package/dist/es2019/index.js
CHANGED
package/dist/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/css",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "Style components backed by Atlassian Design System design tokens powered by Compiled CSS-in-JS.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,18 +44,19 @@
|
|
|
44
44
|
],
|
|
45
45
|
"atlaskit:src": "src/index.tsx",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@atlaskit/tokens": "^
|
|
47
|
+
"@atlaskit/tokens": "^13.0.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
|
-
"@compiled/react": "^0.
|
|
49
|
+
"@compiled/react": "^0.20.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": "^18.2.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@af/visual-regression": "workspace:^",
|
|
56
|
-
"@atlaskit/button": "^23.
|
|
57
|
-
"@atlaskit/ds-lib": "^
|
|
58
|
-
"@atlaskit/primitives": "^
|
|
56
|
+
"@atlaskit/button": "^23.11.0",
|
|
57
|
+
"@atlaskit/ds-lib": "^7.0.0",
|
|
58
|
+
"@atlaskit/primitives": "^19.0.0",
|
|
59
|
+
"@atlassian/structured-docs-types": "workspace:^",
|
|
59
60
|
"@emotion/react": "^11.7.1",
|
|
60
61
|
"@testing-library/react": "^16.3.0",
|
|
61
62
|
"@types/jscodeshift": "^0.11.0",
|