Skip to content

Commit a4d14cf

Browse files
committed
fix: remove min, max size from stack components
1 parent 9451ca7 commit a4d14cf

File tree

5 files changed

+47
-122
lines changed

5 files changed

+47
-122
lines changed

packages/react/src/preset/Button/ButtonCatalog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Catalog.register('Button', {
4343
default: 'md',
4444
},
4545
children: {
46-
label: 'Children',
46+
label: 'Text',
4747
type: 'text',
4848
default: 'Button',
4949
},

packages/react/src/preset/HStack/HStack.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ type Props = PropsWithChildren<{
99
alignHorizontal?: 'start' | 'end' | 'center' | 'between' | 'around';
1010
alignVertical?: 'stretch' | 'start' | 'end' | 'center';
1111
flex?: number;
12-
size?: {
13-
width?: number | string;
14-
minWidth?: number | string;
15-
maxWidth?: number | string;
16-
height?: number | string;
17-
minHeight?: number | string;
18-
maxHeight?: number | string;
19-
};
12+
width?: number | string;
13+
height?: number | string;
2014
padding?: { top: number; right: number; bottom: number; left: number };
2115
margin?: { top: number; right: number; bottom: number; left: number };
2216
gap?: number;
@@ -28,10 +22,11 @@ export const HStack: FC<Props> = ({
2822
alignHorizontal,
2923
alignVertical,
3024
flex,
31-
size,
3225
padding,
3326
margin,
3427
gap,
28+
width,
29+
height,
3530
background,
3631
...props
3732
}) => (
@@ -43,12 +38,6 @@ export const HStack: FC<Props> = ({
4338
})}
4439
style={{
4540
flex,
46-
width: size?.width,
47-
minWidth: size?.minWidth,
48-
maxWidth: size?.maxWidth,
49-
height: size?.height,
50-
minHeight: size?.minHeight,
51-
maxHeight: size?.maxHeight,
5241
paddingTop: padding?.top,
5342
paddingBottom: padding?.bottom,
5443
paddingLeft: padding?.left,
@@ -58,6 +47,8 @@ export const HStack: FC<Props> = ({
5847
marginLeft: margin?.left,
5948
marginRight: margin?.right,
6049
gap,
50+
width,
51+
height,
6152
background,
6253
}}
6354
{...props}

packages/react/src/preset/HStack/HStackCatalog.tsx

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,53 +53,19 @@ Catalog.register('HStack', {
5353
type: 'number',
5454
optional: true,
5555
},
56-
background: {
57-
label: 'Background',
58-
type: 'text',
59-
default: '#EEEEEE',
56+
57+
width: {
58+
group: 'Size',
59+
label: 'Width',
60+
type: 'number',
61+
default: 100,
6062
optional: true,
6163
},
62-
size: {
63-
label: 'Size',
64-
type: 'object',
65-
fields: {
66-
width: {
67-
label: 'Width',
68-
type: 'number',
69-
default: 100,
70-
optional: true,
71-
},
72-
minWidth: {
73-
label: 'Min Width',
74-
type: 'number',
75-
optional: true,
76-
},
77-
maxWidth: {
78-
label: 'Max Width',
79-
type: 'number',
80-
optional: true,
81-
},
82-
height: {
83-
label: 'Height',
84-
type: 'number',
85-
default: 100,
86-
optional: true,
87-
},
88-
minHeight: {
89-
label: 'Min Height',
90-
type: 'number',
91-
optional: true,
92-
},
93-
maxHeight: {
94-
label: 'Max Height',
95-
type: 'number',
96-
optional: true,
97-
},
98-
},
99-
default: {
100-
width: 100,
101-
height: 100,
102-
},
64+
height: {
65+
group: 'Size',
66+
label: 'Height',
67+
type: 'number',
68+
default: 100,
10369
optional: true,
10470
},
10571
padding: {
@@ -158,6 +124,12 @@ Catalog.register('HStack', {
158124
},
159125
optional: true,
160126
},
127+
background: {
128+
label: 'Background',
129+
type: 'text',
130+
default: '#EEEEEE',
131+
optional: true,
132+
},
161133
children: {
162134
label: 'Children',
163135
type: 'node',

packages/react/src/preset/VStack/VStack.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ type Props = PropsWithChildren<{
1010
alignVertical?: 'start' | 'end' | 'center' | 'between' | 'around';
1111
flex?: number;
1212
gap?: number;
13-
size?: {
14-
width?: number | string;
15-
minWidth?: number | string;
16-
maxWidth?: number | string;
17-
height?: number | string;
18-
minHeight?: number | string;
19-
maxHeight?: number | string;
20-
};
13+
width?: number | string;
14+
height?: number | string;
2115
padding?: { top: number; right: number; bottom: number; left: number };
2216
margin?: { top: number; right: number; bottom: number; left: number };
2317
background?: string;
@@ -28,9 +22,10 @@ export const VStack: FC<Props> = ({
2822
alignHorizontal,
2923
alignVertical,
3024
flex,
31-
size,
3225
padding,
26+
width,
3327
margin,
28+
height,
3429
gap,
3530
background,
3631
...props
@@ -43,12 +38,6 @@ export const VStack: FC<Props> = ({
4338
})}
4439
style={{
4540
flex,
46-
width: size?.width,
47-
minWidth: size?.minWidth,
48-
maxWidth: size?.maxWidth,
49-
height: size?.height,
50-
minHeight: size?.minHeight,
51-
maxHeight: size?.maxHeight,
5241
paddingTop: padding?.top,
5342
paddingBottom: padding?.bottom,
5443
paddingLeft: padding?.left,
@@ -57,8 +46,10 @@ export const VStack: FC<Props> = ({
5746
marginBottom: margin?.bottom,
5847
marginLeft: margin?.left,
5948
marginRight: margin?.right,
60-
background,
6149
gap,
50+
width,
51+
height,
52+
background,
6253
}}
6354
{...props}
6455
/>

packages/react/src/preset/VStack/VStackCatalog.tsx

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,53 +53,18 @@ Catalog.register('VStack', {
5353
type: 'number',
5454
optional: true,
5555
},
56-
background: {
57-
label: 'Background',
58-
type: 'text',
59-
default: '#EEEEEE',
56+
width: {
57+
group: 'Size',
58+
label: 'Width',
59+
type: 'number',
60+
default: 100,
6061
optional: true,
6162
},
62-
size: {
63-
label: 'Size',
64-
type: 'object',
65-
fields: {
66-
width: {
67-
label: 'Width',
68-
type: 'number',
69-
default: 100,
70-
optional: true,
71-
},
72-
minWidth: {
73-
label: 'Min Width',
74-
type: 'number',
75-
optional: true,
76-
},
77-
maxWidth: {
78-
label: 'Max Width',
79-
type: 'number',
80-
optional: true,
81-
},
82-
height: {
83-
label: 'Height',
84-
type: 'number',
85-
default: 100,
86-
optional: true,
87-
},
88-
minHeight: {
89-
label: 'Min Height',
90-
type: 'number',
91-
optional: true,
92-
},
93-
maxHeight: {
94-
label: 'Max Height',
95-
type: 'number',
96-
optional: true,
97-
},
98-
},
99-
default: {
100-
width: 100,
101-
height: 100,
102-
},
63+
height: {
64+
group: 'Size',
65+
label: 'Height',
66+
type: 'number',
67+
default: 100,
10368
optional: true,
10469
},
10570
padding: {
@@ -158,6 +123,12 @@ Catalog.register('VStack', {
158123
},
159124
optional: true,
160125
},
126+
background: {
127+
label: 'Background',
128+
type: 'text',
129+
default: '#EEEEEE',
130+
optional: true,
131+
},
161132
children: {
162133
label: 'Children',
163134
type: 'node',

0 commit comments

Comments
 (0)