@croquiscom/pds 8.0.0 → 8.2.0-next.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.
@@ -0,0 +1,79 @@
1
+ export declare const en: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
@@ -0,0 +1,79 @@
1
+ export declare const en: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
@@ -0,0 +1,79 @@
1
+ export declare const ja: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
@@ -0,0 +1,79 @@
1
+ export declare const ja: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
@@ -0,0 +1,79 @@
1
+ export declare const ko: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
@@ -0,0 +1,79 @@
1
+ export declare const ko: {
2
+ lang: string;
3
+ accessibility: {
4
+ info: string;
5
+ success: string;
6
+ warning: string;
7
+ error: string;
8
+ close: string;
9
+ page: string;
10
+ prev: string;
11
+ next: string;
12
+ back: string;
13
+ };
14
+ ConfirmModal: {
15
+ title: string;
16
+ confirmText: string;
17
+ cancelText: string;
18
+ };
19
+ AlertModal: {
20
+ title: string;
21
+ confirmText: string;
22
+ };
23
+ NoticeModal: {
24
+ closeText: string;
25
+ checkReplayText: string;
26
+ };
27
+ Dropdown: {
28
+ placeholder: string;
29
+ };
30
+ DatePicker: {
31
+ placeholder: string;
32
+ footer: {
33
+ now: string;
34
+ today: string;
35
+ ok: string;
36
+ clear: string;
37
+ };
38
+ };
39
+ DatePickerRange: {
40
+ placeholder: string[];
41
+ dataPreset: {
42
+ today: string;
43
+ '1-week': string;
44
+ '1-month': string;
45
+ '3-month': string;
46
+ '6-month': string;
47
+ '1-year': string;
48
+ all: string;
49
+ };
50
+ };
51
+ TimePicker: {
52
+ placeholder: string;
53
+ footer: {
54
+ ok: string;
55
+ clear: string;
56
+ };
57
+ };
58
+ TimeRangePicker: {
59
+ placeholder: string[];
60
+ };
61
+ FileUpload: {
62
+ label: string;
63
+ };
64
+ Table: {
65
+ noDataText: string;
66
+ };
67
+ ColumnViewController: {
68
+ noFixedItemsText: string;
69
+ fixedSectionTitle: string;
70
+ listSectionTitle: string;
71
+ max: string;
72
+ items: string;
73
+ };
74
+ CategorySelector: {
75
+ levelCategory: string;
76
+ selectParentCategoryLine1: string;
77
+ selectParentCategoryLine2: string;
78
+ };
79
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croquiscom/pds",
3
- "version": "8.0.0",
3
+ "version": "8.2.0-next.1",
4
4
  "description": "Design system for Zigzag's Partner Center",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.es.js",
@@ -76,7 +76,7 @@
76
76
  "typescript": "^4.3.5"
77
77
  },
78
78
  "dependencies": {
79
- "@floating-ui/react": "^0.18.0",
79
+ "@floating-ui/react": "^0.26.6",
80
80
  "@react-aria/focus": "^3.9.0",
81
81
  "@react-aria/utils": "^3.14.0",
82
82
  "chroma-js": "^2.4.2",
@@ -14,8 +14,10 @@ import { API, FileInfo } from 'jscodeshift';
14
14
 
15
15
  const migrations = {
16
16
  Table: 'DataTable',
17
+ TableProps: 'DataTableProps',
17
18
  TableColumnBase: 'DataTableColumnBase',
18
19
  TableColumnType: 'DataTableColumnType',
20
+ TableColumnsType: 'DataTableColumnsType',
19
21
  TableColumnGroupType: 'DataTableColumnGroupType',
20
22
  TableRowType: 'DataTableRowType',
21
23
  TableRowsType: 'DataTableRowsType',
@@ -24,11 +26,15 @@ const migrations = {
24
26
  };
25
27
 
26
28
  const original_name_list = Object.keys(migrations);
29
+ const migration_entries = Object.entries(migrations);
27
30
 
28
31
  export default function transformer(file: FileInfo, api: API) {
29
32
  const j = api.jscodeshift;
30
33
  const source = j(file.source);
31
34
 
35
+ let is_used_comp = false;
36
+ let is_used_props = false;
37
+
32
38
  if (!hasImportDeclaration(j, source, '@croquiscom/pds')) {
33
39
  return;
34
40
  }
@@ -38,16 +44,64 @@ export default function transformer(file: FileInfo, api: API) {
38
44
  .filter((path) => original_name_list.includes(path.node.imported.name))
39
45
  .forEach((path) => {
40
46
  const new_name = migrations[path.node.imported.name];
41
- if (new_name) {
42
- j(path).replaceWith(j.importSpecifier(j.identifier(new_name)));
47
+ if (!new_name) return;
48
+
49
+ if (new_name === 'DataTable') {
50
+ if (source.find(j.Identifier, { name: 'DataTable' }).length) {
51
+ j(path).replaceWith(j.importSpecifier(j.identifier(new_name), j.identifier('PdsDataTable')));
52
+ is_used_comp = true;
53
+ return;
54
+ }
55
+ }
56
+ if (new_name === 'DataTableProps') {
57
+ if (source.find(j.Identifier, { name: 'DataTableProps' }).length) {
58
+ j(path).replaceWith(j.importSpecifier(j.identifier(new_name), j.identifier('PdsDataTableProps')));
59
+ is_used_props = true;
60
+ return;
61
+ }
43
62
  }
63
+
64
+ j(path).replaceWith(j.importSpecifier(j.identifier(new_name)));
44
65
  });
45
66
 
46
- if (hasImportSpecifier(j, source, 'DataTable', '@croquiscom/pds')) {
47
- source.find(j.JSXIdentifier, { name: 'Table' }).forEach((path) => {
48
- j(path).replaceWith(j.jsxIdentifier('DataTable'));
67
+ migration_entries
68
+ .filter(([_origin, new_name]) => hasImportSpecifier(j, source, new_name, '@croquiscom/pds'))
69
+ .forEach(([original_name, new_name]) => {
70
+ if (new_name === 'DataTable') {
71
+ source.find(j.JSXIdentifier, { name: original_name }).forEach((path) => {
72
+ j(path).replaceWith(j.jsxIdentifier(is_used_comp ? 'PdsDataTable' : new_name));
73
+ });
74
+ return;
75
+ }
76
+
77
+ source.find(j.Identifier, { name: original_name }).forEach((path) => {
78
+ if (new_name === 'DataTableProps' && is_used_props) {
79
+ j(path).replaceWith('PdsDataTableProps');
80
+ } else {
81
+ j(path).replaceWith(new_name);
82
+ }
83
+ });
84
+
85
+ source
86
+ .find(j.CallExpression, { typeParameters: { type: 'TSTypeParameterInstantiation' } } as any)
87
+ .forEach((path) => {
88
+ const index = (path.node as any).typeParameters.params.findIndex((param) => {
89
+ return j(param).find(j.Identifier, { name: original_name }).length;
90
+ });
91
+
92
+ if (index === -1) return;
93
+
94
+ j((path.node as any).typeParameters.params[index])
95
+ .find(j.Identifier, { name: original_name })
96
+ .forEach((path) => {
97
+ if (new_name === 'DataTableProps' && is_used_props) {
98
+ j(path).replaceWith('PdsDataTableProps');
99
+ } else {
100
+ j(path).replaceWith(j.identifier(new_name));
101
+ }
102
+ });
103
+ });
49
104
  });
50
- }
51
105
 
52
106
  return source.toSource({ quote: 'single' });
53
107
  }