Skip to content

Commit d38ef76

Browse files
feat: Allow Box in Row
1 parent 304ada7 commit d38ef76

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { AddressElement } from './Address';
2+
import type { BoxElement } from './Box';
23
import type { ImageElement } from './Image';
34
import type { LinkElement } from './Link';
45
import type { SkeletonElement } from './Skeleton';
@@ -15,7 +16,8 @@ export type RowChildren =
1516
| TextElement
1617
| ValueElement
1718
| LinkElement
18-
| SkeletonElement;
19+
| SkeletonElement
20+
| BoxElement;
1921

2022
/**
2123
* The props of the {@link Row} component.

packages/snaps-sdk/src/jsx/validation.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,11 @@ describe('RowStruct', () => {
14481448
<Row label="label" variant="default" tooltip="This is a tooltip.">
14491449
<Value extra="foo" value="bar" />
14501450
</Row>,
1451+
<Row label="label">
1452+
<Box>
1453+
<Text>Foo</Text>
1454+
</Box>
1455+
</Row>,
14511456
])('validates a row element', (value) => {
14521457
expect(is(value, RowStruct)).toBe(true);
14531458
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ export const RowStruct: Describe<RowElement> = element('Row', {
925925
ValueStruct,
926926
LinkStruct,
927927
SkeletonStruct,
928+
BoxStruct,
928929
]),
929930
variant: optional(
930931
nullUnion([literal('default'), literal('warning'), literal('critical')]),

0 commit comments

Comments
 (0)