Skip to content

Commit f33a7a2

Browse files
Allow BoxChildStruct
1 parent d38ef76 commit f33a7a2

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

packages/snaps-sdk/src/jsx/components/Row.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
import type { AddressElement } from './Address';
2-
import type { BoxElement } from './Box';
3-
import type { ImageElement } from './Image';
4-
import type { LinkElement } from './Link';
5-
import type { SkeletonElement } from './Skeleton';
6-
import type { TextElement } from './Text';
7-
import type { ValueElement } from './Value';
1+
import type { GenericSnapElement } from '../component';
82
import { createSnapComponent } from '../component';
93

104
/**
115
* The children of a {@link Row} component.
126
*/
13-
export type RowChildren =
14-
| AddressElement
15-
| ImageElement
16-
| TextElement
17-
| ValueElement
18-
| LinkElement
19-
| SkeletonElement
20-
| BoxElement;
7+
export type RowChildren = GenericSnapElement;
218

229
/**
2310
* The props of the {@link Row} component.

packages/snaps-sdk/src/jsx/validation.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -918,15 +918,8 @@ export const BannerStruct: Describe<BannerElement> = element('Banner', {
918918
*/
919919
export const RowStruct: Describe<RowElement> = element('Row', {
920920
label: string(),
921-
children: typedUnion([
922-
AddressStruct,
923-
ImageStruct,
924-
TextStruct,
925-
ValueStruct,
926-
LinkStruct,
927-
SkeletonStruct,
928-
BoxStruct,
929-
]),
921+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
922+
children: lazy(() => BoxChildStruct),
930923
variant: optional(
931924
nullUnion([literal('default'), literal('warning'), literal('critical')]),
932925
),

0 commit comments

Comments
 (0)