@wishket/design-system 3.4.2 → 3.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/dist/Components/Base/Typography/Typography.d.ts +0 -9
- package/dist/Components/Base/Typography/Typography.js +2 -2
- package/dist/Components/DataDisplays/ImageLabel/ImageLabel.js +1 -1
- package/dist/Components/Feedbacks/DialogBox/DialogBox.js +6 -6
- package/dist/Components/Feedbacks/GlobalLoadingIndicator/GlobalLoadingIndicator.js +1 -1
- package/dist/Components/Feedbacks/Tooltip/Tooltip.js +3 -3
- package/dist/Components/Inputs/AutoCompleteList/AutoCompleteList.d.ts +2 -2
- package/dist/Components/Inputs/AutoCompleteList/AutoCompleteList.js +22 -7
- package/dist/Components/Inputs/AutoCompleteList/AutoCompleteList.types.d.ts +17 -0
- package/dist/Components/Inputs/Autocomplete/Autocomplete.d.ts +3 -1
- package/dist/Components/Inputs/Autocomplete/Autocomplete.js +28 -5
- package/dist/Components/Inputs/Autocomplete/Autocomplete.types.d.ts +18 -0
- package/dist/Components/Inputs/Checkbox/Checkbox.js +4 -4
- package/dist/Components/Inputs/Checkbox/Checkbox.parts.js +3 -3
- package/dist/Components/Inputs/Checkbox/Checkbox.types.d.ts +0 -1
- package/dist/Components/Inputs/CheckboxCard/CheckboxCard.js +4 -4
- package/dist/Components/Inputs/CheckboxCard/CheckboxCard.parts.js +4 -4
- package/dist/Components/Inputs/FileUploader/FileUploader.js +4 -4
- package/dist/Components/Inputs/IconButtonDropdown/IconButtonDropdown.js +4 -4
- package/dist/Components/Inputs/Input/Input.js +1 -1
- package/dist/Components/Inputs/Input/PasswordInput.js +3 -3
- package/dist/Components/Inputs/InputChip/InputChip.d.ts +16 -3
- package/dist/Components/Inputs/InputChip/InputChip.js +13 -4
- package/dist/Components/Inputs/Radio/Radio.js +5 -5
- package/dist/Components/Inputs/RadioCard/RadioCard.js +5 -5
- package/dist/Components/Inputs/RadioCard/RadioCard.parts.js +4 -4
- package/dist/Components/Inputs/RangeSlider/RangeSlider.js +2 -2
- package/dist/Components/Inputs/SearchField/SearchField.js +5 -5
- package/dist/Components/Inputs/TextField/TextField.js +1 -1
- package/dist/Components/Inputs/TextFieldDropdown/TextFieldDropdown.d.ts +24 -3
- package/dist/Components/Inputs/TextFieldDropdown/TextFieldDropdown.js +10 -54
- package/dist/Components/Inputs/TextFieldDropdown/TextFieldDropdown.parts.d.ts +9 -0
- package/dist/Components/Inputs/TextFieldDropdown/TextFieldDropdown.parts.js +1 -1
- package/dist/Components/Inputs/TextFieldTrigger/TextFieldTrigger.d.ts +73 -0
- package/dist/Components/Inputs/TextFieldTrigger/TextFieldTrigger.js +62 -0
- package/dist/Components/Inputs/TextFieldTrigger/index.d.ts +2 -0
- package/dist/Components/Inputs/Textarea/Textarea.js +4 -4
- package/dist/Components/Inputs/index.d.ts +1 -0
- package/dist/Components/Navigations/Drawer/Drawer.js +3 -3
- package/dist/Components/Navigations/Menu/MenuBase.js +3 -3
- package/dist/Components/Utils/BackDrop/BackDrop.js +1 -1
- package/dist/Components/Utils/BackDropLiftContainer/BackDropLiftContainer.js +2 -2
- package/dist/Components/Utils/BottomModalContainer/BottomModalContainer.js +1 -1
- package/dist/Components/Utils/FullModalContainer/FullModalContainer.js +1 -1
- package/dist/Components/Utils/Modal/Modal.js +3 -3
- package/dist/Components/Utils/ModalContainer/ModalContainer.js +2 -2
- package/dist/Components/Wrappers/WithBadge/WithBadge.js +2 -2
- package/dist/Components/Wrappers/WithSnackBar/WithSnackBar.js +3 -3
- package/dist/cjs/Components/Base/Typography/Typography.js +1 -1
- package/dist/cjs/Components/DataDisplays/ImageLabel/ImageLabel.js +3 -3
- package/dist/cjs/Components/Feedbacks/DialogBox/DialogBox.js +6 -6
- package/dist/cjs/Components/Feedbacks/GlobalLoadingIndicator/GlobalLoadingIndicator.js +1 -1
- package/dist/cjs/Components/Feedbacks/Tooltip/Tooltip.js +3 -3
- package/dist/cjs/Components/Inputs/AutoCompleteList/AutoCompleteList.js +22 -7
- package/dist/cjs/Components/Inputs/Autocomplete/Autocomplete.js +25 -4
- package/dist/cjs/Components/Inputs/Checkbox/Checkbox.js +4 -4
- package/dist/cjs/Components/Inputs/Checkbox/Checkbox.parts.js +5 -5
- package/dist/cjs/Components/Inputs/CheckboxCard/CheckboxCard.js +4 -4
- package/dist/cjs/Components/Inputs/CheckboxCard/CheckboxCard.parts.js +4 -4
- package/dist/cjs/Components/Inputs/FileUploader/FileUploader.js +6 -6
- package/dist/cjs/Components/Inputs/IconButtonDropdown/IconButtonDropdown.js +3 -3
- package/dist/cjs/Components/Inputs/Input/Input.js +2 -2
- package/dist/cjs/Components/Inputs/Input/PasswordInput.js +2 -2
- package/dist/cjs/Components/Inputs/InputChip/InputChip.js +36 -2
- package/dist/cjs/Components/Inputs/Radio/Radio.js +6 -6
- package/dist/cjs/Components/Inputs/RadioCard/RadioCard.js +4 -4
- package/dist/cjs/Components/Inputs/RadioCard/RadioCard.parts.js +4 -4
- package/dist/cjs/Components/Inputs/RangeSlider/RangeSlider.js +3 -3
- package/dist/cjs/Components/Inputs/SearchField/SearchField.js +3 -3
- package/dist/cjs/Components/Inputs/TextField/TextField.js +2 -2
- package/dist/cjs/Components/Inputs/TextFieldDropdown/TextFieldDropdown.js +10 -8
- package/dist/cjs/Components/Inputs/TextFieldDropdown/TextFieldDropdown.parts.js +1 -1
- package/dist/cjs/Components/Inputs/TextFieldTrigger/TextFieldTrigger.js +62 -0
- package/dist/cjs/Components/Inputs/Textarea/Textarea.js +5 -5
- package/dist/cjs/Components/Navigations/Drawer/Drawer.js +3 -3
- package/dist/cjs/Components/Navigations/Menu/MenuBase.js +3 -3
- package/dist/cjs/Components/Utils/BackDrop/BackDrop.js +1 -1
- package/dist/cjs/Components/Utils/BackDropLiftContainer/BackDropLiftContainer.js +2 -2
- package/dist/cjs/Components/Utils/BottomModalContainer/BottomModalContainer.js +1 -1
- package/dist/cjs/Components/Utils/FullModalContainer/FullModalContainer.js +1 -1
- package/dist/cjs/Components/Utils/Modal/Modal.js +2 -2
- package/dist/cjs/Components/Utils/ModalContainer/ModalContainer.js +2 -2
- package/dist/cjs/Components/Wrappers/WithBadge/WithBadge.js +1 -1
- package/dist/cjs/Components/Wrappers/WithSnackBar/WithSnackBar.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
- package/scripts/codemods/add-as-link.ts +9 -5
- package/scripts/codemods/menu-split.ts +25 -11
|
@@ -86,25 +86,29 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
86
86
|
return root.toSource({ quote: 'single' });
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
const getJSXName = (node: JSXOpeningElement): string | null => {
|
|
90
90
|
const { name } = node;
|
|
91
91
|
if (name.type === 'JSXIdentifier') return name.name;
|
|
92
92
|
if (name.type === 'JSXMemberExpression') {
|
|
93
93
|
return memberExpressionToString(name);
|
|
94
94
|
}
|
|
95
|
+
|
|
95
96
|
return null;
|
|
96
|
-
}
|
|
97
|
+
};
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
const memberExpressionToString = (
|
|
99
100
|
expr: JSXMemberExpression,
|
|
100
|
-
): string | null {
|
|
101
|
+
): string | null => {
|
|
101
102
|
const right = expr.property.name;
|
|
102
103
|
if (expr.object.type === 'JSXIdentifier') {
|
|
103
104
|
return `${expr.object.name}.${right}`;
|
|
104
105
|
}
|
|
106
|
+
|
|
105
107
|
if (expr.object.type === 'JSXMemberExpression') {
|
|
106
108
|
const left = memberExpressionToString(expr.object);
|
|
109
|
+
|
|
107
110
|
return left ? `${left}.${right}` : null;
|
|
108
111
|
}
|
|
112
|
+
|
|
109
113
|
return null;
|
|
110
|
-
}
|
|
114
|
+
};
|
|
@@ -79,6 +79,7 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
79
79
|
root,
|
|
80
80
|
` TODO: codemod could not safely resolve aliased Menu import — manually split into MenuLink / MenuButton.`,
|
|
81
81
|
);
|
|
82
|
+
|
|
82
83
|
return root.toSource({ quote: 'single' });
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -98,6 +99,7 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
98
99
|
` TODO: codemod could not safely resolve spread props — manually choose MenuLink or MenuButton.`,
|
|
99
100
|
);
|
|
100
101
|
hasUnconvertedMenu = true;
|
|
102
|
+
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
105
|
|
|
@@ -121,6 +123,7 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
121
123
|
` TODO: codemod could not safely resolve — manually choose MenuLink or MenuButton.`,
|
|
122
124
|
);
|
|
123
125
|
hasUnconvertedMenu = true;
|
|
126
|
+
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
129
|
|
|
@@ -131,6 +134,7 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
131
134
|
` TODO: codemod could not safely resolve — Menu without href or onClick. Choose MenuLink (add href) or MenuButton (add onClick).`,
|
|
132
135
|
);
|
|
133
136
|
hasUnconvertedMenu = true;
|
|
137
|
+
|
|
134
138
|
return;
|
|
135
139
|
}
|
|
136
140
|
|
|
@@ -147,28 +151,35 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
147
151
|
dsImports.forEach(path => {
|
|
148
152
|
const specifiers = path.node.specifiers ?? [];
|
|
149
153
|
const next: ImportSpecifier[] = [];
|
|
154
|
+
|
|
150
155
|
let touched = false;
|
|
151
156
|
|
|
152
157
|
specifiers.forEach(spec => {
|
|
153
158
|
if (spec.type !== 'ImportSpecifier') {
|
|
154
159
|
next.push(spec as ImportSpecifier);
|
|
160
|
+
|
|
155
161
|
return;
|
|
156
162
|
}
|
|
163
|
+
|
|
157
164
|
if (spec.imported.name !== SOURCE_NAME) {
|
|
158
165
|
next.push(spec);
|
|
166
|
+
|
|
159
167
|
return;
|
|
160
168
|
}
|
|
169
|
+
|
|
161
170
|
// `Menu`를 제거하고 사용된 변형으로 교체.
|
|
162
171
|
touched = true;
|
|
163
172
|
if (hasUnconvertedMenu) {
|
|
164
173
|
// 일부 변환 못한 호출이 남아있어 Menu도 유지가 필요할 수 있음.
|
|
165
174
|
next.push(spec);
|
|
166
175
|
}
|
|
176
|
+
|
|
167
177
|
if (usedMenuLink) {
|
|
168
178
|
next.push(
|
|
169
179
|
j.importSpecifier(j.identifier(LINK_NAME)) as ImportSpecifier,
|
|
170
180
|
);
|
|
171
181
|
}
|
|
182
|
+
|
|
172
183
|
if (usedMenuButton) {
|
|
173
184
|
next.push(
|
|
174
185
|
j.importSpecifier(j.identifier(BUTTON_NAME)) as ImportSpecifier,
|
|
@@ -186,6 +197,7 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
186
197
|
const key = `${importedName}::${localName}`;
|
|
187
198
|
if (seen.has(key)) return false;
|
|
188
199
|
seen.add(key);
|
|
200
|
+
|
|
189
201
|
return true;
|
|
190
202
|
});
|
|
191
203
|
didChange = true;
|
|
@@ -197,17 +209,18 @@ export default function transformer(file: FileInfo, api: API): string {
|
|
|
197
209
|
return root.toSource({ quote: 'single' });
|
|
198
210
|
}
|
|
199
211
|
|
|
200
|
-
|
|
212
|
+
const getJSXName = (node: JSXOpeningElement): string | null => {
|
|
201
213
|
const { name } = node;
|
|
202
214
|
if (name.type === 'JSXIdentifier') return name.name;
|
|
215
|
+
|
|
203
216
|
return null;
|
|
204
|
-
}
|
|
217
|
+
};
|
|
205
218
|
|
|
206
|
-
|
|
219
|
+
const renameJSXElement = (
|
|
207
220
|
j: JSCodeshift,
|
|
208
221
|
path: ASTPath<JSXOpeningElement>,
|
|
209
222
|
newName: string,
|
|
210
|
-
) {
|
|
223
|
+
) => {
|
|
211
224
|
const opening = path.node;
|
|
212
225
|
(opening.name as JSXIdentifier).name = newName;
|
|
213
226
|
|
|
@@ -219,34 +232,35 @@ function renameJSXElement(
|
|
|
219
232
|
(closingName as JSXIdentifier).name = newName;
|
|
220
233
|
}
|
|
221
234
|
}
|
|
222
|
-
}
|
|
235
|
+
};
|
|
223
236
|
|
|
224
|
-
|
|
237
|
+
const addCommentBefore = (
|
|
225
238
|
j: JSCodeshift,
|
|
226
239
|
path: ASTPath<JSXOpeningElement>,
|
|
227
240
|
message: string,
|
|
228
|
-
) {
|
|
241
|
+
) => {
|
|
229
242
|
// JSX element 자체의 부모(보통 JSXElement)를 찾아 그 앞에 코멘트를 삽입.
|
|
230
243
|
let current: ASTPath | null = path;
|
|
231
244
|
while (current && current.node && current.node.type !== 'JSXElement') {
|
|
232
245
|
current = current.parent;
|
|
233
246
|
}
|
|
247
|
+
|
|
234
248
|
if (!current) return;
|
|
235
249
|
|
|
236
250
|
const node = current.node;
|
|
237
251
|
node.comments = node.comments ?? [];
|
|
238
252
|
node.comments.push(j.commentLine(message, true, false));
|
|
239
|
-
}
|
|
253
|
+
};
|
|
240
254
|
|
|
241
|
-
|
|
255
|
+
const addLeadingComment = (
|
|
242
256
|
j: JSCodeshift,
|
|
243
257
|
root: Collection,
|
|
244
258
|
message: string,
|
|
245
|
-
) {
|
|
259
|
+
) => {
|
|
246
260
|
const program = root.get().node.program;
|
|
247
261
|
const body = program.body;
|
|
248
262
|
if (!body || body.length === 0) return;
|
|
249
263
|
const first = body[0];
|
|
250
264
|
first.comments = first.comments ?? [];
|
|
251
265
|
first.comments.push(j.commentLine(message, true, false));
|
|
252
|
-
}
|
|
266
|
+
};
|