@spaced-out/ui-design-system 0.5.21 → 0.5.23
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 +14 -0
- package/lib/components/Input/Input.d.ts +2 -0
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +79 -57
- package/lib/components/Input/Input.module.css +23 -0
- package/lib/components/SearchInput/SearchInput.d.ts +2 -0
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +3 -1
- package/lib/components/Typeahead/Typeahead.d.ts +1 -0
- package/lib/components/Typeahead/Typeahead.d.ts.map +1 -1
- package/lib/components/Typeahead/Typeahead.js +2 -0
- package/mcp/build-mcp-data.js +162 -8
- package/mcp/index.js +709 -1
- package/mcp/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.23](https://github.com/spaced-out/ui-design-system/compare/v0.5.22...v0.5.23) (2025-11-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* rightSlot for input, searchinput and typeahead [GDS-550] ([#433](https://github.com/spaced-out/ui-design-system/issues/433)) ([bad66cd](https://github.com/spaced-out/ui-design-system/commit/bad66cd5247da87409f8214b084c89c0f95353c5))
|
|
11
|
+
|
|
12
|
+
### [0.5.22](https://github.com/spaced-out/ui-design-system/compare/v0.5.21...v0.5.22) (2025-11-12)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add context aware results and utils and types info ([#431](https://github.com/spaced-out/ui-design-system/issues/431)) ([743fecf](https://github.com/spaced-out/ui-design-system/commit/743fecf93625edd13800e345c408343eff773748))
|
|
18
|
+
|
|
5
19
|
### [0.5.21](https://github.com/spaced-out/ui-design-system/compare/v0.5.20...v0.5.21) (2025-11-12)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -7,6 +7,7 @@ type ClassNames = Readonly<{
|
|
|
7
7
|
iconRight?: string;
|
|
8
8
|
wrapper?: string;
|
|
9
9
|
prefixText?: string;
|
|
10
|
+
rightSlotContent?: string;
|
|
10
11
|
}>;
|
|
11
12
|
export declare const EXPONENT_CHARACTER_LIST: string[];
|
|
12
13
|
export declare const INPUT_TYPES: Readonly<{
|
|
@@ -47,6 +48,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
47
48
|
errorText?: string;
|
|
48
49
|
label?: string | React.ReactNode;
|
|
49
50
|
helperText?: string | React.ReactNode;
|
|
51
|
+
rightSlot?: React.ReactNode;
|
|
50
52
|
type?: InputType;
|
|
51
53
|
size?: 'medium' | 'small';
|
|
52
54
|
iconLeftName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAOrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAOlD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KA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M,CAAC;IACvB,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAsWD,eAAO,MAAM,KAAK,EAEb,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -48,6 +48,7 @@ const Input_ = (props, ref) => {
|
|
|
48
48
|
errorText,
|
|
49
49
|
label,
|
|
50
50
|
helperText,
|
|
51
|
+
rightSlot,
|
|
51
52
|
classNames,
|
|
52
53
|
size = 'medium',
|
|
53
54
|
iconLeftName = '',
|
|
@@ -137,7 +138,7 @@ const Input_ = (props, ref) => {
|
|
|
137
138
|
children: '*'
|
|
138
139
|
})]
|
|
139
140
|
})
|
|
140
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
141
142
|
"data-testid": (0, _qa.generateTestId)({
|
|
142
143
|
base: testId,
|
|
143
144
|
slot: 'box'
|
|
@@ -152,73 +153,94 @@ const Input_ = (props, ref) => {
|
|
|
152
153
|
}, classNames?.box),
|
|
153
154
|
onClick: !(disabled || locked) ? onContainerClick : undefined,
|
|
154
155
|
ref: boxRef,
|
|
155
|
-
children:
|
|
156
|
-
|
|
157
|
-
base: testId,
|
|
158
|
-
slot: 'iconLeft'
|
|
159
|
-
}),
|
|
160
|
-
className: (0, _classify.classify)(classNames?.iconLeft),
|
|
161
|
-
name: iconLeftName,
|
|
162
|
-
color: disabled ? 'disabled' : 'secondary',
|
|
163
|
-
size: "small",
|
|
164
|
-
type: iconLeftType
|
|
165
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
|
|
166
|
-
condition: !(0, _isEmpty.default)(prefix),
|
|
156
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ConditionalWrapper.ConditionalWrapper, {
|
|
157
|
+
condition: !!rightSlot,
|
|
167
158
|
wrapper: children => /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
168
|
-
className: _InputModule.default.
|
|
159
|
+
className: _InputModule.default.rightSlotContainer,
|
|
169
160
|
"data-testid": (0, _qa.generateTestId)({
|
|
170
161
|
base: testId,
|
|
171
|
-
slot: '
|
|
162
|
+
slot: 'rightSlotContainer'
|
|
172
163
|
}),
|
|
173
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
174
|
-
className: (0, _classify.classify)(_InputModule.default.
|
|
164
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
165
|
+
className: (0, _classify.classify)(_InputModule.default.rightSlotContent, classNames?.rightSlotContent),
|
|
175
166
|
"data-testid": (0, _qa.generateTestId)({
|
|
176
167
|
base: testId,
|
|
177
|
-
slot: '
|
|
168
|
+
slot: 'rightSlotContainer'
|
|
178
169
|
}),
|
|
179
|
-
|
|
180
|
-
|
|
170
|
+
onClick: e => {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
},
|
|
173
|
+
children: rightSlot
|
|
174
|
+
})]
|
|
181
175
|
}),
|
|
182
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
183
|
-
|
|
176
|
+
children: [iconLeftName && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
177
|
+
testId: (0, _qa.generateTestId)({
|
|
178
|
+
base: testId,
|
|
179
|
+
slot: 'iconLeft'
|
|
180
|
+
}),
|
|
181
|
+
className: (0, _classify.classify)(classNames?.iconLeft),
|
|
182
|
+
name: iconLeftName,
|
|
183
|
+
color: disabled ? 'disabled' : 'secondary',
|
|
184
|
+
size: "small",
|
|
185
|
+
type: iconLeftType
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
|
|
187
|
+
condition: !(0, _isEmpty.default)(prefix),
|
|
188
|
+
wrapper: children => /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
189
|
+
className: _InputModule.default.prefixContainer,
|
|
190
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
191
|
+
base: testId,
|
|
192
|
+
slot: 'prefixContainer'
|
|
193
|
+
}),
|
|
194
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
195
|
+
className: (0, _classify.classify)(_InputModule.default.prefixText, classNames?.prefixText),
|
|
196
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
197
|
+
base: testId,
|
|
198
|
+
slot: 'prefixText'
|
|
199
|
+
}),
|
|
200
|
+
children: prefix
|
|
201
|
+
}), children]
|
|
202
|
+
}),
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
204
|
+
...inputProps,
|
|
205
|
+
"data-testid": (0, _qa.generateTestId)({
|
|
206
|
+
base: testId,
|
|
207
|
+
slot: 'input'
|
|
208
|
+
}),
|
|
209
|
+
disabled: locked || disabled,
|
|
210
|
+
name: name,
|
|
211
|
+
ref: inputRef,
|
|
212
|
+
placeholder: placeholder,
|
|
213
|
+
value: value,
|
|
214
|
+
onChange: onChange,
|
|
215
|
+
onFocus: onFocus,
|
|
216
|
+
onBlur: onBlur,
|
|
217
|
+
type: showPassword ? 'text' : type,
|
|
218
|
+
readOnly: readOnly,
|
|
219
|
+
onKeyDown: handleKeyDown
|
|
220
|
+
})
|
|
221
|
+
}), type === 'color' && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
184
222
|
"data-testid": (0, _qa.generateTestId)({
|
|
185
223
|
base: testId,
|
|
186
|
-
slot: '
|
|
224
|
+
slot: 'colorText'
|
|
187
225
|
}),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
[_InputModule.default.hasValue]: value
|
|
207
|
-
}),
|
|
208
|
-
children: value ? value : placeholder
|
|
209
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(RightInputIcon, {
|
|
210
|
-
testId: testId,
|
|
211
|
-
isEmail: type === 'email',
|
|
212
|
-
isPassword: type === 'password',
|
|
213
|
-
showPassword: showPassword,
|
|
214
|
-
showPasswordToggleIcon: !hidePasswordToggleIcon,
|
|
215
|
-
isLocked: locked,
|
|
216
|
-
isDisabled: disabled,
|
|
217
|
-
onClick: handleRightIconClick,
|
|
218
|
-
iconRightName: iconRightName,
|
|
219
|
-
iconRightType: iconRightType,
|
|
220
|
-
className: classNames?.iconRight
|
|
221
|
-
})]
|
|
226
|
+
className: (0, _classify.classify)(_InputModule.default.colorText, _InputModule.default[size], {
|
|
227
|
+
[_InputModule.default.hasValue]: value
|
|
228
|
+
}),
|
|
229
|
+
children: value ? value : placeholder
|
|
230
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(RightInputIcon, {
|
|
231
|
+
testId: testId,
|
|
232
|
+
isEmail: type === 'email',
|
|
233
|
+
isPassword: type === 'password',
|
|
234
|
+
showPassword: showPassword,
|
|
235
|
+
showPasswordToggleIcon: !hidePasswordToggleIcon,
|
|
236
|
+
isLocked: locked,
|
|
237
|
+
isDisabled: disabled,
|
|
238
|
+
onClick: handleRightIconClick,
|
|
239
|
+
iconRightName: iconRightName,
|
|
240
|
+
iconRightType: iconRightType,
|
|
241
|
+
className: classNames?.iconRight
|
|
242
|
+
})]
|
|
243
|
+
})
|
|
222
244
|
}), (Boolean(helperText) || error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
223
245
|
"data-testid": (0, _qa.generateTestId)({
|
|
224
246
|
base: testId,
|
|
@@ -203,3 +203,26 @@ input::placeholder {
|
|
|
203
203
|
min-width: size18;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
+
|
|
207
|
+
.rightSlotContainer {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
gap: spaceXSmall;
|
|
212
|
+
width: sizeFluid;
|
|
213
|
+
cursor: inherit;
|
|
214
|
+
padding-left: size2;
|
|
215
|
+
overflow-y: auto;
|
|
216
|
+
|
|
217
|
+
& .rightSlotContent {
|
|
218
|
+
color: colorTextTertiary;
|
|
219
|
+
padding: 0 spaceXSmall;
|
|
220
|
+
width: max-content;
|
|
221
|
+
min-width: max-content;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
& input {
|
|
225
|
+
padding-left: spaceNone;
|
|
226
|
+
min-width: size18;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { Flow } from 'flow-to-typescript-codemod';
|
|
2
3
|
import type { InputProps } from '../../components/Input';
|
|
3
4
|
type ClassNames = Readonly<{
|
|
@@ -10,6 +11,7 @@ export interface SearchInputProps extends Omit<InputProps, 'classNames' | 'onCle
|
|
|
10
11
|
onClear?: () => void;
|
|
11
12
|
isLoading?: boolean;
|
|
12
13
|
testId?: string;
|
|
14
|
+
rightSlot?: React.ReactNode;
|
|
13
15
|
}
|
|
14
16
|
export declare const SearchInput: Flow.AbstractComponent<SearchInputProps, HTMLInputElement>;
|
|
15
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAMrD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAMrD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC;IAChE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAC9C,gBAAgB,EAChB,gBAAgB,CAuEjB,CAAC"}
|
|
@@ -25,6 +25,7 @@ const SearchInput = exports.SearchInput = /*#__PURE__*/React.forwardRef((_ref, r
|
|
|
25
25
|
size,
|
|
26
26
|
iconLeftName = 'magnifying-glass',
|
|
27
27
|
testId,
|
|
28
|
+
rightSlot,
|
|
28
29
|
...searchInputProps
|
|
29
30
|
} = _ref;
|
|
30
31
|
const handleClearClick = () => {
|
|
@@ -58,7 +59,8 @@ const SearchInput = exports.SearchInput = /*#__PURE__*/React.forwardRef((_ref, r
|
|
|
58
59
|
testId: (0, _qa.generateTestId)({
|
|
59
60
|
base: testId,
|
|
60
61
|
slot: 'input'
|
|
61
|
-
})
|
|
62
|
+
}),
|
|
63
|
+
rightSlot: rightSlot
|
|
62
64
|
}), isLoading && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
63
65
|
className: (0, _classify.default)(_SearchInputModule.default.loaderContainer, {
|
|
64
66
|
[_SearchInputModule.default.small]: size === 'small'
|
|
@@ -22,6 +22,7 @@ interface BaseTypeaheadProps extends Omit<InputProps, 'classNames' | 'onSelect'
|
|
|
22
22
|
clickAwayRef?: React.RefObject<ClickAwayRefType | null>;
|
|
23
23
|
elevation?: ElevationType;
|
|
24
24
|
testId?: string;
|
|
25
|
+
rightSlot?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
export interface TypeaheadProps extends Omit<BaseTypeaheadProps, 'allowInternalFilter'> {
|
|
27
28
|
allowInternalFilter?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/components/Typeahead/Typeahead.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAKrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAK3D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG/D,OAAO,KAAK,EAAC,aAAa,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AAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;IACvD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAyMD,eAAO,MAAM,SAAS,EAAE,IAAI,CAAC,iBAAiB,CAC5C,cAAc,EACd,gBAAgB,CASjB,CAAC"}
|
|
@@ -37,6 +37,7 @@ const BaseTypeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
37
37
|
clickAwayRef,
|
|
38
38
|
elevation = 'modal',
|
|
39
39
|
testId,
|
|
40
|
+
rightSlot,
|
|
40
41
|
...inputProps
|
|
41
42
|
} = _ref;
|
|
42
43
|
const menuOptions = menu?.options;
|
|
@@ -89,6 +90,7 @@ const BaseTypeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
89
90
|
box: classNames?.box
|
|
90
91
|
},
|
|
91
92
|
isLoading: isLoading,
|
|
93
|
+
rightSlot: rightSlot,
|
|
92
94
|
onChange: e => {
|
|
93
95
|
e.stopPropagation();
|
|
94
96
|
onSearch?.(e);
|
package/mcp/build-mcp-data.js
CHANGED
|
@@ -42,7 +42,34 @@ function getDirectories(path) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Get all files recursively in a directory
|
|
46
|
+
*/
|
|
47
|
+
function getAllFilesRecursively(dirPath, filesList = [], baseDir = dirPath) {
|
|
48
|
+
try {
|
|
49
|
+
const files = readdirSync(dirPath);
|
|
50
|
+
|
|
51
|
+
files.forEach(file => {
|
|
52
|
+
if (file.startsWith('.')) return;
|
|
53
|
+
|
|
54
|
+
const filePath = join(dirPath, file);
|
|
55
|
+
const stat = statSync(filePath);
|
|
56
|
+
|
|
57
|
+
if (stat.isDirectory()) {
|
|
58
|
+
getAllFilesRecursively(filePath, filesList, baseDir);
|
|
59
|
+
} else {
|
|
60
|
+
const relativePath = filePath.replace(baseDir + '/', '');
|
|
61
|
+
filesList.push(relativePath);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
} catch (error) {
|
|
65
|
+
// Ignore errors for non-existent directories
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return filesList;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Extract all components with their files (including sub-components)
|
|
46
73
|
*/
|
|
47
74
|
function buildComponentsData() {
|
|
48
75
|
console.log('📦 Extracting components...');
|
|
@@ -59,24 +86,58 @@ function buildComponentsData() {
|
|
|
59
86
|
for (const componentName of componentDirs) {
|
|
60
87
|
const componentDir = join(componentsPath, componentName);
|
|
61
88
|
|
|
89
|
+
// Get all files in the component directory
|
|
90
|
+
const allFiles = getAllFilesRecursively(componentDir);
|
|
91
|
+
|
|
92
|
+
// Extract main component files
|
|
62
93
|
const mainTsx = join(componentDir, `${componentName}.tsx`);
|
|
63
94
|
const mainTs = join(componentDir, `${componentName}.ts`);
|
|
95
|
+
const mainContent = safeReadFile(mainTsx) || safeReadFile(mainTs);
|
|
64
96
|
|
|
97
|
+
// Extract story files
|
|
65
98
|
const storyTsx = join(componentDir, `${componentName}.stories.tsx`);
|
|
66
99
|
const storyTs = join(componentDir, `${componentName}.stories.ts`);
|
|
100
|
+
const storyContent = safeReadFile(storyTsx) || safeReadFile(storyTs);
|
|
67
101
|
|
|
102
|
+
// Extract CSS file
|
|
68
103
|
const cssFile = join(componentDir, `${componentName}.module.css`);
|
|
104
|
+
const cssContent = safeReadFile(cssFile);
|
|
69
105
|
|
|
106
|
+
// Extract index file
|
|
70
107
|
const indexFile = join(componentDir, 'index.ts');
|
|
71
|
-
|
|
72
|
-
const mainContent = safeReadFile(mainTsx) || safeReadFile(mainTs);
|
|
73
|
-
const storyContent = safeReadFile(storyTsx) || safeReadFile(storyTs);
|
|
74
|
-
const cssContent = safeReadFile(cssFile);
|
|
75
108
|
const indexContent = safeReadFile(indexFile);
|
|
76
109
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
110
|
+
// Extract all additional TypeScript/TSX files (sub-components)
|
|
111
|
+
const additionalFiles = {};
|
|
112
|
+
for (const file of allFiles) {
|
|
113
|
+
// Skip main files we already extracted
|
|
114
|
+
if (
|
|
115
|
+
file === `${componentName}.tsx` ||
|
|
116
|
+
file === `${componentName}.ts` ||
|
|
117
|
+
file === `${componentName}.stories.tsx` ||
|
|
118
|
+
file === `${componentName}.stories.ts` ||
|
|
119
|
+
file === `${componentName}.module.css` ||
|
|
120
|
+
file === 'index.ts' ||
|
|
121
|
+
file.endsWith('.module.css') ||
|
|
122
|
+
file.endsWith('.stories.tsx') ||
|
|
123
|
+
file.endsWith('.stories.ts') ||
|
|
124
|
+
file.endsWith('.stories.module.css')
|
|
125
|
+
) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Only include .tsx and .ts files (sub-components)
|
|
130
|
+
if (file.endsWith('.tsx') || file.endsWith('.ts')) {
|
|
131
|
+
const fullPath = join(componentDir, file);
|
|
132
|
+
const content = safeReadFile(fullPath);
|
|
133
|
+
if (content) {
|
|
134
|
+
additionalFiles[file] = {
|
|
135
|
+
path: file,
|
|
136
|
+
content: content
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
80
141
|
|
|
81
142
|
components[componentName] = {
|
|
82
143
|
name: componentName,
|
|
@@ -86,6 +147,7 @@ function buildComponentsData() {
|
|
|
86
147
|
story: storyContent ? { path: `${componentName}.stories.tsx`, content: storyContent } : null,
|
|
87
148
|
css: cssContent ? { path: `${componentName}.module.css`, content: cssContent } : null,
|
|
88
149
|
index: indexContent ? { path: 'index.ts', content: indexContent } : null,
|
|
150
|
+
additional: additionalFiles,
|
|
89
151
|
},
|
|
90
152
|
allFiles,
|
|
91
153
|
};
|
|
@@ -190,6 +252,94 @@ function buildTokensData() {
|
|
|
190
252
|
return tokens;
|
|
191
253
|
}
|
|
192
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Extract all utils
|
|
257
|
+
*/
|
|
258
|
+
function buildUtilsData() {
|
|
259
|
+
console.log('🔧 Extracting utils...');
|
|
260
|
+
const utilsPath = join(DESIGN_SYSTEM_PATH, 'src/utils');
|
|
261
|
+
const utils = {};
|
|
262
|
+
|
|
263
|
+
if (!existsSync(utilsPath)) {
|
|
264
|
+
console.warn('⚠️ Utils path not found');
|
|
265
|
+
return utils;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const utilDirs = getDirectories(utilsPath);
|
|
269
|
+
|
|
270
|
+
for (const utilName of utilDirs) {
|
|
271
|
+
const utilDir = join(utilsPath, utilName);
|
|
272
|
+
|
|
273
|
+
// Get all files in the util directory
|
|
274
|
+
const allFiles = getAllFilesRecursively(utilDir);
|
|
275
|
+
|
|
276
|
+
// Read all TypeScript files
|
|
277
|
+
const files = {};
|
|
278
|
+
for (const file of allFiles) {
|
|
279
|
+
if ((file.endsWith('.ts') || file.endsWith('.tsx')) && !file.endsWith('.d.ts')) {
|
|
280
|
+
const fullPath = join(utilDir, file);
|
|
281
|
+
const content = safeReadFile(fullPath);
|
|
282
|
+
if (content) {
|
|
283
|
+
files[file] = {
|
|
284
|
+
path: file,
|
|
285
|
+
content: content
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
utils[utilName] = {
|
|
292
|
+
name: utilName,
|
|
293
|
+
path: `src/utils/${utilName}`,
|
|
294
|
+
files: files,
|
|
295
|
+
allFiles: allFiles,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
console.log(` ✅ Extracted ${Object.keys(utils).length} util modules`);
|
|
300
|
+
return utils;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Extract all types
|
|
305
|
+
*/
|
|
306
|
+
function buildTypesData() {
|
|
307
|
+
console.log('📐 Extracting types...');
|
|
308
|
+
const typesPath = join(DESIGN_SYSTEM_PATH, 'src/types');
|
|
309
|
+
const types = {};
|
|
310
|
+
|
|
311
|
+
if (!existsSync(typesPath)) {
|
|
312
|
+
console.warn('⚠️ Types path not found');
|
|
313
|
+
return types;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
try {
|
|
317
|
+
const files = readdirSync(typesPath).filter(f =>
|
|
318
|
+
!f.startsWith('.') &&
|
|
319
|
+
(f.endsWith('.ts') || f.endsWith('.tsx')) &&
|
|
320
|
+
!f.endsWith('.d.ts')
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
for (const file of files) {
|
|
324
|
+
const filePath = join(typesPath, file);
|
|
325
|
+
const content = safeReadFile(filePath);
|
|
326
|
+
if (content) {
|
|
327
|
+
const typeName = file.replace(/\.(ts|tsx)$/, '');
|
|
328
|
+
types[typeName] = {
|
|
329
|
+
name: typeName,
|
|
330
|
+
path: `src/types/${file}`,
|
|
331
|
+
content: content,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
} catch (error) {
|
|
336
|
+
console.warn(` ⚠️ Error reading types:`, error.message);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
console.log(` ✅ Extracted ${Object.keys(types).length} type files`);
|
|
340
|
+
return types;
|
|
341
|
+
}
|
|
342
|
+
|
|
193
343
|
/**
|
|
194
344
|
* Get package version
|
|
195
345
|
*/
|
|
@@ -217,6 +367,8 @@ function build() {
|
|
|
217
367
|
components: buildComponentsData(),
|
|
218
368
|
hooks: buildHooksData(),
|
|
219
369
|
tokens: buildTokensData(),
|
|
370
|
+
utils: buildUtilsData(),
|
|
371
|
+
types: buildTypesData(),
|
|
220
372
|
};
|
|
221
373
|
|
|
222
374
|
// Create output directory if it doesn't exist
|
|
@@ -232,6 +384,8 @@ function build() {
|
|
|
232
384
|
console.log(` - Components: ${Object.keys(data.components).length}`);
|
|
233
385
|
console.log(` - Hooks: ${Object.keys(data.hooks).length}`);
|
|
234
386
|
console.log(` - Token categories: ${Object.keys(data.tokens).length}`);
|
|
387
|
+
console.log(` - Utils: ${Object.keys(data.utils).length}`);
|
|
388
|
+
console.log(` - Types: ${Object.keys(data.types).length}`);
|
|
235
389
|
console.log(` - Version: ${data.metadata.version}`);
|
|
236
390
|
console.log(` - Output: ${OUTPUT_FILE}`);
|
|
237
391
|
console.log(` - Size: ${(Buffer.byteLength(JSON.stringify(data)) / 1024 / 1024).toFixed(2)} MB\n`);
|