@atlaskit/icon-file-type 6.4.8 → 6.5.0
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 +199 -78
- package/__tests__/visual-regression/icon-file-type-snapshots.test.ts +14 -24
- package/afm-jira/tsconfig.json +24 -0
- package/afm-post-office/tsconfig.json +24 -0
- package/codemods/6.1.0-metadata-entry.ts +90 -97
- package/codemods/__tests__/6.1.0-metadata-entry.ts +63 -63
- package/docs/0-intro.tsx +7 -7
- package/docs/content/props-definition.tsx +22 -5
- package/docs/content/usage.tsx +4 -4
- package/glyph/archive/16.d.ts +1 -1
- package/glyph/archive/16.js +14 -14
- package/glyph/archive/24.d.ts +1 -1
- package/glyph/archive/24.js +14 -14
- package/glyph/archive/48.d.ts +1 -1
- package/glyph/archive/48.js +15 -15
- package/glyph/audio/16.d.ts +1 -1
- package/glyph/audio/16.js +14 -14
- package/glyph/audio/24.d.ts +1 -1
- package/glyph/audio/24.js +14 -14
- package/glyph/audio/48.d.ts +1 -1
- package/glyph/audio/48.js +15 -15
- package/glyph/document/16.d.ts +1 -1
- package/glyph/document/16.js +14 -14
- package/glyph/document/24.d.ts +1 -1
- package/glyph/document/24.js +14 -14
- package/glyph/document/48.d.ts +1 -1
- package/glyph/document/48.js +15 -15
- package/glyph/excel-spreadsheet/16.d.ts +1 -1
- package/glyph/excel-spreadsheet/16.js +14 -14
- package/glyph/excel-spreadsheet/24.d.ts +1 -1
- package/glyph/excel-spreadsheet/24.js +14 -14
- package/glyph/excel-spreadsheet/48.d.ts +1 -1
- package/glyph/excel-spreadsheet/48.js +15 -15
- package/glyph/executable/16.d.ts +1 -1
- package/glyph/executable/16.js +14 -14
- package/glyph/executable/24.d.ts +1 -1
- package/glyph/executable/24.js +14 -14
- package/glyph/executable/48.d.ts +1 -1
- package/glyph/executable/48.js +15 -15
- package/glyph/figma/16.d.ts +1 -1
- package/glyph/figma/16.js +14 -14
- package/glyph/figma/24.d.ts +1 -1
- package/glyph/figma/24.js +14 -14
- package/glyph/figma/48.d.ts +1 -1
- package/glyph/figma/48.js +15 -15
- package/glyph/folder/16.d.ts +1 -1
- package/glyph/folder/16.js +14 -14
- package/glyph/folder/24.d.ts +1 -1
- package/glyph/folder/24.js +14 -14
- package/glyph/folder/48.d.ts +1 -1
- package/glyph/folder/48.js +15 -15
- package/glyph/generic/16.d.ts +1 -1
- package/glyph/generic/16.js +14 -14
- package/glyph/generic/24.d.ts +1 -1
- package/glyph/generic/24.js +14 -14
- package/glyph/generic/48.d.ts +1 -1
- package/glyph/generic/48.js +15 -15
- package/glyph/gif/16.d.ts +1 -1
- package/glyph/gif/16.js +14 -14
- package/glyph/gif/24.d.ts +1 -1
- package/glyph/gif/24.js +14 -14
- package/glyph/gif/48.d.ts +1 -1
- package/glyph/gif/48.js +15 -15
- package/glyph/google-doc/16.d.ts +1 -1
- package/glyph/google-doc/16.js +14 -14
- package/glyph/google-doc/24.d.ts +1 -1
- package/glyph/google-doc/24.js +14 -14
- package/glyph/google-doc/48.d.ts +1 -1
- package/glyph/google-doc/48.js +15 -15
- package/glyph/google-form/16.d.ts +1 -1
- package/glyph/google-form/16.js +14 -14
- package/glyph/google-form/24.d.ts +1 -1
- package/glyph/google-form/24.js +14 -14
- package/glyph/google-form/48.d.ts +1 -1
- package/glyph/google-form/48.js +15 -15
- package/glyph/google-sheet/16.d.ts +1 -1
- package/glyph/google-sheet/16.js +14 -14
- package/glyph/google-sheet/24.d.ts +1 -1
- package/glyph/google-sheet/24.js +14 -14
- package/glyph/google-sheet/48.d.ts +1 -1
- package/glyph/google-sheet/48.js +15 -15
- package/glyph/google-slide/16.d.ts +1 -1
- package/glyph/google-slide/16.js +14 -14
- package/glyph/google-slide/24.d.ts +1 -1
- package/glyph/google-slide/24.js +14 -14
- package/glyph/google-slide/48.d.ts +1 -1
- package/glyph/google-slide/48.js +15 -15
- package/glyph/image/16.d.ts +1 -1
- package/glyph/image/16.js +14 -14
- package/glyph/image/24.d.ts +1 -1
- package/glyph/image/24.js +14 -14
- package/glyph/image/48.d.ts +1 -1
- package/glyph/image/48.js +15 -15
- package/glyph/pdf-document/16.d.ts +1 -1
- package/glyph/pdf-document/16.js +14 -14
- package/glyph/pdf-document/24.d.ts +1 -1
- package/glyph/pdf-document/24.js +14 -14
- package/glyph/pdf-document/48.d.ts +1 -1
- package/glyph/pdf-document/48.js +15 -15
- package/glyph/powerpoint-presentation/16.d.ts +1 -1
- package/glyph/powerpoint-presentation/16.js +14 -14
- package/glyph/powerpoint-presentation/24.d.ts +1 -1
- package/glyph/powerpoint-presentation/24.js +14 -14
- package/glyph/powerpoint-presentation/48.d.ts +1 -1
- package/glyph/powerpoint-presentation/48.js +15 -15
- package/glyph/presentation/16.d.ts +1 -1
- package/glyph/presentation/16.js +14 -14
- package/glyph/presentation/24.d.ts +1 -1
- package/glyph/presentation/24.js +14 -14
- package/glyph/presentation/48.d.ts +1 -1
- package/glyph/presentation/48.js +15 -15
- package/glyph/sketch/16.d.ts +1 -1
- package/glyph/sketch/16.js +14 -14
- package/glyph/sketch/24.d.ts +1 -1
- package/glyph/sketch/24.js +14 -14
- package/glyph/sketch/48.d.ts +1 -1
- package/glyph/sketch/48.js +15 -15
- package/glyph/source-code/16.d.ts +1 -1
- package/glyph/source-code/16.js +14 -14
- package/glyph/source-code/24.d.ts +1 -1
- package/glyph/source-code/24.js +14 -14
- package/glyph/source-code/48.d.ts +1 -1
- package/glyph/source-code/48.js +15 -15
- package/glyph/spreadsheet/16.d.ts +1 -1
- package/glyph/spreadsheet/16.js +14 -14
- package/glyph/spreadsheet/24.d.ts +1 -1
- package/glyph/spreadsheet/24.js +14 -14
- package/glyph/spreadsheet/48.d.ts +1 -1
- package/glyph/spreadsheet/48.js +15 -15
- package/glyph/video/16.d.ts +1 -1
- package/glyph/video/16.js +14 -14
- package/glyph/video/24.d.ts +1 -1
- package/glyph/video/24.js +14 -14
- package/glyph/video/48.d.ts +1 -1
- package/glyph/video/48.js +15 -15
- package/glyph/word-document/16.d.ts +1 -1
- package/glyph/word-document/16.js +14 -14
- package/glyph/word-document/24.d.ts +1 -1
- package/glyph/word-document/24.js +14 -14
- package/glyph/word-document/48.d.ts +1 -1
- package/glyph/word-document/48.js +15 -15
- package/metadata/package.json +1 -1
- package/package.json +73 -74
- package/report.api.md +3 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__icon-file-type/app",
|
|
7
|
+
"composite": true,
|
|
8
|
+
"rootDir": "../"
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*"
|
|
18
|
+
],
|
|
19
|
+
"references": [
|
|
20
|
+
{
|
|
21
|
+
"path": "../../../design-system/icon/afm-jira/tsconfig.json"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.post-office.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__icon-file-type/app",
|
|
7
|
+
"composite": true,
|
|
8
|
+
"rootDir": "../"
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*"
|
|
18
|
+
],
|
|
19
|
+
"references": [
|
|
20
|
+
{
|
|
21
|
+
"path": "../../../design-system/icon/afm-post-office/tsconfig.json"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -1,118 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {
|
|
2
|
+
type default as core,
|
|
3
|
+
type API,
|
|
4
|
+
type FileInfo,
|
|
5
|
+
type ImportSpecifier,
|
|
6
|
+
type ASTPath,
|
|
7
|
+
type ImportDefaultSpecifier,
|
|
8
|
+
type Options,
|
|
8
9
|
} from 'jscodeshift';
|
|
9
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
10
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
10
11
|
|
|
11
12
|
export const packageName = '@atlaskit/icon-file-type';
|
|
12
13
|
|
|
13
|
-
export default function transformer(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
p.replace();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return root.toSource(options.printOptions || { quote: 'single' });
|
|
50
|
-
}
|
|
51
|
-
return file.source;
|
|
14
|
+
export default function transformer(file: FileInfo, api: API, options: Options) {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source, { quote: 'auto' });
|
|
17
|
+
if (hasImportDeclaration(j, root, packageName)) {
|
|
18
|
+
const imports = root.find(j.ImportSpecifier, {
|
|
19
|
+
imported: { name: 'metadata' },
|
|
20
|
+
});
|
|
21
|
+
imports.forEach((p: ASTPath<ImportSpecifier | ImportDefaultSpecifier>) => {
|
|
22
|
+
if (p.parentPath.parentPath.node.source.value !== packageName) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (p.parentPath.node.specifiers.length === 1) {
|
|
26
|
+
p.node.type = 'ImportDefaultSpecifier';
|
|
27
|
+
p.parentPath.node.source.value = `${packageName}/metadata`;
|
|
28
|
+
} else if (p.node.local) {
|
|
29
|
+
tryCreateImport({
|
|
30
|
+
j,
|
|
31
|
+
base: root,
|
|
32
|
+
packageName: `${packageName}/metadata`,
|
|
33
|
+
relativeToPackage: packageName,
|
|
34
|
+
});
|
|
35
|
+
addToImport({
|
|
36
|
+
j,
|
|
37
|
+
base: root,
|
|
38
|
+
packageName: `${packageName}/metadata`,
|
|
39
|
+
importSpecifier: j.importDefaultSpecifier(j.identifier(p.node.local.name)),
|
|
40
|
+
});
|
|
41
|
+
p.replace();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return root.toSource(options.printOptions || { quote: 'single' });
|
|
45
|
+
}
|
|
46
|
+
return file.source;
|
|
52
47
|
}
|
|
53
48
|
|
|
54
49
|
function hasImportDeclaration(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
j: core.JSCodeshift,
|
|
51
|
+
source: ReturnType<typeof j>,
|
|
52
|
+
importPath: string,
|
|
58
53
|
) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.filter((path) => path.node.source.value === importPath).length;
|
|
54
|
+
return !!source.find(j.ImportDeclaration).filter((path) => path.node.source.value === importPath)
|
|
55
|
+
.length;
|
|
62
56
|
}
|
|
63
57
|
|
|
64
58
|
function tryCreateImport({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
j,
|
|
60
|
+
base,
|
|
61
|
+
relativeToPackage,
|
|
62
|
+
packageName,
|
|
69
63
|
}: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
j: core.JSCodeshift;
|
|
65
|
+
base: Collection<any>;
|
|
66
|
+
relativeToPackage: string;
|
|
67
|
+
packageName: string;
|
|
74
68
|
}) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.filter((path) => path.value.source.value === packageName).length > 0;
|
|
69
|
+
const exists: boolean =
|
|
70
|
+
base.find(j.ImportDeclaration).filter((path) => path.value.source.value === packageName)
|
|
71
|
+
.length > 0;
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
if (exists) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
base
|
|
78
|
+
.find(j.ImportDeclaration)
|
|
79
|
+
.filter((path) => path.value.source.value === relativeToPackage)
|
|
80
|
+
.insertBefore(j.importDeclaration([], j.literal(packageName)));
|
|
88
81
|
}
|
|
89
82
|
|
|
90
83
|
function addToImport({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
j,
|
|
85
|
+
base,
|
|
86
|
+
importSpecifier,
|
|
87
|
+
packageName,
|
|
95
88
|
}: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
89
|
+
j: core.JSCodeshift;
|
|
90
|
+
base: Collection<any>;
|
|
91
|
+
importSpecifier: ImportSpecifier | ImportDefaultSpecifier;
|
|
92
|
+
packageName: string;
|
|
100
93
|
}) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
94
|
+
base
|
|
95
|
+
.find(j.ImportDeclaration)
|
|
96
|
+
.filter((path) => path.value.source.value === packageName)
|
|
97
|
+
.replaceWith((declaration) => {
|
|
98
|
+
return j.importDeclaration(
|
|
99
|
+
[
|
|
100
|
+
// we are appending to the existing specifiers
|
|
101
|
+
// We are doing a filter hear because sometimes specifiers can be removed
|
|
102
|
+
// but they hand around in the declaration
|
|
103
|
+
...(declaration.value.specifiers || []).filter(
|
|
104
|
+
(item) => item.type === 'ImportSpecifier' && item.imported != null,
|
|
105
|
+
),
|
|
106
|
+
importSpecifier,
|
|
107
|
+
],
|
|
108
|
+
j.literal(packageName),
|
|
109
|
+
);
|
|
110
|
+
});
|
|
118
111
|
}
|
|
@@ -5,124 +5,124 @@ import transformer, { packageName } from '../6.1.0-metadata-entry';
|
|
|
5
5
|
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
|
|
6
6
|
|
|
7
7
|
describe('Update imports', () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
defineInlineTest(
|
|
9
|
+
{ default: transformer, parser: 'tsx' },
|
|
10
|
+
{},
|
|
11
|
+
`
|
|
12
12
|
import { metadata } from '${packageName}';
|
|
13
13
|
console.log(metadata);
|
|
14
14
|
`,
|
|
15
|
-
|
|
15
|
+
`
|
|
16
16
|
import metadata from '${packageName}/metadata';
|
|
17
17
|
console.log(metadata);
|
|
18
18
|
`,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
'should replace named metadata import from main entry point with default import from dedicated entry point',
|
|
20
|
+
);
|
|
21
|
+
defineInlineTest(
|
|
22
|
+
{ default: transformer, parser: 'tsx' },
|
|
23
|
+
{},
|
|
24
|
+
`
|
|
25
25
|
import { metadata as data } from '${packageName}';
|
|
26
26
|
console.log(data);
|
|
27
27
|
`,
|
|
28
|
-
|
|
28
|
+
`
|
|
29
29
|
import data from '${packageName}/metadata';
|
|
30
30
|
console.log(data);
|
|
31
31
|
`,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
'should preserve renaming when converting from named import to default import',
|
|
33
|
+
);
|
|
34
|
+
defineInlineTest(
|
|
35
|
+
{ default: transformer, parser: 'tsx' },
|
|
36
|
+
{},
|
|
37
|
+
`
|
|
38
38
|
import { a, metadata, b } from '${packageName}';
|
|
39
39
|
console.log(metadata);
|
|
40
40
|
`,
|
|
41
|
-
|
|
41
|
+
`
|
|
42
42
|
import metadata from '${packageName}/metadata';
|
|
43
43
|
import { a, b } from '${packageName}';
|
|
44
44
|
console.log(metadata);
|
|
45
45
|
`,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
'should preserve other named imports',
|
|
47
|
+
);
|
|
48
|
+
defineInlineTest(
|
|
49
|
+
{ default: transformer, parser: 'tsx' },
|
|
50
|
+
{},
|
|
51
|
+
`
|
|
52
52
|
import { a, metadata as data, b } from '${packageName}';
|
|
53
53
|
console.log(data);
|
|
54
54
|
`,
|
|
55
|
-
|
|
55
|
+
`
|
|
56
56
|
import data from '${packageName}/metadata';
|
|
57
57
|
import { a, b } from '${packageName}';
|
|
58
58
|
console.log(data);
|
|
59
59
|
`,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
'should preserve other named imports, as well as metadata renaming',
|
|
61
|
+
);
|
|
62
|
+
defineInlineTest(
|
|
63
|
+
{ default: transformer, parser: 'tsx' },
|
|
64
|
+
{},
|
|
65
|
+
`
|
|
66
66
|
import Icon, { a, metadata as data, b } from '${packageName}';
|
|
67
67
|
console.log(a, data, b);
|
|
68
68
|
`,
|
|
69
|
-
|
|
69
|
+
`
|
|
70
70
|
import data from '${packageName}/metadata';
|
|
71
71
|
import Icon, { a, b } from '${packageName}';
|
|
72
72
|
console.log(a, data, b);
|
|
73
73
|
`,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
'should preserve other named imports and default import, as well as metadata renaming',
|
|
75
|
+
);
|
|
76
|
+
defineInlineTest(
|
|
77
|
+
{ default: transformer, parser: 'tsx' },
|
|
78
|
+
{},
|
|
79
|
+
`
|
|
80
80
|
import metadata from '${packageName}/metadata';
|
|
81
81
|
console.log(metadata);
|
|
82
82
|
`,
|
|
83
|
-
|
|
83
|
+
`
|
|
84
84
|
import metadata from '${packageName}/metadata';
|
|
85
85
|
console.log(metadata);
|
|
86
86
|
`,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
'should not affect existing good imports',
|
|
88
|
+
);
|
|
89
|
+
defineInlineTest(
|
|
90
|
+
{ default: transformer, parser: 'tsx' },
|
|
91
|
+
{},
|
|
92
|
+
`
|
|
93
93
|
import { metadata } from 'not-${packageName}';
|
|
94
94
|
`,
|
|
95
|
-
|
|
95
|
+
`
|
|
96
96
|
import { metadata } from 'not-${packageName}';
|
|
97
97
|
`,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
'should not affect other packages',
|
|
99
|
+
);
|
|
100
|
+
defineInlineTest(
|
|
101
|
+
{ default: transformer, parser: 'tsx' },
|
|
102
|
+
{},
|
|
103
|
+
`
|
|
104
104
|
import { metadata } from '${packageName}/foo';
|
|
105
105
|
`,
|
|
106
|
-
|
|
106
|
+
`
|
|
107
107
|
import { metadata } from '${packageName}/foo';
|
|
108
108
|
`,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
'should not affect other entrypoints',
|
|
110
|
+
);
|
|
111
|
+
defineInlineTest(
|
|
112
|
+
{ default: transformer, parser: 'tsx' },
|
|
113
|
+
{},
|
|
114
|
+
`
|
|
115
115
|
import { metadata } from '@atlaskit/icon';
|
|
116
116
|
import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
|
|
117
117
|
import { metadata as fileTypeIconMetadata } from '@atlaskit/icon-file-type';
|
|
118
118
|
import { metadata as priorityIconMetadata } from '@atlaskit/icon-priority';
|
|
119
119
|
`,
|
|
120
|
-
|
|
120
|
+
`
|
|
121
121
|
import { metadata } from '@atlaskit/icon';
|
|
122
122
|
import { metadata as objectIconMetadata } from '@atlaskit/icon-object';
|
|
123
123
|
import fileTypeIconMetadata from '@atlaskit/icon-file-type/metadata';
|
|
124
124
|
import { metadata as priorityIconMetadata } from '@atlaskit/icon-priority';
|
|
125
125
|
`,
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
'should work as expected on a real-world case',
|
|
127
|
+
);
|
|
128
128
|
});
|
package/docs/0-intro.tsx
CHANGED
|
@@ -9,11 +9,11 @@ export default md`
|
|
|
9
9
|
This package provides the collections of icons for the different types of content used across Atlassian products.
|
|
10
10
|
|
|
11
11
|
${(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
<DocsContentTabs
|
|
13
|
+
tabs={[
|
|
14
|
+
{ name: 'Usage', content: UsageTab },
|
|
15
|
+
{ name: 'Props Definition', content: PropsDefinitionTab },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
)}
|
|
19
19
|
`;
|
|
@@ -2,10 +2,27 @@ import React from 'react';
|
|
|
2
2
|
import { md, PropsTable } from '@atlaskit/docs';
|
|
3
3
|
|
|
4
4
|
export default md`
|
|
5
|
+
# Props
|
|
6
|
+
|
|
7
|
+
This package utilizes the \`@atlaskit/icon\` component and accepts the following props:
|
|
8
|
+
|
|
5
9
|
${(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
<PropsTable
|
|
11
|
+
details={[
|
|
12
|
+
{
|
|
13
|
+
name: 'label',
|
|
14
|
+
type: 'string',
|
|
15
|
+
description:
|
|
16
|
+
'Text used to describe what the icon is in context. A label is needed when there is no pairing visible text next to the icon. An empty string marks the icon as presentation only.',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'testId',
|
|
20
|
+
type: 'string',
|
|
21
|
+
description:
|
|
22
|
+
'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.',
|
|
23
|
+
},
|
|
24
|
+
]}
|
|
25
|
+
/>
|
|
26
|
+
)}
|
|
27
|
+
|
|
11
28
|
`;
|
package/docs/content/usage.tsx
CHANGED
package/glyph/archive/16.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { PureComponent } from 'react';
|
|
|
2
2
|
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
3
3
|
|
|
4
4
|
export default class extends PureComponent<
|
|
5
|
-
|
|
5
|
+
Omit<GlyphProps, 'primaryColor' | 'secondaryColor' | 'size'>
|
|
6
6
|
> {}
|
package/glyph/archive/16.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
@@ -10,22 +10,22 @@ var _react = _interopRequireDefault(require('react'));
|
|
|
10
10
|
var _base = require('@atlaskit/icon/base');
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) {
|
|
13
|
-
|
|
13
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const Archive16Icon = (props) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
18
|
+
_base.Icon,
|
|
19
|
+
Object.assign(
|
|
20
|
+
{
|
|
21
|
+
dangerouslySetGlyph: `<svg width="16" height="16" viewBox="0 0 16 16" role="presentation"><path fill="#758195" fill-rule="evenodd" d="M2 0h12a2 2 0 012 2v12a2 2 0 01-2 2H2a2 2 0 01-2-2V2a2 2 0 012-2zm4 3v2h2V3H6zm2 2v2h2V5H8zM6 7v2h2V7H6zm2 2v2h2V9H8zm-2.307 2v2h2v-2h-2z"/></svg>`,
|
|
22
|
+
},
|
|
23
|
+
props,
|
|
24
|
+
{
|
|
25
|
+
size: 'small',
|
|
26
|
+
},
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
29
|
|
|
30
30
|
Archive16Icon.displayName = 'Archive16Icon';
|
|
31
31
|
var _default = Archive16Icon;
|
package/glyph/archive/24.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { PureComponent } from 'react';
|
|
|
2
2
|
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
3
3
|
|
|
4
4
|
export default class extends PureComponent<
|
|
5
|
-
|
|
5
|
+
Omit<GlyphProps, 'primaryColor' | 'secondaryColor' | 'size'>
|
|
6
6
|
> {}
|
package/glyph/archive/24.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
@@ -10,22 +10,22 @@ var _react = _interopRequireDefault(require('react'));
|
|
|
10
10
|
var _base = require('@atlaskit/icon/base');
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) {
|
|
13
|
-
|
|
13
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const Archive24Icon = (props) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
18
|
+
_base.Icon,
|
|
19
|
+
Object.assign(
|
|
20
|
+
{
|
|
21
|
+
dangerouslySetGlyph: `<svg width="24" height="24" viewBox="0 0 24 24" role="presentation"><path fill="#758195" fill-rule="evenodd" d="M3 0h18a3 3 0 013 3v18a3 3 0 01-3 3H3a3 3 0 01-3-3V3a3 3 0 013-3zm6 3v3h3V3H9zm3 3v3h3V6h-3zM9 9v3h3V9H9zm3 3v3h3v-3h-3zm-3 3v3h3v-3H9zm3 3v3h3v-3h-3z"/></svg>`,
|
|
22
|
+
},
|
|
23
|
+
props,
|
|
24
|
+
{
|
|
25
|
+
size: 'medium',
|
|
26
|
+
},
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
29
|
|
|
30
30
|
Archive24Icon.displayName = 'Archive24Icon';
|
|
31
31
|
var _default = Archive24Icon;
|
package/glyph/archive/48.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { PureComponent } from 'react';
|
|
|
2
2
|
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
3
3
|
|
|
4
4
|
export default class extends PureComponent<
|
|
5
|
-
|
|
5
|
+
Omit<GlyphProps, 'primaryColor' | 'secondaryColor' | 'size'>
|
|
6
6
|
> {}
|